/* Layout: arsip aktivitas kronologis — header ringkasan, kalender aktivitas, lalu riwayat per hari dengan papan tanggal ala signage bandara */
:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --ink: #0f172a;
  --muted: #5b6b80;
  --line: #dde4ec;
  --teal: #0d9488;
  --teal-soft: #e3f6f3;
  --teal-ink: #115e59;
  --amber: #c26a05;
  --amber-soft: #fff4dc;
  --sign-bg: #16181d;
  --sign-fg: #f5b800;
  --ok: #0f9f6e;
  --ok-soft: #e2f6ee;
  --warn: #b45309;
  --warn-soft: #fdf0dc;
  --heat-0: #e3e9f0;
  --heat-1: #a7e3da;
  --heat-2: #4fc2b2;
  --heat-3: #0d9488;
  --overlay: rgba(10, 14, 22, .88);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .05);
  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f19; --surface: #131b2e; --surface-2: #18223a; --ink: #eef2f8; --muted: #94a3b8; --line: #26334d;
    --teal: #2dd4bf; --teal-soft: #12363a; --teal-ink: #99f0e2; --amber: #fbbf24; --amber-soft: #3a2a0c;
    --sign-bg: #05070b; --sign-fg: #ffc81f; --ok: #34d399; --ok-soft: #10332a; --warn: #fbbf24; --warn-soft: #3a2a0c;
    --heat-0: #1c2740; --heat-1: #13514c; --heat-2: #1a8f82; --heat-3: #2dd4bf; --overlay: rgba(3, 5, 10, .9);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f19; --surface: #131b2e; --surface-2: #18223a; --ink: #eef2f8; --muted: #94a3b8; --line: #26334d;
  --teal: #2dd4bf; --teal-soft: #12363a; --teal-ink: #99f0e2; --amber: #fbbf24; --amber-soft: #3a2a0c;
  --sign-bg: #05070b; --sign-fg: #ffc81f; --ok: #34d399; --ok-soft: #10332a; --warn: #fbbf24; --warn-soft: #3a2a0c;
  --heat-0: #1c2740; --heat-1: #13514c; --heat-2: #1a8f82; --heat-3: #2dd4bf; --overlay: rgba(3, 5, 10, .9);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* demo ribbon */
.demo { background: var(--amber-soft); color: var(--amber); font-size: 13px; }
.demo .wrap { padding-block: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.demo b { font-weight: 600; }

/* header */
header.top { padding-block: 32px 8px; }
.brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--teal); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 24px; height: 24px; }
.eyebrow { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; font-weight: 600; color: var(--muted); }
h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(34px, 6vw, 52px); line-height: 1; margin: 18px 0 10px; letter-spacing: .005em; text-wrap: balance; text-transform: uppercase; }
h1 span { color: var(--teal); }
.lede { color: var(--muted); max-width: 62ch; margin: 0; font-size: 16px; }
.who { display: flex; gap: 10px 20px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; color: var(--muted); }
.who strong { color: var(--ink); font-weight: 600; }

/* stats + heatmap panel */
.panel { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-right: 1px solid var(--line); }
.stat { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.stat:nth-child(odd) { border-right: 1px solid var(--line); }
.stat:nth-last-child(-n+2) { border-bottom: 0; }
.stat .k { font-family: var(--f-display); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 600; color: var(--muted); }
.stat .v { font-family: var(--f-display); font-weight: 600; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 16px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.heat { padding: 18px 20px; min-width: 0; }
.heat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.heat-head h2 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 18px; text-transform: uppercase; letter-spacing: .04em; }
.heat-scroll { overflow-x: auto; padding-bottom: 4px; }
.heat-grid { display: grid; grid-template-columns: 28px repeat(var(--weeks), minmax(0, 1fr)); gap: 4px; min-width: 360px; }
.heat-grid .dl { font-size: 11px; color: var(--muted); line-height: 18px; }
.heat-grid .ml { font-size: 11px; color: var(--muted); height: 16px; white-space: nowrap; overflow: visible; }
.cell { aspect-ratio: 1; max-width: 100%; border-radius: 4px; background: var(--heat-0); border: 0; padding: 0; min-height: 14px; }
.cell[data-l="1"] { background: var(--heat-1); }
.cell[data-l="2"] { background: var(--heat-2); }
.cell[data-l="3"] { background: var(--heat-3); }
.cell.future { background: transparent; border: 1px dashed var(--line); cursor: default; }
.cell.sel { outline: 2px solid var(--amber); outline-offset: 1px; }
.legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* filter bar */
.filters { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); margin-top: 28px; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.filters .wrap { padding-block: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line); }
.search { flex: 1 1 240px; position: relative; min-width: 0; }
.search input { width: 100%; padding: 10px 12px 10px 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
select { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-size: 14px; color: var(--muted); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--teal-soft); color: var(--teal-ink); }
.result-count { font-size: 13px; color: var(--muted); margin-left: auto; }
.chip-clear { border: 1px solid var(--amber); color: var(--amber); background: var(--amber-soft); border-radius: 999px; padding: 4px 10px; font-size: 13px; }

/* day groups */
main { padding-block: 20px 48px; display: flex; flex-direction: column; gap: 36px; }
.day { display: flex; flex-direction: column; gap: 14px; }
.sign { background: var(--sign-bg); color: var(--sign-fg); border-radius: 8px; display: flex; align-items: center; gap: 16px; padding: 10px 16px; flex-wrap: wrap; }
.sign .d { font-family: var(--f-display); font-weight: 700; font-size: 24px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.1; }
.sign .shift { font-family: var(--f-display); font-weight: 600; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: #e9edf3; border: 1px solid rgba(255,255,255,.25); border-radius: 4px; padding: 1px 8px; }
.sign .n { margin-left: auto; font-family: var(--f-mono); font-size: 13px; color: #c9d1dc; }
.sign svg { width: 22px; height: 22px; flex: none; }

/* entry */
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
.info { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--line); min-width: 0; }
.info-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.time { font-family: var(--f-mono); font-size: 13px; font-weight: 500; }
.pid { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-left: auto; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.pill.sh1 { background: var(--amber-soft); color: var(--amber); }
.pill.sh2 { background: var(--teal-soft); color: var(--teal-ink); }
.pill.cm { background: var(--warn-soft); color: var(--warn); }
.loc { font-weight: 600; font-size: 17px; line-height: 1.3; margin: 0; text-wrap: balance; }
.equip { font-size: 13px; color: var(--muted); margin-top: -8px; }
.speed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.speed > div { padding: 8px 10px; background: var(--surface-2); min-width: 0; }
.speed > div + div { border-left: 1px solid var(--line); }
.speed .k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.speed .v { font-family: var(--f-mono); font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.speed .v small { font-size: 11px; color: var(--muted); margin-left: 2px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); }
.check.bad { background: var(--warn-soft); color: var(--warn); }
.check svg { width: 12px; height: 12px; }
.cmbox { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.cmbox summary { padding: 8px 12px; cursor: pointer; font-weight: 600; color: var(--warn); list-style: none; display: flex; align-items: center; gap: 6px; }
.cmbox summary::-webkit-details-marker { display: none; }
.cmbox summary::after { content: "+"; margin-left: auto; font-family: var(--f-mono); }
.cmbox[open] summary::after { content: "−"; }
.cmbox dl { margin: 0; padding: 0 12px 10px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.cmbox dt { color: var(--muted); }
.cmbox dd { margin: 0; white-space: pre-line; }

.photos { padding: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; min-width: 0; align-content: start; }
.photo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.thumb { position: relative; border: 0; padding: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 3 / 4; max-width: 100%; background: var(--surface-2); display: block; width: 100%; }
.thumb img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.thumb:hover img { transform: scale(1.03); }
.thumb .slot { position: absolute; top: 8px; left: 8px; font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: .06em; background: rgba(10,14,22,.72); color: #fff; padding: 1px 7px; border-radius: 4px; }
.photo-meta { display: flex; align-items: center; gap: 6px; min-width: 0; }
.photo-meta .lbl { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-meta .sz { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; flex: none; color: var(--ink); }
.icon-btn:hover { border-color: var(--teal); color: var(--teal); }
.icon-btn svg { width: 15px; height: 15px; }
.entry-foot { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 10px 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
.btn:hover { border-color: var(--teal); color: var(--teal); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #042f2e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #042f2e; } }
.btn.primary:hover { filter: brightness(1.08); color: inherit; }
.entry-foot .btn { margin-left: auto; }

.more { align-self: center; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; border: 1px dashed var(--line); border-radius: 14px; }

footer { border-top: 1px solid var(--line); }
footer .wrap { padding-block: 20px; display: flex; gap: 8px 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 50; background: var(--overlay); display: grid; grid-template-columns: minmax(0, 1fr) 320px; color: #eef2f8; }
.lb-stage { position: relative; display: grid; place-items: center; padding: max(56px, calc(env(safe-area-inset-top, 0px) + 56px)) 64px 24px max(64px, env(safe-area-inset-left, 0px)); min-width: 0; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 100px); width: auto; height: auto; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; }
.lb-nav:hover { background: rgba(255,255,255,.18); }
.lb-nav svg { width: 20px; height: 20px; }
.lb-prev { left: max(12px, env(safe-area-inset-left, 0px)); }
.lb-next { right: 12px; }
.lb-close { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; }
.lb-side { background: #121826; padding: max(24px, calc(env(safe-area-inset-top, 0px) + 24px)) max(20px, env(safe-area-inset-right, 0px)) 24px 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; border-left: 1px solid #263048; }
.lb-side h3 { margin: 0; font-family: var(--f-display); font-size: 26px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; line-height: 1.05; color: #ffc81f; }
.lb-side .sub { color: #a9b4c4; font-size: 14px; margin-top: -8px; }
.lb-side dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: 13px; }
.lb-side dt { color: #8b97aa; }
.lb-side dd { margin: 0; overflow-wrap: anywhere; }
.lb-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lb-strip button { border: 2px solid transparent; padding: 0; border-radius: 6px; overflow: hidden; aspect-ratio: 3 / 4; background: #1b2336; }
.lb-strip button[aria-current="true"] { border-color: #ffc81f; }
.lb-strip img { width: 100%; height: 100%; display: block; }
.lb-side .btn { justify-content: center; padding: 10px 14px; font-size: 14px; }
.lb-side .btn.ghost { background: transparent; color: #eef2f8; border-color: #34405a; }
.lb-side .btn.ghost:hover { border-color: #ffc81f; color: #ffc81f; }
.lb-hint { font-size: 12px; color: #7f8ba0; margin-top: auto; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: min(520px, calc(100vw - 32px)); box-shadow: 0 10px 30px rgba(0,0,0,.25); }

@media (max-width: 960px) {
  .panel { grid-template-columns: minmax(0, 1fr); }
  .stats { border-right: 0; border-bottom: 1px solid var(--line); grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat { border-bottom: 0; border-right: 1px solid var(--line); }
  .stat:last-child { border-right: 0; }
  .entry { grid-template-columns: minmax(0, 1fr); }
  .info { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .lb-stage { padding: calc(env(safe-area-inset-top, 0px) + 56px) 12px 12px; }
  .lb-stage img { max-height: 58vh; }
  .lb-nav { top: auto; bottom: 16px; transform: none; }
  .lb-side { border-left: 0; border-top: 1px solid #263048; max-height: 42vh; padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 16px) max(16px, env(safe-area-inset-left, 0px)); }
  .lb-side .lb-strip, .lb-hint { display: none; }
  .sign .d { font-size: 20px; }
  .result-count { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .thumb img { transition: none; } .thumb:hover img { transform: none; } }

/* real-data additions */
.lb-strip img { object-fit: cover; }
.lb-stage img { object-fit: contain; background: #0b0f19; }
.thumb.missing { display: grid; place-items: center; color: var(--muted); font-size: 12px; border: 1px dashed var(--line); background: transparent; cursor: default; }
.photo-meta a.icon-btn { text-decoration: none; }
a.btn { text-decoration: none; }
.loading { color: var(--muted); padding: 32px 0; }
.err-box { border: 1px solid var(--warn); background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 16px; }
.speed .k span { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: .8; }
.speed .v { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* fixes 2026-11-10 */
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.photo-meta .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.photo-meta .txt .lbl { flex: none; }
.heat-grid { min-width: 300px; }
@media (max-width: 720px) {
  .filters { position: static; }
  .filters .wrap { gap: 8px; }
  .search { flex-basis: 100%; }
  .filters select { flex: 1 1 auto; }
  .seg button { padding: 6px 10px; }
  .stat .v { font-size: 30px; }
  .heat-grid { min-width: 0; gap: 3px; }
  .cell { min-height: 0; }
}
