/* ================= Buttons — plan §5.1 ================= */

/* Note: buttons in this codebase are built with just `.btn-primary` /
   `.btn-secondary` / `.btn-tertiary` / `.btn-danger` (no separate base
   `.btn` class token on the element), so the shared button rules below
   are attached to that whole selector list rather than to `.btn` alone. */
.btn-primary,
.btn-secondary,
.btn-tertiary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  margin-bottom: 20px;
  transition: transform 120ms var(--ease-standard), box-shadow 120ms var(--ease-standard), opacity 120ms var(--ease-standard);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-tertiary:disabled,
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-tertiary:focus-visible,
.btn-danger:focus-visible {
  outline: 4px solid rgba(106, 53, 184, 0.35);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--primary);
  color: var(--color-on-accent, #fff);
  box-shadow: var(--shadow-button);
}

.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--text-main);
  border: 1.5px solid var(--border-soft);
}

.btn-secondary:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }

.btn-tertiary {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
}

.btn-tertiary:hover:not(:disabled) { color: var(--text-main); }

.btn-danger {
  background: transparent;
  color: var(--git-conflict);
  border: 1.5px solid var(--git-conflict);
}

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

/* ================= Top nav tabs ================= */

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.nav-tab:hover { background: var(--surface-soft); color: var(--text-main); }

.nav-tab.is-active {
  background: var(--primary);
  color: #fff;
}

.nav-tab:focus-visible {
  outline: 3px solid rgba(106, 53, 184, 0.35);
  outline-offset: 2px;
}

/* ================= Status pill (project status bar) ================= */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.status-pill .value { color: var(--primary); }
.status-pill.is-remote { color: var(--text-muted); }

/* ================= Cards ================= */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
  padding: var(--space-5);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.card-header h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
}

.card-header .icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

/* ================= Git status chips — plan §5.3 ================= */

.git-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
}

.git-chip.is-modified { background: color-mix(in srgb, var(--git-modified) 14%, white); color: var(--git-modified); }
.git-chip.is-staged { background: color-mix(in srgb, var(--git-staged) 14%, white); color: var(--git-staged); }
.git-chip.is-committed { background: color-mix(in srgb, var(--git-committed) 14%, white); color: var(--git-committed); }
.git-chip.is-branch { background: color-mix(in srgb, var(--git-branch) 14%, white); color: var(--git-branch);margin-bottom: 20px; }
.git-chip.is-conflict { background: color-mix(in srgb, var(--git-conflict) 14%, white); color: var(--git-conflict); }

/* ================= Track-card text fragments =================
   The old track-card component (.track-card/.track-list/etc.) is gone
   now that the Studio uses the timeline block editor instead, but these
   three text-style classes are still used by js/mockup-screens.js (the
   static Remix/Merge previews) and js/demo-timeline.js's git-command
   line, so they stay. */

.track-card__name {
  font-weight: 800;
  font-size: 0.98rem;
}

.track-card__filename {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.track-card__desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ================= Song picker (character panel) ================= */
/* Which backing track "▶ 測試本段" / a Demo replay plays and times notes
   against — sits inside 櫻's character card (.character-panel), between
   her portrait/name block and her hint bubble. .character-panel is a flex
   column with its own `gap`, so no margin-bottom here — that would double
   up the spacing the flex `gap` already provides. Styled to match
   .demo-name-field's input. */

.song-picker {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.song-picker label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.song-picker select {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-main);
  cursor: pointer;
}

.song-picker select:focus-visible {
  outline: 3px solid rgba(217, 77, 130, 0.3);
  outline-offset: 1px;
  border-color: var(--primary);
}

/* ================= Timeline block editor ================= */
/* 4 lanes x 32 steps (2 measures). Replaces the old track-card list as
   the Studio's left column — clicking a cell places/removes a block, and
   grid-to-chart.js turns filled cells directly into rhythm-test notes. */

.timeline-editor-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Placement-mode toggle ("🖊 單點" / "▬ 長按") above the grid — see
   renderModeToggle() in timeline-editor.js. A plain two-button toggle
   rather than a second click gesture on the grid itself, since long-press/
   drag gestures are fragile across mouse+touch. */
.mode-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.mode-toggle__options {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-soft);
  border-radius: var(--radius-pill);
  gap: 2px;
}

.mode-toggle__option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 90ms var(--ease-standard), color 90ms var(--ease-standard);
}

.mode-toggle__option:hover {
  color: var(--text-main);
}

.mode-toggle__option.is-active {
  background: var(--primary);
  color: var(--surface);
}

.mode-toggle__hint {
  margin: 0;
}

.timeline-editor-scroll {
  /* No horizontal scroll at desktop/tablet widths (768px+) — the 32
     columns below are flexible (grid, repeat(32, 1fr)) and fill whatever
     width .studio-main gives the card. This only becomes a real scroll
     container again below the 767px breakpoint; see the comment there in
     responsive.css for why that bucket needs the old fixed-width
     fallback instead. */
  padding-bottom: var(--space-1);
}

.timeline-editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.timeline-lane {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.timeline-lane__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 168px;
  flex-shrink: 0;
}

.timeline-lane__key {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.timeline-lane__icon {
  color: var(--primary);
  flex-shrink: 0;
}

.timeline-lane__label {
  min-width: 0;
}

.timeline-lane__name {
  font-weight: 800;
  font-size: 0.85rem;
}

.timeline-lane__desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 128px;
}

.timeline-lane__cells {
  /* Grid instead of flex-with-fixed-width-cells: repeat(32, 1fr) divides
     whatever width this row has into 32 equal flexible columns, so the
     32-step timeline fills the card instead of needing to scroll. 32
     must match GRID_STEPS in timeline-state.js. */
  display: grid;
  grid-template-columns: repeat(32, 1fr);
  /* 2px read as one solid pink bar instead of 32 separate cells — bumped
     to the space-1 token so individual cells are actually distinguishable
     at a glance. */
  gap: var(--space-1);
  flex: 1 1 0;
  /* Without this, this flex item's (of .timeline-lane) automatic minimum
     width is its 32-column min-content size — wider than the row has
     room for — which would force the row (and everything above it) to
     overflow instead of letting the grid's fr columns shrink to fit. */
  min-width: 0;
  /* Positioning context for .timeline-hold's absolute percentage-based
     left/width below, so a capsule lines up with the grid columns
     regardless of viewport width. */
  position: relative;
}

.timeline-cell {
  height: 32px;
  padding: 0;
  border: none;
  border-left: 1px solid var(--border-soft);
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: background 90ms var(--ease-standard);
}

.timeline-cell:hover {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface-soft));
}

.timeline-cell.is-beat-start {
  border-left: 2px solid var(--border-soft);
}

.timeline-cell.is-measure-start {
  border-left: 3px solid var(--git-branch);
}

.timeline-cell:focus-visible {
  outline: 4px solid rgba(106, 53, 184, 0.35);
  outline-offset: 3px;
}

/* A placed block — a small rotated square, echoing the falling "petal"
   diamond renderer.js already draws in the real rhythm test. */
.timeline-cell.is-filled::after {
  content: "";
  position: absolute;
  /* A percentage instead of a fixed px inset, because .timeline-cell's
     width is now fluid (as narrow as ~13px at the 768px tablet width) —
     a fixed 6px inset left almost nothing of the marker visible on a
     ~13px-wide cell. 18% scales down with the cell instead. */
  inset: 18%;
  /* --lane-color is set per-row in timeline-editor.js and matches
     renderer.js's LANE_COLORS by lane index, so a block reads as the same
     color it'll fall as during "▶ 測試本段". Falls back to --primary if
     something renders a cell outside a .timeline-lane row. */
  background: var(--lane-color, var(--primary));
  transform: rotate(45deg);
  border-radius: 3px;
}

/* Cells placed since the last commit get a subtle ring so it's easy to
   see what this Demo would add. */
.timeline-cell.is-new {
  box-shadow: 0 0 0 2px var(--accent-pink) inset;
}

/* A step covered by a hold renders plain — the .timeline-hold capsule
   overlay (below) is what actually shows it. This just stops it from
   inheriting the empty-cell hover tint, so it doesn't look clickable-empty. */
.timeline-cell.is-hold-covered:hover {
  background: var(--surface-soft);
}

/* The in-progress hold's first click, waiting for a second click to
   finish it — see handleHoldModeClick() in timeline-state.js. A pulsing
   ring in the lane's own color, distinct from both the static is-new ring
   and the filled-in .timeline-hold capsule it will become. */
.timeline-cell.is-hold-pending {
  animation: hold-pending-pulse 1.1s ease-in-out infinite;
}

@keyframes hold-pending-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--lane-color, var(--primary)); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--lane-color, var(--primary)) 35%, transparent); }
}

/* The hold-note symbol itself: one connected capsule/bar spanning its
   start step through its end step (inclusive), instead of a strip of
   separate tap diamonds — see renderHoldCapsule() in timeline-editor.js.
   `pointer-events: none` so clicks pass through to the real cell buttons
   underneath (that's what makes "click anywhere in a hold to remove it"
   work without this overlay needing its own handler). Rounded pill shape
   plus two small end-dots keep its length legible at a glance even at
   narrow cell widths. */
.timeline-hold {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: var(--radius-pill);
  background: var(--lane-color, var(--primary));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--lane-color, var(--primary)) 55%, white) inset;
  pointer-events: none;
}

.timeline-hold::before,
.timeline-hold::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

.timeline-hold::before {
  left: 5px;
}

.timeline-hold::after {
  right: 5px;
}

.demo-change-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--git-staged) 8%, white);
  border: 1px solid color-mix(in srgb, var(--git-staged) 30%, white);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--git-staged);
}

.demo-change-summary i {
  color: var(--git-staged);
}

/* ================= Staging panel ================= */

.staging-empty {
  border: 1.5px dashed var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.demo-name-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-name-field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.demo-name-field input {
  font-family: inherit;
  font-size: 0.92rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-main);
}

.demo-name-field input:focus-visible {
  outline: 3px solid rgba(217, 77, 130, 0.3);
  outline-offset: 1px;
  border-color: var(--primary);
}

/* 調音筆記（js/portfolio.js）—— 跟 .demo-name-field label 同一套視覺語言，
   只是這裡的 label/textarea 沒有再包一層 flex 容器，label 跟 textarea 之間
   的間距改用 textarea 自己的 margin-top。 */
.tune-notes-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tune-notes-textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-main);
  resize: vertical;
}

.tune-notes-textarea:focus-visible {
  outline: 3px solid rgba(217, 77, 130, 0.3);
  outline-offset: 1px;
  border-color: var(--primary);
}

.field-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.field-note.is-error { color: var(--git-conflict); font-weight: 700; }

/* A tab's own intro/description paragraph, sitting directly above its main
   row of cards (e.g. .mockup-grid, or the "Demo 時光軸" list card) — needs
   more breathing room than the small inline hint-text .field-note is used
   for elsewhere (under form fields, modal subtitles, etc.), so this is a
   modifier added on top of .field-note rather than a change to the base
   class. 30px is a specific value the design called for, not one of the
   space-* tokens. */
.field-note.tab-description {
  margin-bottom: 30px;
}

/* Every other description/hint .field-note lives as a plain block-level
   child inside a .card (no flex `gap` between siblings there), so with no
   margin of its own it sits flush against whatever comes right after it —
   e.g. the timeline editor's "點格子放置..." hint above the block grid, the
   Demo-name field's helper/validation text, and the "沒有東西可以錄製"
   commit-blocked note. .tab-description's 30px is reserved for tab intros;
   this is the smaller "at least 20px before the next thing" version used
   everywhere else that needs its own spacing. */
.field-note.own-gap {
  margin-bottom: 20px;
}

.action-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ================= Character panel ================= */

.character-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.character-portrait {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-pink), var(--primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  flex-shrink: 0;
}

.character-panel__top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.character-name {
  font-weight: 800;
}

.character-role {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.character-producer {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 700;
  margin-top: 2px;
}

/* Wraps .character-bubble + .character-next when they're rendered next to
   the status bar's title (see .status-bar__title-group in layout.css) —
   caps their width so a long hint doesn't stretch the whole row, since
   they used to live in the narrow sidebar card and weren't designed for
   full-bleed width. */
.status-bar__character-hint {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 640px;
}

.character-bubble {
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: 0.9rem;
  line-height: 1.6;
  position: relative;
}

.character-next {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ================= Demo timeline ================= */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-node {
  display: flex;
  gap: var(--space-4);
  position: relative;
  padding-bottom: var(--space-5);
}

.timeline-node:last-child { padding-bottom: 0; }

.timeline-node__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-node__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--git-committed);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--git-committed);
  flex-shrink: 0;
}

.timeline-node__line {
  flex: 1;
  width: 2px;
  background: var(--border-soft);
  margin-top: 4px;
}

.timeline-node__card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.timeline-node__message {
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}

.timeline-node__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.timeline-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: var(--space-5);
  text-align: center;
  border: 1.5px dashed var(--border-soft);
  border-radius: var(--radius-md);
}

/* ================= Rhythm test extras ================= */

.lane-legend {
  /* Must land each key exactly above its lane's center in renderer.js's
     canvas (laneWidth = width / LANES.length, lane i's center =
     laneWidth * (i + 0.5)). A flex row centered as a group with fixed
     gaps between differently-sized items doesn't reliably divide into
     the same 4 equal fractions the canvas uses — grid with repeat(4,1fr)
     and NO column-gap does, as long as .lane-legend spans the exact same
     width as .rhythm-canvas-wrap (both are plain full-width children of
     .rhythm-modal__body, so they get it automatically). Adding a gap
     here would shift each column's center away from the canvas's
     gap-less lane centers, so intentionally leaving it out. */
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
}

.lane-key {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--primary);
  border: 1.5px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  transition: transform 90ms var(--ease-standard), background 90ms var(--ease-standard);
}

.lane-key.is-pressed {
  transform: translateY(2px) scale(0.94);
  background: var(--primary);
  color: #fff;
}

.rhythm-stats {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.rhythm-stats .stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rhythm-stats .stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}

.rhythm-stats .stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  display: inline-block; /* transform 動畫需要，行內元素不會套用 transform */
}

/* Combo 數字每次上升時的小彈跳動畫（純 CSS keyframe + JS class toggle，
   見 rhythm-test-modal.js 的 updateHud()）。 */
.rhythm-stats .stat-value.is-combo-bump {
  animation: comboBump 260ms var(--ease-standard);
}

@keyframes comboBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  70% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

.narrow-screen-hint {
  display: none;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* ================= Mockup / preview screens ================= */

.mockup-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--git-branch);
  background: color-mix(in srgb, var(--git-branch) 12%, white);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}

.mockup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

/* 旋律交會橋（js/merge-conflict.js）解鎖後的卡片直向堆疊——副歌撞稿事件／
   沒有衝突的軌道／每個衝突軌道／完成合併，一個接一個 append 進同一個
   container，沒有這個 class 的話彼此會直接黏在一起。 */
.merge-conflict-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.mockup-conflict-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4);
  align-items: stretch;
}

.mockup-conflict-col {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mockup-conflict-col.is-merge {
  background: var(--surface-soft);
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-tile .stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; }
.stat-tile .stat-value { font-size: 1.6rem; font-weight: 800; color: var(--primary); }

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: var(--space-6) 0 var(--space-3);
}

.section-title:first-child { margin-top: 0; }

/* ================= Loading / empty / error / completed states ================= */

.state-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
  padding: var(--space-6) var(--space-4);
}

.state-message h1 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
}

.state-message.is-error {
  color: var(--git-conflict);
}

.state-message.is-error i {
  color: var(--git-conflict);
  font-size: 1.8rem;
}

.sakura-spin {
  animation: sakura-spin 900ms linear infinite;
  font-size: 1.6rem;
  color: var(--primary);
}

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

@media (prefers-reduced-motion: reduce) {
  .sakura-spin { animation: none; }
  .timeline-cell.is-hold-pending { animation: none; box-shadow: 0 0 0 3px var(--lane-color, var(--primary)); }
}

.completed-stamp {
  font-size: 2.2rem;
  color: var(--result-perfect);
}

/* ================= Toast ================= */

#toast-host {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 200;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card-hover);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 0.88rem;
  max-width: 320px;
  animation: toast-in 200ms var(--ease-standard);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
