/* Medfins RegAI - styles (light / dark), no external assets.
   Brand: the two colours of the Medfins butterfly - indigo #4040C0 (primary actions, active states) and azure #1070F0
   (secondary accent, links, information). Flat surfaces with borders instead of resting shadows; shadows only on layers
   that float (menus, dialogs, toasts). 4 / 8 px spacing rhythm. */
:root {
  --brand: #4040c0; --brand-strong: #33339f; --brand-soft: #ececfb; --brand-softer: #f5f5fd; --brand-line: #c9c9f1;
  --azure: #0b6ee6; --azure-soft: #e7f1fe;
  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #f8f9fc; --surface-3: #eef0f6; --border: #e2e5ee; --border-strong: #cbd0de;
  --text: #121729; --text-2: #434b63; --muted: #646c84;
  --accent: var(--brand); --accent-soft: var(--brand-soft); --brand-2: var(--brand); --link: #3535b4;
  --ok: #157347; --ok-soft: #e2f4ea; --warn: #8f5400; --warn-soft: #fff3db; --bad: #b42318; --bad-soft: #fdeceb; --info: #0b62cc; --info-soft: #e7f1fe;
  --purple: #6236b8; --purple-soft: #f0eafb; --teal: #0e6f67; --teal-soft: #ddf3f0; --yellow: #7d6000; --yellow-soft: #fff6c7; --orange: #a6430a; --orange-soft: #ffecdc;
  --side-bg: #ffffff; --side-text: #434b63; --side-active: var(--brand-strong); --side-hover: #f1f2f8; --side-border: var(--border);
  --gate-bg: #eef0fa;
  --shadow: none; --shadow-pop: 0 10px 30px rgba(18,23,41,.14), 0 2px 6px rgba(18,23,41,.06); --shadow-lg: var(--shadow-pop);
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent);
  --radius: 12px; --radius-sm: 8px; --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --brand: #8d8dff; --brand-strong: #a9a9ff; --brand-soft: #23264a; --brand-softer: #1b1e3a; --brand-line: #3c3f78;
  --azure: #5aa8ff; --azure-soft: #142a47;
  --bg: #0d1020; --surface: #151a2c; --surface-2: #191f34; --surface-3: #222942; --border: #2a314d; --border-strong: #3a4266;
  --text: #e9ebf5; --text-2: #b9bfd6; --muted: #8e95b0; --link: #a9a9ff;
  --ok: #5fd08f; --ok-soft: #13301f; --warn: #f2b45a; --warn-soft: #362710; --bad: #ff8f86; --bad-soft: #3a1714; --info: #7db8ff; --info-soft: #142a47;
  --purple: #c3a6ff; --purple-soft: #2a2142; --teal: #5fd3c6; --teal-soft: #12302d; --yellow: #f0d46a; --yellow-soft: #322b0e; --orange: #ffb07a; --orange-soft: #382212;
  --side-bg: #11152a; --side-text: #b9bfd6; --side-hover: #1b2036; --side-border: #232a45; --gate-bg: #0d1020;
  --shadow-pop: 0 14px 40px rgba(0,0,0,.55); color-scheme: dark;
} }
:root[data-theme="dark"] {
  --brand: #8d8dff; --brand-strong: #a9a9ff; --brand-soft: #23264a; --brand-softer: #1b1e3a; --brand-line: #3c3f78;
  --azure: #5aa8ff; --azure-soft: #142a47;
  --bg: #0d1020; --surface: #151a2c; --surface-2: #191f34; --surface-3: #222942; --border: #2a314d; --border-strong: #3a4266;
  --text: #e9ebf5; --text-2: #b9bfd6; --muted: #8e95b0; --link: #a9a9ff;
  --ok: #5fd08f; --ok-soft: #13301f; --warn: #f2b45a; --warn-soft: #362710; --bad: #ff8f86; --bad-soft: #3a1714; --info: #7db8ff; --info-soft: #142a47;
  --purple: #c3a6ff; --purple-soft: #2a2142; --teal: #5fd3c6; --teal-soft: #12302d; --yellow: #f0d46a; --yellow-soft: #322b0e; --orange: #ffb07a; --orange-soft: #382212;
  --side-bg: #11152a; --side-text: #b9bfd6; --side-hover: #1b2036; --side-border: #232a45; --gate-bg: #0d1020;
  --shadow-pop: 0 14px 40px rgba(0,0,0,.55); color-scheme: dark;
}

/* ------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.25; color: var(--text); letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; } h2 { font-size: 19px; font-weight: 650; } h3 { font-size: 16px; font-weight: 650; } h4 { font-size: 15px; margin-top: 1em; } h5 { font-size: 14px; margin: .8em 0 .3em; color: var(--text-2); }
p { margin: 0 0 .7em; } code { font-family: var(--mono); font-size: 13px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .xsmall { font-size: 12.5px; } .nowrap { white-space: nowrap; } .mono { font-family: var(--mono); }
.error-text { color: var(--bad); } .warn-text { color: var(--warn); }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); align-content: center; gap: 14px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ------------------------------------------------------------ gate (setup / profile picker / access code) */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--gate-bg); }
.gate-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 36px; width: min(580px, 100%); }
.gate-card h2 { font-size: 22px; margin-top: 4px; }
.gate-actions { margin: 18px 0 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; } .brand b { display: block; font-size: 16px; letter-spacing: -.01em; } .brand small { display: block; font-size: 12.5px; color: var(--muted); }
.brand.big { margin-bottom: 24px; } .brand.big b { font-size: 20px; color: var(--text); }
.logo-mark { width: 40px; height: 40px; border-radius: 11px; background: #fff; display: grid; place-items: center; padding: 4px; flex: none; border: 1px solid var(--border); }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand.big .logo-mark { width: 56px; height: 56px; border-radius: 14px; padding: 6px; }
.boot .logo-mark { width: 64px; height: 64px; border-radius: 16px; padding: 7px; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 14px 0; }
.profiles.small { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.profile { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: left; color: var(--text); font: inherit; min-height: 60px; transition: border-color .12s, background .12s; }
.profile:hover { border-color: var(--brand); background: var(--brand-softer); } .profile small { display: block; color: var(--muted); font-size: 12.5px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 14px; } .avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; border-radius: 14px; }

/* ------------------------------------------------------------ shell */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px 14px; border-right: 1px solid var(--side-border); }
.sidebar .brand { padding: 2px 8px 20px; color: var(--text); }
.sidebar .brand .logo-mark { border-color: transparent; background: transparent; padding: 0; width: 38px; height: 38px; }
:root[data-theme="dark"] .sidebar .brand .logo-mark { background: #fff; padding: 4px; border-radius: 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sidebar .brand .logo-mark { background: #fff; padding: 4px; border-radius: 10px; } }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-text); font-weight: 550; font-size: 14.5px; min-height: 42px; position: relative; }
.nav a:hover { background: var(--side-hover); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--side-active); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav .ic { width: 20px; height: 20px; }
.nav-group { margin: 16px 12px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.nav a.minor { font-size: 14px; min-height: 38px; padding: 8px 12px; font-weight: 500; }
.side-foot { padding: 12px 4px 0; border-top: 1px solid var(--side-border); display: grid; gap: 6px; }
.engine-pill { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
.engine-pill.ok .ic { color: var(--ok); } .engine-pill.off .ic { color: var(--warn); } .engine-pill:hover { text-decoration: none; border-color: var(--brand-line); color: var(--text); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 28px; background: var(--bg); border-bottom: 1px solid var(--border); min-height: 62px; }
.crumbs { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--text); }
.crumbs .sep .ic { width: 14px; height: 14px; } .crumbs span:last-child { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 14px 4px 4px; cursor: pointer; color: var(--text); font: inherit; text-align: left; min-height: 42px; }
.user-chip:hover { border-color: var(--brand-line); }
.user-chip small { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; } .user-chip span { line-height: 1.25; font-size: 14px; }
.view { padding: 28px 28px 72px; max-width: 1480px; width: 100%; margin: 0 auto; }
.loading { padding: 40px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.only-mobile, .icon-btn.only-mobile { display: none; }
/* global search in the top bar */
.gsearch { position: relative; flex: 0 1 460px; min-width: 200px; }
.gsearch .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.gsearch input { padding: 10px 64px 10px 40px; border-radius: 10px; background: var(--surface); min-height: 42px; }
.gsearch kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd { font-family: var(--font); font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-3); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
.gs-panel { position: absolute; right: 0; width: min(560px, calc(100vw - 24px)); top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); max-height: min(70vh, 560px); overflow: auto; padding: 6px; z-index: 60; }
.gs-group { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 10px 4px; }
.gs-item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 9px 10px; border: none; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; border-radius: 8px; min-height: 44px; }
.gs-item .ic { color: var(--brand); } .gs-item small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.gs-item.sel, .gs-item:hover { background: var(--brand-soft); }
.gs-empty { padding: 16px; color: var(--muted); font-size: 14px; }
.new-menu .btn { min-height: 42px; }
@media (max-width: 1100px) { .gsearch kbd { display: none; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; } .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-pop); } .only-mobile, .icon-btn.only-mobile { display: inline-grid; } .view { padding: 18px 16px 60px; } .topbar { padding: 8px 12px; gap: 8px; }
  .user-chip > span:last-child { display: none; } .user-chip { padding: 4px; } .gsearch { flex: 1 1 auto; min-width: 0; } .new-menu .label { display: none; }
}

/* ------------------------------------------------------------ page structure */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; } .page-head p { margin: 0; max-width: 760px; color: var(--muted); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 16px; } .card-head h3 .ic { color: var(--brand); }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-body { padding: 16px 18px; } .card-body > :last-child { margin-bottom: 0; }
.card.flush .card-body { padding: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; } .grid-2 > .span-2 { grid-column: span 2; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; } .grid-side.rev { grid-template-columns: 340px minmax(0, 1fr); }
@media (max-width: 1100px) { .grid-2, .grid-3, .grid-side, .grid-side.rev { grid-template-columns: 1fr; } .grid-2 > .span-2 { grid-column: auto; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpis.small { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
a.kpi { color: inherit; } a.kpi:hover { text-decoration: none; border-color: var(--brand-line); }
.kpi-v { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; order: 2; } .kpi-l { color: var(--text-2); font-size: 14px; font-weight: 550; order: 1; } .kpi-s { font-size: 13px; color: var(--muted); order: 3; }
.kpi.warn .kpi-v { color: var(--bad); } .kpi.brand .kpi-v { color: var(--brand); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search.wide { flex: 1 1 300px; width: auto; margin-bottom: 0; } .toolbar > select { width: auto; flex: 0 1 240px; min-width: 160px; max-width: 360px; } .toolbar > .check { white-space: nowrap; align-items: center; } .toolbar > .check input { margin-top: 0; }
.toolbar .spacer { flex: 1; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); } .empty .ic { width: 40px; height: 40px; color: var(--brand); opacity: .55; } .empty h4 { color: var(--text); margin: 10px 0 6px; font-size: 17px; } .empty p { max-width: 560px; margin: 0 auto 16px; font-size: 14.5px; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text); } .banner .ic { color: var(--warn); width: 22px; height: 22px; }
.banner.info { background: var(--brand-softer); border-color: var(--brand-line); } .banner.info .ic { color: var(--brand); }
.banner.small { padding: 9px 12px; font-size: 13.5px; margin-bottom: 12px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 0 12px; } .section-title h2 { margin: 0; font-size: 18px; } .section-title a { font-size: 14px; }

/* ------------------------------------------------------------ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; min-height: 40px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--radius-sm); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--surface-3); text-decoration: none; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
:root[data-theme="dark"] .btn.primary { color: #0d1020; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0d1020; } }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; } .btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); } .btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-strong); } .btn.soft:hover { background: color-mix(in srgb, var(--brand) 18%, var(--surface)); }
.btn.link { background: none; border: none; color: var(--link); padding: 0 4px; min-height: 0; font-weight: 600; }
.btn.sm { padding: 6px 12px; font-size: 13.5px; min-height: 34px; } .btn.xs { padding: 2px 9px; font-size: 12.5px; min-height: 26px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: none; background: transparent; color: var(--text-2); border-radius: 8px; cursor: pointer; } .icon-btn:hover { background: var(--surface-3); color: var(--text); }
input, select, textarea { font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; min-width: 0; min-height: 40px; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--focus); border-color: var(--brand); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-2); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; min-height: 0; accent-color: var(--brand); }
textarea { resize: vertical; line-height: 1.5; }
.search { position: relative; display: inline-flex; align-items: center; min-width: 240px; } .search .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; } .search input { padding-left: 40px; } .search.wide { width: 100%; max-width: 560px; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin-bottom: 14px; } .form-grid .field.wide { grid-column: span 2; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .form-grid .field.wide { grid-column: auto; } }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--text); } .field .help { font-size: 13px; color: var(--muted); margin-top: 5px; }
.req { color: var(--bad); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 14px; padding: 6px 0; }
.check { display: inline-flex; gap: 9px; align-items: flex-start; cursor: pointer; font-weight: 400; } .check input { margin-top: 3px; } .field .check { font-weight: 400; color: var(--text); font-size: 14.5px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; } .switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 22px; transition: .15s; cursor: pointer; } .switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--brand); } .switch input:checked + span::before { transform: translateX(18px); }
.radio-cards { display: grid; gap: 10px; margin-bottom: 14px; } .radio-card { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; } .radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-softer); } .radio-card p { margin: 2px 0 0; }
.key-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; } .key-row input { flex: 1; min-width: 220px; font-family: var(--mono); } .key-row select { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; } .chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); padding: 7px 12px; border-radius: 999px; font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; } .chip:hover { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-softer); }

/* badges, progress, misc */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; vertical-align: 1px; line-height: 1.5; }
.badge.green { background: var(--ok-soft); color: var(--ok); } .badge.red { background: var(--bad-soft); color: var(--bad); } .badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.yellow { background: var(--yellow-soft); color: var(--yellow); } .badge.blue { background: var(--info-soft); color: var(--info); } .badge.purple { background: var(--purple-soft); color: var(--purple); } .badge.teal { background: var(--teal-soft); color: var(--teal); } .badge.grey { background: var(--surface-3); color: var(--text-2); }
.badge.brand { background: var(--brand-soft); color: var(--brand-strong); }
.progress { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin: 5px 0; } .progress > div { height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s; }
.progress.ok > div { background: var(--ok); } .progress.azure > div { background: var(--azure); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.score { display: inline-block; min-width: 36px; text-align: center; font-weight: 700; border-radius: 6px; padding: 1px 6px; font-size: 13px; } .score.good { background: var(--ok-soft); color: var(--ok); } .score.mid { background: var(--yellow-soft); color: var(--yellow); } .score.bad { background: var(--bad-soft); color: var(--bad); }
.mini-logo { height: 22px; max-width: 64px; object-fit: contain; vertical-align: middle; }
ul.plain { list-style: none; padding: 0; margin: 0 0 8px; } ul.plain li { padding: 4px 0; }
.link-list { list-style: none; padding: 0; margin: 0 0 12px; } .link-list li { padding: 9px 0; border-bottom: 1px solid var(--border); } .link-list li:last-child { border-bottom: none; }
.pre { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; max-height: 60vh; overflow: auto; }
.dirty { color: var(--orange); font-weight: 600; margin-left: 8px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); vertical-align: 1px; margin-right: 6px; } .dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.brand { background: var(--brand); }

/* tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl.compact td, .tbl.compact th { padding: 7px 10px; } .tbl tr:last-child td { border-bottom: none; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--brand-softer); }
.tbl tr.excluded td { opacity: .55; } .tbl tr.head td { font-weight: 600; background: var(--surface-2); } .tbl tr.sub td:first-child { padding-left: 26px; }
.tbl.reg td:first-child, .tbl.reg th:first-child { width: 30px; }
.card .table-wrap:first-child .tbl th:first-child, .card.flush .tbl th:first-child, .card.flush .tbl td:first-child { padding-left: 18px; }
.cell-title { font-weight: 600; color: var(--text); } .cell-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.people .tbl td { padding: 4px 5px; } .people .tbl input { padding: 7px 9px; font-size: 14px; min-height: 36px; } .people .btn { margin-top: 8px; }
/* directory tables (Notified Bodies, laboratories): fixed columns, long names and addresses wrap inside their column */
.tbl.dir { table-layout: fixed; min-width: 760px; } .tbl.dir td { overflow-wrap: anywhere; } .tbl.dir td > b { font-weight: 600; display: block; margin-bottom: 2px; }
.tbl.dir tbody tr:hover td { background: var(--brand-softer); }
.cls { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; font-size: 12.5px; margin: 0 4px 4px 0; }
.scope { margin: 0; padding-left: 18px; } .scope li { margin: 0 0 4px; }
.scope-more summary { cursor: pointer; color: var(--link); font-size: 13px; font-weight: 600; margin: 2px 0 4px; }
.count { display: inline-block; background: var(--surface-3); color: var(--text-2); border-radius: 99px; padding: 0 8px; font-size: 12.5px; font-weight: 600; line-height: 1.6; }
.ivd-cat { margin-bottom: 22px; } .ivd-cat h4 { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 4px 0 10px; font-size: 15px; }

/* tabs and segmented controls (tabs wrap onto a second row instead of scrolling sideways) */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 14px; color: var(--text-2); font-weight: 600; font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: 8px 8px 0 0; } .tab:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--brand-strong); border-bottom-color: var(--brand); } .tab .count { margin-left: 6px; }
.tab.active .count { background: var(--brand-soft); color: var(--brand-strong); }
.segs { display: inline-flex; flex-wrap: wrap; margin-bottom: 16px; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg { border: none; background: transparent; color: var(--text-2); padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 8px; display: inline-flex; gap: 6px; align-items: center; min-height: 36px; }
.seg:hover { color: var(--text); text-decoration: none; } .seg.active { background: var(--surface); color: var(--brand-strong); box-shadow: 0 1px 2px rgba(18,23,41,.08); }
.segs .seg { text-decoration: none; } .segs .seg:hover { text-decoration: none; }
.segs.sub { margin-bottom: 12px; } .segs.sub .seg { font-size: 13.5px; padding: 6px 12px; }
.lab-line + .lab-line { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.mode-bar .seg, .side-tabs .seg { border: 1px solid var(--border); background: var(--surface); margin-right: 4px; }
.mode-bar .seg.active, .side-tabs .seg.active { background: var(--brand-soft); border-color: var(--brand-line); box-shadow: none; }

/* modal and toasts */
.modal-backdrop { position: fixed; inset: 0; background: rgba(13,16,32,.48); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-pop); width: min(540px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border: 1px solid var(--border); }
.modal.wide { width: min(860px, 100%); } .modal.xwide { width: min(1200px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); } .modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 18px 20px; overflow: auto; } .modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); align-items: center; } .foot-note { margin-right: auto; font-size: 13px; color: var(--muted); }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; max-width: min(460px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ok); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow-pop); animation: fade .15s; font-size: 14.5px; }
.toast.error { border-left-color: var(--bad); } .toast.warn { border-left-color: var(--warn); } .toast.out { opacity: 0; transition: opacity .3s; } .toast .ic { margin-top: 2px; }
.toast.ok .ic { color: var(--ok); } .toast.error .ic { color: var(--bad); } .toast.warn .ic { color: var(--warn); }

/* AI run panel */
.run-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.run-phase { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.run-log { max-height: 100px; overflow: auto; font-size: 13px; color: var(--text-2); margin-bottom: 10px; } .log-line.search { color: var(--info); } .log-line.warn { color: var(--warn); }
.run-batch { margin-bottom: 10px; }
.run-think { margin-bottom: 10px; font-size: 13px; color: var(--text-2); } .run-think div { max-height: 120px; overflow: auto; white-space: pre-wrap; }
.run-preview { height: 56vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; background: var(--surface-2); }

/* markdown documents */
.md { line-height: 1.6; overflow-wrap: anywhere; } .md h1 { font-size: 22px; margin-top: .2em; } .md h2 { font-size: 18px; margin-top: 1.3em; padding-bottom: 4px; border-bottom: 1px solid var(--border); } .md h3 { font-size: 15.5px; margin-top: 1.1em; } .md h4 { font-size: 14.5px; }
.md table { border-collapse: collapse; width: 100%; margin: 10px 0 14px; font-size: 13.5px; } .md th, .md td { border: 1px solid var(--border-strong); padding: 6px 9px; text-align: left; vertical-align: top; } .md th { background: var(--surface-3); }
.md ul, .md ol { padding-left: 24px; margin: 0 0 .8em; } .md li { margin: 3px 0; } .md blockquote { margin: 10px 0; padding: 6px 14px; border-left: 3px solid var(--brand-line); color: var(--text-2); background: var(--brand-softer); border-radius: 0 8px 8px 0; }
.md pre { background: var(--surface-3); padding: 12px; border-radius: 8px; overflow: auto; } .md hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.md li.task { list-style: none; margin-left: -20px; }
.missing { background: var(--yellow-soft); color: var(--yellow); border-radius: 4px; padding: 0 4px; font-weight: 600; border: 1px dashed color-mix(in srgb, var(--yellow) 50%, transparent); }
.missing.flash { outline: 3px solid var(--brand, #1070F0); outline-offset: 2px; animation: missingFlash 1.6s ease-out; }
@keyframes missingFlash { 0% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand, #1070F0) 35%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.md.doc { font-size: 14.5px; } .doc-meta { margin-bottom: 10px; } .small-doc { font-size: 13.5px; }

/* project workspace */
.stages { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1200px) { .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stage { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stage-n { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; color: var(--text-2); flex: none; font-size: 13px; }
.stage.done .stage-n { background: var(--ok); color: #fff; } .stage.done { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
ul.next { list-style: none; padding: 0; margin: 0; } ul.next li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); } ul.next li span { flex: 1; } ul.next li:last-child { border: none; } ul.next .ic { color: var(--brand); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; } .facts div { display: flex; flex-direction: column; } .facts span { font-size: 13px; color: var(--muted); }
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; } .upload-row select { width: auto; }
ul.miss { padding-left: 20px; margin: 0 0 12px; } ul.miss li { margin-bottom: 6px; }
.reco { margin-top: 14px; border: 1px dashed var(--brand-line); border-radius: var(--radius); padding: 12px 14px; background: var(--brand-softer); } .reco-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.reco-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 800px) { .reco-grid { grid-template-columns: 1fr; } }
.reco-grid li { margin-bottom: 6px; }
.qlist { list-style: none; padding: 0; margin: 0; } .qlist li { padding: 10px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; margin-bottom: 4px; } .qlist li:hover { background: var(--surface-2); } .qlist li.active { background: var(--brand-soft); border-color: var(--brand-line); }
.q-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.qsec { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 14px; } .qsec legend { font-weight: 700; padding: 0 6px; }
.qitem { padding: 10px 0; border-bottom: 1px dashed var(--border); } .qitem:last-child { border: none; } .qitem label { display: block; margin-bottom: 4px; } .qitem textarea, .qitem input, .qitem select { margin-top: 6px; }
.q-foot { display: flex; justify-content: flex-end; gap: 12px; align-items: center; }
.answers li { border-bottom: 1px solid var(--border); padding: 7px 0; }
.alert-list { list-style: none; padding: 0; margin: 0; } .alert-list li { padding: 9px 0; border-bottom: 1px solid var(--border); } .alert-list li:last-child { border: none; } .alert-list li.click { cursor: pointer; } .alert-list li.click:hover { background: var(--brand-softer); }
.activity { list-style: none; padding: 0; margin: 0; } .activity li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; } .activity li:last-child { border-bottom: none; }
details.learn, details.research, details.log-entry { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: var(--surface); } details.learn summary, details.research summary, details.log-entry summary { padding: 10px 14px; cursor: pointer; }
.learn-body, .research-body { padding: 4px 16px 14px; } .sources li { margin-bottom: 4px; }
.engine-card ul { margin: 10px 0 12px; }
.reg-group .card-head { padding: 11px 18px; }

/* document editor */
.doc-head h1 { font-size: 22px; } .docno { color: var(--brand); font-family: var(--mono); font-size: 16px; margin-right: 6px; }
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1150px) { .doc-layout { grid-template-columns: 1fr; } }
.mode-bar { display: flex; align-items: center; gap: 0; margin-bottom: 10px; } .mode-bar [data-count] { margin-left: auto; }
.editor { width: 100%; min-height: 70vh; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; padding: 14px 16px; tab-size: 2; background: var(--surface); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .split .editor, .split .preview { height: 74vh; min-height: 0; overflow: auto; }
.preview { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 20px; background: var(--surface); min-height: 70vh; }
.doc-side { position: sticky; top: 76px; max-height: calc(100vh - 92px); display: flex; flex-direction: column; }
.side-tabs { display: flex; flex-wrap: wrap; padding: 10px 10px 0; gap: 2px; } .side-tabs .seg { font-size: 13px; padding: 5px 10px; margin-bottom: 4px; min-height: 32px; }
.side-body { padding: 12px 16px 16px; overflow: auto; }
.score-big { font-size: 36px; font-weight: 800; } .score-big small { font-size: 15px; color: var(--muted); font-weight: 500; } .score-big.good { color: var(--ok); } .score-big.mid { color: var(--yellow); } .score-big.bad { color: var(--bad); }
.checks-list { list-style: none; padding: 0; margin: 0; } .checks-list li { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.checks-list li.pass .ic { color: var(--ok); } .checks-list li.warn .ic { color: var(--warn); } .checks-list li.fail .ic { color: var(--bad); }
.versions { list-style: none; padding: 0; margin: 0; } .versions li { display: flex; justify-content: space-between; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.qbox { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; } .qbox .ic { color: var(--muted); }
.menu-wrap { position: relative; } .menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); z-index: 50; min-width: 220px; padding: 6px; }
.menu button, .menu a { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border: none; background: none; color: var(--text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; border-radius: 8px; min-height: 42px; }
.menu button:hover, .menu a:hover { background: var(--brand-soft); text-decoration: none; } .menu .ic { color: var(--brand); }
.menu small { display: block; color: var(--muted); font-size: 12.5px; }
.diff { font-family: var(--mono); font-size: 13px; border: 1px solid var(--border); border-radius: 8px; overflow: auto; max-height: 74vh; background: var(--surface); }
.d-line { display: flex; white-space: pre-wrap; word-break: break-word; padding: 0 8px; } .d-sign { width: 16px; flex: none; color: var(--muted); user-select: none; }
.d-ins { background: var(--ok-soft); } .d-del { background: var(--bad-soft); } .d-ins ins { background: color-mix(in srgb, var(--ok) 30%, transparent); text-decoration: none; } .d-del del { background: color-mix(in srgb, var(--bad) 30%, transparent); }
.d-skip { color: var(--muted); padding: 3px 24px; font-style: italic; background: var(--surface-2); } .diff-head { margin-bottom: 8px; }

/* console */
.console { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; } @media (max-width: 900px) { .console { grid-template-columns: 1fr; } }
.chat-list select { margin-bottom: 10px; } .chats { list-style: none; padding: 0; margin: 10px 0 0; } .chats li { padding: 10px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; } .chats li:hover { background: var(--surface-2); } .chats li.active { background: var(--brand-soft); }
.chat { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 480px; margin: 0; }
.chat-head { display: flex; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.messages { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.msg.user { align-self: flex-end; max-width: 75%; text-align: right; } .msg.user .bubble { background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 16px 16px 4px 16px; text-align: left; }
.msg.ai { display: flex; gap: 12px; max-width: 100%; } .ai-badge { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.answer { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; padding: 12px 16px; min-width: 0; flex: 1; } .msg.err .answer { border-color: var(--bad); }
.msg-foot { margin-top: 8px; }
.composer { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); align-items: flex-end; } .composer textarea { flex: 1; } .composer.slim { padding: 0; border: none; }
.suggest { max-width: 780px; } .suggest .chip { display: block; margin: 8px 0; }

/* knowledge, updates */
.clauses .clause { padding: 8px 0; border-bottom: 1px solid var(--border); } .clauses .clause p { margin: 3px 0 0; color: var(--text-2); font-size: 14px; } .clauses .lvl0 { font-size: 16px; padding-top: 16px; } .clauses .lvl2 { padding-left: 20px; } .clauses .lvl3 { padding-left: 38px; }
.std { padding: 12px 0; border-bottom: 1px solid var(--border); } .std:last-child { border-bottom: none; }
.route-out { margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--brand-softer); border: 1px solid var(--brand-line); }
.feed { list-style: none; padding: 0; margin: 0; } .feed li { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); } .feed-date { color: var(--muted); font-size: 13.5px; }

/* regulatory intelligence */
.bars { list-style: none; padding: 0; margin: 0 0 12px; } .bars li { display: grid; grid-template-columns: minmax(120px, 40%) 1fr 38px; gap: 10px; align-items: center; padding: 4px 0; font-size: 13.5px; }
.bar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); } .bar-t { background: var(--surface-3); border-radius: 4px; height: 10px; overflow: hidden; } .bar { display: block; height: 100%; background: var(--brand); border-radius: 4px; } .bar-n { text-align: right; font-weight: 600; }
.actions-list { list-style: none; padding: 0; margin: 0; } .actions-list li { padding: 8px 0; border-bottom: 1px solid var(--border); } .actions-list li:last-child { border: none; } .actions-list li.done span { text-decoration: line-through; color: var(--muted); }
.tbl.gapm tr.sev-critical td:first-child { box-shadow: inset 3px 0 var(--bad); } .tbl.gapm tr.sev-major td:first-child { box-shadow: inset 3px 0 var(--orange); } .tbl.gapm tr.sev-minor td:first-child { box-shadow: inset 3px 0 var(--yellow); } .tbl.gapm tr.sev-compliant td { color: var(--text-2); }
.tbl.aqi td { min-width: 70px; } .tbl.aqi td:nth-child(5), .tbl.aqi td:nth-child(6), .tbl.aqi td:nth-child(7) { min-width: 200px; }
blockquote.quote { margin: 8px 0 12px; padding: 10px 14px; border-left: 3px solid var(--brand-line); background: var(--brand-softer); border-radius: 0 8px 8px 0; font-size: 14px; }
.kpi .kpi-v .badge { font-size: 16px; padding: 2px 10px; }

/* ------------------------------------------------------------ home */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.hello h1 { font-size: 30px; margin-bottom: 4px; } .hello p { margin: 0; color: var(--muted); font-size: 15.5px; }
.start-steps { list-style: none; padding: 0; margin: 0; counter-reset: st; display: grid; gap: 8px; }
.start-steps li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.start-steps li::before { counter-increment: st; content: counter(st); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--brand-soft); color: var(--brand-strong); font-size: 14px; }
.start-steps li.done::before { content: "✓"; background: var(--ok); color: #fff; } .start-steps li.done b { color: var(--muted); }
.start-steps li span { display: block; color: var(--muted); font-size: 13.5px; }
.attention { list-style: none; padding: 0; margin: 0; } .attention li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); } .attention li:last-child { border-bottom: none; }
.attention .ic { color: var(--brand); margin-top: 3px; } .attention .att-body { flex: 1; min-width: 0; } .attention small { display: block; color: var(--muted); font-size: 13px; }
.attention a.att { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------ cards for clients / projects */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; color: var(--text); transition: border-color .12s, background .12s; min-height: 100%; }
a.tile:hover, .tile.click:hover { border-color: var(--brand-line); background: var(--brand-softer); text-decoration: none; cursor: pointer; }
.tile-head { display: flex; gap: 12px; align-items: center; min-width: 0; } .tile-head > div { min-width: 0; }
.tile-head b { display: block; font-size: 16px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tile-head small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-logo { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.tile-logo img { max-width: 40px; max-height: 40px; object-fit: contain; }
.tile-logo.ph { background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; font-size: 16px; border-color: transparent; }
.tile-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.tile-stats div { display: flex; flex-direction: column; } .tile-stats b { font-size: 18px; } .tile-stats span { font-size: 12.5px; color: var(--muted); }
.tile-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tile.add { align-items: center; justify-content: center; text-align: center; border-style: dashed; color: var(--brand-strong); font-weight: 600; min-height: 180px; }
.tile.add .ic { width: 28px; height: 28px; }
.view-toggle { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.view-toggle button { border: none; background: transparent; color: var(--text-2); width: 36px; height: 34px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.view-toggle button.active { background: var(--surface); color: var(--brand-strong); box-shadow: 0 1px 2px rgba(18,23,41,.08); }

/* ------------------------------------------------------------ client workspace */
.ws-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.ws-head .tile-logo { width: 64px; height: 64px; border-radius: 16px; } .ws-head .tile-logo img { max-width: 56px; max-height: 56px; } .ws-head .tile-logo.ph { font-size: 22px; }
.ws-title { flex: 1; min-width: 240px; } .ws-title h1 { margin: 0 0 6px; } .ws-title .tile-meta { gap: 8px; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.facts-grid > div { padding: 12px 16px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); margin: 0 -1px -1px 0; }
.facts-grid span { display: block; font-size: 13px; color: var(--muted); } .facts-grid b { font-weight: 600; overflow-wrap: anywhere; }
.std-matrix th.dev { writing-mode: horizontal-tb; white-space: normal; min-width: 120px; } .std-matrix td.tick { text-align: center; color: var(--brand); font-weight: 700; }
.logo-box { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; } .logo-box img { max-width: 160px; max-height: 90px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: #fff; }
.logo-ph { width: 120px; height: 80px; border: 1px dashed var(--border-strong); border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; } .logo-actions { display: grid; gap: 6px; }

/* shared server (Settings → Data): offer on the first-run screen */
.join-box { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--brand-line); border-radius: var(--radius); background: var(--brand-softer); }
.join-box > b { display: flex; align-items: center; gap: 8px; } .join-box p { margin: 6px 0 12px; }

/* client documentation pack */
.lead-text { margin: 0 0 14px; color: var(--text-2); max-width: 78ch; }
.pack-progress { display: flex; align-items: center; gap: 12px; margin: -4px 0 12px; } .pack-progress .progress { flex: 1; max-width: 420px; }
.driver-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.miss-box { margin-top: 12px; border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-soft); border-radius: var(--radius); padding: 10px 14px; }
.miss-box summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; } .miss-box ul { margin: 10px 0; } .miss-box li { margin: 4px 0; }
.tbl.pack .why { font-size: 12.5px; color: var(--text-2); margin-top: 2px; max-width: 70ch; } .tbl.pack td { vertical-align: top; }
.pv-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pv-doc { max-height: 66vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; background: var(--surface); }
.segs button.seg { font: inherit; font-size: 14px; font-weight: 600; }
/* workflows (client overview) */
.flow + .flow { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.flow-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.flow-steps a { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.flow-steps a:hover { background: var(--brand-softer); border-color: var(--brand-line); }
.flow-ic { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); } .flow-ic .ic { width: 15px; height: 15px; }
.flow-steps li.done .flow-ic { background: var(--ok-soft); color: var(--ok); } .flow-steps li.doing .flow-ic { background: var(--info-soft); color: var(--info); } .flow-steps li.todo .flow-ic { background: var(--brand-soft); color: var(--brand-strong); }
.flow-steps li.na a { opacity: .55; } .flow-d { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }

/* CDSCO dossier navigator */
.dossier { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.dossier-nav { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; padding: 12px; }
.dossier-nav .search { margin-bottom: 10px; } .part-nav { list-style: none; margin: 0; padding: 0; }
.part-nav a { display: grid; grid-template-columns: 10px 22px 1fr; gap: 6px; align-items: start; padding: 7px 8px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; line-height: 1.35; text-decoration: none; }
.part-nav a:hover { background: var(--brand-softer); color: var(--text); } .part-nav .dot { margin-top: 5px; } .part-nav .pn { font-weight: 700; color: var(--muted); }
.dot.warn { background: var(--warn); } .dot.info { background: var(--info); }
.dossier-part .card-head h3 { display: flex; gap: 10px; align-items: baseline; } .part-no { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-strong); font-size: 14px; font-weight: 700; }
.dossier-part { scroll-margin-top: 80px; } .dossier-part .explain { font-size: 15px; max-width: 80ch; }
.dp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; margin: 10px 0 12px; } .dp-grid h4 { margin: 0 0 6px; font-size: 13px; text-transform: none; color: var(--text-2); }
.dp-grid ul.incl { margin: 0; padding-left: 18px; } .dp-grid ul.incl li { margin: 3px 0; font-size: 14px; }
.tbl.ev td { padding: 6px 8px; vertical-align: top; } .std-links { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; font-size: 12.5px; }
.dp-content, .dp-q { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; } .dp-content summary, .dp-q summary { cursor: pointer; font-weight: 600; display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.dp-content .md { margin-top: 8px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); max-height: 520px; overflow: auto; }
.dp-feed { margin-top: 10px; } .feed-list { margin: 6px 0 0; padding-left: 18px; } .feed-list li { margin: 3px 0; font-size: 13.5px; }
.src-links { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; font-size: 13.5px; }
@media (max-width: 980px) { .dossier { grid-template-columns: 1fr; } .dossier-nav { position: static; max-height: none; } .dp-grid { grid-template-columns: 1fr; } }

/* cross-references inside documents */
.md a.xref { color: var(--brand-strong); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--brand-line); } .md a.xref:hover { background: var(--brand-softer); }
.md .xref.planned { color: var(--text-2); border-bottom: 1px dashed var(--border-strong, var(--border)); cursor: help; } .md .xref.self { font-weight: 600; }
.md a.xref.std { color: inherit; font-weight: inherit; border-bottom: 1px dotted var(--muted); } .md a.xref.std:hover { color: var(--brand-strong); background: none; }

/* v1.4: document design - page view (stays white like paper in dark mode) */
.page-pane { background: var(--surface-3); padding: 18px; }
.split .page-pane { padding: 12px; }
.paper { background: #fff; color: #000; max-width: 210mm; margin: 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 8px 24px rgba(0,0,0,.08); border-radius: 2px; position: relative; overflow-wrap: anywhere; }
.paper.letter { max-width: 216mm; }
.paper.draft::after { content: 'DRAFT'; position: absolute; top: 260px; left: 0; right: 0; text-align: center; font: bold 84px Arial, sans-serif; color: rgba(200,0,0,.06); transform: rotate(-24deg); pointer-events: none; }
.paper .ds-head { margin-bottom: 7mm; } .paper .ds-foot { margin-top: 9mm; }
.paper a.xref { color: #1f3f9e; text-decoration: none; border-bottom: 1px solid #b9c4ea; font-weight: 600; } .paper .xref.planned { color: #555; border-bottom: 1px dashed #999; cursor: help; } .paper a.xref.std { color: inherit; font-weight: inherit; border-bottom: 1px dotted #888; }
.paper .ds-cover { border-bottom: 1px dashed #ccc; margin-bottom: 8mm; }
/* design editor */
.ds-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
.ds-form .form-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.ds-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ds-preset { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 3px; }
.ds-preset span { font-size: 12.5px; color: var(--muted); } .ds-preset.active { border-color: var(--brand); background: var(--brand-softer); box-shadow: inset 0 0 0 1px var(--brand); } .ds-preset:hover { border-color: var(--brand-line); }
.ds-sec { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 12px 10px; margin-bottom: 10px; background: var(--surface); }
.ds-sec > summary { cursor: pointer; font-weight: 650; padding: 8px 0; display: flex; gap: 8px; align-items: center; } .ds-sec > summary .ic { color: var(--brand); }
.ds-rows { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.ds-color { display: inline-flex; gap: 8px; align-items: center; } .ds-color input[type=color] { width: 42px; height: 32px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; } .ds-color code { font-size: 12.5px; }
.ds-preview { position: sticky; top: 76px; } .ds-preview-head { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ds-preview-scroll { max-height: 78vh; overflow: auto; background: var(--surface-3); border-radius: var(--radius-sm); padding: 14px; }
@media (max-width: 1100px) { .ds-editor { grid-template-columns: 1fr; } .ds-preview { position: static; } }
/* signatures */
.seg-group { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 6px 0 12px; } .seg-group .seg { border: none; border-radius: 0; }
.sig-preview { min-height: 90px; border: 1px dashed var(--border-strong, var(--border)); border-radius: var(--radius-sm); display: grid; place-items: center; background: #fff; padding: 8px; margin-top: 8px; } .sig-preview img { max-height: 110px; max-width: 100%; }
.sig-pad { width: 100%; height: 190px; border: 1px dashed var(--border-strong, var(--border)); border-radius: var(--radius-sm); background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sig-list { list-style: none; margin: 0; padding: 0; } .sig-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sig-thumbs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; } .sig-thumb { position: relative; display: inline-flex; flex-direction: column; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; }
.sig-thumb img { height: 30px; max-width: 110px; object-fit: contain; } .sig-thumb small { font-size: 10.5px; color: #555; } .sig-thumb .icon-btn { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 50%; }
.sig-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 10px; } .sig-choice { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; display: flex; flex-direction: column; gap: 4px; align-items: center; cursor: pointer; background: #fff; color: #222; }
.sig-choice img { max-height: 56px; max-width: 100%; } .sig-choice:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.signoff { list-style: none; margin: 0 0 10px; padding: 0; } .signoff li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); align-items: start; }
.signoff-role { font-size: 12.5px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .02em; padding-top: 2px; } .signoff-img { max-height: 36px; max-width: 160px; background: #fff; border-radius: 4px; margin-top: 4px; display: block; }
/* review suggestions */
.side-h { margin: 14px 0 4px; font-size: 14px; }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--text); align-items: center; } .banner.ok .ic { color: var(--ok); }
.sug-list { list-style: none; margin: 6px 0 0; padding: 0; } .sug { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 10px; margin-bottom: 8px; background: var(--surface); }
.sug-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; font-size: 13.5px; } .sug-change { margin-top: 4px; color: var(--text); background: var(--brand-softer); border-radius: 6px; padding: 5px 7px; } .sug-change .ic { color: var(--brand); width: 14px; height: 14px; }
.sug.accepted { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); } .sug.applied { opacity: .7; } .sug.rejected { opacity: .55; } .sug .toolbar { margin: 6px 0 0; gap: 6px; }
/* evidence register, queries, AI memory */
.ev-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: start; }
.ev-row .ev-title { font-weight: 600; } .ev-files { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; margin-top: 3px; }
.ev-summary { font-size: 13px; color: var(--text-2); margin-top: 4px; white-space: pre-line; }
.q-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; background: var(--surface); } .q-card blockquote { margin: 6px 0; }
.mem { border-bottom: 1px solid var(--border); padding: 10px 0; } .mem-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 760px) { .ev-row { grid-template-columns: 1fr; } .signoff li { grid-template-columns: 1fr; } }

/* print (browser print of the app pages) */
@media print {
  .sidebar, .topbar, .head-actions, .tabs, .toolbar, .doc-side, .mode-bar, #toasts { display: none !important; }
  .app { display: block; } .view { padding: 0; max-width: none; } .card { border: none; }
  body { background: #fff; color: #000; }
  @page { size: A4; margin: 16mm 14mm; @bottom-right { content: "Page " counter(page) " of " counter(pages); font-size: 8pt; } }
}

/* v1.5: house templates, batch review, routes, file import, knowledge freshness */
.sug-doc { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px 4px; margin-bottom: 12px; background: var(--surface); }
.sug-doc h4 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; } .sug-doc h4 .sug-tools { margin-left: auto; display: inline-flex; gap: 4px; }
.sug-table td { vertical-align: top; } .sug-text { margin-top: 3px; padding: 6px 8px; background: var(--brand-softer); border-radius: 6px; font-size: 13px; } tr.sug-accepted .sug-text { background: var(--ok-soft, #e6f6ea); }
.route-dev { border-top: 1px solid var(--border); padding: 10px 0 4px; } .route-dev:first-of-type { border-top: 0; } .route-dev h4 { margin: 0 0 6px; }
.route-main ol { margin: 6px 0 4px 18px; } .route-alts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 4px; } .route-alt { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.fresh { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; font-size: 13px; color: var(--muted); margin: -4px 0 14px; } .fresh .ic { color: var(--brand); vertical-align: -3px; margin-right: 3px; }
.upload-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }

/* v1.6: console attachments and sources, standards verification, WorkHub link */
.composer-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; } .composer-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.att-chips { display: flex; flex-wrap: wrap; gap: 6px; } .att-chips:empty { display: none; }
.chip.att { display: inline-flex; align-items: center; gap: 6px; cursor: default; } .chip.att .icon-btn { width: 20px; height: 20px; padding: 0; margin-left: 2px; }
.att-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .att-list .att { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; background: rgba(255,255,255,.18); border-radius: 6px; padding: 2px 8px; } .att-list .att.skipped { opacity: .6; text-decoration: line-through; }
.sources-box { margin-top: 8px; } .sources-box summary { cursor: pointer; color: var(--muted); } .sources-box ol { margin: 6px 0 0 18px; }
.std-dev { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 12px; margin-bottom: 8px; background: var(--surface); } .std-dev > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0; } .std-dev > summary .sug-tools { margin-left: auto; }
.std-table select.sm { padding: 2px 6px; font-size: 12.5px; } .std-table tr.excluded td { opacity: .6; }
.wh-plan .tbl td { vertical-align: top; } .wh-plan .edited { color: var(--warn, #b45309); }

/* v1.7: quality panel */
.q-list { list-style: none; margin: 0 0 10px; padding: 0; } .q-item { padding: 7px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; } .q-change del { color: var(--danger, #b42318); text-decoration: line-through; opacity: .8; }

/* v1.9: label artwork builder and editor */
.lbl-q { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 14px 10px; margin-bottom: 16px; background: var(--surface); } .lbl-q > summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 8px 0; }
.lbl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-bottom: 18px; } .lbl-grid .card { margin-bottom: 0; }
.lbl-preview { background: #f1f3f6; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; display: flex; justify-content: center; overflow: auto; margin-bottom: 8px; } .lbl-preview svg { max-width: 100%; height: auto; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.lbl-status { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.lbl-check .lbl-ok .ic { color: var(--ok); } .lbl-check .lbl-miss { color: var(--warn, #b45309); font-size: 12.5px; } .lbl-check .lbl-miss .ic { vertical-align: -3px; }
.lbl-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.lbl-canvas { background: #e9ecf1; padding: 18px; border-radius: var(--radius-sm); overflow: auto; outline: none; display: flex; justify-content: center; align-items: flex-start; min-height: 320px; } .lbl-canvas:focus { box-shadow: 0 0 0 2px var(--brand-line); } .lbl-canvas svg { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); user-select: none; touch-action: none; max-width: none; }
.lbl-side .field { margin-bottom: 8px; } .lbl-side .form-grid.lbl-two { grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-bottom: 6px; } .lbl-side .toolbar { margin-bottom: 8px; }
.lbl-els { max-height: 170px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--surface); } .lbl-els div { padding: 4px 8px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; } .lbl-els div:last-child { border-bottom: 0; } .lbl-els div.sel { background: var(--brand-softer); font-weight: 600; } .lbl-els div.hid { opacity: .55; } .lbl-els .ic { width: 14px; height: 14px; flex: none; }
@media (max-width: 900px) { .lbl-editor { grid-template-columns: 1fr; } }

/* v1.10: About page, approvals, master list */
.about-hero { display: flex; gap: 20px; align-items: center; margin: 4px 0 18px; } .about-hero img { max-height: 76px; max-width: 220px; object-fit: contain; } .about-hero h1 { margin: 0 0 4px; } .about-hero .lead-text { margin: 0; }
.about-text { font-size: 15px; line-height: 1.6; } .about-text p { margin: 0 0 10px; }
.tbl.approvals td { vertical-align: top; }

/* v1.11: polish - brand signature, density, motion, skeletons, command palette, sidebar rail, focus mode, editor tools, home */
:root { --brand-grad: linear-gradient(135deg, #4040c0 0%, #1070f0 100%); --ease: cubic-bezier(.2, .7, .2, 1); }
.page-enter { animation: page-in .22s var(--ease) both; } @keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.btn, .seg, .tab, .tile, .gs-item, .menu button, .menu a, .nav a, .kpi, .icon-btn { transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .08s var(--ease), box-shadow .15s var(--ease); }
.btn:active:not(:disabled), .icon-btn:active { transform: translateY(1px); } .tile:hover { border-color: var(--brand-line); } a.kpi:hover { border-color: var(--brand-line); text-decoration: none; }
.skeleton { display: grid; gap: 16px; padding: 4px 0; } .sk { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 10px; }
.sk.h1 { height: 30px; width: 38%; } .sk.line { height: 16px; width: 60%; } .sk.row { height: 96px; } .sk.card { height: 200px; } .sk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; } .sk-cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } } @media (max-width: 900px) { .sk-grid { grid-template-columns: 1fr 1fr; } .sk-cols { grid-template-columns: 1fr; } }
/* density: compact keeps more on the screen (per browser) */
:root[data-density="compact"] body { font-size: 14px; } :root[data-density="compact"] .view { padding: 18px 22px 60px; } :root[data-density="compact"] .card { margin-bottom: 14px; } :root[data-density="compact"] .card-body { padding: 12px 14px; } :root[data-density="compact"] .card-head { padding: 10px 14px; }
:root[data-density="compact"] .kpi { padding: 12px 14px; } :root[data-density="compact"] .kpi-v { font-size: 24px; } :root[data-density="compact"] .kpis { gap: 10px; margin-bottom: 16px; } :root[data-density="compact"] .tbl td { padding: 8px 12px; } :root[data-density="compact"] .tbl th { padding: 8px 12px; }
:root[data-density="compact"] .nav a { min-height: 36px; padding: 7px 12px; font-size: 14px; } :root[data-density="compact"] .page-head { margin-bottom: 14px; } :root[data-density="compact"] .tile { padding: 14px; gap: 8px; } :root[data-density="compact"] .topbar { min-height: 54px; padding: 6px 22px; } :root[data-density="compact"] .tabs { margin-bottom: 14px; } :root[data-density="compact"] .tab { padding: 8px 12px; }
/* sidebar rail */
:root[data-sidebar="collapsed"] .app { grid-template-columns: 76px 1fr; } :root[data-sidebar="collapsed"] .sidebar { padding: 16px 10px 14px; }
:root[data-sidebar="collapsed"] .sidebar .brand > div, :root[data-sidebar="collapsed"] .nav a span, :root[data-sidebar="collapsed"] .nav-group, :root[data-sidebar="collapsed"] .engine-pill span, :root[data-sidebar="collapsed"] .side-foot .xsmall { display: none; }
:root[data-sidebar="collapsed"] .sidebar .brand { flex-direction: column; gap: 10px; padding: 2px 0 16px; } :root[data-sidebar="collapsed"] .nav a { justify-content: center; padding: 10px; } :root[data-sidebar="collapsed"] .nav a.active::before { left: -10px; } :root[data-sidebar="collapsed"] .engine-pill { justify-content: center; padding: 8px; }
.side-collapse { margin-left: auto; width: 30px; height: 30px; color: var(--muted); } .side-collapse:hover { color: var(--text); } :root[data-sidebar="collapsed"] .side-collapse { margin: 0; } :root[data-sidebar="collapsed"] .side-collapse .ic { transform: rotate(180deg); }
@media (max-width: 900px) { :root[data-sidebar="collapsed"] .app { grid-template-columns: 1fr; } :root[data-sidebar="collapsed"] .sidebar .brand > div, :root[data-sidebar="collapsed"] .nav a span, :root[data-sidebar="collapsed"] .nav-group, :root[data-sidebar="collapsed"] .engine-pill span { display: block; } :root[data-sidebar="collapsed"] .nav a { justify-content: flex-start; } :root[data-sidebar="collapsed"] .sidebar .brand { flex-direction: row; } .side-collapse { display: none; } }
/* command palette */
.gs-item kbd { margin-left: auto; flex: none; } .gs-item > span { min-width: 0; flex: 1; } .gs-item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-hint { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 10px 4px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; } .keys div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; } .keys kbd + kbd { margin-left: 3px; } .keys h4 { grid-column: 1 / -1; margin: 12px 0 2px; } @media (max-width: 640px) { .keys { grid-template-columns: 1fr; } }
/* home */
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 22px; } .quick .btn { background: var(--surface); }
.kpi.ringed { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 12px; } .kpi.ringed .kpi-l, .kpi.ringed .kpi-v, .kpi.ringed .kpi-s { grid-column: 2; } .kpi.ringed .ring { grid-column: 1; grid-row: 1 / 4; }
.ring { width: 52px; height: 52px; } .ring circle { fill: none; stroke-width: 3.6; } .ring .bg { stroke: var(--surface-3); } .ring .fg { stroke: var(--brand); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dasharray .7s var(--ease); } .ring text { font-size: 9.5px; font-weight: 700; fill: var(--text); }
.spark { width: 132px; height: 30px; display: block; } .spark path { fill: none; stroke: var(--brand); stroke-width: 1.6; stroke-linejoin: round; } .spark .area { fill: color-mix(in srgb, var(--brand) 14%, transparent); stroke: none; }
.card-head .spark-wrap { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.timeline { position: relative; height: 66px; margin: 10px 4px 2px; } .timeline .axis { position: absolute; left: 0; right: 0; top: 40px; height: 2px; background: var(--border-strong); border-radius: 2px; } .timeline .today { position: absolute; top: 34px; width: 2px; height: 14px; background: var(--azure); transform: translateX(-50%); }
.timeline .tick { position: absolute; top: 48px; font-size: 11px; color: var(--muted); transform: translateX(-50%); white-space: nowrap; } .timeline .tick.l { transform: none; } .timeline .tick.r { transform: translateX(-100%); }
.timeline .dot { position: absolute; top: 34px; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); transform: translateX(-50%); box-shadow: 0 0 0 1px var(--brand-line); } .timeline .dot.late { background: var(--bad); box-shadow: 0 0 0 1px color-mix(in srgb, var(--bad) 40%, transparent); }
.timeline .dot .lbl { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; color: var(--text-2); background: var(--surface); padding: 1px 7px; border: 1px solid var(--border); border-radius: 6px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; } .timeline .dot:hover .lbl { color: var(--text); border-color: var(--brand-line); z-index: 2; }
.timeline .dot:nth-child(odd) .lbl { bottom: auto; top: 20px; }
.pulse { list-style: none; margin: 0; padding: 0; } .pulse li { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; align-items: start; } .pulse li:last-child { border-bottom: 0; } .pulse .date { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; padding-top: 1px; } .pulse small { display: block; color: var(--muted); font-size: 12.5px; }
.ai-badge { background: var(--brand-grad); color: #fff; }
/* document editor */
.ed-wrap { display: flex; flex-direction: column; min-height: 0; } .split .ed-wrap { height: 74vh; } .split .ed-wrap .editor { height: auto; flex: 1; min-height: 0; }
.ed-tools { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; padding: 6px 8px; border: 1px solid var(--border-strong); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface-2); } .ed-tools + .editor { border-top-left-radius: 0; border-top-right-radius: 0; }
.ed-tools .btn.xs { min-height: 28px; min-width: 30px; padding: 2px 8px; border-color: transparent; background: transparent; color: var(--text-2); } .ed-tools .btn.xs:hover { background: var(--surface-3); color: var(--text); } .ed-tools .b { font-weight: 800; } .ed-tools .i { font-style: italic; font-family: Georgia, serif; } .ed-tools .sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; } .ed-tools .spacer { flex: 1; }
.ol-list { display: flex; flex-direction: column; gap: 1px; } .ol-item { text-align: left; border: 0; background: none; font: inherit; font-size: 13.5px; padding: 5px 8px; border-radius: 6px; color: var(--text); cursor: pointer; display: flex; gap: 8px; align-items: baseline; } .ol-item:hover { background: var(--brand-soft); } .ol-item .n { color: var(--muted); font-size: 11.5px; flex: none; min-width: 18px; }
.ol-item.l3 { padding-left: 22px; color: var(--text-2); } .ol-item.l4 { padding-left: 36px; color: var(--muted); font-size: 13px; } .ol-item.l1 { font-weight: 700; }
.mode-bar { gap: 8px; } .savestate { font-size: 12.5px; color: var(--muted); white-space: nowrap; } .savestate.dirty { color: var(--warn); font-weight: 600; } .mode-bar .segs { margin-bottom: 0; } .mode-bar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
body[data-focus] .sidebar, body[data-focus] .topbar, body[data-focus] .doc-side, body[data-focus] .doc-head p .badge:nth-child(n+3) { display: none; } body[data-focus] .app { grid-template-columns: 1fr; } body[data-focus] .doc-layout { grid-template-columns: 1fr; } body[data-focus] .view { max-width: 1680px; padding-top: 18px; }
body[data-focus] .editor, body[data-focus] .split .ed-wrap, body[data-focus] .split .preview, body[data-focus] .preview { height: calc(100vh - 210px); min-height: 0; } body[data-focus] .page-head { margin-bottom: 12px; }
.draft-banner { display: flex; gap: 12px; align-items: center; } .draft-banner .toolbar { margin: 0 0 0 auto; }
.mode-bar .right [data-count] { margin-left: 0; } .mode-bar .right .btn.sm { min-height: 30px; }
@media (max-width: 1150px) { .split { grid-template-columns: 1fr; } .split .ed-wrap, .split .preview { height: auto; } .split .ed-wrap .editor { min-height: 46vh; } .split .preview { max-height: 60vh; } }
.split .preview { zoom: .82; } body[data-focus] .split .preview { zoom: 1; } .mode-bar .design-link { display: inline-flex; align-items: center; gap: 4px; }
.pulse li { grid-template-columns: 52px 1fr; }

/* v1.12: security policy (watermark, hidden while inactive) and the team monitor */
#secMark { position: fixed; inset: -10%; z-index: 9000; pointer-events: none; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; gap: 60px 90px; transform: rotate(-22deg); opacity: .085; font-size: 13px; font-weight: 600; color: var(--text); user-select: none; overflow: hidden; }
#secMark span { white-space: nowrap; }
body[data-sec] .page-pane { position: relative; }
body[data-sec-blur] .app, body[data-sec-blur] .gate { filter: blur(16px); pointer-events: none; user-select: none; }
body[data-sec-blur]::after { content: "Content hidden while this window is not active - click here to continue"; position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 72%, transparent); color: var(--text); font-weight: 600; font-size: 16px; }
body[data-sec] .btn.sec-off, body[data-sec] .sec-off { display: none !important; }
.mon-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; } .mon-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); } .mon-status.online .dot { background: var(--ok); } .mon-status.away .dot { background: var(--warn); }
.mon-bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; min-width: 90px; } .mon-bar > div { height: 100%; background: var(--brand); border-radius: 99px; }
.mon-areas { display: flex; flex-wrap: wrap; gap: 4px; } .mon-areas .badge { font-weight: 500; }
