@charset "utf-8";
:root {
  color-scheme: dark;
  --bg: #050a1c;
  --ink: #f1f5fb;
  --muted: #a7b4c6;
  --faint: #6f7f95;
  --accent: #ff9a5c;
  --accent-2: #7c9cff;
  --glass: rgba(255, 255, 255, .065);
  --glass-strong: rgba(255, 255, 255, .1);
  --stroke: rgba(255, 255, 255, .14);
  --stroke-hi: rgba(255, 255, 255, .28);
  --blur: blur(18px) saturate(150%);
  --radius: 20px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 10% -10%, #1b2b6b 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 10%, #4a1d3f 0%, transparent 60%),
              var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans Thai", "Noto Sans Thai", Tahoma, sans-serif;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.bg-orbs span:nth-child(1) { width: 42vmax; height: 42vmax; left: -12vmax; top: 18vh; background: #ff6a2b; opacity: .32; }
.bg-orbs span:nth-child(2) { width: 46vmax; height: 46vmax; right: -16vmax; top: -8vh; background: #2f55ff; opacity: .38; animation-duration: 32s; }
.bg-orbs span:nth-child(3) { width: 30vmax; height: 30vmax; left: 38vw; bottom: -14vmax; background: #b43cff; opacity: .26; animation-duration: 38s; }
@keyframes drift { to { transform: translate3d(6vmax, -4vmax, 0) scale(1.12); } }

.glass {
  background: linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.035));
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), var(--shadow);
}
.wrap { width: min(76rem, calc(100% - 2rem)); margin-inline: auto; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: "Anuphan", "IBM Plex Sans Thai", sans-serif; letter-spacing: -.01em; }

/* masthead */
.masthead { padding-top: 1.25rem; }
.masthead-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 2rem;
  padding: clamp(1.75rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.03));
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), var(--shadow);
  position: relative; overflow: hidden;
}
.masthead-inner::after {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 60%; height: 140%;
  background: radial-gradient(closest-side, rgba(255,154,92,.28), transparent);
  pointer-events: none;
}
.period {
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .5rem;
  padding: .2rem .8rem; border-radius: 999px; font-size: .9rem; font-weight: 600;
  color: #ffd2b3; background: rgba(255,154,92,.14); border: 1px solid rgba(255,154,92,.35);
}
.period::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
h1 {
  font-size: clamp(2.6rem, 7vw, 5.2rem); line-height: 1.35; font-weight: 700;
  background: linear-gradient(100deg, #ffffff 10%, #ffc7a1 45%, #a9b8ff 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.intro { color: var(--muted); max-width: 38rem; font-size: 1.05rem; }
.chamber {
  display: none; flex-shrink: 0; width: 13rem; height: 6.5rem; border-radius: 13rem 13rem 0 0; position: relative; z-index: 1;
  background: repeating-radial-gradient(circle at bottom center, transparent 0 11px, rgba(255,255,255,.55) 12px 14px, transparent 15px 20px);
  -webkit-mask: linear-gradient(90deg, #000 0 50%, rgba(0,0,0,.45) 50%); mask: linear-gradient(90deg, #000 0 50%, rgba(0,0,0,.45) 50%);
  filter: drop-shadow(0 0 12px rgba(169,184,255,.4));
}

.notice {
  display: flex; flex-wrap: wrap; gap: .25rem .8rem; margin-block: 1.25rem; padding: .75rem 1.1rem;
  color: #ffe1c7; background: rgba(255,154,92,.1); border: 1px solid rgba(255,154,92,.3); border-radius: 14px;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); font-size: .95rem;
}
.notice strong { color: #ffb98a; }

/* rail */
.rail-section { padding: clamp(1.1rem, 3vw, 1.75rem); margin-bottom: 1.5rem; }
.rail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.rail-head h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.rail-hint { color: var(--muted); font-size: .92rem; }
.zoom { display: flex; gap: .4rem; }
.zoom button { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 12px; }
.zoom svg, .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary svg { fill: currentColor; stroke: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .6rem; margin: 1.1rem 0 .4rem; }
.stat { padding: .7rem .9rem; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--stroke); }
.stat dd { margin: 0; font: 700 1.6rem/1.2 "Anuphan", sans-serif; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #fff, #ffc7a1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat dt { color: var(--muted); font-size: .85rem; }

.rail-day { margin-top: 1.1rem; }
.rail-day-label { font-size: 1rem; font-weight: 600; margin-bottom: .45rem; color: #dfe6f2; }
.rail-frame { display: flex; border-radius: 16px; background: rgba(4, 9, 26, .55); border: 1px solid var(--stroke); overflow: hidden; }
.lane-labels { flex: 0 0 auto; display: grid; grid-template-rows: 3rem 3rem; padding: .7rem .55rem 1.8rem .7rem; gap: .5rem;
  font-size: .72rem; color: var(--faint); border-right: 1px solid rgba(255,255,255,.08); }
.lane-labels span { display: flex; align-items: center; writing-mode: horizontal-tb; white-space: nowrap; }
.rail-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.rail-track { position: relative; height: 8.6rem; margin-inline: 1.4rem; }
.lane { position: absolute; left: -1.4rem; right: -1.4rem; height: 3rem; border-radius: 10px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 24px); }
.lane.top { top: .7rem; }
.lane.bottom { top: 4.2rem; }
.tick { position: absolute; top: .3rem; bottom: 1.6rem; border-left: 1px dashed rgba(255,255,255,.1); }
.tick.hour { border-left: 1px solid rgba(255,255,255,.22); }
.tick-label { position: absolute; bottom: -1.55rem; transform: translateX(-50%); font-size: .72rem; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tick.hour .tick-label { color: var(--muted); font-weight: 600; }
.gap { position: absolute; top: .7rem; height: 6.5rem; border-radius: 8px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 6px, transparent 6px 12px); border: 1px dashed rgba(255,255,255,.12); }

.seg {
  --c: #8a99ab;
  position: absolute; height: 3rem; min-height: 0; padding: 0 .45rem; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.35); color: #fff; overflow: hidden; text-align: left;
  font: 600 .78rem/3rem "IBM Plex Sans Thai", sans-serif; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.45);
  background: linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,0) 55%), var(--c);
  box-shadow: 0 6px 18px -6px var(--c), inset 0 -8px 14px -10px rgba(0,0,0,.5);
  transform-origin: left center; animation: grow .6s cubic-bezier(.2,.8,.2,1) both;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease, filter .2s ease;
}
.seg.top { top: .7rem; }
.seg.bottom { top: 4.2rem; }
.seg:hover { filter: brightness(1.15) saturate(1.1); box-shadow: 0 0 0 1px rgba(255,255,255,.6), 0 0 24px -2px var(--c); z-index: 2; }
.seg.selected { z-index: 3; box-shadow: 0 0 0 2px #fff, 0 0 28px 2px var(--c); }
.seg.dim { opacity: .18; filter: grayscale(.6); }
.seg-name { pointer-events: none; }
@keyframes grow { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

.rail-detail {
  --c: #8a99ab;
  margin-top: 1rem; padding: 1rem 1.2rem 1.1rem; border-radius: 16px; position: relative; overflow: hidden;
  background: linear-gradient(120deg, color-mix(in srgb, var(--c) 22%, transparent), rgba(255,255,255,.04) 60%);
  border: 1px solid color-mix(in srgb, var(--c) 55%, rgba(255,255,255,.2));
  animation: rise .3s ease both;
}
.rail-detail::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); box-shadow: 0 0 16px var(--c); }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }
.detail-head { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.detail-time { font-weight: 700; color: #ffd2b3; font-variant-numeric: tabular-nums; }
.chip { padding: .1rem .65rem; border-radius: 999px; font-size: .82rem; background: rgba(255,255,255,.1); border: 1px solid var(--stroke); }
.chip.target { background: rgba(255,90,90,.15); border-color: rgba(255,120,120,.4); color: #ffd0d0; }
.detail-topic { font-size: clamp(1.15rem, 2.6vw, 1.45rem); margin: .45rem 0 .2rem; }
.detail-who { color: var(--muted); font-size: .95rem; }
.detail-points { margin: .5rem 0 0; padding-inline-start: 1.2rem; color: #dbe3ee; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .45rem 1rem; border-radius: 12px;
  font: 600 .95rem "IBM Plex Sans Thai", sans-serif; color: var(--ink); text-decoration: none; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid var(--stroke-hi); transition: background .2s ease, border-color .2s ease; }
.btn:hover { background: rgba(255,255,255,.16); }
.btn.primary { background: linear-gradient(135deg, #ff8a4c, #ff5f6d); border-color: transparent; color: #fff; box-shadow: 0 8px 22px -10px #ff6a4c; }
.btn.primary:hover { filter: brightness(1.08); }

.legend { display: flex; flex-wrap: wrap; gap: .4rem .6rem; list-style: none; padding: 0; margin: 1rem 0 0; font-size: .85rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; padding: .15rem .6rem .15rem .45rem; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.legend li.absent { opacity: .5; }
.swatch { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .4rem; box-shadow: 0 0 8px currentColor; }

/* layout, filters, list */
.layout { display: grid; align-items: start; gap: 1.5rem; padding-bottom: 4rem; }
.layout > * { min-width: 0; }
.filters { padding: 1.25rem; }
.filters h2, .section-heading h2 { font-size: 1.3rem; }
.fields { display: grid; gap: .85rem; margin-block: 1rem; }
label { display: grid; gap: .3rem; font-weight: 500; font-size: .92rem; color: #d6deea; }
input, select, button { font: inherit; color: inherit; min-height: 44px; }
input, select {
  min-width: 0; width: 100%; padding: .5rem .8rem; border-radius: 12px;
  background: rgba(5, 10, 28, .55); border: 1px solid var(--stroke); color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { border-color: rgba(255,154,92,.7); box-shadow: 0 0 0 3px rgba(255,154,92,.2); outline: none; }
select option { background: #0c1430; color: var(--ink); }
button { background: rgba(255,255,255,.08); border: 1px solid var(--stroke-hi); border-radius: 12px; padding: .4rem 1rem; cursor: pointer; transition: background .2s ease; }
button:hover { background: rgba(255,255,255,.15); }
:focus-visible { outline: 3px solid #9db4ff; outline-offset: 3px; }

.section-heading, .entry-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.section-heading { padding-bottom: .6rem; border-bottom: 1px solid var(--stroke); }
#result-count { color: var(--muted); font-size: .9rem; }
.day-heading { margin-block: 1.4rem .8rem; font-size: 1.05rem; color: #ffd2b3; }
.entries { margin: 0 0 0 .4rem; padding: 0 0 0 1.3rem; list-style: none; border-inline-start: 2px solid transparent;
  border-image: linear-gradient(180deg, rgba(255,154,92,.7), rgba(124,156,255,.5), transparent) 1; }
.entries > li { position: relative; padding-bottom: 1rem; }
.entries > li::before { content: ""; position: absolute; left: -1.78rem; top: 1.6rem; width: .75rem; height: .75rem; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 12px var(--accent); }
article {
  --c: #8a99ab;
  position: relative; padding: clamp(1rem, 3vw, 1.5rem); border-radius: 18px; overflow: hidden;
  background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--stroke); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 14px 34px -22px rgba(0,0,0,.8);
  transition: border-color .2s ease, transform .2s ease;
}
article::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); box-shadow: 0 0 14px var(--c); }
article:hover { border-color: var(--stroke-hi); }
.time { color: #ffb98a; font-weight: 700; font-variant-numeric: tabular-nums; }
.confidence { padding: .1rem .65rem; border-radius: 999px; font-size: .8rem; color: var(--muted); background: rgba(255,255,255,.06); border: 1px solid var(--stroke); }
h4 { margin-block: .55rem .7rem; font-size: clamp(1.2rem, 2.6vw, 1.55rem); line-height: 1.5; }
dl { display: grid; grid-template-columns: fit-content(40%) 1fr; gap: .3rem .9rem; margin: 0; font-size: .95rem; }
dt { color: var(--faint); }
dd { margin: 0; }
.speaker { display: flex; gap: .45rem; align-items: baseline; }
.dot { flex: 0 0 auto; width: .6rem; height: .6rem; border-radius: 50%; transform: translateY(-1px); box-shadow: 0 0 8px currentColor; }
.points { margin: .7rem 0 0; padding-inline-start: 1.3rem; color: #d7dfeb; }
.points li + li { margin-top: .2rem; }
.timestamp { display: inline-flex; align-items: center; gap: .35rem; margin-top: .9rem; padding: .4rem .9rem; border-radius: 10px;
  color: #ffd2b3; font-weight: 600; text-decoration: none; background: rgba(255,154,92,.12); border: 1px solid rgba(255,154,92,.35); }
.timestamp:hover { background: rgba(255,154,92,.22); }
.timestamp[aria-disabled="true"] { color: var(--faint); background: transparent; border-color: var(--stroke); }
article.flash { animation: flash 1.8s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--c), 0 0 40px var(--c); } to { box-shadow: 0 0 0 0 transparent; } }
#empty-state, #error-state { margin-top: 1rem; color: var(--muted); }

@media (min-width: 36rem) { .chamber { display: block; } }
@media (min-width: 52rem) {
  .layout { grid-template-columns: minmax(14rem, 1fr) minmax(0, 3fr); gap: 2rem; }
  .filters { position: sticky; top: 1rem; }
}
@media (max-width: 36rem) {
  .stats { grid-template-columns: repeat(4, 1fr); gap: .35rem; margin-top: .8rem; }
  .stat { padding: .45rem .5rem; border-radius: 12px; }
  .stat dd { font-size: 1.15rem; }
  .stat dt { font-size: .68rem; line-height: 1.35; }
  .masthead-inner { padding: 1.4rem 1.2rem; }
}

/* data coverage states */
.status-summary { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 0; }
.status-chip { --s: #8a99ab; display: inline-flex; align-items: center; gap: .4rem; padding: .15rem .7rem; border-radius: 999px; font-size: .82rem;
  color: #e9eef6; background: color-mix(in srgb, var(--s) 16%, transparent); border: 1px solid color-mix(in srgb, var(--s) 50%, transparent); }
.status-chip.ok { --s: #3ddc97; }
.status-chip .pip { width: .55rem; height: .55rem; border-radius: 50%; background: var(--s); box-shadow: 0 0 8px var(--s); }
.status-chip.review .pip { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.band { --s: #9aa7b8; position: absolute; top: .7rem; height: 6.5rem; min-height: 0; padding: 0; border-radius: 10px; cursor: pointer; overflow: hidden;
  color: #fff; font: 600 .72rem/1 "IBM Plex Sans Thai", sans-serif;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--s) 32%, transparent) 0 7px, color-mix(in srgb, var(--s) 10%, transparent) 7px 14px);
  border: 1px dashed color-mix(in srgb, var(--s) 75%, transparent); transition: background .2s ease, box-shadow .2s ease; }
.band:hover { box-shadow: 0 0 18px -2px var(--s); background-color: color-mix(in srgb, var(--s) 18%, transparent); }
.band { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 16px -4px var(--s); } }
.band-label { display: inline-block; padding: .2rem .45rem; border-radius: 6px; background: rgba(5,10,28,.7); white-space: nowrap; pointer-events: none; }
.badge-backfill { padding: .1rem .6rem; border-radius: 999px; font-size: .78rem; color: #ffe3a3; background: rgba(245,185,66,.14); border: 1px solid rgba(245,185,66,.45); }
.entry-heading .badge-backfill { margin-left: auto; }
.entries > li.gap-item::before { border-color: var(--faint); box-shadow: none; top: 1.05rem; }
.status-row { --s: #9aa7b8; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; padding: .65rem 1rem; border-radius: 14px; font-size: .92rem;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--s) 12%, transparent) 0 8px, transparent 8px 16px);
  border: 1px dashed color-mix(in srgb, var(--s) 60%, transparent); }
.status-row strong { color: var(--s); }
.status-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.status-desc { color: var(--muted); flex-basis: 100%; font-size: .85rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
