:root {
  /* CERAH: oren & putih */
  --ground: #FFF8F1;
  --ground-2: #FFFFFF;
  --card: #FFFFFF;
  --card-2: #FFF3E6;
  --strong: #2B211B;
  --strong-2: #3D3029;
  --strong-ink: #FFFFFF;
  --text: #1F1712;
  --muted: #6B5B50;
  --line: #EED9C4;
  --line-2: #F6E7D8;
  --accent: #D9560B;
  --accent-soft: rgba(242, 107, 29, .12);
  --gold: #E8620F;
  --cta: linear-gradient(135deg, #FFB24D 0%, #FF8A2A 50%, #F26B1D 100%);
  --cta-ink: #2A1200;
  --cta-glow: rgba(242, 107, 29, .28);
  --hero: linear-gradient(135deg, #D9530B 0%, #A63A06 100%);
  --hero-ink: #FFFFFF;
  --hero-muted: #FFE2CC;
  --hero-glow: rgba(242, 107, 29, .30);
  --spark: #FFD9A8;
  --mine-bg: linear-gradient(135deg, #FF9A3C, #F26B1D);
  --mine-ink: #2A1200;
  --mine-glow: rgba(242, 107, 29, .45);
  --lot-border: #E2BFA0;
  --taken-bg: #EFE6DE;
  --taken-ink: #9A8A7E;
  --amber: #F5A623;
  --amber-soft: rgba(245, 166, 35, .16);
  --amber-ink: #8A5300;
  --paid-ink: #2A1800;
  --green: #12805C;
  --green-soft: rgba(18, 128, 92, .12);
  --red: #C0263E;
  --red-soft: rgba(192, 38, 62, .10);
  --locked: #3D3029;
  --nav-bg: rgba(255, 255, 255, .94);
  --placeholder: #A8968A;
  --backdrop: rgba(31, 23, 18, .45);
  --glow-1: rgba(255, 138, 42, .16);
  --glow-2: rgba(255, 178, 77, .14);
  color-scheme: light;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  /* GELAP: emas & hitam */
  --ground: #0A0A0B;
  --ground-2: #121214;
  --card: #161618;
  --card-2: #202023;
  --strong: #2A2A2E;
  --strong-2: #36363B;
  --strong-ink: #FAF7F0;
  --text: #FAF7F0;
  --muted: #B8B1A3;
  --line: #3A372F;
  --line-2: #26251F;
  --accent: #F5C542;
  --accent-soft: rgba(245, 197, 66, .14);
  --gold: #F5C542;
  --cta: linear-gradient(135deg, #FFE38A 0%, #F5C542 45%, #C9971C 100%);
  --cta-ink: #1A1300;
  --cta-glow: rgba(245, 197, 66, .25);
  --hero: linear-gradient(135deg, #2E2510 0%, #141414 65%);
  --hero-ink: #FAF7F0;
  --hero-muted: #D9CFA8;
  --hero-glow: rgba(245, 197, 66, .18);
  --spark: #F5C542;
  --mine-bg: linear-gradient(135deg, #FFE38A, #E0AE2E);
  --mine-ink: #1A1300;
  --mine-glow: rgba(245, 197, 66, .5);
  --lot-border: #5A5446;
  --taken-bg: #1E1E20;
  --taken-ink: #6E6A60;
  --amber: #FF9A3C;
  --amber-soft: rgba(255, 154, 60, .16);
  --amber-ink: #FFB877;
  --paid-ink: #2A1500;
  --green: #5BD9A0;
  --green-soft: rgba(47, 208, 138, .14);
  --red: #FF7A8A;
  --red-soft: rgba(255, 77, 109, .14);
  --locked: #4A4231;
  --nav-bg: rgba(14, 14, 16, .94);
  --placeholder: #7D776B;
  --backdrop: rgba(0, 0, 0, .65);
  --glow-1: rgba(245, 197, 66, .12);
  --glow-2: rgba(201, 151, 28, .10);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  /* GELAP: emas & hitam */
  --ground: #0A0A0B;
  --ground-2: #121214;
  --card: #161618;
  --card-2: #202023;
  --strong: #2A2A2E;
  --strong-2: #36363B;
  --strong-ink: #FAF7F0;
  --text: #FAF7F0;
  --muted: #B8B1A3;
  --line: #3A372F;
  --line-2: #26251F;
  --accent: #F5C542;
  --accent-soft: rgba(245, 197, 66, .14);
  --gold: #F5C542;
  --cta: linear-gradient(135deg, #FFE38A 0%, #F5C542 45%, #C9971C 100%);
  --cta-ink: #1A1300;
  --cta-glow: rgba(245, 197, 66, .25);
  --hero: linear-gradient(135deg, #2E2510 0%, #141414 65%);
  --hero-ink: #FAF7F0;
  --hero-muted: #D9CFA8;
  --hero-glow: rgba(245, 197, 66, .18);
  --spark: #F5C542;
  --mine-bg: linear-gradient(135deg, #FFE38A, #E0AE2E);
  --mine-ink: #1A1300;
  --mine-glow: rgba(245, 197, 66, .5);
  --lot-border: #5A5446;
  --taken-bg: #1E1E20;
  --taken-ink: #6E6A60;
  --amber: #FF9A3C;
  --amber-soft: rgba(255, 154, 60, .16);
  --amber-ink: #FFB877;
  --paid-ink: #2A1500;
  --green: #5BD9A0;
  --green-soft: rgba(47, 208, 138, .14);
  --red: #FF7A8A;
  --red-soft: rgba(255, 77, 109, .14);
  --locked: #4A4231;
  --nav-bg: rgba(14, 14, 16, .94);
  --placeholder: #7D776B;
  --backdrop: rgba(0, 0, 0, .65);
  --glow-1: rgba(245, 197, 66, .12);
  --glow-2: rgba(201, 151, 28, .10);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--text); font-family: var(--body); -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; background: radial-gradient(120% 50% at 50% -10%, var(--glow-1), transparent 60%), radial-gradient(90% 40% at 100% 110%, var(--glow-2), transparent 60%), var(--ground); background-attachment: fixed; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); margin: 0; }

#app { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Layout halaman ---------- */
.page { flex: 1; display: flex; flex-direction: column; padding-bottom: 96px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 20px 8px; }
.topbar h1 { font-size: 22px; flex: 1; }
.topbar .sub { font-size: 12px; color: var(--muted); }
.content { padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.eyebrow { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .08em; color: var(--gold); }
.section-title { font-family: var(--display); font-weight: 700; font-size: 18px; display: flex; justify-content: space-between; align-items: baseline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.hidden { display: none !important; }

/* ---------- Kad ---------- */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: 18px; padding: 16px; }
.card.dark { background: var(--hero); border: 1px solid var(--hero-glow); color: var(--hero-ink); position: relative; overflow: hidden; box-shadow: 0 10px 30px var(--hero-glow); }
.card.dark::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 88% 12%, var(--hero-glow), transparent 40%), radial-gradient(2px 2px at 20% 30%, var(--spark) 50%, transparent 51%), radial-gradient(2px 2px at 70% 70%, var(--spark) 50%, transparent 51%), radial-gradient(3px 3px at 85% 45%, var(--spark) 50%, transparent 51%), radial-gradient(2px 2px at 40% 85%, var(--spark) 50%, transparent 51%); }
.card.dark > * { position: relative; z-index: 1; }
.card.dark .muted { color: var(--hero-muted); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--display); font-size: 22px; }
.list { background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); color: var(--text); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list-item .title { font-weight: 700; font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; font-size: 14px; }

/* ---------- Butang ---------- */
.btn { height: 50px; padding: 0 18px; border-radius: 14px; border: 0; background: var(--cta); color: var(--cta-ink); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-align: center; }
.btn:hover { filter: brightness(1.08); color: var(--cta-ink); }
.btn { box-shadow: 0 6px 18px var(--cta-glow); }
.btn.ghost, .btn.danger, .btn.dark, .btn.sm.tab { box-shadow: none; }
.btn.block { width: 100%; }
.btn.dark { background: var(--strong); color: var(--strong-ink); }
.btn.dark:hover { background: var(--strong-2); color: var(--strong-ink); filter: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--card-2); color: var(--text); filter: none; }
.btn.danger { background: transparent; color: var(--red); border: 1px solid var(--line); }
.btn.danger:hover { background: var(--red-soft); color: var(--red); filter: none; }
.btn.wa { background: #1F8A4C; color: #fff; box-shadow: none; }
.btn.wa:hover { color: #fff; }
.btn.sm { height: 40px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); flex: none; }

/* ---------- Borang ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.input, select.input, textarea.input { height: 48px; border-radius: 12px; border: 1px solid var(--line); padding: 0 14px; background: var(--card-2); color: var(--text); font-weight: 500; font-size: 15px; width: 100%; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
.input::placeholder { color: var(--placeholder); }
.input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.radio-card { display: flex; gap: 12px; align-items: center; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; cursor: pointer; }
.radio-card:has(input:checked) { border: 2px solid var(--gold); padding: 12px 13px; }
input[type=radio], input[type=checkbox] { accent-color: var(--gold); width: 20px; height: 20px; }

/* ---------- Lencana status ---------- */
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber-ink); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gray { background: var(--line-2); color: var(--muted); }
.badge.dark { background: var(--locked); color: #fff; }

/* ---------- Peta tapak (macam kerusi bas) ---------- */
.map-wrap { background: var(--card); border: 1px solid var(--line-2); border-radius: 18px; padding: 12px; overflow-x: auto; }
.lotmap { display: grid; gap: 7px; min-width: min-content; }
.lot { min-width: 52px; min-height: 46px; height: auto; line-height: 1.15; word-break: break-word; text-align: center; border-radius: 10px; border: 1.5px solid var(--lot-border); background: var(--card-2); color: var(--text); font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 0 4px; }
.lot.free:hover { border-color: var(--gold); }
.lot.sel { outline: 3px solid var(--gold); outline-offset: 2px; }
.lot.mine, .lot.v-sel { background: var(--mine-bg); border-color: transparent; color: var(--mine-ink); box-shadow: 0 0 16px var(--mine-glow); }
.lot.taken { background: var(--taken-bg); border-color: var(--taken-bg); color: var(--taken-ink); cursor: not-allowed; font-weight: 600; font-size: 12px; }
.lot.held { background: var(--amber-soft); border: 1.5px dashed var(--amber); color: var(--amber-ink); }
.lot.paid { background: var(--amber); border-color: var(--amber); color: var(--paid-ink); }
.lot.locked { background: var(--locked); border-color: var(--locked); color: #fff; font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; font-weight: 600; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1.5px solid transparent; }
.legend i.sw-free { background: var(--card-2); border-color: var(--lot-border); }
.legend i.sw-sel { background: var(--mine-bg); }
.legend i.sw-taken { background: var(--taken-bg); border-color: var(--line); }
.legend i.sw-held { background: var(--amber-soft); border: 1.5px dashed var(--amber); }
.legend i.sw-paid { background: var(--amber); }
.legend i.sw-locked { background: var(--locked); }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; }
.tabs a { height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.tabs a.on { background: var(--strong); color: var(--strong-ink); }
.progress { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: rgba(0,0,0,.3); }
.progress .p-locked { background: var(--hero-ink); }
.progress .p-paid { background: var(--spark); }
.code-tile { display: flex; align-items: center; justify-content: center; flex: none; font-weight: 700; border-radius: 10px; min-width: 44px; height: 44px; padding: 0 8px; background: var(--accent-soft); color: var(--accent); }
.code-tile.amber { background: var(--amber-soft); color: var(--amber-ink); }
.code-tile.big { min-width: 60px; height: 60px; border-radius: 14px; font-family: var(--display); font-size: 20px; background: var(--mine-bg); color: var(--mine-ink); }

.layout-img { border-radius: 16px; overflow: hidden; background: var(--card-2); }
.layout-img img { width: 100%; max-height: 320px; object-fit: contain; background: var(--card-2); cursor: zoom-in; }
.layout-empty { height: 140px; border-radius: 16px; background: var(--card); border: 1px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; padding: 12px; }

/* ---------- Bar bawah ---------- */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; height: 72px; background: var(--nav-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line-2); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: center; z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); }
.bottom-nav a.active { color: var(--gold); }
.action-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; background: var(--nav-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line-2); padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 14px; z-index: 21; }

/* ---------- Helaian bawah (bottom sheet) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--ground-2); border-top: 1px solid var(--line); width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 18px 20px calc(22px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { font-size: 20px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-height: 100%; object-fit: contain; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--strong); color: var(--strong-ink); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 60; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.error { background: #B3123F; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Skrin selamat datang (video intro) ---------- */
.welcome { --brand-orange: #F5C542; flex: 1; min-height: 100vh; min-height: 100dvh; background: #000; color: #fff; display: flex; flex-direction: column; padding: 20px 24px calc(28px + env(safe-area-inset-bottom)); position: relative; overflow: hidden; }
.intro-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; background: #000 url('../assets/intro-poster.jpg') center 35% / cover no-repeat; }
.intro-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 18%, rgba(0,0,0,0) 48%, rgba(0,0,0,.82) 72%, #000 100%); pointer-events: none; }
.welcome.login .intro-shade { background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 15%, rgba(0,0,0,.2) 35%, rgba(0,0,0,.88) 55%, #000 100%); }
.welcome .music { height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.welcome .btn.light { background: var(--cta); color: var(--cta-ink); height: 56px; font-size: 16px; }
.welcome .btn.light:hover { filter: brightness(1.08); }
.welcome .btn.outline { background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; }
.welcome form .input { background: rgba(20,20,26,.85); border-color: #3A3B47; color: #fff; }
.welcome form .input:focus { outline-color: var(--brand-orange); }
.welcome label.field { color: #E4E5EA; }

.tap-start { position: absolute; left: 50%; top: 66%; transform: translate(-50%, -50%); z-index: 5; pointer-events: none; }
.tap-start span { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: rgba(0,0,0,.55); border: 1px solid rgba(245,197,66,.55); color: #FFE38A; font-weight: 700; font-size: 14px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: tapPulse 1.6s ease-in-out infinite; white-space: nowrap; }
@keyframes tapPulse { 0%,100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }

/* ---------- Invois / cetak ---------- */
.invoice { background: var(--card); border: 1px solid var(--line-2); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.invoice table { width: 100%; border-collapse: collapse; font-size: 13px; }
.invoice th { text-align: left; font-size: 11px; color: var(--muted); letter-spacing: .04em; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.invoice td { padding: 8px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.invoice .num { text-align: right; white-space: nowrap; }
.item-row { display: grid; grid-template-columns: 1fr 44px; gap: 8px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.item-row > input:first-child { grid-column: 1 / -1; }

@media print {
  body { background: #fff; color: #000; }
  .invoice { background: #fff; color: #000; border: 0; }
  .invoice .muted, .invoice th { color: #444; }
  .invoice [style*="--gold"] { color: #000 !important; }
  .no-print, .bottom-nav, .action-bar, .topbar { display: none !important; }
  .page { padding: 0; }
  .content { padding: 0; }
  .invoice { border-radius: 0; padding: 0; }
}

/* ---------- Pilihan tema ---------- */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; }
.seg button { height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--strong); color: var(--strong-ink); }

/* ---------- Tapak menunggu tandatangan & nama bisnes ---------- */
.lot.signing { background: var(--green-soft); border: 1.5px dashed var(--green); color: var(--green); }
.legend i.sw-signing { background: var(--green-soft); border: 1.5px dashed var(--green); }
.lot.named { flex-direction: column; gap: 1px; padding: 3px 4px; min-height: 50px; }
.lot.named > span { display: inline-flex; align-items: center; gap: 2px; }
.lot-name { display: block; max-width: 100%; font-size: 8.5px; font-weight: 600; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .9; }

/* ---------- Perjanjian (kertas putih dalam kedua-dua tema) ---------- */
.agreement { background: #fffdf9; color: #1d1a16; border-radius: 16px; padding: 22px 18px; font-size: 13.5px; line-height: 1.6; border: 1px solid var(--line-2); }
.agreement p { margin: 0 0 8px; }
.agreement h3 { font-family: var(--display); font-size: 13.5px; letter-spacing: .03em; margin: 16px 0 6px; color: #000; }
.ag-title { text-align: center; font-family: var(--display); font-size: 17px; line-height: 1.35; margin: 0 0 14px; color: #000; }
.ag-title span { font-size: 15px; color: #b5651d; letter-spacing: .12em; }
.ag-blank { display: inline-block; min-width: 140px; border-bottom: 1px solid #999; }
.ag-box { background: #f6efe4; border-radius: 12px; padding: 12px 14px; margin: 10px 0 14px; display: flex; flex-direction: column; gap: 4px; }
.ag-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ag-signs { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 18px; border-top: 1px solid #ddd; padding-top: 6px; }
@media (min-width: 480px) { .ag-signs { grid-template-columns: 1fr 1fr; } }
.ag-sigbox { min-height: 92px; border-bottom: 1.5px solid #333; display: flex; align-items: flex-end; margin: 6px 0 4px; }
.ag-sig { max-height: 110px; max-width: 100%; }
.ag-stamp { font-size: 11px; color: #555; background: #f3f3f3; border-radius: 8px; padding: 6px 8px; }
.sig-pad { width: 100%; height: 150px; background: #fff; border: 2px dashed var(--gold); border-radius: 12px; touch-action: none; cursor: crosshair; }
.ag-timer { background: var(--card); border: 1.5px solid var(--amber); box-shadow: 0 6px 18px rgba(0,0,0,.12); color: var(--amber-ink); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 700; position: sticky; top: 8px; z-index: 5; }

@media print {
  body.print-agreement .page > *:not(.content), body.print-agreement .content > *:not(.agreement) { display: none !important; }
  .agreement { border: 0; border-radius: 0; padding: 0; background: #fff; font-size: 11.5pt; }
  .agreement h3 { break-after: avoid; }
  .ag-signs { grid-template-columns: 1fr 1fr; break-inside: avoid; }
  .ag-box { break-inside: avoid; }
  .ag-box, .ag-stamp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.ag-sig-hint { color: #999; font-size: 12px; font-style: italic; padding-bottom: 6px; }
.sign-area { display: flex; flex-direction: column; gap: 8px; background: var(--accent-soft); border: 2px solid var(--gold); border-radius: 14px; padding: 12px; }
.sign-area .sig-pad { height: 170px; border-style: solid; }
.ag-row > :last-child { white-space: nowrap; text-align: right; }
/* ---------- Jadual bayaran & pilihan pelan ---------- */
.sched { display: flex; flex-direction: column; gap: 8px; background: var(--card-2); border-radius: 12px; padding: 12px; }
.sched-row { display: flex; align-items: center; gap: 10px; }
.sched-pct { min-width: 44px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.plan-opt { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line-2); border-radius: 14px; padding: 12px; cursor: pointer; background: var(--card); }
.plan-opt input { accent-color: var(--accent); width: 20px; height: 20px; }
.plan-opt:has(input:checked) { border-color: var(--gold); background: var(--accent-soft); }
.plan-bars { display: flex; gap: 4px; margin-top: 6px; }
.plan-bars i { height: 6px; border-radius: 3px; background: var(--line-2); }
.plan-bars i:first-child { background: var(--gold); }
.nav-dot { position: absolute; top: 6px; margin-left: 18px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px; font-style: normal; }
.bottom-nav a { position: relative; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line-2); }
.notif-item:first-child { border-top: 0; }

/* Pilihan event (vendor) */
.ev-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; scroll-snap-type: x proximity; }
.ev-tabs::-webkit-scrollbar { display: none; }
.ev-tabs a { flex: none; max-width: 240px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-2); color: var(--muted); }
.ev-tabs a b { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-tabs a span { font-size: 11px; }
.ev-tabs a.on { background: var(--strong); border-color: var(--strong); color: var(--strong-ink); }
.ev-tabs a.on b { color: var(--strong-ink); }

/* Telefon: bar tindakan menggantikan menu bawah */
.action-bar ~ .bottom-nav { display: none; }

/* =============================================================
   TABLET & LAPTOP (skrin lebar) — menu di tepi, kandungan lebih luas
   ============================================================= */
@media (min-width: 768px) {
  body.in-app { --side: 92px; }
  body.in-app #app { max-width: none; margin: 0 0 0 var(--side); }
  body.in-app .page { width: 100%; max-width: 1040px; margin: 0 auto; padding-bottom: 40px; }
  body.in-app .topbar { padding: 26px 32px 8px; }
  body.in-app .topbar h1 { font-size: 26px; }
  body.in-app .content { padding: 10px 32px 32px; gap: 18px; }

  /* Menu bawah jadi menu tepi */
  body.in-app .bottom-nav { left: 0; top: 0; bottom: 0; transform: none; width: var(--side); max-width: none; height: auto;
    grid-auto-flow: row; grid-auto-rows: 68px; grid-auto-columns: auto; align-content: start; gap: 4px;
    padding: 20px 8px; border-top: 0; border-right: 1px solid var(--line-2); }
  body.in-app .bottom-nav::before { content: ''; display: block; height: 64px; margin-bottom: 12px;
    background: url(../assets/logo.jpg) center / 52px 52px no-repeat; border-radius: 14px; }
  body.in-app .bottom-nav a { border-radius: 14px; justify-content: center; text-align: center; position: relative; }
  body.in-app .bottom-nav a:hover { background: var(--card); }
  body.in-app .bottom-nav a.active { background: var(--accent-soft); }

  body.in-app .action-bar ~ .bottom-nav { display: grid; }
  body.in-app .action-bar { left: var(--side); right: 0; width: auto; max-width: none; transform: none;
    padding-left: max(32px, calc((100vw - var(--side) - 1040px) / 2 + 32px)); padding-right: max(32px, calc((100vw - var(--side) - 1040px) / 2 + 32px)); }

  /* Helaian bawah jadi tetingkap di tengah */
  .sheet-backdrop { align-items: center; padding: 24px; }
  body.in-app .sheet-backdrop { padding-left: calc(var(--side) + 24px); }
  .sheet { max-width: 580px; border-radius: 22px; border: 1px solid var(--line); max-height: 86vh; padding: 24px 26px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
  body.in-app .toast { left: calc(50% + var(--side) / 2); bottom: 32px; }

  /* Susunan grid */
  .ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
  .layout-img img { max-height: 460px; }
  .lot { min-height: 54px; font-size: 14px; }
  .lotmap { gap: 10px; }
}

/* Laptop / tablet melintang: menu tepi dengan label penuh */
@media (min-width: 1100px) {
  body.in-app { --side: 232px; }
  body.in-app .bottom-nav { grid-auto-rows: 52px; padding: 24px 14px; }
  body.in-app .bottom-nav::before { background-position: 10px center; height: 60px; }
  body.in-app .bottom-nav a { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 0 16px; font-size: 15px; text-align: left; }
  body.in-app .content { gap: 20px; }
  .layout-img img { max-height: 540px; }
}

/* =============================================================
   CABUTAN BERTUAH
   ============================================================= */
.qr-box { background: #fff; border-radius: 14px; padding: 10px; align-self: center; line-height: 0; }
.qr-box svg { display: block; width: 200px; max-width: 100%; height: auto; }
.lucky-admin-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .lucky-admin-grid { grid-template-columns: 1fr 1fr; align-items: start; } }

/* Page pembeli & log masuk petugas (tema emas-hitam tetap) */
.lucky-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: flex-start; justify-content: center; padding: 28px 16px 40px;
  background: radial-gradient(120% 60% at 50% -10%, #4a3510 0%, #120d05 55%, #000 100%); color: #f4ecd8; }
.lucky-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 12px; }
.lucky-logo { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 0 30px rgba(245,197,66,.35); }
.lucky-eyebrow { font-family: var(--display); font-weight: 800; letter-spacing: .24em; font-size: 12px; color: #F5C542; margin-top: 8px; }
.lucky-card h1 { font-size: 30px; line-height: 1.1; color: #fff; text-wrap: balance; }
.lucky-card h2 { font-size: 22px; color: #fff; }
.lucky-sub { margin: 0; color: #cbbd9c; font-size: 14px; }
.lucky-from { background: rgba(245,197,66,.12); border: 1px solid rgba(245,197,66,.35); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.lucky-from b { color: #F5C542; }
.lucky-prizes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lucky-prizes b { width: 100%; font-size: 12px; letter-spacing: .1em; color: #a99c7f; text-transform: uppercase; }
.lucky-prizes span { background: #1f1a12; border: 1px solid #3d3322; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.lucky-prizes i { font-style: normal; color: #F5C542; }
.lucky-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; background: #17130d; border: 1px solid #3d3322; border-radius: 18px; padding: 18px; }
.lucky-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #e9dcc0; }
.lucky-form input:not([type=checkbox]) { height: 50px; border-radius: 12px; border: 1px solid #4a3d27; background: #0d0a06; color: #fff; padding: 0 14px; font-size: 16px; }
.lucky-form input:focus { outline: 2px solid #F5C542; outline-offset: 1px; }
.lucky-form .lucky-consent { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 12px; line-height: 1.5; color: #b9ab90; }
.lucky-consent input { margin-top: 2px; width: 18px; height: 18px; accent-color: #F5C542; flex: none; }
.lucky-form .btn { background: linear-gradient(135deg, #F5C542, #D99A1E); color: #1a1205; border: 0; }
.lucky-ok { text-align: center; background: #17130d; border: 1px solid #3d3322; border-radius: 18px; padding: 24px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: #e9dcc0; }
.lucky-ok svg { color: #1a1205; background: #F5C542; border-radius: 50%; padding: 8px; width: 52px; height: 52px; }
.lucky-ok p { margin: 0; font-size: 14px; line-height: 1.55; }
.lucky-closed { background: #2a1416; border: 1px solid #5a2a2e; color: #f3c9cd; border-radius: 14px; padding: 14px; font-size: 14px; }

/* Skrin cabutan (untuk projektor / TV) */
body.draw-mode #app { max-width: none; margin: 0; }
.draw-stage { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; color: #f4ecd8;
  background: radial-gradient(90% 70% at 50% 0%, #4a3510 0%, #140f07 55%, #000 100%); padding: 16px clamp(16px, 3vw, 40px) 24px; gap: 18px; }
.draw-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.draw-logo { width: 54px; height: 54px; border-radius: 14px; }
.draw-title { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.draw-eyebrow { font-family: var(--display); font-weight: 800; letter-spacing: .26em; font-size: 12px; color: #F5C542; }
.draw-select { background: transparent; border: 0; color: #fff; font: 700 clamp(18px, 2.4vw, 26px) var(--display); padding: 0; max-width: 100%; }
.draw-select option { color: #000; }
.draw-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.draw-ghost { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(245,197,66,.35); background: rgba(0,0,0,.3); color: #f4ecd8; font: 600 14px var(--body); cursor: pointer; }
.draw-main { flex: 1; display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .draw-main { grid-template-columns: 1fr 320px; } }
.draw-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 10px 0; }
.draw-stats { display: flex; gap: 10px 22px; flex-wrap: wrap; justify-content: center; color: #cbbd9c; font-size: 15px; }
.draw-stats b { color: #fff; font-size: 20px; }
.draw-live { color: #7ee2a8; }
.draw-prize-now { font-size: clamp(18px, 2.4vw, 28px); color: #e9dcc0; }
.draw-prize-now b { color: #F5C542; }
.draw-prize-now span { color: #a99c7f; font-size: .7em; }
.draw-slot { width: min(100%, 900px); min-height: clamp(130px, 22vh, 220px); display: flex; align-items: center; justify-content: center; border-radius: 28px;
  background: linear-gradient(180deg, #0b0905, #1d170e); border: 2px solid rgba(245,197,66,.5); box-shadow: inset 0 0 50px rgba(0,0,0,.8), 0 0 60px rgba(245,197,66,.15); padding: 16px 24px; overflow: hidden; }
.draw-slot span { font: 800 clamp(30px, 6vw, 84px)/1.1 var(--display); color: #fff; word-break: break-word; }
.draw-slot.spinning span { color: #F5C542; filter: blur(.4px); }
.draw-slot .final { color: #F5C542; text-shadow: 0 0 40px rgba(245,197,66,.6); }
.draw-go { height: 70px; padding: 0 48px; border-radius: 999px; border: 0; cursor: pointer; font: 800 clamp(18px, 2.2vw, 24px) var(--display); letter-spacing: .08em; color: #1a1205;
  background: linear-gradient(135deg, #FFE08A, #F5C542 40%, #D99A1E); box-shadow: 0 12px 40px rgba(245,197,66,.35); }
.draw-go.small { height: 52px; padding: 0 30px; font-size: 18px; }
.draw-go:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.draw-go:focus-visible, .draw-ghost:focus-visible, .draw-prizes button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.draw-prizes { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 900px; }
.draw-prizes button { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; border: 1px solid #4a3d27; background: #17130d; color: #e9dcc0; font: 600 15px var(--body); cursor: pointer; }
.draw-prizes button i { font-style: normal; font-size: 12px; color: #a99c7f; }
.draw-prizes button.on { background: #F5C542; color: #1a1205; border-color: #F5C542; }
.draw-prizes button.on i { color: #5a420f; }
.draw-prizes button:disabled { opacity: .35; text-decoration: line-through; cursor: default; }
.draw-side { background: rgba(0,0,0,.35); border: 1px solid #3d3322; border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 120px); overflow: auto; }
.draw-side-h { font: 700 16px var(--display); color: #F5C542; }
.draw-list { display: flex; flex-direction: column; gap: 8px; }
.draw-w { background: #17130d; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.draw-w b { color: #fff; } .draw-w span { font-size: 12px; color: #a99c7f; } .draw-w em { font-size: 11px; color: #e08a8a; font-style: normal; }
.draw-w.off b { text-decoration: line-through; opacity: .6; }
.draw-none, .draw-empty { color: #a99c7f; font-size: 14px; }
.draw-pop { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.78); display: flex; align-items: center; justify-content: center; padding: 20px; }
.draw-confetti { position: absolute; inset: 0; pointer-events: none; }
.draw-pop-card { position: relative; width: min(100%, 760px); text-align: center; border-radius: 28px; padding: clamp(24px, 5vw, 48px); display: flex; flex-direction: column; gap: 12px; align-items: center;
  background: linear-gradient(160deg, #2b2110, #0b0905); border: 2px solid #F5C542; box-shadow: 0 0 80px rgba(245,197,66,.35); animation: popIn .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes popIn { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .draw-pop-card { animation: none; } }
.draw-pop-prize { font: 700 clamp(18px, 2.6vw, 28px) var(--display); color: #e9dcc0; }
.draw-pop-name { font: 800 clamp(36px, 7vw, 92px)/1.05 var(--display); color: #F5C542; word-break: break-word; text-shadow: 0 0 40px rgba(245,197,66,.5); }
.draw-pop-meta { font-size: clamp(16px, 2vw, 22px); color: #cbbd9c; }
.draw-pop-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* =============================================================
   PENDAFTARAN KEHADIRAN (check-in QR)
   ============================================================= */
.ci-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ci-stats .card { padding: 14px; }
.ci-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .ci-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.ci-kv { display: flex; gap: 12px; font-size: 14px; }
.ci-kv span { width: 82px; flex: none; color: var(--muted); }
.ci-kv b { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.ci-warn { display: flex; gap: 8px; align-items: flex-start; background: var(--amber-soft); color: var(--amber-ink); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 600; }
.ci-warn svg { flex: none; margin-top: 1px; }
.ci-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ci-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; border-radius: 999px; padding: 6px 6px 6px 14px; }
.ci-chip button { border: 0; background: none; color: inherit; display: flex; padding: 4px; border-radius: 50%; cursor: pointer; }
.ci-chip button:hover { background: var(--accent-soft); }
.ci-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.ci-tools .btn { flex: 1 1 auto; }
.ci-wa { color: #1DA851 !important; flex: none; }
.ci-msg { white-space: pre-wrap; font-size: 13px; line-height: 1.5; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; max-height: 180px; overflow: auto; }
.ci-progress { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.ci-progress i { display: block; height: 100%; background: var(--green); }
.ci-table { overflow-x: auto; }
.ci-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ci-table th, .ci-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.ci-details summary { cursor: pointer; font-weight: 700; font-size: 13px; }

/* Tiket peserta */
.tk-card { background: #fff; color: #111; border-radius: 22px; padding: 22px 18px 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.tk-qr { line-height: 0; }
.tk-qr svg { width: 250px; max-width: 72vw; height: auto; }
.tk-code { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: .04em; color: #B5651D; margin-top: 4px; }
.tk-name { font-weight: 800; font-size: 20px; line-height: 1.2; }
.tk-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 14px; color: #555; }
.tk-meta b { color: #111; }
.tk-done { display: flex; align-items: center; gap: 6px; margin-top: 6px; background: #E5F4EE; color: #12805C; font-weight: 700; font-size: 13px; border-radius: 999px; padding: 6px 12px; }

/* Skrin kaunter (krew) */
body.kt-mode #app { max-width: 720px; }
.kt-page { min-height: 100vh; min-height: 100dvh; padding: 0 16px 40px; display: flex; flex-direction: column; gap: 12px; background: var(--ground); }
.kt-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 0; background: var(--ground); border-bottom: 1px solid var(--line-2); }
.kt-logo { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.kt-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kt-title > b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kt-select { font: inherit; font-weight: 700; font-size: 16px; background: none; color: var(--text); border: 0; padding: 0; max-width: 100%; }
.kt-stat { font-size: 13px; color: var(--muted); }
.kt-stat b { color: var(--green); font-size: 15px; }
.kt-ghost { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.kt-closed { background: var(--red-soft); color: var(--red); font-weight: 700; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.kt-counter { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.kt-counter input { flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 0 12px; font-size: 15px; font-weight: 600; }
.kt-scan-btn { display: flex; align-items: center; justify-content: center; gap: 14px; height: 92px; border: 0; border-radius: 22px; background: var(--cta); color: var(--cta-ink); font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .06em; box-shadow: 0 10px 28px var(--cta-glow); cursor: pointer; }
.kt-scan-btn:active { transform: scale(.98); }
.kt-search { display: flex; gap: 8px; }
.kt-search input { flex: 1; min-width: 0; height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 0 14px; font-size: 16px; }
.kt-search button { width: 52px; height: 52px; border-radius: 14px; border: 0; background: var(--strong); color: var(--strong-ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.kt-walkin { align-self: center; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; padding: 10px; cursor: pointer; text-decoration: underline; }
.kt-note { border-radius: 14px; padding: 14px 16px; font-weight: 800; font-size: 16px; line-height: 1.35; margin-bottom: 10px; }
.kt-note.ok { background: var(--green); color: #fff; }
.kt-note.warn { background: var(--amber); color: #2A1800; }
.kt-note.err { background: var(--red); color: #fff; animation: kt-shake .4s; }
@keyframes kt-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.kt-person { background: var(--card); border: 1px solid var(--line-2); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.kt-status { display: flex; align-items: center; gap: 8px; border-radius: 12px; padding: 10px 12px; font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.kt-status.ok { background: var(--green-soft); color: var(--green); }
.kt-status.in { background: var(--amber-soft); color: var(--amber-ink); }
.kt-pcode { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.kt-pname { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.15; overflow-wrap: anywhere; }
.kt-pmeta { display: flex; gap: 14px; align-items: center; }
.kt-size { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 84px; height: 84px; border-radius: 18px; background: var(--strong); color: var(--strong-ink); font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; padding: 0 10px; }
.kt-size small { font-size: 11px; letter-spacing: .14em; opacity: .7; margin-bottom: 4px; font-family: var(--body); }
.kt-info { font-size: 15px; line-height: 1.5; color: var(--muted); }
.kt-info b { color: var(--text); font-size: 18px; letter-spacing: .03em; }
.kt-pnote { font-size: 13px; background: var(--card-2); border-radius: 10px; padding: 8px 12px; }
.kt-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.kt-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 2px dashed var(--line); background: var(--card-2); color: var(--text); border-radius: 14px; padding: 12px; font-weight: 800; font-size: 16px; cursor: pointer; min-height: 64px; }
.kt-item small { font-weight: 500; font-size: 11px; color: var(--muted); }
.kt-item span { display: flex; align-items: center; gap: 6px; }
.kt-item.done { border: 2px solid var(--green); background: var(--green-soft); color: var(--green); cursor: default; }
.kt-item.done small { color: var(--green); }
.kt-item:disabled { opacity: .6; }
.kt-go { height: 64px; border: 0; border-radius: 16px; background: var(--green); color: #fff; font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: .04em; cursor: pointer; }
.kt-go:disabled { opacity: .6; }
.kt-complete { text-align: center; font-weight: 700; color: var(--green); padding: 8px; }
.kt-next { height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.kt-list { background: var(--card); border: 1px solid var(--line-2); border-radius: 18px; overflow: hidden; }
.kt-list-h { padding: 10px 14px; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.kt-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line-2); background: none; color: var(--text); text-align: left; cursor: pointer; }
.kt-row:last-child { border-bottom: 0; }
.kt-row > b { min-width: 58px; color: var(--accent); font-size: 14px; }
.kt-row > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kt-rname { font-weight: 700; font-size: 15px; }
.kt-row small { color: var(--muted); font-size: 12px; }
.kt-row em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--green); display: flex; align-items: center; gap: 3px; }
.kt-empty { margin: 80px auto; display: flex; flex-direction: column; gap: 10px; text-align: center; color: var(--muted); }
.kt-empty b { color: var(--text); font-size: 18px; }
.kt-scan { position: fixed; inset: 0; z-index: 90; background: #000; display: flex; align-items: center; justify-content: center; }
.kt-scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kt-frame { position: relative; width: min(70vw, 340px); aspect-ratio: 1; border-radius: 24px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); border: 3px solid #F5C542; }
.kt-scan-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(16px, env(safe-area-inset-top)) 16px 16px; color: #fff; font-size: 15px; }
.kt-x { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.kt-scan-msg { position: absolute; bottom: max(32px, env(safe-area-inset-bottom)); left: 16px; right: 16px; text-align: center; color: #fff; font-weight: 600; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .kt-note.err { animation: none; } }
.ci-kind { display: grid; gap: 8px; }
@media (min-width: 480px) { .ci-kind { grid-template-columns: 1fr 1fr; } }
.ci-kind button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card-2); color: var(--text); cursor: pointer; }
.ci-kind button b { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.ci-kind button span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.ci-kind button.on { border-color: var(--accent); background: var(--accent-soft); }
.ci-kind button:disabled { opacity: .45; cursor: not-allowed; }
.ag-row { gap: 8px; }
.ag-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--text); }
.ag-acts { display: flex; align-items: center; gap: 6px; flex: none; }
@media (max-width: 520px) { .ag-row { flex-wrap: wrap; } .ag-acts { width: 100%; justify-content: flex-end; } }
.tk-with { font-size: 13px; color: #555; margin-top: 2px; }
.tk-with b { color: #111; }
.kt-mates { display: flex; flex-direction: column; gap: 6px; }
.kt-mates > small { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.kt-mate { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); cursor: pointer; }
.kt-mate b { color: var(--accent); min-width: 54px; }
.kt-mate span { flex: 1; min-width: 0; font-weight: 600; }
.kt-mate em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--green); display: flex; align-items: center; gap: 3px; }
