:root {
  --teal: #1f4d3a;
  --teal-deep: #16382b;
  --gold: #e7c7a1;
  --ink: #eceae6;
  --muted: #9aa3ad;
  --line: #2a3038;
  --panel: #14181f;
  --bg: #0c0e12;
  --danger: #f0b4ae;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

body.shell {
  min-height: 100vh;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 520px at 8% -12%, rgba(231, 199, 161, .14), transparent 58%),
    radial-gradient(720px 360px at 100% -8%, rgba(231, 199, 161, .07), transparent 55%),
    var(--bg);
}
body.shell button:focus-visible,
body.shell a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.shell-top {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  background: rgba(12, 14, 18, .88);
  border-bottom: 1px solid #232830;
  backdrop-filter: blur(14px);
}
.logo {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #e7c7a1;
  color: #1c1917;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .06em;
}
.shell-top .title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .08em;
}
.shell-nav { display: flex; gap: 4px; flex: 1; }
.shell-nav button {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b7bec7;
  font-size: 14px;
}
.shell-nav button:hover { background: #1a1f27; color: #f5f5f4; }
.shell-nav button.active,
.shell-nav button.active:hover {
  background: #e7c7a1;
  color: #1c1917;
}
.shell-top .right { margin-left: auto; }
.user-menu { position: relative; }
.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
}
.user-trigger:hover,
.user-trigger[aria-expanded="true"] { background: #1a1f27; }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #243028;
  color: #f6f1e8;
  font-weight: 650;
  font-size: 13px;
}
#whoName { color: #d6d3d1; font-size: 13px; }
.user-drop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 148px;
  padding: 6px;
  background: #1b2129;
  border: 1px solid #2e3640;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  z-index: 30;
}
.user-drop[hidden] { display: none !important; }
.user-drop button {
  display: block;
  width: 100%;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #f0b4ae;
  text-align: left;
  padding: 0 12px;
}
.user-drop button:hover { background: #262d37; }

.page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 28px 64px;
}
.view { display: none; }
.view.active { display: block; }
.page-title { margin-bottom: 18px; }
.page-title h2,
.block-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.02em;
}
.sub, .hint, .muted { color: var(--muted); }

.block,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
  margin-bottom: 14px;
}
.block { padding: 18px 18px 16px; }
.block-head { margin-bottom: 12px; }
.card-h {
  padding: 14px 18px 0;
  font-size: 16px;
  font-weight: 650;
}
.card-b { padding: 14px 18px 18px; }

.scan-row,
.filters,
.form-grid,
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.line-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 10px;
}
.line-field label {
  flex: none;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.line-field input,
.line-field select { flex: 1; min-width: 0; width: auto; }
.line-field .ghost { flex: none; width: auto; }
.pair-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.pair-row .line-field { min-width: 0; margin-top: 0; }
.pair-row .line-field label { width: 4.5em; }
.block-btn { width: 100%; margin-top: 10px; }
.field.grow { flex: 1; min-width: 220px; }
.field label { font-size: 12px; color: var(--muted); }
.field input,
.field select,
.field textarea,
.line-field input,
.line-field select,
.qty-grid input,
#copyFallbackText {
  height: 36px;
  border-radius: 8px;
  background: #0e1116;
  border: 1px solid #2c333c;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}
.field textarea,
#copyFallbackText {
  height: auto;
  min-height: 120px;
  padding: 8px 10px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.line-field input:focus,
.line-field select:focus,
.qty-grid input:focus,
#copyFallbackText:focus {
  outline: none;
  border-color: var(--gold);
}
.field input[type="file"],
.line-field input[type="file"] { padding: 4px 8px; font-size: 12px; }
.field input[type="date"] { color-scheme: dark; }

body.shell .go,
body.shell .ghost,
body.shell .btn {
  height: 36px;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .02em;
  white-space: nowrap;
}
body.shell .go,
body.shell .btn:not(.ghost):not(.danger) {
  border: 0;
  background: #e7c7a1;
  color: #1c1917;
  box-shadow: none;
}
body.shell .go:hover,
body.shell .btn:not(.ghost):not(.danger):hover { background: #f0d7b8; }
body.shell .ghost,
body.shell .btn.ghost {
  background: #12151a;
  border: 1px solid #343b46;
  color: #e7e5e4;
  box-shadow: none;
}
body.shell .ghost:hover,
body.shell .btn.ghost:hover {
  background: #1c222b;
  border-color: #4b5563;
}
body.shell .btn.sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
}
body.shell .btn.danger,
body.shell .btn.sm.danger {
  color: #f0b4ae;
  background: #2a1616;
  border: 1px solid #6b3030;
  box-shadow: none;
}

.banner {
  background: #14181f;
  border: 1px solid #3a3224;
  color: var(--gold);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  line-height: 1.6;
}
.banner button {
  border: 0;
  background: none;
  color: #f6f1e8;
  font-weight: 700;
  padding: 0;
  text-decoration: underline;
}

.summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: #12151a;
  border: 1px solid #2a3038;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 12px 0;
}
.summary .text { color: var(--gold); }
.summary .actions,
.ops { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th,
table.data td {
  padding: 12px 10px;
  border-bottom: 1px solid #232830;
  text-align: left;
  vertical-align: middle;
}
table.data th {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .04em;
  color: #9aa3ad;
  background: #12151a;
  white-space: nowrap;
}
table.data tbody tr:hover td { background: #1a1f27; }
table.data tr.picked td { background: rgba(31, 77, 58, .28); }
.prod { color: #d7efe4; }
input[type="checkbox"] { accent-color: #e7c7a1; width: 16px; height: 16px; }
.check-label { display: none; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 650;
}
.badge.yes {
  background: rgba(31, 77, 58, .35);
  color: #d7efe4;
  border: 1px solid rgba(31, 77, 58, .7);
}
.badge.no {
  background: #262b33;
  color: #c5ccd4;
  border: 1px solid #3a414c;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.empty { padding: 28px 10px; text-align: center; color: var(--muted); }

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #161b22;
  color: #f6f1e8;
  border: 1px solid #2a3038;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 420px;
  z-index: 80;
  display: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.toast.show { display: block; }
.toast.bad { border-color: #6b3030; color: #f0b4ae; }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 12, .62);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 16px;
}
.modal-mask.show { display: flex; }
.modal {
  width: min(860px, 100%);
  max-height: calc(100vh - 32px);
  background: #161b22;
  color: var(--ink);
  border: 1px solid #2a3038;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
}
.modal header,
.modal footer {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.modal header { border-bottom: 1px solid #2a3038; font-weight: 650; }
.modal footer { border-top: 1px solid #2a3038; justify-content: flex-end; }
.modal .body { padding: 14px 16px; overflow: auto; }
.order {
  border: 1px solid #2a3038;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #12151a;
}
.order-head { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.log-remark,
.log-sum,
.log-products {
  background: #0e1116;
  border: 1px solid #2a3038;
  border-radius: 8px;
  margin: 0 0 8px;
}
.log-remark { padding: 8px 10px; border-left: 3px solid #6b7280; }
.log-sum { padding: 8px 10px; border-left: 3px solid #e7c7a1; }
.log-kicker { color: var(--muted); font-size: 12px; font-weight: 650; }
.log-remark-text,
.log-sum-text {
  display: block;
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #f0b4ae;
  font-weight: 700;
  line-height: 1.45;
}
.log-sum .log-kicker,
.log-sum .log-sum-text { display: inline; margin-top: 0; }
.log-note { margin-top: 4px; color: #e7c7a1; font-size: 12px; }
.log-products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 6px;
  padding: 10px 8px;
}
.count-item { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.count-name {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid #3a414c;
  border-radius: 8px;
  overflow: hidden;
  background: #14181f;
}
.step-minus,
.step-plus {
  flex: 0 0 22px;
  width: 22px;
  border: 0;
  background: #1c222b;
  color: #d6d3d1;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.step-minus { border-right: 1px solid #3a414c; }
.step-plus { border-left: 1px solid #3a414c; }
.step-minus::before { content: "−"; }
.step-plus::before { content: "+"; }
.step-input {
  flex: 1;
  min-width: 0;
  width: auto;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font-weight: 700;
  padding: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}
.step-input::-webkit-outer-spin-button,
.step-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.count-item.is-on .stepper { border-color: rgba(220, 80, 80, .7); background: #2a1616; }
.count-item.is-on .step-minus,
.count-item.is-on .step-plus { background: #3a1c1c; color: #f0b4ae; }
.count-item.is-on .step-minus { border-right-color: rgba(220, 80, 80, .35); }
.count-item.is-on .step-plus { border-left-color: rgba(220, 80, 80, .35); }
.count-item.is-on .step-input,
.count-item.is-on .count-name { color: #f0b4ae; }
.log-raw pre {
  white-space: pre-wrap;
  background: #0e1116;
  border-radius: 8px;
  padding: 8px;
  margin: 0;
  font-family: inherit;
  color: var(--ink);
}
.tag { font-size: 12px; color: #f3d7a1; margin-left: 6px; }
.log-raw { margin-top: 8px; }
.log-raw summary { cursor: pointer; color: var(--gold); }

.bottom-nav { display: none; }

body.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1c1917;
  background: #fff;
}
.brand {
  position: relative;
  color: #fff;
  padding: 72px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(900px 520px at 18% 18%, rgba(255, 255, 255, .16), transparent 55%),
    linear-gradient(165deg, #3a342c 0%, #1c1917 48%, #14120f 100%);
}
.mark {
  align-self: flex-start;
  width: 84px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: .04em;
  background: #e7c7a1;
  color: #1c1917;
  border: 0;
}
.brand h1 { margin: 28px 0 8px; font-size: 40px; letter-spacing: 1px; }
.slogan { margin: 0; color: rgba(255, 255, 255, .82); letter-spacing: 2px; }
.brand ul { margin: 36px 0 0; padding: 0; list-style: none; }
.brand li { position: relative; padding: 8px 0 8px 16px; color: rgba(255, 255, 255, .9); }
.brand li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
}
.panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.form { width: min(420px, 100%); }
.form h2 { margin: 0; font-size: 28px; }
.lead { margin: 8px 0 28px; color: #78716c; font-size: 14px; }
.tabs { display: flex; gap: 28px; border-bottom: 1px solid #e7e5e4; margin-bottom: 22px; }
.tabs button {
  border: 0;
  background: transparent;
  padding: 10px 0 12px;
  color: #667182;
  font-size: 15px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button.active { color: #1f4d3a; border-bottom-color: #1f4d3a; font-weight: 650; }
.gate .field { position: relative; margin-bottom: 14px; min-width: 0; }
.gate .field svg.icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #9aa3af;
}
.gate .field input {
  width: 100%;
  height: 46px;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  background: #f7f9fb;
  color: #1c1917;
  padding: 0 42px;
  font-size: 15px;
}
.gate .field input:focus {
  outline: none;
  border-color: #1f4d3a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 77, 58, .12);
}
.eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #9aa3af;
  width: 34px;
  height: 34px;
}
.gate .go {
  width: 100%;
  height: 46px;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  background: #1c1917;
  color: #f6f1e8;
  font-size: 16px;
  letter-spacing: 4px;
}
.gate .go:hover { background: #292524; }
.err { min-height: 22px; margin: 10px 0 0; color: #d14343; font-size: 13px; }

@media (max-width: 980px) {
  .shell-top { padding: 0 14px; gap: 10px; }
  .page { padding: 18px 14px 88px; }
}

@media (max-width: 768px) {
  body.shell .shell-nav { display: none !important; }
  body.shell .bottom-nav {
    display: grid;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    grid-template-columns: repeat(3, 1fr);
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(12, 14, 18, .96);
    border-top: 1px solid #2a3038;
    backdrop-filter: blur(12px);
  }
  body.shell .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: #8b939c;
    font-size: 11px;
    font-weight: 600;
    height: 58px;
    letter-spacing: .02em;
    box-shadow: none;
  }
  body.shell .bottom-nav button::before {
    content: "";
    width: 22px;
    height: 22px;
    background: currentColor;
    -webkit-mask: var(--ico) center / contain no-repeat;
    mask: var(--ico) center / contain no-repeat;
  }
  body.shell .bottom-nav button[data-view="stat"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 19h4V9H4zm6 0h4V5h-4zm6 0h4v-7h-4z'/%3E%3C/svg%3E"); }
  body.shell .bottom-nav button[data-view="product"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 7.5 12 4l8 3.5v9L12 20l-8-3.5zm8 2.2 5.2-2.3L12 5.2 6.8 7.4zm-6 1.5 5 2.2v6.2l-5-2.2zm7 8.4v-6.2l5-2.2v6.2z'/%3E%3C/svg%3E"); }
  body.shell .bottom-nav button[data-view="token"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8.5 13.5a4.5 4.5 0 1 1 3.8-6.9L21 8.2v3h-2v2h-2v2h-3.2l-1.2-1.2a4.5 4.5 0 0 1-4.1-.5zM8.5 8.5a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z'/%3E%3C/svg%3E"); }
  body.shell .bottom-nav button[data-view="admin"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 6h16v2H4zm0 5h16v2H4zm0 5h10v2H4z'/%3E%3C/svg%3E"); }
  body.shell.is-admin .bottom-nav { grid-template-columns: repeat(4, 1fr); }
  body.shell .bottom-nav button.active { color: #e7c7a1; background: transparent; }
  body.shell .shell-top { height: 56px; padding: 0 12px; }
  body.shell .shell-top .title { font-size: 14px; letter-spacing: 0; }
  body.shell #whoName { display: none; }
  body.shell .page { padding: 14px 12px 96px; max-width: none; }
  body.shell .page-title h2 { font-size: 20px; }
  body.shell .pair-row,
  body.shell .line-field { flex-direction: row; align-items: center; }
  body.shell .line-field label { font-size: 12px; }
  #view-product table.data { table-layout: fixed; }
  #view-product th:first-child,
  #view-product td:first-child { width: 64px; }
  #view-product th:last-child,
  #view-product td.ops { width: 188px; }
  #view-product .ops { flex-wrap: nowrap; gap: 4px; }
  #view-product .btn.sm { padding: 0 6px; }
  #view-product td.alias-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #view-stat .table-wrap { overflow: visible; }
  #view-stat table.data,
  #view-stat table.data thead,
  #view-stat table.data tbody { display: block; width: 100%; }
  #view-stat table.data thead th { display: none; }
  #view-stat table.data thead tr { display: flex; }
  #view-stat table.data th.check-col {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    padding: 0 2px 8px;
    background: transparent;
    letter-spacing: 0;
  }
  #view-stat .check-label { display: inline; color: var(--muted); font-size: 13px; font-weight: 500; }
  #view-stat table.data tr {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    grid-template-areas:
      "check code badge"
      "check who who"
      "check qty qty"
      "prod prod prod"
      "ops ops ops";
    gap: 6px 8px;
    margin: 0 0 10px;
    padding: 12px;
    border: 1px solid #2a3038;
    border-radius: 12px;
    background: #12151a;
  }
  #view-stat table.data tr.picked {
    border-color: rgba(231, 199, 161, .55);
    background: rgba(231, 199, 161, .08);
  }
  #view-stat table.data td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  #view-stat table.data td:nth-child(1) { grid-area: check; padding-top: 2px; }
  #view-stat table.data td:nth-child(2) {
    grid-area: code;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: .02em;
  }
  #view-stat table.data td:nth-child(3) { grid-area: who; color: var(--muted); }
  #view-stat table.data td:nth-child(3):empty { display: none; }
  #view-stat table.data td:nth-child(4) { grid-area: qty; color: var(--ink); }
  #view-stat table.data td:nth-child(4)::before { content: "数量 "; }
  #view-stat table.data td:nth-child(5) {
    grid-area: prod;
    white-space: normal;
    line-height: 1.5;
  }
  #view-stat table.data td:nth-child(6) { grid-area: badge; justify-self: end; }
  #view-stat table.data td.ops {
    grid-area: ops;
    display: flex;
    gap: 8px;
  }
  #view-stat table.data td.ops .btn {
    flex: 1;
    height: 36px;
    min-width: 0;
  }
  #view-stat .badge { white-space: nowrap; display: inline-block; }
  #view-stat table.data tbody tr:hover td,
  #view-stat table.data tr.picked td { background: transparent; }
  body.shell .scan-row,
  body.shell .filters,
  body.shell .form-grid,
  body.shell .btn-row {
    flex-direction: column;
    align-items: stretch;
  }
  body.shell .field,
  body.shell .field.grow,
  body.shell .scan-row .go,
  body.shell .scan-row .ghost,
  body.shell .filters .go,
  body.shell .btn-row .go,
  body.shell .btn-row .ghost { width: 100%; min-width: 0; }
  body.shell .summary { flex-direction: column; align-items: stretch; }
  body.shell .summary .actions .btn,
  body.shell .summary .actions .go { flex: 1; }
  body.shell .pager { flex-wrap: wrap; }
  body.shell .modal { width: 100%; max-height: calc(100vh - 16px); }
  #logMask { padding: 8px; align-items: stretch; }
  #logMask .modal { height: calc(100vh - 16px); }
  body.shell .modal footer { flex-wrap: wrap; }
  body.shell .modal footer .btn,
  body.shell .modal footer .go,
  body.shell .modal footer .ghost { flex: 1; }
  body.shell .toast { left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); max-width: none; }
  body.gate { grid-template-columns: 1fr; }
  .brand { padding: 36px 24px 28px; }
  .brand h1 { font-size: 30px; margin-top: 16px; }
  .brand ul { margin-top: 16px; }
  .panel { padding: 28px 20px 48px; }
  #adminTable { min-width: 0; }
  #adminTable thead { display: none; }
  #adminTable,
  #adminTable tbody { display: block; }
  #adminTable tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin: 0 0 10px;
    padding: 12px;
    border: 1px solid #2a3038;
    border-radius: 12px;
    background: #12151a;
  }
  #adminTable td {
    display: block;
    border: 0;
    padding: 0;
    background: transparent;
  }
  #adminTable td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: #8b939c;
    font-size: 11px;
  }
  #adminTable td.span { grid-column: 1 / -1; }
  .admin-summary { align-items: stretch; }
  .admin-summary .ghost { width: 100%; }
}

.req { margin-left: 2px; color: #e7c7a1; }
.pick-box { position: relative; flex: 1; min-width: 0; }
.pick-trigger { width: 100%; text-align: left; }
.picker-panel {
  position: absolute;
  z-index: 12;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  padding: 10px;
  background: #1b2129;
  border: 1px solid #2a3038;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
.picker-tools { display: flex; gap: 6px; }
.picker-tools input { flex: 1; min-width: 0; }
.picker-tools .ghost { width: auto; padding: 0 10px; }
.picker-list { overflow: auto; display: grid; gap: 6px; }
.picker-list label { display: flex; align-items: center; gap: 8px; color: #f5f2ec; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #2a241c;
  color: #e7c7a1;
  font-size: 13px;
}
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; }
.admin-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 12px;
  color: #d6d3cd;
}
.admin-summary b { color: #e7c7a1; font-weight: 700; }
