:root {
  color-scheme: light;
  --bg: #f5f7f3;
  --paper: #ffffff;
  --ink: #1f2622;
  --muted: #66716a;
  --line: #d8ded6;
  --soft: #f0f4ee;
  --soft-2: #fafbf8;
  --green: #1f6f5d;
  --green-2: #dcece6;
  --blue: #2a5f86;
  --blue-2: #e7eff5;
  --amber: #9a641d;
  --amber-2: #f4e8d7;
  --shadow: 0 10px 24px rgba(28, 39, 32, 0.06);
  --shadow-strong: 0 16px 36px rgba(28, 39, 32, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

button:hover {
  border-color: #b8c4bc;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.eyebrow,
.section-label,
.label {
  margin: 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel,
.focus-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.app-shell {
  display: grid;
  grid-template-columns: 360px minmax(520px, 1fr) 320px;
  gap: 14px;
  width: min(1760px, calc(100% - 28px));
  margin: 10px auto 28px;
  align-items: start;
}

.nav-pane,
.context-pane {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 10px;
  max-height: calc(100vh - 20px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.nav-pane {
  min-height: 0;
  overflow: hidden;
}

.task-pane {
  min-width: 0;
}

.panel {
  padding: 12px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.12;
}

.route-panel {
  height: calc(100vh - 20px);
  min-height: 0;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.route-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.route-head h2 {
  margin: 3px 0 0;
  font-size: 18px;
  line-height: 1.15;
}

.route-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.route-controls {
  display: grid;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.resume-button {
  min-height: 74px;
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 10px 12px;
  border-color: #bdd1c8;
  background: linear-gradient(180deg, #ffffff 0%, #f4faf6 100%);
  text-align: left;
  box-shadow: 0 8px 16px rgba(28, 39, 32, 0.05);
}

.resume-button:hover {
  border-color: var(--green);
  box-shadow: 0 10px 18px rgba(28, 39, 32, 0.08);
}

.resume-button span,
.resume-button strong,
.resume-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resume-button span {
  color: var(--green);
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.resume-button strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.18;
}

.resume-button small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.resume-button.status-doing {
  border-color: #d49a46;
  background: linear-gradient(180deg, #fffaf2 0%, #f8ecd9 100%);
}

.resume-button.status-doing span {
  color: var(--amber);
}

.resume-button.status-done {
  background: linear-gradient(180deg, #ffffff 0%, #eff8f3 100%);
}

.status-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: var(--paper);
}

.status-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  background: transparent;
  box-shadow: none;
  white-space: nowrap;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  text-align: left;
}

.status-tabs button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-tabs button strong {
  min-width: 22px;
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.status-tabs button.active {
  background: var(--ink);
  color: white;
}

.status-tabs button.active strong {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.day-list {
  min-height: 0;
  overflow: auto;
  padding: 10px 9px 12px;
  display: grid;
  gap: 7px;
  align-content: start;
  scrollbar-gutter: stable;
}

.route-section-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 4px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

.route-section-title small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  text-transform: none;
}

.day-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px;
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.day-row.status-todo,
.day-row.status-doing,
.day-row.status-done {
  background: transparent;
}

.day-row:hover {
  border-color: #c8d3cc;
  background: var(--paper);
}

.day-row.selected {
  border-color: var(--green);
  background: var(--paper);
  box-shadow: inset 3px 0 0 var(--green), 0 0 0 1px rgba(31, 111, 93, 0.1);
}

.day-index {
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--soft);
}

.day-index.status-doing {
  background: var(--amber-2);
}

.day-index.status-done {
  background: var(--green-2);
}

.day-index.status-doing span,
.day-index.status-doing strong {
  color: var(--amber);
}

.day-index.status-done span,
.day-index.status-done strong {
  color: var(--green);
}

.day-index span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 780;
  line-height: 1;
  text-transform: uppercase;
}

.day-index strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
}

.day-info {
  min-width: 0;
}

.day-title-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.day-title-line h3 {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.day-info p {
  margin: 4px 0 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.day-row-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.subtask-mini {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--soft-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.empty-route {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: var(--soft-2);
}

.empty-route strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.tag,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--blue-2);
  color: var(--blue);
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.pill {
  background: var(--soft);
  color: var(--muted);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.status-chip.status-todo,
.status-option.status-todo {
  background: var(--soft);
  color: var(--muted);
}

.status-chip.status-doing,
.status-option.status-doing {
  border-color: #d49a46;
  background: var(--amber-2);
  color: var(--amber);
}

.status-chip.status-done,
.status-option.status-done {
  border-color: #9bc2b4;
  background: var(--green-2);
  color: var(--green);
}

.focus-card {
  min-width: 0;
  padding: 18px 20px;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow-strong);
}

.focus-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 18px;
  align-items: start;
}

.focus-status {
  display: grid;
  gap: 8px;
  width: 100%;
  justify-self: end;
  padding-top: 2px;
}

.focus-card h2 {
  margin: 3px 0 0;
  font-size: clamp(28px, 2.5vw, 38px);
  line-height: 1.07;
  letter-spacing: 0;
}

.focus-summary {
  margin: 0;
  max-width: 900px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.execution-line {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.execution-line strong {
  color: var(--ink);
}

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

.fact {
  min-height: 108px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.fact span {
  display: block;
  margin-bottom: 7px;
  color: var(--green);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.fact strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.38;
}

.day-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.35fr);
  gap: 14px;
  align-items: start;
}

.day-subtasks {
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.block-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.block-head h4 {
  margin: 2px 0 0;
  font-size: 15px;
}

.block-head > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.subtask-list {
  display: grid;
  gap: 8px;
}

.subtask-card {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-color: transparent;
  background: #fbfcfa;
  text-align: left;
}

.subtask-card:hover {
  transform: none;
}

.subtask-card.active {
  border-color: var(--green);
  background: var(--paper);
  box-shadow: inset 3px 0 0 var(--green), 0 0 0 1px rgba(31, 111, 93, 0.1);
}

.subtask-card.done {
  background: #f5f8f3;
}

.subtask-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 820;
}

.subtask-card.done .subtask-number {
  background: var(--green-2);
  color: var(--green);
}

.subtask-copy {
  min-width: 0;
}

.subtask-copy strong,
.subtask-copy small {
  display: block;
}

.subtask-copy strong {
  font-size: 14px;
  line-height: 1.25;
}

.subtask-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.subtask-state {
  border-radius: 999px;
  padding: 5px 7px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.subtask-card.done .subtask-state {
  background: var(--green-2);
  color: var(--green);
}

.subtask-detail {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--paper);
}

.subtask-detail h3 {
  margin: 2px 0 6px;
  font-size: 22px;
  line-height: 1.15;
}

.subtask-detail > p:not(.section-label) {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.subtask-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin-top: 14px;
}

.subtask-detail-grid > div {
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.subtask-detail-grid h4 {
  margin: 0 0 7px;
  font-size: 14px;
}

.subtask-detail-grid p,
.subtask-detail-grid ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.subtask-detail-grid ul {
  display: grid;
  gap: 6px;
  padding-left: 18px;
}

.subtask-done-toggle {
  min-height: 38px;
  margin-top: 14px;
  padding: 0 16px;
  border-color: var(--green);
  background: var(--green);
  color: var(--paper);
  font-weight: 760;
}

.subtask-done-toggle.done {
  border-color: var(--line);
  background: var(--soft);
  color: var(--muted);
}

.day-guard {
  grid-column: 1 / -1;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.detail-block {
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-block h4 {
  margin: 0 0 9px;
  font-size: 15px;
}

.detail-block ol,
.detail-block ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  line-height: 1.48;
}

.guard {
  border-left: 4px solid var(--amber);
  padding-left: 12px;
  color: var(--muted);
}

.guard p {
  margin: 0;
  line-height: 1.5;
}

summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 760;
}

.hint-list {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.hint-card {
  border: 1px solid #d7ded8;
  border-radius: 8px;
  padding: 10px;
  background: var(--paper);
}

.hint-card strong {
  display: block;
  margin-bottom: 5px;
}

.hint-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.notes-block {
  padding-top: 0;
  border-top: 0;
}

.note-area {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: var(--paper);
}

.status-control {
  display: grid;
  gap: 7px;
}

.status-control-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.status-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.status-options-top {
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #fbfcfa;
}

.status-option {
  min-height: 36px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 720;
  box-shadow: none;
}

.status-options-top .status-option {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 780;
}

.status-option.active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.status-options-top .status-option.active {
  border-color: var(--green);
  background: var(--green);
  color: var(--paper);
  box-shadow: none;
}

.context-summary {
  display: grid;
  gap: 10px;
}

.context-summary h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.16;
}

.context-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.context-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.context-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.prestart-card,
.context-box,
.unblock-box {
  display: grid;
  gap: 10px;
}

.context-summary,
.prestart-card,
.context-box,
.unblock-box {
  box-shadow: 0 8px 20px rgba(28, 39, 32, 0.05);
}

.unblock-box summary {
  display: grid;
  gap: 3px;
}

.unblock-box summary span {
  font-weight: 780;
}

.unblock-box summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
}

.context-head h2 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.16;
}

.prestart-list {
  display: grid;
  gap: 7px;
}

.prestart-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #fbfcfa;
}

.prestart-item input {
  margin-top: 3px;
}

.prestart-item span {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.38;
}

.unblock-content {
  margin-top: 10px;
}

.unblock-note {
  margin: 0;
  border-left: 3px solid var(--amber);
  padding-left: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.nested-disclosure {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfa;
}

.nested-disclosure summary {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.side-command-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.side-command {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid #c9d2cb;
  border-radius: 8px;
  padding: 8px;
  background: #17211c;
  color: #f1f5ef;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.4;
}

.resource-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.resource-list a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  background: #fbfcfa;
  font-size: 13px;
}

.context-box p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--ink);
  color: white;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1320px) {
  .app-shell {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .context-pane {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    overflow: visible;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .task-pane {
    order: 1;
  }

  .nav-pane {
    order: 2;
  }

  .context-pane {
    order: 3;
  }

  .nav-pane,
  .context-pane {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .route-panel {
    height: auto;
  }

  .day-list {
    overflow: visible;
  }

  .context-pane {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .panel-head {
    display: block;
  }

  .app-shell {
    width: min(100% - 20px, 1760px);
    margin-top: 10px;
  }

  .focus-card {
    padding: 14px;
  }

  .focus-top {
    grid-template-columns: 1fr;
  }

  .focus-status {
    justify-self: stretch;
  }

  .status-options-top {
    grid-template-columns: 1fr;
  }

  .focus-card h2 {
    font-size: 29px;
  }

  .focus-grid,
  .day-workspace,
  .subtask-detail-grid,
  .workspace-grid,
  .workspace-footer {
    grid-template-columns: 1fr;
  }

  .subtask-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .subtask-state {
    grid-column: 2;
    justify-self: start;
  }

  .status-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
