:root {
  --paper: #eceff4;
  --surface: #ffffff;
  --ink: #1a1f36;
  --ink-2: #5b6178;
  --line: #cfd4df;
  --velvet: #b3263a;
  --velvet-ink: #ffffff;
  --mint: #d6ece2;
  --mint-ink: #134a36;
  --past: #a5aabb;
  --sat: #2f62c9;
  --num: "Barlow Condensed", "Zen Kaku Gothic New", sans-serif;
  --jp: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141729; --surface: #1d2139; --ink: #e8eaf3; --ink-2: #a2a8c0; --line: #343a58;
    --velvet: #ff6b7d; --velvet-ink: #1a0b10; --mint: #1d3d33; --mint-ink: #bfe9d6; --past: #5c627e; --sat: #8fb0ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141729; --surface: #1d2139; --ink: #e8eaf3; --ink-2: #a2a8c0; --line: #343a58;
  --velvet: #ff6b7d; --velvet-ink: #1a0b10; --mint: #1d3d33; --mint-ink: #bfe9d6; --past: #5c627e; --sat: #8fb0ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--jp); font-size: 15px; line-height: 1.6;
  font-feature-settings: "palt";
}
button, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--velvet); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.top__inner, .tools, .days, .main, .foot { max-width: 1080px; margin: 0 auto; padding-inline: 16px; }
.top__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; }
.brand { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .04em; }
.pick-btn {
  flex: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: #b3263a; color: #fff; border: 0; border-radius: 999px; padding: 7px 8px 7px 16px; font-weight: 500;
}
.pick-btn__n { font-family: var(--num); font-weight: 600; min-width: 26px; padding: 0 6px; border-radius: 999px; background: #fff; color: #b3263a; text-align: center; }
.pick-btn:hover { background: #9a1f31; }

/* 日付の帯：ここが主役。大きな数字で1週間を一望 */
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding-top: 12px; padding-bottom: 10px; }
.day {
  appearance: none; border: 0; background: transparent; cursor: pointer; padding: 4px 0 6px;
  display: flex; flex-direction: column; align-items: center; gap: 0; border-radius: 10px; color: var(--ink-2);
}
.day__d { font-family: var(--num); font-weight: 600; font-size: 34px; line-height: 1; letter-spacing: -.01em; color: var(--ink); }
.day__w { font-size: 12px; }
.day[data-dow="0"] .day__w, .day[data-dow="0"] .day__d { color: var(--velvet); }
.day[data-dow="6"] .day__w { color: var(--sat); }
.day[aria-current="date"] { background: var(--ink); }
.day[aria-current="date"] .day__d, .day[aria-current="date"] .day__w { color: var(--paper); }
.day__m { font-family: var(--num); font-size: 13px; line-height: 1; height: 13px; }

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-bottom: 12px; }
.view { flex: none; height: 38px; }
.search input { height: 38px; }
.search { flex: 1 1 220px; }
.hide-past { margin-left: auto; }
.search input, .picker__filters input {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 12px;
}
.view { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view button { border: 0; background: var(--surface); padding: 6px 12px; cursor: pointer; color: var(--ink-2); }
.view button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.hide-past { font-size: 13px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }

/* ---------- theater blocks ---------- */
.main { padding-top: 20px; padding-bottom: 40px; display: grid; gap: 28px; }
.theater__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 4px; }
.theater__name { margin: 0; font-size: 20px; font-weight: 700; }
.theater__meta { font-size: 12px; color: var(--ink-2); }
.theater__link { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.theater__note { font-size: 13px; color: var(--ink-2); padding: 12px 0; }

.movie { display: grid; grid-template-columns: minmax(0, 15em) 1fr; gap: 6px 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.movie__title { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.45; }
.movie__title a { text-decoration: none; }
.movie__title a:hover { text-decoration: underline; }
.times { display: flex; flex-wrap: wrap; gap: 6px 18px; align-content: flex-start; }
.time { display: inline-flex; flex-direction: column; line-height: 1; min-width: 3.4em; }
.time__s { font-family: var(--num); font-weight: 600; font-size: 26px; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.time__e { font-size: 11px; color: var(--ink-2); margin-top: 3px; white-space: nowrap; }
.time.is-past .time__s, .time.is-past .time__e { color: var(--past); }
.time.is-next .time__s { color: var(--velvet); }

/* 時間順 */
.slot { display: grid; grid-template-columns: 4.6em 1fr; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.slot .time__s { font-size: 26px; }
.slot__title { font-weight: 500; }
.slot__sub { font-size: 12px; color: var(--ink-2); }
.slot.is-past { color: var(--past); }
.slot.is-past .slot__sub { color: var(--past); }

.empty { text-align: center; padding: 64px 16px; }
.empty__lead { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.primary, .ghost { border-radius: 8px; padding: 9px 18px; cursor: pointer; font-weight: 500; }
.primary { background: var(--velvet); color: var(--velvet-ink); border: 0; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
.empty .primary { margin-top: 16px; }

.foot { color: var(--ink-2); font-size: 12px; padding-bottom: 40px; }

/* ---------- picker ---------- */
.picker { border: 0; padding: 0; border-radius: 14px; width: min(860px, calc(100vw - 24px)); max-height: min(86vh, 900px); background: var(--surface); color: var(--ink); }
.picker::backdrop { background: rgba(10, 12, 25, .55); }
.picker__form { display: flex; flex-direction: column; max-height: min(86vh, 900px); }
.picker__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.picker__head h2 { margin: 0; font-size: 18px; }
.picker__close { background: none; border: 0; color: var(--ink-2); cursor: pointer; }
.picker__filters { padding: 0 20px 12px; border-bottom: 1px solid var(--line); }
.picker__list { overflow: auto; padding: 4px 20px 16px; }
.pref { margin-top: 14px; }
.pref__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.pref__head h3 { font-size: 15px; margin: 0; font-weight: 700; }
.bulk { border: 1px solid var(--line); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 3px 12px; font-size: 12px; cursor: pointer; }
.bulk[aria-pressed="true"] { background: var(--mint); color: var(--mint-ink); border-color: transparent; }
.chain { display: grid; grid-template-columns: 14em 1fr; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); }
.chain__name { font-size: 13px; font-weight: 700; padding: 3px 8px; margin: 0; text-align: left; align-self: start; background: none; border: 1px dashed transparent; border-radius: 6px; cursor: pointer; color: var(--ink); }
.chain__name:hover { border-color: var(--line); }
.chain__name[aria-pressed="true"] { color: var(--mint-ink); background: var(--mint); }
.chain__name::after { content: "（まとめて選択）"; display: block; font-size: 11px; font-weight: 400; color: var(--ink-2); }
.chain__name[aria-pressed="true"]::after { content: "（まとめて外す）"; color: inherit; }
.timetable-link { font-size: 13px; color: var(--ink-2); }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opt span { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; cursor: pointer; }
.opt input:checked + span { background: var(--mint); color: var(--mint-ink); border-color: transparent; font-weight: 700; }
.opt input:focus-visible + span { outline: 3px solid var(--velvet); outline-offset: 2px; }
.picker__foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); }

/* ---------- はしご ---------- */
.hashigo { max-width: 1080px; margin: 0 auto; padding: 16px 16px 0; }
.hashigo[hidden] { display: none; }
.hashigo__titles { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hashigo__titles legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.hashigo__pick { display: grid; gap: 6px; align-content: start; }
.hashigo__pick select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; width: 100%; font-size: 13px; color: var(--ink-2); }
.hashigo__pick select:disabled { opacity: .5; }
.hashigo__titles input, .hashigo__opts select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 12px; width: 100%; }
.hashigo__opts { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.hashigo__opts label { display: inline-flex; align-items: center; gap: 6px; }
.hashigo__opts select { width: auto; padding: 4px 8px; }
.hashigo__scope { display: inline-flex; gap: 12px; }
.plans .hint { padding-top: 0; }
.hashigo__bar { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.saved-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 14px; font-size: 13px; cursor: pointer; }
.saved-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.hashigo__form[hidden] { display: none; }
.plan__date { font-weight: 700; font-size: 15px; }
.plan__actions { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 12px; }
.plan__actions .act { justify-content: center; white-space: nowrap; }
.plan__actions .copy-field { grid-row: 2; grid-column: 1 / -1; }
.act { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; text-decoration: none; cursor: pointer; }
.act:hover { border-color: var(--ink-2); }
.act--save { background: var(--velvet); color: var(--velvet-ink); border-color: transparent; font-weight: 700; }
.act--save[aria-pressed="true"] { background: var(--mint); color: var(--mint-ink); }
.act--line { background: #06c755; color: #fff; border-color: transparent; font-weight: 700; }
.act--del { color: var(--ink-2); }
.gap__map { margin-left: 8px; color: inherit; font-weight: 700; }
.copy-field { flex: 1 1 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; background: var(--surface); color: var(--ink); }
.linklike { background: none; border: 0; color: var(--ink); text-decoration: underline; cursor: pointer; margin-left: 8px; padding: 0; font-size: inherit; }
.plan { padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.plan__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 8px; }
.plan__span { font-family: var(--num); font-weight: 600; font-size: 24px; }
.plan__meta { font-size: 12px; color: var(--ink-2); }
.leg { display: grid; grid-template-columns: 7.2em 1fr; gap: 12px; align-items: baseline; padding: 4px 0; }
.leg__time { font-family: var(--num); font-weight: 600; font-size: 22px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.leg__time small { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.leg__title { font-weight: 500; }
.leg__where { font-size: 12px; color: var(--ink-2); }
.gap { margin-left: 7.2em; padding-left: 12px; font-size: 12px; color: var(--ink-2); border-left: 2px dotted var(--line); }
.gap.is-move { color: var(--velvet); }
.hint { color: var(--ink-2); font-size: 13px; padding: 12px 0; }

@media (max-width: 640px) {
  .plan__actions { display: grid; grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .plan__actions .copy-field { grid-row: auto; }
  .brand { font-size: 16px; letter-spacing: 0; }
  .pick-btn { padding: 6px 6px 6px 12px; font-size: 14px; }
  .hashigo__titles { grid-template-columns: 1fr; }
  .leg { grid-template-columns: 6.4em 1fr; }
  .gap { margin-left: 6.4em; }
  .top { position: static; }
  .day__d { font-size: 26px; }
  .movie { grid-template-columns: 1fr; }
  .time__s { font-size: 23px; }
  .chain { grid-template-columns: 1fr; gap: 4px; }
  .theater__head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
