/* Shared dark UI components of the demo platform (/platform) and the sign-up page.
   Dark surfaces come from the --app-* tokens. All colours use CSS variables so one tone class
   (.tone-strong, .tone-good, …) restyles a ring, a pill and a card together. */

.app-theme, .app-body, .modal, .toast {
  color: var(--app-text);
  color-scheme: dark;
}

/* ---- tones --------------------------------------------------------------------------------- */
.tone-strong { --tone: #4be396; }
.tone-good { --tone: #a6e86a; }
.tone-partial { --tone: #f2c14e; }
.tone-weak { --tone: #f59e6b; }
.tone-not_eligible { --tone: #ff8a80; }

/* ---- buttons, icon buttons ------------------------------------------------------------------ */
.btn-dark {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--app-line-strong);
  background: var(--app-surface-3); color: var(--app-text); font-weight: 600; font-size: 0.875rem; text-decoration: none; white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.btn-dark:hover { border-color: rgba(75, 227, 150, 0.55); background: #1b302d; }
.btn-dark.btn-sm { min-height: 34px; padding: 0 13px; font-size: 0.8rem; }
.btn-dark .ico { width: 16px; height: 16px; }
.btn-dark.save[aria-pressed="true"] { border-color: rgba(75, 227, 150, 0.6); color: var(--app-accent); background: rgba(75, 227, 150, 0.1); }
.btn-dark.save[aria-pressed="true"] .ico { fill: currentColor; }
.btn-dark:disabled, .btn-accent:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-more { margin-top: 8px; }
.app-theme .btn-accent, .app-body .btn-accent, .modal .btn-accent { min-height: 40px; padding: 0 18px; font-size: 0.85rem; box-shadow: none; }
.app-body .btn-accent.btn-sm, .modal .btn-accent.btn-sm { min-height: 34px; padding: 0 14px; font-size: 0.8rem; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none;
  border: 1px solid var(--app-line); background: var(--app-surface-2); color: var(--app-muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--app-text); border-color: var(--app-line-strong); }
.icon-btn .ico { width: 18px; height: 18px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--app-muted); font-size: 0.8rem; padding: 6px 2px; }
.link-btn:hover { color: var(--app-danger); }

/* ---- tiles, monograms, pills, status, badges ---------------------------------------------------- */
.tile, .mono {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; font-weight: 800; letter-spacing: -0.02em;
}
.tile { color: #bff9db; background: linear-gradient(135deg, #14412e, #0d2a22); border: 1px solid rgba(75, 227, 150, 0.28); }
.tile .ico { width: 22px; height: 22px; }
.mono { color: #0a3a28; background: linear-gradient(180deg, #ffffff, #dff3ea); font-size: 0.95rem; }
.mono-sm { width: 28px; height: 28px; border-radius: 8px; font-size: 0.7rem; display: inline-grid; margin-right: 8px; vertical-align: middle; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent;
  font-size: 0.72rem; font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.pill-seeking { color: #4be396; background: rgba(75, 227, 150, 0.12); border-color: rgba(75, 227, 150, 0.35); }
.pill-bids { color: #5fe3d4; background: rgba(95, 227, 212, 0.1); border-color: rgba(95, 227, 212, 0.32); }
.pill-search { color: #b9ee74; background: rgba(185, 238, 116, 0.1); border-color: rgba(185, 238, 116, 0.32); }
.pill-muted { color: var(--app-muted); background: rgba(255, 255, 255, 0.05); border-color: var(--app-line); }

.status {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 650; text-align: center; line-height: 1.5;
  color: var(--tone, var(--app-muted)); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
}
@supports (color: color-mix(in srgb, red, blue)) {
  .status { background: color-mix(in srgb, var(--tone) 13%, transparent); border-color: color-mix(in srgb, var(--tone) 38%, transparent); }
}
.conf { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 600; }
.conf-ok { color: #4be396; }
.conf-warn { color: var(--app-warn); }
.conf-muted { color: var(--app-muted); }
.badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: auto; border-radius: 999px;
  background: var(--app-accent); color: #03100a; font-size: 0.72rem; font-weight: 800;
}
.verified { display: inline-flex; color: #4be396; }
.muted { color: var(--app-muted); }
.lead { font-size: 1rem; color: var(--app-text); line-height: 1.5; }
.fineprint { font-size: 0.75rem; color: var(--app-faint); line-height: 1.5; }

/* ---- chips ------------------------------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; line-height: 1.5;
  color: var(--app-muted); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--app-line);
}
.chip small { font-size: 0.68rem; opacity: 0.8; }
.chip-more { color: var(--app-faint); }
.chip-cert-verified { color: #7df4ba; border-color: rgba(75, 227, 150, 0.4); background: rgba(75, 227, 150, 0.08); }
.chip-cert-declared { color: var(--app-muted); border-style: dashed; border-color: var(--app-line-strong); }
.chip-cert-missing { color: var(--app-danger); border-color: rgba(255, 138, 128, 0.45); background: rgba(255, 138, 128, 0.08); }

/* ---- score ring -------------------------------------------------------------------------------- */
.ring { position: relative; display: inline-grid; place-items: center; width: 52px; height: 52px; flex: none; }
.ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-track { stroke: rgba(255, 255, 255, 0.09); }
.ring-value { stroke: var(--tone, #4be396); }
.ring b { position: relative; font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em; }
/* Not eligible: no score, a dashed ring and a dash (matching.mjs) */
.ring.is-empty .ring-track { stroke: var(--tone, rgba(255, 255, 255, 0.2)); stroke-dasharray: 3 3; opacity: 0.6; }
.ring.is-empty b { color: var(--tone, inherit); }
.ring-sm { width: 38px; height: 38px; }
.ring-sm b { font-size: 0.76rem; }
.ring-lg { width: 88px; height: 88px; }
.ring-lg b { font-size: 1.6rem; font-family: var(--font-display); font-weight: 800; }

/* ---- cards (projects & companies) -------------------------------------------------------------- */
.card-list { display: grid; gap: 12px; }
.card {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px 16px; align-items: start; padding: 16px;
  background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 16px; transition: border-color 0.15s, background 0.15s;
}
.card:hover { border-color: var(--app-line-strong); background: var(--app-surface-2); }
.card-main { min-width: 0; display: grid; gap: 4px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; }
.card-title a { color: var(--app-text); text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card .meta, .meta { font-size: 0.82rem; color: var(--app-muted); }
.card .headline { font-size: 0.85rem; color: var(--app-text); opacity: 0.85; }
.card .facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8rem; color: var(--app-muted); }
.card .facts span { display: inline-flex; align-items: center; gap: 5px; }
.card .chips { margin-top: 4px; }
.card-score { position: relative; z-index: 2; display: grid; justify-items: center; align-content: start; gap: 6px; min-width: 104px; text-align: center; }
.flag { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; font-size: 0.8rem; line-height: 1.4; }
.flag .ico { margin-top: 2px; }
.flag-block { color: var(--app-danger); }
.flag-warn { color: var(--app-warn); }
.card.tone-not_eligible { border-color: rgba(255, 138, 128, 0.22); }
.card.is-compact { padding: 12px; gap: 12px; background: var(--app-surface-2); }
.card.is-compact .tile, .card.is-compact .mono { width: 38px; height: 38px; }
.card.is-compact .card-title { font-size: 0.95rem; }
.card.is-compact .card-score { min-width: 78px; }
.card.is-unscored .card-score { align-content: center; min-width: 88px; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--app-muted); cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: #4be396; cursor: pointer; }
.check:hover { color: var(--app-text); }
.check-box { min-height: 40px; padding: 0 12px; border: 1px solid var(--app-line); border-radius: 10px; background: var(--app-surface-2); }

@media (max-width: 560px) {
  .card { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .card-score { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 10px 12px; min-width: 0; padding-top: 12px; border-top: 1px solid var(--app-line); text-align: left; }
  .card-score .ring { width: 44px; height: 44px; }
  .card-score .check { margin-left: auto; }
  .card.is-compact { grid-template-columns: auto minmax(0, 1fr); }
}

/* ---- score breakdown & reasons --------------------------------------------------------------- */
.breakdown { display: grid; gap: 10px; }
.breakdown li { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 1.4fr) 44px; gap: 12px; align-items: center; font-size: 0.85rem; }
.b-label small { margin-left: 6px; color: var(--app-faint); font-size: 0.72rem; }
.b-bar { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.b-bar i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, #1f8f5c, #4be396); }
.breakdown b { text-align: right; font-weight: 650; }
.breakdown .is-na { opacity: 0.5; }
.breakdown .is-na .b-bar i { background: none; }
.reasons { display: grid; gap: 8px; }
.reasons li { display: flex; gap: 9px; align-items: flex-start; font-size: 0.86rem; line-height: 1.45; }
.reasons .ico { margin-top: 2px; }
.r-block { color: var(--app-danger); }
.r-warn { color: var(--app-warn); }
.r-ok { color: #8fe9b8; }

.match-panel { display: grid; gap: 16px; padding: 18px; border-radius: 16px; background: var(--app-surface-2); border: 1px solid var(--app-line); }
.match-top { display: flex; gap: 16px; align-items: center; }
.match-top h3 { font-size: 0.95rem; font-weight: 650; margin-bottom: 4px; }
.match-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 6px; }
.match-explain { font-size: 0.88rem; color: var(--app-muted); line-height: 1.45; }

/* ---- comparison table -------------------------------------------------------------------------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--app-line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.compare-table { width: 100%; min-width: 580px; border-collapse: collapse; font-size: 0.82rem; }
.compare-table th, .compare-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--app-line); line-height: 1.4; }
.compare-table thead th { background: var(--app-surface-3); font-weight: 650; white-space: nowrap; }
.compare-table tbody th { width: 150px; color: var(--app-muted); font-weight: 600; background: var(--app-surface); }
.compare-table tbody tr:last-child > * { border-bottom: 0; }
.compare-table thead th:first-child, .compare-table tbody th { position: sticky; left: 0; z-index: 1; }

/* ---- detail dialogs ---------------------------------------------------------------------------- */
dialog.modal {
  padding: 0; border: 1px solid var(--app-line-strong); border-radius: 20px; background: #0c1817; width: min(760px, calc(100% - 24px));
  max-height: min(90dvh, 920px); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6); overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in 0.2s ease-out; }
dialog.modal.modal-xl { width: min(1040px, calc(100% - 24px)); }
dialog.modal::backdrop { background: rgba(2, 8, 6, 0.74); backdrop-filter: blur(5px); }
body:has(dialog.modal[open]) { overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--app-line); }
.modal-head h2 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; }
.modal-sub { margin-top: 4px; font-size: 0.85rem; color: var(--app-muted); }
.modal-body { padding: 18px 22px 22px; overflow-y: auto; display: grid; gap: 20px; align-content: start; overscroll-behavior: contain; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--app-line); background: #0a1514; }
.modal-foot .check { margin-right: auto; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }

.detail-sec { display: grid; gap: 10px; }
.detail-sec h3 { font-size: 0.9rem; font-weight: 650; letter-spacing: -0.005em; }
.detail-sec h4 { font-size: 0.78rem; font-weight: 600; color: var(--app-muted); margin-top: 6px; }
.facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--app-surface); border: 1px solid var(--app-line); }
.facts-grid dt { font-size: 0.72rem; color: var(--app-faint); }
.facts-grid dd { margin: 2px 0 0; font-size: 0.9rem; font-weight: 550; overflow-wrap: anywhere; }
.need-list { display: grid; gap: 6px; }
.need-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 9px 12px; border-radius: 10px; background: var(--app-surface); border: 1px solid var(--app-line); font-size: 0.88rem; }
.need-list b { font-weight: 600; color: var(--app-muted); }
.need-list small { margin-left: auto; color: var(--app-faint); }
.bullets { display: grid; gap: 7px; }
.bullets li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 0.88rem; }
.bullets .ico { color: var(--app-accent); align-self: center; }
.bullets small { color: var(--app-faint); }
.mini-list { display: grid; gap: 8px; }
.mini-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--app-surface); border: 1px solid var(--app-line); }
.mini-list a { color: var(--app-text); font-weight: 600; text-decoration: none; font-size: 0.9rem; }
.mini-list a:hover { color: var(--app-accent); }
.mini-list small { grid-column: 2 / -1; color: var(--app-muted); font-size: 0.78rem; }
.mini-fit li { grid-template-columns: auto minmax(0, 1fr) auto; }

@media (max-width: 640px) {
  dialog.modal { width: 100%; max-width: none; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 94dvh; }
  .modal-head { padding: 16px 16px 12px; }
  .modal-head h2 { font-size: 1.15rem; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); justify-content: stretch; }
  .modal-foot > * { flex: 1 1 auto; }
  .facts-grid { grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 12px; }
  .breakdown li { grid-template-columns: minmax(90px, 1fr) minmax(0, 1fr) 40px; gap: 8px; }
  .match-top { flex-direction: column; align-items: flex-start; }
}

/* ---- toasts ---------------------------------------------------------------------------------------- */
.toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 300; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast {
  padding: 11px 16px; border-radius: 12px; font-size: 0.88rem; line-height: 1.4; background: #10211e; border: 1px solid var(--app-line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); animation: toast-in 0.2s ease-out;
}
.toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 1023px) { .app-body .toasts { bottom: calc(92px + env(safe-area-inset-bottom)); } }

/* ============================ DASHBOARD ============================================================ */
.dash { container-type: inline-size; container-name: dash; display: grid; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 46%); grid-template-areas: "ico ." "label label" "value spark" "note note"; align-items: end;
  padding: 14px 16px 12px; border-radius: 14px; border: 1px solid var(--app-line);
  background: linear-gradient(180deg, rgba(31, 184, 106, 0.07), transparent 65%), var(--app-surface);
}
.kpi-ico { grid-area: ico; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #7df4ba; background: rgba(75, 227, 150, 0.12); border: 1px solid rgba(75, 227, 150, 0.25); margin-bottom: 10px; }
.kpi-label { grid-area: label; font-size: 0.8rem; color: var(--app-muted); }
.kpi-value { grid-area: value; font-family: var(--font-display); font-weight: 800; font-size: 1.85rem; letter-spacing: -0.035em; line-height: 1.15; }
.kpi .spark { grid-area: spark; width: 100%; height: 36px; overflow: visible; }
.kpi-note { grid-area: note; display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.74rem; color: #6fe3a6; line-height: 1.3; }
.kpi-note .ico { width: 13px; height: 13px; flex: none; }
@container dash (max-width: 1040px) { .kpi-value { font-size: 1.62rem; } }
@container dash (max-width: 880px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-value { font-size: 1.85rem; } }
/* Narrow screens: two cards per row, so the sparkline moves up next to the icon. */
@container dash (max-width: 460px) {
  .kpi { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ico spark" "label label" "value value" "note note"; align-items: center; padding: 12px; }
  .kpi-ico { margin-bottom: 8px; }
  .kpi .spark { height: 30px; margin: 0 0 8px 10px; }
  .kpi-value { font-size: 1.55rem; }
}

.dash-row { display: grid; gap: 14px; }
.row-a { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.row-b { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@container dash (max-width: 800px) { .row-a, .row-b { grid-template-columns: minmax(0, 1fr); } }

.panel { display: flex; flex-direction: column; padding: 16px 18px 18px; border-radius: 16px; background: var(--app-surface); border: 1px solid var(--app-line); min-width: 0; }
.panel-head { flex: none; }
.panel-sectors .donut { flex: 1 1 auto; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }
.panel-sub { margin-top: 2px; font-size: 0.76rem; color: var(--app-faint); }
.panel-note { margin-top: 10px; font-size: 0.74rem; color: var(--app-faint); }
.view-all { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76rem; color: var(--app-muted); text-decoration: none; white-space: nowrap; }
a.view-all:hover { color: var(--app-accent); }

/* bar chart */
.bars { --plot-h: 196px; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: var(--plot-h) auto; column-gap: 12px; }
.bars-y { position: relative; min-width: 28px; font-size: 0.72rem; color: var(--app-faint); }
.bars-y span { position: absolute; right: 0; bottom: calc(var(--p, 0) * 100%); transform: translateY(50%); line-height: 1; }
.bars-grid { position: absolute; inset: 0; pointer-events: none; }
.bars-grid i { position: absolute; left: 0; right: 0; bottom: calc(var(--p, 0) * 100%); border-top: 1px solid rgba(255, 255, 255, 0.06); }
.bars-plot { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: clamp(6px, 3.2%, 24px); padding: 0 6px; }
.bar-col { position: relative; z-index: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 8px; }
.bar-fill { display: block; width: min(100%, 46px); height: var(--h); border-radius: 9px 9px 3px 3px; background: linear-gradient(180deg, #4be396 0%, #25996a 55%, #166045 100%); transform-origin: bottom; transition: filter 0.15s; }
.bar-col.is-empty .bar-fill { background: rgba(255, 255, 255, 0.1); }
.bar-col:hover .bar-fill, .bar-col:focus-visible .bar-fill, .bar-col.is-top .bar-fill { filter: brightness(1.18); }
.bar-tip {
  position: absolute; left: 50%; bottom: calc(var(--h) + 8px); transform: translateX(-50%); z-index: 2; padding: 3px 9px; border-radius: 8px; white-space: nowrap;
  font-size: 0.72rem; font-weight: 650; background: #0a1514; border: 1px solid var(--app-line-strong); opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.bar-col.is-top .bar-tip, .bar-col:hover .bar-tip, .bar-col:focus-visible .bar-tip { opacity: 1; }
.bars-plot:hover .bar-col.is-top:not(:hover) .bar-tip { opacity: 0; }
.bars-x { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: clamp(6px, 3.2%, 24px); padding: 8px 6px 0; text-align: center; font-size: 0.72rem; color: var(--app-faint); }
.dash:not(.is-in) .bar-fill { transform: scaleY(0); }
.dash.is-in .bar-fill { animation: bar-grow 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@container dash (max-width: 520px) { .bars { --plot-h: 160px; } }

/* donut */
.donut { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: center; gap: 20px; }
.donut-ring { position: relative; width: 152px; aspect-ratio: 1; }
.donut-svg { width: 100%; height: 100%; }
.donut-centre { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-centre b { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.donut-centre span { font-size: 0.74rem; color: var(--app-muted); }
@container dash (min-width: 900px) { .donut { gap: 28px; } .donut-ring { width: 176px; } .donut-legend { gap: 12px; } }
.donut-legend { display: grid; gap: 9px; }
.donut-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 0.85rem; }
.donut-legend .dot { width: 9px; height: 9px; border-radius: 50%; }
.donut-legend .lbl { color: var(--app-muted); }
.donut-legend b { font-weight: 650; }
.dash.is-in .donut-svg { animation: donut-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes donut-in { from { opacity: 0; transform: rotate(-70deg) scale(0.92); } }
@container dash (max-width: 420px) { .donut { grid-template-columns: 1fr; justify-items: center; } .donut-legend { width: 100%; } }

/* sparkline */
.spark-line { stroke-dasharray: 160; stroke-dashoffset: 0; }
.dash.is-in .spark-line { animation: spark-draw 1.1s ease-out both; }
@keyframes spark-draw { from { stroke-dashoffset: 160; } }

/* rows (recent projects, partner matches) */
.rows { display: grid; gap: 2px; }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 8px; border-radius: 12px; color: inherit; text-decoration: none; }
a.row:hover { background: var(--app-surface-2); }
.row-main { min-width: 0; }
.row-title { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 0.78rem; color: var(--app-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { display: grid; justify-items: end; gap: 4px; }
.row-when { font-size: 0.74rem; color: var(--app-faint); }
.match-row { grid-template-columns: auto minmax(0, 1fr) minmax(70px, 108px) auto; }
.row-score { display: grid; gap: 5px; }
.row-score b { font-size: 0.78rem; font-weight: 650; color: var(--tone, #4be396); }
.meter { display: block; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, #25996a, #4be396); }
@container dash (max-width: 520px) {
  /* The whole row is a link, so the "View" button can go and the name gets the room. */
  .match-row { grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; }
  .match-row .row-score { grid-column: 2; }
  .match-row .btn-dark { display: none; }
  .project-row { grid-template-columns: auto minmax(0, 1fr); }
  .project-row .row-end { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; }
}
.picker { display: flex; align-items: center; gap: 8px; margin: -4px 0 10px; font-size: 0.78rem; color: var(--app-faint); }
.select-sm {
  min-width: 0; flex: 1; min-height: 34px; padding: 0 10px; border-radius: 9px; font-size: 0.8rem;
  background: var(--app-surface-2); color: var(--app-text); border: 1px solid var(--app-line-strong);
}
