:root {
  --ink: #080d10;
  --muted: #5c656c;
  --line: #e6e2dc;
  --paper: #f4f1ec;
  --card: #ffffff;
  --navy: #080d10;
  --navy-2: #14181b;
  --blue: #ff7a00;
  --blue-ink: #ffffff;
  --danger: #c0392b;
  --good: #1e8a55;
  --side: #080d10;
  --side-ink: #f4f1ec;
  --shadow: 0 8px 24px rgba(8, 13, 16, 0.06);
  --sans: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; overflow-x: hidden; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(255, 122, 0, 0.08), transparent 55%),
    radial-gradient(720px 380px at 100% 0%, rgba(8, 13, 16, 0.06), transparent 50%),
    var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
}
body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(40px);
}
body::before {
  width: 420px;
  height: 420px;
  left: -80px;
  top: -60px;
  background: rgba(255, 122, 0, 0.16);
  animation: drift 18s ease-in-out infinite;
}
body::after {
  width: 360px;
  height: 360px;
  right: -70px;
  bottom: 8%;
  background: rgba(8, 13, 16, 0.08);
  animation: drift 22s ease-in-out infinite reverse;
}
#app { position: relative; z-index: 1; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: rgba(255, 122, 0, 0.18); }
#shop { position: relative; z-index: 1; }
h1, h2 { font-weight: 500; letter-spacing: -0.03em; }
h1 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; color: var(--navy); }
h2 { margin: 0; font-size: 16px; line-height: 1.25; color: var(--navy); }

.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}
.gate-brand {
  color: var(--side-ink);
  background:
    radial-gradient(480px 240px at 18% 88%, rgba(255, 122, 0, 0.18), transparent 62%),
    var(--navy);
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.gate-brand::before {
  content: "";
  position: absolute;
  inset: -40% auto -40% -30%;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: shine 7s ease-in-out infinite;
  pointer-events: none;
}
.gate-brand > * { position: relative; z-index: 1; }
.mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 13px;
}
.mark i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-style: normal;
  box-shadow: 0 0 0 0 rgba(255, 122, 0, 0.5);
  animation: pulse 2.8s ease-out infinite;
}
.mode-box { display: grid; gap: 6px; }
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}
.mode-btn {
  border: 0;
  border-radius: 8px;
  padding: 8px 6px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  color: #9c9a94;
  cursor: pointer;
}
.mode-btn.active { background: var(--blue); color: #fff; }
.mode-btn[data-mode="pro"].active { background: #d4b45a; color: #080d10; }
.mode-hint {
  margin: 0 4px;
  font-size: 11px;
  color: #9c9a94;
  line-height: 1.35;
}
.nav-item.locked { opacity: 0.55; }
.nav-lock {
  margin-left: auto;
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #d4b45a;
}
.side.is-pro {
  background:
    radial-gradient(180px 80px at 20% 0%, rgba(212, 180, 90, 0.22), transparent 70%),
    var(--navy);
}
.gate-brand h1 { max-width: 14ch; color: #fff; }
.gate-brand p { max-width: 38ch; color: #b8b6b0; font-size: 15px; line-height: 1.4; }
.gate-form {
  display: grid;
  align-content: center;
  padding: 32px 40px;
  gap: 6px;
  background: #fff;
  animation: rise 0.55s ease both;
}
.gate-form h2 { margin-bottom: 4px; }
.gate-tool {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  max-width: 38ch;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.gate-tool:hover { background: rgba(255, 122, 0, 0.35); border-color: rgba(255, 255, 255, 0.28); }
.gate-tool-ico {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
}
.gate-tool-ico svg { width: 22px; height: 22px; }
.gate-tool strong { display: block; font-size: 14px; }
.gate-tool small { display: block; margin-top: 2px; color: #b8b6b0; font-size: 12px; line-height: 1.35; }
.video-card { margin: 0; min-width: 0; }
.video-card h2 { margin: 0 0 8px; font-size: 14px; }
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1220;
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-open { display: inline-block; margin-top: 8px; font-size: 13px; }
.gate-brand .video-card { margin-top: 14px; max-width: 420px; }
.gate-brand .video-card h2 { color: #fff; }
.gate-brand .video-open { color: #d0cdc6; }
.shop-video { margin: 0 0 20px; max-width: 560px; }
.shop-video h2 { color: var(--navy); }
.shop-video .video-open { color: var(--muted); }
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}
.chip {
  display: grid;
  gap: 2px;
  text-align: left;
  border: 1px solid var(--line);
  background: #f7f4ef;
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--navy);
  font-weight: 600;
  font-size: 13px;
}
.chip small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; line-height: 1.3; }
.chip:hover { border-color: #ffd2a8; background: #fff4ea; }
.gate:has(.plan-form),
.gate:has(.install-form) {
  grid-template-columns: minmax(0, 0.7fr) minmax(420px, 1.3fr);
}
.plan-form,
.install-form { align-content: start; overflow: auto; }
.install-form .actions { flex-wrap: wrap; }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.plan-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 14px;
  background: #fff;
  display: grid;
  gap: 8px;
  align-content: start;
}
.plan-card.is-free { box-shadow: inset 0 0 0 1px rgba(255, 122, 0, 0.12); }
.plan-card.is-on { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.15); }
.plan-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.plan-price { margin: 0; font-size: 22px; font-weight: 700; color: var(--navy); }
.plan-price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.plan-perks, .plan-limits { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.plan-perks li { color: var(--ink); font-size: 13px; }
.plan-limits { color: var(--danger); }
.plan-limits li { font-size: 13px; font-weight: 600; }
@media (max-width: 980px) {
  .gate:has(.plan-form),
  .gate:has(.install-form) { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
}
.gate-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 8px 0 0;
}
.gate-links a {
  color: var(--blue);
  font-weight: 600;
  font-size: 13px;
}

.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.side {
  background:
    radial-gradient(180px 80px at 20% 0%, rgba(255, 122, 0, 0.16), transparent 70%),
    var(--navy);
  color: var(--side-ink);
  padding: 14px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.menu { display: flex; flex-direction: column; gap: 1px; min-height: 0; overflow: auto; }
.nav-label {
  margin: 10px 8px 3px;
  color: #9c9a94;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1.2;
}
.menu > .nav-label:first-child { margin-top: 0; }
.nav-item, .quiet {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #e4e1da;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.nav-step {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
}
.nav-item.active .nav-step { background: rgba(255, 255, 255, 0.3); }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; transform: none; }
.nav-item.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 122, 0, 0.35);
  transform: none;
}
.who {
  margin-top: auto;
  padding: 10px 8px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.who strong { display: block; font-weight: 600; font-size: 13px; line-height: 1.25; }
.who span { color: #9c9a94; font-size: 11px; line-height: 1.25; }
.quiet { color: #d0cdc6; margin-top: 4px; padding-left: 0; }

.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--paper); }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  animation: fade 0.5s ease both;
}
main { padding: 10px 24px 32px; min-width: 0; }
#main.portal-main {
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
}
.portal-frame {
  flex: 1;
  width: 100%;
  border: 0;
  min-height: calc(100dvh - 56px);
  background: #e7e0d6;
}
.page-head { margin: 2px 0 12px; animation: rise 0.45s ease both; }
.lede { margin: 4px 0 0; color: var(--muted); max-width: 62ch; font-size: 13px; line-height: 1.35; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  animation: rise 0.5s ease both;
}
.card:hover, .panel:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(8, 13, 16, 0.08);
  border-color: #ddd6cc;
}
.stat { padding: 12px; position: relative; }
.stat::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), #ffb56a);
  transform: scaleX(0.22);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.card.stat:hover::after { transform: scaleX(1); }
.grid .card:nth-child(1) { animation-delay: 0.04s; }
.grid .card:nth-child(2) { animation-delay: 0.08s; }
.grid .card:nth-child(3) { animation-delay: 0.12s; }
.grid .card:nth-child(4) { animation-delay: 0.16s; }
.grid .card:nth-child(5) { animation-delay: 0.2s; }
.grid .card:nth-child(6) { animation-delay: 0.24s; }
.grid .card:nth-child(7) { animation-delay: 0.28s; }
.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#overview-stats .stat-net {
  grid-column: span 2;
  background: linear-gradient(135deg, #080d10 0%, #1a1612 62%, #3a2414 100%);
  border-color: #2a2118;
  box-shadow: 0 12px 28px rgba(8, 13, 16, 0.2);
  padding: 16px 18px;
}
#overview-stats .stat-net span {
  color: #d8cfc4;
  letter-spacing: 0.12em;
}
#overview-stats .stat-net strong {
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
#overview-stats .stat-net::after {
  height: 4px;
  background: linear-gradient(90deg, #ff7a00, #fff);
  transform: scaleX(0.62);
}
#overview-stats .card.stat-net:hover {
  transform: translateY(-1px);
  border-color: #ff7a00;
  box-shadow: 0 16px 32px rgba(8, 13, 16, 0.24);
}
.kv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 16px;
  margin: 0;
  padding: 4px 2px 8px;
}
.kv div { display: grid; gap: 2px; min-width: 0; }
.kv dt { font-size: 12px; color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; color: var(--navy); word-break: break-word; }
.meters { display: grid; gap: 10px; margin: 16px 0 8px; }
.meter { display: grid; grid-template-columns: 52px 1fr 48px; align-items: center; gap: 10px; }
.meter span, .meter strong { font-size: 13px; color: var(--muted); }
.meter-bar {
  height: 10px;
  background: #ece7e0;
  border-radius: 999px;
  overflow: hidden;
}
.meter-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #ffb56a);
  border-radius: inherit;
  transition: width 0.4s ease;
}
.meter-bar.warm i { background: linear-gradient(90deg, #d97706, #f5b04a); }
.meter-bar.hot i { background: linear-gradient(90deg, #c0392b, #e57373); }

.panel { padding: 14px 16px; margin-bottom: 10px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.stack { display: grid; gap: 12px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.wide { grid-column: 1 / -1; }
.fields input[type="checkbox"] { width: auto; }
.fields textarea { min-height: 140px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; resize: vertical; }
label { display: grid; gap: 4px; }
label span { font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea {
  width: 100%;
  border: 1px solid #ddd6cc;
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.15);
  transform: translateY(-1px);
}
.actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.btn {
  border: 0;
  background: var(--blue);
  color: var(--blue-ink);
  border-radius: 12px;
  padding: 8px 16px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,0.28) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.45s ease;
}
.btn:hover { background: #e56a00; transform: translateY(-1px); box-shadow: 0 10px 18px rgba(255, 122, 0, 0.28); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0); }
.tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 8px 14px;
  color: var(--ink);
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.tab:hover { transform: translateY(-1px); }
.tab.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: 0 8px 16px rgba(15, 39, 68, 0.18);
}
.btn.ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #a33024; }
.btn.slim { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.toolbar label { min-width: 220px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.mik-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.btn.brass {
  background: #ece7e0;
  color: var(--navy);
}
.btn.brass:hover { background: #e0d9cf; }
.mik-form {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px 18px;
  align-items: center;
  max-width: 760px;
}
.mik-form > span { color: var(--muted); font-size: 14px; }
.password-row, .data-limit { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.password-row input, .data-limit input[type="number"], .data-limit input[type="text"] { flex: 1; min-width: 80px; }
.data-limit select { width: 110px; }
.data-limit .check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.data-limit input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex: none; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.check input { width: auto; }
.readonly { background: #f4f1ec; color: #4a5868; }
.hidden { display: none !important; }
.qr-box { margin-top: 18px; }
.voucher-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-width: 280px;
  text-align: center;
  background: #fff;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  animation: rise 0.5s ease both;
}
.voucher-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(15, 39, 68, 0.12);
}
.voucher-card strong { font-size: 24px; color: var(--navy); }
@media print {
  .side, .topbar, .tabs, .toolbar, .mik-toolbar, .who { display: none !important; }
  .mik-form { grid-template-columns: 140px 1fr; }
}

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-width: 100%;
  max-height: min(72vh, 760px);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.table-box {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.table-find {
  justify-self: end;
  margin: 0;
  width: min(14rem, 100%);
}
.table-find input {
  width: 100%;
  height: 32px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f4ef;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  box-shadow: none;
}
.table-find input:focus {
  outline: none;
  border-color: #ffd2a8;
  background: #fff;
  color: var(--ink);
}
.table-find input::placeholder { color: #9c9a94; }
.panel:has(.table-wrap) {
  padding: 14px 12px 12px;
}
.data-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.data-table th,
.data-table td {
  padding: 6px 8px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f4ef;
  box-shadow: inset 0 -1px 0 var(--line);
  padding: 8px 10px;
  white-space: nowrap;
  line-height: 1.2;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.clip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.period {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  min-height: 36px;
}
.period.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.who-actions {
  display: grid;
  gap: 2px;
  margin: 6px 0 8px;
}
.who-actions .quiet,
.who-actions .nav-item {
  margin-top: 0;
  padding-left: 12px;
}
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  place-items: center;
  flex: none;
  padding: 0;
}
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  position: relative;
}
.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }
.nav-backdrop { display: none; }
.top-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toolbar.wrap {
  align-items: end;
  gap: 10px;
}
.toolbar.wrap label {
  min-width: 0;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
table { width: 100%; border-collapse: collapse; table-layout: auto; }
th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0 6px 6px;
}
td {
  padding: 6px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  transition: background 0.18s ease;
}
tbody tr { transition: transform 0.18s ease; }
tr:hover td { background: #f7f3ee; }
.price { color: var(--navy); font-weight: 600; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  background: #ece7e0;
  color: #3d4d61;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge.good {
  background: #e5f6ec;
  color: var(--good);
  box-shadow: 0 0 0 0 rgba(30, 138, 85, 0.35);
  animation: glow 2.6s ease-out infinite;
}
.badge.bad { background: #fdecea; color: var(--danger); }
.badge.warn { background: #fff4e0; color: #b45309; }
.price-total {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 10px;
  background: #fff4ea;
  border: 1px solid #ffd2a8;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
}
.price-total strong { color: var(--navy); font-size: 18px; }
.icon-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}
.icon-btn svg { width: 13px; height: 13px; pointer-events: none; }
.icon-btn:hover { background: #fff4ea; border-color: #ffd2a8; }
.icon-btn.danger { color: #9b1c1c; }
.icon-btn.danger:hover { background: #fff1f1; border-color: #f0b4b4; }
.act-bulk { margin: 0 0 12px; align-items: center; gap: 10px; }
.act-bulk .lede { margin: 0; font-size: 12px; }
.act-bulk .btn.slim { min-height: 32px; padding: 4px 10px; font-size: 12px; font-weight: 600; box-shadow: none; transform: none; }
.act-bulk .btn.slim:hover { transform: none; box-shadow: none; }
.auto-profiles {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
  max-width: 420px;
}
.auto-profiles > span {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}
.auto-profiles.is-off { opacity: 0.72; }
.auto-profile-table .data-table {
  font-size: 12px;
  width: 100%;
  min-width: 0;
}
.auto-profile-table .data-table th,
.auto-profile-table .data-table td { padding: 6px 8px; }
.auto-profile-table .data-table th:first-child,
.auto-profile-table .data-table td:first-child {
  width: 36px;
  text-align: center;
}
.auto-profile-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
}
.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  font-size: 12px;
  color: var(--navy);
  cursor: pointer;
  min-height: 32px;
}
.chip-check:has(input:checked) {
  border-color: #ffd2a8;
  background: #fff4ea;
  color: var(--blue);
}
.chip-check input { width: 16px; height: 16px; margin: 0; }
.act-auto-note { margin: 0 0 12px; font-size: 12px; }
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 8px 4px 6px;
  min-height: 32px;
  cursor: pointer;
}
.switch-icon { flex: none; }
.switch-track {
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #ddd6cc;
  position: relative;
  flex: none;
}
.switch-knob {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 2px rgba(15, 39, 68, 0.2);
  transition: left 0.16s ease;
}
.switch-text { display: grid; line-height: 1.15; text-align: left; }
.switch-text strong { max-width: 220px; }
.switch-text strong { font-size: 12px; color: var(--navy); font-weight: 650; }
.switch-text small { font-size: 10px; color: var(--muted); }
.switch.on { border-color: #ffd2a8; background: #fff4ea; color: var(--blue); }
.switch.on .switch-track { background: var(--blue); }
.switch.on .switch-knob { left: 16px; }
.data-table input.act-pick,
.data-table #act-select-all { width: 18px; height: 18px; min-height: 18px; margin: 0; vertical-align: middle; }
.data-table th:has(input[type="checkbox"]),
.data-table td:has(input[type="checkbox"]),
#act-table th:first-child,
#act-table td:first-child {
  width: 2.2rem;
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
  overflow: visible;
}
.data-table thead th:last-child:not([data-sort]) {
  width: auto;
}
.data-table td:has(.row-actions),
.data-table td:has(.btn),
.data-table td:has(.icon-btn) {
  overflow: visible;
  white-space: nowrap;
}
.data-table .row-actions {
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
}
.data-table .btn,
.data-table .btn.slim {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: none;
}
.data-table .price { font-size: inherit; }
.data-table td:has(.when-cell) { white-space: normal; }
.when-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}
.when-cell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.act-reason {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
}
.data-table .clip { max-width: 100%; }
.th-sort {
  all: unset;
  cursor: pointer;
  display: inline;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: inherit;
}
table.sortable th[data-sort] { cursor: pointer; user-select: none; }
table.sortable th[data-sort]::after {
  content: "↕";
  margin-left: 2px;
  font-size: 8px;
  opacity: 0.35;
}
table.sortable th.asc::after { content: "↑"; opacity: 1; }
table.sortable th.desc::after { content: "↓"; opacity: 1; }
.empty { color: var(--muted); padding: 24px 8px; }
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  min-height: min(52vh, 420px);
  padding: 36px 16px;
  font-weight: 600;
  text-align: center;
}
.loading .spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid #ddd6cc;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex: none;
}
#busy {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  background: rgba(244, 247, 251, 0.72);
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
}
#busy .busy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 28px;
  box-shadow: var(--shadow);
  min-width: 160px;
}
#busy .spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
}
#busy[hidden] { display: none !important; }
.notice, .error { margin: 0 0 14px; font-weight: 600; }
.notice { color: var(--good); }
.error { color: var(--danger); }
.field-note { margin: 6px 0 0; font-size: 13px; font-weight: 600; }
.field-note.warn { color: #7a4b00; }
.alert-list { display: grid; gap: 8px; margin: 0 0 14px; }
.alert-list p { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.alert-list .warn { background: #fff6e8; border: 1px solid #f0d2a0; color: #7a4b00; }
.alert-list .bad { background: #fff1f1; border: 1px solid #f0b4b4; color: #9b1c1c; }
.alert-list .good { background: #eef8f0; border: 1px solid #b7e0c2; color: #216e3a; }
.nav-count {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e24b4b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.impersonate-bar {
  margin: 0 18px 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff6e8;
  border: 1px solid #f0d2a0;
  color: #7a4b00;
  font-size: 13px;
}
.chat-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.4fr);
  gap: 14px;
  align-items: start;
}
.chat-threads { display: grid; gap: 8px; }
.chat-thread {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  position: relative;
}
.chat-thread.active { border-color: var(--blue); box-shadow: var(--shadow); }
.chat-thread span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread em {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #e24b4b;
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
}
.chat-log {
  display: grid;
  gap: 10px;
  max-height: 52vh;
  overflow: auto;
  padding: 4px 2px 12px;
}
.bubble {
  max-width: min(520px, 92%);
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4f1ec;
}
.bubble.mine { justify-self: end; background: #ffe4cc; }
.bubble span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.bubble p { margin: 4px 0; white-space: pre-wrap; word-break: break-word; }
.bubble time { font-size: 11px; color: var(--muted); }
.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.chat-compose textarea { min-height: 64px; resize: vertical; }
.defs div { display: grid; gap: 4px; }
.defs dt { color: var(--muted); font-size: 13px; }
.defs dd { margin: 0; font-size: 17px; }
.script {
  margin: 0;
  white-space: pre-wrap;
  font-family: Consolas, ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.55;
  background: #080d10;
  color: #f4f1ec;
  border-radius: 8px;
  padding: 16px 18px;
  overflow: auto;
}

.pick { min-height: 100vh; display: flex; flex-direction: column; }
.pick-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  background: var(--navy);
  color: var(--side-ink);
}
.pick-who { display: flex; align-items: center; gap: 12px; }
.pick-who span { color: #9c9a94; font-size: 12px; }
.pick-who .quiet { width: auto; color: #d0cdc6; }
.pick-body { padding: 24px 32px 48px; max-width: 1180px; width: 100%; margin: 0 auto; }
.pick-body > .panel { margin-bottom: 18px; }
.pick-tools {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}
.search-field { min-width: min(100%, 200px); display: grid; gap: 4px; }
.search-field span { font-size: 11px; color: var(--muted); font-weight: 500; }
.search-field input {
  min-height: 32px;
  height: 32px;
  padding: 4px 8px;
  font-size: 13px;
}
.router-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.router-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 8px;
  animation: rise 0.45s ease both;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.router-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(15, 39, 68, 0.1);
}
.router-card-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.router-card h2 { font-size: 18px; }
.router-card .lede { margin: 0; }
.router-card .meta-line { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.router-card .actions { margin-top: 6px; }
.winbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.winbox-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 10px;
}
.winbox-card h2 { font-size: 18px; }
.winbox-card .defs {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.winbox-list .data-table { font-size: 12px; }
.winbox-list .data-table th,
.winbox-list .data-table td { padding: 6px 8px; }
.winbox-list code { font-size: 11px; }
.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pick-split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 14px; }
.router-chip { margin-bottom: 4px; }
.router-chip strong { display: block; }
.router-chip .badge { margin-top: 2px; }
.toolbar input { min-width: min(100%, 280px); flex: 1; }
.offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.offer-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 10px;
  animation: rise 0.45s ease both;
}
.offer-card-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.offer-card h2 { font-size: 18px; }
a.offer-card { color: inherit; text-decoration: none; }
.offer-price { margin: 0; font-size: 26px; font-weight: 600; color: var(--navy); }
.offer-specs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.offer-specs li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.offer-specs strong { color: var(--ink); font-weight: 600; }
.offer-offline { opacity: 0.72; }
.shop-shell { min-height: 100vh; }
.shop-bar {
  background: var(--navy);
  color: #fff;
  padding: 18px 32px;
  padding-top: max(18px, env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.shop-body { max-width: 1080px; margin: 0 auto; padding: 28px 24px 56px; padding-bottom: max(56px, env(safe-area-inset-bottom)); }
.qty-field input { max-width: 160px; }
.shop-checkout {
  margin-top: 18px;
  max-width: 520px;
}
.pay-break {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px 14px;
  background: #f7f4ef;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.pay-break div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.pay-break .total {
  font-weight: 700;
  font-size: 16px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.pay-break .save { color: var(--good); }
.qty-field input { max-width: 120px; }
.voucher-result {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.voucher-result code { font-size: 22px; font-weight: 700; color: var(--navy); }
.voucher-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  text-align: left;
}
.voucher-list article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 8px;
}
.voucher-list article span { display: block; color: var(--muted); font-size: 13px; }
.model-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  align-items: start;
}
.model-preview {
  background: #ece7e0;
  padding: 14px;
  border-radius: 10px;
  overflow: auto;
  min-height: 520px;
}
.a4-frame {
  width: 210mm;
  padding: 4mm;
  box-sizing: border-box;
  background: #fff;
  box-shadow: var(--shadow);
  transform: scale(0.38);
  transform-origin: top left;
}
.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.banner-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 184px;
  gap: 28px;
  align-items: center;
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(255, 122, 0, 0.22), transparent 60%),
    var(--navy);
  color: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  margin: 0 0 16px;
}
.banner-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9c9a94;
  font-weight: 600;
}
.banner-hero h2 { margin: 0; color: #fff; font-size: clamp(24px, 3vw, 32px); }
.banner-url { margin: 10px 0 18px; color: #b8b6b0; font-size: 13px; word-break: break-all; }
.banner-hero .actions { margin: 0; }
.banner-qr {
  margin: 0;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.banner-qr img { width: 148px; height: 148px; display: block; margin: 0 auto; }
.banner-qr figcaption {
  margin: 8px 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
}
.banner-list { display: grid; gap: 8px; }
.banner-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.banner-idx { font-weight: 700; color: var(--blue); font-size: 13px; }
.banner-row h3 { margin: 0; font-size: 16px; color: var(--navy); }
.banner-row p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.banner-price { font-size: 20px; color: var(--navy); white-space: nowrap; }

@media (max-width: 980px) {
  .gate, .shell { grid-template-columns: 1fr; }
  .shell, .workspace, main:not(.portal-main) { max-width: 100%; min-width: 0; }
  .gate-brand { min-height: 0; padding: 16px 14px; }
  .gate-brand h1 { max-width: none; font-size: 22px; line-height: 1.15; }
  .gate-brand p { font-size: 14px; line-height: 1.35; }
  .gate-tool { max-width: none; margin-top: 10px; padding: 8px 10px; }
  .gate-brand .video-card { max-width: none; margin-top: 10px; }
  .gate-form, main:not(.portal-main), .topbar { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .gate-form { padding-top: 16px; padding-bottom: 20px; gap: 4px; }
  .menu-toggle { display: grid; width: 36px; height: 36px; }
  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 39, 68, 0.46);
    z-index: 20;
  }
  body.nav-open .nav-backdrop { display: block; }
  .side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(78vw, 240px);
    height: 100dvh;
    z-index: 30;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    padding: 10px 8px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    gap: 8px;
  }
  body.nav-open .side { transform: none; }
  .menu { flex-direction: column; overflow: auto; gap: 0; }
  .nav-label { margin: 8px 8px 2px; }
  .nav-item, .quiet {
    width: 100%;
    min-height: 34px;
    padding: 5px 8px;
    font-size: 13px;
    line-height: 1.2;
  }
  .nav-item:hover { transform: none; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f4f7fb;
    padding: 8px 10px;
    padding-top: max(8px, env(safe-area-inset-top));
    gap: 8px;
    justify-content: flex-start;
    font-size: 12px;
  }
  main:not(.portal-main) { padding-top: 8px; padding-bottom: max(56px, env(safe-area-inset-bottom)); }
  #main.portal-main { padding: 0; }
  .page-head { margin: 0 0 8px; }
  .lede { font-size: 12px; line-height: 1.3; }
  .panel { padding: 10px 10px; margin-bottom: 8px; }
  .panel-head { margin-bottom: 8px; }
  .fields, .pick-split, .model-layout, .checks, .mik-form, .chat-layout { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kv { grid-template-columns: 1fr 1fr; }
  .pick-bar, .pick-body, .shop-body { padding-left: 10px; padding-right: 10px; }
  .shop-bar { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .offer-grid { grid-template-columns: 1fr; }
  .banner-hero { grid-template-columns: 1fr; padding: 14px 12px; }
  .banner-row { grid-template-columns: 36px minmax(0, 1fr); }
  .banner-price { grid-column: 2; justify-self: start; }
  .actions { flex-wrap: wrap; margin-top: 10px; }
  .actions .btn { flex: 1 1 auto; }
  .btn { min-height: 38px; padding: 7px 12px; font-size: 13px; }
  .tab, .period { min-height: 36px; padding: 6px 10px; font-size: 13px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,
  textarea { font-size: 16px; min-height: 40px; }
  .toolbar,
  .toolbar.wrap,
  .period-bar,
  .act-bulk,
  .pick-tools {
    align-items: stretch;
    width: 100%;
  }
  .toolbar label,
  .toolbar.wrap label {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
  }
  .toolbar input,
  .toolbar select { min-width: 0; width: 100%; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-right: -4px; padding-bottom: 4px; }
  .tab { flex: none; white-space: nowrap; }
  .table-find { justify-self: stretch; width: 100%; }
  .table-find input {
    font-size: 16px;
    min-height: 40px;
    height: 40px;
  }
  .table-wrap { margin: 0; max-height: min(68dvh, 640px); }
  .clip { max-width: 18rem; }
  .data-table {
    font-size: 12px;
    line-height: 1.25;
    table-layout: auto;
    width: max-content;
    min-width: 100%;
  }
  .data-table thead th { font-size: 10px; padding: 6px 6px; white-space: nowrap; }
  .data-table th,
  .data-table td { padding: 6px 6px; }
  .data-table .btn,
  .data-table .btn.slim {
    min-height: 32px;
    font-size: 12px;
    padding: 4px 8px;
  }
  .data-table input:not([type="checkbox"]),
  .data-table select,
  .data-table textarea {
    font-size: 16px;
    min-height: 36px;
    width: auto;
    height: auto;
  }
  .data-table input.act-pick,
  .data-table #act-select-all,
  .data-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    min-width: 18px;
  }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn svg { width: 15px; height: 15px; }
  .switch {
    width: 100%;
    min-height: 38px;
    justify-content: flex-start;
  }
  .switch-text strong { max-width: none; }
  .act-bulk .lede { width: 100%; }
  .auto-profiles { width: 100%; max-width: none; }
  .auto-profile-table input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; }
  .price-total { flex-wrap: wrap; justify-content: space-between; }
  .a4-frame { transform: scale(0.28); }
  .model-preview { overflow: auto; }
  .inspect-card { width: 100%; max-height: 90dvh; padding: 12px; }
  .pick-bar { flex-wrap: wrap; padding: 10px; }
  .pick-who { flex-wrap: wrap; }
  .search-field { min-width: 0; width: 100%; }
  .qty-field input { max-width: none; width: 100%; }
  h1 { font-size: 20px; line-height: 1.15; }
  h2 { font-size: 15px; }
  .stat { padding: 10px; }
  .stat strong { font-size: 18px; margin-top: 2px; }
  #overview-stats .stat-net { padding: 12px 14px; }
  #overview-stats .stat-net strong { font-size: 24px; }
  .who { margin-top: auto; }
  #busy .busy-card { min-width: 140px; padding: 18px 22px; }
}

@media (max-width: 640px) {
  .grid, .kv { grid-template-columns: 1fr; }
  .stat strong { font-size: 18px; }
  .panel:has(.table-wrap) { padding: 8px 6px 6px; }
  .pick-who { flex-wrap: wrap; }
  .banner-row p { white-space: normal; }
  .topbar time { display: none; }
  .gate-brand h1 { font-size: 20px; }
}

html.is-android {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html.is-android body { font-size: 14px; line-height: 1.32; }
html.is-android .gate,
html.is-android .shell { grid-template-columns: 1fr; }
html.is-android .shell,
html.is-android .workspace,
html.is-android main:not(.portal-main) { max-width: 100%; min-width: 0; }
html.is-android .gate-brand { min-height: 0; padding: 16px 14px; }
html.is-android .gate-brand h1 { max-width: none; font-size: 22px; line-height: 1.15; }
html.is-android .gate-brand p { font-size: 14px; line-height: 1.35; }
html.is-android .gate-tool { max-width: none; margin-top: 10px; padding: 8px 10px; }
html.is-android .menu-toggle { display: grid; width: 36px; height: 36px; }
html.is-android .nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 39, 68, 0.46);
  z-index: 20;
}
html.is-android body.nav-open .nav-backdrop { display: block; }
html.is-android .side {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(78vw, 240px);
  height: 100dvh;
  z-index: 30;
  transform: translateX(-105%);
  padding: 10px 8px;
  gap: 8px;
}
html.is-android body.nav-open .side { transform: none; }
html.is-android .nav-item,
html.is-android .quiet {
  min-height: 34px;
  padding: 5px 8px;
  font-size: 12.5px;
  line-height: 1.2;
}
html.is-android .topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 8px 10px;
  gap: 8px;
  font-size: 12px;
}
html.is-android main:not(.portal-main) { padding-top: 8px; padding-bottom: max(56px, env(safe-area-inset-bottom)); }
html.is-android .lede,
html.is-android .guide-copy { font-size: 12px; line-height: 1.32; }
html.is-android .panel { padding: 10px; margin-bottom: 8px; }
html.is-android .fields,
html.is-android .pick-split,
html.is-android .model-layout,
html.is-android .checks,
html.is-android .mik-form,
html.is-android .chat-layout { grid-template-columns: 1fr; }
html.is-android .data-table { font-size: 12px; line-height: 1.25; }
html.is-android .btn { font-size: 13px; }
html.is-android h1 { font-size: 20px; }

@media (hover: none) {
  .card:hover, .panel:hover, .offer-card:hover, .voucher-card:hover {
    transform: none;
  }
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(36px, 22px, 0) scale(1.08); }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 122, 0, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(255, 122, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 122, 0, 0); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30, 138, 85, 0.28); }
  50% { box-shadow: 0 0 0 6px rgba(30, 138, 85, 0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shine {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

#inspect-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
#inspect-layer[hidden] { display: none; }
.inspect-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 39, 68, 0.45);
}
.inspect-card {
  position: relative;
  width: min(640px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 20px 22px;
  z-index: 1;
}
.inspect-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.inspect-card h2 { font-size: 18px; }
.inspect-card h3 {
  margin: 16px 0 8px;
  font-size: 14px;
  color: var(--navy);
}
.guide-copy { font-size: 13px; line-height: 1.4; color: var(--navy); }
.guide-copy p { margin: 0 0 6px; color: var(--muted); }
.guide-copy ul, .guide-copy ol { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.guide-copy li { padding-left: 2px; }
.usage-jump { margin-top: 10px; }
