/* Lynxbudget — styles. Palette and tone shared with Lynxtime (Lynxmind brand). No build step. */

:root {
  --lm-teal: #009999;
  --lm-teal-solid: #00807f;
  --lm-skobeloff: #08706e;
  --lm-hunter: #3c5845;
  --lm-viridian: #5b866d;
  --lm-sunburst: #a0885a;
  --lm-night: #111111;
  --lm-onyx: #444444;
  --lm-soft-gray: #9ca3af;
  --lm-danger: #b91c1c;
  --lm-attention: #854d0e;

  --bg: #f5f5f5;
  --panel: #ffffff;
  --panel-2: #f5f7f6;
  --ink: #111111;
  --text: #333333;
  --muted: #5b6370;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #009999;
  --accent-solid: #00807f;
  --accent-text: #08706e;
  --accent-soft: rgba(0, 153, 153, .10);
  --sidebar-bg: #111111;
  --row-hover: #f3f7f6;
  --good-bg: #ccfbf1; --good-fg: #08706e;
  --warn-bg: #fef3c7; --warn-fg: #854d0e;
  --bad-bg: #fee2e2; --bad-fg: #b91c1c;
  --neutral-bg: #eeeeee; --neutral-fg: #444444;
  --info-bg: #e0f2fe; --info-fg: #075985;
  --bar: #009999;
  --bar-neg: #b91c1c;

  --radius: 12px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .06);
  --shadow-lg: 0 20px 50px rgba(17, 17, 17, .18);
  --focus-ring: 0 0 0 3px rgba(0, 153, 153, .22);
  --sidebar-w: 248px;

  --font-ui: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Geist", "Segoe UI", system-ui, sans-serif;
  /* Numbers use the UI face with tabular digits (monospace read too heavy); real monospace only for code. */
  --font-mono: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-code: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg: #121414;
  --panel: #1b1f1f;
  --panel-2: #222727;
  --ink: #f3f4f6;
  --text: #d6dada;
  --muted: #9aa3a3;
  --border: #2d3333;
  --border-strong: #3b4343;
  --accent: #2ec4c4;
  --accent-solid: #1aa5a5;
  --accent-text: #5fd3d3;
  --accent-soft: rgba(46, 196, 196, .14);
  --sidebar-bg: #0b0d0d;
  --row-hover: #1f2626;
  --good-bg: #0f3d39; --good-fg: #7fe0d6;
  --warn-bg: #3d2f0f; --warn-fg: #f4d07a;
  --bad-bg: #4a1414; --bad-fg: #f8a3a3;
  --neutral-bg: #2b3030; --neutral-fg: #d6dada;
  --info-bg: #0f2e3d; --info-fg: #9bd5f0;
  --bar: #2ec4c4;
  --bar-neg: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --lm-hunter: #a7c5b4;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--lm-hunter); margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { text-align: right; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; color: var(--ink); }
.neg { color: var(--bad-fg); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 18px; }
.grow { flex: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Brand ---------- */
.brand { display: flex; flex-direction: column; line-height: 1.1; text-decoration: none; }
.brand:hover { text-decoration: none; }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; color: #fff; }
.brand-sub { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--lm-soft-gray); margin-top: 3px; }
.brand-light .wordmark { color: var(--ink); }
.brand-light .brand-sub { color: var(--accent); }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 10% -10%, rgba(0, 153, 153, .14), transparent 60%), radial-gradient(700px 400px at 100% 110%, rgba(60, 88, 69, .14), transparent 60%), var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 10px 40px rgba(17, 17, 17, .08); padding: 36px 32px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.login-card form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.login-error { color: var(--bad-fg); font-size: 13px; min-height: 1em; }
.login-entra { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.login-entra .btn { justify-content: center; }
.login-entra p { margin: 0; }
.login-card form[hidden], .login-entra[hidden] { display: none; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg); color: #fff;
  position: fixed; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; padding: 20px 14px 14px; z-index: 30;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 14px; }
.hamburger { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: transparent; color: #fff; cursor: pointer; font-size: 18px; }
.year-pick { padding: 0 8px 12px; }
.year-pick select {
  width: 100%; background: rgba(255,255,255,.07); color: #fff; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; padding: 8px 10px; font: inherit; font-weight: 600;
}
.year-pick select option { color: #111; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm);
  color: #d1d5db; font-weight: 500; text-decoration: none; font-size: 13.5px; transition: background .12s, color .12s;
}
.nav a svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav a.active { background: var(--lm-teal-solid); color: #fff; }
.nav .nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 8px 10px; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--lm-soft-gray); }
.sidebar-foot .btn { width: 100%; }

.content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; padding: 26px 28px 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); margin-top: 3px; font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius-xs); border: 1px solid var(--border-strong);
  background: var(--panel); color: var(--ink); font: inherit; font-weight: 500; font-size: 13.5px; cursor: pointer;
  transition: background .12s, border-color .12s; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
.btn-primary:hover { background: var(--lm-skobeloff); }
.btn-danger { color: var(--bad-fg); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad-fg); }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn-icon { padding: 4px 7px; line-height: 1; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--panel-2); }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius-xs);
  padding: 7px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
input[type="checkbox"] { width: auto; }
textarea { min-height: 70px; resize: vertical; }
label { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; flex-direction: column; gap: 4px; }
label .help { font-weight: 400; font-size: 11.5px; }
/* Number inputs: what the typed text will be saved as, or why it cannot be read. */
.num-echo { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.num-echo:empty { display: none; }
.num-echo.bad { color: var(--bad-fg); }
input.invalid, input.invalid:focus { border-color: var(--bad-fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad-fg) 22%, transparent); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.field-row .wide { grid-column: 1 / -1; }
.search { max-width: 280px; }

/* ---------- Cards / KPIs ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head .hint { font-size: 12.5px; color: var(--muted); }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .k-label { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.kpi .k-value { font-family: var(--font-mono); font-size: 22px; font-weight: 500; color: var(--ink); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.hero { grid-column: span 2; background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--panel); border-color: var(--accent); }
.kpi.hero .k-value { font-size: 30px; }
.kpi .neg { color: var(--bad-fg); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; white-space: nowrap; }
table.data th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; background: var(--panel-2); position: sticky; top: 0; z-index: 1; cursor: pointer; user-select: none; }
table.data th.num, table.data td.num { text-align: right; }
table.data th .sort { margin-left: 3px; font-size: 10px; }
table.data tbody tr:hover { background: var(--row-hover); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tfoot td { font-weight: 600; color: var(--ink); background: var(--panel-2); border-top: 2px solid var(--border-strong); }
table.data td.editable { cursor: text; position: relative; }
table.data td.editable:focus { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
table.data td.editable:hover { box-shadow: inset 0 0 0 1px var(--accent); border-radius: 4px; }
table.data td.editable:focus::after, table.data td.editable:hover::after { content: "✎"; position: absolute; right: 2px; top: 2px; font-size: 9px; color: var(--accent); }
table.data td.editing { padding: 2px 4px; }
table.data td.editing input, table.data td.editing select { padding: 4px 6px; min-width: 90px; font-size: 13px; }
table.data td.computed { color: var(--muted); }
table.data td.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.data td.wrap { white-space: normal; min-width: 180px; }
table.data .actions { text-align: right; white-space: nowrap; }
table.data .actions .btn { margin-left: 4px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.table-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--panel); font-size: 12.5px; cursor: pointer; color: var(--text); }
.chip.active { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--neutral-bg); color: var(--neutral-fg); white-space: nowrap; }
.badge.good { background: var(--good-bg); color: var(--good-fg); }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge.bad { background: var(--bad-bg); color: var(--bad-fg); }
.badge.info { background: var(--info-bg); color: var(--info-fg); }
.badge.muted { opacity: .7; }
.cell-warn { background: var(--warn-bg); color: var(--warn-fg); border-radius: 4px; }
.cell-bad { background: var(--bad-bg); color: var(--bad-fg); border-radius: 4px; }

/* ---------- Bars (single-series horizontal bar chart) ---------- */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 180px) 1fr 110px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.bar-row .bar-track { height: 14px; background: var(--panel-2); border-radius: 4px; position: relative; }
.bar-row .bar-fill { position: absolute; top: 0; bottom: 0; left: 0; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row .bar-fill.neg { background: var(--bar-neg); }
.bar-row .bar-fill.warn { background: var(--lm-sunburst); }
.bar-row .bar-value { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.bar-row:hover .bar-track { outline: 1px solid var(--accent); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(17,17,17,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 10px; }
.modal-body { padding: 6px 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--border); }
.modal .preview { background: var(--panel-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; }
.modal .preview b { font-family: var(--font-mono); color: var(--ink); display: block; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--lm-night); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-lg); max-width: 380px; }
.toast.error { background: var(--lm-danger); }
.toast.ok { background: var(--lm-skobeloff); }
.toast { display: flex; align-items: center; gap: 12px; }
.toast-action { margin-left: auto; background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.7); border-radius: 6px; padding: 4px 10px; font: inherit; font-weight: 600; cursor: pointer; min-height: 28px; }
.toast-action:hover { background: rgba(255,255,255,.15); }
/* Save errors: under the field they belong to, or at the top of the dialog. */
.field-error { color: var(--bad-fg); font-size: 12px; font-weight: 500; }
.form-error { background: var(--bad-bg); color: var(--bad-fg); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; font-size: 13px; font-weight: 500; }
[aria-invalid="true"] { border-color: var(--bad-fg) !important; }
/* A cell that is being saved, and a page that is loading another year. */
table.data td.saving input, table.data td.saving select { opacity: .6; cursor: progress; }
table.data td.saving { background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 18%, transparent), transparent); background-size: 200% 100%; animation: lxb-saving 1s linear infinite; }
@keyframes lxb-saving { from { background-position: 100% 0; } to { background-position: -100% 0; } }
#page.busy { position: relative; opacity: .45; pointer-events: none; transition: opacity .15s; }
#page.busy::before { content: attr(data-busy); position: sticky; top: 40vh; display: block; text-align: center; font-weight: 600; z-index: 5; }
@media (prefers-reduced-motion: reduce) { table.data td.saving { animation: none; } }

/* ---------- Misc ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 18px; font-size: 13px; }
.detail-grid dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.detail-grid dd { margin: 2px 0 0; color: var(--ink); font-weight: 500; }
.note { background: var(--warn-bg); color: var(--warn-fg); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }
.history-item { display: grid; grid-template-columns: 150px 90px 110px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; align-items: start; }
.history-item .diff { color: var(--muted); font-size: 12px; white-space: normal; }
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.list-box ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.list-box li { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.loading { color: var(--muted); padding: 30px; text-align: center; }
kbd { font-family: var(--font-code); font-size: 11px; background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 4px; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s; }
  .sidebar.open { transform: none; }
  .hamburger { display: inline-flex; align-items: center; justify-content: center; }
  .menu-fab { position: fixed; top: 12px; left: 12px; z-index: 29; }
  .content { margin-left: 0; padding: 64px 16px 60px; }
  .kpi.hero { grid-column: span 1; }
  .bar-row { grid-template-columns: 100px 1fr 90px; }
  .history-item { grid-template-columns: 1fr; gap: 2px; }
}
@media print {
  .sidebar, .page-actions, .table-tools, .actions, .toasts { display: none !important; }
  .content { margin: 0; padding: 0; }
}

/* ---------- Redesign: overview statement, side cards, alerts, sub-nav ---------- */
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.hero-card { padding: 20px 22px; }
.hero-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.hero-value { font-family: var(--font-display); font-size: 40px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; line-height: 1.1; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.hero-side { text-align: right; }
.hero-second { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--ink); margin: 4px 0 2px; }
.k-label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.eq-bar { display: flex; height: 14px; border-radius: 5px; overflow: hidden; background: var(--panel-2); margin-top: 18px; gap: 2px; }
.eq-bar.cost { margin-top: 4px; height: 8px; }
.eq-seg.rev { background: var(--bar); }
.eq-seg.cmk { background: var(--lm-skobeloff); }
.eq-seg.cmk2 { background: var(--lm-viridian); }
.eq-seg.spent { background: var(--bar-neg); opacity: .8; }
.eq-seg.rest { background: transparent; }
.statement { margin-top: 14px; display: flex; flex-direction: column; }
.st-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.st-line:last-child { border-bottom: 0; }
.st-line.total { border-top: 2px solid var(--border-strong); border-bottom: 0; font-weight: 600; color: var(--ink); margin-top: 2px; padding-top: 9px; }
.st-line.total .st-value { font-size: 17px; font-weight: 600; }
.st-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.st-label a { color: inherit; }
.st-label a:hover { color: var(--accent-text); }
.st-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.st-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.statement.big .st-line { font-size: 15px; padding: 9px 0; }
.side-cards .mini { display: block; color: inherit; text-decoration: none; padding: 14px 16px; }
.side-cards .mini:hover { border-color: var(--accent); text-decoration: none; }
.mini-main { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); margin: 4px 0 2px; }
.alerts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.alert { display: block; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; border: 1px solid transparent; color: inherit; text-decoration: none; }
.alert:hover { text-decoration: none; filter: brightness(.97); }
.alert.bad { background: var(--bad-bg); color: var(--bad-fg); }
.alert.warn { background: var(--warn-bg); color: var(--warn-fg); }
.alert.note { background: var(--panel-2); color: var(--muted); border-color: var(--border); }
.summary-strip { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.summary-strip b { color: var(--ink); }
.subnav { display: inline-flex; gap: 2px; margin-top: 4px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.subnav a { padding: 4px 12px; border-radius: 999px; font-size: 13px; color: var(--text); font-weight: 500; }
.subnav a.active { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.subnav a:hover { text-decoration: none; color: var(--accent-text); }
.toggle { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.toggle input { width: auto; margin: 0; }
table.data.compact th, table.data.compact td { padding: 7px 10px; }
table.data tr.dim td { color: var(--muted); }

.detail-grid.one { grid-template-columns: 1fr; }
@media (max-width: 1000px) { .grid-main { grid-template-columns: 1fr; } .hero-value { font-size: 32px; } }
.st-sign { display: inline-block; width: 14px; color: var(--muted); }
.st-line.total .st-sign { color: var(--ink); }

/* ---------- signed values ---------- */
.pos { color: var(--good-fg); }
.neg { color: var(--bad-fg); }
.warn-text { color: var(--warn-fg); }
td.pos, td.neg { font-weight: 500; }
.st-line.forecast { border-top: 1px dashed var(--border-strong); color: var(--muted); font-style: italic; }
.st-line.forecast .st-value { font-size: 14px; }

/* ---------- year chart ---------- */
/* "Ao longo do ano" (Home): drawn at real pixel size, so text never scales with the screen. */
.year-chart { position: relative; }
.yc-kpis { display: flex; gap: 32px; flex-wrap: wrap; margin: 2px 0 10px; }
.yc-k { font-size: 12px; color: var(--muted); }
.yc-v { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--ink); }
.yc-sub { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.yc-plot, .yc-bars { width: 100%; }
.yc-plot svg, .yc-bars svg { display: block; font-family: var(--font-ui); overflow: visible; }
.yc-grid { stroke: var(--border); stroke-width: 1; }
.yc-grid.zero { stroke: var(--border-strong); }
.yc-tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.yc-tick.now { fill: var(--accent-text); font-weight: 600; }
.yc-today { stroke: var(--border-strong); stroke-width: 1; }
.yc-area { fill: var(--ink); opacity: .07; stroke: none; }
.yc-line { fill: none; stroke: var(--ink); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.yc-line.dashed { stroke-dasharray: 5 5; opacity: .75; }
.yc-dot { fill: var(--ink); stroke: var(--panel); stroke-width: 2; }
.yc-cross { stroke: var(--accent); stroke-width: 1; }
.yc-bar { fill: var(--bar); transition: opacity .12s; }
.yc-bar.neg { fill: var(--bar-neg); }
.yc-bar.future { opacity: .4; }
.yc-bar.dim { opacity: .25; }
.yc-hit { all: unset; position: absolute; cursor: crosshair; }
.yc-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.yc-tip { position: absolute; z-index: 5; width: 210px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius-xs); box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12.5px; pointer-events: none; }
.yc-tip-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 3px; }
.yc-tip-row.total { border-top: 1px solid var(--border); margin-top: 5px; padding-top: 5px; }
@media (prefers-reduced-motion: reduce) { .yc-bar { transition: none; } }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.legend .sw { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.legend .sw.inc { background: var(--bar); } .legend .sw.cost { background: var(--bar-neg); } .legend .sw.res { background: var(--ink); height: 4px; }
details summary { cursor: pointer; }

.bar-fill.pos { background: var(--good-fg); }

/* ---------- AI answers ---------- */
.ai-answer { border-top: 1px solid var(--border); padding-top: 10px; }
.md h2, .md h3, .md h4 { margin: 12px 0 6px; font-size: 14px; }
.md p { margin: 6px 0; }
.md ul, .md ol { margin: 6px 0 6px 20px; padding: 0; }
.md li { margin: 3px 0; }
.md code { background: var(--panel-2); padding: 1px 4px; border-radius: 4px; }

/* numbers everywhere: tabular digits, never monospace */
table.data td.num, table.data th.num, .num, .st-value, .k-value, .bar-value, .hero-value, .hero-second, .mini-main, .summary-strip b { font-variant-numeric: tabular-nums; }

/* ================= Revamp: tiles, attention, shares, cost centres, timeline, search, mobile ================= */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tiles.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { display: block; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 15px 18px; box-shadow: var(--shadow); color: inherit; text-decoration: none; min-width: 0; }
a.tile:hover { border-color: var(--accent); text-decoration: none; }
/* A tile that is not a link does not react to the mouse. */
.tile.static { cursor: default; }
.tile .t-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tile .t-value { font-family: var(--font-display); font-size: 32px; font-weight: 600; margin: 6px 0 2px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.1; }
.tile .t-sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.tile .t-sub b { color: var(--ink); font-weight: 600; }
.trend { font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.trend.up { color: var(--good-fg); } .trend.down { color: var(--bad-fg); } .trend.flat { color: var(--muted); }
.two { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.attention { display: flex; flex-direction: column; gap: 8px; }
.att { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; background: var(--panel-2); }
.att .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.att .dot.k-bad { background: var(--bad-fg); } .att .dot.k-warn { background: var(--lm-sunburst); } .att .dot.k-note { background: var(--lm-soft-gray); }
.att .txt { flex: 1; font-size: 13.5px; min-width: 0; }
.share { display: grid; grid-template-columns: minmax(90px, 170px) 1fr 92px 48px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.share .trk { height: 12px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.share .fil { height: 100%; background: var(--bar); }
.explain { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 10px; }
details.how { margin-top: 10px; font-size: 13px; color: var(--muted); }
details.card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2::before { content: "\25B8  "; color: var(--muted); font-size: 12px; }
details.card[open] > summary h2::before { content: "\25BE  "; }
.cc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.cc { display: block; color: inherit; text-decoration: none; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 15px 18px; box-shadow: var(--shadow); border-top: 4px solid var(--cc, var(--bar)); min-width: 0; }
.cc:hover { border-color: var(--accent); border-top-color: var(--cc); text-decoration: none; }
.cc h3 { font-size: 15px; } .cc .big { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin: 4px 0; font-variant-numeric: tabular-nums; color: var(--ink); }
.cc .meta { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.cc .meta .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.budget { height: 8px; background: var(--panel-2); border-radius: 4px; margin: 8px 0 4px; position: relative; }
.budget .used { height: 100%; border-radius: 4px; background: var(--cc, var(--bar)); }
.budget .mark { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--ink); }
.months { display: flex; gap: 3px; align-items: flex-end; height: 40px; margin-top: 10px; }
.months i { flex: 1; background: var(--cc, var(--bar)); opacity: .75; border-radius: 2px 2px 0 0; display: block; }
.months i.f { opacity: .3; }
.stack-chart { display: flex; gap: 6px; align-items: stretch; }
.sc-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sc-bar { flex: 1; display: flex; flex-direction: column-reverse; gap: 1px; background: var(--panel-2); border-radius: 4px 4px 0 0; overflow: hidden; }
.sc-bar i { display: block; }
.sc-col.future .sc-bar i { opacity: .35; }
.sc-lbl { font-size: 10.5px; color: var(--muted); text-align: center; margin-top: 4px; }
.timeline { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.tl-col { text-align: center; min-width: 0; font-size: 11.5px; color: var(--muted); }
.tl-bar { height: 46px; display: flex; align-items: flex-end; }
.tl-bar i { display: block; width: 100%; background: var(--panel-2); border-radius: 4px 4px 0 0; min-height: 3px; }
.tl-col.has .tl-bar i { background: var(--bar); }
.tl-m { font-weight: 600; color: var(--ink); margin-top: 4px; }
.tl-v { font-size: 11px; }
.tl-names { font-size: 11px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data tr.group td { background: var(--panel-2); font-weight: 600; color: var(--ink); border-top: 1px solid var(--border-strong); padding: 6px 10px; }
.sw-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.side-search { position: relative; padding: 0 8px 12px; }
.side-search input { background: rgba(255,255,255,.07); color: #fff; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; padding: 7px 10px; font-size: 13px; }
.side-search input::placeholder { color: var(--lm-soft-gray); }
.search-results { position: absolute; left: 8px; right: 8px; top: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 40; max-height: 360px; overflow: auto; }
.search-results a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); font-size: 13px; }
.search-results a .badge { align-self: flex-start; }
.search-results a.active, .search-results a:hover { background: var(--row-hover); }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .two { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .tiles, .tiles.tiles-3, .cc-grid { grid-template-columns: 1fr; }
  .tile .t-value { font-size: 26px; }
  .timeline { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .share { grid-template-columns: 90px 1fr 80px 40px; }
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td, table.data tfoot { display: block; width: 100%; }
  table.data tr { border-bottom: 1px solid var(--border-strong); padding: 6px 0; }
  table.data tr.group td { border: 0; }
  table.data td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 3px 10px; white-space: normal; text-align: left; }
  table.data td.num { text-align: right; }
  table.data td[data-label]:not([data-label=""])::before { content: attr(data-label); color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; flex: 0 0 38%; }
  table.data td.actions { justify-content: flex-end; }
  table.data tfoot td { display: flex; justify-content: space-between; }
  table.data td.truncate { max-width: none; }
}

.table-tools .legend { margin: 0 0 0 auto; }
.card-head > div > h2 { margin-bottom: 2px; }

.att .dot { padding: 0; min-width: 10px; max-width: 10px; }
.att .btn { flex: 0 0 auto; }

/* menu notification badges */
.nav a { position: relative; }
.nav .nbadge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--lm-sunburst); color: #111; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.nav .nbadge.bad { background: #ef4444; color: #fff; }
.nav a.active .nbadge { background: #fff; color: var(--lm-teal-solid); }

/* wizards */
.modal.modal-wide { max-width: 820px; }
.wz-steps { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 20px 6px; }
.wz-step { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--panel-2); }
.wz-step i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: var(--border-strong); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.wz-step.active { color: var(--ink); background: var(--accent-soft); } .wz-step.active i { background: var(--accent-solid); color: #fff; }
.wz-step.done i { background: var(--good-fg); color: #fff; }
.wz-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.wz-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel-2); border-radius: 10px; font-size: 13.5px; }
.wz-sub { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 12px; }
.wz-review .wz-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }

/* ---- Step 4: keyboard and accessibility ---- */
/* Editable cells are visible without hovering: a dotted underline on their text. */
table.data td.editable:not(.editing) { text-decoration: underline dotted color-mix(in srgb, var(--accent) 70%, transparent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
/* Column headers are buttons; the ⓘ next to them opens the formula. */
table.data th { cursor: default; }
table.data th .th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; border-radius: 4px; }
table.data th .th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tip { all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; min-height: 22px; margin-left: 2px; font-size: 11px; color: var(--muted); border-radius: 50%; vertical-align: middle; }
.tip:hover, .tip[aria-expanded="true"] { color: var(--accent); }
.tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tip-pop { position: absolute; z-index: 70; max-width: 300px; background: var(--panel); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12.5px; line-height: 1.4; text-transform: none; letter-spacing: 0; font-weight: 400; }
.sort-note { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.link-btn { all: unset; cursor: pointer; color: var(--accent); text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table.data tr.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Row buttons: the delete ✕ is a 32 px target with room around it. */
table.data td.actions .btn { min-height: 32px; }
table.data td.actions .btn-icon { min-width: 32px; justify-content: center; margin-left: 6px; }
/* Contrast: white on the light-teal dark-mode accent was 3:1; use dark text there. */
[data-theme="dark"] .btn-primary, [data-theme="dark"] .chip.active, [data-theme="dark"] .wz-step.active i { color: #062424; }
.badge.muted { opacity: 1; color: var(--muted); }
/* Screen-reader-only text, and the "skip to content" link that appears on Tab. */
.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; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--panel); color: var(--accent); padding: 8px 12px; border-radius: 8px; border: 2px solid var(--accent); }
.skip-link:focus { top: 8px; }
#page-title:focus { outline: none; }
/* Phones: a slim top bar holds ☰ and the page title, so nothing floats over the content. */
.mobile-bar { display: none; }
@media (max-width: 900px) {
  .mobile-bar { display: flex; align-items: center; gap: 10px; position: fixed; top: 0; left: 0; right: 0; height: 52px; padding: 0 12px; background: var(--bg); border-bottom: 1px solid var(--border); z-index: 29; }
  .mobile-bar .menu-fab { position: static; }
  .mobile-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
}
/* Phone cards: the field name sits in the same cell, so the underline cue would cover it too;
   show the ✎ instead (always, not only on hover). */
@media (max-width: 700px) {
  table.data td.editable:not(.editing) { text-decoration: none; }
  table.data td.editable:not(.editing)::after { content: "✎"; position: static; margin-left: 6px; font-size: 11px; color: var(--accent); }
}

/* ---- Step 6: first use, menus, history, hints ---- */
.getting-started { margin-bottom: 14px; }
.gs { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.gs li { display: flex; gap: 10px; align-items: flex-start; }
.gs li .btn { margin-top: 8px; }
.gs-n { flex: 0 0 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; background: var(--accent-soft); color: var(--ink); }
.gs li.done .gs-n { background: var(--accent-solid); color: #fff; }
[data-theme="dark"] .gs li.done .gs-n { color: #062424; }
.menu-wrap { position: relative; display: inline-block; }
.action-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 45; min-width: 220px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.action-menu[hidden] { display: none; }
.action-menu [role=menuitem] { all: unset; padding: 9px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text); }
.action-menu [role=menuitem]:hover, .action-menu [role=menuitem]:focus-visible { background: var(--panel-2); outline: none; color: var(--ink); }
.near-hint { font-size: 12px; font-weight: 500; color: var(--warn-fg, #92400e); }
.near-hint[hidden] { display: none; }
.mt-xs { margin-top: 6px; gap: 6px; }
.tile .t-sub a { font-weight: 500; }

/* ---- CSV export link and radio-card choices ---- */
.table-meta { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 6px; }
.table-meta .sort-note { margin: 0; }
.table-meta .link-btn { font-size: 12.5px; }
fieldset.choice { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
fieldset.choice legend { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 6px; padding: 0; }
.choice-card { flex-direction: row !important; align-items: flex-start; gap: 10px !important; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; color: var(--text) !important; }
.choice-card:has(input:checked) { border-color: var(--accent); box-shadow: var(--focus-ring); }
.choice-card input { margin-top: 3px; width: auto; flex: 0 0 auto; box-shadow: none; }
.choice-card > span { display: flex; flex-direction: column; gap: 3px; }
label[hidden] { display: none !important; }

/* "Mais opções" in forms: fields people rarely change. */
.more-fields { grid-column: 1 / -1; margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.more-fields > summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 500; }
.more-fields[open] > summary { margin-bottom: 10px; }
/* Month detail (click a month in "Ao longo do ano"). */
.yc-tip-hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.md-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.md-sum div { background: var(--panel-2); border-radius: var(--radius-xs); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.md-sum span { font-size: 12px; color: var(--muted); }
.md-sum b { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.md-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.md-cols h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; }
.md-sec { margin-bottom: 12px; }
.md-h { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border-strong); font-weight: 600; font-size: 13.5px; }
.md-line { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.md-line.sub { padding-left: 14px; color: var(--text); }
.md-l { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.md-note { font-size: 11.5px; color: var(--muted); }
.md-a { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.md-p { display: inline-block; min-width: 38px; margin-left: 6px; font-size: 11.5px; color: var(--muted); font-weight: 400; }
@media (max-width: 700px) { .md-cols { grid-template-columns: 1fr; } .md-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* "Custos por mês": stacked by cost centre; hatched = no date (spread), light = recurring still to come. */
.cm-note { font-size: 13px; color: var(--text); background: var(--panel-2); border-radius: var(--radius-xs); padding: 8px 10px; margin: 0 0 10px; }
.cm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.cm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cm-legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.cm-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.cm-key i.solid { background: var(--muted); }
.cm-key i.hatch { background: repeating-linear-gradient(45deg, var(--muted) 0 2.5px, transparent 2.5px 5px); outline: 1px solid var(--border); }
.cm-key i.light { background: var(--muted); opacity: .35; }
.cm-plot { width: 100%; }
.cm-plot svg { display: block; overflow: visible; font-family: var(--font-ui); }
.cm-seg { transition: opacity .12s; }
.cm-seg.fc { opacity: .4; }
.cm-seg.dim { opacity: .2; }
.cm-sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
@media (prefers-reduced-motion: reduce) { .cm-seg { transition: none; } }

/* Utilizadores: the "invited — send this address" note */
.notice { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.notice .btn { margin-left: 6px; }
