/* Software Requirements Analyzer - main stylesheet */
:root {
  /* ===== Theme: 2 contrast colours + 3 button colours (admin portal can override) ===== */
  --c-dark: #0B1B36;      /* contrast colour 1 - deep navy */
  --c-light: #F5F1E8;     /* contrast colour 2 - warm ivory */
  --btn-1: #4F46E5;       /* button colour 1 - primary actions (indigo) */
  --btn-2: #0F766E;       /* button colour 2 - confirm / accept / save (teal) */
  --btn-3: #F59E0B;       /* button colour 3 - highlight CTA (amber, dark text) */

  --navy: var(--c-dark);
  --navy-2: color-mix(in srgb, var(--c-dark) 82%, white);
  --navy-3: color-mix(in srgb, var(--c-dark) 70%, white);
  --on-dark: color-mix(in srgb, var(--c-light) 78%, var(--c-dark));
  --on-dark-2: color-mix(in srgb, var(--c-light) 52%, var(--c-dark));
  --primary: var(--btn-1);
  --primary-600: color-mix(in srgb, var(--btn-1) 82%, black);
  --primary-50: color-mix(in srgb, var(--btn-1) 9%, white);
  --secondary: var(--btn-2);
  --secondary-600: color-mix(in srgb, var(--btn-2) 80%, black);
  --secondary-50: color-mix(in srgb, var(--btn-2) 10%, white);
  --accent: var(--btn-3);
  --accent-600: color-mix(in srgb, var(--btn-3) 86%, black);
  --accent-50: color-mix(in srgb, var(--btn-3) 14%, white);
  --ink: var(--c-dark);
  --ink-2: color-mix(in srgb, var(--c-dark) 72%, white);
  --ink-3: color-mix(in srgb, var(--c-dark) 52%, white);
  --line: color-mix(in srgb, var(--c-dark) 11%, var(--c-light));
  --bg: var(--c-light);
  --card: #ffffff;
  --good: #11865a;
  --good-bg: #e6f6ee;
  --fair: #2d6fd6;
  --fair-bg: #e8f0fc;
  --warn: #b45309;
  --warn-bg: #fdf3e1;
  --poor: #c8312f;
  --poor-bg: #fdeceb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 27, 54, .05), 0 2px 6px rgba(11, 27, 54, .05);
  --shadow-lg: 0 18px 40px -16px rgba(11, 27, 54, .35);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 15px; overflow-wrap: break-word; -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: 1.7rem; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--ink-3); }
code, .mono { font-family: var(--mono); font-size: .88em; }
img { max-width: 100%; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  width: 256px; background: var(--navy); color: var(--on-dark); flex-shrink: 0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  padding-left: env(safe-area-inset-left);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; color: #fff; font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--c-dark);
  display: grid; place-items: center; font-size: .78rem; font-weight: 800; letter-spacing: .02em; flex-shrink: 0;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.12);
}
.brand-logo { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; flex-shrink: 0; background: #fff; }
.brand small { display: block; font-weight: 500; color: var(--on-dark-2); font-size: .72rem; }
.nav-section { padding: 6px 12px; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--on-dark-2); padding: 14px 10px 6px; font-weight: 700; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--on-dark);
  font-size: .92rem; border-left: 3px solid transparent;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-link:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--navy-2); color: #fff; border-left-color: var(--accent); }
.nav-link.active svg { color: var(--accent); opacity: 1; }
.sidebar-foot { margin-top: auto; padding: 14px 20px 20px; border-top: 1px solid var(--navy-2); font-size: .85rem; }
.sidebar-foot .who-mail { color: var(--on-dark-2); }
.sidebar-foot .who { color: #fff; font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none; align-items: center; justify-content: space-between; background: var(--navy); color: #fff;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
  position: sticky; top: 0; z-index: 30; padding-top: max(10px, env(safe-area-inset-top));
}
.content { padding: 28px 32px 48px; max-width: 1280px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { color: var(--ink-2); margin: 0; }
.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { color: var(--ink-3); }

/* public layout */
.public-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px max(40px, env(safe-area-inset-right)) 14px max(40px, env(safe-area-inset-left)); background: var(--navy); position: sticky; top: 0; z-index: 30; }
.public-nav .brand { padding: 0; }
.public-menu { display: flex; align-items: center; gap: 22px; }
.public-nav nav a { color: var(--on-dark); font-size: .95rem; font-weight: 600; }
.public-nav nav a.current { color: #fff; }
.public-nav nav a:not(.btn):hover { color: #fff; text-decoration: none; }
.public-main { min-height: calc(100vh - 140px); min-height: calc(100dvh - 140px); }
.public-flash { max-width: 1120px; margin: 16px auto 0; padding: 0 20px; }

/* ---------- components ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 17px; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; line-height: 1.2;
  background: var(--primary); color: #fff; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 4px 12px -6px color-mix(in srgb, var(--primary) 70%, transparent);
  transition: background .15s, box-shadow .15s, transform .08s;
}
.btn:hover { background: var(--primary-600); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 35%, white); outline-offset: 1px; }
/* button colour 2 */
.btn-secondary, .btn-success { background: var(--secondary); box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--secondary) 70%, transparent); }
.btn-secondary:hover, .btn-success:hover { background: var(--secondary-600); }
/* button colour 3 (bright, dark text) */
.btn-accent { background: var(--accent); color: var(--c-dark); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 6px 16px -6px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-accent:hover { background: var(--accent-600); color: var(--c-dark); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn-outline:hover { background: var(--primary-50); border-color: color-mix(in srgb, var(--primary) 30%, white); color: var(--primary-600); }
.btn-ghost { background: transparent; color: var(--ink-2); box-shadow: none; }
.btn-ghost:hover { background: color-mix(in srgb, var(--c-dark) 6%, white); }
.btn-on-dark { background: transparent; color: #fff; border-color: color-mix(in srgb, var(--c-light) 40%, transparent); box-shadow: none; }
.btn-on-dark:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn-danger { background: var(--poor); box-shadow: none; }
.btn-danger:hover { background: #a92623; }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: 13px 24px; font-size: 1rem; border-radius: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; white-space: nowrap; background: #edf0f6; color: var(--ink-2); }
.badge.high, .badge.poor, .badge.dismissed { background: var(--poor-bg); color: var(--poor); }
.badge.medium, .badge.warn, .badge.needs_review, .badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.low, .badge.fair, .badge.info-b { background: var(--fair-bg); color: var(--fair); }
.badge.good, .badge.confirmed, .badge.accepted, .badge.info, .badge.match { background: var(--good-bg); color: var(--good); }
.badge.rejected { background: #eceef3; color: var(--ink-3); }
.badge.auto { background: #f0ecfd; color: #6a3fd1; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 12px; border: 1px solid; font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--good-bg); border-color: #b5e3cc; color: #0b5e3f; }
.alert-danger { background: var(--poor-bg); border-color: #f5c2c0; color: #8f1f1d; }
.alert-warning { background: var(--warn-bg); border-color: #f3d79e; color: #7a4a00; }
.alert-info { background: var(--fair-bg); border-color: #c3d6f7; color: #1d4b94; }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; font-size: 1.1rem; line-height: 1; }
.notice { background: #f8f9fc; border: 1px dashed #c9d1e2; border-radius: 10px; padding: 12px 14px; font-size: .88rem; color: var(--ink-2); }

/* forms */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; }
.field { margin-bottom: 16px; }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--c-dark) 18%, white); border-radius: 9px; font: inherit; background: #fff; color: var(--ink);
}
textarea { resize: vertical; min-height: 90px; }
input[type=range] { width: 100%; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 17px; height: 17px; }

/* stats */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: block; color: inherit; }
a.stat:hover { text-decoration: none; border-color: color-mix(in srgb, var(--primary) 30%, white); box-shadow: var(--shadow-lg); }
.grid > .stat:nth-child(3n+1) { border-top: 3px solid var(--primary); }
.grid > .stat:nth-child(3n+2) { border-top: 3px solid var(--secondary); }
.grid > .stat:nth-child(3n+3) { border-top: 3px solid var(--accent); }
.stat .label { color: var(--ink-3); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.9rem; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.stat .sub { font-size: .8rem; color: var(--ink-3); }
.stat.good .value { color: var(--good); } .stat.fair .value { color: var(--fair); }
.stat.warn .value { color: var(--warn); } .stat.poor .value { color: var(--poor); }
.stat-icon { float: right; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.stat-icon svg { width: 20px; height: 20px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--c-light) 45%, white); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fbfcfe; }
.req-code { font-family: var(--mono); font-weight: 700; color: var(--primary); white-space: nowrap; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; font-weight: 600; font-size: .9rem; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; font-family: inherit; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { background: #edf0f6; color: var(--ink-2); border-radius: 99px; padding: 0 7px; font-size: .75rem; margin-left: 5px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.doc-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; background: var(--card); border: 1px solid var(--line); padding: 6px; border-radius: 10px; }
.doc-nav a, .doc-nav span { padding: 7px 12px; border-radius: 7px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.doc-nav a:hover { background: #f0f3f9; text-decoration: none; }
.doc-nav a.active { background: var(--navy); color: #fff; box-shadow: inset 0 -3px 0 var(--accent); }
.doc-nav span { color: #b3bccd; cursor: not-allowed; }

/* findings */
.finding { border: 1px solid var(--line); border-left: 4px solid var(--fair); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.finding.high { border-left-color: var(--poor); }
.finding.medium { border-left-color: var(--warn); }
.finding.low { border-left-color: var(--fair); }
.finding.info { border-left-color: var(--good); }
.finding.is-dismissed { opacity: .55; }
.finding-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.finding .req-text { background: #f7f8fb; border-radius: 8px; padding: 9px 12px; margin: 8px 0; font-size: .93rem; }
.finding .msg { color: var(--ink-2); font-size: .9rem; margin: 0; }
mark.vague { background: #ffe5a3; color: inherit; padding: 0 3px; border-radius: 4px; border-bottom: 2px solid #e8a100; cursor: help; }
.review-btns { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.automated-tag { font-size: .72rem; color: #6a3fd1; font-weight: 600; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* requirement list */
.req-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); align-items: start; }
.req-item:last-child { border-bottom: 0; }
.req-item .text { font-size: .95rem; }
.req-item .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 7px; align-items: center; }
.req-item .meta select { width: auto; padding: 4px 8px; font-size: .8rem; }
.req-item .actions { display: flex; gap: 4px; }
.req-item .orig { font-size: .82rem; color: var(--ink-3); margin-top: 5px; }
.edit-form { display: none; margin-top: 8px; }
.req-item.editing .edit-form { display: block; }
.req-item.editing .text { display: none; }
.req-item.unconfirmed { background: #fffbf1; }

/* upload */
.dropzone { border: 2px dashed #b9c6e3; border-radius: 14px; padding: 40px 20px; text-align: center; background: #fafbff; cursor: pointer; transition: .15s; }
.dropzone.drag { border-color: var(--primary); background: var(--primary-50); }
.dropzone svg { width: 46px; height: 46px; color: var(--primary); }
.dropzone .file-name { font-weight: 600; margin-top: 10px; color: var(--ink); }
.dropzone input { display: none; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 38px; margin-bottom: 14px; font-size: .92rem; color: var(--ink-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-50); color: var(--primary); font-weight: 700; display: grid; place-items: center; font-size: .8rem; }
.steps li b { color: var(--ink); display: block; }

/* diagrams */
.diagram-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; }
.diagram-img { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px; text-align: center; }
.diagram-img img { max-height: 420px; object-fit: contain; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #f0f3f9; border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px; font-size: .82rem; }
.chip.actor { background: #f0ecfd; border-color: #ddd3fa; }
.chip.func { background: var(--good-bg); border-color: #c5ead7; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; margin: 0; font-size: .9rem; }
dl.kv dt { color: var(--ink-3); font-weight: 600; }
dl.kv dd { margin: 0; }
pre.ocr { background: var(--navy); color: #dbe4ff; padding: 12px; border-radius: 8px; font-size: .8rem; max-height: 200px; overflow: auto; white-space: pre-wrap; }

/* quality */
.score-ring { position: relative; width: 190px; height: 190px; margin: 0 auto; }
.score-ring canvas { width: 190px; height: 190px; }
.score-ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.score-ring .num { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; }
.score-ring .grade { font-size: .85rem; color: var(--ink-3); font-weight: 600; }
.chart-box { position: relative; width: 100%; }
.chart-box canvas { width: 100% !important; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.bar-mini { height: 8px; background: #edf0f6; border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar-mini > span { display: block; height: 100%; border-radius: 99px; }

/* suggestions */
.sugg { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 16px; overflow: hidden; }
.sugg-head { padding: 12px 16px; background: #fafbfd; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sugg-body { padding: 16px; display: grid; gap: 12px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare > div { border-radius: 8px; padding: 11px 13px; font-size: .92rem; }
.compare .before { background: var(--poor-bg); }
.compare .after { background: var(--good-bg); }
.compare .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink-3); display: block; margin-bottom: 4px; }

/* home */
.hero {
  background:
    radial-gradient(700px 380px at 92% 0%, color-mix(in srgb, var(--primary) 55%, transparent) 0, transparent 70%),
    radial-gradient(520px 300px at 0% 100%, color-mix(in srgb, var(--accent) 22%, transparent) 0, transparent 70%),
    var(--navy);
  color: #fff; padding: 86px 40px 96px; position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg, var(--primary) 0 33.3%, var(--secondary) 33.3% 66.6%, var(--accent) 66.6%); }
.hero-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.hero h1 { color: #fff; font-size: 2.8rem; letter-spacing: -.03em; line-height: 1.12; }
.hero p.lead { color: var(--on-dark); font-size: 1.1rem; max-width: 560px; }
.hero .eyebrow { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; margin-bottom: 12px; }
.hero-image img { width: 100%; border-radius: 18px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.55); display: block; }
.hero-preview { background: #fff; border-radius: 16px; padding: 18px; color: var(--ink); box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.section { max-width: 1120px; margin: 0 auto; padding: 64px 40px; }
.section h2 { font-size: 1.9rem; text-align: center; letter-spacing: -.02em; font-weight: 800; }
.section-alt { max-width: none; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-alt > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.section-alt > .lead { max-width: 640px; }
.step-card { margin: 0; position: relative; padding-top: 26px; }
.step-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; color: #fff; background: var(--primary); }
.grid > .step-card:nth-child(4n+2) .step-num { background: var(--secondary); }
.grid > .step-card:nth-child(4n+3) .step-num { background: var(--accent); color: var(--c-dark); }
.grid > .step-card:nth-child(4n+4) .step-num { background: var(--navy); }
.home-in-app { margin: -28px -32px 0; }
.section .lead { text-align: center; color: var(--ink-2); max-width: 640px; margin: 0 auto 36px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; transition: transform .15s, box-shadow .15s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; margin-bottom: 14px; }
.grid > .feature:nth-child(3n+2) .icon { background: var(--secondary-50); color: var(--secondary); }
.grid > .feature:nth-child(3n+3) .icon { background: var(--accent-50); color: var(--accent-600); }
.feature .icon svg { width: 22px; height: 22px; }
.feature p { color: var(--ink-2); font-size: .92rem; margin: 0; }

/* auth */
.auth-wrap { min-height: calc(100vh - 150px); min-height: calc(100dvh - 150px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 440px; margin: 0; padding: 30px; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); width: 100%; max-width: 920px;
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--line); }
.auth-split .auth-card { border: 0; box-shadow: none; border-radius: 0; max-width: none; }
.auth-side { background: radial-gradient(400px 260px at 100% 0, color-mix(in srgb, var(--primary) 55%, transparent), transparent 70%), var(--navy);
  color: var(--on-dark); padding: 36px 32px; display: flex; flex-direction: column; justify-content: center; }
.auth-side h2 { color: #fff; font-size: 1.5rem; letter-spacing: -.02em; }
.auth-side-img { border-radius: 12px; margin-bottom: 22px; max-height: 220px; object-fit: cover; width: 100%; }
.auth-points { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; font-size: .92rem; }
.auth-points li { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-1 { background: var(--primary); } .dot-2 { background: var(--secondary); } .dot-3 { background: var(--accent); }
.announce { background: var(--accent); color: var(--c-dark); text-align: center; font-weight: 700; font-size: .9rem; padding: 9px 16px; }
.auth-card h1 { text-align: center; }
.auth-card .sub { text-align: center; color: var(--ink-2); margin-bottom: 22px; }

.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty svg { width: 44px; height: 44px; color: #b8c2d6; }
details summary { cursor: pointer; font-weight: 600; }
details.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; margin-bottom: 12px; }
.extracted-text { max-height: 320px; overflow: auto; background: #f7f8fb; padding: 12px; border-radius: 8px; white-space: pre-wrap; font-size: .85rem; margin-top: 10px; }
.mini-table { border-collapse: collapse; font-size: .82rem; margin-top: 8px; }
.mini-table td { border: 1px solid var(--line); padding: 4px 8px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.thumbs a { border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; text-align: center; font-size: .78rem; color: var(--ink-2); }
.thumbs img { height: 100px; object-fit: contain; width: 100%; }
.sticky-bar { position: sticky; bottom: 0; background: rgba(255,255,255,.97); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: 14px 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 -22px -22px; border-radius: 0 0 var(--radius) var(--radius); }

.backdrop { display: none; position: fixed; inset: 0; background: rgba(11,27,54,.45); z-index: 40; }
.backdrop.show { display: block; }


/* ---------- admin portal ---------- */
.brand-mark-admin svg { width: 19px; height: 19px; }
.admin-auth { min-height: 100vh; min-height: 100dvh; background: radial-gradient(600px 400px at 100% 0, color-mix(in srgb, var(--primary) 40%, transparent), transparent 70%), var(--navy); }
.auth-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: var(--c-dark); display: grid; place-items: center; margin: 0 auto 14px; }
.auth-icon svg { width: 26px; height: 26px; }
.admin-tile { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; color: inherit; box-shadow: var(--shadow); transition: .15s; }
.admin-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 30%, white); }
.admin-tile-body { display: flex; flex-direction: column; gap: 3px; }
.admin-tile-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.admin-tile-icon svg { width: 21px; height: 21px; }
.grid > .admin-tile:nth-child(3n+2) .admin-tile-icon { background: var(--secondary-50); color: var(--secondary); }
.grid > .admin-tile:nth-child(3n+3) .admin-tile-icon { background: var(--accent-50); color: var(--accent-600); }
.admin-form { padding-bottom: 0; }
.admin-field { padding: 16px 0; border-bottom: 1px solid var(--line); }
.admin-field:first-of-type { padding-top: 4px; }
.admin-field.is-custom { border-left: 3px solid var(--secondary); padding-left: 14px; margin-left: -17px; }
.admin-field-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.admin-field-head label { margin: 0; }
.admin-field-head .btn { margin-left: auto; }
.color-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.color-row input[type=color] { width: 48px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.swatch-btn { padding: 9px 16px; border-radius: 10px; color: #fff; font-weight: 700; font-size: .85rem; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.image-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.image-preview { width: 120px; height: 84px; border: 1px dashed color-mix(in srgb, var(--c-dark) 22%, white); border-radius: 10px; display: grid; place-items: center; background: repeating-conic-gradient(#f2f2f2 0 25%, #fff 0 50%) 0 0 / 16px 16px; overflow: hidden; }
.image-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.public-nav nav a.btn-accent, .public-nav nav a.btn-accent:hover { color: var(--c-dark); }
.swatch-btn.on-light { color: var(--c-dark); text-shadow: none; border: 1px solid var(--line); }
.install-checks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; font-size: .92rem; }
.install-checks li.pass { color: var(--good); }
.install-checks li.fail { color: var(--poor); font-weight: 600; }
.install-checks .hint { font-weight: 400; color: var(--ink-2); margin-left: 18px; }
.upload-progress { margin-top: 14px; }
.upload-progress .bar-mini > span { transition: width .2s; }


/* =====================================================================
   v2 additions: auth extras, footer, privacy page, settings, responsive
   ===================================================================== */

/* hover effects only where a real mouse exists (no "stuck" hover on phones) */
@media (hover: none) {
  .btn:hover, .feature:hover, .admin-tile:hover { transform: none; }
  .table tr:hover td { background: transparent; }
}

/* show / hide password */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 40px; height: 36px; border: 0; background: transparent;
  color: var(--ink-3); border-radius: 8px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.pw-toggle:hover { color: var(--primary); background: var(--primary-50); }
.pw-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 35%, white); }
.pw-toggle svg { width: 20px; height: 20px; }
input::-ms-reveal, input::-ms-clear { display: none; }

/* auth extras */
.btn-block { width: 100%; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.label-row label { margin-bottom: 5px; }
.auth-switch { text-align: center; margin: 16px 0 0; }
.auth-solo { max-width: 440px; }
.btn-google { width: 100%; background: #fff; color: var(--ink); border: 1px solid color-mix(in srgb, var(--c-dark) 18%, white); box-shadow: var(--shadow); }
.btn-google:hover { background: #f7f8fb; color: var(--ink); }
.btn-google img, .btn-google svg { width: 20px; height: 20px; object-fit: contain; }
.or-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin: 18px 0; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.consent { align-items: flex-start; margin: 2px 0 18px; font-size: .88rem; line-height: 1.45; }
.consent input { margin-top: 2px; flex-shrink: 0; }
.code-input { font-size: 1.6rem !important; letter-spacing: .45em; text-align: center; font-family: var(--mono); font-weight: 700; padding: 12px 8px !important; }
.code-input.code-sm { font-size: 1.15rem !important; letter-spacing: .3em; max-width: 190px; padding: 8px !important; }
.verify-actions { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.verify-actions form { margin: 0; }
.pending-box { margin-top: 16px; padding: 14px; border-radius: 10px; background: var(--warn-bg); border: 1px solid #f3d79e; }
.pending-box p { margin: 0 0 10px; }
.pending-box .row input { width: auto; flex: 1; }
.avatar { width: 22px; height: 22px; border-radius: 50%; vertical-align: -6px; margin-right: 7px; object-fit: cover; }
.signin-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.signin-list li { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.signin-list li > span:nth-child(2) { display: flex; flex-direction: column; }
.signin-list form { margin-left: auto; }
.signin-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.signin-ic svg { width: 18px; height: 18px; }

/* on/off switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 44px; height: 26px; border-radius: 99px; background: #cfd5e2; position: relative; flex-shrink: 0; transition: background .15s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--secondary); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid color-mix(in srgb, var(--primary) 35%, white); outline-offset: 2px; }

/* privacy page */
.legal-wrap { max-width: 860px; margin: 0 auto; padding: 40px 20px 56px; }
.legal-wrap.in-app { padding: 0; }
.legal { padding: 36px 40px; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.2rem; margin-top: 1.6em; }
.legal h3 { font-size: 1.05rem; margin-top: 1.3em; }
.legal p, .legal li { color: var(--ink-2); line-height: 1.7; }
.legal ul { padding-left: 1.3em; margin: 0 0 1em; }
.legal li { margin-bottom: 6px; }
.legal-date { color: var(--ink-3); font-size: .9rem; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 20px; }

/* site footer */
.site-footer { background: var(--navy); color: var(--on-dark-2); font-size: .9rem; padding-bottom: env(safe-area-inset-bottom); }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 48px max(20px, env(safe-area-inset-right)) 32px max(20px, env(safe-area-inset-left));
  display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 36px; }
.footer-col h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin: 6px 0 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.site-footer a { color: var(--on-dark); }
.site-footer a:hover { color: #fff; }
.footer-brand { padding: 0 0 12px; }
.footer-about p { margin: 0 0 16px; max-width: 420px; line-height: 1.6; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.footer-social { display: flex; flex-wrap: wrap; gap: 8px; }
.social-pill { border: 1px solid color-mix(in srgb, var(--c-light) 25%, transparent); border-radius: 99px; padding: 6px 13px; font-size: .82rem; font-weight: 600; }
.social-pill:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--navy-2); max-width: 1120px; margin: 0 auto; padding: 18px max(20px, env(safe-area-inset-right)) 22px max(20px, env(safe-area-inset-left));
  display: flex; gap: 10px 24px; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: .84rem; }
.footer-note { flex: 1 1 320px; text-align: center; }
.footer-bottom nav { display: flex; gap: 18px; flex-wrap: wrap; }
.app-footer { display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; padding: 16px 32px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: .82rem; max-width: 1280px; width: 100%; margin: 0 auto; }
.app-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.app-footer a { color: var(--ink-2); }

/* admin: settings & users */
.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.settings-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: .86rem; }
.settings-nav a:hover { text-decoration: none; border-color: color-mix(in srgb, var(--primary) 30%, white); color: var(--primary); }
.settings-nav svg { width: 16px; height: 16px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; font-weight: 400; margin: 0; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.choice input { margin-top: 3px; flex-shrink: 0; }
.choice > span { display: flex; flex-direction: column; gap: 3px; }
.preset-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.grid.tight { gap: 0 14px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 20px 0 16px; }
ol.howto { margin: 12px 0; padding-left: 1.3em; display: grid; gap: 8px; font-size: .9rem; color: var(--ink-2); }
code.copy { background: var(--primary-50); color: var(--primary-600); padding: 2px 7px; border-radius: 6px; cursor: copy; word-break: break-all; }
code.copy.copied { background: var(--good-bg); color: var(--good); }
code.copy.copied::after { content: "  ✓ copied"; font-family: var(--font); }
.status-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.status-list > div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.search-form input { width: 240px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions form { margin: 0; }
td.break { word-break: break-all; }
textarea.tall { min-height: 360px; font-size: .92rem; line-height: 1.55; }

/* layout helpers that replace fixed inline column widths */
.grid-split-wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.grid-split-wider { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.grid-score { grid-template-columns: 300px minmax(0, 1fr); margin-bottom: 20px; }
.filter-input { width: 220px !important; }

/* public header menu button */
.nav-toggle { display: none; background: transparent; border: 1px solid color-mix(in srgb, var(--c-light) 35%, transparent); color: #fff; border-radius: 10px;
  width: 44px; height: 42px; place-items: center; cursor: pointer; padding: 0; }
.nav-toggle svg { width: 22px; height: 22px; }

/* ---------- responsive: large desktops ---------- */
@media (min-width: 1600px) {
  body { font-size: 15.5px; }
  .hero-inner, .section, .footer-inner, .footer-bottom, .public-flash { max-width: 1280px; }
  .section-alt > * { max-width: 1280px; }
}

/* ---------- laptops & small desktops ---------- */
@media (max-width: 1280px) {
  .status-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diagram-card { grid-template-columns: 1fr; }
  .sidebar { width: 228px; }
  .content { padding: 24px 24px 44px; }
  .app-footer { padding-left: 24px; padding-right: 24px; }
  .hero { padding: 64px 32px 72px; }
  .hero h1 { font-size: 2.3rem; }
  .hero-inner { gap: 32px; }
  .section { padding: 56px 28px; }
  .grid-score { grid-template-columns: 240px minmax(0, 1fr); }
}

/* ---------- tablets (portrait) & large phones ---------- */
@media (max-width: 960px) {
  .grid-split-wide, .grid-split-wider, .grid-score { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-about { grid-column: 1 / -1; }
  .legal { padding: 30px 28px; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -280px; width: 264px; z-index: 50; transition: left .2s; padding-top: env(safe-area-inset-top); }
  .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
  .topbar { display: flex; }
  .content { padding: 20px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); }
  .app-footer { padding-left: 16px; padding-right: 16px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero { padding: 48px 20px 56px; }
  .hero h1 { font-size: 2rem; }
  .auth-split { grid-template-columns: 1fr; max-width: 480px; }
  .auth-side { display: none; }
  .home-in-app { margin: -20px -16px 0; }
  .section { padding: 44px 20px; }
  .public-nav { padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); padding-top: max(10px, env(safe-area-inset-top)); }
  .nav-toggle { display: grid; }
  .public-menu { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--navy); flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left)); border-top: 1px solid var(--navy-2); box-shadow: var(--shadow-lg); }
  .public-menu.open { display: flex; }
  .public-nav nav a { padding: 13px 4px; border-bottom: 1px solid var(--navy-2); font-size: 1rem; }
  .public-nav nav a.btn { margin-top: 12px; border-bottom: 0; padding: 13px; font-size: 1rem; }
  .compare, .pair { grid-template-columns: 1fr; }
  .req-item { grid-template-columns: 44px 1fr; }
  .req-item .actions { grid-column: 2; }
  dl.kv { grid-template-columns: 1fr; }
  .doc-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .doc-nav::-webkit-scrollbar { display: none; }
  .doc-nav a, .doc-nav span { white-space: nowrap; }
  .choice-grid { grid-template-columns: 1fr; }
  .page-head { margin-bottom: 18px; }
  /* 16px text inputs stop iPhone/iPad Safari from zooming in when a field is tapped */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea { font-size: 16px; }
  .sticky-bar { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* ---------- phones ---------- */
@media (max-width: 600px) {
  body { font-size: 15px; }
  h1 { font-size: 1.45rem; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 1.5rem; }
  .stat-icon { width: 32px; height: 32px; }
  .card { padding: 16px; border-radius: 12px; }
  .sticky-bar { margin: 0 -16px -16px; }
  .admin-field.is-custom { margin-left: -11px; padding-left: 8px; }
  .hero { padding: 40px 18px 48px; }
  .hero h1 { font-size: 1.75rem; }
  .hero p.lead { font-size: 1rem; }
  .hero .row .btn { flex: 1 1 100%; }
  .section h2 { font-size: 1.5rem; }
  .auth-wrap { padding: 20px 12px 32px; place-items: start center; }
  .auth-split { border-radius: 16px; }
  .auth-card { padding: 24px 18px; }
  .auth-card h1 { font-size: 1.4rem; }
  .page-head .row { width: 100%; }
  .page-head .row > .btn, .page-head .row > form { flex: 1 1 auto; }
  .filter-input, .search-form input { width: 100% !important; }
  .search-form { width: 100%; flex-wrap: nowrap; }
  .footer-inner { grid-template-columns: 1fr; gap: 26px; padding-top: 36px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-note { text-align: left; flex-basis: auto; }
  .app-footer { flex-direction: column; }
  .legal-wrap { padding: 16px 12px 36px; }
  .legal { padding: 22px 18px; }
  .legal h1 { font-size: 1.55rem; }
  .status-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table th, .table td { padding: 9px 8px; }
  .score-ring, .score-ring canvas { width: 170px; height: 170px; }
  .finding { padding: 12px; }
  .code-input { font-size: 1.4rem !important; letter-spacing: .35em; }
  /* users table becomes cards */
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .table-stack td { border: 0; padding: 4px 0; }
  .table-stack td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; }
  .table-stack .row-actions { justify-content: flex-start; padding-top: 8px; }
}
@media (max-width: 380px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .brand small { display: none; }
  .btn { padding: 10px 14px; }
}

/* touch screens: comfortable tap targets */
@media (pointer: coarse) {
  .btn-sm { min-height: 38px; }
  .nav-link { padding: 12px 10px; }
  .check input, .consent input { width: 20px; height: 20px; }
  .tab { padding: 12px 14px; }
}

/* landscape phones: let the menu scroll */
@media (max-height: 500px) and (orientation: landscape) {
  .public-menu.open { max-height: calc(100dvh - 64px); overflow-y: auto; }
  .auth-wrap { place-items: start center; }
}
.topbar .btn svg { width: 22px; height: 22px; }
@media (max-width: 600px) { .table-stack td.row-actions { display: flex; } }
