:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-alt: #edf1ed;
  --text: #14211a;
  --muted: #5d6d64;
  --line: #dce3dd;
  --brand: #14532d;
  --brand-soft: #dcfce7;
  --accent: #ca8a04;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --shadow: 0 12px 32px rgb(20 33 26 / 8%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); line-height: 1.5; }
button, input, select { font: inherit; }
.hero {
  display: flex; align-items: end; justify-content: space-between; gap: 2rem;
  padding: 3.5rem max(1.25rem, calc((100vw - 1200px) / 2));
  color: white; background: linear-gradient(135deg, #0d2d1b, #166534);
}
.hero h1 { margin: .2rem 0 .5rem; font-size: clamp(2.1rem, 6vw, 4rem); line-height: 1; letter-spacing: -.04em; }
.hero p { max-width: 700px; margin-bottom: 0; color: #d8ede0; }
.eyebrow { margin: 0; font-size: .72rem; font-weight: 800; letter-spacing: .16em; color: var(--brand); }
.hero .eyebrow { color: #86efac; }
.freshness { display: flex; align-items: center; gap: .75rem; min-width: 190px; }
.freshness strong, .freshness time { display: block; }
.freshness time { color: #bbd5c3; font-size: .85rem; }
.dot { width: .75rem; height: .75rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px rgb(202 138 4 / 20%); }
.dot.online { background: #4ade80; box-shadow: 0 0 0 6px rgb(74 222 128 / 20%); }
.dot.offline { background: #f87171; box-shadow: 0 0 0 6px rgb(248 113 113 / 20%); }
main { width: min(1200px, calc(100% - 2rem)); margin: -1.5rem auto 3rem; position: relative; }
.panel, .metric { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.panel { padding: 1.35rem; margin-bottom: 1rem; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.metric { padding: 1.2rem; }
.metric strong { display: block; font-size: 1.8rem; line-height: 1.2; }
.metric span { color: var(--muted); font-size: .85rem; }
.progress { height: 8px; margin-top: .85rem; overflow: hidden; background: var(--surface-alt); border-radius: 99px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.controls { display: grid; grid-template-columns: 2fr repeat(3, 1fr) auto; align-items: end; gap: .8rem; }
label { color: var(--muted); font-size: .78rem; font-weight: 700; }
input, select, button { width: 100%; min-height: 44px; margin-top: .3rem; border: 1px solid var(--line); border-radius: 10px; padding: .65rem .75rem; color: var(--text); background: var(--surface); }
button { width: auto; cursor: pointer; font-weight: 700; background: var(--surface-alt); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; }
h2, h3 { margin: .15rem 0 0; }
.phase { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.phase:first-child { border-top: 0; padding-top: 0; }
.phase-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 260px); gap: 1rem; align-items: center; }
.phase-title { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.phase-title h3 { font-size: 1rem; }
.task-list { display: grid; gap: .7rem; margin-top: .9rem; }
.task { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; background: #fcfdfc; }
.task summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; cursor: pointer; list-style: none; }
.task summary::-webkit-details-marker { display: none; }
.task-meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .45rem; }
.badge { display: inline-flex; padding: .2rem .48rem; border-radius: 99px; font-size: .72rem; font-weight: 800; color: var(--muted); background: var(--surface-alt); }
.badge.done { color: #166534; background: #dcfce7; }
.badge.in_progress, .badge.review { color: #854d0e; background: #fef9c3; }
.badge.blocked, .badge.critical { color: #991b1b; background: #fee2e2; }
.task-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; border-top: 1px solid var(--line); margin-top: .85rem; padding-top: .85rem; }
.task-body h4 { margin: 0 0 .3rem; font-size: .8rem; }
.task-body ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: .86rem; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.three-column { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.status-panel h2 { margin-bottom: 1rem; }
.status-list { margin: 0; }
.status-list div { display: flex; justify-content: space-between; gap: 1rem; padding: .42rem 0; border-bottom: 1px solid var(--line); }
.status-list div:last-child { border-bottom: 0; }
.status-list dt { color: var(--muted); font-size: .82rem; }
.status-list dd { margin: 0; text-align: right; font-size: .84rem; font-weight: 750; }
.warning { margin: .8rem 0 0; padding: .65rem; border-radius: 8px; color: #854d0e; background: #fef3c7; font-weight: 800; font-size: .82rem; }
.timeline { display: grid; gap: .65rem; }
.timeline article { display: grid; grid-template-columns: 155px 1fr auto; gap: .8rem; padding: .85rem; border-left: 3px solid var(--brand); background: var(--surface-alt); border-radius: 0 10px 10px 0; }
.timeline time, .timeline small { color: var(--muted); font-size: .78rem; }
.timeline p { margin: .2rem 0 0; }
.stack { display: grid; gap: .7rem; }
.card { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
.card p { margin: .4rem 0 0; color: var(--muted); font-size: .88rem; }
.decision-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.error-banner { padding: .8rem max(1rem, calc((100vw - 1200px) / 2)); color: #7f1d1d; background: var(--danger-soft); font-weight: 700; }
.muted, .empty { color: var(--muted); }
footer { padding: 1rem; text-align: center; color: var(--muted); font-size: .82rem; }

@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .controls { grid-template-columns: 1fr 1fr; }
  .controls label:first-child { grid-column: 1 / -1; }
  .two-column, .three-column, .decision-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .hero { align-items: start; flex-direction: column; padding-top: 2.5rem; padding-bottom: 3rem; }
  main { width: min(100% - 1rem, 1200px); }
  .metric-grid, .controls, .phase-head, .task-body { grid-template-columns: 1fr; }
  .task summary { grid-template-columns: 1fr; gap: .3rem; }
  .panel { padding: 1rem; border-radius: 12px; }
  .timeline article { grid-template-columns: 1fr; }
}

@media (prefers-color-scheme: dark) {
  :root { --bg:#0c120f; --surface:#141c17; --surface-alt:#202a23; --text:#edf7f0; --muted:#a4b6aa; --line:#2c3930; --brand-soft:#153923; --shadow:none; }
  .task { background:#101713; }
}
