:root {
  color-scheme: light;
  --ink: #182f2d;
  --muted: #556862;
  --dark: #172c2a;
  --surface: #f5f7f3;
  --paper: #fff;
  --line: #dce5df;
  --accent: #11604e;
  --accent-hover: #0a4639;
  --mint: #e3f4e9;
  --warm: #fff1da;
  --red: #943821;
  --radius: 14px;
  font-family: 'Aptos', 'Segoe UI', system-ui, sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--surface); font-size: 1rem; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #3c8b73; outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .65; }
h1, h2, h3, p { margin: 0; }
h1 { letter-spacing: -.046em; line-height: 1.06; font-size: clamp(2rem, 3.5vw, 3.15rem); }
h2 { font-size: 1.25rem; line-height: 1.2; letter-spacing: -.022em; }
h3 { font-size: 1rem; line-height: 1.35; }
small { font-size: .875rem; }
.muted, .card-heading p, .page-heading p { color: var(--muted); }
.wrap, .acceptance { white-space: pre-wrap; overflow-wrap: anywhere; }
.skip { position: absolute; top: 8px; left: 8px; background: white; padding: 8px; z-index: 10; transform: translateY(-200%); }
.skip:focus { transform: translateY(0); }
.boot { padding: 2rem; color: var(--muted); }
.app-shell { min-height: 100svh; display: grid; grid-template-columns: 226px minmax(0,1fr); }
.app-sidebar { background: var(--dark); color: #eff8f1; display: flex; flex-direction: column; padding: 25px 16px 20px; position: sticky; top: 0; height: 100svh; }
.brand, .gate-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 760; line-height: 1.15; }
.brand { margin: 0 5px 34px; }
.brand-mark { align-items: center; border-radius: 11px; display: inline-flex; width: 42px; height: 42px; justify-content: center; flex: 0 0 42px; color: #153f33; background: #c9ecd9; font-size: 1.35rem; font-weight: 850; }
.app-sidebar nav { display: grid; gap: 6px; }
.app-sidebar nav a { padding: 11px 13px; border-radius: 9px; text-decoration: none; color: #d5e5dc; font-size: .94rem; }
.app-sidebar nav a:hover, .app-sidebar nav a[aria-current] { background: #2b4742; color: #fff; }
.app-sidebar nav a[aria-current] { box-shadow: inset 3px 0 #a4d9b8; font-weight: 700; }
.account { margin-top: auto; padding-top: 16px; border-top: 1px solid #3c524d; }
.account-info { display: flex; align-items: center; gap: 9px; padding: 5px 3px 10px; }
.account-info div { min-width: 0; }
.account-info b { display: block; overflow-wrap: anywhere; font-size: .92rem; }
.account-info small { display: block; color: #bed0c6; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; color: #f6fff9; background: #396355; font-size: .8rem; font-weight: 750; }
.content { width: 100%; max-width: 1550px; padding: 36px clamp(20px,4vw,56px) 58px; min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 26px; }
.page-heading p { margin-top: 8px; }
.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; text-decoration: none; font-size: .9rem; line-height: 1.3; font-weight: 700; white-space: nowrap; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.secondary { background: #fff; border-color: #ccd9d1; color: var(--ink); }
.btn.secondary:hover { background: #f0f6f0; }
.btn.quiet { background: none; color: #e2eee7; border-color: #3d5751; }
.btn.quiet:hover { background: #2b4742; }
.filters { background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: 13px; display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 10px 14px; margin-bottom: 20px; }
.filters .field { margin: 0; }
.filters input, .filters select { min-height: 40px; }
.period-label { display: flex; gap: 12px; align-items: baseline; color: var(--ink); margin: 0 0 10px; font-weight: 720; }
.period-label span { color: var(--muted); font-weight: 500; font-size: .85rem; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.metric { min-width: 0; min-height: 132px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.metric > span { font-size: .92rem; font-weight: 700; }
.metric strong { font-size: clamp(1.65rem,3.1vw,2.6rem); line-height: 1.16; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); }
.metric.teal { background: var(--mint); border-color: #d4eadd; }
.metric.warm { background: var(--warm); border-color: #f2deba; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(228px, 1fr); gap: 16px; align-items: start; }
.card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: clip; margin-bottom: 16px; }
.card-heading { padding: 20px 21px 16px; }
.card-heading p { font-size: .89rem; margin-top: 4px; }
.empty { padding: 24px 21px; border-top: 1px solid #ecf0eb; background: #fafbf9; min-height: 94px; }
.empty p { color: var(--muted); margin: 4px 0 0; }
.empty .btn { margin-top: 14px; }
.day-row { display: flex; justify-content: space-between; align-items: baseline; gap: 9px; padding: 11px 20px; border-top: 1px solid #edf0eb; font-size: .89rem; }
.day-row > div:last-child { text-align: right; }
.day-row small { display: block; color: var(--muted); font-size: .81rem; }
.target-row { display: grid; grid-template-columns: minmax(175px,1fr) minmax(74px,.35fr) auto; gap: 13px; padding: 16px 20px; border-top: 1px solid #ecf0eb; align-items: center; }
.target-row h3 { overflow-wrap: anywhere; }
.target-row p { font-size: .875rem; }
.target-row .acceptance { margin-top: 5px; color: #40554e; }
.target-progress { display: grid; gap: 1px; justify-items: start; }
.target-progress small { color: var(--muted); font-size: .8rem; }
progress { width: 100%; height: 6px; margin-top: 4px; appearance: none; border: 0; border-radius: 8px; background: #e8eee8; }
progress::-webkit-progress-bar { border-radius: 8px; background: #e8eee8; }
progress::-webkit-progress-value { border-radius: 8px; background: var(--accent); }
progress::-moz-progress-bar { border-radius: 8px; background: var(--accent); }
.target-side { display: grid; gap: 5px; justify-items: end; font-size: .85rem; }
.badge { display: inline-block; max-width: 100%; border-radius: 99px; padding: 3px 8px; background: #eff3ee; color: #3c554c; font-size: .79rem; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.badge.good { background: #e0f2e8; color: #1b6148; }
.badge.waiting { background: #fff0d3; color: #78541a; }
.badge.alert { background: #fae8df; color: #8d3525; }
.submission-row { display: flex; width: 100%; text-align: left; background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid #ecf0eb; padding: 15px 20px; justify-content: space-between; align-items: center; gap: 12px; }
.submission-row:hover { background: #f2f7f2; }
.submission-row strong { display: block; overflow-wrap: anywhere; }
.submission-row small { color: var(--muted); display: block; }
.row-right { flex: 0 0 auto; display: grid; gap: 4px; justify-items: end; }
.pagination { display: flex; justify-content: space-between; padding: 12px 20px; }
.sprint-head { padding: 18px 20px; }
.sprint-context, .sprint-title, .setting-head, .setting-row, .modal-header { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.sprint-context { justify-content: flex-start; color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.sprint-title p { margin-top: 4px; }
.sprint-head .acceptance { margin-top: 10px; }
.actions, .form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-layout { display: grid; grid-template-columns: minmax(0,2.45fr) minmax(220px,1fr); gap: 16px; align-items: start; }
.form-card, .sidebar-card, .error-panel { padding: 21px; }
.form-card .card-heading, .sidebar-card .card-heading { padding: 0 0 14px; }
.sidebar-card p { color: var(--muted); margin: 6px 0 12px; }
.field { display: grid; gap: 5px; margin: 0 0 14px; min-width: 0; color: var(--ink); }
.field > span { font-weight: 700; font-size: .91rem; }
.field > small { color: var(--muted); }
input, select, textarea { color: var(--ink); border: 1px solid #c8d6ce; background: #fff; border-radius: 8px; min-height: 43px; width: 100%; padding: 8px 10px; min-width: 0; }
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, #557267 50%), linear-gradient(135deg, #557267 50%, transparent 50%); background-position: calc(100% - 17px) 54%, calc(100% - 12px) 54%; background-size: 5px 5px; background-repeat: no-repeat; }
select:disabled, input[readonly] { background-color: #eef3ee; opacity: 1; }
textarea { min-height: 82px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; }
.form-section { padding-top: 15px; margin: 14px 0 18px; border-top: 1px solid var(--line); }
.evidence-input { display: flex; gap: 8px; align-items: flex-start; }
.evidence-input .field { flex: 1; }
.evidence-input .btn { margin-top: 26px; }
.form-actions { margin-top: 18px; }
.form-error { color: var(--red); font-weight: 650; margin: 9px 0; }
.notice { background: var(--warm); border: 1px solid #f0dcb8; padding: 11px 12px; border-radius: 8px; margin-bottom: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.settings-card { max-width: 820px; }
.setting-head { padding-right: 20px; }
.setting-row { padding: 14px 20px; border-top: 1px solid #ecf0eb; }
.setting-row p { font-size: .9rem; }
.gate { min-height: 100svh; display: grid; place-content: center; padding: 20px; }
.gate-brand { margin-bottom: 14px; }
.gate-card { width: min(100%,420px); padding: 25px; margin: 0; }
.gate-card h1 { font-size: 2rem; }
.gate-card > p { color: var(--muted); margin: 9px 0 19px; }
.gate-card .btn.primary { min-width: 118px; }
.gate-switch { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
dialog { width: min(680px,calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 0; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); box-shadow: 0 18px 56px #172c2a30; }
dialog::backdrop { background: #132c29a6; }
.modal-inner { padding: 20px; }
.modal-header { align-items: flex-start; margin-bottom: 15px; }
.modal-header h2 { flex: 1; overflow-wrap: anywhere; }
.modal-inner > p, .modal-inner form > p { margin-bottom: 12px; }
.detail-meta { display: flex; gap: 8px; margin: 0 0 6px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 15px 0; padding: 12px; background: #f1f6f0; border-radius: 9px; }
.detail-grid dt { color: var(--muted); font-size: .88rem; }
.detail-grid dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.detail-answers section, .detail-evidence, .history, .review-form { padding-top: 12px; padding-bottom: 12px; border-top: 1px solid var(--line); }
.detail-answers p { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-evidence ul { padding-left: 20px; margin: 7px 0 0; }
.detail-evidence li { margin: 5px 0; overflow-wrap: anywhere; }
.detail-evidence a small { display: block; color: var(--muted); }
.history summary { cursor: pointer; font-weight: 700; }
.history section { margin: 9px 0 0; }
.history .muted { font-size: .86rem; }
.toast { position: fixed; z-index: 4; right: 18px; bottom: 18px; max-width: min(450px,calc(100vw - 36px)); background: #183f34; border-radius: 9px; color: white; padding: 11px 15px; box-shadow: 0 8px 18px #15392e27; }
.toast.failed { background: #833b2b; }
.loading { margin: 10px; color: var(--muted); }
.error-panel p { margin: 12px 0; }

@media (max-width: 1140px) {
  .overview-grid { grid-template-columns: 1fr; }
  .activity-timeline { margin-top: -16px; }
}

@media (max-width: 850px) {
  .app-shell { display: block; }
  .app-sidebar { position: static; height: auto; padding: 12px 17px; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; }
  .brand { margin: 0; order: 0; }
  .brand br { display: none; }
  .brand > span:last-child { max-width: 114px; }
  .app-sidebar nav { order: 2; flex: 0 0 100%; display: flex; flex-wrap: wrap; gap: 4px; }
  .app-sidebar nav a { padding: 8px 9px; }
  .account { order: 1; margin: 0 0 0 auto; border: 0; padding: 0; }
  .account-info { display: none; }
  .content { padding-top: 25px; }
}

@media (max-width: 620px) {
  .content { padding: 24px 14px 38px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { min-height: 105px; padding: 12px; }
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-layout { grid-template-columns: 1fr; gap: 0; }
  .form-card, .sidebar-card, .modal-inner { padding: 15px; }
  .target-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 13px; }
  .target-main { grid-column: span 2; }
  .target-progress { min-width: 0; width: 82%; }
  .target-side { justify-self: end; }
  .submission-row { padding: 11px; }
  .row-right { white-space: normal; }
  .row-right .badge { white-space: normal; text-align: right; }
}

@media (max-width: 390px) {
  .form-grid { grid-template-columns: 1fr; }
  .app-sidebar { padding-inline: 11px; }
  .app-sidebar nav a { font-size: .85rem; }
}
