/* Layout: one column on phones, cards in an auto-fill grid on wider screens.
   The stage strip on top is the real launch sequence, so it is numbered. */
.alb {
  --bg: #f3f5f8; --surface: #ffffff; --ink: #142030; --muted: #5a6779; --line: #dde2ea;
  --accent: #2550c7; --accent-soft: #e6ecfb;
  --s-idea: #7a6fb3; --s-building: #2f6fd6; --s-testing: #b7791f; --s-submitted: #8a4fc7; --s-live: #1f8a5b; --s-paused: #7c8594;
  --warn-bg: #fff5e0; --warn-ink: #7a4b00;
  --f-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .alb {
    --bg: #0f1520; --surface: #172030; --ink: #e8edf5; --muted: #9aa7ba; --line: #26324a;
    --accent: #7c9cf5; --accent-soft: #1d2a47;
    --s-idea: #a99cf0; --s-building: #6fa2f5; --s-testing: #e3a94a; --s-submitted: #bb8af0; --s-live: #4cc58e; --s-paused: #8e98a8;
    --warn-bg: #3a2a0c; --warn-ink: #f4cf86; color-scheme: dark;
  }
}
:root[data-theme="dark"] .alb {
  --bg: #0f1520; --surface: #172030; --ink: #e8edf5; --muted: #9aa7ba; --line: #26324a;
  --accent: #7c9cf5; --accent-soft: #1d2a47;
  --s-idea: #a99cf0; --s-building: #6fa2f5; --s-testing: #e3a94a; --s-submitted: #bb8af0; --s-live: #4cc58e; --s-paused: #8e98a8;
  --warn-bg: #3a2a0c; --warn-ink: #f4cf86; color-scheme: dark;
}

body:has(.alb) { margin: 0; background: #f3f5f8; }
@media (prefers-color-scheme: dark) { body:has(.alb) { background: #0f1520; } }

.alb { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); min-height: 100vh;
  padding-block: 20px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 20px; align-content: start; max-width: 1240px; margin: 0 auto; box-sizing: border-box; }
.alb *, .alb *::before, .alb *::after { box-sizing: border-box; }
/* Author display rules must not override the hidden attribute, and grid children
   must not grow the page to the width of a nowrap table. */
.alb [hidden] { display: none !important; }
.alb > * { min-width: 0; }
.alb .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.alb-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 8px 16px; }
.alb-eyebrow { margin: 0 0 4px; font: 500 12px/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.alb-title { margin: 0; font: 700 clamp(26px, 5vw, 36px)/1.1 var(--f-display); letter-spacing: -.02em; text-wrap: balance; }
.alb-updated { margin: 0; font: 400 12px/1.3 var(--f-mono); color: var(--muted); }
.alb-h2 { margin: 0 0 10px; font: 600 17px/1.3 var(--f-display); }

/* Stage strip */
.alb-pipe { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.alb-stage { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px;
  padding: 10px 8px 9px; text-align: left; cursor: pointer; display: grid; gap: 2px; position: relative; overflow: hidden; font: inherit; }
.alb-stage::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); }
.alb-stage[aria-pressed="true"] { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.alb-stage .n { font: 500 11px/1 var(--f-mono); color: var(--muted); }
.alb-stage .k { font: 700 22px/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.alb-stage .l { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alb-stage:focus-visible, .alb-chip:focus-visible, .alb-card:focus-visible, .alb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) { .alb-pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Summary tiles */
.alb-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.alb-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.alb-tile .v { font: 700 24px/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.alb-tile .t { font-size: 12.5px; color: var(--muted); }
@media (max-width: 720px) { .alb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Filters */
.alb-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.alb-search { flex: 1 1 240px; min-width: 0; }
.alb-search input { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-height: 44px; }
.alb-chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.alb-chip { appearance: none; font: 500 13px/1 var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 13px; min-height: 36px; cursor: pointer; }
.alb-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }

/* Cards */
.alb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.alb-card { appearance: none; text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 14px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.alb-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.alb-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.alb-name { margin: 0; font: 600 17px/1.25 var(--f-display); letter-spacing: -.01em; min-width: 0; }
.alb-desc { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.alb-pill { display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .05em;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); padding: 6px 9px; border-radius: 999px; white-space: nowrap; }
.alb-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.alb-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.alb-tag { font: 500 12px/1 var(--f-body); padding: 5px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--ink); }
.alb-tag.aud { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.alb-kv { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: 13.5px; }
.alb-kv dt { color: var(--muted); font: 500 11.5px/1.7 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; }
.alb-kv dd { margin: 0; overflow-wrap: anywhere; }
.alb-blocker { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.alb-empty { grid-column: 1 / -1; color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; }

/* History */
.alb-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.alb-hist li { background: var(--surface); padding: 10px 14px; font-size: 13.5px; display: grid; gap: 2px; }
.alb-hist .when { font: 400 12px/1.3 var(--f-mono); color: var(--muted); }

.alb-foot { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.alb-btn { appearance: none; font: 500 13.5px/1 var(--f-body); border-radius: 10px; padding: 11px 14px; min-height: 42px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.alb-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }

/* Detail dialog */
.alb-dialog { border: 0; padding: 0; background: transparent; max-width: min(640px, calc(100vw - 24px)); width: 100%; max-height: calc(100dvh - 24px); }
.alb-dialog::backdrop { background: rgb(10 16 28 / .5); }
.alb-d-inner { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 18px 18px 20px; display: grid; gap: 14px;
  font: 15px/1.5 var(--f-body); max-height: calc(100dvh - 24px); overflow: auto; }
.alb-d-inner .alb-kv { grid-template-columns: 110px minmax(0, 1fr); }
.alb-d-inner h2 { margin: 0; font: 700 22px/1.2 var(--f-display); }
.alb-edit { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.alb-edit label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.alb-edit select, .alb-edit input, .alb-edit textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; min-height: 42px; width: 100%; }
.alb-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.alb-msg { font-size: 13px; min-height: 1em; margin: 0; }
.alb-mono { font-family: var(--f-mono); font-size: 12.5px; }
@media (prefers-reduced-motion: no-preference) { .alb-card { transition: border-color .15s; } }

/* Board / Metrics */
.alb-tabs { display: flex; gap: 8px; }
.alb-tab { appearance: none; font: 600 14px/1 var(--f-body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; min-height: 42px; cursor: pointer; }
.alb-tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.alb-metrics { display: grid; gap: 16px; }
.alb-metrics > * { min-width: 0; }
.alb-banner { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.alb-banner.info { background: var(--accent-soft); color: var(--ink); }
.alb-banner.warn { background: var(--warn-bg); color: var(--warn-ink); }
.alb-note { margin: 0; color: var(--muted); font-size: 13px; }
.alb-miss { color: var(--muted); font-style: italic; }
.alb-up { color: var(--s-live); font-variant-numeric: tabular-nums; }
.alb-down { color: var(--warn-ink); font-variant-numeric: tabular-nums; }
.alb-vs { color: var(--muted); font: 400 13px/1 var(--f-body); }
.alb-tablewrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.alb-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.alb-table th, .alb-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.alb-table th { font: 500 11.5px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.alb-table td.wrap, .alb-table th.wrap { white-space: normal; }
.alb-linkish { appearance: none; background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-align: left; }
.alb-bars { display: flex; align-items: flex-end; justify-content: flex-start; gap: 8px; height: 168px; overflow-x: auto; padding: 12px 12px 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.alb-bar { flex: 0 0 36px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.alb-bar .bar { display: block; width: 22px; background: var(--accent); border-radius: 3px 3px 0 0; }
.alb-bar .lbl { font: 10px/1.2 var(--f-mono); color: var(--muted); }
.alb-review { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; }
.alb-review .who { font: 500 12px/1.3 var(--f-mono); color: var(--muted); }
