:root {
  color-scheme: light;
  --bg: #f3eee6;
  --surface: #fbf8f3;
  --ink: #241f1b;
  --muted: #6f675e;
  --line: #e4d9cc;
  --accent: #7d3f2c;
  --accent-soft: #f4e6dc;
  --ok: #2d4a3a;
  --ok-soft: #e5efe8;
  --warn: #8a5a12;
  --warn-soft: #f6ead4;
  --bad: #7a2e2e;
  --bad-soft: #f8e6e2;
  --shadow: 0 1px 0 rgba(36, 31, 27, 0.04);
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: white;
  padding: 8px 12px;
}
.skip:focus { top: 12px; z-index: 5; }

.app { min-height: 100vh; }
.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 22px 28px 12px;
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand strong {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.16em;
  font-size: 15px;
}
.brand span { color: var(--muted); font-size: 13px; }
.role {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.role select, .filters input, .filters select, .stack input, .stack select, .stack textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
}
.banner, .blockers, .notice, .alert {
  margin: 0 28px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 12px;
}
.banner { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: var(--warn-soft);
  color: var(--warn);
}
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.blockers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.blockers article { border-top: 2px solid var(--accent); padding-top: 6px; }
.blockers h2, .panel h2, .section h2 { font-family: var(--serif); font-weight: 500; font-size: 18px; margin: 0 0 6px; }
.blockers p, .muted { color: var(--muted); margin: 0; font-size: 13px; }
.shell { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 18px; padding: 8px 28px 40px; }
nav { min-width: 0; max-width: 100%; }
nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
}
nav a {
  display: block;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
}
nav a[aria-current="page"], nav a:hover { background: var(--surface); }
.table-region {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.table-region:focus-visible { outline-offset: 3px; }
.blocked-note { padding: 28px; }
main, .shell, .section, .app { min-width: 0; max-width: 100%; }
main { min-width: 0; }
.section { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; flex-wrap: wrap; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.filters label { flex: 1 1 140px; min-width: 0; }
input, select, textarea { max-width: 100%; }
.filters label, .stack label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.button, button {
  background: var(--ink);
  color: #fbf8f3;
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}
button.secondary, .button.secondary { background: transparent; color: var(--ink); }
button.quiet { background: transparent; color: var(--muted); border-color: var(--line); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table-region table { min-width: 640px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { color: var(--muted); font-weight: 560; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.panel, .grid > article, .label-sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.notice { background: var(--ok-soft); }
.alert { background: var(--bad-soft); color: var(--bad); }
.pager { display: flex; gap: 10px; align-items: center; }
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); max-width: 460px; }
.label-sheet { background: #fffdf8; }
.label-sheet strong.mark {
  display: block;
  color: var(--bad);
  letter-spacing: 0.02em;
  margin: 8px 0;
}
.working { margin: 0 0 8px; color: var(--muted); }

@media (max-width: 860px) {
  .top, .banner, .blockers { margin-left: 14px; margin-right: 14px; }
  .top { padding: 16px 0 8px; flex-direction: column; align-items: stretch; }
  .shell { grid-template-columns: 1fr; padding: 8px 14px 28px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  nav ul {
    flex-direction: row;
    max-width: 100%;
    overflow-x: auto;
  }
  nav a { white-space: nowrap; }
  .filters label { flex: 1 1 100%; }
  .blockers, .grid { grid-template-columns: 1fr; }
  .table-region table { min-width: 0; }
  table.responsive thead { display: none; }
  table.responsive tr { display: block; border-bottom: 8px solid var(--bg); }
  table.responsive td { display: flex; justify-content: space-between; gap: 12px; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); margin-right: 12px; }
}
