:root {
  color-scheme: light;
  --bg: #f8f7f2;
  --paper: #fffdf7;
  --ink: #232321;
  --muted: #746f66;
  --line: #ddd5c8;
  --heavy: #222;
  --soft: #fffaf0;
  --accent: #2c73d2;
  --ok: #3f8f6b;
  --watch: #d6a434;
  --risk: #c94c3b;
  --shadow: 0 12px 28px rgba(40, 35, 25, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,0.64), rgba(255,255,255,0.64)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(70,60,45,0.035) 24px),
    var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(221, 213, 200, 0.8);
  background: rgba(248, 247, 242, 0.94);
  padding: 13px 24px 10px;
}

.eyebrow {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

h1 {
  font-size: 26px;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions a,
.focus-card a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #d5cdbf;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
  text-decoration: none;
  font-weight: 800;
}

main {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 14px 24px 28px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: var(--shadow);
}

.script-rail span,
.panel-head > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: var(--heavy);
  color: #fffefb;
  font-size: 12px;
}

.panel {
  padding: 14px;
  scroll-margin-top: 86px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head h2 {
  font-size: 18px;
}

.panel-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.todo-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.todo-card,
.focus-card,
.seed-card,
.handoff-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px dashed #d8d0c2;
  border-radius: 8px;
  background: #fffefb;
  padding: 10px;
}

.todo-head,
.focus-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.focus-top span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.todo-head span,
.focus-top > strong {
  border-radius: 999px;
  background: var(--heavy);
  color: #fffefb;
  padding: 2px 7px;
  font-size: 10px;
}

.focus-card h3 {
  font-size: 14px;
}

.seed-card p,
.focus-card p,
.handoff-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.table-like {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
}

.table-row {
  display: grid;
  grid-template-columns: 0.7fr 1.2fr 2fr 1fr;
  gap: 10px;
  border-top: 1px dashed #ded6c8;
  padding: 9px 10px;
  font-size: 12px;
}

#supportRows .table-row {
  grid-template-columns: 1.3fr 0.7fr 0.8fr 0.5fr 2fr;
}

#unfinishedRows .table-row {
  grid-template-columns: 1.8fr 0.8fr 0.8fr 1fr;
}

.table-row:first-child {
  border-top: 0;
}

.table-header {
  background: #fff8ea;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.todo-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border-top: 1px dashed #ded6c8;
  padding-top: 7px;
}

.todo-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.todo-item strong {
  display: block;
  font-size: 12px;
}

.todo-item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.todo-item i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff3dc;
  color: #835a16;
  font-style: normal;
  font-weight: 900;
}

.stacked-bar {
  display: flex;
  height: 30px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee8dc;
}

.stacked-bar span {
  min-width: 2px;
}

.legend-grid,
.focus-grid,
.seed-grid,
.handoff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.handoff-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.legend-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 7px;
  border: 1px dashed #d8d0c2;
  border-radius: 8px;
  background: #fffefb;
  padding: 9px;
}

.legend-item i {
  width: 10px;
  height: 10px;
  margin-top: 3px;
  border-radius: 999px;
}

.legend-item span {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.focus-card.recommended {
  border-color: rgba(44, 115, 210, 0.45);
  border-top: 4px solid var(--accent);
}

.focus-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.focus-facts span,
.seed-card span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  border: 1px solid #ded6c8;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  padding: 0 8px;
  font-size: 10px;
  font-weight: 900;
}

.handoff-card strong {
  font-size: 13px;
}

.handoff-card a {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 32px;
  border: 1px solid #d5cdbf;
  border-radius: 8px;
  background: var(--paper);
  padding: 0 12px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.confirm-panel pre {
  overflow: auto;
  max-height: 460px;
  margin: 0;
  border: 1px solid #d8d0c2;
  border-radius: 8px;
  background: #222;
  color: #fffdf7;
  padding: 14px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

@media (max-width: 1000px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .todo-grid,
  .legend-grid,
  .focus-grid,
  .seed-grid,
  .handoff-grid {
    grid-template-columns: 1fr;
  }

  .table-row,
  #supportRows .table-row,
  #unfinishedRows .table-row {
    grid-template-columns: 1fr;
  }
}
