:root {
  color-scheme: light;
  --bg: #f6efe5;
  --bg-start: #eadfce;
  --panel: #fffdf8;
  --panel-strong: #fffaf1;
  --panel-soft: #fbf3e8;
  --ink: #141b2d;
  --muted: #687078;
  --line: #ded2c1;
  --line-strong: #c9bca9;
  --track: #e5d9c8;
  --code-bg: #efe7dc;
  --code-ink: #243044;
  --active-bg: #141b2d;
  --active-ink: #ffffff;
  --solid-bg: #141b2d;
  --solid-ink: #ffffff;
  --ribbon-ink: #ffffff;
  --blue: #2f6fed;
  --green: #12836f;
  --amber: #b56b12;
  --red: #cf3f49;
  --violet: #7556f6;
  --danger-stroke: #a33b18;
  --warning-soft: #fff7e8;
  --warning-line: #efc783;
  --warning-ink: #825011;
  --switch-bg: rgba(255, 253, 248, 0.84);
  --map-bg:
    linear-gradient(180deg, rgba(255, 253, 248, 0.95), rgba(250, 243, 233, 0.82)),
    repeating-linear-gradient(0deg, rgba(127, 93, 54, 0.045) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, rgba(127, 93, 54, 0.035) 0 1px, transparent 1px 30px),
    rgba(255, 250, 241, 0.88);
  --shadow: 0 22px 60px rgba(73, 51, 27, 0.14);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11100e;
  --bg-start: #211c16;
  --panel: #1b1916;
  --panel-strong: #221f1a;
  --panel-soft: #161411;
  --ink: #f4efe7;
  --muted: #b3a998;
  --line: #3d3429;
  --line-strong: #514538;
  --track: #332c23;
  --code-bg: #0f0e0c;
  --code-ink: #f0e9de;
  --active-bg: #edf3fb;
  --active-ink: #07111f;
  --solid-bg: #0d1320;
  --solid-ink: #e4edf8;
  --ribbon-ink: #07111f;
  --blue: #5c91ff;
  --green: #3bc5a7;
  --amber: #f0ad46;
  --red: #ff6b72;
  --violet: #9b7cff;
  --danger-stroke: #ff9a5d;
  --warning-soft: #2a2114;
  --warning-line: #7d5a24;
  --warning-ink: #f4c56f;
  --switch-bg: rgba(34, 31, 26, 0.82);
  --map-bg:
    linear-gradient(180deg, rgba(34, 31, 26, 0.94), rgba(22, 20, 17, 0.86)),
    repeating-linear-gradient(0deg, rgba(229, 191, 142, 0.045) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, rgba(229, 191, 142, 0.032) 0 1px, transparent 1px 30px),
    rgba(22, 20, 17, 0.88);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11100e;
    --bg-start: #211c16;
    --panel: #1b1916;
    --panel-strong: #221f1a;
    --panel-soft: #161411;
    --ink: #f4efe7;
    --muted: #b3a998;
    --line: #3d3429;
    --line-strong: #514538;
    --track: #332c23;
    --code-bg: #0f0e0c;
    --code-ink: #f0e9de;
    --active-bg: #edf3fb;
    --active-ink: #07111f;
    --solid-bg: #0d1320;
    --solid-ink: #e4edf8;
    --ribbon-ink: #07111f;
    --blue: #5c91ff;
    --green: #3bc5a7;
    --amber: #f0ad46;
    --red: #ff6b72;
    --violet: #9b7cff;
    --danger-stroke: #ff9a5d;
    --warning-soft: #2a2114;
    --warning-line: #7d5a24;
    --warning-ink: #f4c56f;
    --switch-bg: rgba(34, 31, 26, 0.82);
    --map-bg:
      linear-gradient(180deg, rgba(34, 31, 26, 0.94), rgba(22, 20, 17, 0.86)),
      repeating-linear-gradient(0deg, rgba(229, 191, 142, 0.045) 0 1px, transparent 1px 30px),
      repeating-linear-gradient(90deg, rgba(229, 191, 142, 0.032) 0 1px, transparent 1px 30px),
      rgba(22, 20, 17, 0.88);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, var(--bg-start), transparent 320px),
    repeating-linear-gradient(0deg, rgba(112, 82, 46, 0.035) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(112, 82, 46, 0.025) 0 1px, transparent 1px 34px),
    var(--bg);
  color: var(--ink);
}

main {
  width: min(1480px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 30px 0 34px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
  min-width: 0;
}

.control-stack {
  display: grid;
  gap: 10px;
  justify-items: end;
  flex: 0 0 auto;
  min-width: 0;
}

.control-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.control-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-align: right;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.intro {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.page-tabs a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--switch-bg);
  color: var(--muted);
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.page-tabs a:hover,
.page-tabs a:focus-visible,
.page-tabs a[aria-current="page"] {
  border-color: var(--active-bg);
  background: var(--active-bg);
  color: var(--active-ink);
  outline: none;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--switch-bg);
  box-shadow: 0 10px 26px rgba(20, 27, 45, 0.08);
  max-width: 100%;
}

.segmented-control button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-width: 0;
}

.segmented-control button[aria-pressed="true"] {
  background: var(--active-bg);
  color: var(--active-ink);
}

.git-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 12px;
  min-height: var(--map-height, 560px);
  padding: 24px 18px var(--map-bottom, 260px);
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 18px;
  background: var(--map-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: min-height 220ms ease, padding-bottom 220ms ease;
}

.map-shell {
  max-width: 100%;
  overflow: visible;
}

.map-jumps {
  display: none;
}

.flow-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.command-flow {
  pointer-events: auto;
  cursor: pointer;
}

.lifeline {
  opacity: 0.42;
  filter: drop-shadow(0 4px 10px rgba(20, 27, 45, 0.08));
  transition: opacity 160ms ease, stroke-width 160ms ease;
}

.lifeline.is-selected,
.lifeline.is-active {
  opacity: 1;
  stroke-width: 2.5;
}

.lifeline-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0.9;
}

.lifeline-labels {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 12px;
  pointer-events: none;
}

.lifeline-labels span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-ribbon {
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}

.flow-ribbon.is-visible {
  opacity: 1;
  animation: ribbon-in 380ms ease both;
}

.flow-ribbon.is-active {
  filter: saturate(1.15) brightness(1.02);
}

.flow-line {
  opacity: 0;
  transition: opacity 160ms ease;
}

.flow-line.is-visible {
  opacity: 0.8;
  animation: ribbon-in 380ms ease both;
}

.command-flow.is-daily-path .flow-ribbon.is-visible {
  opacity: 1;
}

.git-map.is-everything .flow-ribbon.is-visible {
  opacity: 0.68;
}

.git-map.is-everything .command-flow.is-active .flow-ribbon,
.git-map.is-everything .command-flow:hover .flow-ribbon {
  opacity: 1;
}

.flow-ribbon.is-danger {
  stroke: var(--danger-stroke);
  stroke-width: 1.5;
}

.flow-label {
  opacity: 0;
  fill: var(--ribbon-ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
  paint-order: stroke;
  stroke: color-mix(in srgb, var(--ink) 20%, transparent);
  stroke-width: 2px;
  stroke-linejoin: round;
  transition: opacity 160ms ease;
  pointer-events: none;
}

.flow-label.is-visible {
  opacity: 1;
}

.flow-label.is-danger {
  fill: var(--ribbon-ink);
}

.flow-daily-marker,
.flow-daily-marker-text {
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.flow-daily-marker {
  fill: var(--panel);
  stroke: var(--ink);
  stroke-width: 1.5px;
}

.flow-daily-marker-text {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.flow-daily-marker.is-visible,
.flow-daily-marker-text.is-visible {
  opacity: 0.9;
}

@keyframes ribbon-in {
  from {
    opacity: 0;
    transform: translateY(4px) scaleX(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scaleX(1);
  }
}

.zone {
  position: relative;
  z-index: 2;
  min-height: 228px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(20, 27, 45, 0.045);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.git-map.has-selection .zone:not(.is-selected):not(.is-related) {
  opacity: 0.82;
  filter: grayscale(0.12);
  transform: scale(0.985);
}

.git-map.has-selection .zone.is-related:not(.is-selected) {
  opacity: 0.96;
}

.git-map.has-selection .zone.is-main-path:not(.is-selected) {
  opacity: 0.9;
}

.zone:hover,
.zone:focus-visible,
.zone.is-selected {
  transform: translateY(-4px);
  border-color: var(--zone-color);
  box-shadow: 0 18px 38px rgba(20, 27, 45, 0.11);
  outline: none;
}

.zone.is-command-active {
  border-color: color-mix(in srgb, var(--zone-color) 72%, var(--line));
  box-shadow: 0 20px 42px color-mix(in srgb, var(--zone-color) 18%, transparent);
}

.zone.is-pinned::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 12px;
  height: 12px;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: var(--zone-color);
  box-shadow: 0 3px 8px color-mix(in srgb, var(--zone-color) 40%, transparent);
}

.zone::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--zone-color);
}

.zone-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.zone-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--zone-color) 12%, var(--panel));
  color: var(--zone-color);
  font-weight: 900;
  font-size: 1.05rem;
}

.zone-scene {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 48px);
  border: 1px solid color-mix(in srgb, var(--zone-color) 26%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--zone-color) 6%, var(--panel));
  color: color-mix(in srgb, var(--zone-color) 82%, var(--ink));
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  padding: 6px 8px;
  transition: transform 160ms ease, background 160ms ease;
}

.zone:hover .zone-scene,
.zone:focus-visible .zone-scene,
.zone.is-command-active .zone-scene {
  background: color-mix(in srgb, var(--zone-color) 12%, var(--panel));
  transform: translateY(-1px);
}

.zone-scene span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-shape {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 18px;
  flex: 0 0 auto;
  color: currentColor;
}

.place-shape::before,
.place-shape::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.place-shelf .place-shape {
  border-bottom: 3px solid currentColor;
}

.place-shelf .place-shape::before {
  left: 2px;
  top: 4px;
  width: 4px;
  height: 9px;
  border-radius: 2px 2px 0 0;
  box-shadow: 7px 0 0 currentColor, 14px 0 0 currentColor;
}

.place-desk .place-shape::before {
  left: 1px;
  right: 1px;
  top: 5px;
  height: 4px;
  border-radius: 3px;
}

.place-desk .place-shape::after {
  left: 4px;
  top: 9px;
  width: 3px;
  height: 8px;
  box-shadow: 13px 0 0 currentColor;
}

.place-packing .place-shape {
  border: 2px solid currentColor;
  border-radius: 3px;
}

.place-packing .place-shape::before {
  left: 9px;
  top: 0;
  width: 2px;
  height: 16px;
  opacity: 0.75;
}

.place-packing .place-shape::after {
  left: 2px;
  right: 2px;
  top: 7px;
  height: 2px;
  opacity: 0.75;
}

.place-archive .place-shape {
  border: 2px solid currentColor;
  border-radius: 3px;
}

.place-archive .place-shape::before {
  left: 2px;
  right: 2px;
  top: 5px;
  height: 2px;
}

.place-archive .place-shape::after {
  left: 8px;
  top: 10px;
  width: 8px;
  height: 2px;
}

.place-mailbox .place-shape::before {
  left: 2px;
  top: 5px;
  width: 18px;
  height: 10px;
  border-radius: 10px 10px 2px 2px;
}

.place-mailbox .place-shape::after {
  right: 0;
  top: 2px;
  width: 3px;
  height: 15px;
  border-radius: 2px;
}

.zone h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.zone p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.91rem;
}

.zone code {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 0.8rem;
  white-space: normal;
}

.details {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.35fr);
  gap: 16px;
  margin-top: 18px;
  align-items: start;
}

.command-panel,
.legend {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
  box-shadow: 0 14px 34px rgba(20, 27, 45, 0.08);
}

.command-panel {
  padding: 18px;
  position: sticky;
  top: 16px;
}

.workflow-console {
  margin-top: 18px;
}

.workflow-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.workflow-heading span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workflow-heading h2 {
  margin: 3px 0 0;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.15;
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.35fr);
  gap: 16px;
  align-items: start;
}

.workflow-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
  box-shadow: 0 14px 34px rgba(20, 27, 45, 0.08);
  padding: 18px;
}

.workflow-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.workflow-card h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.workflow-card-header p {
  max-width: 580px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

.status-input-label,
.journey-select-label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-lens textarea {
  width: 100%;
  min-height: 188px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-ink);
  font: 0.86rem/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  padding: 12px;
}

.status-lens textarea:focus,
.journey-select-label select:focus {
  border-color: var(--blue);
  outline: 3px solid color-mix(in srgb, var(--blue) 18%, transparent);
}

.workflow-actions,
.journey-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.workflow-actions button,
.journey-controls button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  padding: 0 12px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.workflow-actions button:hover,
.workflow-actions button:focus-visible,
.journey-controls button:hover:not(:disabled),
.journey-controls button:focus-visible:not(:disabled) {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 9%, var(--panel));
  color: var(--blue);
  outline: none;
  transform: translateY(-1px);
}

.journey-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.status-analysis {
  margin-top: 12px;
}

.status-analysis-empty,
.status-analysis-card {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.status-analysis-empty strong,
.status-analysis-card strong {
  display: block;
  font-size: 0.98rem;
}

.status-analysis-empty p,
.status-analysis-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

.analysis-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.analysis-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}

.analysis-signals span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.analysis-signals b {
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 0.76rem;
  padding: 4px 7px;
}

.status-analysis-card .status-helper-action {
  margin-top: 12px;
}

.journey-select-label {
  min-width: 220px;
}

.journey-select-label select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 8px 10px;
}

.journey-current {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--journey-color, var(--blue)) 30%, var(--line));
  border-radius: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--journey-color, var(--blue)) 9%, transparent), transparent 52%),
    var(--panel-soft);
  padding: 14px 14px 14px 18px;
}

.journey-current::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--journey-color, var(--blue));
}

.journey-current > span,
.journey-receipt > span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.journey-current strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.journey-current code {
  display: inline-block;
  max-width: 100%;
  margin-top: 9px;
  border-radius: 6px;
  background: var(--solid-bg);
  color: var(--solid-ink);
  font-size: 0.82rem;
  padding: 5px 8px;
  white-space: normal;
}

.journey-current p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

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

.journey-steps button {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 8px 10px;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.journey-steps button:hover,
.journey-steps button:focus-visible,
.journey-steps button[aria-current="step"] {
  border-color: var(--journey-color);
  background: color-mix(in srgb, var(--journey-color) 9%, var(--panel));
  outline: none;
  transform: translateY(-1px);
}

.journey-steps span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--journey-color);
  color: var(--ribbon-ink);
  font-size: 0.74rem;
  font-weight: 900;
}

.journey-steps strong {
  min-width: 0;
  font-size: 0.86rem;
  line-height: 1.2;
}

.journey-receipt {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.journey-receipt pre {
  max-height: 170px;
  overflow: auto;
  margin: 7px 0 0;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 11px;
}

.journey-receipt code {
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.mode-note,
.area-summary {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.mode-note[hidden],
.area-summary[hidden] {
  display: none;
}

.mode-note strong,
.area-summary strong {
  color: var(--ink);
}

.area-summary code {
  border-radius: 6px;
  padding: 2px 5px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 0.82rem;
}

.command-spotlight {
  position: relative;
  overflow: hidden;
  margin: 0 0 12px;
  border: 1px solid color-mix(in srgb, var(--spot-color, var(--blue)) 30%, var(--line));
  border-radius: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--spot-color, var(--blue)) 9%, transparent), transparent 48%),
    var(--panel-strong);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 42%, transparent);
  padding: 14px 14px 13px 18px;
}

.command-spotlight[hidden] {
  display: none;
}

.command-spotlight::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--spot-color, var(--blue));
}

.spotlight-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.spotlight-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.command-spotlight h3 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.2;
}

.spotlight-route {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 48%;
  border: 1px solid color-mix(in srgb, var(--spot-color, var(--blue)) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--spot-color, var(--blue)) 7%, var(--panel));
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
  padding: 7px 9px;
  white-space: nowrap;
}

.spotlight-route span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-route b {
  color: var(--spot-color, var(--blue));
  flex: 0 0 auto;
}

.spotlight-command-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.spotlight-command-row code {
  display: inline-block;
  max-width: 100%;
  border-radius: 7px;
  background: var(--solid-bg);
  color: var(--solid-ink);
  font-size: 0.82rem;
  padding: 5px 8px;
  white-space: normal;
}

.spotlight-copy {
  --cmd-color: var(--spot-color, var(--blue));
}

.spotlight-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 13px 0 0;
}

.spotlight-facts div {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.spotlight-facts dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.spotlight-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.35;
}

.spotlight-preview,
.command-preview,
.journey-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.spotlight-preview div,
.command-preview div,
.journey-preview div {
  min-width: 0;
}

.spotlight-preview span,
.command-preview span,
.journey-preview span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.spotlight-preview p,
.command-preview p,
.journey-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.spotlight-preview p {
  color: var(--ink);
}

.command-panel h2,
.legend h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.command-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.command-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: var(--panel-strong);
  cursor: pointer;
  min-height: 106px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.command-card.is-danger {
  border-color: var(--warning-line);
  background: var(--warning-soft);
}

.command-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.command-card:hover,
.command-card:focus-visible,
.command-card.is-active {
  border-color: var(--cmd-color);
  background: color-mix(in srgb, var(--cmd-color) 7%, var(--panel));
  transform: translateY(-2px);
  outline: none;
}

.command-card strong {
  display: block;
  font-size: 0.95rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--warning-soft);
  color: var(--warning-ink);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.badge-daily {
  border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
  background: color-mix(in srgb, var(--blue) 9%, var(--panel));
  color: var(--blue);
}

.command-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.command-card code {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--solid-bg);
  color: var(--solid-ink);
  font-size: 0.8rem;
  white-space: normal;
}

.copy-button {
  min-width: 44px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--code-ink);
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.copy-button:hover,
.copy-button:focus-visible {
  border-color: var(--cmd-color, var(--ink));
  background: var(--panel-strong);
  color: var(--cmd-color, var(--ink));
  outline: none;
}

.command-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.38;
}

.command-card > .command-preview {
  grid-template-columns: 1fr;
}

.legend {
  padding: 18px;
}

.legend-grid {
  display: grid;
  gap: 12px;
}

.legend-item {
  display: grid;
  grid-template-columns: minmax(16px, max-content) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.95rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--dot);
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 9%, var(--panel));
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
  white-space: nowrap;
}

.legend-pill b {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.64rem;
  line-height: 1;
}

.learn-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.learn-section h3 {
  margin: 0 0 10px;
  font-size: 0.96rem;
  letter-spacing: 0;
}

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

.path-steps li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  align-items: start;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.path-steps code {
  border-radius: 6px;
  padding: 2px 5px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 0.8rem;
}

.path-steps b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--solid-bg);
  color: var(--solid-ink);
  font-size: 0.72rem;
}

.status-helper-select {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-helper-select select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 8px 10px;
}

.status-helper-result {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.status-helper-result p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

.status-helper-groups {
  display: grid;
  gap: 8px;
}

.status-helper-groups div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.status-helper-groups span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-helper-groups code {
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 0.78rem;
  padding: 3px 6px;
  white-space: normal;
}

.status-helper-result small {
  color: var(--warning-ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-helper-action {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--solid-bg);
  color: var(--solid-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.status-helper-action:hover,
.status-helper-action:focus-visible {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, var(--solid-bg));
  outline: none;
  transform: translateY(-1px);
}

.tool-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.tool-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
}

.tool-card.is-danger {
  border-color: var(--warning-line);
  background: var(--warning-soft);
}

.tool-card code {
  display: inline-block;
  margin-bottom: 7px;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 0.8rem;
  white-space: normal;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.38;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.empty-state strong {
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.branch-topbar {
  align-items: start;
}

.branch-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 16px;
  align-items: start;
}

.branch-stage,
.branch-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
  box-shadow: 0 14px 34px rgba(20, 27, 45, 0.08);
}

.branch-stage {
  overflow: hidden;
}

.branch-stage-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.branch-stage-header h2,
.branch-panel h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.branch-stage-header p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.branch-current {
  min-width: 142px;
  height: max-content;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 10px 12px;
}

.branch-current span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.branch-current strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
}

.branch-graph-shell {
  width: 100%;
  overflow: auto;
  background: var(--map-bg);
}

.branch-graph {
  display: block;
  width: max(980px, 100%);
  min-height: 420px;
}

.branch-line,
.merge-line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  opacity: 0.84;
}

.branch-line.is-selected {
  stroke-width: 7;
  opacity: 1;
}

.merge-line {
  stroke-width: 4;
  stroke-dasharray: 8 8;
}

.branch-label {
  cursor: pointer;
}

.branch-label rect {
  filter: drop-shadow(0 8px 14px rgba(20, 27, 45, 0.12));
}

.branch-label text {
  fill: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
  pointer-events: none;
}

.branch-label.is-current rect {
  stroke: var(--panel);
  stroke-width: 3;
}

.commit-node {
  cursor: pointer;
  outline: none;
}

.commit-node circle:first-child {
  filter: drop-shadow(0 8px 14px rgba(20, 27, 45, 0.14));
  stroke: var(--panel);
  stroke-width: 3;
  transition: stroke-width 160ms ease, transform 160ms ease;
}

.commit-node:hover circle:first-child,
.commit-node:focus-visible circle:first-child,
.commit-node.is-selected circle:first-child {
  stroke: var(--ink);
  stroke-width: 4;
}

.commit-node.is-conflict circle:first-child {
  stroke: var(--warning-line);
  stroke-width: 4;
}

.commit-node text {
  fill: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  pointer-events: none;
}

.commit-node text + text {
  font-size: 0.68rem;
  font-weight: 700;
}

.branch-controls {
  display: grid;
  gap: 16px;
}

.branch-panel {
  padding: 18px;
}

.action-section,
.form-grid,
.action-grid,
.merge-row,
.utility-row {
  display: grid;
  gap: 10px;
  margin-top: 13px;
}

.action-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
}

.section-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.section-title-row h3 {
  margin: 0;
  font-size: 0.98rem;
  letter-spacing: 0;
}

.section-title-row span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: right;
}

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

.merge-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) max-content;
  align-items: end;
}

.utility-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 13px;
}

.branch-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.branch-panel input,
.branch-panel select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 8px 10px;
}

.branch-panel button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--code-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 900;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.branch-panel button:hover:not(:disabled),
.branch-panel button:focus-visible:not(:disabled) {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, var(--panel));
  color: var(--blue);
  outline: none;
  transform: translateY(-1px);
}

.branch-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.branch-panel .primary-action {
  background: var(--solid-bg);
  color: var(--solid-ink);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.command-history {
  display: grid;
  gap: 10px;
  max-height: 472px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
  overflow: auto;
}

.command-history li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
}

.command-history strong,
.command-history span {
  display: block;
}

.command-history strong {
  font-size: 0.9rem;
}

.command-history pre {
  margin: 8px 0;
  border-radius: 7px;
  background: var(--solid-bg);
  color: var(--solid-ink);
  overflow: auto;
  padding: 9px;
}

.command-history code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.82rem;
  white-space: pre;
}

.command-history span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

@media (max-width: 1120px) {
  .topbar,
  .details,
  .workflow-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .control-stack {
    justify-items: start;
  }

  .command-panel {
    position: static;
  }

  .branch-workbench {
    grid-template-columns: 1fr;
  }

  .map-jumps {
    display: flex;
    gap: 8px;
    margin: 0 0 10px;
    overflow-x: auto;
    padding: 2px 0 8px;
    scrollbar-width: thin;
  }

  .map-jump {
    min-width: 46px;
    height: 38px;
    border: 1px solid color-mix(in srgb, var(--jump-color) 42%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--jump-color) 9%, var(--panel));
    color: var(--jump-color);
    cursor: pointer;
    flex: 0 0 auto;
    font: inherit;
    font-weight: 900;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
  }

  .map-jump:hover,
  .map-jump:focus-visible,
  .map-jump[aria-pressed="true"] {
    border-color: var(--jump-color);
    background: var(--jump-color);
    color: var(--active-ink);
    outline: none;
    transform: translateY(-1px);
  }

  .map-shell {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 12px;
    scrollbar-color: var(--line-strong) transparent;
    scrollbar-width: thin;
  }

  .git-map {
    width: max(1040px, 100%);
    grid-template-columns: repeat(5, minmax(170px, 1fr));
  }
}

@media (max-width: 720px) {
  main {
    width: min(calc(100vw - 24px), 560px);
    padding-top: 20px;
  }

  .command-list,
  .tool-list,
  .spotlight-facts,
  .spotlight-preview,
  .journey-preview {
    grid-template-columns: 1fr;
  }

  .workflow-heading,
  .workflow-card-header {
    display: grid;
  }

  .workflow-card {
    padding: 14px;
  }

  .journey-select-label {
    min-width: 0;
  }

  .journey-steps {
    grid-template-columns: 1fr;
  }

  .spotlight-top {
    display: grid;
  }

  .spotlight-route {
    max-width: 100%;
    width: max-content;
  }

  .segmented-control {
    width: 100%;
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }

  .control-stack,
  .control-group {
    width: 100%;
  }

  .control-label {
    text-align: left;
  }

  .segmented-control button {
    overflow: hidden;
    padding-inline: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .map-jumps {
    margin-top: -2px;
  }

  .branch-stage-header {
    display: grid;
  }

  .merge-row {
    grid-template-columns: 1fr;
  }

  .git-map {
    width: 1040px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

}
