:root {
  color-scheme: light;
  --ink: #17251f;
  --muted: #66756d;
  --line: #e1e8e3;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --green: #16734a;
  --green-dark: #105638;
  --green-soft: #e7f4ec;
  --amber-soft: #fff3d8;
  --red-soft: #fdebea;
  --shadow: 0 12px 36px rgba(23, 37, 31, 0.055);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--green); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(22, 115, 74, .24);
  outline-offset: 2px;
}
.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand-lockup { display: inline-flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: var(--green);
  color: white;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.brand-name { display: block; font-weight: 750; letter-spacing: -.025em; font-size: 15px; }
.brand-subtitle { display: block; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-actions form { margin: 0; }
.user-chip, .date-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 12px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #2e9e67; }
.main-shell { max-width: 1460px; margin: 0 auto; padding: 34px clamp(16px, 4vw, 52px) 24px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { color: var(--green); font-size: 10px; line-height: 1.4; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 7px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(27px, 3vw, 36px); line-height: 1.14; letter-spacing: -.045em; font-weight: 760; }
h2 { margin-bottom: 5px; font-size: 20px; line-height: 1.25; letter-spacing: -.025em; }
h3 { margin-bottom: 7px; font-size: 15px; line-height: 1.35; }
.muted { color: var(--muted); }
.page-heading p { max-width: 700px; margin-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 18px 20px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-value { font-size: 31px; line-height: 1.25; margin: 7px 0 5px; font-weight: 760; letter-spacing: -.05em; }
.stat-foot { color: #849087; font-size: 11px; }
.section-card { margin-top: 20px; padding: clamp(18px, 2.4vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); scroll-margin-top: 16px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading p { margin-bottom: 0; }
.task-form { padding: 18px; border: 1px solid var(--line); background: #fbfcfb; border-radius: 13px; margin-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: span 2; }
.field label, .stack-form label { color: #35463c; font-size: 12px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  max-width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink);
  border: 1px solid #dbe4dd;
  border-radius: 8px;
  background: white;
}
textarea { min-height: 84px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9aa69e; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 15px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.button:active { transform: translateY(1px); }
.button-primary { background: var(--green); color: white; border-color: var(--green); }
.button-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.button-secondary { background: white; color: var(--ink); border-color: var(--line); }
.button-secondary:hover, .button-quiet:hover { background: #f0f5f1; }
.button-quiet { color: var(--muted); background: transparent; border-color: transparent; }
.button-small { min-height: 31px; padding: 6px 9px; font-size: 11px; }
.button-full { width: 100%; min-height: 44px; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
thead { background: #f7f9f7; }
th { color: #6d7b72; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
th, td { padding: 13px 12px; border-bottom: 1px solid #edf1ed; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfdfc; }
.task-title-cell { min-width: 195px; }
.task-title-cell strong { font-size: 12px; font-weight: 750; }
.inline-status-form { display: flex; gap: 6px; min-width: 200px; }
.inline-status-form select { min-width: 135px; min-height: 31px; padding: 5px; font-size: 11px; }
.inline-details { margin-top: 6px; color: var(--muted); max-width: 300px; }
.inline-details summary, .report-content summary { color: var(--green); cursor: pointer; font-size: 11px; font-weight: 700; }
.inline-details p { white-space: normal; font-weight: 400; }
.priority, .status { display: inline-flex; align-items: center; white-space: nowrap; padding: 4px 8px; border-radius: 999px; background: #f0f3f1; color: #59675f; font-size: 10px; font-weight: 750; }
.priority-p1 { color: #9b302b; background: #fdebea; }
.priority-p2 { color: #815a12; background: #fff3d8; }
.priority-p3 { color: #4b6556; background: #eaf1ec; }
.status-in_progress, .status-report_received, .status-reviewed { color: #205b83; background: #eaf3fc; }
.status-awaiting_report, .status-unverified, .status-not_started { color: #815a12; background: #fff3d8; }
.status-verified, .status-implemented, .status-accepted, .status-report-reviewed, .status-report-accepted { color: #176b43; background: #e7f4ec; }
.status-blocked { color: #9b302b; background: #fdebea; }
.date-cell { color: var(--muted); font-size: 11px; white-space: nowrap; }
.integration-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #fbfcfb;
  border-radius: 12px;
}
.integration-model-label { color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.integration-model { font-size: 18px; font-weight: 750; letter-spacing: -.025em; overflow-wrap: anywhere; }
.integration-note { font-size: 11px; margin: 8px 0 0; max-width: 720px; }
.integration-action { flex: 0 0 auto; margin: 0; }
.integration-footnote { font-size: 11px; margin: 12px 2px 0; }
.empty-state { padding: 32px 18px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin-bottom: 6px; }
.empty-state p { max-width: 480px; margin: 0 auto; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--green-soft); color: var(--green); margin: 0 auto 12px; font-size: 22px; }
.reports-list { display: grid; gap: 12px; }
.report-card { padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.report-topline { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 9px; }
.report-card h3 { margin-bottom: 5px; font-size: 16px; }
.report-meta { color: var(--muted); font-size: 11px; margin-bottom: 9px; }
.report-card p { margin: 9px 0; }
.report-content { margin-top: 12px; padding-top: 11px; border-top: 1px solid #edf1ed; }
.report-body { margin-top: 12px; padding: 13px; border-radius: 8px; background: #f7f9f7; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-height: 560px; overflow: auto; }
.report-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 13px; }
.report-actions form { margin: 0; }
.notice { margin: 0 0 18px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; }
.notice p { margin: 6px 0; }
.notice ul { margin: 8px 0; padding-left: 20px; }
.notice-success { background: #eaf7ef; border-color: #cce8d6; color: #155d37; }
.notice-warning { background: #fff8e8; border-color: #f2e0ad; color: #755516; }
.notice-danger { background: #fff0ef; border-color: #f2ceca; color: #8d302c; }
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 26px 2px 8px; color: #87938b; font-size: 11px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background: radial-gradient(ellipse at top left, #e5f2e9 0, transparent 43%), var(--canvas); }
.login-shell { width: 100%; max-width: 440px; }
.login-shell > .brand-lockup { margin: 0 auto 25px; display: flex; width: fit-content; }
.login-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: clamp(23px, 5vw, 34px); box-shadow: 0 20px 65px rgba(23, 37, 31, .09); }
.login-card h1 { font-size: 29px; }
.login-card > p { margin-bottom: 24px; font-size: 13px; }
.stack-form { display: grid; gap: 9px; }
.stack-form input { margin-bottom: 7px; min-height: 43px; }
.stack-form button { margin-top: 9px; }
.login-footer { text-align: center; margin: 18px 0 0; color: #87938b; font-size: 11px; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92em; overflow-wrap: anywhere; }
@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-wide { grid-column: span 2; }
  .date-chip { display: none; }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; padding: 13px 15px; }
  .topbar-actions { gap: 4px; flex-direction: column; align-items: flex-end; }
  .user-chip { max-width: 160px; overflow-wrap: anywhere; font-size: 10px; }
  .main-shell { padding: 24px 12px 18px; }
  .page-heading { align-items: flex-start; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 14px; border-radius: 12px; }
  .stat-value { font-size: 26px; }
  .section-card { padding: 15px 12px; }
  .task-form { padding: 12px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field-wide { grid-column: auto; }
  .form-actions .button { width: 100%; }
  .app-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
