:root {
  --paper: #ebe6dc;
  --paper-2: #f7f4ee;
  --ink: #24211c;
  --ink-soft: #5c564c;
  --line: #e0d6c6;
  --line-strong: #cfc3ae;
  --orange: #e36b1e;
  --orange-ink: #2a1406;
  --orange-soft: #f8eadc;
  --green: #1f6b45;
  --green-ink: #f3faf6;
  --green-soft: #e5f3eb;
  --danger: #8c2f22;
  --serif: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --shadow: 0 1px 0 rgba(36, 33, 28, 0.04);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(227, 107, 30, 0.08), transparent 55%),
    var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

img,
svg {
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

::selection {
  background: #f0c9a4;
  color: #24180f;
}

:focus-visible {
  outline: 2px solid #c45512;
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 20;
  background: var(--paper-2);
  color: var(--ink);
  padding: 8px 12px;
}

.skip:focus {
  top: 12px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(235, 230, 220, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.top-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 16px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px 28px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.mark {
  width: 36px;
  height: 36px;
  flex: none;
}

.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 18px 22px;
  flex-wrap: wrap;
}

.when {
  margin: 0;
  display: grid;
  justify-items: end;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.when time {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.pace {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pace legend {
  padding: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.pace-options {
  display: flex;
  padding: 3px;
  background: #e3dcd0;
  border-radius: 999px;
}

.pace-options label {
  position: relative;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}

.pace-options input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}

.pace-options label:has(input:checked) {
  background: var(--ink);
  color: #f6f3ed;
  font-weight: 600;
}

.pace-options label:focus-within {
  outline: 2px solid #c45512;
  outline-offset: 2px;
}

.pace-note {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 72px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.shell > * {
  min-width: 0;
}

.side {
  position: sticky;
  top: 112px;
  display: grid;
  gap: 16px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 12px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

.nav a span {
  font-weight: 600;
}

.nav a small {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.nav a[aria-current="location"] {
  background: var(--paper-2);
  box-shadow: inset 3px 0 0 var(--orange);
}

.morning {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 8px;
}

.morning h2 {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.morning dl {
  margin: 0;
}

.morning div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.morning dt {
  color: var(--ink-soft);
}

.morning dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.lede {
  margin: 0 0 18px;
  max-width: 62ch;
  font-size: 1.05rem;
}

.noscript {
  padding: 12px 14px;
  background: var(--orange-soft);
  border-radius: 12px;
}

.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
  margin-bottom: 16px;
  scroll-margin-top: 124px;
}

.kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.card h2 {
  margin: 4px 0 8px;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.15rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.idea,
.count {
  margin: 0 0 16px;
  max-width: 68ch;
  color: var(--ink-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.wide {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: #fffdf9;
  border: 1px solid #d9d0c2;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
  min-height: 84px;
}

.field input:disabled,
.field textarea:disabled,
.field select:disabled {
  background: #f1ebe3;
  color: #6d665c;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 16px;
}

.status {
  margin: 0;
  flex: 1;
  min-width: 12rem;
  min-height: 1.4em;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.status.is-slow {
  color: #8a3d0c;
  font-weight: 600;
}

.status.is-error {
  color: var(--danger);
  font-weight: 600;
}

.btn {
  --btn-bg: var(--ink);
  --btn-fg: #f6f3ed;
  appearance: none;
  border: 0;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: 999px;
  min-height: 44px;
  min-width: 148px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 1;
  cursor: progress;
}

.btn.quiet {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn.quiet:hover:not(:disabled) {
  background: #efeae2;
}

.btn.quiet.is-landed {
  --btn-fg: var(--green);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px var(--green);
}

.btn.is-working {
  --btn-bg: var(--orange);
  --btn-fg: var(--orange-ink);
}

.btn.is-done {
  --btn-bg: var(--green);
  --btn-fg: var(--green-ink);
}

.btn-glyph {
  position: relative;
  width: 0;
  height: 16px;
  margin-right: 0;
  overflow: hidden;
  flex: none;
  transition:
    width 280ms ease,
    margin-right 280ms ease;
}

.btn.is-working .btn-glyph,
.btn.is-done .btn-glyph {
  width: 16px;
  margin-right: 8px;
}

.glyph {
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.btn.is-working .glyph-spin {
  opacity: 1;
  animation: spin 0.7s linear infinite;
}

.btn.is-done .glyph-tick {
  opacity: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.receipt {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.meter {
  position: relative;
  height: 12px;
  background: #e6dfd2;
  border-radius: 99px;
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #c45512, var(--orange));
  border-radius: inherit;
  transition:
    width 400ms linear,
    background-color 300ms ease,
    opacity 500ms ease;
}

.meter.is-done .meter-fill {
  background: var(--green);
}

.meter.is-resting .meter-fill {
  opacity: 0;
}

.meter-notch {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: rgba(36, 33, 28, 0.16);
}

.inline-form {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.stops {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.stop {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e6dfd3;
  border-radius: 12px;
  background: #fffdf9;
  transition:
    background-color 600ms ease,
    border-color 600ms ease,
    box-shadow 600ms ease;
}

.stop-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.tag {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.stop.is-pending {
  background: var(--orange-soft);
  border-color: #f0d2b4;
  box-shadow: inset 3px 0 0 var(--orange);
  animation: rise 280ms ease;
}

.stop.is-pending .tag {
  color: #8a3d0c;
}

.stop.is-settled {
  background: var(--green-soft);
  border-color: #b7dcc8;
  box-shadow: inset 3px 0 0 var(--green);
}

.stop.is-settled .tag {
  color: var(--green);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.person {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 200px;
  gap: 4px 16px;
  align-items: end;
  padding: 12px 14px;
  border: 1px solid #e6dfd3;
  border-radius: 12px;
  background: #fffdf9;
}

.who {
  display: grid;
  align-self: center;
}

.who strong {
  font-weight: 600;
}

.who span {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.whisper {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 1.3em;
  font-size: 0.92rem;
  color: transparent;
  transition: color 400ms ease;
}

.whisper.is-working {
  color: #8a3d0c;
  font-weight: 600;
}

.whisper.is-done {
  color: var(--green);
  font-weight: 600;
}

.hairline {
  height: 4px;
  margin-bottom: 16px;
  background: #e6dfd2;
  border-radius: 99px;
  overflow: hidden;
}

.hairline span {
  display: block;
  height: 100%;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left center;
}

.hairline.is-run span {
  transform: scaleX(1);
  transition: transform var(--run, 1800ms) linear;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  padding: 12px 12px 10px;
  border-radius: 12px;
  background: #fffdf9;
  border: 1px solid #e6dfd3;
}

.metric span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  transition: opacity 320ms ease;
}

.metric.is-stale strong {
  opacity: 0.35;
}

.table-wrap {
  overflow-x: auto;
}

.parts {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.parts caption {
  text-align: left;
  caption-side: bottom;
  padding-top: 10px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.parts th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0 8px 8px;
}

.parts td {
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.parts tr.is-working {
  background: #fbf6ee;
}

.parts tr.is-landed {
  background: var(--green-soft);
  transition: background-color 500ms ease;
}

.free {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.free.is-changed {
  color: var(--green);
}

.action {
  width: 160px;
}

.reserve {
  display: inline-grid;
  justify-items: stretch;
  gap: 6px;
  min-width: 124px;
  padding: 8px 12px;
}

.mini-meter {
  height: 6px;
  background: #efe6d8;
  border-radius: 99px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 200ms ease;
}

.reserve.is-working .mini-meter {
  opacity: 1;
}

.mini-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--orange);
}

.row-status {
  display: block;
  min-height: 1.2em;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
}

.steps li {
  padding: 10px 12px;
  border-radius: 10px;
  background: #efeae1;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  transition:
    background-color 280ms ease,
    color 280ms ease;
}

.steps li.is-on {
  background: var(--orange-soft);
  color: #8a3d0c;
}

.steps li.is-done {
  background: var(--green-soft);
  color: var(--green);
}

.empty {
  margin: 14px 0 0;
  color: var(--ink-soft);
}

.log {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.log li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffdf9;
  border: 1px solid #e6dfd3;
  animation: rise 280ms ease;
}

.log time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav a {
    min-width: max-content;
    background: var(--paper-2);
  }

  .card {
    scroll-margin-top: 240px;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid,
  .inline-form,
  .person,
  .steps {
    grid-template-columns: 1fr;
  }

  .when {
    justify-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

.commands-button {
  appearance: none;
  border: 0;
  background: var(--ink);
  color: #f6f3ed;
  border-radius: 999px;
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}

.commands-button .cmd-count {
  min-width: 1.4em;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--orange-ink);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(36, 33, 28, 0.28);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  width: min(420px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
  border-left: 1px solid var(--line);
  box-shadow: -16px 0 40px rgba(36, 33, 28, 0.12);
  transform: translateX(100%);
  transition: transform 220ms ease;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 8px;
}

.drawer-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.6rem;
}

.drawer-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  padding: 0 8px;
}

.drawer-note {
  margin: 0;
  padding: 0 18px 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.command-log {
  list-style: none;
  margin: 0;
  padding: 0 12px 24px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.cmd {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffdf9;
  border: 1px solid #e6dfd3;
}

.cmd-empty {
  display: block;
  color: var(--ink-soft);
}

.cmd-id {
  grid-column: 1;
  grid-row: 1;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.cmd-status {
  grid-column: 2;
  grid-row: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.cmd-name,
.cmd-meta {
  grid-column: 1 / -1;
  min-width: 0;
}

.cmd-name {
  grid-row: 2;
  font-weight: 600;
}

.cmd-meta {
  grid-row: 3;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.cmd.is-working {
  box-shadow: inset 3px 0 0 var(--orange);
}

.cmd.is-working .cmd-status {
  color: #8a3d0c;
}

.cmd.is-done {
  box-shadow: inset 3px 0 0 var(--green);
}

.cmd.is-done .cmd-status {
  color: var(--green);
}

.cmd.is-rejected {
  box-shadow: inset 3px 0 0 var(--danger);
}

.cmd.is-rejected .cmd-status {
  color: var(--danger);
}

.cmd.is-superseded .cmd-status {
  color: var(--ink-soft);
}
