/* Grave admin. Components follow the planer admin (shapes, type, spacing); the palette is Grave's teal.
   Layout rule: everything on a page is a direct child of .page, and .page spaces its children (one gap, no per-block margins). */

/* ---- palette ---- */
:root {
  --bg: #f1f5f4; --surface: #fbfdfc; --surface-2: #e8efed; --sunken: #e2eae8;
  --line: #d5dfdd; --line-strong: #bccac7;
  --text: #1b2423; --text-2: #52605e; --text-3: #667775;
  --accent: #0d7f75; --accent-hover: #0a655d; --on-accent: #ffffff; --accent-soft: #d9efeb;
  --ok: #2f7d4f; --hi: #a8620a; --danger: #b3342a; --danger-soft: #f7e5e2; --now: #e0675c;
  --c1: #0d7f75; --c2: #3aa99c; --c3: #7ccdc1; --c4: #1f6f8b;
  --av0: #0d7f75; --av1: #1f6f8b; --av2: #7a5ab8; --av3: #a8620a; --av4: #2f7d4f; --av5: #b0487a;
  --shadow: 0 1px 2px rgba(27, 36, 35, .08), 0 8px 20px rgba(27, 36, 35, .1); --overlay: rgba(10, 20, 19, .45);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0c1514; --surface: #121e1d; --surface-2: #192827; --sunken: #091110;
  --line: #233331; --line-strong: #34484a; --text: #e3eeec; --text-2: #a6bbb8; --text-3: #86999a;
  --accent: #4fd8c6; --accent-hover: #7ee6d8; --on-accent: #04201d; --accent-soft: #14302d;
  --ok: #7ccf9a; --hi: #e0a14d; --danger: #f0786d; --danger-soft: #3a1f1c; --now: #ff8a7d;
  --c1: #4fd8c6; --c2: #2fa89b; --c3: #1d6f68; --c4: #5aa9c6;
  --av0: #4fd8c6; --av1: #5aa9c6; --av2: #a98ce0; --av3: #e0a14d; --av4: #7ccf9a; --av5: #e07fae;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 26px rgba(0, 0, 0, .5); --overlay: rgba(0, 0, 0, .62);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0c1514; --surface: #121e1d; --surface-2: #192827; --sunken: #091110;
    --line: #233331; --line-strong: #34484a; --text: #e3eeec; --text-2: #a6bbb8; --text-3: #86999a;
    --accent: #4fd8c6; --accent-hover: #7ee6d8; --on-accent: #04201d; --accent-soft: #14302d;
    --ok: #7ccf9a; --hi: #e0a14d; --danger: #f0786d; --danger-soft: #3a1f1c; --now: #ff8a7d;
    --c1: #4fd8c6; --c2: #2fa89b; --c3: #1d6f68; --c4: #5aa9c6;
    --av0: #4fd8c6; --av1: #5aa9c6; --av2: #a98ce0; --av3: #e0a14d; --av4: #7ccf9a; --av5: #e07fae; color-scheme: dark;
  }
}

/* ---- shell ---- */
body { overflow: hidden; }
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100dvh; }
.nav-check { position: absolute; opacity: 0; pointer-events: none; }
.scrim { display: none; }
.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 16px 12px 12px; border-right: 1px solid var(--line); background: var(--sunken); overflow-y: auto; }
.sidebar .brand { padding: 2px 8px 18px; font-size: 21px; }
.sidebar .brand .badge { margin-left: 4px; }
.badge { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font: 600 10px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; }
.nav-group { margin-bottom: 16px; }
.nav-title { padding: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.nav-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r); color: var(--text-2); font-weight: 500; }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--accent); }
.nav-item.is-active .icon { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r); color: var(--text); }
.me:hover { background: var(--surface-2); text-decoration: none; }
.me.is-active { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { font-size: 12px; color: var(--text-3); }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.foot-row form { margin: 0; }

.theme { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.theme button { display: grid; place-items: center; width: 30px; height: 26px; border: 0; border-radius: 4px; background: transparent; color: var(--text-3); }
.theme button:hover { color: var(--text); }
.theme button[aria-pressed='true'] { background: var(--surface); color: var(--accent); box-shadow: 0 0 0 1px var(--line-strong); }

.content { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: none; }
.main { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; }
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; max-width: 1160px; margin: 0 auto; padding: 28px 32px 64px; }
.page > * { min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 2px; }
.page-head-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.page-head h1 { font-size: 28px; }
.page-head .sub { margin-top: 4px; color: var(--text-2); font-size: 14px; max-width: 70ch; }
.crumb { margin-bottom: 4px; font-size: 13px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- people: avatar and the "avatar + name" cell ---- */
.avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; font: 600 14px/1 var(--font); --av: var(--av0);
  background: color-mix(in srgb, var(--av) 20%, var(--surface)); color: var(--av); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--av) 30%, transparent); }
.av-0 { --av: var(--av0); } .av-1 { --av: var(--av1); } .av-2 { --av: var(--av2); } .av-3 { --av: var(--av3); } .av-4 { --av: var(--av4); } .av-5 { --av: var(--av5); }
.avatar-lg { width: 58px; height: 58px; border-radius: 14px; font-size: 23px; }
.me .avatar { width: 32px; height: 32px; }
.person { display: inline-flex; align-items: center; gap: 11px; min-width: 0; color: var(--text); }
.person:hover { text-decoration: none; }
.person:hover b { color: var(--accent); }
.person-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.person-txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-txt small { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- blocks ---- */
.sec > h2, .block > h2 { font: 500 18px/1.2 var(--serif); white-space: nowrap; margin-bottom: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sec > h2 { justify-content: flex-start; align-items: center; }
.sec > h2 .count { font-family: var(--font); }
.sec-hint { margin: -6px 0 12px; color: var(--text-2); font-size: 13.5px; }
.block { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.block-hint { font: 400 12.5px/1.2 var(--font); color: var(--text-3); text-align: right; }
.block-hint a { font-weight: 500; }
.block.danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger) 4%, var(--surface)); }
.block.danger > h2 { color: var(--danger); }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }      /* blocks in one row are one height */
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; word-break: break-word; }
.kv .mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }
.lead { margin-bottom: 8px; }
.block p + p, .block p + .toolbar { margin-top: 8px; }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--hi) 40%, var(--line)); border-left: 3px solid var(--hi); background: var(--surface); font-size: 14px; }
.note .icon { color: var(--hi); margin-top: 1px; }
.note-list { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); }
.note-list li + li { margin-top: 3px; }
.note-ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); border-left-color: var(--ok); }
.note-ok .icon { color: var(--ok); }
.note-bad { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); border-left-color: var(--danger); }
.note-bad .icon { color: var(--danger); }

/* labelled button rows inside a card ("Продлить на  [+30] [+90]") */
.action { display: grid; grid-template-columns: minmax(130px, 190px) 1fr; gap: 6px 16px; align-items: center; padding: 12px 0; }
.action + .action { border-top: 1px solid var(--line); }
.action:first-of-type { padding-top: 2px; }
.action-label { font-weight: 500; font-size: 14px; }
.action-label small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12.5px; font-weight: 400; }
.action .toolbar { margin: 0; }
.lines { list-style: none; margin: 0; padding: 0; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.line:first-child { padding-top: 0; }
.line:last-child { border-bottom: 0; padding-bottom: 0; }
.line-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.line-main small { display: block; color: var(--text-3); font-size: 12.5px; }

/* a folded card: "+ Create ..." */
.fold { border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.fold > summary { display: flex; align-items: center; gap: 9px; padding: 12px 18px; cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; border-radius: var(--r-lg); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: var(--surface-2); }
.fold[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.fold-body { padding: 18px 20px; }

/* ---- cards (badges, roles) ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.badge-card, .role-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); }
.badge-card:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 0 0 1px var(--accent); }
.badge-card.is-off { opacity: .66; }
.badge-top, .role-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.badge-card b { font-size: 16px; }
.badge-desc, .role-help { color: var(--text-2); font-size: 13.5px; line-height: 1.4; flex: 1; }
.badge-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
.badge-foot span:last-child { display: inline-flex; align-items: center; gap: 5px; }
.role-top b { font-size: 15px; }

/* ---- tables ---- */
.table-wrap { border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); background: var(--sunken); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr[data-href] { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table td.wrap-text { max-width: 440px; word-break: break-word; }
.only-sm { display: none; }
.u-name { font-weight: 500; }
.u-mail { color: var(--text-2); font-size: 13px; }
.c-text { display: block; }
.c-meta { display: block; margin-top: 2px; color: var(--text-3); font-size: 12.5px; }
.empty-row { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 34px 18px; text-align: center; color: var(--text-3); }
.empty-row b { color: var(--text-2); font-weight: 600; }
.empty-row span { max-width: 46ch; font-size: 13.5px; }
.block .empty-row { padding: 18px 6px; }

/* ---- forms and filters ---- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar form, .inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.inline-form { display: inline-flex; }
.search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-field { position: relative; flex: 1 1 260px; min-width: 0; }
.search-field .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-field .input { padding-left: 38px; width: 100%; }
.filter-bar { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.filter-row { display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.filter-label { width: 56px; flex: none; color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.log-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.log-filters .search-field { flex: 1 1 100%; }
.log-filters .search-field .input { width: 100%; }
.log-filters .input { width: 160px; flex: none; }
.log-filters select.input, .log-filters .fs { width: 220px; }
.svc-list { display: flex; flex-wrap: wrap; gap: 8px; }
.vh { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.proxy-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.ping { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ping-txt { font-weight: 500; } .ping-txt.lvl-none, .ping-txt.lvl-bad { color: var(--danger); } .ping-txt.lvl-wait { color: var(--text-3); }
.u-dot.lvl-wait { background: var(--line-strong); }
.proxy-acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.proxy-acts form { margin: 0; }
.icon-btn-danger { color: var(--danger); } .icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
/* pick buttons that can be several at once (log sections, proxy services): a plain, smooth colour change */
.fchip { cursor: pointer; user-select: none; transition: background .22s ease, border-color .22s ease, color .22s ease; }
.fchip-multi:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
[data-log-body] { transition: opacity .2s ease; } [data-log-body].is-loading { opacity: .35; }
[data-log-body].swapped .log { animation: log-in .25s ease; }
@keyframes log-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fchip, [data-log-body] { transition: none; } [data-log-body].swapped .log { animation: none; } }
.fs { position: relative; flex: none; }
.fs-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.fs-btn .person-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-btn::after { content: ''; margin-left: auto; flex: none; width: 7px; height: 7px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg) translateY(-2px); }
.fs .suggest { min-width: 100%; }
.suggest .is-picked b { color: var(--accent); }
.log-filters .dash { color: var(--text-3); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text-2); background: var(--surface); font-size: 13px; font-weight: 500; }
.fchip:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.fchip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.fchip-bad { border-color: color-mix(in srgb, var(--danger) 45%, var(--line-strong)); color: color-mix(in srgb, var(--danger) 80%, var(--text-2)); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.fchip-bad:hover { background: color-mix(in srgb, var(--danger) 13%, var(--surface)); color: var(--danger); }
.fchip-bad.is-on { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); border-color: var(--danger); color: var(--danger); }
.fchip.fchip-bad .fcount, .fchip.fchip-bad.is-on .fcount { color: var(--danger); }
mark.bad { background: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); border-radius: 3px; padding: 0 3px; font-weight: 600; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.fcount { font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fchip.is-on .fcount { color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 16px; align-items: start; }
.form-grid .form-submit { grid-column: 1 / -1; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.w-xs { width: 90px; flex: none; } .w-sm { width: 150px; flex: none; } .w-md { width: 240px; flex: none; }
.input.color { padding: 3px; width: 56px; flex: none; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 14px; color: var(--text-2); font-size: 13.5px; }
.pager .gap { min-width: 110px; text-align: center; }
.pg { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--text); background: var(--surface); }
.pg:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent); }
.pg-off { opacity: .35; }
.log-filters .fs .fs-btn { width: 100%; }
.chip-bad { background: var(--danger-soft); color: var(--danger); }
.swatch-dot { display: inline-block; flex: none; vertical-align: -1px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.field-row:last-of-type { border-bottom: 0; }
.field-row .t { min-width: 0; }
.field-row .t b { font-weight: 500; }
.field-row .t small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.field-row .ctl { flex: none; }
.field-row .input { width: 180px; }
.field-row .ctl .input.wide { width: 280px; }
.foot-actions { display: flex; gap: 8px; margin-top: 6px; }

/* ---- overview ---- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; min-width: 0; padding: 15px 18px 12px; border-right: 1px solid var(--line); color: var(--text); }
.kpi:last-child { border-right: 0; }
a.kpi:hover { background: var(--surface-2); text-decoration: none; }
a.kpi:hover .k { color: var(--accent); }
.kpi .k { font-size: 13px; color: var(--text-2); }
.kpi .v { font: 500 30px/1.1 var(--serif); letter-spacing: -.01em; margin: 4px 0 3px; }
.kpi .d { font-size: 12.5px; color: var(--text-3); }
.kpi .d.up { color: var(--ok); } .kpi .d.down { color: var(--danger); } .kpi .d.warn { color: var(--hi); }
.spark-slot { display: block; height: 30px; margin-top: auto; padding-top: 8px; box-sizing: content-box; }
.kpis.three .kpi, .kpis.four .kpi { padding-bottom: 15px; }
.spark { display: block; width: 100%; height: 30px; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark .area { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: none; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--text-3); font: 12px var(--font); font-size: var(--ax, 12px); }
.chart .ax-empty { font-size: var(--ax-big, 14px); fill: var(--text-3); }
.chart .bar { fill: var(--c2); } .chart .bar:hover { fill: var(--accent); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: color-mix(in srgb, var(--accent) 13%, transparent); }
.chart .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.rank { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); counter-increment: r; }
.rank li:first-child { padding-top: 0; }
.rank li:last-child { border-bottom: 0; padding-bottom: 0; }
.rank li::before { content: counter(r); width: 20px; color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 13px; }
.rank .r-main { min-width: 0; flex: 1; line-height: 1.25; } .rank .r-main b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rank .r-main span { display: block; font-size: 12.5px; line-height: 1.2; color: var(--text-3); }
.rank .r-n { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13.5px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed li:first-child { padding-top: 0; }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.feed-main { min-width: 0; }
.feed-log .feed-main { line-height: 1.4; }
.feed time { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.status { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 28px; font-size: 14px; }
.status li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.range { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.range a { padding: 5px 12px; border-radius: 4px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.range a:hover { text-decoration: none; color: var(--text); }
.range a.is-on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line-strong); }

/* ---- moderation log ---- */
.log-day { position: sticky; top: 0; z-index: 2; margin-top: 12px; padding: 9px 2px 8px; background: var(--bg); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.log > :first-child { margin-top: 0; }
.log-list { border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.log-row { display: grid; grid-template-columns: 52px 30px minmax(0, 1fr); gap: 0 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.log-row:last-child { border-bottom: 0; }
.log-row:hover { background: var(--surface-2); }
.log-row time { color: var(--text-3); font-size: 13px; padding-top: 4px; font-variant-numeric: tabular-nums; }
.log-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.cat-users { --c: var(--c4); } .cat-premium { --c: #b8860b; } .cat-badges { --c: var(--c2); } .cat-content { --c: var(--danger); }
.cat-admins { --c: #7a5ab8; } .cat-settings { --c: var(--hi); } .cat-auth { --c: var(--text-3); }
:root[data-theme='dark'] .cat-premium { --c: #e0b64d; } :root[data-theme='dark'] .cat-admins { --c: #a98ce0; }
.log-main { min-width: 0; line-height: 1.4; padding-top: 3px; }
.log-main .who { font-weight: 600; }
.log-main .role { margin-left: 6px; }
.log-main .extra { color: var(--text-2); font-size: 13.5px; margin-top: 2px; word-break: break-word; }
.log-main .extra b { font-weight: 500; color: var(--text); }
.log-main details { margin-top: 3px; } .log-main summary { cursor: pointer; color: var(--text-3); font-size: 12.5px; }
.log-main .meta { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }

/* ---- user card tabs ---- */
.tabs { display: flex; gap: 2px; margin: 0 0 -6px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; display: inline-flex; align-items: center; height: 42px; padding: 0 16px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.tabs a.is-on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---- gate (login) ---- */
.gate { max-width: 380px; margin: 14vh auto 0; padding: 0 20px; display: flex; flex-direction: column; gap: 14px; }
.gate .brand { padding: 0; font-size: 26px; justify-content: center; }
.gate h1 { text-align: center; font-size: 22px; }
.gate .theme { position: fixed; top: 14px; right: 14px; }
.gate form.block { display: flex; flex-direction: column; gap: 14px; }

/* ---- phones ---- */
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .18s ease-out; box-shadow: var(--shadow); }
  .nav-check:checked ~ .sidebar { transform: none; }
  .nav-check:checked ~ .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: var(--overlay); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 7px 12px; min-height: 52px; border-bottom: 1px solid var(--line); background: var(--sunken); flex: none; }
  .topbar .ttl { font: 500 18px/1 var(--serif); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar label { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); color: var(--text); cursor: pointer; }
  .topbar label:hover { background: var(--surface-2); }
  .page { padding: 18px 14px 44px; gap: 16px; }
  .page-head h1 { font-size: 24px; }
  .avatar-lg { width: 46px; height: 46px; font-size: 19px; }
  .cols, .cols-3, .cards-3 { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .kpis, .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis .kpi { border-bottom: 1px solid var(--line); } .kpis .kpi:nth-child(2n) { border-right: 0; } .kpis .kpi:last-child { border-bottom: 0; }
  .kpis:not(.three):not(.four) .kpi:last-child { grid-column: 1 / -1; }
  .kpis.three .kpi { padding: 12px 12px; border-bottom: 0; border-right: 1px solid var(--line); } .kpis.three .kpi:nth-child(2n) { border-right: 1px solid var(--line); } .kpis.three .kpi:last-child { border-right: 0; }
  .kpis.three .kpi .v { font-size: 26px; }
  .log-row { grid-template-columns: 44px 28px minmax(0, 1fr); gap: 0 9px; padding: 11px 12px; }
  .field-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .field-row .input, .field-row .ctl .input.wide { width: 100%; }
  .table th, .table td { padding: 10px 11px; }
  .w-md, .log-filters select.input, .log-filters .fs { width: 100%; }
  .log-filters .dash { display: none; }
  .log-filters .input[type='date'] { width: calc(50% - 4px); }
  .action { grid-template-columns: minmax(0, 1fr); }
  .filter-label { width: 100%; }
  .fold > summary { padding: 13px 14px; } .fold-body { padding: 14px; }
  .block { padding: 16px; }
}
@media (max-width: 720px) { .uptime { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; } .hide-sm { display: none; } .only-sm { display: block; margin: 5px 0 0 45px; } .tabs a { padding: 0 12px; } }
@media (min-width: 961px) { .topbar { display: none !important; } }
.btn-block { width: 100%; }

/* chart hover: instant, animated tooltip */
.chart-wrap { position: relative; }
.chart .hit { fill: transparent; }
.chart .bar { transition: fill .15s ease, opacity .15s ease; }
.chart-wrap.is-live .bar { opacity: .55; }
.chart-wrap.is-live .bar.on { opacity: 1; fill: var(--accent); }
.chart .guide, .chart .mark { opacity: 0; transition: transform .16s cubic-bezier(.2,.7,.3,1), opacity .15s ease; pointer-events: none; }
.chart .guide { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .mark { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }
.chart-wrap.is-live .guide, .chart-wrap.is-live .mark { opacity: 1; }
.chart-tip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; opacity: 0; white-space: nowrap;
  padding: 7px 11px; border-radius: 10px; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,.16); font-size: 12.5px; line-height: 1.3;
  transition: transform .16s cubic-bezier(.2,.7,.3,1), opacity .15s ease; }
.chart-tip b { display: block; font-size: 15px; font-weight: 600; }
.chart-tip span { color: var(--text-3); }
.chart-wrap.is-live .chart-tip { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .chart .guide, .chart .mark, .chart-tip, .chart .bar { transition: none; } }

/* ---- pop-up window (opened by a link to #id, closed by Escape / the cross / the dark area) ---- */
.dlg { display: none; position: fixed; inset: 0; z-index: 60; place-items: center; padding: 20px; }
.dlg:target { display: grid; }
.dlg-scrim { position: absolute; inset: 0; background: var(--overlay); }
.dlg-card { position: relative; width: min(480px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); animation: pop-in .14s ease-out; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 12px 0 22px; }
.dlg-head h2 { font: 500 20px/1.2 var(--serif); }
.dlg-body { padding: 16px 22px 22px; }
.dlg-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ---- type-ahead list under a person field ---- */
.suggest-wrap { position: relative; }
.suggest { position: absolute; left: 0; right: 0; min-width: min(380px, 92vw); top: calc(100% + 5px); z-index: 40; max-height: 330px; overflow-y: auto; padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.suggest [role='option'] { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--r); cursor: pointer; }
.suggest [role='option']:hover, .suggest [role='option'].is-active { background: var(--surface-2); }
.suggest .person-txt b { font-weight: 500; }
.suggest mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; }
.suggest .s-tags { margin-left: auto; display: flex; gap: 4px; }
.suggest .s-empty { padding: 10px 12px; color: var(--text-3); font-size: 13.5px; }

/* ---- pictures in comments ---- */
.photo { display: block; width: fit-content; max-width: 100%; margin-top: 6px; }
.photo img { display: block; max-width: 190px; max-height: 130px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--sunken); }
.photo:hover img { border-color: var(--accent); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.photo-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.photo-card .photo { margin: 0; width: 100%; }
.photo-card .photo img { width: 100%; max-width: none; max-height: none; aspect-ratio: 4 / 3; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
.photo-meta { display: flex; flex-direction: column; gap: 9px; padding: 12px 14px 14px; }
.photo-who { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.photo-who time { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.photo-meta p { font-size: 13.5px; color: var(--text-2); word-break: break-word; }

/* ---- user card: feed in the middle, folding panels on the right, ⌘K ---- */
.stack { display: grid; gap: 20px; align-content: start; }
.lay-e { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 16px; }
.feed-head h2 { font: 500 18px/1.2 var(--serif); margin: 0; }
#feed, #comments, #playlists { scroll-margin-top: 12px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 0 12px; padding: 0 0 18px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: 0; width: 1px; background: var(--line-strong); }
.tl li:last-child::before { display: none; }
.tl .log-ico { position: relative; z-index: 1; }
.tl .tl-main { line-height: 1.4; padding-top: 4px; font-size: 14px; word-break: break-word; }
.tl .tl-main small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 1px; }
.tl time { color: var(--text-3); font-size: 12.5px; padding-top: 5px; white-space: nowrap; }
.cat-plays { --c: var(--c3); }
:root[data-theme='dark'] .cat-plays { --c: var(--c1); }
.cm { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.cm:first-child { padding-top: 0; } .cm:last-child { border-bottom: 0; padding-bottom: 0; }
.cm .btns .inline-form { justify-content: flex-end; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-table td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table td.r { text-align: right; color: var(--text-3); }
.mini-table td:nth-child(n+2) { padding-left: 14px; }

.props { display: grid; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow-y: auto; position: sticky; top: 12px; max-height: calc(100dvh - 24px); }
.acc { border-bottom: 1px solid var(--line); }
.acc:last-child { border-bottom: 0; }
.acc > summary { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; cursor: pointer; list-style: none; font-weight: 600; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:hover { background: var(--surface-2); }
.acc > summary .acc-t { flex: 1; }
.acc > summary .icon:last-child { color: var(--text-3); transition: transform .15s ease; }
.acc[open] > summary .icon:last-child { transform: rotate(180deg); }
.acc-body { padding: 2px 16px 16px; font-size: 14px; }
.acc .kv { font-size: 13.5px; gap: 8px 16px; }
.acc-actions { display: grid; gap: 8px; margin-top: 12px; }
.acc-actions .toolbar { margin: 0; }
.acc-sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0 12px; }
.acc.is-danger > summary { color: var(--danger); }
.acc .form-stack .input { width: 100%; }
.acc .lines .line:first-child { padding-top: 0; }

.cmd-btn { display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 8px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--text-2); font-weight: 500; }
.cmd-btn:hover { background: var(--surface-2); color: var(--text); }
.cmd-btn kbd { font: 600 11.5px/1 var(--font); padding: 4px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3); }
.pal { position: fixed; inset: 0; z-index: 70; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; background: var(--overlay); }
.pal-card { width: min(580px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; animation: pop-in .12s ease-out; }
.pal-in { width: 100%; height: 52px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 16px; outline: none; }
.pal-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.pal-grp { padding: 9px 10px 4px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.pal-form { margin: 0; }
.pal-item { display: flex; align-items: center; gap: 11px; width: 100%; height: 38px; padding: 0 10px; border: 0; border-radius: var(--r); background: none; color: var(--text); text-align: left; font-weight: 400; }
.pal-item:hover { text-decoration: none; }
.pal-item .icon { color: var(--text-3); }
.pal-item.is-active { background: var(--accent-soft); color: var(--accent); } .pal-item.is-active .icon { color: var(--accent); }
.pal-item.danger { color: var(--danger); } .pal-item.danger .icon { color: var(--danger); }
.pal-item.danger.is-active { background: var(--danger-soft); }
.pal-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.pal-none { padding: 18px; color: var(--text-3); text-align: center; }
@media (max-width: 1100px) { .lay-e { grid-template-columns: minmax(0, 1fr); } .props { position: static; max-height: none; } }
@media (max-width: 720px) { .cm { grid-template-columns: minmax(0, 1fr); } .cm .btns .inline-form { justify-content: flex-start; } .pal { padding-top: 6vh; } }

/* ---- uptime (answer time of the services we use) ---- */
.uptime { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, auto); grid-auto-flow: column; gap: 12px 28px; font-size: 14px; }   /* 3 columns, 2 services under each */
.uptime li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.u-dot { display: inline-block; width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--line-strong); }
.u-dot.lvl-good { background: var(--ok); }
.u-dot.lvl-mid { background: #e3b52f; }
.u-dot.lvl-bad, .u-dot.lvl-none { background: var(--danger); }
.u-name { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-ms { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; white-space: nowrap; flex: none; }
.lvl-none + .u-name + .u-ms, .uptime li:has(.lvl-bad) .u-ms { color: var(--danger); }

.h-with-btn { display: inline-flex; align-items: center; gap: 6px; }
.icon-btn-sm { width: 28px; height: 28px; }
.icon-btn[hidden] { display: none; }
.icon-btn.is-loading .icon { animation: spin .8s linear infinite; }
.icon-btn:disabled { cursor: default; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .icon-btn.is-loading .icon { animation: none; opacity: .5; } }

/* The status chip after a title is as tall as the capital letters of that title (0.7 em), centred on the lowercase letters, so its bottom hangs a little below the baseline; its text never drops below 11 px. */
.h1-row { --h: 28px; display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.h1-row h1 { font-size: var(--h); }
.h1-row .chip { --x: calc(var(--h) * .7); --f: max(11px, calc(var(--h) * .42)); height: var(--x); line-height: var(--x); padding: 0 calc(var(--f) * .65); font-size: var(--f); font-weight: 500; border-radius: 4px; position: relative; top: calc(var(--x) / -2 + var(--f) * .3 + var(--h) * .12); }
@media (max-width: 960px) { .h1-row { --h: 24px; } }

/* ---- badges master switch ---- */
.switch-form { display: inline-flex; align-items: center; margin: 0; }
.switch-form .switch { padding: 6px 12px 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font-weight: 500; }
.switch-form .switch:hover { background: var(--surface-2); }
.switch-text { margin-left: 2px; }
.cards.is-muted { opacity: .55; }

/* ---- choosing a person: list under the field + the tag in the field ---- */
.suggest .s-item { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--r); cursor: pointer; }
.suggest .s-item:hover, .suggest .s-item.is-active { background: var(--surface-2); }
.suggest .person-txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-xs { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
.tf-box { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 36px; padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: text; transition: border-color .1s, box-shadow .1s; }
.tf-box:hover { border-color: var(--text-3); }
.tf-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tf-in { flex: 1 1 120px; min-width: 90px; height: 28px; padding: 0 4px; border: 0; background: transparent; outline: none; color: inherit; }
.tf-in::placeholder { color: var(--text-3); }
.tf-box.has-token .tf-in { flex: 0 0 6px; min-width: 6px; width: 6px; padding: 0; opacity: 0; }            /* still focusable: Backspace takes the tag away */
.tf-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 2px 3px 2px 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-2); font-size: 13.5px; }
.tf-chip .avatar-xs { border-radius: 50%; }
.tf-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-login { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.tf-x { display: grid; place-items: center; width: 20px; height: 20px; margin-left: 2px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); font-size: 16px; line-height: 1; padding: 0; }
.tf-x:hover { background: var(--danger-soft); color: var(--danger); }

/* ---- campaigns: composer, phone preview ---- */
.segpick { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); flex-wrap: wrap; }
.segopt { position: relative; cursor: pointer; }
.segopt input { position: absolute; opacity: 0; inset: 0; }
.segopt span { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 4px; color: var(--text-2); font-weight: 500; }
.segopt input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line-strong); font-weight: 600; }
.segopt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint-line { margin-top: 10px; font-size: 13.5px; }
.count-line { margin-top: 12px; color: var(--text-2); font-size: 14px; }
.count-line b { color: var(--text); font-size: 16px; }
.lang-h { font: 500 16px/1.2 var(--serif); }
.compose textarea.input { min-height: 96px; }
.send-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.preview-panel { padding: 16px; gap: 14px; overflow-y: auto; }
.prev-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prev-note { font-size: 12.5px; text-align: center; }
.phone { width: min(310px, 100%); margin: 0 auto; padding: 9px; border-radius: 38px; background: #060c0b; box-shadow: 0 0 0 1px var(--line-strong), var(--shadow); }
.phone-screen { display: flex; flex-direction: column; justify-content: flex-start; gap: 12px; min-height: 660px; padding: 46px 14px 30px; border-radius: 32px; background: linear-gradient(180deg, #0f1a19, #0a1211); position: relative; }
.toast-prev { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 16px; background: #1a2827; color: #e3eeec; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.toast-prev .icon { color: #4fd8c6; flex: none; }
.toast-img { flex: none; width: 36px; height: 36px; border-radius: 9px; background: #243635; overflow: hidden; }
.toast-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.toast-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.toast-txt b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-txt small { font-size: 12px; color: #9db3b0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.promo { --promo: #3DD6C0; display: flex; flex-direction: column; gap: 14px; text-align: center; color: #e3eeec; flex: 1 1 auto; min-height: 0; }      /* fills the screen: text in the middle, the button at the bottom, as in the app */
.promo-hero, .promo h3, .promo-card { margin: 0; }
.promo-hero { margin-top: auto; }
.promo-card { margin-bottom: auto; }
.promo-hero { display: grid; place-items: center; }
.promo-icon { color: var(--promo); display: grid; place-items: center; }
.promo-icon[hidden] { display: none; }
.promo-img { width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #1a2827; }
.promo-img:empty { display: none; }
.promo-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo h3 { font: 800 21px/1.2 var(--font); letter-spacing: -.01em; color: #fff; word-break: break-word; }
.promo h3:empty, .promo-card:empty { display: none; }
.promo-card { padding: 0 4px; color: #9db3b0; font-size: 16px; line-height: 1.5; white-space: pre-line; word-break: break-word; }
.promo-btn { display: block; margin-top: 8px; padding: 12px; border-radius: 14px; background: #3DD6C0; color: #04201d; font-weight: 600; font-size: 15px; }
.promo-close { font-size: 13px; color: #9db3b0; }
.promo[hidden], .toast-prev[hidden], .promo-close[hidden], .count-line[hidden], [data-who][hidden] { display: none; }
@media (max-width: 1100px) { .preview-panel { order: -1; } }

/* ---- photo viewer ---- */
.lb { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 56px 64px 18px; }
.lb[hidden] { display: none; }
.lb-scrim { position: absolute; inset: 0; background: rgba(4, 9, 8, .92); }
.lb-fig { position: relative; margin: 0; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lb-img { max-width: 100%; max-height: calc(100dvh - 230px); min-height: min(52dvh, 460px); object-fit: contain; border-radius: 10px; background: #0e1a19; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: pop-in .14s ease-out; cursor: zoom-in; }
.lb-fig.is-actual { overflow: auto; max-height: calc(100dvh - 190px); }
.lb-fig.is-actual .lb-img { max-width: none; max-height: none; min-height: 0; cursor: zoom-out; }
.lb-cap { max-width: 640px; text-align: center; color: #cfe0dd; font-size: 14px; line-height: 1.45; }
.lb-cap b { color: #fff; font-weight: 600; }
.lb-cap small { display: block; color: #8aa09d; font-size: 12.5px; margin-top: 2px; }
.lb-btn { position: absolute; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 26px; line-height: 1; padding: 0; }
.lb-btn:hover { background: rgba(255,255,255,.22); }
.lb-btn:disabled { opacity: .25; cursor: default; }
.lb-x { top: 12px; right: 14px; } .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); } .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-bar { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; color: #8aa09d; font-size: 13px; padding-top: 10px; }
.lb-bar a, .lb-bar button { color: #fff; }
.lb-bar .btn { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.08); }
.lb-bar .btn-danger-ghost { color: #ff9a90; }
@media (max-width: 720px) { .lb { padding: 56px 10px 14px; } .lb-prev { left: 4px; } .lb-next { right: 4px; } }

.phone-notch { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 92px; height: 26px; border-radius: 14px; background: #000; }
.phone-home { position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%); width: 110px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.35); }

/* ---- composer: cards, tabs, dropzone, swatches, sticky send bar ---- */
.kindcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kindcard { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s; }
.kindcard:hover { background: var(--surface-2); }
.kindcard input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.kc-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.kc-t { display: flex; flex-direction: column; gap: 2px; }
.kc-t b { font-weight: 600; } .kc-t small { color: var(--text-3); font-size: 12.5px; line-height: 1.35; }
.kindcard:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.kindcard:has(input:checked) .kc-ico { background: var(--accent); color: var(--on-accent); }
.kindcard:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.who-field { margin-top: 14px; }
.who-field[hidden] { display: none; }
.count-line { margin-top: 14px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); color: var(--text-2); font-size: 13.5px; }
.count-line b { color: var(--accent); font-size: 17px; margin-right: 2px; }
.langtabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.langtabs button { height: 32px; padding: 0 16px; border: 0; border-radius: 4px; background: transparent; color: var(--text-2); font-weight: 500; }
.langtabs button.is-on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--line-strong); }
.lang-panel { display: grid; gap: 16px; margin-top: 14px; }
.lang-panel[hidden] { display: none; }
.lang-panel .field { position: relative; }
.counter { position: absolute; right: 0; top: 0; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.stack-s { display: grid; gap: 18px; }
.dropzone { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dz-ico { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); color: var(--accent); }
.dz-txt { display: flex; flex-direction: column; gap: 2px; } .dz-txt small { color: var(--text-3); font-size: 12.5px; }
.dz-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 8px 12px; border-radius: var(--r); background: var(--surface-2); font-size: 13.5px; }
.dz-file[hidden] { display: none; }
.dz-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatchrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sw { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 2px solid transparent; border-radius: 50%; background: transparent; }
.sw:hover { background: var(--surface-2); }
.sw.is-on { border-color: var(--text); }
.sw .swatch-dot { vertical-align: 0; }
.swatchrow .input.color { -webkit-appearance: none; appearance: none; width: 34px; height: 34px; padding: 4px; flex: none; cursor: pointer; border: 2px solid transparent; border-radius: 50%;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(#ff3b3b, #ffd23b, #3bff6b, #3bf0ff, #3b5bff, #d03bff, #ff3b3b) border-box; }
.swatchrow .input.color::-webkit-color-swatch-wrapper { padding: 0; }
.swatchrow .input.color::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatchrow .input.color::-moz-color-swatch { border: 0; border-radius: 50%; }
.send-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.send-sum { font-weight: 500; color: var(--text-2); font-size: 14px; }
.send-btns { display: flex; gap: 8px; }
.send-hint { flex-basis: 100%; font-size: 13px; }
.send-hint:empty { display: none; }
@media (max-width: 720px) { .kindcards { grid-template-columns: minmax(0, 1fr); } .kindcard { flex-direction: row; align-items: center; } }
