:root {
  /* Brand identity (2026-11-21): engineering navy, blueprint blue, AI cyan. */
  --navy: #0e2a47;
  --navy-2: #143b63;
  --brand: #1e6fd9;
  --brand-dark: #1557ad;
  --brand-soft: #e8f1fd;
  --accent: #12a4b8;
  --accent-soft: #e3f6f8;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --ink: #172433;
  --muted: #5b6b7d;
  --line: #dce3ec;
  --ok: #1d7a46;
  --warn: #a35a00;
  --danger: #b3261e;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 32, 56, .06), 0 4px 14px rgba(16, 32, 56, .05);
  --shadow-lg: 0 10px 30px rgba(14, 42, 71, .14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--brand);
  color: #fff;
}
.brand { font-size: 18px; font-weight: 600; }
.version { font-size: 13px; opacity: 0.8; }

.layout { display: flex; min-height: calc(100vh - 56px); }

.sidebar {
  flex: 0 0 240px;
  padding: 16px 12px;
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
}
.nav-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}
.nav-item.active { background: #e6eef5; color: var(--brand); font-weight: 600; }
.nav-item.disabled { color: var(--muted); }
.nav-item small { font-size: 11px; white-space: nowrap; }

.content { flex: 1; min-width: 0; padding: 24px 32px 48px; max-width: 980px; }

h1 { margin: 0 0 16px; font-size: 24px; }
h2 { margin: 32px 0 12px; font-size: 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.card-label { font-size: 13px; color: var(--muted); }
.card-value { margin: 4px 0; font-size: 22px; font-weight: 600; }
.card-value.ok { color: var(--ok); }
.card-value.warn { color: var(--warn); }
.card-note { font-size: 13px; color: var(--muted); }

table.data { width: 100%; max-width: 420px; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
table.data th, table.data td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: start; font-weight: 400; }
table.data td { text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; }
table.data tr:last-child th, table.data tr:last-child td { border-bottom: 0; }

.phases { margin: 0; padding-inline-start: 24px; }
.phases li { padding: 4px 0; color: var(--muted); }
.phases li.done, .phases li.current { color: var(--ink); }
.phases li.current .phase-title { font-weight: 600; }
.tag { margin-inline-start: 8px; padding: 1px 8px; font-size: 12px; border-radius: 10px; background: #e3f1e8; color: var(--ok); }
.tag-current { background: #e6eef5; color: var(--brand); }

code { padding: 1px 5px; background: #eef1f4; border-radius: 4px; font-size: 13px; }

@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { flex: none; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .content { padding: 16px; }
}

/* --- Phase 3: library pages --- */
.content-wide { max-width: none; }
.lead { color: var(--muted); max-width: 70ch; }
.muted { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: 13px; }
.crumbs { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
a { color: var(--brand); }
h3 { margin: 20px 0 8px; font-size: 15px; }

.alert { margin: 0 0 16px; padding: 10px 14px; border-radius: 6px; border: 1px solid; }
.alert-error { background: #fdf0ee; border-color: #e8b4ab; color: #8a1f11; }
.alert-notice { background: #eaf3fb; border-color: #b5d0e6; color: #17466b; }

.badge { display: inline-block; padding: 1px 8px; font-size: 12px; font-weight: 600; border-radius: 10px; background: #e9edf1; color: var(--muted); vertical-align: middle; }
.badge-ok { background: #e3f1e8; color: var(--ok); }
.badge-error { background: #fdf0ee; color: #8a1f11; }
.badge-busy { background: #fff3dc; color: var(--warn); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.toolbar input[type="search"] { flex: 1 1 260px; max-width: 420px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], select, input[type="file"], textarea {
  width: 100%; padding: 7px 10px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid #b9c3ce; border-radius: 6px;
}
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn { display: inline-block; padding: 7px 14px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #b9c3ce; border-radius: 6px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #eef2f6; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #123a59; }

.form { display: grid; gap: 14px; max-width: 760px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.form label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.form label input, .form label select { font-weight: 400; }
.form .btn { justify-self: start; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.inline-form { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

table.grid { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
table.grid th, table.grid td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
table.grid th { font-size: 13px; color: var(--muted); font-weight: 600; background: #f8fafb; }
table.grid .num { text-align: end; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; position: relative; }  /* keeps hidden labels inside the scroll box */
.empty { color: var(--muted); padding: 12px 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 24px; margin: 0 0 20px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.report { margin: 16px 0; padding: 10px 14px; background: #fffaf0; border: 1px solid #ecd9ae; border-radius: 6px; }
.report summary { cursor: pointer; font-weight: 600; }
.report ul { margin: 4px 0 8px; padding-inline-start: 20px; }

.part { margin-top: 24px; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.clause { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin: 4px 0; }
.clause summary { display: flex; gap: 12px; align-items: baseline; padding: 8px 12px; cursor: pointer; }
.clause-number { flex: 0 0 52px; font-weight: 600; font-variant-numeric: tabular-nums; }
.clause-title { flex: 1; min-width: 0; }
.clause-page { color: var(--muted); font-size: 13px; white-space: nowrap; }
.clause-body { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.clause-meta { font-size: 13px; color: var(--muted); }
pre { margin: 0; font-family: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }

.compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.compare h2 { margin-top: 0; }
.page-image { width: 100%; height: auto; border: 1px solid var(--line); background: #fff; }
.page-text { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
@media (max-width: 1000px) { .compare { grid-template-columns: 1fr; } }

/* --- Phase 4: project pages --- */
textarea { width: 100%; padding: 7px 10px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #b9c3ce; border-radius: 6px; resize: vertical; }
textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.form label textarea { font-weight: 400; }
.btn-small { padding: 3px 10px; font-size: 13px; }
.toolbar.spaced { margin-top: 12px; }
.toolbar select { flex: 1 1 320px; max-width: 640px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.note { margin: 10px 0; padding: 10px 14px; max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.note-meta { margin: 0 0 4px; font-size: 13px; color: var(--muted); }

/* --- Phase 5: submittal pages --- */
.form.spaced { margin-top: 12px; }
.type-form { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.type-form select { width: auto; min-width: 170px; padding: 3px 8px; }
.type-form label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.existing-comment { margin: 8px 0; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }

/* --- Phase 6: review pages --- */
.card-link { color: inherit; text-decoration: none; }
.card-link:hover { border-color: var(--brand); }
.status-box { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-start; margin: 0 0 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.status-box p { flex: 1 1 320px; margin: 0; }
.finding-group { margin-top: 24px; }
.finding { margin: 10px 0; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-inline-start-width: 4px; border-radius: 6px; }
.finding-non_compliant { border-inline-start-color: #b3261e; }
.finding-missing_information { border-inline-start-color: #c2410c; }
.finding-conflicting_information { border-inline-start-color: #b3261e; }
.finding-partially_compliant { border-inline-start-color: var(--warn); }
.finding-engineer_judgment, .finding-not_in_specifications { border-inline-start-color: #6b7a8c; }
.finding-compliant { border-inline-start-color: var(--ok); }
.finding-comment { margin: 0 0 6px; font-weight: 600; }
.finding-tags { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.finding-detail { margin: 0; display: grid; grid-template-columns: minmax(140px, 180px) 1fr; gap: 6px 16px; font-size: 14px; }
.finding-detail dt { color: var(--muted); }
.finding-detail dd { margin: 0; min-width: 0; }
.evidence + .evidence { margin-top: 8px; }
blockquote { margin: 4px 0; padding: 4px 10px; border-inline-start: 3px solid var(--line); color: var(--ink); background: #f8fafb; overflow-wrap: anywhere; }
.choices { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: baseline; font-weight: 400 !important; }
.choice input { width: auto; }
@media (max-width: 720px) { .finding-detail { grid-template-columns: 1fr; } }

/* --- Phase 7: AI comparison and AI settings --- */
.ai-box { margin: 0 0 16px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.ai-box h2 { margin-top: 0; }
.ai-estimate { margin: 8px 0; padding: 8px 12px; background: #f6f8fa; border-radius: 6px; }
.ai-estimate p { margin: 4px 0; }
.badge-ai { background: #ece7f8; color: #4a3787; }
.checklist { list-style: none; padding: 0; }
.checklist li { margin: 6px 0; }

/* --- Phase 8: engineer feedback and Owner Review Queue --- */
.decision-rejected { opacity: 0.75; }
.badge-engineer { background: #e6f0fa; color: #17466b; }
.original-text blockquote { margin: 4px 0 8px; color: var(--muted); }
.quick-accept { margin-top: 8px; }
details.decide, details.history { margin-top: 8px; }
details.decide > summary, details.history > summary { cursor: pointer; color: var(--brand); font-weight: 600; }
details.decide form { margin-top: 8px; }
details.history ol { margin: 6px 0; padding-inline-start: 20px; }
fieldset.propose { margin: 8px 0; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 6px; }
.final-box { margin: 24px 0; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.final-box h2 { margin-top: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 0 0 16px; }
.filters label { display: flex; flex-direction: column; font-size: 13px; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.compare blockquote { margin: 4px 0; }
.diff del { background: #fdf0ee; color: #8a1f11; }
.diff ins { background: #e3f1e8; color: var(--ok); text-decoration: none; }

/* --- Phase 9: knowledge base and Owner Dashboard --- */
.knowledge-box { margin: 0 0 16px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.knowledge-box > summary { cursor: pointer; font-weight: 600; }
.knowledge-used { padding-inline-start: 20px; }
.knowledge-used li { margin: 8px 0; }
.knowledge-text { font-size: 16px; margin: 8px 0 16px; padding: 10px 14px; background: var(--surface); border-inline-start: 4px solid var(--brand); }
.inline-form.compact { margin-top: 0; }

/* --- Phase 12: sign-in and accounts --- */
.topbar-right { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }
.topbar-user { color: inherit; text-decoration: none; font-weight: 600; }
.login-box { max-width: 380px; margin: 48px auto; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.user-table td form { margin: 0; }

/* --- Password fields: show/hide and confirmation --- */
.field { display: grid; gap: 4px; font-size: 14px; }
.field > label { font-weight: 600; }
.password-field { position: relative; display: flex; align-items: stretch; }
.password-field input { padding-inline-end: 44px; }
.password-toggle {
  position: absolute; inset-block: 1px; inset-inline-end: 1px; width: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 0 5px 5px 0; background: transparent; color: var(--muted); cursor: pointer;
}
.password-toggle:hover { color: var(--brand); background: #eef2f6; }
.password-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.password-toggle .icon-hide { display: none; }
.password-toggle[aria-pressed="true"] .icon-show { display: none; }
.password-toggle[aria-pressed="true"] .icon-hide { display: block; }
input[aria-invalid="true"] { border-color: #b3261e; }
.field-error { margin: 0; font-size: 13px; color: #8a1f11; }
/* Hide the browser's own reveal button so only one eye is shown. */
input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display: none; }
.set-password summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.set-password form { margin-top: 8px; display: grid; gap: 8px; min-width: 220px; }

/* --- Review status and review mode (Reviews and Submittals pages) --- */
.badge-info { background: #e6f0fa; color: #17466b; }
.badge-icon { display: inline-flex; align-items: center; gap: 4px; }
.badge-icon .icon { width: 12px; height: 12px; fill: currentColor; flex: none; }
.badge { white-space: nowrap; }
.cell-note { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.review-filters { align-items: flex-end; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.review-filters select { min-width: 150px; }
.review-filters .reset-link { align-self: center; font-size: 13px; }
.review-filters .filter-count { margin-inline-start: auto; align-self: center; }
.review-filters .file-search { flex: 1 1 220px; max-width: 360px; }
.filter-note { flex-basis: 100%; margin: 0; font-size: 12px; }

.page-time-note { margin: 32px 0 0; font-size: 12px; color: var(--muted); }

/* --- Revision Comparison (2026-11-24) --- */
.compare-form .form-row label { flex: 1 1 320px; }
.compare-check.ok { border-inline-start: 4px solid var(--ok); }
.compare-check.blocked { border-inline-start: 4px solid #b3261e; }
.progress-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 12px; }
.progress-track { flex: 0 1 360px; height: 10px; background: #e3e8ee; border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: #1e7b34; }

/* Comparison page (2026-11-25). One colour per status, used by the cards, the table and the exports. */
:root { --c-resolved: #1e7b34; --c-pending: #b3261e; --c-partial: #c25e00; --c-engineer: #8a6a00;
        --c-not_reassessed: #4a6a8a; --c-new: #6b3fa0; --c-info: #5b6b7d; --c-worse: #b3261e; --c-first_reviewed: #4a6a8a; }
.cmp-head { padding: 16px 18px; margin: 0 0 12px; background: var(--surface); border: 1px solid var(--line);
            border-radius: var(--radius); box-shadow: var(--shadow); }
.cmp-project { margin: 0; color: var(--muted); font-size: 13px; }
.cmp-head h1 { margin: 2px 0 4px; }
.cmp-revs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 22px; font-weight: 700; color: var(--navy); }
.cmp-revs .badge { font-size: 12px; font-weight: 600; }
.cmp-arrow { color: var(--brand); }
.cmp-sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.cmp-side { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.cmp-side-label { margin: 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cmp-side-name { margin: 2px 0 6px; font-weight: 600; overflow-wrap: anywhere; }
.cmp-facts { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 0; font-size: 13px; }
.cmp-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.cmp-facts dt { color: var(--muted); }
.cmp-facts dd { margin: 0; overflow-wrap: anywhere; }
.cmp-spec { margin: 10px 0 0; }
.cmp-coverage { margin: 4px 0 0; }
.cmp-warning { margin-bottom: 8px; }
.cmp-summary { display: grid; grid-template-columns: minmax(0, 6fr) minmax(170px, 1fr); gap: 16px; margin: 14px 0 6px; }
.cmp-group-title { margin: 0 0 6px; font-size: 14px; }
.cmp-group-title .hint { font-weight: 400; margin-inline-start: 6px; }
.cmp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.cmp-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; text-align: start;
            background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--line);
            border-radius: 8px; cursor: pointer; font: inherit; color: inherit; }
div.cmp-card { cursor: default; }  /* plain counts (2026-11-26): the cards no longer filter the table */
button.cmp-card:hover, button.cmp-card:focus-visible { border-color: var(--brand); }
.cmp-card.selected { outline: 2px solid var(--brand); outline-offset: 1px; }
.cmp-card-label { font-size: 12.5px; color: var(--muted); }
.cmp-card-value { font-size: 24px; font-weight: 700; color: var(--navy); }
.cmp-card.total { border-inline-start-color: var(--navy); }
.cmp-card.result-resolved { border-inline-start-color: var(--c-resolved); } .cmp-card.result-resolved .cmp-card-value { color: var(--c-resolved); }
.cmp-card.result-pending { border-inline-start-color: var(--c-pending); } .cmp-card.result-pending .cmp-card-value { color: var(--c-pending); }
.cmp-card.result-partial { border-inline-start-color: var(--c-partial); } .cmp-card.result-partial .cmp-card-value { color: var(--c-partial); }
.cmp-card.result-engineer { border-inline-start-color: var(--c-engineer); } .cmp-card.result-engineer .cmp-card-value { color: var(--c-engineer); }
.cmp-card.result-not_reassessed { border-inline-start-color: var(--c-not_reassessed); } .cmp-card.result-not_reassessed .cmp-card-value { color: var(--c-not_reassessed); }
.cmp-card.result-new { border-inline-start-color: var(--c-new); } .cmp-card.result-new .cmp-card-value { color: var(--c-new); }
.cmp-card.result-worse { border-inline-start-color: var(--c-worse); } .cmp-card.result-worse .cmp-card-value { color: var(--c-worse); }
.cmp-card.result-first_reviewed { border-inline-start-color: var(--c-first_reviewed); } .cmp-card.result-first_reviewed .cmp-card-value { color: var(--c-first_reviewed); }
/* Verdict box (2026-11-26): is the new revision better? */
.cmp-verdict { margin: 0 0 12px; padding: 12px 16px; border: 1px solid var(--line); border-inline-start: 6px solid var(--c-info);
               border-radius: var(--radius); background: #f1f4f7; }
.cmp-verdict-head { margin: 0 0 4px; font-size: 19px; font-weight: 700; color: var(--c-info); }
.cmp-verdict-line { margin: 2px 0 0; font-size: 14px; }
.cmp-verdict-line .sep { margin: 0 6px; color: var(--muted); }
.cmp-verdict-confirm { color: var(--c-engineer); }
.cmp-verdict.verdict-better { border-inline-start-color: var(--c-resolved); background: #e7f4ea; }
.cmp-verdict.verdict-better .cmp-verdict-head { color: var(--c-resolved); }
.cmp-verdict.verdict-mixed { border-inline-start-color: var(--c-partial); background: #fdeedd; }
.cmp-verdict.verdict-mixed .cmp-verdict-head { color: var(--c-partial); }
.cmp-verdict.verdict-worse { border-inline-start-color: var(--c-pending); background: #fbe9e7; }
.cmp-verdict.verdict-worse .cmp-verdict-head { color: var(--c-pending); }
.cmp-filters { margin-top: 4px; }
.cmp-table-wrap { max-height: 78vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cmp-table { table-layout: fixed; width: 100%; min-width: 980px; margin: 0; border: 0; }
/* Page table widths (2026-11-26): No. stays narrow, the two review columns get the room their evidence needs and
   the outcome column takes what is left, so no column is stretched past its text. */
.cmp-table col.c-no { width: 52px; } .cmp-table col.c-ref { width: 120px; } .cmp-table col.c-req { width: 26%; }
.cmp-table col.c-ev { width: 27%; } .cmp-table col.c-res { width: auto; }
.cmp-table .th-sub { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
/* Redesigned table (2026-11-26): small status badges with light backgrounds, never colour alone. */
.badge-s { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.5;
           background: #eef1f4; color: #4f5d6b; }
.badge-s.tone-ok { background: #e7f4ea; color: #1e7b34; }
.badge-s.tone-warn { background: #fdf0dc; color: #8a5300; }
.badge-s.tone-bad { background: #fbe9e7; color: #b3261e; }
.badge-s.tone-info { background: #e6f0f9; color: #1f5a8a; }
.badge-s.tone-new { background: #f1eafa; color: #6b3fa0; }
.badge-s.tone-grey { background: #e9edf1; color: #4f5d6b; }
.badge-s.tone-light { background: #f3f5f7; color: #7a8590; }
.badge-s.tone-pending { background: #fdecea; color: #c0392b; }
.badge-s.tone-blue { background: #e6f0f9; color: #1f5a8a; }
/* Revision Outcome Summary on the page (2026-11-26), as in the PDF */
.cmp-outcome { margin: 18px 0 14px; }
.cmp-outcome h2 { margin: 0 0 6px; }
table.grid.cmp-outcome-table { width: auto; min-width: 640px; max-width: 100%; margin: 0 0 6px; }
.cmp-outcome-table th, .cmp-outcome-table td { padding: 6px 12px; vertical-align: middle; }
.cmp-outcome-table .num { text-align: right; font-variant-numeric: tabular-nums; width: 90px; }
.cmp-outcome-table td.sub { padding-inline-start: 26px; }
.cmp-outcome-table tr.group td { font-weight: 700; background: #f2f5f8; }
.cmp-outcome-table tr.group td.meaning, .cmp-outcome-table td.meaning { font-size: 13px; color: var(--muted); font-weight: 400; }
/* R00 vs R01 Compliance Summary on the page (2026-11-26), as in the PDF */
.cmp-compliance { margin: 4px 0 14px; }
.cmp-compliance h2 { margin: 0 0 6px; }
table.grid.cmp-compliance-table { width: auto; min-width: 520px; max-width: 100%; margin: 0 0 6px; }
.cmp-compliance-table th, .cmp-compliance-table td { padding: 6px 12px; }
.cmp-compliance-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cmp-compliance-table .diff { font-weight: 600; color: var(--muted); }
.cmp-compliance-table .diff.good { color: #1e7b34; } .cmp-compliance-table .diff.bad { color: #b3261e; }
.cmp-compliance-table tr.total td { font-weight: 700; background: #f2f5f8; border-top: 2px solid var(--navy); }
.cmp-table tbody tr.cmp-row:nth-of-type(4n+3) td { background: #f9fbfc; }
.cmp-table td { padding: 9px 10px; line-height: 1.5; }
.cmp-req .cmp-ref { display: block; }
.cmp-req-text { display: block; margin-top: 2px; font-size: 14px; }
.cmp-req-text.muted { color: var(--muted); font-size: 13px; }
.ev-cell .ev-finding { display: block; margin-top: 4px; }
.ev-cell .ev-confirm { display: block; font-size: 11.5px; color: var(--muted); }
.ev-cell .ev-item { display: block; margin-top: 4px; }
.ev-cell .ev-page { display: block; font-weight: 600; color: var(--navy); }
.ev-cell q { font-style: italic; }
.ev-cell .ev-text { display: block; margin-top: 4px; }
.ev-cell .ev-text.muted, .outcome-cell .cell-note { color: var(--muted); }
.outcome-cell .cell-note { display: block; margin-top: 4px; }
.outcome-cell .cell-note.suggestion { color: #1e7b34; }
.cmp-legend { margin: 4px 0 10px; font-size: 13px; }
.cmp-legend summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.cmp-legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 6px 24px; margin-top: 8px; }
.cmp-legend dl { margin: 0; }
.cmp-legend dl div { display: grid; grid-template-columns: 190px 1fr; gap: 10px; padding: 3px 0; }
.cmp-legend dd { margin: 0; color: var(--muted); }
.cmp-table th, .cmp-table td { vertical-align: top; overflow-wrap: anywhere; }
.cmp-table thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); box-shadow: inset 0 -1px 0 var(--line); }
.cmp-table .sticky-1, .cmp-table .sticky-2 { position: sticky; z-index: 2; background: var(--surface); }
.cmp-table .sticky-1 { left: 0; } .cmp-table .sticky-2 { left: 56px; box-shadow: inset -1px 0 0 var(--line); }
.cmp-table thead .sticky-1, .cmp-table thead .sticky-2 { z-index: 4; }
.cmp-row { cursor: pointer; }
.cmp-row:hover td, .cmp-row.open td { background: #f5f8fc; }
.cmp-row:hover .result-cell, .cmp-row.open .result-cell { filter: brightness(.98); }
.cmp-toggle { width: 100%; padding: 2px 0; text-align: start; white-space: nowrap; font: inherit; font-weight: 600; color: var(--brand);
              background: none; border: 0; cursor: pointer; }
.cmp-toggle::before { content: "▸ "; } .cmp-toggle[aria-expanded="true"]::before { content: "▾ "; }
.cmp-ref { font-weight: 600; color: var(--navy); }
.cmp-has-note { display: inline-block; margin-inline-start: 6px; padding: 0 5px; font-size: 11px; font-weight: 600;
                color: var(--brand); border: 1px solid var(--brand); border-radius: 8px; }
.cmp-table .cell-small { font-size: 13px; }
.result-cell strong { display: inline-block; }
.result-cell.result-resolved { background: #e7f4ea; color: var(--c-resolved); }
.result-cell.result-pending { background: #fbe9e7; color: var(--c-pending); }
.result-cell.result-partial { background: #fdeedd; color: var(--c-partial); }
.result-cell.result-engineer { background: #fff5d6; color: var(--c-engineer); }
.result-cell.result-not_reassessed { background: #e8eef5; color: var(--c-not_reassessed); }
.result-cell.result-new { background: #f1eafa; color: var(--c-new); }
.result-cell.result-worse { background: #fbe9e7; color: var(--c-worse); }
.result-cell.result-first_reviewed { background: #e8eef5; color: var(--c-first_reviewed); }
.result-cell.result-remains_compliant, .result-cell.result-new_compliant, .result-cell.result-previously_compliant { background: #f1f4f7; color: var(--c-info); }
.result-cell .cell-note { color: var(--muted); }
.result-cell .suggestion, .cmp-detail .suggestion { color: var(--c-resolved); }
.cmp-detail > td { background: #f8fafc; padding: 12px 14px 16px; }
.cmp-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px 20px; max-width: 1400px; }
.cmp-detail h3 { margin: 0 0 6px; font-size: 13.5px; color: var(--navy); }
.cmp-dl { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; margin: 0; font-size: 13px; }
.cmp-dl dt { color: var(--muted); } .cmp-dl dd { margin: 0; } .cmp-dl .pre, .cmp-detail .pre { white-space: pre-line; }
.cmp-note-form textarea { width: 100%; font-size: 13px; }
.cmp-note-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cmp-note-state { font-size: 12.5px; color: var(--c-resolved); }
.cmp-note-state.unsaved { color: var(--c-pending); }
@media (max-width: 760px) {
  .cmp-summary { grid-template-columns: 1fr; }
  .cmp-dl { grid-template-columns: 1fr; }
}
table.status-table td { white-space: normal; min-width: 8em; }
table.status-table td.num { min-width: 0; }
table.status-table .col-badge { white-space: nowrap; }
@media (max-width: 640px) {
  .review-filters label, .review-filters select { width: 100%; }
  .review-filters .filter-count { margin-inline-start: 0; }
}

/* --- Plans and subscriptions (Owner) --- */
.plan-box { margin: 8px 0; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.plan-box summary { cursor: pointer; }
.plan-box .form { margin-top: 10px; border: 0; padding: 0; max-width: none; }
.plan-box h3 { font-size: 14px; margin: 14px 0 4px; }
.plan-history { margin: 0; padding-inline-start: 18px; font-size: 13px; }
.over-limit { color: #8a1f11; font-weight: 600; }

/* --- Subscription, credits and review type (customers) --- */
.account-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0 0 14px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.account-strip a { margin-inline-start: auto; font-size: 13px; }
.account-strip-low { border-color: #e7b4ab; background: #fdf6f4; }
.review-mode-choice .choice { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.review-mode-choice .choice:has(input:checked) { border-color: var(--brand); }
.choice-disabled { opacity: .6; }
.sub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 18px; }
.sub-card { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.sub-card .card-label { font-size: 13px; color: var(--muted); }
.sub-card .card-value { font-size: 22px; font-weight: 700; margin: 2px 0; }
.meter { height: 6px; background: #e9edf1; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.meter span { display: block; height: 100%; background: var(--brand); }
.meter .meter-full { background: #b3261e; }
/* Inside forms, a tick box or option button sits beside its text (".form label" is a grid). */
.form label.choice { display: flex; gap: 10px; align-items: baseline; }
.form label.choice input { flex: none; }
table.grid td.indent { padding-inline-start: 28px; color: var(--muted); }

/* --- Owner deletion (2026-11-20) --- */
.danger-box { margin: 12px 0 18px; padding: 12px 16px; background: #fdf0ee; border: 1px solid #e7b4ab; border-left: 4px solid #b3261e; border-radius: 6px; color: #5c160c; }
.danger-box p { margin: 6px 0; }
.btn-danger { background: #b3261e; border-color: #b3261e; color: #fff; }
.btn-danger:hover { background: #8a1f11; }
.warn-text { color: #8a1f11; }
.btn-link-danger { color: #8a1f11; }

/* ======================================================================================
   Design system (2026-11-21): one look for the whole product. Later rules refine the
   earlier ones; class names are unchanged, so every page and action works as before.
   ====================================================================================== */
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; color: var(--navy); }
h2 { font-size: 18px; font-weight: 650; color: var(--navy); }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
.icon { flex: none; vertical-align: middle; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; align-items: center; min-height: 58px; padding: 0 20px;
  background: linear-gradient(90deg, var(--navy), var(--navy-2)); box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 17px; font-weight: 650; letter-spacing: .01em; }
.brand:hover { color: #fff; }
.brand .icon { color: #7fe3ee; }
.topbar-right { gap: 14px; }
.topbar-link { color: #d6e3f3; text-decoration: none; font-size: 14px; }
.topbar-link:hover { color: #fff; }
.topbar-user { display: inline-flex; align-items: center; gap: 8px; color: #fff; }
.topbar-user:hover { color: #fff; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; }
.version { color: #9fb6cf; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-button { display: none; color: #fff; cursor: pointer; margin-inline-end: 6px; }

/* Sidebar */
.layout { min-height: calc(100vh - 58px); }
.sidebar { flex: 0 0 248px; padding: 14px 10px 24px; background: var(--surface); border-inline-end: 1px solid var(--line); }
.nav-group + .nav-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.nav-heading { padding: 4px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8a98a8; }
.nav-item { align-items: center; justify-content: flex-start; gap: 10px; padding: 8px 12px; margin: 1px 0; border-radius: 8px; color: #334355; font-size: 14.5px; }
.nav-item .icon { color: #7b8a9b; }
.nav-item:hover { background: #f1f5fa; color: var(--navy); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 650; box-shadow: inset 3px 0 0 var(--brand); }
.nav-item.active .icon { color: var(--brand); }

/* Content and cards */
.content { padding: 28px 36px 56px; max-width: 1040px; }
.content-wide { max-width: none; }
.card, .sub-card, .status-box, .form, .ai-box, .final-box, .knowledge-box, .plan-box, .note, .review-filters, .account-strip, .finding, .clause {
  border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.finding { border-inline-start-width: 4px; }
.card-value, .sub-card .card-value { color: var(--navy); letter-spacing: -.01em; }
.lead { font-size: 15.5px; }

/* Buttons and fields */
.btn { border-radius: 8px; border-color: #c4cfdb; font-weight: 550; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: #f1f5fa; border-color: #aebdcc; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(30,111,217,.25); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { color: #fff; }
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="month"], select, input[type="file"], textarea { border-color: #c4cfdb; border-radius: 8px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,111,217,.18); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Tables */
table.grid { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border-collapse: separate; border-spacing: 0; }
table.grid th { background: #f6f8fb; color: #5b6b7d; font-size: 12.5px; letter-spacing: .01em; }
table.grid tbody tr:hover td { background: #fafcff; }
table.grid tr:last-child td { border-bottom: 0; }
.table-scroll table.grid { box-shadow: none; }
.table-scroll { border-radius: var(--radius); box-shadow: var(--shadow); }

/* Status labels */
.badge { border-radius: 999px; padding: 2px 9px; font-size: 11.5px; letter-spacing: .01em; }
.badge-info { background: var(--brand-soft); color: var(--brand-dark); }
.alert { border-radius: var(--radius); }
.alert-notice { background: var(--brand-soft); border-color: #bcd5f5; color: #12437f; }

/* Charts and progress (real figures only) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0 0 22px; }
.stat { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
a.stat-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.stat-link:hover { border-color: #b7cbe4; box-shadow: var(--shadow-lg); color: inherit; }
.findings-bar { margin: 18px 0 6px; }
/* Delete confirmation pages (2026-11-23) */
.delete-box { max-width: 760px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.delete-box h2 { font-size: 16px; margin: 18px 0 6px; }
.delete-impact, .delete-keep { margin: 0; padding-inline-start: 20px; line-height: 1.6; }
.delete-keep { color: var(--muted); }
.delete-box .form { border: 0; box-shadow: none; padding: 0; margin-top: 10px; background: none; }
.row-actions { white-space: nowrap; }
.btn-link-danger { background: none; border: 0; padding: 0; color: #8a1f11; text-decoration: underline; cursor: pointer; font: inherit; }
/* AI result: the AI's own notes (everyone) and technical details (Owner only), 2026-11-23 */
.ai-notes, .ai-tech { margin: 12px 0 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfcfe; }
.ai-notes summary, .ai-tech summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.ai-notes p { margin: 8px 0 0; line-height: 1.55; }
.ai-tech table.grid { margin: 10px 0; box-shadow: none; }
.ai-tech .left-out { margin: 6px 0 0; padding-inline-start: 18px; font-size: 13.5px; }
.ai-tech .left-out li { margin: 3px 0; }

/* Plan columns on the Subscription page (2026-11-21) */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 6px 0 22px; align-items: stretch; }
.plan-card { --plan: #5b6b7d; --plan-soft: #f1f4f8; display: flex; flex-direction: column; padding: 20px 20px 18px; background: var(--surface);
  border: 1px solid var(--line); border-top: 4px solid var(--plan); border-radius: 14px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.plan-basic { --plan: #12a4b8; --plan-soft: #e3f6f8; }
.plan-advanced { --plan: #1e6fd9; --plan-soft: #e8f1fd; }
.plan-custom { --plan: #0e2a47; --plan-soft: #eaf0f6; }
.plan-card.is-current { border-color: var(--plan); box-shadow: 0 0 0 2px var(--plan-soft), var(--shadow); }
.plan-top { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.plan-card h3 { margin: 12px 0 4px; font-size: 19px; color: var(--navy); }
.plan-price { display: flex; align-items: baseline; gap: 5px; margin: 4px 0 6px; color: var(--navy); }
.plan-currency { font-size: 14px; font-weight: 650; color: var(--muted); }
.plan-amount { font-size: 30px; font-weight: 750; letter-spacing: -.02em; }
.plan-amount-text { font-size: 22px; }
.plan-period { font-size: 13.5px; color: var(--muted); }
.plan-desc { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.plan-features { list-style: none; margin: 12px 0 16px; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; flex: 1; }
.plan-features li { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; line-height: 1.4; }
.plan-features li .icon { flex: none; margin-top: 1px; padding: 2px; border-radius: 50%; box-sizing: content-box; }
.plan-features li.yes .icon { color: var(--plan); background: var(--plan-soft); }
.plan-features li.no { color: #95a2b1; }
.plan-features li.no .icon { color: #a8b4c2; background: #f1f4f8; }
.plan-features li.no em { font-style: normal; font-size: 12.5px; }
.plan-features strong { color: var(--navy); font-weight: 650; }
.plan-features li.no strong { color: inherit; }
.plan-action .btn { width: 100%; justify-content: center; }
.plan-action form { display: block; margin: 0; }
.plan-current-note { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 8px;
  background: var(--plan-soft); color: var(--plan); font-weight: 650; font-size: 14px; }
@media (max-width: 520px) { .plan-grid { grid-template-columns: 1fr; } }
.content-login { max-width: none; width: 100%; display: grid; place-items: start center; padding-top: 64px;
  background: radial-gradient(900px 400px at 50% -10%, #dce9f9 0%, transparent 70%); }
.content-login .login-box { width: min(420px, 100%); box-sizing: border-box; padding: 32px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.content-login .login-box h1 { margin: 12px 0 0; }
.content-login .login-box > .hint:first-of-type { margin-top: 2px; }
.content-login .login-box .form { border: 0; box-shadow: none; padding: 0; margin: 18px 0 8px; background: none; }
.content-login .login-box .btn-primary { width: 100%; padding: 10px; }
.login-mark { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--navy); color: #7fe3ee; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; }
.field-grid input { width: 100%; box-sizing: border-box; }
input[type="tel"], input[type="url"] { border: 1px solid #c4cfdb; border-radius: 8px; padding: 7px 9px; font: inherit; }
.dash-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.stat-top .icon { color: var(--brand); }
.stat-value { margin: 6px 0 2px; font-size: 28px; font-weight: 700; color: var(--navy); letter-spacing: -.02em; }
.stat-note { font-size: 12.5px; color: var(--muted); }
.stackbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #e9eef4; }
.stackbar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.seg-compliant { background: #1d7a46; }
.seg-partially_compliant { background: #d18a00; }
.seg-non_compliant { background: #b3261e; }
.seg-missing_information { background: #e0703a; }
.seg-conflicting_information { background: #8e2a8e; }
.seg-engineer_judgment { background: #6b7a8c; }
.seg-not_in_specifications { background: #a8b4c2; }
.seg-engineer_comment { background: #1e6fd9; }
.seg-reviewed { background: #1d7a46; }
.seg-in_progress { background: #1e6fd9; }
.panel { padding: 16px 18px; margin: 0 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel h2 { margin-top: 0; font-size: 16px; }
.progress { height: 8px; background: #e6edf5; border-radius: 999px; overflow: hidden; margin: 8px 0 4px; max-width: 520px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 999px; transition: width .4s; }
.progress-running span { width: 40%; animation: progress-slide 1.6s ease-in-out infinite; }
@keyframes progress-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* Phone and tablet */
@media (max-width: 860px) {
  .nav-toggle-button { display: inline-flex; }
  .layout { flex-direction: column; }
  .sidebar { display: none; flex: none; border-inline-end: 0; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav-toggle:checked ~ .layout .sidebar { display: block; }
  .content { padding: 18px 16px 40px; }
  .topbar-link, .version { display: none; }
}
@media (max-width: 520px) {
  .topbar-name { display: none; }
  .brand span { font-size: 15px; line-height: 1.2; }
  .topbar { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Team Management: invitations by copyable link (2026-11-27, phase 2) */
td.nowrap, .nowrap { white-space: nowrap; }
.team-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.team-head > div { flex: 1 1 420px; min-width: 0; }
.team-invite-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.invite-link { margin: 8px 0 22px; padding: 16px 18px; border: 1px solid #9fd3da; border-left: 4px solid #1199aa; border-radius: 8px; background: #f0fafb; }
.invite-link h2 { margin: 0 0 6px; font-size: 18px; }
.invite-warn { margin: 0 0 10px; }
.invite-sent { margin: 0 0 10px; color: var(--ok); }
.invite-email { font-size: 12px; color: var(--muted); }
.invite-email-sent { color: var(--ok); }
.invite-email-failed { color: #8a1f11; font-weight: 600; }
.invite-copy { display: flex; gap: 8px; align-items: stretch; }
.invite-copy input { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: #fff; }
.invite-copy .btn { flex: none; }
.invite-link .hint { margin: 10px 0 0; }
.invite-local { color: #8a5a00; }
.invite-table td { vertical-align: middle; }
.invite-table td:first-child { min-width: 13em; overflow-wrap: anywhere; }
.invite-table .inline-form.compact { display: inline-flex; margin: 2px 4px 2px 0; }
.invite-form-box { margin: 22px 0; padding: 4px 18px 14px; border: 1px solid var(--line, #d9e0e7); border-radius: 8px; background: var(--surface); }
.invite-form-box > summary { cursor: pointer; list-style: revert; }
.invite-form-box > summary h2 { display: inline; margin: 0; font-size: 18px; line-height: 2.6; }
.invite-form-box form { margin-top: 6px; }
.invite-form-box textarea { width: 100%; }
@media (max-width: 560px) {
  .invite-copy { flex-direction: column; }
  .team-invite-btn { width: 100%; justify-content: center; }
}

/* Feature access switches on the Owner's Companies and users page (2026-11-27) */
.feature-table td { vertical-align: middle; }
.feature-table th:nth-child(3), .feature-table th:nth-child(4) { min-width: 9.5em; }
.feature-form { margin: 0; }
.feature-switch { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; font: inherit; font-size: 13px; font-weight: 650;
  border: 1px solid; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.feature-switch.is-on { background: #e3f1e8; border-color: #9fcfb1; color: var(--ok); }
.feature-switch.is-off { background: #f1f3f5; border-color: #c9d1d9; color: #5b6673; }
.feature-switch:hover { filter: brightness(.97); }
.feature-switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.feature-switch:disabled { cursor: wait; opacity: .6; }
.feature-track { position: relative; width: 34px; height: 20px; border-radius: 999px; flex: none; transition: background .15s; }
.is-on .feature-track { background: var(--ok); }
.is-off .feature-track { background: #a7b1bc; }
.feature-knob { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.is-on .feature-knob { left: 17px; }
.feature-note { display: block; margin-top: 4px; max-width: 18em; }
.feature-history { margin: 4px 0 24px; }
.feature-history summary { cursor: pointer; font-weight: 600; color: var(--brand); }
