/* Legaltecher HQ — dark theme in the spirit of legaltecher.com.
   Black background, white text, greys for secondary text, violet as the single accent, lilac for "AI". */

:root {
  --bg: #000;
  --surface: #0b0b0f;
  --surface-2: #141419;
  --surface-3: #1c1c23;
  --border: #26262f;
  --border-strong: #3a3a46;
  --text: #fff;
  --text-2: #c9c9d1;
  --muted: #8e8e99;
  --accent: #7c5cff;          /* violet */
  --accent-hover: #8f74ff;
  --accent-soft: rgba(124, 92, 255, .14);
  --lilac: #c7b8ff;           /* the word "AI" */
  --orange: #ff8a3d;          /* Critical / High */
  --red: #ff5a5f;             /* overdue */
  --teal: #3ed3b9;            /* strengths, done */
  --amber: #ffc857;
  --radius: 14px;
  --radius-sm: 9px;
  --gap: 1.5rem;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--lilac); text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: clamp(1.7rem, 2.4vw + 1rem, 2.4rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; color: var(--text-2); }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: .1em .4em; border-radius: 6px; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.ai { color: var(--lilac); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.ok-text { color: var(--teal); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: -.01em; font-size: 1.1rem; }
.brand-hq { color: var(--accent); font-weight: 700; margin-left: .15em; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem; padding-top: max(.85rem, env(safe-area-inset-top));
  background: rgba(0, 0, 0, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.menu-btn { background: none; border: 1px solid var(--border); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; display: grid; place-items: center; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; position: relative; content: ""; }
.menu-icon::before { position: absolute; top: -6px; }
.menu-icon::after { position: absolute; top: 6px; }

.sidenav {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(82vw, 280px);
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 1.5rem;
  transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto;
}
.sidenav.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .6); }
.brand-side { padding: 0 .75rem; display: none; }
.sidenav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.sidenav a, .sidenav .linklike {
  display: block; padding: .7rem .75rem; border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none; font-size: 1rem; min-height: 44px;
}
.sidenav a:hover, .sidenav .linklike:hover { background: var(--surface-2); color: #fff; }
.sidenav a[aria-current="page"] { background: var(--accent-soft); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.sidenav-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 1rem; display: grid; gap: .15rem; }
.sidenav-foot form { margin: 0; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; width: 100%; text-align: left; }

.main { padding: 1.5rem 1rem 4rem; max-width: 1120px; margin: 0 auto; }

@media (min-width: 1024px) {
  .topbar { display: none; }
  .sidenav { transform: none; width: 248px; padding: 2rem 1rem; }
  .sidenav.open { box-shadow: none; }
  .brand-side { display: block; margin-bottom: .5rem; }
  .main { margin-left: 248px; margin-right: 0; padding: 3rem 3rem 5rem; max-width: 1180px; }
}

/* ---------- Page blocks ---------- */
.page-head { margin-bottom: 2rem; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin-bottom: .4rem; }

.panel, .card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: var(--gap);
}
.panel-accent { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 60%); }
.stack > * + * { margin-top: 1.1rem; }
.stack > h2 { margin-top: 1.8rem; }
.stack > h2:first-child, .stack > input[type=hidden] + h2 { margin-top: 0; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: var(--gap); }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.25rem; display: grid; gap: .35rem; }
.kpi-label { color: var(--muted); font-size: .85rem; }
.kpi-value { font-size: 1.9rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.phase-list { margin: 0; padding: 0; list-style: none; display: grid; gap: .4rem; }
.phase-list li { color: var(--text-2); padding: .55rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.phase-list li span:first-child { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-right: .6rem; }
.phase-list li.done { color: #fff; box-shadow: inset 3px 0 0 var(--teal); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .35rem; overflow-x: auto; margin: -0.5rem 0 1.5rem; padding-bottom: .25rem; scrollbar-width: thin; }
.tabs a { white-space: nowrap; padding: .55rem .95rem; border-radius: 999px; color: var(--text-2); text-decoration: none; border: 1px solid var(--border); font-size: .92rem; }
.tabs a:hover { color: #fff; border-color: var(--border-strong); }
.tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Forms ---------- */
.field { display: grid; gap: .4rem; }
.field > span, legend { color: var(--text-2); font-size: .9rem; font-weight: 500; }
.field small { color: var(--muted); font-size: .8rem; }
.field-narrow { max-width: 420px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: #fff; background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .7rem .85rem; min-height: 46px;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); margin: .2rem 0 0; flex: none; }
.input-code { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .3em; text-align: center; max-width: 260px; }
fieldset { border: 0; padding: 0; margin: 0; }
.radio-row { display: grid; gap: .6rem; }
.radio, .check { display: flex; gap: .7rem; align-items: flex-start; cursor: pointer; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.grid-2, .grid-3 { display: grid; gap: 1rem 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }
.grid-top { align-items: start; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .6rem 1.15rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: #fff; font: inherit; font-size: .95rem; font-weight: 550;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-3); border-color: #555; color: #fff; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(255, 90, 95, .12); color: #fff; }
.btn-small { min-height: 34px; padding: .3rem .8rem; font-size: .82rem; }
.btn-block { width: 100%; }

/* ---------- Messages ---------- */
.flash { padding: .85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid; font-size: .95rem; }
.flash-ok { border-color: rgba(62, 211, 185, .5); background: rgba(62, 211, 185, .08); }
.flash-error { border-color: rgba(255, 90, 95, .55); background: rgba(255, 90, 95, .08); }
.flash-info { border-color: var(--border-strong); background: var(--surface-2); }

/* ---------- Data ---------- */
.kv { display: grid; grid-template-columns: 1fr; gap: .3rem 1.5rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0 0 .8rem; }
@media (min-width: 720px) { .kv { grid-template-columns: 200px 1fr; } .kv dd { margin: 0; } }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding: .6rem .7rem; border-bottom: 1px solid var(--border); }
.table td { padding: .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; border: 1px solid var(--border-strong); margin: 0 .25rem .25rem 0; }
.tag-ok { border-color: rgba(62, 211, 185, .5); color: var(--teal); }
.tag-off { color: var(--muted); }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1.25rem; }
.steps { padding-left: 1.3rem; display: grid; gap: .6rem; color: var(--text-2); }
.code-line { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.code-line code { padding: .5rem .7rem; }
.codes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; max-width: 420px; }
.codes code { display: block; text-align: center; font-size: 1.05rem; padding: .45rem; }
.secret-key { font-size: 1.05rem; letter-spacing: .08em; display: inline-block; padding: .5rem .7rem; }
.qr-wrap { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.qr { background: #fff; padding: 12px; border-radius: 12px; width: 204px; height: 204px; }
.qr:empty::after { content: "A carregar o QR…"; color: #555; font-size: .8rem; }

/* ---------- Checks (installer) ---------- */
.checks { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .45rem; }
.checks li { display: flex; gap: .8rem; align-items: flex-start; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.check-mark { width: 1.4rem; flex: none; text-align: center; font-weight: 700; }
.checks .ok .check-mark { color: var(--teal); }
.checks .bad .check-mark { color: var(--red); }
.checks .warn .check-mark { color: var(--amber); }

/* ---------- Bare pages (login, installer) ---------- */
.bare-main { max-width: 760px; margin: 0 auto; padding: max(3rem, 8vh) 1rem 4rem; }
.bare-brand { font-weight: 700; font-size: 1.3rem; margin-bottom: 2rem; text-align: center; }
.card-narrow { max-width: 440px; margin: 0 auto 1.5rem; padding: 2rem; }
.card-wide { padding: 2rem; }

/* ---------- Tiles ---------- */
.tile { display: block; text-decoration: none; color: inherit; transition: border-color .15s; }
a.tile:hover { border-color: var(--accent); color: inherit; }
.tile-cta { color: var(--lilac); font-weight: 600; }
.tile-off { opacity: .6; }
.bad-text { color: var(--red); }
.tag-warn { border-color: rgba(255, 138, 61, .6); color: var(--orange); }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ---------- Calculator ---------- */
.presets { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.25rem; }
.dims-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .dims-grid { grid-template-columns: 1fr 1fr; } }
.dim-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem 1rem; background: var(--surface-2); }
.dim-block legend { padding: 0 .4rem; color: #fff; font-weight: 600; font-size: .95rem; }
.q-row { display: grid; gap: .4rem; padding: .55rem 0; border-top: 1px solid var(--border); }
.q-row:first-of-type { border-top: 0; }
.q-label { font-size: .9rem; color: var(--text-2); }
.q-label strong { color: var(--lilac); margin-right: .25rem; }
.seg { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .3rem; max-width: 360px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-height: 42px; border: 1px solid var(--border-strong); border-radius: 9px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--surface); }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--lilac); outline-offset: 2px; }
.seg label:first-child span { color: var(--muted); }
.seg label:first-child input:checked + span { color: #fff; background: var(--border-strong); border-color: var(--border-strong); }
details.context { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem; }
details summary { cursor: pointer; color: var(--text-2); }
details[open] summary { margin-bottom: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .5rem; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: .45rem .8rem; border: 1px solid var(--border-strong); border-radius: 999px; font-size: .88rem; }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--lilac); }

/* ---------- Assessment result ---------- */
.result-hero { display: flex; gap: 1.75rem; align-items: center; flex-wrap: wrap; border-color: var(--accent); background: linear-gradient(135deg, rgba(124, 92, 255, .18), var(--surface) 55%); }
.hero-level { display: flex; align-items: baseline; gap: .4rem; }
.hero-num { font-size: 5rem; line-height: 1; font-weight: 700; color: var(--accent); letter-spacing: -.04em; }
.hero-of { color: var(--muted); font-size: 1.1rem; }
.hero-text { flex: 1 1 260px; }
.hero-text h2 { font-size: 1.6rem; margin-bottom: .4rem; }
.rule-msg { padding: .8rem 1rem; border-left: 3px solid var(--orange); background: rgba(255, 138, 61, .07); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.dim-list { display: grid; gap: 1.1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 900px) { .dim-list { grid-template-columns: 1fr 1fr; } }
.dim-item { padding: 1rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.dim-item header { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.dim-item h3 { color: #fff; margin: 0; font-size: 1rem; }
.dim-score { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--surface-3); border-radius: 99px; margin: .7rem 0; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meaning { font-weight: 550; margin-bottom: .2rem; }
.note { color: var(--orange); margin: .35rem 0 0; padding-left: .9rem; position: relative; }
.note::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--orange); }
.alert-card { border: 1px solid var(--border); border-left-width: 3px; border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: .75rem; background: var(--surface-2); }
.alert-card p { margin: .3rem 0 0; }
.alert-card .sev { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .2rem; }
.sev-high { border-left-color: var(--orange); }
.sev-high .sev { color: var(--orange); }
.sev-att { border-left-color: var(--accent); }
.sev-att .sev { color: var(--lilac); }
.sev-good { border-left-color: var(--teal); }
.rule-code code { font-size: .8rem; }
.plan-cols { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .plan-cols { grid-template-columns: repeat(3, 1fr); } }
.plan-col { display: grid; gap: .75rem; align-content: start; }
.action-card { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.action-card h3 { color: #fff; font-size: 1rem; margin: .2rem 0 .5rem; }
.action-card p { margin: 0 0 .5rem; }
details.explain summary h2 { display: inline; }
details.explain ol { display: grid; gap: .4rem; }

/* ---------- Settings: rules and tests ---------- */
.rule-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; display: grid; gap: .9rem; }
.rule-box legend { padding: 0 .4rem; font-weight: 600; color: #fff; }
.test-case summary { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.test-case[open] summary { margin-bottom: .8rem; }

/* ---------- Print ---------- */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .topbar, .sidenav, .tabs, .btn, form { display: none !important; }
  .main { margin: 0; padding: 0; max-width: none; }
  .panel, .card, .kpi { border-color: #ccc; background: #fff; }
  a { color: #000; }
}

/* ---------- Phase 3: leads, pipeline, organisations ---------- */
.code-wrap { position: relative; }
.code-wrap .btn { position: absolute; top: .6rem; right: .6rem; }
pre.code { margin: 0; padding: 1rem 1.1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-x: auto; font: .8rem/1.55 var(--mono); color: var(--text-2); max-height: 420px; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar .spacer { flex: 1; }
.toolbar select, .toolbar input { width: auto; min-height: 40px; padding: .45rem .7rem; font-size: .92rem; }
.prio { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 8px; font-weight: 700; font-size: .9rem; border: 1px solid var(--border-strong); }
.prio-A { background: rgba(255, 138, 61, .16); border-color: var(--orange); color: var(--orange); }
.prio-B { background: var(--accent-soft); border-color: var(--accent); color: var(--lilac); }
.prio-C { color: var(--muted); }
.due-late { color: var(--red); font-weight: 600; }
.due-soon { color: var(--amber); }
.row-link { color: #fff; text-decoration: none; font-weight: 600; }
.row-link:hover { color: var(--lilac); }
.sub { display: block; color: var(--muted); font-size: .84rem; }
.tag-bad { border-color: rgba(255, 90, 95, .6); color: var(--red); }
.tag-ai { border-color: var(--accent); color: var(--lilac); }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .9rem; overflow-x: auto; padding-bottom: .75rem; scroll-snap-type: x proximity; }
.kanban-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem; display: flex; flex-direction: column; gap: .6rem; min-height: 140px; scroll-snap-align: start; }
.kanban-col h3 { margin: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; }
.kcard { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .75rem; display: grid; gap: .45rem; font-size: .9rem; }
.kcard-head { display: flex; gap: .55rem; align-items: center; }
.kcard form { display: flex; gap: .4rem; }
.kcard select { min-height: 34px; padding: .25rem .5rem; font-size: .82rem; }
.lead-head { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.lead-head .prio { width: 2.6rem; height: 2.6rem; font-size: 1.2rem; }
.lead-head h1 { margin: 0; }
.side-grid { display: grid; gap: var(--gap); }
@media (min-width: 1100px) { .side-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.checklist li { display: flex; gap: .7rem; align-items: flex-start; }
.checklist .mark { flex: none; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: .75rem; margin-top: .15rem; }
.checklist .mark.ok { background: rgba(62, 211, 185, .15); border-color: var(--teal); color: var(--teal); }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border-strong); display: grid; gap: .8rem; }
.timeline li { padding-left: 1rem; position: relative; font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: .5rem; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.sheet { white-space: pre-wrap; font: .88rem/1.6 var(--mono); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; margin: 0; }
.answers-grid { display: grid; gap: .5rem 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .answers-grid { grid-template-columns: 1fr 1fr; } }
.answers-grid .q-row { display: grid; grid-template-columns: 3rem 1fr 5.5rem; gap: .5rem; align-items: center; }
.answers-grid select { min-height: 38px; padding: .3rem .5rem; }
.compare { overflow-x: auto; }
.compare th, .compare td { white-space: nowrap; }
.compare .best { color: var(--teal); font-weight: 600; }
.compare .worst { color: var(--orange); font-weight: 600; }
.danger-zone { border-color: rgba(255, 90, 95, .45); }
details.more > summary { cursor: pointer; color: var(--lilac); }
.toolbar .check { padding: .45rem .7rem; align-items: center; }
.toolbar .check input { width: auto; min-height: 0; }
/* ---------- Phase 4: catalog, templates, playbook text ---------- */
.task-grid { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .task-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.task-card { display: grid; gap: .35rem; align-content: start; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); text-decoration: none; }
.task-card:hover { border-color: var(--accent); color: var(--text); }
.task-card .tag { justify-self: start; }
.tpl-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.tpl-list a { color: var(--text); text-decoration: none; }
.tpl-list a:hover { color: var(--lilac); }
a.tag { color: var(--text-2); text-decoration: none; }
a.tag:hover { border-color: var(--accent); color: #fff; }
.playbook-text h2, .playbook-text h3, .playbook-text h4 { margin: 1.4rem 0 .5rem; }
.playbook-text > h2:first-child { margin-top: 0; }
.playbook-text p, .playbook-text ul, .playbook-text ol { color: var(--text-2); }
.playbook-text blockquote { margin: 1rem 0; padding: .6rem 1rem; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.playbook-text .code-wrap { margin: .8rem 0 1.2rem; }
ul.todo { list-style: none; padding-left: 0; display: grid; gap: .45rem; }
ul.todo li { display: flex; gap: .6rem; align-items: flex-start; }
ul.todo .box { flex: none; width: 1.1rem; height: 1.1rem; margin-top: .3rem; border: 1px solid var(--border-strong); border-radius: 4px; display: grid; place-items: center; font-size: .7rem; color: var(--teal); }
pre.tpl { white-space: pre-wrap; word-break: break-word; max-height: none; color: var(--text); font-size: .85rem; }
pre.tpl mark, .flash mark { background: rgba(255, 200, 87, .18); color: var(--amber); border-radius: 3px; padding: 0 .15rem; }
pre.tpl .filled { background: var(--accent-soft); color: #fff; border-radius: 3px; padding: 0 .15rem; }
textarea.mono { font-family: var(--mono); font-size: .85rem; line-height: 1.55; }
/* ---------- Phase 5: proposals and projects ---------- */
a.chip { display: inline-block; padding: .4rem .85rem; border: 1px solid var(--border-strong); border-radius: 999px; font-size: .88rem; color: var(--text-2); text-decoration: none; }
a.chip:hover { color: #fff; border-color: var(--accent); }
a.chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.toolbar .chips { margin-top: 0; }
@media (min-width: 900px) { .kpis-3 { grid-template-columns: repeat(3, 1fr); } }

.prop-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem .4rem; margin: 0 0 1rem; background: var(--surface-2); }
.prop-item legend { padding: 0 .4rem; font-weight: 600; }
.prop-item .grid-3 { gap: .6rem; }
.prop-item .toolbar { margin: .2rem 0 .4rem; }
.prop-item .radio { padding: .45rem .7rem; }
.doc-preview { white-space: pre-wrap; font: .9rem/1.6 var(--font); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin: .8rem 0 0; overflow-x: auto; }
.doc-preview mark, .clist mark { background: rgba(255, 200, 87, .22); color: var(--amber); padding: 0 2px; border-radius: 3px; }
.doc-preview .filled { color: var(--lilac); }

.progress { display: block; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--teal); }

.ptimeline { position: relative; padding-bottom: 3.2rem; margin: .6rem 0 .4rem; }
.ptl-row { display: grid; grid-template-columns: 3.4rem 1fr; align-items: center; gap: .5rem; height: 1.45rem; }
.ptl-label { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ptl-track { position: relative; height: .55rem; background: var(--surface-2); border-radius: 99px; }
.ptl-bar { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--accent); }
.ptl-bar-t { background: var(--border-strong); }
.ptl-marks { position: absolute; left: 3.9rem; right: 0; top: 0; bottom: 0; pointer-events: none; }
.ptl-mark { position: absolute; top: 0; bottom: 2.6rem; border-left: 1px dashed var(--border-strong); }
.ptl-mark > span { position: absolute; bottom: -2.7rem; left: 0; transform: translateX(-50%); font-size: .72rem; line-height: 1.25; color: var(--muted); white-space: nowrap; text-align: center; }
.ptl-mark.m45, .ptl-mark.m90 { border-left: 2px solid var(--lilac); }
.ptl-mark.m45 > span, .ptl-mark.m90 > span { color: var(--lilac); font-weight: 600; }
.ptl-mark.today { border-left: 2px solid var(--amber); }
.ptl-mark.today > span { color: var(--amber); bottom: auto; top: -1.1rem; }

.clist { display: grid; gap: .1rem; }
.cgroup { margin: .8rem 0 .2rem; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.citem { display: flex; gap: .7rem; align-items: flex-start; padding: .45rem .2rem; border-bottom: 1px solid var(--border); }
.citem:last-child { border-bottom: 0; }
.citem-body { display: grid; gap: .15rem; min-width: 0; }
.citem.is-done .citem-body > span:first-child { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.check-btn { flex: none; width: 1.55rem; height: 1.55rem; margin-top: .1rem; border-radius: 7px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--bg); font-weight: 800; cursor: pointer; display: grid; place-items: center; padding: 0; }
.check-btn:hover { border-color: var(--accent); }
.check-btn.ok { background: var(--teal); border-color: var(--teal); }
.citem-edit summary { cursor: pointer; width: max-content; }
.citem-edit .toolbar { margin: .4rem 0 0; }
.note-line { color: var(--text-2); font-style: italic; }
.inv, .appr { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.inv:last-child, .appr:last-child { border-bottom: 0; }
.inv .toolbar, .appr .toolbar { margin: .4rem 0 0; }
details > summary.small { cursor: pointer; margin-top: .6rem; color: var(--lilac); }
details > summary + form.stack { margin-top: .6rem; }
.ptimeline { padding-bottom: 5.4rem; }
.ptl-mark { bottom: 4.8rem; }
.ptl-mark > span { bottom: -2.7rem; }
.ptl-mark.mend > span, .ptl-mark.m90 > span { bottom: -4.9rem; }
.ptl-mark.mend { border-left-style: solid; }
.ptl-mark.today > span { top: -1.15rem; bottom: auto; }
.kpi-value { font-size: clamp(1.35rem, 2.4vw, 1.9rem); white-space: nowrap; }

/* ---------- Phase 6: Hoje and Métricas ---------- */
.kpi-link { color: inherit; text-decoration: none; }
.kpi-link:hover { border-color: var(--accent); color: inherit; }
.count { display: inline-block; min-width: 1.6rem; padding: 0 .45rem; margin-left: .3rem; border-radius: 99px; background: var(--surface-3); color: var(--text-2); font-size: .8rem; font-weight: 600; text-align: center; vertical-align: middle; }
.today-grid { display: grid; gap: var(--gap); margin-bottom: var(--gap); }
@media (min-width: 1100px) { .today-grid { grid-template-columns: 1fr 1fr; align-items: start; } .today-grid > .panel { margin: 0; } }
.rows { display: grid; }
.rows > li { display: flex; gap: .8rem; align-items: flex-start; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.rows > li:last-child { border-bottom: 0; }
.rows > li > .tag, .rows > li > .prio { flex: none; margin-top: .15rem; }
.reminder .toolbar { margin: .5rem 0 0; }
.reminder form { margin: 0; }
.week-project { font-size: 1rem; margin: 1rem 0 .3rem; }
.week-project:first-of-type { margin-top: 0; }
.week-items { display: grid; gap: .3rem; }
.week-items a { color: var(--text); text-decoration: none; }
.week-items a:hover { color: var(--lilac); text-decoration: underline; }
.digest-preview { background: #fff; color: #111; border-radius: var(--radius-sm); padding: 1.2rem 1.4rem; overflow-x: auto; }

.metrics-grid { display: grid; gap: var(--gap); margin-bottom: var(--gap); }
@media (min-width: 1100px) { .metrics-grid { grid-template-columns: 1fr 1fr; align-items: start; } .metrics-grid > .panel { margin: 0; } }
.hbars { display: grid; gap: .35rem; }
.hbar { display: grid; grid-template-columns: minmax(6rem, 11rem) 1fr auto; gap: .7rem; align-items: center; min-height: 1.6rem; }
.hbar-label { font-size: .88rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { position: relative; height: .7rem; background: var(--surface-2); border-radius: 4px; }
.hbar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar-value { font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; min-width: 4.5rem; text-align: right; }
.hbar:hover .hbar-fill { background: var(--accent-hover); }
.hbar-note { margin: -.2rem 0 .2rem; padding-left: calc(min(11rem, 30%) + .7rem); }
.bar-table .hbar { grid-template-columns: 0 1fr auto; gap: .5rem; }
.bar-table td { min-width: 12rem; }
.bar-table .is-current td:first-child { color: var(--lilac); font-weight: 600; }
.cap-bars .hbar { grid-template-columns: 4.5rem 1fr auto; }
.cap-line { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text-2); border-radius: 1px; }
.cap-bars .is-over .hbar-fill { background: var(--orange); }
.cap-bars .is-over .hbar-value { color: var(--orange); }
.cap-bars .is-current .hbar-label { color: var(--lilac); font-weight: 600; }
.dist-grid { display: grid; gap: 1.2rem 2rem; }
@media (min-width: 900px) { .dist-grid { grid-template-columns: 1fr 1fr; } .dist-wide { grid-column: 1 / -1; } }
.dist h3 { font-size: .95rem; margin: 0 0 .5rem; }
.dist-wide .hbar { grid-template-columns: minmax(10rem, 22rem) 1fr auto; }
@media (max-width: 600px) {
  .hbar, .dist-wide .hbar { grid-template-columns: 1fr auto; }
  .hbar-label { grid-column: 1 / -1; white-space: normal; }
  .bar-table .hbar .hbar-label { display: none; }
  .hbar-note { padding-left: 0; }
}
.dist .hbar { grid-template-columns: minmax(5rem, 8.5rem) 1fr auto; }
.dist .hbar-value { min-width: 3.8rem; }

/* ---------- 0.7: organisations board and project page ---------- */
.board-chips { margin: 0 0 1rem; }
.board td { vertical-align: top; }
.board select { padding: .3rem .5rem; font-size: .88rem; max-width: 11rem; }
.board td:first-child { min-width: 12rem; }
.board td:nth-child(4) { min-width: 14rem; }
.stagebar { display: grid; gap: 1rem 2rem; }
@media (min-width: 800px) { .stagebar { grid-template-columns: auto 1fr; align-items: start; } }
.stagebar p { margin: 0 0 .3rem; }
.stagebar .toolbar input { max-width: 14rem; }
.assess-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.assess-head .hero-num { font-size: 3rem; }
.assess-head p { margin: 0; }
.board td:nth-child(2) { min-width: 10rem; }
.board td:nth-child(2) select { width: 100%; }
