/* Tiller: one stylesheet, light and dark, phone first. */
:root {
  --bg: #f4f6f7;
  --surface: #ffffff;
  --surface-2: #eef2f3;
  --ink: #15232a;
  --ink-2: #4b5d66;
  --line: #d9e1e4;
  --brand: #0f5c63;
  --brand-ink: #ffffff;
  --brand-soft: #e2f0f1;
  --accent: #f2a33a;
  --ok: #1d7a46;
  --ok-soft: #e3f4ea;
  --warn: #9a5b00;
  --warn-soft: #fff1d6;
  --bad: #b3261e;
  --bad-soft: #fde7e5;
  --muted: #6b7c85;
  --muted-soft: #edf0f2;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(16 32 40 / 6%), 0 4px 16px rgb(16 32 40 / 5%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e171b;
    --surface: #152227;
    --surface-2: #1b2b31;
    --ink: #e6eef0;
    --ink-2: #a8b8be;
    --line: #26393f;
    --brand: #5fb8bf;
    --brand-ink: #062226;
    --brand-soft: #173a3e;
    --ok: #6ccf95;
    --ok-soft: #173426;
    --warn: #f2b45c;
    --warn-soft: #3a2c12;
    --bad: #ff8a80;
    --bad-soft: #3d1c1a;
    --muted: #8fa1a8;
    --muted-soft: #1f2e33;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; }
p { margin: 0 0 .75rem; }

/* ---- top bar ---------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); position: relative; flex: none; }
.mark::before, .mark::after { content: ""; position: absolute; background: var(--accent); border-radius: 2px; }
.mark::before { left: 7px; right: 7px; top: 8px; height: 4px; }
.mark::after { left: 13px; width: 4px; top: 8px; bottom: 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.1rem; letter-spacing: .01em; }
.brand-sub { font-size: .75rem; color: var(--ink-2); }
.nav-wide { display: none; gap: .25rem; flex: 1; }
.nav-wide a { padding: .45rem .7rem; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.nav-wide a:hover { background: var(--surface-2); text-decoration: none; }
.nav-wide a.active { background: var(--brand-soft); color: var(--brand); }
.who { display: none; align-items: center; gap: .75rem; margin-left: auto; color: var(--ink-2); }
.who form { margin: 0; }

.nav-phone { margin-left: auto; }
.nav-phone summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem;
  padding: .55rem .9rem; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; min-height: 44px;
}
.nav-phone summary::-webkit-details-marker { display: none; }
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -6px; }
.burger::after { top: 6px; }
.nav-phone nav {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  display: grid; padding: .5rem 1rem 1rem;
}
.nav-phone nav a, .menu-signout {
  display: block; padding: .9rem .75rem; font-size: 1.1rem; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--line); text-align: left;
}
.nav-phone nav a.active { color: var(--brand); }
.menu-signout { width: 100%; background: none; border: 0; font: inherit; font-size: 1.05rem; color: var(--ink-2); cursor: pointer; }

@media (min-width: 1200px) {
  .nav-wide, .who { display: flex; }
  .nav-phone { display: none; }
}

/* ---- layout ----------------------------------------------------------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 1.25rem 16px 3rem; }
.foot { max-width: 1240px; margin: 0 auto; padding: 1rem 16px 2rem; display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .8rem; flex-wrap: wrap; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.crumbs { font-size: .85rem; color: var(--ink-2); margin-bottom: .2rem; }
.stack { display: grid; gap: 1rem; align-content: start; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
.ticket-layout { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2.wide-left { grid-template-columns: 2fr 1fr; }
  .ticket-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .span-all { grid-column: 1 / -1; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 560px; margin: 2rem auto; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.inset { padding: .9rem 1.1rem; }
.empty { color: var(--muted); padding: 1rem 1.1rem; margin: 0; }
.card:not(.flush) > .empty { padding: .25rem 0; }
.muted, .sub { color: var(--muted); }
.sub { font-size: .82rem; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.prose.lead { margin-bottom: 1rem; }
.article { font-size: 1rem; line-height: 1.65; }
.sr { position: relative; }
.sr > :not(textarea):not(select):not(input) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- tiles ------------------------------------------------------------ */
.tiles { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1rem; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tiles:not(.small) { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile { display: grid; gap: .2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; color: var(--ink); box-shadow: var(--shadow); }
a.tile:hover { border-color: var(--brand); text-decoration: none; }
.tile-label { font-size: .8rem; color: var(--ink-2); }
.tile-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-foot { font-size: .85rem; color: var(--ink-2); }
.tile-bad { border-color: var(--bad); background: var(--bad-soft); }
.tile-bad .tile-value { color: var(--bad); }
.tile-warn { border-color: var(--warn); background: var(--warn-soft); }

/* ---- lists ------------------------------------------------------------ */
.ticket-list { list-style: none; margin: 0; padding: 0; }
.ticket-list li + li { border-top: 1px solid var(--line); }
.ticket-list a { display: grid; grid-template-columns: auto 1fr auto; gap: .15rem .75rem; padding: .7rem .2rem; color: var(--ink); }
.card.flush .ticket-list a { padding: .8rem 1.1rem; }
.ticket-list a:hover { background: var(--surface-2); text-decoration: none; }
.ticket-list .ref { grid-row: 1; }
.ticket-list .summary { grid-row: 1; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.ticket-list .meta { grid-column: 1 / 3; font-size: .82rem; color: var(--ink-2); }
.ticket-list .badge, .ticket-list .status { grid-column: 3; grid-row: 1 / 3; align-self: center; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.plain.small { font-size: .88rem; }
.plain.cols { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.bars a { display: grid; grid-template-columns: 9rem 1fr 2.5rem; gap: .75rem; align-items: center; color: var(--ink); }
.bars strong { text-align: right; font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 10px; appearance: none; border: 0; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 6px; }
progress::-webkit-progress-value { background: var(--brand); border-radius: 6px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 6px; }

/* ---- badges ----------------------------------------------------------- */
.ref { font-family: var(--mono); font-size: .85em; font-weight: 600; color: var(--brand); white-space: nowrap; }
h1 .ref { font-size: .8em; }
.badge, .status, .pri, .chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; white-space: nowrap; line-height: 1.5; text-transform: none;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.muted, .chip { background: var(--muted-soft); color: var(--ink-2); }
.status { background: var(--muted-soft); color: var(--ink-2); text-transform: capitalize; }
.status.nocap { text-transform: none; }
.s-new { background: var(--brand-soft); color: var(--brand); }
.s-open { background: var(--warn-soft); color: var(--warn); }
.s-pending { background: var(--muted-soft); color: var(--ink-2); }
.s-resolved, .s-closed, .inv-paid, .kb-published, .a-in_use { background: var(--ok-soft); color: var(--ok); }
.inv-sent, .a-repair { background: var(--warn-soft); color: var(--warn); }
.inv-void, .a-retired { background: var(--bad-soft); color: var(--bad); }
.pri { background: var(--muted-soft); color: var(--ink-2); }
.pri.p1 { background: var(--bad); color: #fff; }
.pri.p2 { background: var(--bad-soft); color: var(--bad); }
.pri.p3 { background: var(--warn-soft); color: var(--warn); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }

/* ---- tables ----------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 600; padding: .6rem .8rem; background: var(--surface-2); }
.table td { padding: .65rem .8rem; border-top: 1px solid var(--line); vertical-align: top; }
.table tr.muted td { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 760px) {
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { border-top: 1px solid var(--line); padding: .5rem .2rem; }
  .table.responsive td { border: 0; padding: .25rem .9rem; display: grid; grid-template-columns: 7.5rem 1fr; gap: .5rem; text-align: left; }
  .table.responsive td::before { content: attr(data-label); color: var(--ink-2); font-size: .8rem; }
  .table.responsive td:not([data-label])::before { content: ""; }
  .table.responsive td > span { justify-self: start; }
}

/* ---- forms ------------------------------------------------------------ */
label { display: grid; gap: .3rem; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 9px; padding: .55rem .7rem; min-height: 44px; width: 100%;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus, button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--brand); }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0; display: grid; gap: .75rem; }
legend { font-weight: 700; font-size: .9rem; padding: 0 .3rem; }
.form-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: 1 / -1; } }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: 1rem; }
.filters label { flex: 1 1 150px; }
.filters .btn { flex: none; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }
.row label:not(.check) { flex: 1 1 160px; }
.inline { display: inline; margin: 0; }
.type-picker { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.choice { display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; color: var(--ink); cursor: pointer; min-height: 48px; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.change-only { display: none; }
form:has(input[name="ticket_type"][value="change"]:checked) .change-only { display: grid; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; width: fit-content; }
.seg label { display: flex; align-items: center; gap: .4rem; padding: .5rem .85rem; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg label + label { border-left: 1px solid var(--line); }
.seg label:has(input:checked) { background: var(--brand-soft); color: var(--brand); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.reply:has(input[value="note"]:checked) textarea { background: var(--warn-soft); }
.seg-links { display: inline-flex; gap: .25rem; }
.seg-links a { padding: .3rem .7rem; border-radius: 8px; color: var(--ink-2); font-weight: 600; }
.seg-links a.active { background: var(--brand-soft); color: var(--brand); }
details.add { margin-top: .75rem; }
details.add > summary { list-style: none; width: fit-content; }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > summary { margin-bottom: .75rem; }
.inline-details { margin-top: .25rem; }

/* ---- buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 42px; padding: .5rem 1rem; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.small { min-height: 36px; padding: .3rem .75rem; font-size: .88rem; }
.btn.big { min-height: 50px; padding: .7rem 1.4rem; font-size: 1.02rem; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; font-weight: 600; }
.danger-text { color: var(--bad); }
.small-link { font-size: .85rem; display: inline-block; margin-top: .5rem; }
.status-buttons { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---- flash ------------------------------------------------------------ */
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 600; border: 1px solid; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.flash.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }

/* ---- key/value -------------------------------------------------------- */
.kv { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .45rem 1rem; margin: 0 0 .75rem; }
.kv dt { color: var(--ink-2); font-size: .85rem; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv.tight { gap: .2rem .75rem; }

/* ---- timeline --------------------------------------------------------- */
.timeline { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .75rem; }
.ev { border: 1px solid var(--line); border-radius: 10px; padding: .65rem .85rem; background: var(--surface); }
.ev-head { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; font-size: .85rem; margin-bottom: .25rem; }
.ev.private { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.ev.from-customer { border-left: 4px solid var(--accent); }
.ev.ev-status, .ev.ev-system, .ev.ev-assignment { background: var(--surface-2); border-color: var(--line); font-size: .85rem; padding: .4rem .85rem; }
.ev-approval { border-left: 4px solid var(--brand); }

/* ---- invoice ---------------------------------------------------------- */
.invoice .inv-head { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 800px) { .invoice .inv-head { grid-template-columns: 1fr 1fr 1fr; } }
.invoice .lines { margin: 0 -1.1rem; width: calc(100% + 2.2rem); }
.totals { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1.5rem; max-width: 360px; margin: 1rem 0 0 auto; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--ink-2); }
.totals dd { margin: 0; text-align: right; }
.totals .grand { font-weight: 700; font-size: 1.15rem; color: var(--ink); border-top: 2px solid var(--line); padding-top: .4rem; }

/* ---- login / portal --------------------------------------------------- */
.login { min-height: 70vh; display: grid; place-items: center; }
.login-card { width: 100%; max-width: 420px; padding: 1.75rem; }
.login-card h1 { margin-bottom: .25rem; }
.hero { display: grid; gap: 1rem; align-items: center; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); color: #fff; border-radius: var(--radius); padding: 1.5rem 1.4rem; margin-bottom: 1rem; }
.hero p { margin: .4rem 0 0; opacity: .92; }
.hero .btn { border-color: rgb(255 255 255 / 45%); background: rgb(255 255 255 / 10%); color: #fff; }
.hero .btn.primary { background: var(--accent); border-color: var(--accent); color: #1c1300; }
.hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
@media (min-width: 800px) { .hero { grid-template-columns: 1fr auto; } }
.steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; color: var(--muted); }
.steps .done { color: var(--ok); }
.steps .now { color: var(--ink); font-weight: 700; }
.narrow-cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.narrow-cta p { margin: 0; }
.money .btn { margin-top: .25rem; }

/* Phones: the badge drops under the summary so the summary gets the full width. */
@media (max-width: 560px) {
  .ticket-list a { grid-template-columns: auto 1fr; }
  .ticket-list .meta { grid-column: 1 / -1; }
  .ticket-list .badge, .ticket-list .status { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
}

/* ---- investor room (layout after utilitybox.ng/investor) ------------------- */
.eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: .4rem; }
.room-intro { margin: .5rem 0 1.25rem; max-width: 60rem; }
.room-intro h1 { font-size: clamp(1.5rem, 3.2vw, 2.3rem); line-height: 1.2; margin: .2rem 0 .7rem; }
.room-intro p { color: var(--ink-2); font-size: 1.05rem; }
.room-hero { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 640px) { .room-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .room-hero { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; display: grid; gap: .3rem; align-content: start; }
.kpi small { color: var(--ink-2); font-size: .85rem; }
.kpi strong { font-size: 1.55rem; line-height: 1.15; overflow-wrap: anywhere; }
.kpi span { color: var(--muted); font-size: .82rem; }
.kpi.lead { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.kpi.lead small, .kpi.lead span { color: color-mix(in srgb, var(--brand-ink) 82%, transparent); }
.live { font-style: normal; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ok); background: var(--ok-soft); border-radius: 99px; padding: .05rem .45rem; margin-left: .3rem; }
.notice { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: 1rem; font-size: .9rem; }
.room-layout { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .room-layout { grid-template-columns: 19rem minmax(0, 1fr); } .room-layout > .doc-menu { display: none; } }
.doc-menu > summary { list-style: none; display: flex; align-items: center; gap: .6rem; min-height: 52px; padding: .7rem 1rem; border-radius: var(--radius); background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.doc-menu > summary::-webkit-details-marker { display: none; }
.doc-menu > summary .burger, .doc-menu > summary .burger::before, .doc-menu > summary .burger::after { background: var(--brand-ink); }
.doc-list { display: grid; gap: .45rem; margin-top: .6rem; }
@media (min-width: 900px) { .doc-list { margin-top: 0; position: sticky; top: 1rem; } }
.doc-list h3 { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: .8rem 0 .1rem; }
.doc-list h3:first-child { margin-top: 0; }
.doc-list a { display: grid; gap: .15rem; width: 100%; min-height: 52px; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; }
.doc-list a small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.doc-list a:hover { border-color: var(--brand); text-decoration: none; }
.doc-list a.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
/* One list per width: the burger menu on phones, the sticky sidebar from 900px. */
.doc-list.doc-side { display: none; }
@media (min-width: 900px) { .doc-menu { display: none; } .doc-list.doc-side { display: grid; } }
.reader { min-width: 0; }
.reader h1 { font-size: 1.6rem; margin: .2rem 0 .8rem; }
.prose.doc { white-space: normal; }
.prose.doc h1 { font-size: 1.6rem; margin: .2rem 0 .8rem; }
.prose.doc h2 { font-size: 1.2rem; margin: 1.4rem 0 .5rem; }
.prose.doc h3 { font-size: 1.02rem; margin: 1.1rem 0 .4rem; }
.prose.doc p, .prose.doc li { line-height: 1.6; }
.prose.doc ul, .prose.doc ol { padding-left: 1.3rem; }
.table-wrap { overflow-x: auto; margin: .8rem 0; }
.table-wrap .table { min-width: 34rem; overflow-wrap: normal; }
.table-wrap .table th { white-space: nowrap; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.guide { display: grid; gap: .6rem; grid-template-columns: 1fr; margin-top: 1rem; }
@media (min-width: 700px) { .guide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.guide-card { display: grid; gap: .25rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); text-decoration: none; min-height: 52px; }
.guide-card strong { color: var(--brand); }
.guide-card span { color: var(--ink-2); font-size: .9rem; }
.guide-card:hover { border-color: var(--brand); text-decoration: none; }
.small { font-size: .85rem; }

/* ---- roles, sign-in picker, currency -------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.who-name { display: grid; line-height: 1.15; text-align: right; }
.who-name small { font-size: .75rem; color: var(--muted); }
.cur-pick { margin: 0; }
.cur-pick select { padding: .2rem .35rem; font-size: .85rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-height: 32px; }
.menu-currency { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 1rem; color: var(--ink-2); border-top: 1px solid var(--line); }
.menu-currency select { min-height: 44px; font-size: 1rem; }
.fx-note { margin: -.25rem 0 1rem; }
.conv { display: block; font-style: normal; font-size: .9rem; color: var(--ink-2); font-weight: 500; }
.demo-picker { display: grid; gap: .6rem; padding: 1rem; margin: 1rem 0; border-radius: var(--radius); background: var(--brand-soft); border: 1px solid var(--line); }
.demo-picker label { font-weight: 600; }
.demo-picker select { width: 100%; min-height: 48px; font-size: 1rem; }
.demo-picker.busy { opacity: .7; pointer-events: none; }
.wide { width: 100%; }
.break-glass { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.break-glass summary { cursor: pointer; color: var(--ink-2); font-size: .9rem; min-height: 44px; display: flex; align-items: center; }
.section-title { font-size: 1rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin: 1.25rem 0 .6rem; }
.pad { padding: 1rem 1.1rem 0; }
.inset-top { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.wrap-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.neg { color: var(--bad); }

/* ---- CRM board --------------------------------------------------------------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(15rem, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory; }
.board-col { background: var(--surface-2); border-radius: var(--radius); padding: .6rem; display: grid; gap: .5rem; align-content: start; scroll-snap-align: start; min-width: 0; }
.board-col header { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .1rem .2rem; }
.board-col h2 { font-size: .95rem; margin: 0; }
.count { display: inline-block; min-width: 1.5em; padding: 0 .4em; border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: .8rem; text-align: center; }
.deal-card { display: grid; gap: .2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; color: var(--ink); box-shadow: var(--shadow); }
.deal-card:hover { border-color: var(--brand); }
.deal-money { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .9rem; }
.deal-won { background: var(--ok-soft); color: var(--ok); }
.deal-lost { background: var(--bad-soft); color: var(--bad); }
.deal-negotiation, .deal-proposal { background: var(--warn-soft); color: var(--warn); }
.deal-lead, .deal-qualified { background: var(--brand-soft); color: var(--brand); }

/* ---- projects ------------------------------------------------------------------ */
.pr-active { background: var(--brand-soft); color: var(--brand); }
.pr-done { background: var(--ok-soft); color: var(--ok); }
.pr-on_hold { background: var(--warn-soft); color: var(--warn); }
.pr-cancelled { background: var(--bad-soft); color: var(--bad); }
progress { width: 7rem; height: .6rem; vertical-align: middle; accent-color: var(--brand); }
progress.over { accent-color: var(--bad); }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.task { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.task.t-done strong { text-decoration: line-through; color: var(--ink-2); }
.seg-buttons { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; }
.seg-buttons .btn { min-height: 40px; }

/* ---- reports and investor model ------------------------------------------------- */
.bars { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .5rem; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) 7rem 3.5rem; gap: .5rem; align-items: center; }
.bars strong { text-align: right; font-variant-numeric: tabular-nums; }
.updates { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.updates li { border-left: 3px solid var(--accent); padding-left: .75rem; }
.model-table td, .model-table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.model-table tr.be td { background: var(--ok-soft); font-weight: 700; }
.num-input { width: 9rem; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .bars li { grid-template-columns: minmax(0, 1fr) 3.5rem; }
  .bars progress { grid-column: 1 / -1; width: 100%; }
  .who-name { display: none; }
}
.inv-overdue, .chip.bad { background: var(--bad-soft); color: var(--bad); }
.inv-draft { background: var(--muted-soft); color: var(--ink-2); }
.table-wrap .table.fit { min-width: 0; }
.tile-value { font-size: clamp(1.15rem, 1.9vw, 1.6rem); overflow-wrap: anywhere; }

/* Wide header: twelve sections for an administrator must fit on one line
   (wide nav from 1200px, phone menu below), the currency picker and "Sign out"
   never clip or wrap, and the name/role shows only when there is room. */
.nav-wide { min-width: 0; }
.nav-wide a { padding: .4rem .5rem; font-size: .94rem; white-space: nowrap; }
.who { flex-shrink: 0; }
.who .link { white-space: nowrap; }
.cur-pick select { min-width: 4.75rem; }
@media (max-width: 1439px) { .who-name { display: none; } }
/* Tile figures stay on one line: the size follows the tile's own width. */
.tile { container-type: inline-size; min-width: 0; }
.tile-value { font-size: clamp(1rem, 10.5cqi, 1.6rem); white-space: nowrap; overflow-wrap: normal; }
