:root, [data-theme="dark"] {
  --bg: #0E0E0E;
  --surface: #161616;
  --surface-2: #1F1F1F;
  --border: #2A2A2A;
  --border-strong: #3A3A3A;
  --text: #FFFFFF;
  --muted: #B5B5B5;
  --faint: #8A8A8A;
  --accent: #E11D2E;
  --accent-hover: #C41625;
  --accent-text: #FF4D5A;
  --on-accent: #FFFFFF;
  --cell-off: #1C1C1C;
  --heat: 225, 29, 46;
}
[data-theme="light"] {
  --bg: #FFFFFF;
  --surface: #F5F5F5;
  --surface-2: #EBEBEB;
  --border: #E0E0E0;
  --border-strong: #C9C9C9;
  --text: #0E0E0E;
  --muted: #4A4A4A;
  --faint: #6B6B6B;
  --accent: #E11D2E;
  --accent-hover: #C41625;
  --accent-text: #C8102E;
  --on-accent: #FFFFFF;
  --cell-off: #EDEDED;
  --heat: 225, 29, 46;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.45; min-height: 100vh; }
a { color: var(--accent-text); }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-word { font-family: 'Archivo Black', sans-serif; font-size: 18px; letter-spacing: 1px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--border-strong); }
.avatar { width: 36px; height: 36px; border-radius: 18px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 8px 4px; }
.link-btn:hover { color: var(--text); }

.container { max-width: 1120px; margin: 0 auto; padding: 20px 16px 64px; }
.loading { padding: 64px 0; text-align: center; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 13px; }
.small { font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.card.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.card.outline-accent { border-color: var(--accent); }

.btn { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.white { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.block { width: 100%; min-height: 52px; font-size: 16px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.danger { color: var(--accent-text); border-color: var(--accent); }

label.lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; }
.input { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); padding: 0 14px; font-size: 16px; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.input.code { font-family: 'Archivo Black', sans-serif; letter-spacing: 3px; text-transform: uppercase; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border-strong); color: var(--muted); text-transform: uppercase; }
.badge.red { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.badge.solid { background: var(--text); border-color: var(--text); color: var(--bg); }

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 40px 0 24px; }
.hero-word { font-family: 'Archivo Black', sans-serif; font-size: 34px; letter-spacing: 1px; }
.narrow { max-width: 440px; margin: 0 auto; width: 100%; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.warn { background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 14px; font-size: 14px; }

.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; overflow-x: auto; }
.tab { flex: 1; min-height: 40px; border-radius: 9px; border: none; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; padding: 0 12px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.tab.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--bg); border-radius: 10px; padding: 4px; border: 1px solid var(--border); }
.seg button { min-height: 38px; border-radius: 7px; border: none; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }

.camp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.camp-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); }
.camp-card:hover { border-color: var(--border-strong); }
.camp-title { font-size: 17px; font-weight: 700; }
.page-title { font-size: 24px; font-weight: 800; }

/* grid */
.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sgrid { display: grid; gap: 4px; min-width: 100%; user-select: none; -webkit-user-select: none; }
.sgrid .hd { font-size: 11px; text-align: center; color: var(--muted); line-height: 1.25; padding-bottom: 4px; }
.sgrid .hd b { display: block; color: var(--text); font-size: 15px; }
.sgrid .hr { font-size: 12px; color: var(--muted); display: flex; align-items: center; font-variant-numeric: tabular-nums; }
.cell { height: 44px; border-radius: 8px; border: 1px solid var(--border); background: var(--cell-off); padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; touch-action: manipulation; }
.cell.on { background: var(--accent); border-color: var(--accent); }
.cell.ro { cursor: pointer; touch-action: auto; }
.cell.sel { outline: 2px solid var(--text); outline-offset: -2px; }
.cell.past { opacity: .35; cursor: not-allowed; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.rec { display: flex; flex-direction: column; gap: 4px; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 99px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.chip.pending { color: var(--faint); font-style: italic; }

.person { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.person:last-child { border-bottom: none; }
.person .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) { .layout-2 { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; max-width: calc(100% - 32px); z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { width: 18px; height: 10px; border-radius: 3px; display: inline-block; }
@media (max-width: 520px) { .hide-sm { display: none; } }

/* jadwal gue: scroll horizontal */
#xScroll { position: relative; overflow-x: auto; overscroll-behavior-x: contain; scroll-behavior: auto; padding-bottom: 6px; margin: 0 -4px; }
.xgrid { display: grid; gap: 4px; padding: 0 4px; width: max-content; user-select: none; -webkit-user-select: none; }
.xs { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.xh { font-size: 11px; text-align: center; color: var(--muted); line-height: 1.2; padding-bottom: 4px; }
.xh b { display: block; color: var(--text); font-size: 16px; }
.xh .xm { display: block; color: var(--accent-text); font-weight: 800; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.xh.today b { color: var(--accent-text); }
.xl { display: flex; flex-direction: column; justify-content: center; padding-right: 8px; border-right: 1px solid var(--border); }
.xl b { font-size: 14px; }
.xl span { font-size: 11px; color: var(--faint); }
.chip-btn { min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border-strong); background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.chip-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* kalender bulanan */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; text-transform: uppercase; letter-spacing: 1px; }
.cal-d { min-height: 64px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.cal-d:hover { border-color: var(--border-strong); }
.cal-d.empty { border: none; background: transparent; cursor: default; }
.cal-d.out { opacity: .3; cursor: default; }
.cal-d.today .cal-n { background: var(--text); color: var(--bg); border-radius: 99px; padding: 0 6px; }
.cal-d.sel { outline: 2px solid var(--text); outline-offset: -2px; }
.cal-d.all { border: 2px solid var(--accent); }
.cal-d.lock { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.cal-n { font-size: 13px; font-weight: 700; line-height: 20px; }
.dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 100%; }
.pdot { width: 9px; height: 9px; border-radius: 99px; display: inline-block; box-shadow: 0 0 0 1px var(--border-strong); flex: none; }
.pdot.pend { opacity: .45; }
.chip .pdot { margin-right: 6px; vertical-align: middle; }
.lg-all { width: 18px; height: 14px; border-radius: 4px; border: 2px solid var(--accent); display: inline-block; }
@media (max-width: 520px) { .cal-d { min-height: 54px; padding: 4px 2px; } .pdot { width: 7px; height: 7px; } }

/* modal sukses */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .15s ease; }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; padding: 28px 22px 22px; max-width: 380px; width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; animation: popIn .2s ease; }
.modal-icon { width: 64px; height: 64px; border-radius: 99px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* weekend */
.xh.wk { color: var(--accent-text); }
.xh.wk b { color: var(--accent-text); }
.cell.wk:not(.on) { background: rgba(var(--heat), .10); border-color: rgba(var(--heat), .35); }
.cal-h.wk { color: var(--accent-text); }
.cal-d.wk:not(.lock) { background: rgba(var(--heat), .08); }
.cal-d.wk:not(.lock) .cal-n { color: var(--accent-text); }
.cal-d.today.wk .cal-n { color: var(--bg); }
.rec.compact { padding: 12px 14px; gap: 2px; }
.name-fixed { min-height: 48px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); padding: 0 14px; display: flex; align-items: center; font-weight: 700; font-size: 16px; margin-bottom: 6px; }

/* ===== shell: nav ala app ===== */
.topnav { display: none; gap: 4px; margin-right: auto; margin-left: 24px; }
.topnav .tn { padding: 8px 14px; border-radius: 99px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.topnav .tn:hover { color: var(--text); background: var(--surface); }
.topnav .tn.on { color: var(--text); background: var(--surface-2); }
.userbox { display: inline-flex; text-decoration: none; color: var(--text); border-radius: 99px; }
.botnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: none; background: var(--bg); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
body.has-bot .botnav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
body.has-bot .container { padding-bottom: 96px; }
.bn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--faint); text-decoration: none; font-size: 11px; font-weight: 600; }
.bn.on { color: var(--accent-text); }
.bn.on svg { stroke-width: 2.4; }
@media (min-width: 860px) {
  .topnav { display: flex; }
  body.has-bot .botnav { display: none; }
  body.has-bot .container { padding-bottom: 64px; }
}
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; align-self: flex-start; }
.back:hover { color: var(--text); }

/* home */
.hello { display: flex; justify-content: space-between; align-items: center; }
.avatar.lg { width: 48px; height: 48px; border-radius: 24px; font-size: 18px; text-decoration: none; color: var(--text); }
.avatar.xl { width: 64px; height: 64px; border-radius: 32px; font-size: 24px; flex: none; }
.joinbar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px 6px 6px 14px; }
.jb-ic { color: var(--accent-text); display: inline-flex; }
.jb-in { flex: 1; min-width: 0; border: none; background: transparent; color: var(--text); font-size: 15px; height: 40px; outline: none; }
.jb-in::placeholder { color: var(--faint); }
.joinbar:focus-within { border-color: var(--accent); }
.shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sc { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-size: 12px; font-weight: 600; text-align: center; }
.sc-ic { width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text); }
.sc-ic.red { background: var(--accent); color: #FFFFFF; }
.sc-ic.lg { width: 64px; height: 64px; border-radius: 20px; flex: none; }
.sc:hover .sc-ic { transform: translateY(-1px); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.sec-title { font-size: 18px; font-weight: 800; }
.see-all { display: inline-flex; align-items: center; color: var(--accent-text); text-decoration: none; font-weight: 700; font-size: 13px; white-space: nowrap; }
.soon-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.gcard { flex: none; width: 240px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); }
a.gcard:hover { border-color: var(--border-strong); }
.gcard.wide { width: auto; }
.gcard.empty { width: 100%; max-width: 420px; }
.gtop { display: flex; gap: 6px; }
.gtitle { font-size: 16px; font-weight: 800; line-height: 1.25; }
.gnext { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); }
.gnext.on { background: rgba(var(--heat), .14); color: var(--accent-text); }
.gcard.soon { min-height: 150px; }
.sk { background: var(--surface-2); border-radius: 8px; }
.sk-img { height: 72px; border-radius: 12px; }
.sk-line { height: 12px; }
.sk-line.short { width: 60%; }
.trow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.trow:last-child { border-bottom: none; }
.trank { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: var(--muted); flex: none; }
.soon-hero { display: flex; gap: 16px; align-items: flex-start; }

/* profil */
.prof { display: flex; gap: 14px; align-items: center; }
.menu { padding: 4px 0; }
.mrow { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: none; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 15px; font-weight: 600; cursor: pointer; text-align: left; }
.mrow:last-child { border-bottom: none; }
.mrow:hover { background: var(--surface-2); }
.mrow.danger { color: var(--accent-text); }
.mrow .grow { flex: 1; }
@media (min-width: 860px) {
  .hello .avatar.lg { display: none; }
  .shortcuts { max-width: 480px; }
}
