/* Agenten-Dashboard in the crooom look. Project colors are validated for color-vision
   deficiency (dataviz validator, light + dark); they always appear next to a text label. */
@font-face { font-family: "Plus Jakarta Sans"; src: url("fonts/PlusJakartaSans.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/InstrumentSerif.ttf") format("truetype"); font-weight: 400; font-display: swap; }
/* crooom palette (app_colors.dart): Sunset Coral, Terracotta, Sun Gold, Sand, Cream, Ocean Ink, Palm, Night. */
:root {
  --bg: #fff6ec; --card: #ffffff; --card-2: #fffaf4; --ink: #1e3a4c; --ink-2: #3a5060; --muted: #5a7080;
  --line: #eee6dc; --line-2: #f5eee5;
  --brand: #f06a4b; --brand-2: #c44326; --brand-3: #ffb547; --brand-ink: #ffffff; --brand-soft: #ffe9d4; --brand-text: #c44326;
  --violet: #f06a4b; --rose: #d63a3a; --pink: #d98a14; --teal: #2f78b7; --slate: #7e93a1; --amber: #d98a14;
  --ok: #2f7a5a; --ok-soft: #dff2ea; --bad: #c53030; --bad-soft: #fce8e3; --warn: #a3650f; --warn-soft: #fff0d9;
  --run: #2f6fa8; --run-soft: #deeef7;
  --crooom: #e0603f; --novastash: #2f78b7; --bookarizer: #6b8f2a;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --radius: 18px; --radius-s: 12px;
  --shadow: 0 1px 2px rgba(30, 58, 76, .05), 0 8px 24px -12px rgba(30, 58, 76, .14);
  --shadow-lift: 0 2px 4px rgba(30, 58, 76, .06), 0 16px 32px -14px rgba(30, 58, 76, .24);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1a24; --card: #15232e; --card-2: #1a2b37; --ink: #f4eee7; --ink-2: #c9d5dc; --muted: #9fb3bf;
    --line: #243745; --line-2: #1d2f3b;
    --brand: #ffb547; --brand-2: #f06a4b; --brand-3: #ffd28a; --brand-ink: #0d1a24; --brand-soft: #2b2a24; --brand-text: #ffb547;
    --violet: #ffb547; --rose: #ff7a6b; --pink: #ffb547; --teal: #78b4c8; --slate: #8aa0ad;
    --ok: #5cc596; --ok-soft: #13291f; --bad: #ff7a6b; --bad-soft: #351b19; --warn: #ffcf70; --warn-soft: #30260f;
    --run: #8cc3e0; --run-soft: #172d3c;
    --crooom: #e8663f; --novastash: #3a84c4; --bookarizer: #759530;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -18px rgba(0, 0, 0, .6);
    --shadow-lift: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px -18px rgba(0, 0, 0, .7);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg); min-height: 100vh;
  font: 15.5px/1.55 var(--font); }
/* Soft color wash on its own fixed layer: cheaper than background-attachment: fixed on phones. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 0% -10%, color-mix(in srgb, var(--brand) 13%, transparent), transparent 60%),
    radial-gradient(700px 420px at 100% 0%, color-mix(in srgb, var(--brand-3) 16%, transparent), transparent 60%),
    radial-gradient(800px 500px at 50% 110%, color-mix(in srgb, var(--teal) 7%, transparent), transparent 60%); }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 110px; }
body.plain main { padding-top: 6vh; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
h1 { font-family: var(--display); font-size: 2.3rem; font-weight: 400; letter-spacing: 0; line-height: 1.05; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .04em; }
.break { word-break: break-all; }
.grow { flex: 1 1 auto; min-width: 0; }
.text-bad { color: var(--bad); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.flip { transform: rotate(180deg); }

/* ---------- Header and navigation ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, calc((100% - 1120px) / 2 + 16px)); padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--card) 78%, transparent); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--display); font-size: 1.5rem; line-height: 1; }
.brand:hover { text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #fff;
  background: linear-gradient(135deg, #ffb547, #f06a4b 50%, #c44326); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.logo .ic { width: 19px; height: 19px; stroke-width: 3; }
.logo.big { width: 56px; height: 56px; border-radius: 18px; }
.logo.big .ic { width: 30px; height: 30px; }
.top .nav { display: none; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; margin-left: auto; border-radius: 50%;
  font-size: .8rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #1e3a4c, #2f78b7); }
.avatar.active { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.avatar:hover { text-decoration: none; }
.row .avatar, .setting .avatar { margin-left: 0; }
.avatar.big { width: 48px; height: 48px; font-size: 1rem; }

.nav-mobile {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 20;
  display: flex; justify-content: space-around; padding: 6px; border-radius: 22px;
  background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: saturate(1.6) blur(16px);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); box-shadow: var(--shadow-lift);
}
.nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1;
  padding: 7px 4px; border-radius: 16px; color: var(--muted); font-size: .7rem; font-weight: 600; }
.nav a:hover { text-decoration: none; color: var(--ink); }
.nav a.active { color: var(--brand-ink); background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 16px -8px var(--brand); }
.count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--rose); color: #fff; font-size: .68rem; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--card); }
@media (min-width: 900px) {
  .nav-mobile { display: none; }
  .top .nav { display: flex; gap: 4px; margin: 0 auto; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--line-2) 70%, transparent); }
  .top .nav a { flex-direction: row; gap: 7px; padding: 7px 14px; font-size: .9rem; border-radius: 11px; }
  .top .nav .ic { width: 18px; height: 18px; }
  .top .avatar { margin-left: 0; }
  .count { position: static; box-shadow: none; }
  .nav a.active .count { background: var(--brand-ink); color: var(--brand); }
  main { padding-bottom: 48px; }
}

/* ---------- Page heads, sections ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.page-head p { margin: 4px 0 0; }
.head-count { padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem; color: var(--brand-ink); background: linear-gradient(135deg, var(--brand), var(--brand-2)); white-space: nowrap; }
section { margin-top: 26px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-bottom: 12px; }
.section-head h2 { display: flex; align-items: center; gap: 9px; margin: 0; }
.section-head h2 .ic { width: 28px; height: 28px; padding: 5px; border-radius: 9px; color: var(--brand-text); background: var(--brand-soft); }
.more { display: inline-flex; align-items: center; gap: 2px; font-size: .86rem; font-weight: 600; }
.more .ic { width: 16px; height: 16px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .9rem; }
.back .ic { width: 16px; height: 16px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; display: flex; align-items: center; margin-top: 6px; padding: 26px 24px; border-radius: 24px; color: #fff;
  background: linear-gradient(120deg, #1e3a4c 0%, #7a3b3a 38%, #c44326 62%, #f06a4b 82%, #ffb547 112%); box-shadow: 0 20px 40px -24px rgba(196, 67, 38, .7); }
.hero::after { content: ""; position: absolute; inset: auto -60px -120px auto; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 213, 140, .45), transparent 65%); }
.hero-text { position: relative; z-index: 1; flex: 1; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.1rem); margin-bottom: 6px; }
.hero-date { margin: 0 0 6px; font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.hero-status { font-size: 1.02rem; opacity: .95; margin-bottom: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; font-size: .86rem; font-weight: 600;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); }
.hero-chip .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.hero-chip.bad { background: rgba(255, 255, 255, .94); color: #be123c; }
.btn.hero-btn { background: #fff; color: #c44326; border-color: #fff; }
.hero-art { position: relative; z-index: 1; display: none; place-items: center; width: 110px; height: 110px; border-radius: 30px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); }
.hero-art .ic { width: 56px; height: 56px; stroke-width: 1.6; }
@media (min-width: 700px) { .hero { padding: 32px 34px; } .hero-art { display: grid; } }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
@media (min-width: 800px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { --tone: var(--violet); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 1px; padding: 16px;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tone); }
.stat:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.stat.violet { --tone: var(--violet); } .stat.rose { --tone: var(--rose); } .stat.pink { --tone: var(--pink); }
.stat.teal { --tone: var(--teal); } .stat.slate { --tone: var(--slate); }
.stat-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 10px; border-radius: 12px;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, var(--card)); }
/* Numbers stay in the sans font: Instrument Serif's 1 reads like an l. */
.stat-value { font-size: 1.9rem; font-weight: 780; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-label { font-weight: 650; font-size: .9rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: .78rem; color: var(--muted); }

/* ---------- Columns ---------- */
.columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 22px; }
@media (min-width: 900px) { .columns { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); } }

/* ---------- Cards, lists, rows ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 14px; box-shadow: var(--shadow); }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list.flat { box-shadow: none; margin: 6px 0 16px; }
.row { --c: transparent; position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line-2); color: var(--ink); }
.row:hover { text-decoration: none; }
a.row:hover, summary.row:hover { background: var(--card-2); }
.list > .row:first-child, .list > details:first-child, .list > details:first-child > .row { border-top: 0; }
.row.proj::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.row-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; color: var(--brand-text); background: var(--brand-soft); }
.row-icon .ic { width: 19px; height: 19px; }
.row.proj .row-icon { color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.row.alert .row-icon { color: var(--bad); background: var(--bad-soft); }
.row.hint .row-icon { color: var(--warn); background: var(--warn-soft); }
.row.violet .row-icon { color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, var(--card)); }
.row-title { display: block; font-weight: 600; line-height: 1.35; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: .8rem; color: var(--muted); }
.chev { color: var(--muted); width: 18px; height: 18px; }
.row-details > summary { list-style: none; cursor: pointer; }
.row-details > summary::-webkit-details-marker { display: none; }
.row-details { border-top: 1px solid var(--line-2); }
.row-details > .row { border-top: 0; }
.row-body { padding: 0 16px 14px 20px; }
.grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1050px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.grid .card { margin: 0; }

/* ---------- Project identity ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: .76rem; font-weight: 650;
  color: var(--ink-2); background: color-mix(in srgb, var(--c) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); white-space: nowrap; }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* ---------- Status pills and dots (reserved status colors, always with a label) ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 650; white-space: nowrap;
  background: var(--line-2); color: var(--muted); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.run { background: var(--run-soft); color: var(--run); }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--slate); box-shadow: 0 0 0 3px color-mix(in srgb, var(--slate) 18%, transparent); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 20%, transparent); }
.dot.run { background: var(--run); box-shadow: 0 0 0 3px color-mix(in srgb, var(--run) 20%, transparent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- Agent mini list (overview) ---------- */
.agent-mini { padding: 6px 0; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 9px 16px; font-size: .92rem; }
.mini-row + .mini-row { border-top: 1px solid var(--line-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 16px 6px; border-top: 1px solid var(--line-2); font-size: .76rem; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 8px; height: 8px; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 34px 20px; }
.empty-state.small-pad { padding: 26px 18px; }
.empty-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 12px; border-radius: 18px; color: var(--warn); background: var(--warn-soft); }
.empty-icon.ok { color: var(--ok); background: var(--ok-soft); }
.empty-icon .ic { width: 28px; height: 28px; stroke-width: 2.4; }

/* ---------- Week numbers ---------- */
.insights { display: grid; gap: 10px; margin-bottom: 14px; }
@media (min-width: 800px) { .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.insight { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-s); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.insight .ic { color: var(--brand); margin-top: 2px; }
.insight p { margin: 0; font-size: .93rem; color: var(--ink-2); }
.projects { display: grid; gap: 14px; }
@media (min-width: 900px) { .projects { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); align-items: start; } }
.project { margin: 0; padding: 0; overflow: hidden; }
.project > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 14%, var(--card)), var(--card) 70%); border-bottom: 1px solid var(--line-2); }
.project > header .badge { font-size: .9rem; padding: 4px 12px 4px 9px; }
.project h4 { display: flex; align-items: center; gap: 7px; margin: 4px 18px 0; padding-top: 14px; border-top: 1px dashed var(--line); font-size: .9rem; color: var(--ink-2); }
.project h4 .ic { width: 16px; height: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; padding: 14px 18px 18px; }
.kpi { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--card-2); border: 1px solid var(--line-2); }
.kpi-label { font-size: .78rem; color: var(--muted); line-height: 1.3; min-height: 2.05em; }
.kpi-value { font-size: 1.4rem; font-weight: 760; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.kpi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .76rem; }
.delta { padding: 1px 8px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--line-2); color: var(--muted); }
.delta.good { background: var(--ok-soft); color: var(--ok); } .delta.bad { background: var(--bad-soft); color: var(--bad); }
.note { margin-top: 10px; }

/* ---------- Proposals ---------- */
/* overflow: clip (not hidden) keeps rounded corners without trapping the sticky decision bar. */
.proposal { --c: var(--brand); position: relative; padding: 0; overflow: clip; scroll-margin-top: 80px; }
.proposal::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 30%, transparent)); }
.proposal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 18px 20px 0; }
.kind { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.kind .ic { width: 16px; height: 16px; color: var(--c); }
.proposal-title { font-family: var(--display); font-weight: 400; font-size: 1.75rem; line-height: 1.12; margin: 12px 20px 16px; }
.proposal-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 0 20px; overflow-wrap: anywhere; }
@media (min-width: 860px) { .proposal-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); } }
.media-wrap { border-radius: 14px; overflow: hidden; background: #0b0c14; }
.media { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #0b0c14; }
img.media { background: transparent; }
.preview-link { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; color: var(--ink);
  background: color-mix(in srgb, var(--c) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); }
.preview-link:hover { text-decoration: none; border-color: var(--c); }
.preview-link > .ic:first-child { width: 36px; height: 36px; padding: 8px; border-radius: 11px; color: #fff; background: var(--c); }
.preview-link span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.preview-link small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caption { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line-2); }
.caption-label, .label { display: block; margin-bottom: 4px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.caption p { margin: 0; white-space: pre-wrap; }
.outcome { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 14px; border-radius: 14px; background: var(--brand-soft); }
.outcome > .ic { color: var(--brand-text); margin-top: 2px; }
.outcome p { margin: 0; font-weight: 550; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.facts span { padding: 5px 11px; border-radius: 10px; font-size: .85rem; background: var(--card-2); border: 1px solid var(--line-2); }
.why { margin-bottom: 12px; color: var(--ink-2); }
.why p:last-child { margin-bottom: 0; }
details > summary { cursor: pointer; color: var(--brand-text); font-weight: 600; font-size: .9rem; margin: 8px 0; }
.details { padding-left: 18px; font-size: .88rem; overflow-wrap: anywhere; color: var(--ink-2); }
.decide { position: sticky; bottom: 84px; display: flex; gap: 10px; margin-top: 16px; padding: 14px 20px;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line-2); }
@media (min-width: 900px) { .decide { position: static; } }
.decide .btn { flex: 1; min-height: 50px; font-size: 1rem; }
.readonly { padding: 14px 20px; margin: 0; }

/* ---------- Agents page ---------- */
.agent { --st: var(--line); position: relative; overflow: hidden; }
.agent::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--st); }
.agent.st-ok { --st: var(--ok); } .agent.st-bad { --st: var(--bad); } .agent.st-warn { --st: var(--warn); } .agent.st-run { --st: var(--run); }
.agent header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.agent h3 { margin: 0; }
.agent .badges { margin: 0 0 4px; }
.agent-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; color: var(--brand-text); background: var(--brand-soft); }
.agent-facts { display: grid; gap: 6px; margin: 10px 0 0; font-size: .88rem; }
.agent-facts > div { display: flex; gap: 10px; }
.agent-facts dt { display: flex; align-items: center; gap: 6px; flex: none; width: 116px; margin: 0; color: var(--muted); font-size: .84rem; text-transform: none; letter-spacing: 0; }
.agent-facts dt .ic { width: 15px; height: 15px; }
.agent-facts dd { margin: 0; }
.detail { display: block; color: var(--bad); font-size: .82rem; }
.sources { display: grid; gap: 10px; }
@media (min-width: 700px) { .sources { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1050px) { .sources { grid-template-columns: 1fr 1fr 1fr; } }
.source { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--card); border: 1px solid var(--line); }
.source strong { display: block; font-weight: 650; }
.source .muted { display: block; }

/* ---------- Content ---------- */
.pins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .pins { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1050px) { .pins { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.pin { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s ease; }
.pin:hover { transform: translateY(-2px); }
.pin img, .pin .noimg { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: var(--line-2); }
.pill.on-image { position: absolute; top: 10px; left: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.pin figcaption { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; font-size: .85rem; }
.pin-title { font-weight: 650; line-height: 1.3; }
.post-stats { display: flex; flex-direction: column; align-items: flex-end; min-width: 58px; }
.post-stats b { font-variant-numeric: tabular-nums; }
.post-stats small { color: var(--muted); font-size: .72rem; }

/* ---------- Reports ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.chip { --c: var(--brand); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); white-space: nowrap; font-size: .88rem; font-weight: 600; }
.chip:hover { text-decoration: none; border-color: var(--c); }
.chip.active { background: var(--c); border-color: var(--c); color: #fff; }
.chip:not(.p-crooom):not(.p-novastash):not(.p-bookarizer):not(.chip-alarm).active { color: var(--brand-ink); }
.chip.chip-alarm { --c: var(--rose); }
.report { position: relative; overflow: hidden; }
.report > header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.proj-top::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.prose { overflow-wrap: anywhere; color: var(--ink-2); }
.prose h1 { font-size: 1.2rem; } .prose h2 { font-size: 1.05rem; margin-top: 20px; color: var(--ink); } .prose h3 { font-size: 1rem; color: var(--ink); }
.prose ul, .prose ol { padding-left: 20px; }
.prose li { margin-bottom: 5px; }
.prose pre { overflow-x: auto; background: var(--card-2); padding: 10px; border-radius: 10px; }
.prose code { font-family: ui-monospace, Consolas, monospace; font-size: .88em; }
.prose table { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; font-size: .9rem; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: left; }
.prose th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.prose blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }

/* ---------- Settings ---------- */
.setting-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.setting-head h2 { margin: 0 0 2px; }
.setting-head p { margin: 0; }
.setting-icon { --tone: var(--violet); display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, var(--card)); }
.setting-icon.teal { --tone: var(--teal); }
.push-status { padding: 10px 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-2); font-size: .9rem; }
.invite-form { max-width: 520px; }

/* ---------- Buttons and forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 650; cursor: pointer;
  transition: transform .1s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { text-decoration: none; box-shadow: var(--shadow); }
.btn:active { transform: scale(.98); }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { color: var(--brand-ink); border-color: transparent; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 18px -10px var(--brand); }
.btn.approve { color: #fff; border-color: transparent; background: linear-gradient(135deg, #2f7a5a, #3f9a72); box-shadow: 0 10px 22px -12px #2f7a5a; }
.btn.approve .ic { stroke-width: 3; }
.btn.reject { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--card); }
.btn.reject:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: .85rem; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
input, select { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--ink); min-height: 46px; }
input:focus, select:focus { border-color: var(--brand); background: var(--card); }
input.code { font-size: 1.25rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Auth ---------- */
.auth { max-width: 440px; margin: 0 auto; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 18px; text-align: center; }
.auth-brand strong { font-family: var(--display); font-weight: 400; font-size: 2.2rem; line-height: 1; }
.auth-brand span:last-child { color: var(--muted); font-size: .9rem; }
.auth-card { padding: 24px; }
.auth-card h1 { font-size: 1.9rem; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 14px; }
.qr { background: #fff; padding: 12px; border-radius: 14px; width: 224px; margin: 10px 0; border: 1px solid var(--line); }
.qr svg { display: block; width: 200px; height: 200px; }

/* ---------- Notices ---------- */
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; margin: 0 0 14px;
  background: var(--ok-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.notice > .ic { color: var(--ok); margin-top: 1px; }
.notice.error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.notice.error > .ic { color: var(--bad); }
.notice p { margin: 0 0 6px; }

/* Project identity last, so it wins over component defaults such as .chip/.proposal. */
.p-crooom { --c: var(--crooom); } .p-novastash { --c: var(--novastash); } .p-bookarizer { --c: var(--bookarizer); } .p-other { --c: var(--slate); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
