/* XLeo Client Portal — same neutral canvas / mono micro-label grammar as xleo.dev */
:root {
  --bg: #0a0a0a;
  --panel: #111114;
  --panel-2: #17171b;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.62);
  --dim: rgba(255, 255, 255, 0.38);
  --accent: #7acaff;
  --accent-dark: #0099ff;
  --accent-dim: rgba(122, 202, 255, 0.14);
  --amber: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --violet: #c084fc;
  --radius: 14px;
  --font-head: 'Space Grotesk', 'Poppins', sans-serif;
  --font-body: 'Poppins', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 0.95rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body::before { /* the same quiet navy bloom the portfolio hero sits on */
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(60% 50% at 8% 0%, rgba(0, 153, 255, 0.13), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -0.02em; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 600; }
h2 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.eyebrow {
  font: 400 0.64rem/1 var(--font-mono);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--dim);
}
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--font-mono); }
.noscript { padding: 2rem; text-align: center; }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.62rem 1.1rem; min-height: 40px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: transparent; cursor: pointer;
  font: 500 0.78rem/1 var(--font-head); letter-spacing: 0.12em; text-transform: uppercase;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-danger { border-color: rgba(248, 113, 113, 0.4); color: var(--red); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); }
.btn-sm { min-height: 34px; padding: 0.45rem 0.8rem; font-size: 0.68rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

label { display: block; }
.field { display: grid; gap: 0.4rem; margin-bottom: 1.1rem; }
.field > span { font: 400 0.64rem/1 var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
input, select, textarea {
  width: 100%; padding: 0.7rem 0.85rem; min-height: 44px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line-2); border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
}
textarea { resize: vertical; min-height: 110px; }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.28); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: rgba(122, 202, 255, 0.05); }
select option { background: #151518; }
.form-error { color: var(--red); font-size: 0.85rem; min-height: 1.3em; margin-bottom: 0.6rem; }
.hint { font-size: 0.8rem; color: var(--dim); margin-top: -0.4rem; margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: min(420px, 100%); padding: 2.2rem 2rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.brand { font: 700 1.5rem/1 var(--font-head); letter-spacing: 0.04em; }
.brand .x { color: var(--accent); }
.auth-card .brand { display: block; margin-bottom: 0.5rem; }
.auth-card h1 { font-size: 1.5rem; margin: 1.6rem 0 0.4rem; }
.auth-card .lede { color: var(--muted); font-size: 0.88rem; margin-bottom: 1.6rem; }
.auth-card .btn-primary { width: 100%; margin-top: 0.3rem; }
.auth-foot { margin-top: 1.4rem; text-align: center; font-size: 0.8rem; color: var(--dim); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 26px 14px 18px; border-right: 1px solid var(--line); background: rgba(10, 10, 12, 0.7);
}
.side .brand { padding: 0 12px; }
.side .portal-tag { padding: 6px 12px 0; }
.nav { display: grid; gap: 4px; margin-top: 2rem; }
.nav a {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.62rem 0.75rem; border-radius: 10px;
  color: var(--muted); font-weight: 500; transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-dim); color: var(--text); }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav .label { flex: 1; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  display: inline-grid; place-items: center;
  background: var(--accent-dark); color: #fff; font: 600 0.68rem/1 var(--font-mono);
}
.badge:empty { display: none; }
.side-foot { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.side-foot strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot button { justify-self: start; margin-top: 6px; background: none; border: 0; padding: 0; color: var(--dim); cursor: pointer; font-size: 0.82rem; }
.side-foot button:hover { color: var(--text); }

.main { padding: 44px clamp(20px, 4vw, 56px) 90px; width: 100%; max-width: 1120px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.page-head .eyebrow { margin-bottom: 0.8rem; }
.crumb { display: inline-block; margin-bottom: 1rem; font-size: 0.82rem; color: var(--muted); }

/* ---------- cards & lists ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; }
.card + .card, .section + .section { margin-top: 1.2rem; }
.section { margin-top: 2.4rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.stack > * + * { margin-top: 1.2rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; }
.tile {
  display: block; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: inherit; transition: border-color 0.15s, transform 0.15s;
}
.tile:hover { border-color: var(--line-2); text-decoration: none; transform: translateY(-2px); }
.tile .n { display: block; font: 600 2rem/1 var(--font-head); margin: 0.9rem 0 0; }
.tile--attn { border-color: rgba(251, 191, 36, 0.35); }
.tile--attn .n { color: var(--amber); }

.list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 1rem; align-items: center;
  padding: 0.95rem 1.2rem; color: inherit; border-top: 1px solid var(--line);
  transition: background 0.15s;
}
.row:first-child { border-top: 0; }
a.row:hover { background: rgba(255, 255, 255, 0.035); text-decoration: none; }
.row-title { font-weight: 500; display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.row-title span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { font-size: 0.8rem; color: var(--dim); grid-column: 1; }
.row-side { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: 0.7rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 10px var(--accent); }
.empty { padding: 2.2rem 1.2rem; text-align: center; color: var(--dim); border: 1px dashed var(--line-2); border-radius: var(--radius); }

.pill {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.28rem 0.65rem; border-radius: 99px;
  font: 500 0.64rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid currentColor; background: color-mix(in srgb, currentColor 12%, transparent);
}
.pill--pending { color: var(--amber); }
.pill--in_progress { color: var(--accent); }
.pill--completed { color: var(--green); }
.pill--awaiting_approval { color: var(--violet); }
.pill--declined, .pill--cancelled { color: var(--dim); }
.pill--urgent { color: var(--red); }
.pill--off { color: var(--red); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.2rem; }
.chip {
  padding: 0.42rem 0.9rem; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted);
  font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase;
}
.chip:hover { color: var(--text); text-decoration: none; border-color: rgba(255, 255, 255, 0.3); }
.chip.active { background: var(--accent-dim); border-color: rgba(122, 202, 255, 0.5); color: var(--text); }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.2rem; align-items: start; }
.facts { display: grid; gap: 1rem; }
.facts dt { font: 400 0.62rem/1 var(--font-mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); margin-bottom: 0.35rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- messaging ---------- */
.thread { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.thread-scroll { overflow-y: auto; padding: 1.2rem; min-height: 220px; max-height: 58vh; display: flex; flex-direction: column; gap: 0.55rem; }
.thread--tall .thread-scroll { max-height: none; height: min(62vh, 640px); }
.msg { max-width: min(78%, 560px); padding: 0.6rem 0.9rem; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); overflow-wrap: anywhere; }
.msg .who { display: block; font: 400 0.62rem/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin-bottom: 0.35rem; }
.msg .body { white-space: pre-wrap; }
.msg time { display: block; margin-top: 0.3rem; font-size: 0.68rem; color: var(--dim); }
.msg--mine { align-self: flex-end; background: var(--accent-dark); border-color: var(--accent-dark); border-bottom-right-radius: 4px; }
.msg--mine .who, .msg--mine time { color: rgba(255, 255, 255, 0.7); }
.msg--theirs { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-sys, .msg-day { align-self: center; font: 400 0.64rem/1.4 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); text-align: center; }
.msg-sys { padding: 0.3rem 0.8rem; border: 1px solid var(--line); border-radius: 99px; }
.msg-day { margin-top: 0.4rem; }
.composer { display: flex; gap: 0.7rem; align-items: flex-end; padding: 0.9rem; border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.composer textarea { min-height: 44px; height: 44px; max-height: 160px; resize: none; padding-block: 0.5rem; }
.composer .btn { flex: none; }

/* ---------- misc ---------- */
.creds { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.05); }
.creds code {
  display: inline-block; margin: 0.2rem 0; padding: 0.35rem 0.7rem; border-radius: 8px;
  background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line-2); font: 500 0.95rem var(--font-mono); user-select: all;
}
.site-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 0.7rem; margin-bottom: 0.7rem; align-items: start; }
details.card > summary { cursor: pointer; font: 500 0.78rem var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
details.card[open] > summary { margin-bottom: 1.2rem; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 16px; padding: 1.6rem; width: min(460px, calc(100% - 2rem)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(3px); }
dialog h2 { margin-bottom: 0.5rem; font-size: 1.2rem; }
dialog p { color: var(--muted); margin-bottom: 1rem; font-size: 0.9rem; }

#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: grid; gap: 10px; width: min(360px, calc(100% - 36px)); }
.toast {
  padding: 0.8rem 1rem; background: #18181d; border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  border-radius: 10px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); font-size: 0.88rem; color: var(--text);
  animation: toast-in 0.25s ease-out both; display: block;
}
a.toast:hover { text-decoration: none; background: #1d1d23; }
.toast--error { border-left-color: var(--red); }
.toast strong { display: block; font: 500 0.64rem/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin-bottom: 0.35rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.loading { padding: 4rem 0; text-align: center; color: var(--dim); font: 400 0.7rem var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; }

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .detail aside { order: -1; }
}

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .main { padding: 28px 18px 48px; }
  .grid-2 { grid-template-columns: 1fr; }
  .site-row { grid-template-columns: 1fr; }
  .msg { max-width: 88%; }
  .row { padding: 0.9rem 1rem; grid-template-columns: minmax(0, 1fr); }
  .row-side { grid-row: auto; grid-column: 1; margin-top: 0.35rem; flex-wrap: wrap; }
  #toasts { bottom: calc(18px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- utilities (no inline styles — the CSP forbids them) ---------- */
.w-md { max-width: 680px; }
.w-sm { max-width: 520px; }
.mt-sm { margin-top: 0.5rem; }
.mt-1 { margin-top: 0.8rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.9rem; }
.mb-2 { margin-bottom: 1.3rem; }
.my-2 { margin: 1rem 0; }
.label-gap { margin: 0.4rem 0 0.7rem; }
.creds-lede { margin: 0.8rem 0 0.4rem; }
.creds .mono { font-size: 0.78rem; }

/* =====================================================================
   Design pass — mono micro-labels, status accents, avatars, motion
   ===================================================================== */
body::before {
  background:
    radial-gradient(60% 50% at 8% 0%, rgba(0, 153, 255, 0.14), transparent 70%),
    radial-gradient(40% 40% at 100% 100%, rgba(0, 153, 255, 0.05), transparent 70%),
    radial-gradient(rgba(140, 175, 235, 0.055) 1px, transparent 1px) 0 0 / 30px 30px;
}

/* section titles use the same mono micro-label grammar as xleo.dev */
.section-head h2 {
  font: 400 0.66rem/1 var(--font-mono); letter-spacing: 0.26em; text-transform: uppercase; color: var(--dim);
}
.section-head a { font: 400 0.7rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; }
.page-head h1 { font-weight: 600; letter-spacing: -0.03em; }

/* sidebar */
.nav a { position: relative; }
.nav a.active::before {
  content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.side .brand { font-size: 1.35rem; }

/* ---------- avatars (colours borrowed from the portfolio's per-project palette) ---------- */
.avatar {
  --av: #4f8dff;
  flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font: 600 0.72rem/1 var(--font-head); letter-spacing: 0.04em; color: var(--av);
  background: color-mix(in srgb, var(--av) 16%, transparent); border: 1px solid color-mix(in srgb, var(--av) 45%, transparent);
}
.av-0 { --av: #00e5ff; } .av-1 { --av: #4f8dff; } .av-2 { --av: #f97316; }
.av-3 { --av: #facc15; } .av-4 { --av: #34d399; } .av-5 { --av: #c084fc; }
.row-title .avatar { margin-right: 0.15rem; }

/* ---------- tiles ---------- */
.tile { position: relative; overflow: hidden; }
.tile::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(110% 80% at 0% 0%, color-mix(in srgb, var(--c, transparent) 15%, transparent), transparent 62%);
}
.tile .eyebrow { position: relative; display: flex; align-items: center; gap: 0.55rem; }
.tile .eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--dim)); }
.tile .n { position: relative; }
.tile--pending { --c: var(--amber); }
.tile--in_progress { --c: var(--accent); }
.tile--completed { --c: var(--green); }
.tile--awaiting_approval { --c: var(--violet); }
.tile--msg { --c: #c084fc; }
.tile--attn { border-color: color-mix(in srgb, var(--c, var(--amber)) 45%, transparent); }
.tile--attn .n { color: var(--c, var(--amber)); }

/* ---------- rows: status accent on the left edge ---------- */
.row { position: relative; }
.row--pending::before, .row--in_progress::before, .row--awaiting_approval::before, .row--completed::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0;
}
.row--pending::before { background: var(--amber); }
.row--in_progress::before { background: var(--accent); }
.row--completed::before { background: var(--green); opacity: 0.7; }
.row--awaiting_approval::before { background: var(--violet); }

/* ---------- progress tracker ---------- */
.track {
  list-style: none; margin: 0 0 1.4rem; padding: 1.2rem 1.4rem; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.track li { position: relative; display: grid; gap: 0.3rem; padding-top: 1.6rem; color: var(--dim); }
.track-dot {
  position: absolute; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid rgba(255, 255, 255, 0.22);
}
.track li:not(:last-child)::after {
  content: ''; position: absolute; top: 6px; left: 22px; right: 8px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.1);
}
.track-label { font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; }
.track-when { font-size: 0.78rem; min-height: 1.2em; }
.track li.is-done { color: var(--text); }
.track li.is-done .track-dot { background: var(--accent); border-color: var(--accent); }
.track li.is-done:not(:last-child)::after { background: var(--accent); }
.track li.is-now { color: var(--text); }
.track li.is-now .track-dot { border-color: var(--amber); background: var(--amber); box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.16); animation: pulse 2.2s ease-in-out infinite; }
.track--awaiting_approval li.is-now .track-dot { border-color: var(--violet); background: var(--violet); box-shadow: 0 0 0 5px rgba(192, 132, 252, 0.16); }
.track--in_progress li.is-now .track-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-dim); }
.track--completed li.is-done .track-dot { background: var(--green); border-color: var(--green); }
.track--completed li.is-done:not(:last-child)::after { background: var(--green); }
.track--declined li.is-now .track-dot { border-color: var(--red); background: var(--red); box-shadow: 0 0 0 5px rgba(248, 113, 113, 0.14); animation: none; }
.track--declined li.is-now .track-label { color: var(--red); }
.track--cancelled li.is-now .track-dot { border-color: var(--dim); background: var(--dim); box-shadow: none; animation: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px transparent; } }

/* ---------- banner (push-notification nudge) ---------- */
.banner { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; border-color: rgba(122, 202, 255, 0.3); background: linear-gradient(90deg, rgba(0, 153, 255, 0.1), var(--panel) 70%); }
.banner-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-dim); color: var(--accent); }
.banner-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.banner-copy { flex: 1; min-width: 0; }
.banner-copy p { font-size: 0.85rem; margin-top: 0.15rem; }
@media (max-width: 700px) { .banner { flex-wrap: wrap; } .banner-copy { flex-basis: calc(100% - 60px); } }

/* ---------- login ---------- */
.auth-hero { display: none; }
@media (min-width: 960px) {
  .auth-wrap { grid-template-columns: minmax(0, 520px) 420px; justify-content: center; gap: clamp(3rem, 8vw, 7rem); }
  .auth-hero { display: block; }
  .auth-card > .brand { display: none; }
  .auth-hero .brand { font-size: 1.6rem; }
  .auth-hero h2 { margin: 2.6rem 0 2.2rem; font-size: clamp(2.6rem, 4.4vw, 3.6rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; }
  .auth-hero .accent { color: var(--accent); }
  .auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
  .auth-points li { display: flex; align-items: baseline; gap: 1rem; color: var(--muted); }
  .auth-points span { font: 400 0.64rem/1 var(--font-mono); letter-spacing: 0.2em; color: var(--accent); }
}
.auth-card { backdrop-filter: blur(10px); background: rgba(17, 17, 20, 0.8); }

/* ---------- messaging polish ---------- */
.thread { background: linear-gradient(180deg, var(--panel), #0f0f12); }
.msg--mine { background: linear-gradient(180deg, #0b6bbe, var(--accent-dark)); border-color: transparent; }
.composer { background: rgba(10, 10, 12, 0.6); }

/* ---------- entrance (only on navigation, never on live refreshes) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.main.enter > * { animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.main.enter > :nth-child(2) { animation-delay: 0.05s; }
.main.enter > :nth-child(3) { animation-delay: 0.1s; }
.main.enter > :nth-child(4) { animation-delay: 0.15s; }
.main.enter > :nth-child(n + 5) { animation-delay: 0.2s; }

@media (max-width: 820px) {
  .track { padding: 1rem; }
  .track-when { display: none; }
}

.card .form-error:empty { min-height: 0; margin: 0; }

/* screens without the hero column (setup, forgot, reset) */
@media (min-width: 960px) { .auth-wrap--solo { grid-template-columns: minmax(0, 420px); } }

/* shared logins */
.pill--shared { color: #c084fc; }
.check { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 1.1rem; color: var(--muted); font-size: 0.9rem; cursor: pointer; }
.check input { width: auto; min-height: 0; margin-top: 0.3rem; accent-color: var(--accent-dark); flex: none; }
.check strong { color: var(--text); font-weight: 500; }

/* =====================================================================
   Layout & clarity pass — fill the page, two-column dashboards, guidance
   ===================================================================== */
.main { max-width: 1520px; margin-inline: auto; padding-top: 48px; }
@media (min-width: 1500px) {
  .shell { grid-template-columns: 264px minmax(0, 1fr); }
  .main { padding-inline: clamp(44px, 4.2vw, 80px); }
  .tile .n { font-size: 2.4rem; }
}
.page-sub { margin-top: 0.7rem; color: var(--muted); max-width: 62ch; }
.page-sub a { text-decoration: underline; text-underline-offset: 3px; }
.page-head { margin-bottom: 1.8rem; }

/* standing call-to-action for clients */
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav-cta { margin: 1.8rem 0 0; width: 100%; padding-block: 0.8rem; }
.nav-cta + .nav { margin-top: 1.3rem; }

/* two-column dashboard */
.dash { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 1.4rem; align-items: start; margin-top: 1.6rem; }
.dash .section { margin-top: 0; }
.dash-side .card { padding: 1.2rem 1.3rem; }
@media (max-width: 1100px) { .dash { grid-template-columns: minmax(0, 1fr); } }
.tiles { margin-top: 0.2rem; }

/* "how it works" strip for new clients */
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; margin-bottom: 1.4rem; padding: 1.3rem 1.5rem; background: linear-gradient(90deg, rgba(0, 153, 255, 0.08), var(--panel) 65%); }
.how-step { display: flex; gap: 0.9rem; align-items: flex-start; }
.how-n { flex: none; font: 500 0.66rem/1 var(--font-mono); letter-spacing: 0.2em; color: var(--accent); padding-top: 0.3rem; }
.how strong { display: block; font-weight: 600; margin-bottom: 0.15rem; }
.how p { font-size: 0.86rem; line-height: 1.5; }
@media (max-width: 820px) { .how { grid-template-columns: 1fr; gap: 1rem; } }

/* quick request card */
.card-h { font-size: 1.3rem; margin: 0.7rem 0 1.1rem; }
.quick input, .quick textarea { margin-bottom: 0.8rem; }
.quick textarea { min-height: 96px; }
.quick-row { display: flex; flex-wrap: wrap; gap: 0.8rem 1rem; align-items: center; }
.quick-row select { flex: 1 1 200px; width: auto; }
.quick-row .btn { margin-left: auto; }
.check--inline { margin: 0; }
.quick .form-error:empty { display: none; }

/* sites list, help, tips */
.sites { list-style: none; margin: 0.9rem 0 0; padding: 0; display: grid; gap: 0.8rem; }
.sites li { display: flex; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; align-items: baseline; }
.sites li span { font-weight: 500; }
.sites a { font-size: 0.86rem; }
.tips ul { margin: 0.9rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.8rem; }
.tips li { position: relative; padding-left: 1.2rem; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.tips li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tips strong { color: var(--text); font-weight: 500; }

/* activity feed */
.feed { display: grid; margin-top: 0.5rem; }
.feed-item { display: flex; gap: 0.8rem; align-items: center; padding: 0.8rem 0; color: inherit; border-top: 1px solid var(--line); }
.feed .feed-item:first-child { border-top: 0; }
a.feed-item:hover { text-decoration: none; }
a.feed-item:hover .feed-text { color: #fff; }
.feed-ico { --c: var(--accent); flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.feed-ico svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feed-ico--status { --c: var(--green); }
.feed-ico--message { --c: #c084fc; }
.feed-body { flex: 1; min-width: 0; }
.feed-text { margin: 0; font-size: 0.9rem; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.feed-text strong { color: var(--text); font-weight: 500; }
.feed-meta { margin: 0.15rem 0 0; font-size: 0.76rem; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .empty, .card > .empty { margin-top: 0.8rem; padding: 1.4rem 1rem; }

/* "what happens next" */
.next-step { --c: var(--accent); margin: -0.4rem 0 1.4rem; padding: 0.95rem 1.2rem; border-radius: 12px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 9%, var(--panel)); color: var(--muted); line-height: 1.55; }
.next-step strong { display: block; margin-bottom: 0.2rem; font: 500 0.64rem/1.4 var(--font-mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--c); }
.next-step--pending { --c: var(--amber); }
.next-step--completed { --c: var(--green); }
.next-step--awaiting_approval { --c: var(--violet); }
.next-step--declined { --c: var(--red); }
.next-step--cancelled { --c: var(--dim); }

/* the detail layout can breathe on wide screens */
.detail { grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }

@media (max-width: 820px) {
  .nav-cta { display: none; }
  .main { padding-top: 28px; }
  .quick-row .btn { margin-left: 0; width: 100%; }
}

.feed { grid-template-columns: minmax(0, 1fr); }
.dash-main > * + .section { margin-top: 1.8rem; }

/* =====================================================================
   Background & surface polish — a faint colour per page, depth on cards
   ===================================================================== */
body { --bloom: 0, 153, 255; }                    /* blue — home / overview */
body[data-page="requests"] { --bloom: 56, 189, 248; }   /* sky */
body[data-page="messages"] { --bloom: 168, 85, 247; }   /* violet */
body[data-page="clients"]  { --bloom: 34, 211, 238; }   /* cyan */
body[data-page="account"]  { --bloom: 52, 211, 153; }
body[data-page="help"]     { --bloom: 244, 114, 182; }   /* pink */   /* green */

body::before {
  background:
    radial-gradient(65% 55% at 4% -8%, rgba(var(--bloom), 0.19), transparent 70%),
    radial-gradient(50% 45% at 102% 108%, rgba(var(--bloom), 0.09), transparent 72%),
    radial-gradient(35% 30% at 78% 8%, rgba(var(--bloom), 0.05), transparent 70%),
    radial-gradient(rgba(150, 180, 235, 0.06) 1px, transparent 1px) 0 0 / 30px 30px;
}

/* a soft horizon of light behind each page's heading */
.main { position: relative; }
.main::before {
  content: ''; position: absolute; z-index: -1; left: 0; right: 0; top: -40px; height: 420px; pointer-events: none;
  background: radial-gradient(55% 100% at 28% 0%, rgba(var(--bloom), 0.11), transparent 72%);
}

/* sidebar picks up the same tint */
.side {
  background:
    linear-gradient(180deg, rgba(var(--bloom), 0.07), transparent 38%),
    rgba(10, 10, 12, 0.74);
}

/* surfaces: a hairline highlight on top and a soft drop, so cards sit on the canvas instead of floating flat */
.card, .list, .tile, .track {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 18px 40px -26px rgba(0, 0, 0, 0.85);
}
.card:not(.how):not(.banner):not(.creds):not(.thread), .list, .track {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0) 45%);
}
.row { transition: background 0.15s, padding-left 0.15s; }
a.row:hover { padding-left: 1.4rem; }

/* ---------- Account page ---------- */
.avatar--lg { width: 64px; height: 64px; font-size: 1.15rem; border-width: 1.5px; }
.profile-top { display: flex; align-items: center; gap: 1.2rem; padding-bottom: 1.3rem; margin-bottom: 1.3rem; border-bottom: 1px solid var(--line); }
.profile-id { min-width: 0; display: grid; gap: 0.35rem; justify-items: start; }
.profile-name { font-size: 1.5rem; }
.facts--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.3rem 1.5rem; }
.desc { margin: -0.2rem 0 1.3rem; font-size: 0.9rem; max-width: 56ch; }
.card .card-h { margin-top: 0.6rem; }
form.card .btn[type=submit] { margin-top: 0.2rem; }
.account-note { margin-top: 0.8rem; }

.notif p { margin: 0 0 0.6rem; font-size: 0.9rem; line-height: 1.55; }
.notif-state { display: flex; align-items: center; gap: 0.55rem; font-weight: 500; color: var(--text); margin: 0 0 0.5rem; }
.ok-dot, .off-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ok-dot { background: var(--green); box-shadow: 0 0 10px rgba(52, 211, 153, 0.7); }
.off-dot { background: var(--amber); box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }
@media (max-width: 560px) { .facts--grid { grid-template-columns: 1fr; } .profile-top { align-items: flex-start; } }

@media (max-width: 820px) { .main::before { top: -20px; height: 300px; } }
.eyebrow + .notif-state, .eyebrow + .notif { margin-top: 0.9rem; }

/* =====================================================================
   Files & website status
   ===================================================================== */

/* ---------- upload ---------- */
#uploads:not(:empty), #req-uploads:not(:empty), #quick-uploads:not(:empty) { margin-top: 1rem; display: grid; gap: 0.5rem; }

.up-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1rem; padding: 0.65rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.025); font-size: 0.86rem; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-state { color: var(--dim); font: 400 0.7rem/1.6 var(--font-mono); letter-spacing: 0.06em; text-align: right; }
.up-bar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.15s; }
.up-row.is-done .up-state { color: var(--green); }
.up-row.is-done .up-bar i { background: var(--green); }
.up-row.is-error { border-color: rgba(248, 113, 113, 0.4); cursor: pointer; }
.up-row.is-error .up-state { color: var(--red); white-space: normal; max-width: 28ch; }
.up-row.is-error .up-bar { display: none; }
.attach-hint { margin: -0.5rem 0 1.1rem; }

/* ---------- file list ---------- */
.file-row .row-title { align-items: center; gap: 0.9rem; }
.file-main { display: grid; min-width: 0; }
.file-name { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-main .row-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb { width: 42px; height: 42px; flex: none; object-fit: cover; border-radius: 9px; border: 1px solid var(--line-2); background: #111; }
.fileico {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04); font: 500 0.6rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.list--flat { border: 0; background: none; box-shadow: none; background-image: none; }
.list--flat .row { padding: 0.7rem 0; grid-template-columns: minmax(0, 1fr); }
.list--flat .row-side { grid-row: auto; grid-column: 1; margin-top: 0.4rem; }
.list--flat .thumb, .list--flat .fileico { width: 34px; height: 34px; }
.attach-btn { cursor: pointer; }
.attach-btn svg { width: 14px; height: 14px; }
.card-link { display: inline-block; margin-top: 0.9rem; font-size: 0.85rem; }

/* ---------- website status ---------- */
.site-dot { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 0.55rem; background: var(--dim); }
.site-dot--up { background: var(--green); box-shadow: 0 0 9px rgba(52, 211, 153, 0.7); }
.site-dot--down { background: var(--red); box-shadow: 0 0 9px rgba(248, 113, 113, 0.8); animation: blink 1.4s ease-in-out infinite; }
.site-dot--unknown { background: var(--amber); }
.site-name { display: inline-flex; align-items: center; }
@keyframes blink { 50% { opacity: 0.4; } }
.feed-item > .site-dot { margin: 0 0.1rem 0 0.25rem; }

.pill--site-up { color: var(--green); }
.pill--site-down { color: var(--red); }
.pill--site-unknown { color: var(--amber); }
.pill--site-off { color: var(--dim); }
.tile--down { --c: var(--red); }
.card--alert { border-color: rgba(248, 113, 113, 0.35); background-image: linear-gradient(180deg, rgba(248, 113, 113, 0.08), transparent 60%) !important; }

.sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 1.2rem; margin-top: 1.4rem; }
.tiles + .sites-grid { margin-top: 1.4rem; }
.site-card { display: grid; gap: 1rem; align-content: start; }
.site-card--down { border-color: rgba(248, 113, 113, 0.4); }
.site-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.site-id { display: grid; gap: 0.15rem; min-width: 0; }
.site-id h3 { font-size: 1.15rem; }
.site-id a { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-client { color: var(--dim) !important; }
.site-alert { margin: 0; padding: 0.7rem 0.9rem; border-radius: 10px; background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.3); color: #fecaca; font-size: 0.88rem; }
.site-stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.site-stats dt, .site-rows dt { font: 400 0.6rem/1.3 var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); margin-bottom: 0.3rem; }
.site-stats dd { margin: 0; font: 600 1.35rem/1.1 var(--font-head); letter-spacing: -0.02em; }
.site-rows { margin: 0; display: grid; gap: 0.8rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.site-rows > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0.8rem; align-items: baseline; }
.site-rows dt { margin: 0; }
.site-rows dd { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.site-actions { padding-top: 0.2rem; }

.strip { display: grid; grid-template-columns: repeat(48, minmax(0, 1fr)); gap: 2px; height: 30px; }
.strip i { border-radius: 2px; background: rgba(255, 255, 255, 0.08); }
.strip i.ok { background: var(--green); opacity: 0.85; }
.strip i.bad { background: var(--red); }
.strip-legend { display: flex; justify-content: space-between; margin-top: -0.55rem; font: 400 0.6rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }

@media (max-width: 820px) {
  .site-rows > div { grid-template-columns: 1fr; gap: 0.2rem; }
  .site-stats dd { font-size: 1.15rem; }
}

.sites-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.site-card { max-width: 1000px; }

.quick-attach { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin: -0.1rem 0 0.9rem; font-size: 0.85rem; }
.site-stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.site-note { margin: 0; font-size: 0.82rem; }

.site-detail { margin: -0.4rem 0 0; font: 400 0.76rem/1.5 var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.site-detail span { display: block; font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); margin-bottom: 0.2rem; }

/* ---------- request numbers, find + sort ---------- */
.req-no { flex: none; font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.04em; color: var(--dim); }
.list-tools { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1rem; }
.list-tools input { flex: 1 1 240px; }
.list-tools select { flex: 0 1 230px; }

/* ---------- approval ---------- */
.approve { border-color: rgba(192, 132, 252, 0.45); background: color-mix(in srgb, var(--violet) 8%, var(--panel)); }
.approve .eyebrow { color: var(--violet); }
.approval-banner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 1rem; align-items: center; margin-bottom: 1.2rem;
  border-color: rgba(192, 132, 252, 0.5); background: color-mix(in srgb, var(--violet) 10%, var(--panel)); color: inherit;
}
.approval-banner:hover { text-decoration: none; border-color: var(--violet); }
.approval-banner strong { grid-column: 1; }
.approval-banner .muted { grid-column: 1; font-size: 0.88rem; }
.approval-go { grid-row: 1 / span 2; grid-column: 2; font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--violet); }

/* ---------- help centre ---------- */
.help-find { width: 100%; }
.faq-group { display: grid; gap: 0.7rem; }
.faq-h { margin: 0.4rem 0 0; font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.faq-card { padding: 0.3rem 1.3rem; }
.faq { border-top: 1px solid var(--line); }
.faq:first-child { border-top: 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; font: 400 1.3rem/1 var(--font-mono); color: var(--dim); transition: transform 0.2s; }
.faq[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq summary:hover { color: var(--accent); }
.faq-a { padding: 0 0 1.2rem; color: var(--muted); line-height: 1.65; max-width: 62ch; }
.faq-a p { margin: 0 0 0.7rem; }
.faq-a ol { margin: 0 0 0.9rem; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.todo-list { margin: 0.8rem 0 0; padding-left: 1.1rem; color: var(--muted); display: grid; gap: 0.35rem; font-size: 0.88rem; }

@media (max-width: 820px) {
  .track { padding: 1rem 0.9rem; gap: 0.35rem; }
  .track-label { font-size: 0.56rem; letter-spacing: 0.05em; overflow-wrap: anywhere; }
  .approval-banner { grid-template-columns: minmax(0, 1fr); }
  .approval-go { grid-row: auto; grid-column: 1; margin-top: 0.4rem; }
}

/* ---------- activity log ---------- */
.tag {
  display: inline-block; justify-self: start; padding: 0.3rem 0.55rem; border-radius: 6px; border: 1px solid currentColor;
  font: 500 0.6rem/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; text-align: center;
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.tag--admin { color: var(--accent); }
.tag--client { color: var(--green); }
.tag--system { color: var(--dim); }
button.chip { background: none; cursor: pointer; }
.log-tools select { flex: 0 1 200px; }
.log-count { margin: 0 0 0.7rem; font-size: 0.82rem; min-height: 1.2em; }
.log { position: relative; border-top: 1px solid var(--line); }
.log:first-child { border-top: 0; }
.log::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--dim); }
.log--admin::before { background: var(--accent); }
.log--client::before { background: var(--green); }
.log summary {
  display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 1rem; align-items: center;
  padding: 0.85rem 1.2rem; cursor: pointer; list-style: none; transition: background 0.15s;
}
.log summary::-webkit-details-marker { display: none; }
.log summary:hover, .log[open] summary { background: rgba(255, 255, 255, 0.035); }
.log-body { display: grid; gap: 0.2rem; min-width: 0; }
.log-line { font-weight: 500; overflow-wrap: anywhere; }
.log-meta { font-size: 0.78rem; color: var(--dim); overflow-wrap: anywhere; }
.log-time { font: 400 0.72rem/1.3 var(--font-mono); color: var(--dim); white-space: nowrap; text-align: right; }
.log-detail { margin: 0; padding: 0.4rem 1.2rem 1.3rem calc(74px + 2.2rem); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem 1.6rem; }
.log-more { margin-top: 1.1rem; text-align: center; }
@media (max-width: 820px) {
  .log summary { grid-template-columns: auto minmax(0, 1fr); gap: 0.4rem 0.8rem; padding: 0.8rem 1rem; }
  .log-time { grid-column: 2; text-align: left; }
  .log-detail { padding: 0.2rem 1rem 1.1rem; }
}

@media (max-width: 820px) {
  .list-tools select, .log-tools select { flex: 1 1 100%; }
}

/* ---------- phone: top bar + slide-out menu (replaces the old bottom tab bar) ---------- */
.topbar, .scrim, .drawer-close { display: none; }
@media (max-width: 820px) {
  .topbar {
    position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 0.8rem;
    padding: calc(0.55rem + env(safe-area-inset-top)) 14px 0.55rem; border-bottom: 1px solid var(--line);
    background: rgba(10, 10, 12, 0.92); backdrop-filter: blur(14px);
  }
  .topbar .brand { font-size: 1.3rem; color: var(--text); }
  .topbar .brand:hover { text-decoration: none; }
  .topbar-cta { margin-left: auto; }
  .menu-btn {
    position: relative; flex: none; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
    border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text);
  }
  .menu-btn svg, .drawer-close svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
  .menu-btn .badge { position: absolute; top: -7px; right: -7px; }

  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(300px, 86vw); height: 100vh; height: 100dvh;
    padding: calc(24px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto;
    background: #0d0d10; border-right: 1px solid var(--line-2); box-shadow: 30px 0 60px -20px rgba(0, 0, 0, 0.85);
    transform: translateX(-104%); visibility: hidden; transition: transform 0.26s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s 0.26s;
  }
  .side.open { transform: none; visibility: visible; transition: transform 0.26s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .nav a { padding: 0.8rem 0.75rem; font-size: 1rem; }
  .drawer-close {
    position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 12px; width: 40px; height: 40px; place-items: center;
    display: grid; cursor: pointer; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted);
  }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, 0.62); opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  .scrim.open { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .side, .side.open, .scrim { transition: none; } }

/* ---------- previews ---------- */
.pill--preview { color: var(--violet); }
.pill--pv-waiting { color: var(--amber); }
.pill--pv-approved { color: var(--green); }
.pill--pv-changes { color: var(--red); }
.pill--pv-draft { color: var(--dim); }
.preview--waiting { border-color: rgba(251, 191, 36, 0.4); background: color-mix(in srgb, var(--amber) 5%, var(--panel)); }
.preview--approved { border-color: rgba(52, 211, 153, 0.35); }
.preview--changes { border-color: rgba(248, 113, 113, 0.35); }
.preview--draft { border-style: dashed; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.preview .card-h { margin-bottom: 0.7rem; }
.pv-host { font: 400 0.75rem var(--font-mono); margin-left: 0.4rem; }
.pv-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; margin: 1rem 0; }
.pv-thumb { padding: 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #111; cursor: zoom-in; aspect-ratio: 4 / 3; }
.pv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.pv-thumb:hover { border-color: var(--accent); }
.pv-thumb:hover img { transform: scale(1.04); }
.pv-file { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); overflow-wrap: anywhere; }
.pv-file:hover { text-decoration: none; border-color: var(--accent); }
.pv-answer { margin: 1rem 0 0; padding: 0.8rem 1rem; border-radius: 10px; border-left: 3px solid var(--c, var(--dim)); background: color-mix(in srgb, var(--c, var(--dim)) 9%, transparent); color: var(--muted); font-size: 0.9rem; }
.pv-answer strong { color: var(--c); }
.pv-answer--approved { --c: var(--green); }
.pv-answer--changes { --c: var(--red); }
.pv-hint { margin: 0.9rem 0 0; font-size: 0.8rem; }
.approval-banner--preview { border-color: rgba(251, 191, 36, 0.5); background: color-mix(in srgb, var(--amber) 8%, var(--panel)); }
.approval-banner--preview .approval-go { color: var(--amber); }
dialog.lightbox { width: auto; max-width: min(96vw, 1100px); padding: 0; background: #0b0b0e; overflow: hidden; }
dialog.lightbox::backdrop { background: rgba(0, 0, 0, 0.82); }
.lightbox img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; }
.lightbox-bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1rem; border-top: 1px solid var(--line); }
.lightbox-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.85rem; }

/* ---------- monthly reports ---------- */
.card--link { display: block; color: inherit; }
.card--link:hover { text-decoration: none; border-color: var(--accent); }
.card--draft { border-color: rgba(251, 191, 36, 0.4); background: color-mix(in srgb, var(--amber) 7%, var(--panel)); }
.card--draft .eyebrow { color: var(--amber); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.report-note { border-color: rgba(122, 202, 255, 0.35); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.report-h { margin: 2rem 0 0.8rem; }
.tile--bad { --c: var(--red); }
.small { font-size: 0.82rem; }
.tone-completed { color: var(--green); }
.tone-pending { color: var(--amber); }
.tone-bad { color: var(--red); }
.site-report { margin-bottom: 1rem; }
.site-report-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.site-report-head h3 { margin: 0; font-size: 1.15rem; }
.site-report-head a { font: 400 0.78rem var(--font-mono); }
.site-report-stats { margin-bottom: 1.3rem; }
.rbars { display: flex; gap: 2px; height: 34px; }
.rbar { flex: 1; min-width: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); }
.rbar--ok { background: var(--green); }
.rbar--warn { background: var(--amber); }
.rbar--bad { background: var(--red); }
.rbars-axis { display: flex; justify-content: space-between; margin-top: 0.4rem; font: 400 0.6rem var(--font-mono); letter-spacing: 0.12em; color: var(--dim); }
.rtable { width: 100%; margin-top: 1.1rem; border-collapse: collapse; font-size: 0.88rem; }
.rtable th { padding: 0 0.5rem 0.5rem 0; text-align: left; font: 400 0.6rem var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.rtable td { padding: 0.6rem 0.5rem 0.6rem 0; border-top: 1px solid var(--line); vertical-align: top; }
.rlist { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.45rem; }
.rlist--muted { margin-top: 0.9rem; color: var(--muted); font-size: 0.88rem; }
.gen-form { max-width: 420px; }
.report-card .card-h { margin-bottom: 0.4rem; }
@media (max-width: 560px) { .rtable { display: block; overflow-x: auto; } }

.card > .eyebrow + .field, .card > .eyebrow + p.muted { margin-top: 0.9rem; }
/* a card's small label needs breathing room above whatever follows it (.rlist/.prose set their own margins later in the file) */
.card > .eyebrow + .rlist, .card > .eyebrow + .prose, .card > .eyebrow + p, .card > .eyebrow + .list { margin-top: 1.1rem; }
.tile .eyebrow + .n { margin-top: 1.15rem; }
.site-report-stats dt { margin-bottom: 0.6rem; }
.report-note { margin: 1.2rem 0; padding: 1.4rem 1.5rem; }
.report-note .prose { margin-top: 1.2rem; }
.page-head + p.muted.small { margin: 0 0 1.2rem; }
.tile .eyebrow + .n { margin-top: 1.4rem; }
.notif-master { margin: 1.1rem 0 0.9rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.notif-opts { display: grid; gap: 0.2rem; margin-bottom: 0.4rem; }
.notif-opts.is-off { opacity: 0.45; }
.notif-desc { display: block; margin-top: 0.15rem; font-size: 0.82rem; color: var(--dim); }
.report-h { margin: 2.6rem 0 1.1rem; }
.site-report .rbars-axis + *, .site-report .rbars-axis ~ p { margin-top: 1.1rem; }

/* ---------- privacy policy ---------- */
.side-link { justify-self: start; margin-top: 2px; font-size: 0.78rem; color: var(--dim); }
.side-link:hover { color: var(--text); }
.legal { display: grid; gap: 1rem; max-width: 820px; }
.legal-meta { font-size: 0.82rem; }
.legal-toc ol { margin: 0.9rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; font-size: 0.9rem; }
.legal-sec h2 { font-size: 1.15rem; margin: 0 0 0.9rem; }
.legal-sec p { margin: 0 0 0.8rem; line-height: 1.65; color: var(--muted); }
.legal-sec p:last-child { margin-bottom: 0; }
.legal-sec { scroll-margin-top: 1.2rem; }
.legal-list { margin: 0 0 0.9rem; gap: 0.6rem; line-height: 1.6; color: var(--muted); }
.legal-table { margin: 0 0 0.4rem; }
.legal-table th { padding-bottom: 0.7rem; }
.legal-table td { padding: 0.85rem 1rem 0.85rem 0; line-height: 1.55; color: var(--muted); font-size: 0.86rem; }
.legal-table td:first-child { color: var(--text); }
.legal-wrap { max-width: 820px; margin: 0 auto; padding: 2.5rem 24px 4rem; }
.legal-wrap > .brand { display: inline-block; margin-bottom: 1.6rem; }
.legal-wrap h1 { font-size: 2rem; margin: 0.5rem 0 0.4rem; }
.legal-wrap > .muted { margin-bottom: 1.6rem; }
@media (max-width: 700px) { .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; } .legal-table thead { display: none; } .legal-table tr { padding: 0.9rem 0; border-top: 1px solid var(--line); } .legal-table td { border: 0; padding: 0.3rem 0; } .legal-table td::before { content: attr(data-label); display: block; margin-bottom: 0.15rem; font: 400 0.6rem var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); } }

/* ---------- two-step verification ---------- */
.auth-card--wide { max-width: 480px; }
.qr { width: 204px; height: 204px; margin: 0.4rem 0 1rem; padding: 6px; background: #fff; border-radius: 10px; }
.qr svg { display: block; width: 100%; height: 100%; }
.tf-steps { margin: 0 0 0.6rem; padding-left: 1.2rem; color: var(--muted); font-size: 0.9rem; }
.tf-manual { margin: 0 0 1.2rem; font-size: 0.86rem; color: var(--muted); }
.tf-manual summary { cursor: pointer; }
.tf-key { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.tf-key code { font: 500 0.95rem var(--font-mono); letter-spacing: 0.08em; color: var(--text); overflow-wrap: anywhere; }
.rec-codes { list-style: none; margin: 1rem 0; padding: 1rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem 1.2rem; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 12px; font: 500 0.95rem var(--font-mono); letter-spacing: 0.06em; }
.tf-codes-wrap .btn-primary { margin-top: 0.4rem; }
.sec-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.9rem; }
.sec { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); gap: 0.4rem; align-items: start; }
.sec p { margin: 0.15rem 0 0; font-size: 0.84rem; line-height: 1.55; color: var(--muted); }
.sec-ico { font-size: 0.8rem; line-height: 1.6; }
.sec--ok .sec-ico { color: var(--green); }
.sec--info .sec-ico { color: var(--accent); }
.sec--warn .sec-ico { color: var(--amber); }
.sec--bad .sec-ico { color: var(--red); }
