:root {
  --bg: #161219;
  --surface: #211c25;
  --surface-2: #2a242e;
  --line: #3b3440;
  --line-bright: #5a4f60;
  --text: #f6f0f4;
  --muted: #a49aa9;
  --lime: #c7f36b;
  --lime-dark: #253019;
  --coral: #ff846f;
  --yellow: #f7ce72;
  --danger: #ff9a8c;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .28);
  --sans: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% -10%, rgba(199, 243, 107, .08), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
.hidden { display: none !important; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 15px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
}
.boot-mark, .brand-mark {
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--lime);
  color: #222719;
  font-weight: 900;
  transform: rotate(-5deg);
}
.boot-mark { width: 48px; height: 48px; font-size: 24px; }
.brand-mark { width: 37px; height: 37px; flex: 0 0 auto; font-size: 19px; }

.auth-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(420px, .8fr);
}
.auth-art {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 42px clamp(34px, 7vw, 110px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(199, 243, 107, .08), transparent 48%),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255, 255, 255, .025) 80px),
    #19151d;
}
.auth-art::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(199, 243, 107, .18);
  border-radius: 50%;
  right: -120px;
  bottom: -170px;
  box-shadow: 0 0 0 55px rgba(199, 243, 107, .025), 0 0 0 110px rgba(199, 243, 107, .018);
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-lockup b { display: block; letter-spacing: .02em; }
.brand-lockup small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font: 9px var(--mono);
  letter-spacing: .14em;
}
.auth-art > .brand-lockup { position: absolute; top: 38px; left: clamp(34px, 7vw, 110px); }
.auth-art h1 {
  max-width: 700px;
  margin: 10px 0 20px;
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1.06;
  letter-spacing: -.055em;
}
.auth-copy { max-width: 580px; color: #b9afbc; line-height: 1.9; }
.kicker {
  margin: 0;
  color: var(--lime);
  font: 10px var(--mono);
  letter-spacing: .16em;
}
.signal-card {
  width: min(650px, 100%);
  margin-top: 36px;
  padding: 8px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(27, 23, 31, .8);
  backdrop-filter: blur(8px);
}
.signal-card div {
  display: grid;
  grid-template-columns: 8px 70px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #302a34;
}
.signal-card div:last-child { border: 0; }
.signal-card i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(199, 243, 107, .08); }
.signal-card span { color: var(--muted); font: 9px var(--mono); }
.signal-card b { font-size: 12px; }
.auth-panel { display: grid; place-items: center; padding: 30px; background: #120f15; }
.auth-card { width: min(390px, 100%); }
.auth-head h2 { margin: 7px 0; font-size: 29px; letter-spacing: -.04em; }
.auth-head p:last-child { margin: 0 0 24px; color: var(--muted); font-size: 12px; }
.field { display: grid; gap: 7px; margin-bottom: 13px; }
.field > span, .slider-field > span { color: #bdb3c1; font-size: 11px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: #18141b;
  color: var(--text);
  padding: 11px 12px;
  transition: .18s;
}
textarea { resize: vertical; line-height: 1.65; }
input:focus, textarea:focus, select:focus { border-color: #91ad58; box-shadow: 0 0 0 3px rgba(199, 243, 107, .1); }
.form-error { min-height: 18px; margin: 4px 0 8px; color: var(--danger); font-size: 11px; }
.fine-print { margin: 15px 0 0; color: #776e7c; font-size: 10px; line-height: 1.65; }
.wide { width: 100%; }

.btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--line-bright); }
.btn.primary { border-color: var(--lime); background: var(--lime); color: #202518; }
.btn.primary:hover { background: #d5ff80; }
.btn.danger { border-color: #65403d; background: #2e2225; color: var(--danger); }
.btn.subtle { border-color: #453d49; background: #29232d; }
.btn.small { padding: 7px 10px; font-size: 10px; }
.text-btn { border: 0; padding: 7px 0; background: transparent; color: var(--lime); font-size: 11px; font-weight: 700; }
.auth-card > .text-btn { margin-top: 13px; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); }
.danger-text { color: var(--danger); }
.h5-only, .mobile-tabbar { display: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 15px 17px;
  border-right: 1px solid var(--line);
  background: #19151d;
}
.sidebar > .brand-lockup { padding: 0 9px 26px; }
.nav { display: grid; gap: 4px; }
.nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  background: transparent;
  color: #b9afbd;
  text-align: left;
  transition: .16s;
}
.nav button:hover, .nav button.active { background: #2d2732; color: #fff; }
.nav button.active { box-shadow: inset 3px 0 var(--lime); }
.nav i { width: 17px; color: inherit; font-style: normal; text-align: center; }
.sidebar-card { margin-top: auto; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #231e27; }
.side-card-head { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(199, 243, 107, .08); }
.sidebar-card > b { display: block; margin-top: 10px; font-size: 14px; }
.sidebar-card p { min-height: 30px; margin: 4px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.user-row { display: grid; grid-template-columns: 31px minmax(0, 1fr) 28px; align-items: center; gap: 9px; margin-top: 15px; padding: 0 5px; }
.user-row b, .user-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row b { font-size: 11px; }
.user-row small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.user-row .icon-btn { width: 28px; height: 28px; }
.avatar { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #f6c38b, #e77770); color: #422722; font-weight: 900; }
.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(22, 18, 25, .91);
  backdrop-filter: blur(14px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; }
.crumb { color: var(--muted); font-size: 11px; }
.crumb b { color: var(--text); }
.menu-btn { display: none; }
.live-indicator { display: flex; align-items: center; gap: 7px; color: var(--muted); font: 9px var(--mono); }
.live-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #68616d; }
.live-indicator i.on { background: var(--coral); box-shadow: 0 0 0 4px rgba(255, 132, 111, .1); }
.membership-chip { border: 1px solid #4b5f2c; border-radius: 99px; padding: 5px 9px; background: #252c1d; color: var(--lime); font-size: 9px; font-weight: 700; }
.content { max-width: 1460px; margin: 0 auto; padding: 27px 32px 45px; }
.page { display: none; animation: rise .2s ease; }
.page.active { display: block; }
@keyframes rise { from { opacity: .4; transform: translateY(4px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.page-head h1 { margin: 6px 0; font-size: 29px; letter-spacing: -.045em; }
.page-head p:last-child { margin: 0; color: var(--muted); font-size: 11px; }
.metrics { display: grid; grid-template-columns: 1.45fr repeat(3, 1fr); gap: 13px; margin-bottom: 14px; }
.metric { min-height: 107px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.metric span, .metric small { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: block; margin: 13px 0 4px; font-size: 26px; letter-spacing: -.045em; }
.metric.featured { border-color: var(--lime); background: var(--lime); color: #24281d; }
.metric.featured span, .metric.featured small { color: #596047; }
.metric.featured strong { margin-top: 14px; font-size: 21px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(285px, .72fr); gap: 14px; }
.card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head.compact { margin: 13px 0 8px; }
.card-head h2 { margin: 0; font-size: 14px; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.button-row { display: flex; flex-wrap: wrap; gap: 7px; }
.stream {
  position: relative;
  height: 315px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #3c3541;
  border-radius: 13px;
  background: #100d13;
}
.stream video, .stream > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: none; }
.stream video.show, .stream > img.show { display: block; }
.stream-empty { z-index: 1; display: grid; justify-items: center; gap: 7px; color: #817888; text-align: center; }
.stream-empty > span { font-size: 34px; }
.stream-empty b { color: #d9d1dd; font-size: 12px; }
.stream-empty small { font-size: 10px; }
.live-tag { position: absolute; z-index: 2; top: 11px; left: 11px; display: flex; align-items: center; gap: 6px; border: 1px solid #4a424e; border-radius: 8px; padding: 5px 8px; background: #211c25e8; color: var(--muted); font: 9px var(--mono); }
.live-tag i { width: 6px; height: 6px; border-radius: 50%; background: #68616d; }
.live-tag i.on { background: var(--coral); }
.crop-layer { position: absolute; inset: 0; z-index: 4; cursor: crosshair; touch-action: none; }
.crop-layer > span { position: absolute; z-index: 1; left: 50%; top: 12px; transform: translateX(-50%); border: 1px solid var(--line-bright); border-radius: 8px; padding: 6px 9px; background: #17131ae8; font-size: 9px; white-space: nowrap; }
#cropBox { position: absolute; display: none; border: 2px solid var(--lime); background: rgba(199, 243, 107, .13); box-shadow: 0 0 0 9999px rgba(3, 2, 4, .52); pointer-events: none; }
.stream-tools { display: flex; justify-content: space-between; margin: 8px 2px 0; color: var(--muted); font-size: 9px; }
.comment-box { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #19151d; }
.comment-box textarea { font-size: 12px; }
.comment-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; }
.toggle-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.toggle-label input { width: auto; accent-color: var(--lime); }
.reply-panel { margin-top: 11px; border-left: 2px solid var(--lime); border-radius: 0 9px 9px 0; padding: 10px 12px; background: #22201f; }
.reply-panel .intent { color: var(--lime); font: 9px var(--mono); }
.reply-panel p { margin: 7px 0 10px; color: #e9e2eb; font-size: 12px; line-height: 1.7; }
.side-stack { display: grid; align-content: start; gap: 14px; }
.queue-preview { display: grid; gap: 6px; margin-bottom: 11px; }
.queue-preview div { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 8px; border: 1px solid #39323e; border-radius: 9px; padding: 8px; background: #19151d; }
.queue-preview i { color: var(--lime); font: 8px var(--mono); font-style: normal; }
.queue-preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.mint-card { border-color: #66833f; background: #252b20; }
.mint-card h2 { margin: 9px 0; }
.mint-card p:not(.kicker) { color: #b6c0a8; font-size: 10px; line-height: 1.65; }
.qr-mini { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 7px; background: #312b36; color: var(--lime); font-size: 18px; }
.qr-mini.ready { box-shadow: 0 0 0 2px rgba(199, 243, 107, .18); background: #2e3624; }
.muted { color: var(--muted); font-size: 10px; line-height: 1.6; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(310px, .9fr); gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chips button { border: 1px solid var(--line); border-radius: 99px; padding: 7px 10px; background: #19151d; color: var(--muted); font-size: 10px; }
.chips button.active { border-color: var(--lime); background: var(--lime); color: #23281c; font-weight: 700; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 13px; }
.span-2 { grid-column: span 2; }
.tag, .status-pill { border-radius: 99px; padding: 5px 8px; background: #332d38; color: var(--lime); font: 9px var(--mono); }
.status-pill { padding: 7px 11px; }
.script-output { min-height: 250px; padding: 15px; border: 1px solid #39333e; border-radius: 11px; background: #17141a; color: #e7dfea; font-size: 13px; line-height: 1.85; white-space: pre-wrap; }
.card > .button-row { margin-top: 12px; }
.automation-grid { grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); }
.queue-editor { min-height: 272px; font-size: 12px; }
.queue-options { display: flex; justify-content: space-between; gap: 15px; margin: 11px 0; }
.queue-options label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.queue-options select { width: auto; padding: 7px; }
.slider-field { margin: 14px 0; }
.slider-field > span { display: flex; justify-content: space-between; }
.slider-field input { padding: 0; accent-color: var(--lime); }
.notice { display: grid; gap: 5px; margin-top: 13px; border: 1px solid #534439; border-radius: 10px; padding: 10px 12px; background: #28231f; color: #d3c4ad; font-size: 10px; line-height: 1.65; }
.stage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 14px; }
.stage-card { position: relative; min-height: 146px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #1d1921; }
.stage-card.active { border-color: #88a653; background: #242a1f; }
.stage-card span { color: var(--lime); font: 9px var(--mono); }
.stage-card h3 { margin: 13px 0 6px; font-size: 12px; }
.stage-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.stage-card button { position: absolute; bottom: 11px; left: 13px; right: 13px; }
.principles { display: grid; gap: 0; margin: 13px 0; padding: 0; list-style: none; }
.principles li { display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.principles li:last-child { border: 0; }
.principles b { font-size: 10px; }
.principles span { color: var(--muted); font-size: 10px; }
.membership-status { display: grid; justify-items: end; gap: 4px; }
.membership-status span { color: var(--muted); font-size: 9px; }
.membership-status b { color: var(--lime); font-size: 13px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.plan-card { position: relative; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.plan-card.recommended { border-color: #718d43; background: #22271d; }
.plan-card .recommend { position: absolute; top: -1px; right: 14px; border-radius: 0 0 8px 8px; padding: 5px 8px; background: var(--lime); color: #23281d; font-size: 8px; font-weight: 800; }
.plan-card h3 { margin: 0; font-size: 15px; }
.plan-price { margin: 13px 0; }
.plan-price strong { font-size: 29px; letter-spacing: -.05em; }
.plan-price small { color: var(--muted); font-size: 10px; }
.plan-card ul { min-height: 96px; margin: 0 0 14px; padding: 0; list-style: none; }
.plan-card li { padding: 5px 0; color: #bdb5c1; font-size: 10px; }
.plan-card li::before { content: " · "; color: var(--lime); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
th { padding: 9px; color: var(--muted); font-weight: 500; text-align: left; }
td { padding: 11px 9px; border-top: 1px solid var(--line); }
td .text-btn { padding: 0; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upload-box { position: relative; min-height: 205px; display: grid; place-items: center; gap: 7px; overflow: hidden; border: 1px dashed var(--line-bright); border-radius: 12px; background: #18141b; color: var(--muted); text-align: center; cursor: pointer; }
.upload-box span, .upload-box b { z-index: 1; font-size: 10px; }
.upload-box b { color: var(--lime); }
.upload-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: none; background: #fff; }
.upload-box img.show { display: block; }
.upload-box img.show ~ span, .upload-box img.show ~ b { display: none; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); padding: 14px 0; }
.toggle-row span { display: grid; gap: 4px; }
.toggle-row b { font-size: 11px; }
.toggle-row small { color: var(--muted); font-size: 9px; }
.toggle-row input { width: auto; accent-color: var(--lime); }
.admin-order-list { display: grid; gap: 8px; }
.admin-order { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #19151d; }
.admin-order header { display: flex; justify-content: space-between; gap: 10px; }
.admin-order b { font-size: 10px; }
.admin-order small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.admin-order .button-row { margin-top: 9px; }
.empty { padding: 25px 10px; color: var(--muted); font-size: 10px; text-align: center; }

.pay-dialog {
  width: min(460px, calc(100vw - 30px));
  border: 1px solid var(--line-bright);
  border-radius: 19px;
  padding: 24px;
  background: #211c25;
  color: var(--text);
  box-shadow: var(--shadow);
}
.pay-dialog::backdrop { background: rgba(7, 5, 9, .76); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; }
.dialog-head h2 { margin: 7px 0 16px; }
.pay-summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.pay-summary span { font-size: 11px; }
.pay-summary strong { font-size: 22px; }
.pay-summary small { grid-column: span 2; color: var(--muted); font: 9px var(--mono); user-select: all; }
.pay-qr { min-height: 270px; display: grid; place-items: center; margin: 13px 0; overflow: hidden; border-radius: 12px; background: #fff; color: #555; text-align: center; }
.pay-qr img { display: none; width: 100%; max-height: 330px; object-fit: contain; }
.pay-qr img.show { display: block; }
.pay-qr span { font-size: 11px; }
.pay-name { margin: 0; font-weight: 700; }
.pay-dialog .fine-print { margin-bottom: 0; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 22px; transform: translate(-50%, 14px); opacity: 0; pointer-events: none; border-radius: 10px; padding: 11px 16px; background: #f5efe8; color: #201c21; font-size: 11px; font-weight: 700; transition: .22s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1120px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .workspace-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(3, 1fr); }
  .stage-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .auth-view { grid-template-columns: 1fr; }
  .auth-art { min-height: 41vh; padding: 80px 25px 30px; }
  .auth-art > .brand-lockup { top: 25px; left: 25px; }
  .auth-art h1 { font-size: 35px; }
  .signal-card { display: none; }
  .auth-panel { padding: 30px 20px 50px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 12; left: 0; width: 235px; transform: translateX(-103%); transition: .22s; box-shadow: 20px 0 50px #0008; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-block; }
  .topbar { padding: 0 16px; }
  .content { padding: 21px 15px calc(92px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; flex-direction: column; }
  .two-col, .automation-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card ul { min-height: 0; }
  .mobile-tabbar {
    position: fixed;
    z-index: 11;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    padding: 6px;
    border: 1px solid #4a414f;
    border-radius: 17px;
    background: rgba(29, 24, 33, .94);
    box-shadow: 0 16px 42px rgba(0, 0, 0, .48);
    backdrop-filter: blur(16px);
  }
  .mobile-tabbar button {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-height: 49px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #918697;
    font-size: 9px;
  }
  .mobile-tabbar button i { font-size: 18px; font-style: normal; line-height: 1; }
  .mobile-tabbar button.active { background: #343d25; color: var(--lime); }
  .h5-only { display: inline-flex; align-items: center; justify-content: center; }
  input, textarea, select { font-size: 16px; }
  .topbar { height: 60px; }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .pay-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 28px);
    margin: auto auto calc(10px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 14px 14px;
  }
}

@media (max-width: 520px) {
  .content { padding: 18px 11px calc(92px + env(safe-area-inset-bottom)); }
  .topbar-right .live-indicator { display: none; }
  .metrics { gap: 8px; }
  .metric { padding: 13px; min-height: 95px; }
  .metric strong { font-size: 21px; }
  .workspace-grid { gap: 10px; }
  .card { padding: 14px; border-radius: 14px; }
  .stream { height: 220px; }
  .field-grid, .upload-grid, .stage-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .page-head h1 { font-size: 25px; }
  .button-row { width: 100%; }
  .page-head .button-row .btn, .page-head > .btn { width: 100%; }
  .pay-dialog { padding: 19px; }
  .stream .button-row { justify-content: flex-end; }
  .stream .button-row .btn, .stream .button-row .h5-only { width: auto; }
}
