/* ── buttons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; min-height: 44px;
  border-radius: 12px; border: 1px solid transparent;
  font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 88%, black); }
.btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--fg); }
.btn-ghost { background: transparent; color: var(--fg); border-color: transparent; padding-inline: 10px; }
.btn-ghost:hover { background: color-mix(in oklab, var(--fg) 7%, transparent); }
.btn-arrow::after { content: '→'; transition: transform .15s ease; }
.btn-arrow:hover::after { transform: translateX(2px); }
.btn-danger { background: transparent; color: oklch(52% 0.19 25); border-color: color-mix(in oklab, oklch(52% 0.19 25) 32%, transparent); }
.btn-danger:hover { background: color-mix(in oklab, oklch(52% 0.19 25) 10%, transparent); }

/* ── series chips ────────────────────────── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding-block: 14px 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--fg);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip .count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.chip-x { width: 20px; height: 20px; border: 0; background: transparent; border-radius: 50%; color: var(--muted); display: grid; place-items: center; padding: 0; }
.chip-x:hover { background: color-mix(in oklab, var(--fg) 9%, transparent); color: var(--fg); }
.chip-x svg { width: 10px; height: 10px; }
.chip-pause { border: 0; background: transparent; font-size: 11px; font-family: var(--font-mono); color: var(--muted); padding: 2px 4px; border-radius: 6px; }
.chip-paused { opacity: 0.6; }
.chip-add {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-pill); border: 1px dashed var(--muted);
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; min-height: 32px;
}
.chip-add:hover, .chip-add:focus { color: var(--accent); border-color: var(--accent); }
.chip-add svg { width: 12px; height: 12px; }

/* ── calendar card ───────────────────────── */
.calcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.cal-head div {
  padding: 10px 0 8px; margin: 0 7px; text-align: left;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.cal-body { display: grid; grid-template-columns: repeat(7, 1fr); }
.day {
  min-height: 112px; padding: 7px 7px 6px; position: relative;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px; align-items: stretch;
  background: var(--surface); cursor: pointer; text-align: left; border-top: 0; border-left: 0;
  transition: background .12s ease; font: inherit;
}
.day:nth-child(7n) { border-right: 0; }
.day:hover { background: color-mix(in oklab, var(--accent) 7%, var(--surface)); }
.day.dim { background: color-mix(in oklab, var(--bg) 60%, var(--surface)); }
.day-top { display: flex; align-items: center; justify-content: flex-start; gap: 4px; }
.day-num { font-family: var(--font-mono); font-size: 12px; color: var(--muted); min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; font-variant-numeric: tabular-nums; padding: 0 3px; }
.day.today .day-num { background: var(--accent); color: white; font-weight: 700; }
.day-evs { display: flex; flex-direction: column; gap: 3px; margin-top: 1px; min-width: 0; overflow: hidden; }
.ev {
  font-size: 11.5px; font-weight: 600; line-height: 1.3;
  padding: 2.5px 7px; border-radius: 7px; border: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  width: 100%; text-align: left; display: block;
}
.ev:hover { filter: brightness(0.96); }
.ev.fav::before { content: "★ "; font-size: 8.5px; vertical-align: 1px; }
.ev.muted { opacity: 0.42; text-decoration: line-through; text-decoration-thickness: 1px; }
.ev-more { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); background: none; border: 0; padding: 2px 8px; text-align: left; }
.ev-more:hover { color: var(--fg); }

/* category tints (12–26% mixes) */
.cat-music    { background: color-mix(in oklab, var(--cat-music) 14%, white); color: color-mix(in oklab, var(--cat-music) 62%, black); }
.cat-kids     { background: color-mix(in oklab, var(--cat-kids) 26%, white); color: color-mix(in oklab, var(--cat-kids) 50%, black); }
.cat-arts     { background: color-mix(in oklab, var(--cat-arts) 14%, white); color: color-mix(in oklab, var(--cat-arts) 58%, black); }
.cat-outdoors { background: color-mix(in oklab, var(--cat-outdoors) 16%, white); color: color-mix(in oklab, var(--cat-outdoors) 58%, black); }
.cat-market   { background: color-mix(in oklab, var(--cat-market) 18%, white); color: color-mix(in oklab, var(--cat-market) 55%, black); }

/* ── agenda / list ───────────────────────── */
.listcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.list-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.005em; }
.list-count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px; }
.fbtn {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  padding: 6px 13px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 600; min-height: 32px;
  display: inline-flex; align-items: center; gap: 7px;
}
.fbtn .dot { width: 8px; height: 8px; border-radius: 50%; }
.fbtn[aria-pressed="true"] { background: var(--fg); color: var(--surface); border-color: var(--fg); }
.fbtn:hover { border-color: var(--fg); }
.ag-row {
  display: grid; grid-template-columns: 96px minmax(0,1fr) auto; gap: 16px; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--border); cursor: pointer; background: var(--surface);
}
.ag-row:hover { background: color-mix(in oklab, var(--accent) 6%, var(--surface)); }
.ag-date { text-align: center; }
.ag-date .d { font-family: var(--font-display); font-size: 25px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.ag-date .m { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.ag-body { min-width: 0; }
.ag-title { font-size: 15px; font-weight: 700; letter-spacing: -0.005em; display: flex; align-items: center; gap: 8px; min-width: 0; }
.ag-title .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-title .fav { color: var(--cat-kids); font-size: 13px; flex: none; }
.ag-venue { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.badge { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; padding: 3px 9px; border-radius: var(--radius-pill); border: 1px solid var(--border); color: var(--muted); text-transform: uppercase; }
.ag-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 13px; flex: none; }
.ag-actions { display: flex; gap: 2px; align-items: center; }
.icon-btn { width: 38px; height: 38px; border: 0; background: transparent; border-radius: 10px; color: var(--muted); display: grid; place-items: center; padding: 0; }
.icon-btn:hover { background: color-mix(in oklab, var(--fg) 7%, transparent); color: var(--fg); }
.icon-btn.faved { color: var(--cat-kids); background: color-mix(in oklab, var(--cat-kids) 14%, transparent); }
.icon-btn.faved svg path { fill: currentColor; }
.icon-btn.star { color: var(--muted); }
.icon-btn.star:hover { color: var(--cat-kids); }
.icon-btn svg { width: 18px; height: 18px; }
.day-favmark {
  margin-left: auto; color: var(--cat-kids); font-size: 11px; line-height: 1;
  flex: none; padding: 0 1px;
}
.empty { padding: 40px 24px; text-align: center; }
.empty .big { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin-bottom: 6px; }
.empty p { color: var(--muted); font-size: 13.5px; max-width: 40ch; margin-inline: auto; }

/* ── rail cards ──────────────────────────── */
.railcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.railcard h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.railcard .sub { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.railcard .sub.bottom { margin-bottom: 0; margin-top: 10px; }
.series-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.series-row:first-of-type { border-top: 0; padding-top: 2px; }
.series-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.series-main { flex: 1; min-width: 0; }
.series-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.series-sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.series-ctl { display: flex; gap: 2px; flex: none; }
.mini-btn { border: 0; background: transparent; color: var(--muted); font-size: 11px; font-family: var(--font-mono); padding: 5px 7px; border-radius: 7px; min-height: 26px; }
.mini-btn:hover { background: color-mix(in oklab, var(--fg) 8%, transparent); color: var(--fg); }
.nextup { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.nextup:first-of-type { border-top: 0; padding-top: 0; }
.nextup img { width: 52px; height: 52px; border-radius: 13px; object-fit: cover; flex: none; }
.nextup .nx-t { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.nextup .nx-w { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.nextup-btn { margin-top: 12px; width: 100%; }

/* ── dialogs ─────────────────────────────── */
dialog {
  border: 0; padding: 0; background: var(--surface); color: var(--fg);
  border-radius: var(--radius-lg); width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 720px);
  box-shadow: 0 24px 70px color-mix(in oklab, var(--fg) 28%, transparent);
}
dialog::backdrop { background: color-mix(in oklab, var(--fg) 45%, transparent); }
.dlg-pad { padding: 24px 26px 22px; overflow-y: auto; max-height: min(86vh, 720px); }
.dlg-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.dlg-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
.dlg-sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; max-width: 52ch; }
.dlg-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; padding: 0; }
.dlg-close:hover { background: color-mix(in oklab, var(--fg) 7%, transparent); color: var(--fg); }
.dlg-close svg { width: 15px; height: 15px; }
.steps { display: flex; gap: 6px; margin-top: 16px; }
.step { flex: 1; height: 4px; border-radius: 99px; background: color-mix(in oklab, var(--fg) 10%, transparent); }
.step.on { background: var(--accent); }
.promptbox { margin-top: 16px; }
.promptbox label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.promptbox textarea {
  width: 100%; min-height: 76px; resize: vertical;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  font: inherit; font-size: 14.5px; line-height: 1.5; background: var(--bg); color: var(--fg);
}
.promptbox textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent); }
.examples { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.exbtn { border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 12px; padding: 5px 11px; border-radius: var(--radius-pill); min-height: 28px; }
.exbtn:hover { color: var(--accent); border-color: var(--accent); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.planbox { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; background: var(--bg); }
.planbox .ph { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.planrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13px; }
.planrow:first-of-type { border-top: 0; padding-top: 0; }
.planrow .src { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-pill); padding: 2px 8px; color: var(--muted); flex: none; }
.planrow .q { flex: 1; min-width: 0; }
.planrow .q b { font-weight: 600; }
.pvrow { display: grid; grid-template-columns: 56px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.pvrow:first-of-type { border-top: 0; padding-top: 2px; }
.pvrow img { width: 56px; height: 42px; object-fit: cover; border-radius: 10px; }
.pv-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.pv-check { width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: transparent; display: grid; place-items: center; padding: 0; }
.pv-check[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: white; }
.pv-check svg { width: 12px; height: 12px; }
.success { text-align: center; padding-block: 8px 4px; }
.success .mark { width: 46px; height: 46px; border-radius: 14px; background: color-mix(in oklab, var(--accent) 14%, white); color: color-mix(in oklab, var(--accent) 70%, black); display: grid; place-items: center; margin: 0 auto 14px; }
.success .mark svg { width: 20px; height: 20px; }

/* event detail dialog */
.evd-hero { position: relative; }
.evd-hero img { width: 100%; height: 188px; object-fit: cover; }
.evd-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: color-mix(in oklab, white 78%, transparent); backdrop-filter: blur(6px); color: var(--fg); display: grid; place-items: center; padding: 0; }
.evd-close:hover { background: color-mix(in oklab, white 92%, transparent); }
.evd-close svg { width: 15px; height: 15px; }
.evd-body { padding: 20px 24px 22px; }
.evd-title { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.22; margin-top: 10px; }
.evd-rows { margin-top: 16px; display: grid; gap: 12px; }
.evd-row { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.evd-row svg { width: 17px; height: 17px; color: var(--muted); flex: none; margin-top: 1px; }
.evd-row .lbl { color: var(--muted); font-size: 12.5px; margin-bottom: 1px; }
.evd-row .val { font-weight: 500; }
.evd-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.evd-actions .btn { flex: 1; min-width: 130px; }
.evd-note { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 14px; line-height: 1.5; }

/* ── toast ───────────────────────────────── */
.init-error {
  margin: 16px 0 0; padding: 12px 16px;
  border: 1px solid color-mix(in oklab, oklch(52% 0.19 25) 35%, transparent);
  border-radius: var(--radius);
  background: color-mix(in oklab, oklch(52% 0.19 25) 8%, var(--surface));
  color: oklch(52% 0.19 25); font-size: 14px; font-weight: 500;
}

/* ── toast ───────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(14px);
  background: var(--fg); color: var(--bg); font-size: 13.5px; font-weight: 500;
  padding: 11px 18px; border-radius: 12px; box-shadow: 0 12px 32px color-mix(in oklab, var(--fg) 30%, transparent);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 90;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

dialog[open] { animation: dlg-in .18s ease; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }