:root {
  --ink: #1c2b3a;
  --accent: #b3541e;
  --line: #d8dee4;
  --bg: #f6f7f9;
  --card: #ffffff;
  --muted: #5b6b7a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.app-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--ink); color: #fff;
  padding: 10px 14px 0;
}
.app-header h1 { font-size: 18px; margin: 0 0 8px; }
.tabs { display: flex; gap: 4px; }
.tab {
  border: 0; background: transparent; color: #cfd8e0;
  padding: 8px 12px; font-size: 14px; cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tab.is-active { color: #fff; border-bottom-color: var(--accent); font-weight: 600; }
main { max-width: 760px; margin: 0 auto; padding: 14px; }
.screen { display: none; }
.screen.is-active { display: block; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; margin-bottom: 14px;
}
.field { display: block; margin-bottom: 10px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select {
  width: 100%; padding: 9px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.check { display: block; margin: 8px 0; font-size: 14px; }
.row { display: flex; align-items: center; margin: 8px 0; }
.row.gap { gap: 8px; }
.row.small { font-size: 13px; }
.row.wrap { flex-wrap: wrap; }
button {
  font-size: 14px; padding: 9px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip { padding: 5px 10px; border-radius: 999px; font-size: 13px; }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.file-btn {
  font-size: 14px; padding: 9px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.note { font-size: 12px; color: var(--muted); }
.section-title { font-size: 16px; margin: 4px 0 10px; }
.sub-title { font-size: 14px; margin: 14px 0 6px; }
.alert {
  background: #fdf3e3; border: 1px solid #e8cf9f; color: #6b5312;
  border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.status-chip {
  font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
}
.status-chip.ok { border-color: #9db89d; }
.status-chip.none { color: var(--muted); }
.status-chip.error { border-color: #c0392b; color: #c0392b; }
.title-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer; width: 100%; text-align: left;
}
.title-row .tname { font-weight: 600; flex: 1; }
.title-row .tmeta { font-size: 12px; color: var(--muted); }
.star-btn { border: 0; background: transparent; font-size: 22px; padding: 10px 12px; color: #c9a227; }
.result-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 10px;
}
.result-card .r-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.result-card .r-time { font-size: 18px; font-weight: 700; }
.result-card .r-title { font-weight: 600; }
.badge {
  font-size: 11px; background: #eef2f5; border-radius: 4px; padding: 2px 6px; color: var(--ink);
}
.result-card .r-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.result-card .r-price { margin-top: 6px; font-size: 15px; }
.result-card .r-price .amount { font-weight: 700; font-size: 17px; }
.result-card .r-price .unknown { color: #c0392b; font-weight: 700; }
.result-card .r-actions { margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.title-group {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 12px;
}
.tg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; }
.tg-title { font-size: 17px; font-weight: 700; }
.tg-caret { margin-left: 4px; color: var(--muted); font-size: 13px; }
.tg-head .switch { margin-left: auto; }
.th-head .switch { margin-left: auto; }
.switch {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 6px 2px; cursor: pointer;
}
.switch-label { font-size: 12px; color: var(--muted); font-weight: 400; }
.switch-track {
  width: 40px; height: 24px; border-radius: 999px; background: #c8d2db;
  position: relative; flex: none; transition: background .15s;
}
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: left .15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.switch.is-on .switch-knob { left: 19px; }
.switch-star { font-size: 16px; line-height: 1; color: #9aa7b1; }
.switch.kind-title.is-on .switch-track { background: #b9e4c6; }
.switch.kind-title.is-on .switch-knob { background: #2f9e5f; }
.switch.kind-title.is-on .switch-star { color: #2f9e5f; }
.switch.kind-theatre.is-on .switch-track { background: #bfd9f2; }
.switch.kind-theatre.is-on .switch-knob { background: #2f6fd0; }
.switch.kind-theatre.is-on .switch-star { color: #2f6fd0; }
.tg-caret::before { content: "▸"; }
.title-group.is-open .tg-caret::before { content: "▾"; }
.title-group .tg-body { display: none; }
.title-group.is-open .tg-body { display: block; }
.theatre-group { border-top: 1px solid var(--line); padding: 10px 0 6px; margin-top: 10px; }
.th-head { font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.time-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.time-pill {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  border: 1.5px solid #2f6fd0; border-radius: 14px; padding: 6px 14px;
  color: #2f6fd0; background: #fff; text-decoration: none;
}
.time-pill .tp-time { font-size: 17px; font-weight: 700; }
.time-pill .tp-end { font-size: 11px; margin-left: 2px; }
.time-pill .tp-format { font-size: 11px; font-weight: 700; }
.time-pill .tp-sub { font-size: 11px; color: var(--muted); }
.time-pill .tp-unknown { color: #c0392b; font-weight: 700; }
a.buy-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.list-row {
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line); padding: 8px 0; font-size: 14px;
}
.list-row .grow { flex: 1; }
.overlay {
  position: fixed; inset: 0; background: rgba(20, 30, 40, .55);
  display: flex; align-items: flex-start; justify-content: center; padding: 24px 14px; z-index: 50;
  overflow-y: auto;
}
.overlay[hidden] { display: none; }
.overlay-card { background: #fff; border-radius: 12px; padding: 20px; max-width: 520px; width: 100%; }
