:root {
  --bg: #f6f3ee;
  --panel: #ffffff;
  --ink: #14212b;
  --muted: #5c6b75;
  --line: #e3ddd3;
  --accent: #0f7c86;
  --accent-ink: #ffffff;
  --accent-soft: #dcefef;
  --warm: #e0703a;
  --navy: #0e2a3b;
  --shadow: 0 1px 2px rgba(14, 42, 59, .06), 0 4px 16px rgba(14, 42, 59, .05);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1820; --panel: #13222c; --ink: #e8eef1; --muted: #9db0bb; --line: #223744;
    --accent: #3fb5bf; --accent-ink: #062027; --accent-soft: #173a40; --warm: #f08a55; --navy: #08131a;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "DM Sans", system-ui, sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; }

.topbar { background: var(--navy); color: #fff; padding: 18px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; gap: 14px; align-items: center; }
.logo { font-size: 34px; color: var(--warm); line-height: 1; }
.brand h1 { font-family: Fraunces, Georgia, serif; font-size: 26px; letter-spacing: .2px; }
.tagline { margin: 0; color: #b9cbd4; font-size: 13.5px; }
.topbar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.35); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: 999px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; font-weight: 500; padding: 0; }

.searchbar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 28px; }
.search-wrap { flex: 1 1 360px; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 16px; box-shadow: var(--shadow); }
.search-wrap svg { width: 18px; fill: var(--muted); flex: none; }
.search-wrap input { border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; padding: 11px 0; width: 100%; }
.chips { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; }
.chips.wrap { flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 6px 12px;
  font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.chips button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filter-toggle { display: none; }

.layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; padding: 22px 28px 60px; max-width: 1400px; margin: 0 auto; }
.filters { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; padding-right: 6px; }
.fgroup { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.fgroup h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; }
.fgroup label { display: block; font-size: 14px; margin: 4px 0; }
.fgroup input[type=date], input.mini { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; margin-top: 2px; }
input.mini { margin-bottom: 8px; }
.toggle { cursor: pointer; }
.checklist { max-height: 260px; overflow: auto; }
.checklist.tall { max-height: 420px; }
.checklist .subhead { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 0 4px; }
.checklist .subhead:first-child { margin-top: 0; }
tr.group-row td { background: var(--bg); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.checklist label { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 2px 0; }
.checklist span { flex: 1; }
.checklist em { font-style: normal; color: var(--muted); font-size: 12px; }

.summary { color: var(--muted); margin-bottom: 14px; font-size: 14px; }
.summary strong { color: var(--ink); }
.day { margin-bottom: 26px; }
.day h2 { font-family: Fraunces, Georgia, serif; font-size: 20px; margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; }
.day h2 small { font-family: "DM Sans", sans-serif; font-size: 13px; color: var(--muted); font-weight: 400; }
.cards { display: grid; gap: 10px; }

.card { display: grid; grid-template-columns: 76px 1fr 96px; gap: 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.card .time { font-weight: 700; font-size: 14px; color: var(--accent); padding-top: 2px; }
.card .time small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.card h4 { margin: 0 0 3px; font-size: 16.5px; line-height: 1.3; }
.card h4 a { color: var(--ink); text-decoration: none; }
.card h4 a:hover { color: var(--accent); text-decoration: underline; }
.card .where { color: var(--muted); font-size: 13.5px; }
.card .desc { font-size: 13.5px; margin: 6px 0 0; color: var(--ink); opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.card .desc.open { -webkit-line-clamp: unset; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); text-decoration: none; white-space: nowrap; }
.tag.src { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.tag.free { background: #e3f4e1; color: #24602a; }
@media (prefers-color-scheme: dark) { .tag.free { background: #1d3a22; color: #a8e2ad; } }
.tag.city { background: #fbe7dc; color: #8a3a12; }
@media (prefers-color-scheme: dark) { .tag.city { background: #3d2417; color: #f7c3a3; } }
.thumb { width: 96px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--accent-soft); }
.thumb.none { display: grid; place-items: center; color: var(--muted); font-size: 22px; }

.ongoing { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 22px; }
.ongoing summary { cursor: pointer; font-weight: 500; }
.ongoing .cards { margin-top: 12px; }
.ongoing .btn { margin-top: 10px; }
.jump-row { margin: -10px 0 18px; }
.jump-row .btn { display: inline-flex; align-items: center; gap: 8px; color: var(--warm); border-color: var(--warm); }
.jump-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warm); }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }
#sentinel { height: 40px; }
.loading { text-align: center; color: var(--muted); padding: 20px; }

@media (max-width: 860px) {
  .topbar { padding: 14px 16px; }
  .tagline { display: none; }
  .searchbar { padding: 12px 16px; }
  .filter-toggle { display: inline-flex; }
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .filters { display: none; position: static; max-height: none; }
  .filters.open { display: block; }
  .card { grid-template-columns: 62px 1fr; }
  .thumb { display: none; }
}

/* admin */
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 28px 60px; }
.admin-wrap h2 { font-family: Fraunces, Georgia, serif; margin: 26px 0 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.st { font-weight: 600; font-size: 12.5px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st.ok { background: #e3f4e1; color: #24602a; }
.st.error { background: #fde2df; color: #9b231a; }
.st.warning, .st.skipped, .st.disabled { background: #fdf0d6; color: #8a5a00; }
.st.running { background: var(--accent-soft); color: var(--accent); }
@media (prefers-color-scheme: dark) {
  .st.ok { background: #1d3a22; color: #a8e2ad; } .st.error { background: #45201c; color: #f4b2aa; }
  .st.warning, .st.skipped, .st.disabled { background: #3d3115; color: #f1d08a; }
}
.err { color: var(--muted); font-size: 12.5px; max-width: 360px; }
.statusbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.warnbox { background: #fdf0d6; color: #6b4600; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.login { max-width: 360px; margin: 10vh auto; }
.login form { display: grid; gap: 12px; }
.login input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--bg); color: var(--ink); }
.login .error { color: #b3261e; }

.chips button em { font-style: normal; opacity: .65; font-size: 12px; margin-left: 2px; }
.chips button.on em { opacity: .85; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.tag.price { background: #e8edf9; color: #23396b; font-weight: 500; }
@media (prefers-color-scheme: dark) { .tag.price { background: #1d2a45; color: #b9c9f0; } }
.tag.free { font-weight: 600; }

.now-marker { position: relative; display: flex; align-items: center; gap: 10px; margin: 6px 0; color: var(--warm); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.now-marker::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--warm); flex: none; }
.now-marker::after { content: ""; flex: 1; height: 2px; background: var(--warm); opacity: .6; }

/* AI highlights */
.highlights { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 18px; border-top: 3px solid var(--warm); }
.hl-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hl-head h2 { font-family: Fraunces, Georgia, serif; font-size: 20px; margin: 0; }
.hl-spark { color: var(--warm); }
.hl-tabs { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.hl-tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.hl-tabs button.on { background: var(--accent); color: var(--accent-ink); }
.hl-tabs button small { opacity: .75; margin-left: 4px; font-size: 11.5px; }
.hl-toggle { margin-left: auto; }
.hl-summary { margin: 12px 0 10px; font-size: 15px; line-height: 1.55; }
.hl-picks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.hl-picks li { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.hl-picks img, .hl-picks .ph { width: 56px; height: 56px; border-radius: 9px; object-fit: cover; background: var(--accent-soft); }
.hl-picks .ph { display: grid; place-items: center; color: var(--muted); }
.hl-picks .when { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .03em; }
.hl-picks a.t { display: block; font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.3; margin: 1px 0 2px; }
.hl-picks a.t:hover { color: var(--accent); text-decoration: underline; }
.hl-picks .w { font-size: 12.5px; color: var(--muted); }
.hl-picks .why { font-size: 13px; margin-top: 4px; font-style: italic; }
.hl-picks .tag { margin-left: 4px; font-style: normal; }
.hl-foot { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.hl-empty { color: var(--muted); font-size: 14px; margin: 12px 0 4px; }
.highlights.collapsed .hl-body { display: none; }
@media (max-width: 860px) { .hl-toggle { margin-left: 0; } .hl-picks { grid-template-columns: 1fr; } }

.ai-form { display: grid; gap: 10px; max-width: 760px; }
.ai-form label { display: grid; gap: 4px; font-size: 14px; }
.ai-form label.toggle { display: flex; gap: 8px; align-items: center; }
.ai-form select, .ai-form input[name=model] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; }
.ai-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ai-table { margin-top: 14px; }
.results { min-width: 0; }
.hl-tabs { max-width: 100%; overflow-x: auto; }
.hl-tabs button { white-space: nowrap; }
.hl-picks { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.hl-picks li > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 860px) { .hl-tabs button small { display: none; } .highlights { padding: 14px; } }
.card > div { min-width: 0; overflow-wrap: anywhere; }
.cards, .day { min-width: 0; }
