/* Owner panel — /inbox/. Same look as the website: dark, warm accent, Archivo + Geist. */
:root {
  --bg: #0a0a0d; --side: #0d0d11; --card: #121217; --card-2: #17171e; --card-3: #1e1e26;
  --ink: #eeece6; --ink-2: rgba(238, 236, 230, 0.68); --ink-3: rgba(238, 236, 230, 0.44);
  --line: rgba(238, 236, 230, 0.1); --line-2: rgba(238, 236, 230, 0.2);
  --accent: #ff6a2b; --accent-ink: #0b0a0c; --mark: #f2602a;
  --ok: #3dff8b; --warn: #ffb547; --bad: #ff5a64; --wa: #25d366;
  --panel: #101015;
  --f-display: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --f-body: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --r: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: radial-gradient(70% 45% at 85% -10%, rgba(255, 106, 43, 0.12), transparent 60%), var(--bg);
  color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
code { font-family: var(--f-mono); font-size: 0.86em; background: rgba(255, 255, 255, 0.06); padding: 1px 6px; border-radius: 6px; }
.mono { margin: 0; font: 500 11px/1.3 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───── buttons, inputs ───── */
.btn {
  height: 40px; padding: 0 14px; border-radius: 12px; border: 0; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap;
  text-decoration: none; transition: background-color 0.2s, box-shadow 0.2s, color 0.2s, transform 0.15s var(--ease);
}
.btn:hover { box-shadow: inset 0 0 0 1px var(--line-2); background: var(--card-3); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn svg { width: 17px; height: 17px; }
.btn--accent { background: var(--accent); color: var(--accent-ink); box-shadow: none; font-weight: 600; }
.btn--accent:hover { background: #ff7d45; box-shadow: none; }
.btn--wa { background: var(--wa); color: #052e14; box-shadow: none; font-weight: 600; }
.btn--wa:hover { background: #35dd75; box-shadow: none; }
.btn--danger { color: var(--bad); }
.btn--danger:hover { box-shadow: inset 0 0 0 1px var(--bad); background: rgba(255, 90, 100, 0.08); }
.dlg .btn--danger { background: var(--bad); color: #1a0306; box-shadow: none; font-weight: 600; }
.btn--ghost { background: transparent; }
.btn--sm { height: 34px; padding: 0 11px; font-size: 13px; border-radius: 10px; }
.btn--icon { width: 40px; padding: 0; }
.btn--wide { width: 100%; height: 48px; }
.btn.is-on { background: var(--ink); color: var(--accent-ink); box-shadow: none; }
.input, .textarea, .select {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 12px; border: 0; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); outline: none;
  transition: box-shadow 0.2s;
}
.input:focus, .textarea:focus, .select:focus { box-shadow: inset 0 0 0 1px var(--accent); }
.textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.select { appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9a7a2' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.field { display: block; margin: 0 0 14px; }
.field > span:first-child { display: flex; justify-content: space-between; margin: 0 0 6px; font: 500 11px/1.3 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.field small { font: 400 12px var(--f-body); letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.field .count { font: 500 11px var(--f-mono); letter-spacing: 0.04em; }
.field.is-bad .input, .field.is-bad .textarea { box-shadow: inset 0 0 0 1px var(--bad); }
.field__err { margin: 6px 0 0; color: var(--bad); font-size: 13px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.err { color: var(--bad); font-size: 14px; min-height: 1.4em; margin: 6px 0 8px; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { position: relative; width: 46px; height: 28px; border-radius: 99px; background: var(--card-3); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color 0.25s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform 0.3s var(--ease); }
.switch input:checked + i { background: #1c7a43; box-shadow: none; }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ───── login ───── */
.login { max-width: 430px; margin: 10vh auto 40px; padding: 28px; border-radius: 24px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.login h1 { margin: 6px 0 10px; font: 700 44px/0.95 var(--f-display); letter-spacing: -0.045em; font-variation-settings: 'wdth' 88; }
.login__lead { color: var(--ink-2); margin: 0 0 22px; }
.login .check { margin: 4px 0 6px; }
.pw { position: relative; display: block; }
.pw .input { padding-right: 70px; }
.pw button { position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 13px; }
.pw button:hover { color: var(--ink); }
.back { display: inline-flex; gap: 6px; margin-bottom: 18px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--ink); }
.hint { margin: 16px 0 0; font-size: 13px; color: var(--ink-3); }

/* ───── layout ───── */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 16px;
  background: var(--side); box-shadow: inset -1px 0 0 var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 10px; text-decoration: none; }
.brand > svg { width: 30px; height: 30px; stroke: var(--accent); stroke-width: 2; }
.brand span { display: grid; line-height: 1.2; min-width: 0; }
.brand b { font: 700 17px var(--f-display); letter-spacing: -0.02em; }
.brand small { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; text-decoration: none; color: var(--ink-2); font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}
.nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--ink); }
.nav a[aria-current='page'] { background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav a[aria-current='page'] svg { color: var(--accent); }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font: 700 12px/22px var(--f-body); text-align: center; }
.side__foot { margin-top: auto; display: grid; gap: 2px; }
.side__link { display: flex; justify-content: space-between; height: 40px; align-items: center; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink-3); text-decoration: none; font-size: 14px; cursor: pointer; text-align: left; }
.side__link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.main { min-width: 0; padding: calc(22px + env(safe-area-inset-top)) clamp(16px, 3.4vw, 44px) 80px; outline: none; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 0 0 22px; }
.top h1 { margin: 6px 0 0; font: 700 clamp(30px, 4.6vw, 52px)/0.95 var(--f-display); letter-spacing: -0.045em; font-variation-settings: 'wdth' 88; }
.top__actions { display: flex; align-items: center; gap: 8px; }
.top__logout { display: none; }
.sync { font-size: 12px; color: var(--ink-3); }
.tabbar { display: none; }
.view { animation: rise 0.45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ───── cards ───── */
.grid { display: grid; gap: 14px; }
.grid--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.grid--even { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.card { padding: 20px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.card__head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 14px; }
.card__head h2, .card h2 { margin: 0; font: 600 19px/1.2 var(--f-display); letter-spacing: -0.02em; font-variation-settings: 'wdth' 92; }
.card__head .link, .link { color: var(--ink-2); font-size: 13px; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.card__head .link:hover, .link:hover { color: var(--accent); }
.card p { margin: 0 0 10px; }
.muted { color: var(--ink-3); }
.sub { color: var(--ink-2); font-size: 14px; }
.stack { display: grid; gap: 14px; }

/* KPI tiles */
.kpi { padding: 18px 18px 16px; }
.kpi__label { font-size: 13px; color: var(--ink-2); margin: 0 0 8px; }
.kpi__value { font: 600 38px/1 var(--f-body); letter-spacing: -0.03em; }
.kpi--accent { background: linear-gradient(160deg, rgba(255, 106, 43, 0.16), rgba(255, 106, 43, 0.04)), var(--card); box-shadow: inset 0 0 0 1px rgba(255, 106, 43, 0.3); }
.kpi__delta { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); }
.kpi__delta b { font-weight: 600; }
.up { color: var(--ok); }
.down { color: #ff8a8f; }

/* chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; fill: initial; stroke: none; }
.chart .grid-line { stroke: rgba(238, 236, 230, 0.09); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font: 500 10.5px var(--f-mono); font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--mark); transition: opacity 0.15s; }
.chart .bar.is-zero { fill: rgba(238, 236, 230, 0.12); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.is-hot { filter: brightness(1.18); }
.chart:focus-visible { outline-offset: 6px; border-radius: 8px; }
.tip {
  position: absolute; pointer-events: none; z-index: 3; padding: 8px 11px; border-radius: 10px; background: #f3f1ec; color: #111;
  font-size: 12.5px; line-height: 1.35; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.tip b { font-size: 15px; display: block; }
.tip span { color: #555; }
.table-toggle { margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.table-toggle summary { cursor: pointer; }
.table-toggle summary:hover { color: var(--ink); }
.tbl { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 7px 8px; box-shadow: inset 0 -1px 0 var(--line); }
.tbl th { font: 500 11px var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { max-height: 260px; overflow: auto; }

/* bar list (by type) */
.bars { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 13.5px; }
.bars .track { grid-column: 1 / -1; height: 8px; border-radius: 0 4px 4px 0; background: rgba(238, 236, 230, 0.06); overflow: hidden; }
.bars .fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--mark); }
.bars b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* small lists */
.mini { margin: 0; padding: 0; list-style: none; display: grid; }
.mini li + li { box-shadow: inset 0 1px 0 var(--line); }
.mini a, .mini button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; width: 100%; padding: 11px 2px; border: 0; background: none; text-align: left; text-decoration: none; cursor: pointer; border-radius: 8px; }
.mini a:hover b, .mini button:hover b { color: var(--accent); }
.mini b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini small { color: var(--ink-3); font-size: 12.5px; }
.mini .when { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--ink-3); font-size: 12.5px; }
.caught { display: flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 8px 0; }
.caught svg { color: var(--ok); }

/* status pill (availability) */
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line); font: 500 12px var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 1.9s var(--ease) infinite; }
.dot--busy { background: var(--warn); }
.dot--busy::after { animation: none; }
@keyframes ping { from { transform: scale(1); opacity: 0.7; } to { transform: scale(3.4); opacity: 0; } }

/* system checklist */
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 10px; font-size: 14px; }
.checks li > svg { width: 18px; height: 18px; margin-top: 2px; }
.checks small { grid-column: 2; color: var(--ink-3); font-size: 12.5px; }
.checks .ok svg { color: var(--ok); }
.checks .off svg { color: var(--ink-3); }
.checks .bad svg { color: var(--bad); }

/* ───── enquiries ───── */
.toolbar { position: sticky; top: 0; z-index: 4; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 0 12px; margin-top: -10px; background: linear-gradient(var(--bg) 75%, transparent); }
.toolbar .input { flex: 1 1 220px; min-width: 0; }
.toolbar .select { width: auto; flex: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 12px; border-radius: 99px; border: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--accent-ink); box-shadow: none; }
.chip em { font-style: normal; opacity: 0.65; margin-left: 4px; }
.menu { position: relative; }
.menu__list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; min-width: 250px; padding: 6px; border-radius: 14px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 40px rgba(0, 0, 0, 0.45); }
.menu__list button { display: grid; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; font-size: 14px; }
.menu__list button small { color: var(--ink-3); font-size: 12px; }
.menu__list button:hover { background: rgba(255, 255, 255, 0.05); }
.list { display: grid; gap: 12px; }
.msg { position: relative; padding: 18px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.3s, background-color 0.3s; }
.msg.unread { background: var(--card-2); box-shadow: inset 0 0 0 1px rgba(255, 106, 43, 0.32); }
.msg.unread::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.msg.is-picked { box-shadow: inset 0 0 0 2px var(--accent); }
.msg.is-flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 30% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 6px rgba(255, 106, 43, 0.18); } }
.msg__head { display: flex; gap: 12px; align-items: flex-start; }
.msg__pick { display: none; margin-top: 4px; }
.picking .msg__pick { display: block; }
.msg__pick input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.msg__who { flex: 1; min-width: 0; }
.msg__name { margin: 0; font: 600 20px/1.2 var(--f-display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.msg__meta { display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.msg__side { display: flex; gap: 6px; align-items: center; flex: none; }
.star { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.star:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.star[aria-pressed='true'] { color: #ffc531; }
.star[aria-pressed='true'] svg { fill: currentColor; }
.stage { height: 34px; width: auto; min-height: 0; padding: 0 30px 0 11px; font-size: 13px; border-radius: 10px; background-color: var(--card-3); background-position: right 8px center; }
.stage[data-v='won'] { color: var(--ok); }
.stage[data-v='lost'] { color: var(--ink-3); }
.tag { padding: 3px 9px; border-radius: 99px; background: rgba(255, 106, 43, 0.14); color: var(--accent); font-weight: 600; font-size: 12px; }
.via { padding: 3px 9px; border-radius: 99px; background: rgba(61, 255, 139, 0.09); color: var(--ok); font-weight: 600; font-size: 12px; }
.via--popup { background: rgba(120, 160, 255, 0.13); color: #9db8ff; }
.new { padding: 3px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 11px; letter-spacing: 0.04em; }
.msg__body { margin: 14px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__body.is-clamped { max-height: 9.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.msg__more { margin: -6px 0 12px; }
.msg__contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; margin-bottom: 14px; }
.contact { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.contact a, .contact > div { display: grid; flex: 1; min-width: 0; text-decoration: none; }
.contact span { font: 500 10.5px var(--f-mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; }
.contact b { font-weight: 500; overflow-wrap: anywhere; }
.contact a:hover b { color: var(--accent); }
.copy { flex: none; width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.copy:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.copy svg { width: 17px; height: 17px; }
.msg__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.note-box { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 197, 49, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 197, 49, 0.2); }
.note-box p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.note-box .mono { color: #e2b23a; margin-bottom: 6px; }
.note-edit { margin-top: 14px; display: grid; gap: 8px; }
.note-edit .textarea { min-height: 80px; }
.note-edit div { display: flex; gap: 8px; }
.bulk {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 20; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 24px);
  padding: 10px; border-radius: 16px; background: #1c1c24; box-shadow: inset 0 0 0 1px var(--line-2), 0 20px 50px rgba(0, 0, 0, 0.55);
}
.bulk b { padding: 0 6px; font-size: 14px; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-2); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.note { padding: 22px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); line-height: 1.6; color: var(--ink-2); }
.note b { color: var(--ink); }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin: 0 0 14px; border-radius: 14px; background: rgba(120, 160, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(120, 160, 255, 0.22); font-size: 14px; color: var(--ink-2); }
.banner svg { color: #9db8ff; margin-top: 1px; }
.banner b { color: var(--ink); }

/* ───── updates ───── */
.compose { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.compose__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.compose__opts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 4px 0 18px; }
.compose__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.compose__date { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }
.preview { position: sticky; top: 16px; }
.preview .posts { display: grid; gap: 14px; }
.upd { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; padding: 16px 18px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.upd.is-draft { background: transparent; box-shadow: inset 0 0 0 1px var(--line); opacity: 0.85; }
.upd__meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font: 500 11px var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.upd__meta em { font-style: normal; padding: 3px 8px; border-radius: 99px; color: var(--accent); background: rgba(255, 106, 43, 0.12); }
.flag { padding: 3px 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); color: var(--ink-2); }
.flag--pin { background: rgba(255, 197, 49, 0.12); color: #ffc531; }
.upd h3 { margin: 6px 0 4px; font: 600 18px/1.25 var(--f-display); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.upd p { margin: 0; color: var(--ink-2); font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.upd__actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.upd.is-editing { box-shadow: inset 0 0 0 2px var(--accent); }

/* "your home page shows the newest [3] [5] [10] notes" */
.shown { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14.5px; color: var(--ink-2); }
.seg { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: grid; place-items: center; min-width: 44px; height: 36px; padding: 0 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 600; color: var(--ink); transition: background-color 0.2s, color 0.2s; }
.seg:hover span { box-shadow: inset 0 0 0 1px var(--ink-2); }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the post card, exactly as on the website */
.post {
  display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 22px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none;
}
a.post:hover { box-shadow: inset 0 0 0 1px rgba(255, 106, 43, 0.6); }
.post__img { display: block; margin: -8px -8px 6px; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 10; background: #111; }
.post__img img { width: 100%; height: 100%; object-fit: cover; }
.post__meta { display: flex; gap: 10px; align-items: center; font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); }
.post__meta em { font-style: normal; padding: 4px 8px; border-radius: 99px; color: var(--accent); background: rgba(255, 106, 43, 0.12); }
.post__title { font-family: var(--f-display); font-weight: 600; font-variation-settings: 'wdth' 90; font-size: 21px; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.post__text { color: var(--ink-2); font-size: 14.5px; white-space: pre-line; overflow-wrap: anywhere; }
.post__go { margin-top: auto; padding-top: 6px; font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }

/* ───── settings ───── */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.status-edit { display: grid; gap: 14px; }
.logins td small { display: block; color: var(--ink-3); }

/* ───── toast, dialog, alarm ───── */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 40; transform: translate(-50%, 180%);
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--accent-ink); font-weight: 500;
  visibility: hidden; transition: transform 0.5s var(--ease), visibility 0s 0.5s;
}
.toast.on { transform: translate(-50%, 0); visibility: visible; transition: transform 0.5s var(--ease), visibility 0s; }
.toast a { color: inherit; font-weight: 700; }
.dlg { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 20px; background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 80px rgba(0, 0, 0, 0.6); }
.dlg::backdrop { background: rgba(5, 5, 8, 0.66); }
.dlg form { padding: 22px; }
.dlg h2 { margin: 0 0 10px; font: 600 21px/1.2 var(--f-display); letter-spacing: -0.02em; }
.dlg p { margin: 0 0 10px; color: var(--ink-2); }
.dlg__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.alarm { margin: 16px; padding: 16px 18px; border-radius: 14px; background: rgba(255, 90, 100, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 90, 100, 0.55); line-height: 1.55; }
.alarm b { color: var(--bad); }
.loading { opacity: 0.55; transition: opacity 0.2s; }
.skeleton { height: 120px; border-radius: var(--r); background: linear-gradient(90deg, var(--card) 30%, var(--card-2) 50%, var(--card) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ───── phones & small screens ───── */
@media (max-width: 1100px) {
  .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--2, .compose { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top__logout { display: inline-flex; }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(13, 13, 17, 0.94); box-shadow: inset 0 1px 0 var(--line);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .tabbar a { position: relative; display: grid; justify-items: center; gap: 3px; padding: 7px 4px; border-radius: 12px; color: var(--ink-3); text-decoration: none; font-size: 11.5px; font-weight: 500; }
  .tabbar a[aria-current='page'] { color: var(--ink); }
  .tabbar a[aria-current='page'] svg { color: var(--accent); }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; line-height: 18px; }
  .bulk { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .grid--even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .sync { display: none; }
  .top { align-items: flex-start; }
  .top h1 { font-size: 32px; }
  .kpi__value { font-size: 32px; }
  .compose__row { grid-template-columns: minmax(0, 1fr); }
  .msg { padding: 16px 14px; }
  .msg__head { flex-wrap: wrap; }
  .msg__side { width: 100%; justify-content: space-between; }
  .msg__actions .btn { flex: 1 1 auto; }
  .upd { grid-template-columns: minmax(0, 1fr); }
  .upd__actions { justify-content: flex-start; }
  .toolbar .select { flex: 1 1 40%; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .login { margin-top: 6vh; padding: 22px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
