/* Arah desain: meja redaksi. Permukaan hangat dan datar, garis rambut, judul serif,
   metadata mono, satu warna aksen yang hanya dipakai untuk hal yang butuh keputusan. */

:root {
  --bg: #0F0F0D; --surface: #171714; --raised: #1F1F1B;
  --line: #2A2924; --line-2: #3B3A33;
  --ink: #EFECE4; --ink-2: #A9A598; --ink-3: #726F64;
  --accent: #FF6A3D; --on-accent: #1A0B05;
  --ok: #8CCB8A; --warn: #E2B14C; --bad: #EE766C;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 12px; --ease: cubic-bezier(0.22, 1, 0.36, 1); --fast: 140ms;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F4F1E9; --surface: #FBF9F3; --raised: #ECE8DD;
    --line: #DED9CB; --line-2: #C8C2B1;
    --ink: #1B1A16; --ink-2: #5C594F; --ink-3: #8B877A;
    --accent: #D9431A; --on-accent: #FFF8F3;
    --ok: #2C7A4B; --warn: #9A6200; --bad: #BD3A2C;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F4F1E9; --surface: #FBF9F3; --raised: #ECE8DD;
  --line: #DED9CB; --line-2: #C8C2B1;
  --ink: #1B1A16; --ink-2: #5C594F; --ink-3: #8B877A;
  --accent: #D9431A; --on-accent: #FFF8F3;
  --ok: #2C7A4B; --warn: #9A6200; --bad: #BD3A2C;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--sans); font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }

.mono { font: 400 12px/16px var(--mono); letter-spacing: .01em; color: var(--ink-3); }
.serif { font-family: var(--serif); font-weight: 400; }
.dim { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- kerangka ---------- */
#shell { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
#stage { min-width: 0; }
#view { outline: 0; padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; animation: enter 320ms var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.wordmark { text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.wordmark span { font: italic 400 26px/1 var(--serif); }
.wordmark small { font: 400 12px/1 var(--mono); letter-spacing: .01em; color: var(--ink-3); }

#topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
#tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
#tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; text-decoration: none;
  color: var(--ink-3); font: 500 11px/1 var(--sans); position: relative;
}
#tabbar a[aria-current] { color: var(--ink); }
#tabbar a[aria-current]::before { content: ""; position: absolute; top: -7px; width: 28px; height: 2px; background: var(--accent); }
#tabbar .count { position: absolute; top: 4px; left: calc(50% + 12px); }

#rail { display: none; }
@media (min-width: 960px) {
  #shell { grid-template-columns: 240px 1fr; }
  #rail {
    display: flex; flex-direction: column; gap: 36px; position: sticky; top: 0; height: 100dvh;
    padding: 28px 16px 24px 24px; border-right: 1px solid var(--line);
  }
  #topbar, #tabbar { display: none !important; }
  #view { padding: 44px 48px 80px; }
}
#railnav { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
#railnav a {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; text-decoration: none;
  color: var(--ink-2); font-weight: 500; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
#railnav a:hover { background: var(--surface); color: var(--ink); }
#railnav a[aria-current] { background: var(--raised); color: var(--ink); }
#railnav .count { margin-left: auto; }
.count {
  font: 400 12px/16px var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
#engine { margin-top: auto; }
.engine { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.engine-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
#engine-m .engine { padding: 0; border: 0; flex-direction: row; gap: 16px; }
#engine-m .engine-row:nth-child(2) { display: none; }
#engine-m .engine-row { font: 400 12px/1 var(--mono); letter-spacing: .01em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex-shrink: 0; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.accent { background: var(--accent); }
.dot.live { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.i.sm { width: 16px; height: 16px; }

/* ---------- tipografi halaman ---------- */
.eyebrow { margin: 0 0 10px; }
.lede { font: 400 clamp(32px, 6.2vw, 56px)/1.04 var(--serif); letter-spacing: -.02em; margin: 0 0 6px; max-width: 18ch; text-wrap: balance; }
.lede em { font-style: normal; color: var(--accent); }
.sub { color: var(--ink-2); margin: 0; max-width: 56ch; }
.page-title { font: 400 clamp(30px, 5vw, 44px)/1.05 var(--serif); letter-spacing: -.01em; margin: 0; }
section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.section-head h2 { margin: 0; font: 500 14px/20px var(--sans); color: var(--ink); }
.section-head a { font-size: 13px; color: var(--ink-2); }

/* ---------- tombol dan kontrol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  font-weight: 500; text-decoration: none; white-space: nowrap; transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:hover { background: var(--raised); }
.btn.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.solid:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn.go { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.go:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.quiet { border-color: transparent; color: var(--ink-2); padding: 0 12px; }
.btn.risk { color: var(--bad); }
.btn.risk.armed { background: var(--bad); border-color: var(--bad); color: var(--bg); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span, .field > .label { font: 400 13px/20px var(--sans); color: var(--ink-2); display: flex; justify-content: space-between; }
textarea, input[type=text], input[type=password], input[type=url], input[type=time], input[type=number], input[type=datetime-local], select {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 12px;
  font-size: 16px; line-height: 1.5; transition: border-color var(--fast) var(--ease);
}
textarea { resize: vertical; min-height: 96px; }
textarea:hover, input:hover, select:hover { border-color: var(--line-2); }
textarea:focus, input:focus, select:focus { outline: 0; border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; background: var(--surface); }
.seg button { border: 0; background: none; padding: 8px 16px; border-radius: 6px; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.seg button[aria-pressed=true] { background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.toggle { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.toggle i { position: absolute; inset: 0; border-radius: 13px; background: var(--line-2); transition: background-color var(--fast) var(--ease); pointer-events: none; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); transition: transform var(--fast) var(--ease); }
.toggle input:checked + i { background: var(--accent); }
.toggle input:checked + i::after { transform: translateX(18px); }
.toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.status { display: inline-flex; align-items: center; gap: 8px; font: 400 12px/16px var(--mono); letter-spacing: .01em; color: var(--ink-2); white-space: nowrap; }

/* ---------- beranda ---------- */
.decide { display: grid; gap: 12px; }
@media (min-width: 720px) { .decide { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); } }
.ticket {
  display: grid; grid-template-columns: 92px 1fr; gap: 16px; padding: 16px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color var(--fast) var(--ease);
}
.ticket:hover { border-color: var(--line-2); }
.ticket h3 { margin: 8px 0; font: 400 22px/1.15 var(--serif); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ticket .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ticket .body { display: flex; flex-direction: column; min-width: 0; }
.ticket .body .foot { margin-top: auto; }
.poster { aspect-ratio: 9 / 16; border-radius: 4px; overflow: hidden; background: var(--raised); position: relative; display: block; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster.text { padding: 32px 10px 10px; font: 400 13px/1.25 var(--serif); color: var(--ink-2); display: block; }
.poster.text::before { content: "@"; position: absolute; top: 6px; left: 9px; font: 400 22px/1 var(--serif); color: var(--ink-3); }
.poster.blank { display: grid; place-items: center; color: var(--ink-3); }

.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-top: 4px; }
.steps div { display: flex; flex-direction: column; gap: 8px; font: 400 12px/16px var(--mono); color: var(--ink-3); }
.steps div::before { content: ""; height: 3px; border-radius: 2px; background: var(--line-2); }
.steps .done { color: var(--ink-2); } .steps .done::before { background: var(--ink-2); }
.steps .now { color: var(--ink); }
.steps .now::before { background: linear-gradient(90deg, var(--accent) var(--p, 35%), var(--line-2) var(--p, 35%)); }

.agenda { display: grid; grid-auto-flow: column; grid-auto-columns: 104px; gap: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); scrollbar-width: thin; }
@media (min-width: 960px) { .agenda { grid-auto-flow: row; grid-template-columns: repeat(7, 1fr); overflow: visible; } }
.day { padding: 12px 10px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 132px; display: flex; flex-direction: column; gap: 8px; }
.day .n { font: 400 26px/1 var(--serif); }
.day.today .n { color: var(--accent); }
.day.today { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.slot { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; font: 500 11px/1.2 var(--mono); text-decoration: none; border: 1px solid var(--line-2); color: var(--ink); }
.slot.plan { border-style: dashed; color: var(--ink-3); }
.slot:not(.plan):hover { background: var(--raised); }
.agenda-off { padding: 24px 16px; border: 1px dashed var(--line-2); border-radius: var(--r); display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

.figures { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
@media (min-width: 720px) { .figures { grid-template-columns: repeat(4, 1fr); } }
.figure { padding: 16px 16px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.figure b { display: block; font: 400 44px/1 var(--serif); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.empty { padding: 32px 16px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--ink-2); text-align: center; }
.empty .serif { display: block; font-size: 24px; color: var(--ink); margin-bottom: 4px; }

/* ---------- pustaka ---------- */
.toolbar { display: flex; gap: 8px; overflow-x: auto; margin: 24px -16px 16px; padding: 0 16px 2px; scrollbar-width: none; }
.chip { flex-shrink: 0; border: 1px solid var(--line); background: none; border-radius: 99px; padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; }
.chip[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip small { font: 500 11px var(--mono); opacity: .7; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 16px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 32px 20px; } }
.tile { text-decoration: none; display: flex; flex-direction: column; gap: 10px; }
.tile .poster { border: 1px solid var(--line); transition: border-color var(--fast) var(--ease); }
.tile:hover .poster { border-color: var(--line-2); }
.tile.text .poster { font-size: 17px; padding: 40px 16px 16px; }
.tile h3 { margin: 0; font: 400 18px/1.2 var(--serif); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .meta { display: flex; flex-direction: column; gap: 6px; }

/* ---------- detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink-2); font-size: 14px; margin-bottom: 16px; }
.detail { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "player" "body"; }
.detail > * { min-width: 0; }
.detail > .head { grid-area: head; } .detail > .player { grid-area: player; } .detail > .body { grid-area: body; }
.detail.text { grid-template-areas: "head" "body" "player"; max-width: 680px; }
@media (min-width: 860px) {
  .detail:not(.text) { grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); grid-template-areas: "player head" "player body"; grid-template-rows: auto 1fr; gap: 0 44px; align-items: start; }
  .detail:not(.text) > .player { position: sticky; top: 28px; }
}
.player video { width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: var(--r); background: #000; display: block; }
@media (max-width: 859px) { .player video { width: min(100%, 270px); margin: 0 auto; } .wide { display: none; } }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 16px 0 0; font-size: 13px; }
.facts dt { font: 400 12px/20px var(--mono); letter-spacing: .01em; color: var(--ink-3); }
.facts dd { margin: 0; color: var(--ink-2); }
.detail h1 { font: 400 clamp(28px, 4.4vw, 42px)/1.06 var(--serif); letter-spacing: -.01em; margin: 10px 0 0; text-wrap: balance; }
.when { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-block: 1px solid var(--line); margin: 20px 0 0; font-size: 14px; }
.when > span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.when input { width: auto; padding: 8px 10px; font-size: 14px; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 24px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 0; color: var(--ink-3); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--ink); border-color: var(--accent); }
.notice { padding: 12px 16px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; }
.notice.bad { border-color: var(--bad); color: var(--bad); }
.notice.warn { border-color: var(--warn); }
.sources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sources li { border-bottom: 1px solid var(--line); }
.sources a { display: flex; gap: 12px; align-items: center; padding: 12px 0; text-decoration: none; }
.sources a:hover b { text-decoration: underline; }
.sources b { font-weight: 500; } .sources small { color: var(--ink-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62vw; }
.readonly { white-space: pre-wrap; padding: 16px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.scene { display: grid; grid-template-columns: 44px 1fr; gap: 6px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.scene .no { font: 400 30px/1 var(--serif); color: var(--ink-3); }
.scene .fields { display: grid; gap: 12px; min-width: 0; }
.scene .pair { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .scene .pair { grid-template-columns: 140px 1fr; } }
.scene-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.actions {
  position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 10; display: flex; gap: 8px; margin-top: 28px; padding: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
  border: 1px solid var(--line-2); border-radius: 12px;
}
.actions .btn { flex: 1; min-width: 0; padding: 0 12px; }
.actions .spacer { display: none; }
.actions .btn.go { flex: 1.6; }
@media (min-width: 960px) { .actions { bottom: 20px; } .actions .btn { flex: 0 1 auto; padding: 0 16px; } .actions .spacer { display: block; flex: 1; } .actions .btn.go { flex: 0 1 220px; } }
.results { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.results a, .results div { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }

/* ---------- buat & pengaturan ---------- */
.composer { max-width: 640px; display: grid; gap: 24px; margin-top: 24px; }
.composer textarea { font: 400 24px/1.25 var(--serif); min-height: 132px; padding: 16px; }
.composer textarea::placeholder { color: var(--ink-3); }
.kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kind { text-align: left; padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.kind[aria-pressed=true] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.kind b { font-weight: 500; } .kind small { color: var(--ink-2); font-size: 13px; line-height: 1.35; }
.panel { max-width: 720px; }
.rows { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.rowi { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 16px; border-bottom: 1px solid var(--line); }
.rowi:last-child { border-bottom: 0; }
.rowi > div:first-child { min-width: 0; } .rowi b { font-weight: 500; display: block; } .rowi small { color: var(--ink-2); font-size: 13px; display: block; }
.rowi input, .rowi select { width: auto; max-width: 170px; padding: 8px 10px; font-size: 15px; }
.rowi input[type=number], .rowi input.time-field { width: 76px; }
.rowi input.time-field { text-align: center; }
.rowi input.url-field { width: 280px; max-width: 100%; }
.connect { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.connect input { width: 190px; max-width: 100%; }
@media (max-width: 640px) {
  .rowi:has(.connect), .rowi:has(input.url-field) { flex-direction: column; align-items: stretch; gap: 10px; }
  .connect input { flex: 1; min-width: 0; max-width: none; }
  .rowi input.url-field { width: 100%; max-width: none; flex: none; }
}

.code { font: 500 14px/1 var(--mono); color: var(--ink); background: var(--raised); border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 6px; white-space: nowrap; }

/* ---------- bank topik ---------- */
.bank { max-width: 640px; }
.bank-add { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.bank-add input, .bank-add select { font-size: 15px; padding: 8px 12px; }
.bank-add select { width: auto; }
@media (max-width: 560px) { .bank-add { grid-template-columns: minmax(0, 1fr) auto; } .bank-add input { grid-column: 1 / -1; } }
.ideas { list-style: none; margin: 16px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.ideas li { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line); }
.ideas li:last-child { border-bottom: 0; }
.idea { flex: 1; min-width: 0; font-size: 15px; line-height: 1.35; display: flex; flex-direction: column; gap: 4px; }

/* ---------- kalender ---------- */
.cal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.cal-head .page-title::first-letter { text-transform: uppercase; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav .btn { padding: 0 10px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.cal-dow { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.cday {
  appearance: none; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; background: none;
  min-height: 76px; padding: 8px 6px 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; min-width: 0; border-radius: 0;
}
.cday:hover { background: var(--raised); }
.cday .n { font: 400 20px/1 var(--serif); }
.cday.out .n, .cday.past .n { color: var(--ink-3); }
.cday.out { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.cday.today .n { color: var(--accent); }
.cday.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.cday.drop { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.cday .chips { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.cchip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: 4px; border: 1px solid var(--line-2); font: 400 11px/1 var(--mono); color: var(--ink); max-width: 100%; }
.cchip svg.i.sm { width: 12px; height: 12px; }
.cchip .dot { width: 6px; height: 6px; }
.cchip.plan { border-style: dashed; color: var(--ink-3); }
.cchip[draggable=true] { cursor: grab; }
.cchip .t, .cday .more { display: none; }
.cal-hint { font-size: 13px; margin: 12px 0 0; }
.daylink { text-decoration: none; }
.daylink:hover { background: var(--raised); }
@media (min-width: 720px) {
  .cday { min-height: 120px; padding: 10px 10px 12px; }
  .cday .n { font-size: 24px; }
  .cday .chips { flex-direction: column; flex-wrap: nowrap; }
  .cchip { padding: 4px 6px; font-size: 11px; gap: 6px; }
  .cchip .t, .cday .more { display: inline; }
}

/* ---------- carousel dan statistik ---------- */
.deck { display: grid; gap: 10px; }
.strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--r); border: 1px solid var(--line); scrollbar-width: none; background: var(--raised); }
.strip::-webkit-scrollbar { display: none; }
.strip img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; scroll-snap-align: start; display: block; }
.deck-nav { display: flex; align-items: center; justify-content: space-between; }
.deck-nav .btn { padding: 0 10px; }
@media (max-width: 859px) { .deck { width: min(100%, 340px); margin: 0 auto; } }
.stats { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 16px 16px; display: grid; gap: 16px; }
.stats-row { display: grid; gap: 8px; }
.metrics { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.metrics div { display: flex; flex-direction: column; }
.metrics b { font: 400 26px/1.1 var(--serif); }
.metrics small { font-size: 12px; color: var(--ink-2); }
.stats > small { font-size: 12px; }
.rank { list-style: none; margin: 16px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.rank li { border-bottom: 1px solid var(--line); } .rank li:last-child { border-bottom: 0; }
.rank a { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; text-decoration: none; }
.rank a:hover { background: var(--raised); }
.rank .no { font: 400 26px/1 var(--serif); color: var(--ink-3); }
.rank .what b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .nums { text-align: right; } .rank .nums b { font: 400 22px/1.1 var(--serif); display: block; }

#login { min-height: 82dvh; display: grid; place-items: center; }
#login form { width: min(360px, 100%); display: grid; gap: 16px; }
#login h1 { font: italic 400 46px/1 var(--serif); margin: 0 0 6px; }

#toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease), transform 200ms var(--ease); max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) { #toast { bottom: 28px; } }
.field b { font-weight: 400; }
