/*
 * The operations panel's look (2026-10-05, director: 「個admin panel 可唔可以俾返D 誠意做好佢呢」).
 *
 * Iroverse's own night room — the website's ink and the girls' five colours — set as a working tool: two
 * surfaces on the ink, hairline borders instead of boxes, Sung only where a page announces itself (its title and
 * its big numbers) and Hei for everything that is read. One accent, the rose, kept for the active place, the
 * primary action and the line that matters on a chart. The five-colour band is the brand mark and appears twice:
 * at the top of the sidebar and on the sign-in card.
 *
 * Every text colour was measured against every surface it sits on (WCAG AA, 4.5:1 for body text): the dimmest,
 * --mute #9b96a8, is 5.0:1 on the lightest surface it meets (#2c2836). The old panel's #8f8a9c fell to 4.3 there.
 */
:root {
  --ink: #16141c;          /* the page */
  --s1: #1d1a24;           /* cards, the sidebar */
  --s2: #25212d;           /* inputs, hover, the second level inside a card */
  --s3: #2c2836;           /* pressed, selected rows, chips */
  --line: rgba(255, 255, 255, .075);
  --line-strong: rgba(255, 255, 255, .13);
  --text: #f7f5f9;
  --soft: #c9c4d2;
  --mute: #9b96a8;
  --accent: #c8446e;
  --accent-hi: #d6527c;
  --rose: #ff9cbd;
  --rose-wash: rgba(255, 156, 189, .1);
  --good: #7dd3a8;
  --good-wash: rgba(125, 211, 168, .1);
  --warn: #f0c674;
  --warn-wash: rgba(240, 198, 116, .1);
  --bad: #ff8f8f;
  --bad-wash: rgba(255, 143, 143, .1);
  --teal: #5fb8a6;
  --cast-1: #c8446e; --cast-2: #8a5a74; --cast-3: #17806f; --cast-4: #3a3745; --cast-5: #58744b;

  --hei: "PingFang HK", "PingFang TC", "Noto Sans TC", "Hiragino Sans TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --sung: "Noto Serif TC", "Songti TC", "Source Han Serif TC", "PMingLiU", Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --wordmark: Anton, Impact, "Arial Narrow", "Helvetica Neue", sans-serif;

  /* type scale */
  --t12: 12px; --t13: 13px; --t14: 14px; --t16: 16px; --t20: 20px; --t28: 28px; --t36: 36px;
  /* spacing, on 4/8 */
  --sp1: 4px; --sp2: 8px; --sp3: 12px; --sp4: 16px; --sp5: 24px; --sp6: 32px; --sp7: 40px; --sp8: 56px;
  --r-sm: 8px; --r: 10px; --r-lg: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --fast: 150ms;
  --sidebar: 248px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--ink); color: var(--text);
  font: 400 var(--t14)/1.55 var(--hei); -webkit-font-smoothing: antialiased; font-feature-settings: "palt" 0;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--rose); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; border-radius: 6px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--s2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; color: var(--soft); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--mute); }
.soft { color: var(--soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ------------------------------------------------------------------ brand */
.cast { display: flex; height: 3px; }
.cast i { flex: 1; }
.cast i:nth-child(1), .bars i:nth-child(1) { background: var(--cast-1); }
.cast i:nth-child(2), .bars i:nth-child(2) { background: var(--cast-2); }
.cast i:nth-child(3), .bars i:nth-child(3) { background: var(--cast-3); }
.cast i:nth-child(4), .bars i:nth-child(4) { background: #5a5568; }
.cast i:nth-child(5), .bars i:nth-child(5) { background: var(--cast-5); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand .bars { display: flex; gap: 2px; }
.brand .bars i { width: 4px; height: 18px; border-radius: 1px; }
.brand .word { font-family: var(--wordmark); font-size: 21px; letter-spacing: .06em; line-height: 1; }
.brand .sub { font-size: var(--t12); color: var(--mute); letter-spacing: .08em; margin-left: 2px; padding-left: 10px; border-left: 1px solid var(--line-strong); line-height: 18px; }

/* ------------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--s2); color: var(--text);
  font-size: var(--t14); font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; user-select: none;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast), opacity var(--fast);
}
.btn:hover { background: var(--s3); border-color: rgba(255, 255, 255, .2); }
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn.danger { background: var(--bad-wash); border-color: rgba(255, 143, 143, .35); color: var(--bad); }
.btn.danger:hover { background: rgba(255, 143, 143, .16); border-color: rgba(255, 143, 143, .55); }
.btn.danger.solid { background: #b8374a; border-color: #b8374a; color: #fff; }
.btn.danger.solid:hover { background: #c94358; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--soft); }
.btn.ghost:hover { background: var(--s2); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: var(--t13); border-radius: var(--r-sm); }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.block { width: 100%; height: 44px; font-size: var(--t16); }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.input, .select, .textarea {
  height: 36px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--s2);
  color: var(--text); font-size: var(--t14); transition: border-color var(--fast), box-shadow var(--fast), background-color var(--fast);
  min-width: 0;
}
.input::placeholder, .textarea::placeholder { color: #827d8f; }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(255, 255, 255, .22); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(255, 156, 189, .18); }
.input:disabled { opacity: .45; }
.input.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(255, 143, 143, .14); }
.input.num { text-align: right; font-variant-numeric: tabular-nums; width: 120px; }
.input.lg { height: 44px; font-size: var(--t16); padding: 0 14px; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239b96a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; width: 100%; }
.textarea.code { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; tab-size: 2; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
input[type="date"].input { color-scheme: dark; }
.search { position: relative; display: inline-flex; align-items: center; }
.search svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--mute); pointer-events: none; }
.search .input { padding-left: 34px; }

/* a checkbox as a switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; color: var(--soft); font-size: var(--t13); }
.switch input { appearance: none; -webkit-appearance: none; margin: 0; width: 34px; height: 20px; border-radius: 999px; background: var(--s3); border: 1px solid var(--line-strong); position: relative; cursor: pointer; flex: none; transition: background-color var(--fast), border-color var(--fast); }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--soft); transition: transform var(--fast) var(--ease), background-color var(--fast); }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(14px); background: #fff; }
.switch input:disabled { opacity: .45; cursor: not-allowed; }
input[type="checkbox"].check { appearance: none; -webkit-appearance: none; margin: 0; width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .28); background: var(--s2); display: inline-grid; place-content: center; cursor: pointer; vertical-align: middle; transition: background-color var(--fast), border-color var(--fast); }
input[type="checkbox"].check::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
input[type="checkbox"].check:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"].check:checked::after { opacity: 1; }
input[type="checkbox"].check:disabled { opacity: .4; cursor: not-allowed; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r); background: var(--s2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--mute); height: 28px; padding: 0 10px; border-radius: 7px; font-size: var(--t13); font-weight: 600; cursor: pointer; transition: background-color var(--fast), color var(--fast); font-variant-numeric: tabular-nums; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--s3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: var(--t12); font-weight: 600; white-space: nowrap; background: var(--s3); color: var(--soft); border: 1px solid transparent; line-height: 1; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.plain::before { display: none; }
.pill.paid { background: var(--rose-wash); color: var(--rose); }
.pill.bond { background: rgba(138, 90, 116, .22); color: #e2b4cb; }
.pill.free { background: var(--s3); color: var(--mute); }
.pill.good { background: var(--good-wash); color: var(--good); }
.pill.warn { background: var(--warn-wash); color: var(--warn); }
.pill.bad { background: var(--bad-wash); color: var(--bad); }

/* ------------------------------------------------------------------ the sign-in screen */
.door { min-height: 100vh; display: grid; place-items: center; padding: var(--sp5) 16px; position: relative; overflow: hidden; }
.door::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 70%; pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 50% 0%, rgba(200, 68, 110, .16), transparent 70%);
}
.door-card {
  position: relative; width: 100%; max-width: 400px; background: var(--s1); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.door-body { padding: var(--sp6) var(--sp6) var(--sp6); }
.door h1 { font-family: var(--sung); font-weight: 900; font-size: var(--t28); line-height: 1.25; margin: var(--sp5) 0 var(--sp2); letter-spacing: .02em; }
.door .lede { color: var(--soft); margin: 0 0 var(--sp5); font-size: var(--t14); }
.door label.field-label { display: block; font-size: var(--t13); color: var(--soft); margin-bottom: var(--sp2); font-weight: 600; }
.door .input.lg { width: 100%; }
.door .btn.block { margin-top: var(--sp4); }
.door .sent { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--s2); border: 1px solid var(--line); color: var(--soft); font-size: var(--t13); margin-bottom: var(--sp5); }
.door .sent svg { width: 18px; height: 18px; color: var(--rose); flex: none; margin-top: 1px; }
.door .sent strong { color: var(--text); font-weight: 600; }
.door .row-links { display: flex; justify-content: space-between; align-items: center; margin-top: var(--sp4); font-size: var(--t13); }
.door .linkbtn { border: 0; background: none; padding: 0; color: var(--soft); cursor: pointer; font-size: var(--t13); }
.door .linkbtn:hover:not(:disabled) { color: var(--text); text-decoration: underline; }
.door .linkbtn:disabled { color: var(--mute); cursor: default; }
.door .msg { min-height: 20px; margin-top: var(--sp3); font-size: var(--t13); color: var(--bad); }
.door .foot { margin-top: var(--sp5); padding-top: var(--sp4); border-top: 1px solid var(--line); color: var(--mute); font-size: var(--t12); }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input {
  width: 100%; height: 56px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--s2);
  text-align: center; font: 600 24px/1 var(--mono); color: var(--text); caret-color: var(--rose);
  transition: border-color var(--fast), box-shadow var(--fast), background-color var(--fast);
}
.otp input:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(255, 156, 189, .18); background: var(--s3); }
.otp.error input { border-color: var(--bad); }
.otp.shake { animation: shake .32s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ------------------------------------------------------------------ the shell */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--s1);
  border-right: 1px solid var(--line); z-index: 20;
}
.sidebar .brand { padding: 22px 20px 20px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 12px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: var(--r);
  color: var(--soft); font-weight: 500; text-decoration: none; transition: background-color var(--fast), color var(--fast);
  position: relative;
}
.nav a svg { width: 18px; height: 18px; color: var(--mute); transition: color var(--fast); }
.nav a:hover { background: var(--s2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--rose-wash); color: var(--text); font-weight: 600; }
.nav a[aria-current="page"] svg { color: var(--rose); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rose); }
.side-group { margin: 20px 12px 0; padding: 16px 12px 4px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.side-group .label { font-size: var(--t12); color: var(--mute); }
.side-group .select { width: 100%; height: 34px; }
.side-foot { margin-top: auto; padding: 14px 12px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--cast-1), var(--cast-2)); color: #fff; font-weight: 700; font-size: var(--t13); }
.who { min-width: 0; flex: 1; line-height: 1.3; }
.who .email { font-size: var(--t13); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .role { font-size: var(--t12); color: var(--mute); }

.topbar { display: none; }
.scrim { display: none; }

.main { min-width: 0; position: relative; }
.loadbar { position: fixed; top: 0; left: var(--sidebar); right: 0; height: 2px; z-index: 40; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity 200ms; }
.loadbar.on { opacity: 1; }
.loadbar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--rose), transparent); animation: slide 1.1s var(--ease) infinite; }
@keyframes slide { from { left: -40%; } to { left: 100%; } }
.page { max-width: 1240px; padding: var(--sp7) var(--sp7) var(--sp8); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp4) var(--sp5); flex-wrap: wrap; margin-bottom: var(--sp6); }
.page-head h1 { font-family: var(--sung); font-weight: 900; font-size: var(--t28); line-height: 1.2; margin: 0; letter-spacing: .02em; }
.page-head p { margin: 6px 0 0; color: var(--mute); max-width: 68ch; }
.page-head .actions { display: flex; gap: var(--sp2); align-items: center; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--mute); font-size: var(--t13); margin-bottom: var(--sp3); text-decoration: none; }
.crumb:hover { color: var(--text); text-decoration: none; }
.crumb svg { width: 16px; height: 16px; }

.section { margin-top: var(--sp7); }
.section > header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp4); margin-bottom: var(--sp4); flex-wrap: wrap; }
.section > header h2 { font-size: var(--t16); font-weight: 600; margin: 0; }
.section > header p { margin: 4px 0 0; color: var(--mute); font-size: var(--t13); max-width: 70ch; }
.section > header .tools { display: flex; gap: var(--sp2); align-items: center; flex-wrap: wrap; }
.help { color: var(--mute); font-size: var(--t13); max-width: 70ch; margin: 0; }

.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card.pad { padding: var(--sp5); }
.card > .card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp3); padding: var(--sp4) var(--sp5); border-bottom: 1px solid var(--line); }
.card > .card-head h3 { margin: 0; font-size: var(--t14); font-weight: 600; }
.card > .card-head .muted { font-size: var(--t13); }
.card > .card-body { padding: var(--sp5); }
.grid { display: grid; gap: var(--sp4); }
.grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* a headline number */
.kpi { padding: 20px 22px 18px; display: flex; flex-direction: column; min-height: 168px; position: relative; overflow: hidden; }
.kpi .k-label { font-size: var(--t13); color: var(--soft); display: flex; align-items: center; gap: 8px; }
.kpi .k-label .dot { width: 8px; height: 8px; border-radius: 2px; }
.kpi .k-value { font-family: var(--sung); font-weight: 900; font-size: var(--t36); line-height: 1.1; margin-top: 12px; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.01em; }
.kpi .k-value.good { color: var(--good); } .kpi .k-value.bad { color: var(--bad); } .kpi .k-value.warn { color: var(--warn); }
.kpi .k-note { font-size: var(--t12); color: var(--mute); margin-top: 6px; }
.kpi .k-spark { margin-top: auto; padding-top: 12px; height: 44px; }
.kpi .k-spark svg { display: block; width: 100%; height: 32px; overflow: visible; }
.kpi .k-spark { position: relative; }
.kpi .k-spark-label { position: absolute; right: 0; top: 0; font-size: 11px; color: var(--mute); }

/* a smaller figure, in a run of them */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 18px 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.stats.cols-4 .stat:nth-child(4n) { border-right: 0; }
.stats.cols-4 .stat:nth-last-child(-n+4):nth-child(4n+1), .stats.cols-4 .stat:nth-last-child(-n+4):nth-child(4n+1) ~ .stat { border-bottom: 0; }
.stats.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.cols-3 .stat:nth-child(3n) { border-right: 0; }
.stats.cols-3 .stat:nth-last-child(-n+3):nth-child(3n+1), .stats.cols-3 .stat:nth-last-child(-n+3):nth-child(3n+1) ~ .stat { border-bottom: 0; }
.stat .s-label { font-size: var(--t13); color: var(--mute); }
.stat .s-value { font-size: var(--t20); font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat .s-value.small { font-size: var(--t14); font-weight: 500; line-height: 1.6; }
.stat .s-value.good { color: var(--good); } .stat .s-value.bad { color: var(--bad); } .stat .s-value.warn { color: var(--warn); }
.stat .s-note { font-size: var(--t12); color: var(--mute); margin-top: 2px; overflow-wrap: anywhere; }
.meter { height: 6px; border-radius: 999px; background: var(--s3); overflow: hidden; margin-top: 10px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--teal); transition: width 300ms var(--ease); }
.meter.warn > span { background: var(--warn); } .meter.bad > span { background: var(--bad); }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { fill: var(--mute); font-size: 11px; font-family: var(--hei); font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: rgba(255, 255, 255, .06); }
.chart .baseline { stroke: rgba(255, 255, 255, .14); }
.chart .cursor { stroke: rgba(255, 255, 255, .25); stroke-dasharray: 3 3; }
.chart-legend { display: flex; gap: var(--sp4); flex-wrap: wrap; font-size: var(--t12); color: var(--soft); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 3px; border-radius: 2px; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px; padding: 10px 12px; border-radius: var(--r);
  background: #2a2633; border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  font-size: var(--t12); color: var(--soft); opacity: 0; transition: opacity 100ms; transform: translate(-50%, calc(-100% - 12px));
}
.tip.on { opacity: 1; }
.tip .t-day { color: var(--text); font-weight: 600; margin-bottom: 6px; }
.tip .t-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.tip .t-row b { color: var(--text); font-weight: 600; }
.tip .t-row i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* bars in a list: plan mix, retention, the funnel */
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar .h-top { display: flex; justify-content: space-between; gap: 12px; font-size: var(--t13); }
.hbar .h-top .h-name { color: var(--soft); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .h-top .h-val { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; white-space: nowrap; }
.hbar .h-top .h-val small { color: var(--mute); font-weight: 400; margin-left: 6px; }
.hbar .h-track { height: 8px; border-radius: 999px; background: var(--s2); margin-top: 6px; overflow: hidden; }
.hbar .h-track > span { display: block; height: 100%; border-radius: inherit; background: var(--rose); opacity: .85; transition: width 400ms var(--ease); }
.hbar.teal .h-track > span { background: var(--teal); }
.hbar.dim .h-track > span { background: #6d6779; }

/* tables */
.table-wrap { overflow: auto; border-radius: inherit; }
.card > .table-wrap { border-radius: var(--r-lg); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
table.t th, table.t td { padding: 0 16px; height: 46px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th { height: 40px; font-size: var(--t12); font-weight: 600; color: var(--mute); background: var(--s1); position: sticky; top: 0; z-index: 2; }
table.t th.num, table.t td.num { text-align: right; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background-color 120ms; }
table.t.hover tbody tr:hover { background: var(--s2); }
table.t.click tbody tr { cursor: pointer; }
table.t td.wrap { white-space: normal; min-width: 220px; }
table.t td .sub { display: block; font-size: var(--t12); color: var(--mute); line-height: 1.3; }
/* the coupon page's 折扣 card reuses the list's cell (7 折 over 減 30%); without this the two ran together */
.stat .s-value .sub { display: block; font-size: var(--t12); font-weight: 400; color: var(--mute); line-height: 1.3; margin-top: 2px; }
table.t th.sortable { cursor: pointer; user-select: none; }
table.t th.sortable:hover { color: var(--text); }
table.t th .sort { display: inline-flex; align-items: center; gap: 4px; }
table.t th.num .sort { flex-direction: row-reverse; }
table.t th .sort svg { width: 12px; height: 12px; opacity: 0; transition: opacity var(--fast), transform var(--fast); }
table.t th.sortable:hover .sort svg { opacity: .5; }
table.t th[aria-sort] { color: var(--text); }
table.t th[aria-sort] .sort svg { opacity: 1; color: var(--rose); }
table.t th[aria-sort="ascending"] .sort svg { transform: rotate(180deg); }
table.t .idcell { font-family: var(--mono); font-size: 12.5px; color: var(--soft); }
table.t .inline-bar { display: inline-block; width: 72px; height: 6px; border-radius: 999px; background: var(--s3); vertical-align: middle; margin-left: 10px; overflow: hidden; }
table.t .inline-bar > span { display: block; height: 100%; background: var(--rose); border-radius: inherit; }
.players-table { max-height: calc(100vh - 260px); }
/* the coupon page's codes: one per line inside a cell, each with its own switch */
.cp-codes { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; }
.cp-codes .switch { color: var(--text); }
/* The Stripe mode beside the coupon page's heading: the heading's serif and size are not the pill's. */
.page-head h1 .pill { font-family: var(--hei); letter-spacing: 0; vertical-align: middle; margin-left: 12px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--sp3); padding: 12px 16px; border-top: 1px solid var(--line); color: var(--mute); font-size: var(--t13); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 6px; align-items: center; }
.toolbar { display: flex; gap: var(--sp3); align-items: center; flex-wrap: wrap; margin-bottom: var(--sp4); }
.toolbar .grow { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--soft); font-size: var(--t13); cursor: pointer; transition: background-color var(--fast), color var(--fast), border-color var(--fast); font-variant-numeric: tabular-nums; }
.chip:hover { background: var(--s2); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--rose-wash); border-color: rgba(255, 156, 189, .4); color: var(--rose); }
.chip .n { color: var(--mute); margin-left: 4px; }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .8; }

/* empty and loading */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 40px 24px; color: var(--mute); }
.empty.compact { padding: 24px; flex-direction: row; gap: 12px; justify-content: flex-start; text-align: left; }
.empty.compact svg { margin: 0; width: 22px; height: 22px; }
.empty.compact strong { font-size: var(--t13); }
.empty svg { width: 28px; height: 28px; color: #6d6779; margin-bottom: 4px; }
.empty strong { color: var(--soft); font-weight: 600; font-size: var(--t14); }
.empty span { font-size: var(--t13); max-width: 46ch; }
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--s2) 0%, #2d2937 50%, var(--s2) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk.line { height: 12px; }
.sk.big { height: 36px; width: 60%; margin-top: 14px; }

/* key and value pairs */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0; }
.kv > div { padding: 14px 20px; border-bottom: 1px solid var(--line); min-width: 0; }
.kv dt { font-size: var(--t12); color: var(--mute); }
.kv dd { margin: 2px 0 0; font-size: var(--t14); color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* forms inside cards */
.form-row { display: flex; gap: var(--sp3); align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span.f-label, .field > label.f-label { font-size: var(--t13); color: var(--soft); font-weight: 600; }
.field .f-help { font-size: var(--t12); color: var(--mute); max-width: 60ch; }
.field.grow { flex: 1; min-width: 200px; }
.field .input, .field .select { width: 100%; }
.note-line { font-size: var(--t13); color: var(--mute); margin-top: var(--sp3); }
.note-line.warn { color: var(--warn); }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--warn-wash); border: 1px solid rgba(240, 198, 116, .28); color: #f3d79e; font-size: var(--t13); max-width: 80ch; }
.callout svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.callout.info { background: var(--s2); border-color: var(--line); color: var(--soft); }

/* the player page */
.player-head { display: flex; align-items: center; gap: var(--sp4); flex-wrap: wrap; }
.player-head .portrait { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-family: var(--sung); font-weight: 900; font-size: 24px; color: #fff; flex: none; }
.player-head h1 { font-family: var(--sung); font-weight: 900; font-size: var(--t28); margin: 0; line-height: 1.15; }
.player-head .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.copy { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--s2); color: var(--soft); font: 12px var(--mono); cursor: pointer; transition: background-color var(--fast), color var(--fast); max-width: 100%; }
.copy:hover { background: var(--s3); color: var(--text); }
.copy svg { width: 13px; height: 13px; flex: none; }
.copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subnav { position: sticky; top: 0; z-index: 10; display: flex; gap: 4px; padding: 10px 0; margin: var(--sp5) 0 0; background: linear-gradient(var(--ink) 75%, transparent); overflow-x: auto; scrollbar-width: none; }
.subnav a { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 8px; color: var(--soft); font-size: var(--t13); font-weight: 500; white-space: nowrap; text-decoration: none; }
.subnav a:hover { background: var(--s2); color: var(--text); }
.subnav a.on { background: var(--s2); color: var(--text); box-shadow: inset 0 -2px 0 var(--rose); }
.anchor { scroll-margin-top: 64px; }
.actions-row { display: flex; gap: var(--sp2); flex-wrap: wrap; align-items: center; }
.split { display: flex; justify-content: space-between; align-items: center; gap: var(--sp3); flex-wrap: wrap; }
.report { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.report:last-child { border-bottom: 0; }
.report .r-meta { font-size: var(--t12); color: var(--mute); margin-bottom: 8px; }
.report .r-said { color: var(--soft); font-size: var(--t13); margin-bottom: 6px; }
.report .r-her { border-left: 2px solid var(--rose); padding-left: 12px; color: var(--text); white-space: pre-wrap; }

/* the content page */
.editor { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 540px; }
.files { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.files .search { padding: 12px; border-bottom: 1px solid var(--line); display: flex; }
.files .search svg { left: 23px; }
.files .search .input { width: 100%; height: 32px; font-size: var(--t13); }
.files ul { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; max-height: 600px; }
.files li button { width: 100%; text-align: left; border: 0; background: none; color: var(--soft); font: 12.5px var(--mono); padding: 6px 10px; border-radius: 7px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.files li button:hover { background: var(--s2); color: var(--text); }
.files li button[aria-current="true"] { background: var(--rose-wash); color: var(--rose); }
.files li button.edited::after { content: " •"; color: var(--warn); }
.files .dir { font: 11px var(--hei); color: var(--mute); padding: 10px 10px 4px; }
.editor-main { display: flex; flex-direction: column; min-width: 0; }
.editor-main .ed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); font: 12.5px var(--mono); color: var(--soft); min-height: 46px; }
.editor-main textarea { flex: 1; border: 0; border-radius: 0 0 var(--r-lg) 0; background: transparent; min-height: 480px; padding: 16px; box-shadow: none !important; }
.publish-bar { display: flex; gap: var(--sp3); align-items: flex-end; flex-wrap: wrap; padding: var(--sp4) var(--sp5); border-top: 1px solid var(--line); background: var(--s1); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* the config page */
.cfg-section { margin-top: var(--sp7); }
.cfg-section:first-child { margin-top: 0; }
.cfg-section > h2 { font-size: var(--t16); font-weight: 600; margin: 0 0 4px; }
.cfg-section > p.muted { margin: 0 0 var(--sp4); font-size: var(--t13); max-width: 72ch; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0; }
.fields .field { padding: 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); gap: 8px; }
.fields .f-label { font-size: var(--t14); color: var(--text); font-weight: 600; }
.fields .f-help { font-size: var(--t12); color: var(--mute); line-height: 1.5; }
.f-err { display: block; color: var(--bad); font-size: var(--t12); white-space: normal; max-width: 260px; }
.f-err:empty { display: none; }
.in { height: 34px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--s2); color: var(--text); font-variant-numeric: tabular-nums; transition: border-color var(--fast), box-shadow var(--fast); }
.in:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(255, 156, 189, .18); }
.in.num { width: 120px; text-align: right; }
.in.wide { width: 100%; max-width: 420px; }
.in:disabled { opacity: .4; }
.in.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(255, 143, 143, .14); }
select.in { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239b96a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.field input.in.num { align-self: flex-start; }
table.form-table td { vertical-align: top; padding-top: 12px; padding-bottom: 12px; height: auto; }
table.form-table th { cursor: default; }
table.form-table td.label-cell { white-space: normal; min-width: 220px; max-width: 340px; }
table.form-table td.label-cell .f-label { font-weight: 600; color: var(--text); }
table.form-table td.label-cell .f-help { font-size: var(--t12); color: var(--mute); margin-top: 2px; line-height: 1.5; }
table.form-table td.ro { color: var(--soft); font-family: var(--mono); font-size: 12.5px; }
table.form-table th .muted { font-weight: 400; }
.unl { display: inline-flex; gap: 6px; align-items: center; margin-right: 10px; color: var(--soft); font-size: var(--t12); }
.unl input { accent-color: var(--accent); }
.form-table input[type="checkbox"], .fields input[type="checkbox"], #config-form .row input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.warnbox { border: 1px solid rgba(240, 198, 116, .3); background: var(--warn-wash); color: #f3d79e; border-radius: var(--r); padding: 10px 14px; font-size: var(--t13); margin: 8px 0; max-width: 80ch; }
#config-form .row { display: flex; gap: var(--sp3); align-items: center; flex-wrap: wrap; }
#config-form h3 { font-size: var(--t13); color: var(--soft); font-weight: 600; margin: var(--sp5) 0 var(--sp2); display: flex; gap: 8px; align-items: center; }
#config-form h3:first-of-type { margin-top: 0; }
#config-form .wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--s1); }
#config-form .card dl.kv { padding: 0; }
.ctl { height: 34px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--s2); color: var(--text); font-weight: 600; font-size: var(--t13); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.ctl:hover { background: var(--s3); }
details.advanced { margin-top: var(--sp7); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--s1); }
details.advanced summary { padding: 14px 20px; cursor: pointer; color: var(--soft); font-weight: 600; list-style: none; display: flex; align-items: center; gap: 10px; }
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary svg { width: 16px; height: 16px; transition: transform var(--fast); color: var(--mute); }
details.advanced[open] summary svg { transform: rotate(90deg); }
details.advanced .adv-body { padding: 0 20px 20px; }
details.advanced .textarea { min-height: 46vh; }
.savebar {
  position: sticky; bottom: 16px; z-index: 15; margin-top: var(--sp6); padding: 12px 12px 12px 20px; border-radius: var(--r-lg);
  background: rgba(37, 33, 45, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong); box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  display: flex; gap: var(--sp3); align-items: center; flex-wrap: wrap;
  transition: border-color var(--fast), transform 200ms var(--ease);
}
.savebar.dirty { border-color: rgba(240, 198, 116, .45); }
.savebar .grow { flex: 1; min-width: 200px; }
.savebar .status { font-size: var(--t13); color: var(--mute); }
span.dirty { color: var(--warn); font-size: var(--t13); display: block; }
.savebar .error { color: var(--bad); font-size: var(--t13); display: block; }
.savebar .error:empty { display: none; }

/* ------------------------------------------------------------------ dialog and toasts */
dialog.dlg { border: 1px solid var(--line-strong); border-radius: 16px; background: var(--s1); color: var(--text); padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
dialog.dlg::backdrop { background: rgba(10, 9, 14, .62); backdrop-filter: blur(2px); }
dialog.dlg[open] { animation: pop 160ms var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
.dlg .d-body { padding: 24px 24px 8px; }
.dlg .d-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--s2); color: var(--soft); margin-bottom: 16px; }
.dlg .d-icon.danger { background: var(--bad-wash); color: var(--bad); }
.dlg .d-icon svg { width: 20px; height: 20px; }
.dlg h2 { font-size: var(--t16); margin: 0 0 6px; font-weight: 600; }
.dlg p { margin: 0; color: var(--soft); font-size: var(--t13); line-height: 1.6; }
.dlg .field { margin-top: 16px; }
.dlg .d-err { color: var(--bad); font-size: var(--t12); min-height: 18px; margin-top: 6px; }
.dlg .d-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 20px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px; border-radius: 12px; background: #2a2633; border: 1px solid var(--line-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5); font-size: var(--t13); color: var(--text); animation: toast-in 180ms var(--ease);
}
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--good); } .toast.err svg { color: var(--bad); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity 180ms, transform 180ms; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ narrower */
@media (max-width: 1180px) {
  .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .stats.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.cols-4 .stat:nth-child(4n) { border-right: 1px solid var(--line); }
  .stats.cols-4 .stat:nth-child(2n) { border-right: 0; }
  .stats.cols-4 .stat { border-bottom: 1px solid var(--line) !important; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform 220ms var(--ease); box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  .shell.drawer .sidebar { transform: none; }
  .shell.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 9, 14, .6); z-index: 15; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 12; height: 56px; align-items: center; gap: 8px; padding: 0 8px 0 4px; background: rgba(22, 20, 28, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .topbar .brand { flex: 1; }
  .topbar .brand .word { font-size: 18px; }
  .loadbar { left: 0; }
  .page { padding: var(--sp5) 16px var(--sp7); }
  .page-head { margin-bottom: var(--sp5); }
  .page-head h1 { font-size: 24px; }
  .grid.halves, .grid.thirds { grid-template-columns: minmax(0, 1fr); }
  .kpi { min-height: 0; padding: 16px 16px 14px; }
  .kpi .k-value { font-size: 28px; }
  .stat { padding: 14px 16px; }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .files { border-right: 0; border-bottom: 1px solid var(--line); }
  .files ul { max-height: 200px; }
  .subnav { top: 56px; }
  .anchor { scroll-margin-top: 112px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .savebar { bottom: 8px; }
  .players-table { max-height: none; }
  .door-body { padding: var(--sp5); }
}
@media (max-width: 900px) {
  /* the top bar already has a refresh button */
  .page-head .actions > [data-refresh] { display: none; }
  .page-head .actions:empty { display: none; }
  /* the player column stays put while the numbers scroll under it */
  #pl-table th:first-child, #pl-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--s1); box-shadow: 1px 0 0 var(--line); }
  #pl-table th:first-child { z-index: 3; }
}
@media (max-width: 520px) {
  .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px 14px 12px; }
  .kpi .k-value { font-size: 24px; margin-top: 8px; }
  .kpi .k-note { font-size: 11.5px; }
  .kpi .k-spark { height: 34px; padding-top: 8px; }
  .kpi .k-spark svg { height: 26px; }
  .stats.cols-4, .stats.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.cols-3 .stat:nth-child(3n) { border-right: 1px solid var(--line); }
  .stats.cols-3 .stat:nth-child(2n) { border-right: 0; }
  .stats.cols-3 .stat { border-bottom: 1px solid var(--line) !important; }
  .page-head .actions { width: 100%; }
  .otp { gap: 6px; }
  .otp input { height: 50px; font-size: 22px; }
}

/* a grid of fields inside a card: the card's own edge stands in for the last column's and row's borders */
.card.clip { overflow: hidden; }
.card > .fields { margin: 0 -1px -1px 0; }
/* number fields without the browser's spinner: they are typed into, and the arrows crowded the digits */
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
@media (max-width: 520px) { table.form-table td.label-cell { min-width: 170px; } }

/* ---------------------------------------------------------------------------- 客服 */
.sp-grid { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .sp-grid { grid-template-columns: 1fr; } }
.sp-list { padding: 6px; display: flex; flex-direction: column; gap: 2px; max-height: 72vh; overflow-y: auto; }
.sp-row { display: block; padding: 10px 12px; border-radius: var(--r); color: var(--text); }
.sp-row:hover { background: var(--s2); }
.sp-row.on { background: var(--rose-wash); }
.sp-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sp-row-text { margin-top: 4px; color: var(--soft); font-size: var(--t13, 13px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-row-when { margin-top: 2px; color: var(--mute); font-size: var(--t12); }
.sp-thread { display: flex; flex-direction: column; }
.sp-messages { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 12px; max-height: 56vh; overflow-y: auto; }
.sp-msg { display: flex; flex-direction: column; max-width: 78%; }
.sp-msg.player { align-self: flex-start; }
.sp-msg.ops { align-self: flex-end; align-items: flex-end; }
.sp-bubble { padding: 9px 12px; border-radius: 12px; background: var(--s2); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.sp-msg.ops .sp-bubble { background: var(--rose-wash); border-color: rgba(255, 156, 189, .3); }
.sp-meta { margin-top: 3px; color: var(--mute); font-size: var(--t12); }
.sp-form { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.sp-form .textarea { flex: 1; }
