:root {
  --blue: #073da5;
  --blue-dark: #06265f;
  --blue-soft: #eaf1ff;
  --ink: #141922;
  --muted: #626d7b;
  --line: #dce1e9;
  --soft: #f5f7fa;
  --white: #fff;
  --green: #17663a;
  --green-soft: #eaf6ef;
  --amber: #8a4b08;
  --amber-soft: #fff3df;
  --red: #a32424;
  --red-soft: #fff0f0;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}
a { color: var(--blue); }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { outline-offset: 3px; }
:focus-visible { outline: 3px solid #8aafff; }
.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
}
.skip-link:focus { top: 12px; }
.topbar {
  min-height: 68px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--blue);
  color: var(--white);
  font-weight: 800;
}
.top-actions { display: flex; align-items: center; gap: 16px; }
.user-name { color: var(--muted); font-size: 14px; }
.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-weight: 700;
}
.page {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 140px);
  margin: 0 auto;
  padding: 54px 0 72px;
}
.narrow { width: min(680px, calc(100% - 40px)); }
.review-page {
  width: min(880px, calc(100% - 32px));
  min-height: calc(100vh - 140px);
  margin: 0 auto;
  padding: 44px 0 72px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 10px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}
h2 { font-size: 23px; letter-spacing: -0.02em; }
h3 { font-size: 17px; }
.lead { max-width: 720px; color: var(--muted); font-size: 18px; }
.eyebrow { color: var(--blue); font-size: 13px; font-weight: 800; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
  text-decoration: none;
  cursor: pointer;
  font-weight: 750;
}
.button:hover { background: var(--blue-dark); }
.button.secondary { background: var(--white); color: var(--blue); }
.button.ghost { border-color: var(--line); background: var(--white); color: var(--ink); }
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 38px 0;
  border: 1px solid var(--line);
  background: var(--line);
}
.stat { padding: 24px; background: var(--white); }
.stat strong { display: block; font-size: 34px; line-height: 1; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.section-head {
  margin: 44px 0 15px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.list { border-top: 1px solid var(--line); }
.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(140px, .6fr) minmax(160px, .7fr);
  gap: 20px;
  align-items: center;
  padding: 19px 2px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.list-row:hover { background: var(--soft); }
.list-row small { color: var(--muted); }
.status {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.status-approved { background: var(--green-soft); color: var(--green); }
.status-changes_requested { background: var(--amber-soft); color: var(--amber); }
.status-awaiting, .status-in_review { background: var(--blue-soft); color: var(--blue); }
.status-done { background: var(--green-soft); color: var(--green); }
.status-blocked { background: var(--red-soft); color: var(--red); }
.status-in_progress { background: var(--blue-soft); color: var(--blue); }
.status-todo, .status-cancelled { background: var(--soft); color: var(--muted); }
.task-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.task-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.task-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}
.task-card-head h3 { margin: 10px 0 4px; }
.task-card-head small { color: var(--muted); text-align: right; }
.task-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 18px;
}
.task-form .button { width: fit-content; }
.panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.panel + .panel { margin-top: 16px; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr);
  gap: 28px;
  align-items: start;
}
.muted { color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; }
.item-list { display: grid; gap: 12px; margin-top: 22px; }
.approval-item {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.approval-item p { margin-bottom: 0; color: var(--muted); }
.number {
  display: inline-grid;
  width: 27px;
  height: 27px;
  margin-right: 8px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}
.form-grid { display: grid; gap: 18px; margin-top: 28px; }
.field { display: grid; gap: 7px; }
label { font-weight: 700; }
input, textarea, select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #bcc4cf;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}
.helptext, .field-help { color: var(--muted); font-size: 12px; }
.errorlist, .field-error { margin: 4px 0 0; color: var(--red); font-size: 13px; }
.messages {
  position: fixed;
  z-index: 50;
  top: 78px;
  right: 18px;
  width: min(430px, calc(100% - 36px));
}
.message {
  margin-bottom: 8px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}
.message-success { border-color: #96c9aa; background: var(--green-soft); }
.message-warning { border-color: #e4be83; background: var(--amber-soft); }
.message-error { border-color: #dfa0a0; background: var(--red-soft); }
.review-header {
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.decision-card {
  margin-bottom: 16px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 12px;
}
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice label {
  display: block;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: center;
  cursor: pointer;
}
.choice input:focus-visible + label { outline: 3px solid #8aafff; }
.choice input:checked + label { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.legal-note {
  margin: 24px 0;
  padding: 15px 18px;
  border-left: 4px solid var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 13px;
}
.timeline { border-left: 1px solid var(--line); margin-left: 8px; padding-left: 22px; }
.timeline-item { position: relative; margin-bottom: 18px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
}
.timeline-item small { color: var(--muted); }
.footer {
  min-height: 72px;
  padding: 20px max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .user-name { display: none; }
  .page, .review-page { padding-top: 32px; }
  .stats, .layout, .task-board, .task-form { grid-template-columns: 1fr; }
  .list-row { grid-template-columns: 1fr; gap: 5px; }
  .section-head { align-items: start; flex-direction: column; }
  .choices { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
}

@media print {
  .topbar, .footer, .messages, .no-print { display: none !important; }
  .page, .review-page { width: 100%; padding: 20px; }
  .panel { break-inside: avoid; }
}
