/* Kalokalo site layer — built on tokens.css + components.css (copied unchanged from design/). */
:root { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
a { color: var(--gold); }
a:hover { color: var(--focus); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold-fill); color: var(--on-gold); padding: 8px 14px; border-radius: var(--radius-md); z-index: 100; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 700px) { .wrap { padding: 0 24px; } }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { padding-top: 16px; padding-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo span { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 32px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; font-weight: 500; flex: 1 1 auto; }
.nav a { color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold); }
.nav a.is-raffle:hover, .nav a.is-raffle[aria-current="page"] { color: var(--lagoon); }
.head-actions { display: flex; gap: 12px; align-items: center; }
.link-muted { color: var(--ink-muted); text-decoration: none; font-size: 14px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; background: none; border: 0; cursor: pointer; font-family: inherit; padding: 0 4px; }
.link-muted:hover { color: var(--gold); }
.icon-btn { background: transparent; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--ink); width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.badge-dot { background: var(--ember); color: #14110a; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 0 6px; margin-left: 6px; line-height: 18px; }
a.kk-btn { text-decoration: none; }
a.kk-btn-primary, a.kk-btn-primary:hover { color: var(--on-gold); }
a.kk-btn-secondary { color: var(--ink); }
a.kk-btn-secondary:hover { color: var(--gold); }
.kk-btn { min-height: 44px; }

/* Flash */
.flash-wrap { padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.flash { border-radius: var(--radius-md); padding: 12px 16px; font-size: 14px; line-height: 20px; border: 1px solid var(--line); background: var(--bg-100); }
.flash-success { background: var(--success-fill); color: var(--success); border-color: transparent; }
.flash-error { background: var(--ember-fill); color: var(--ember); border-color: transparent; }

/* Type scale */
.h-display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(34px, 5vw, 44px); line-height: 1.1; }
.h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 4vw, 36px); line-height: 1.12; }
.h3 { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1.15; }
.muted { color: var(--ink-muted); }
.gold { color: var(--gold); } .lagoon { color: var(--lagoon); }
.tnum { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }

/* Hero */
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 48px; align-items: center; padding-top: 48px; padding-bottom: 48px; }
@media (min-width: 700px) { .hero { padding-top: 72px; padding-bottom: 56px; } }
.hero h1 { font-size: clamp(44px, 6vw, 68px); line-height: 1.02; }
.hero p { font-size: 17px; line-height: 28px; max-width: 520px; margin: 0; }
.search { display: flex; flex-wrap: wrap; gap: 12px; max-width: 560px; }
.search .kk-input { flex: 1 1 260px; }
.stats { display: flex; flex-wrap: wrap; gap: 24px 32px; padding-top: 8px; }
.stat-n { font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.hero-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tile { border-radius: var(--radius-lg); background: var(--bg-100); border: 1px solid var(--line); min-height: 182px; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; text-decoration: none; color: var(--ink); background-size: cover; background-position: center; position: relative; overflow: hidden; }
.tile:hover { box-shadow: var(--shadow-lift); color: var(--ink); }
.tile-big { grid-row: span 2; background-color: var(--bg-200); min-height: 380px; padding: 20px; gap: 8px; }
.tile .kk-badge { align-self: flex-start; position: relative; }
.tile-t { font-weight: 600; position: relative; }
.tile-big .tile-t { font-family: var(--font-display); font-size: 26px; line-height: 30px; }
.tile-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-muted); font-size: 13px; opacity: .9; }
@media (max-width: 560px) { .tile-big { min-height: 260px; } }

.chips { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chips .wrap { padding-top: 20px; padding-bottom: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip { text-decoration: none; color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); padding: 10px 16px; font-size: 14px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; background: transparent; }
.chip:hover, .chip[aria-current="true"] { border-color: var(--gold); color: var(--gold); }

.section { padding-top: 56px; display: flex; flex-direction: column; gap: 24px; }
.grid-lots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 24px; }
.grid-lots .kk-lot { max-width: 320px; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 40px 24px; text-align: center; color: var(--ink-muted); }

.card { background: var(--bg-100); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.card-lg { padding: 32px; }
.two-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 24px; }
.two-ways ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-muted); }
.note-line { font-size: 13px; color: var(--ink-muted); border-top: 1px solid var(--line); padding-top: 12px; }
.trust { border-top: 1px solid var(--line); margin-top: 72px; }
.trust .wrap { padding-top: 32px; padding-bottom: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 24px; }
.trust-item { display: flex; flex-direction: column; gap: 6px; }
.trust-item .kk-badge { align-self: flex-start; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: auto; }
.site-footer .wrap { padding-top: 32px; padding-bottom: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--ink-muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer a { color: var(--ink-muted); min-height: 44px; display: inline-flex; align-items: center; }
.site-footer a:hover { color: var(--gold); }

/* Lot detail */
.crumbs { font-size: 13px; color: var(--ink-muted); display: flex; gap: 8px; flex-wrap: wrap; padding-top: 24px; }
.crumbs a { color: var(--ink-muted); }
.lot-layout { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding-top: 24px; padding-bottom: 72px; }
.lot-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.lot-side { flex: 1 1 340px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 24px; min-width: 0; }
.lot-side .kk-panel, .lot-side .side-card { max-width: 380px; width: 100%; }
.gallery-main { aspect-ratio: 16 / 10; background: var(--bg-200); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.thumb { aspect-ratio: 4/3; background: var(--bg-100); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0; overflow: hidden; cursor: pointer; min-height: 44px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb[aria-current="true"] { border-color: var(--gold); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.facts > div { background: var(--bg-100); padding: 16px; }
.facts b { display: block; margin-top: 4px; }
.lot-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(32px, 5vw, 44px); line-height: 1.12; }
.bullets { margin: 0; padding-left: 20px; color: var(--ink-muted); display: flex; flex-direction: column; gap: 6px; }
.prose { margin: 0; color: var(--ink-muted); max-width: 680px; white-space: pre-line; }
.steps3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.steps3 .card { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.steps3 .n { font-family: var(--font-display); font-size: 32px; font-weight: 600; color: var(--lagoon); }
.side-card { background: var(--bg-100); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.bid-row { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ticket-chip { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; color: var(--lagoon); background: var(--lagoon-fill); border-radius: var(--radius-sm); padding: 6px 10px; }
.kk-panel { width: 100%; }
.kk-panel-action { display: contents; }
.kk-alert { margin: 0; }
.kk-alert-info { background: var(--bg-200); color: var(--ink); }
.field-error { color: var(--ember); font-size: 13px; }
.kk-count[data-ended="1"] { color: var(--ink-muted); }
@media (max-width: 899px) {
  .lot-side { position: static; flex-basis: 100%; }
  .lot-side .kk-panel, .lot-side .side-card { max-width: none; }
  body.has-bar { padding-bottom: 88px; }
  .kk-panel-action { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg-100); border-top: 1px solid var(--line); padding: 12px var(--space-4) calc(12px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lift); }
}

/* Forms */
.form { display: flex; flex-direction: column; gap: 40px; }
fieldset.fs { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
fieldset.fs > legend { margin-bottom: 12px; padding: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.lbl { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.lbl small, .hint { font-size: 12px; font-weight: 400; color: var(--ink-muted); }
.kk-input input, .kk-input select, .kk-input textarea { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 400 15px/24px var(--font-sans); padding: 12px 8px; outline: none; }
.kk-input select option { background: var(--bg-100); color: var(--ink); }
.kk-input textarea { resize: vertical; min-height: 120px; }
.kk-input.is-error { border-color: var(--ember); }
.kk-input input[type="number"] { font-weight: 600; font-variant-numeric: tabular-nums; }
.kk-input input[type="file"] { font-size: 14px; padding: 10px 0; }
.mode-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.mode { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--radius-lg); background: var(--bg-100); color: var(--ink); font-family: var(--font-sans); min-height: 44px; border: 2px solid var(--line); position: relative; }
.mode input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.mode:has(input:checked) { border-color: var(--gold-fill); }
.mode.is-raffle:has(input:checked) { border-color: var(--lagoon); }
.mode:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.mode .t { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.mode .d { font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.drop { border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.photo-list { display: flex; flex-wrap: wrap; gap: 12px; }
.photo-list label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-muted); }
.photo-list img { width: 96px; height: 72px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--line); }
.sell-layout { padding-top: 40px; padding-bottom: 80px; display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.sell-layout > form { flex: 999 1 560px; min-width: 0; }
.sell-layout > aside { flex: 1 1 320px; position: sticky; top: 24px; }
.sell-layout .kk-panel { max-width: 380px; }
.dl-grid { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.dl-grid dt { color: var(--ink-muted); } .dl-grid dd { margin: 0; font-weight: 600; text-align: right; }

/* Browse */
.browse-head { padding-top: 40px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px 0 24px; }
.filters .lbl { flex: 1 1 150px; }
.filters .kk-input input, .filters .kk-input select { padding: 10px 8px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 32px 0; }

/* Auth */
.auth { max-width: 440px; margin: 0 auto; padding: 56px var(--space-4) 80px; display: flex; flex-direction: column; gap: 24px; }
.otp-input input { letter-spacing: .4em; font-size: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.devbox { border: 1px dashed var(--line-strong); border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; color: var(--ink-muted); }

/* Account / tables */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.tab { text-decoration: none; color: var(--ink); padding: 10px 14px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; border: 1px solid transparent; }
.tab:hover { border-color: var(--line-strong); }
.tab[aria-current="page"] { background: var(--bg-200); color: var(--gold); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-100); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font: 600 11px/14px var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
table.t tr:first-child td { border-top: 0; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.page-pad { padding-top: 40px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 32px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.admin-tile { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
.admin-tile:hover { border-color: var(--gold); color: var(--ink); }
.admin-tile .n { font-family: var(--font-display); font-size: 40px; font-weight: 600; color: var(--gold); line-height: 1; }
.review { display: flex; flex-direction: column; gap: 16px; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.inline-form .kk-input { flex: 1 1 200px; }
.kk-btn-danger { background: transparent; color: var(--ember); border-color: var(--ember); }
.kk-btn-danger:hover:not(:disabled) { background: var(--ember-fill); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.verify-ok { color: var(--success); } .verify-bad { color: var(--ember); }
.static { max-width: 760px; padding-top: 48px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 20px; }
.static p, .static li { color: var(--ink-muted); }
.todo { background: var(--bg-200); color: var(--ink); padding: 0 6px; border-radius: var(--radius-sm); }
.ticket-grid { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow: auto; padding: 4px; }
.ticket-grid .ticket-chip { font-size: 12px; padding: 4px 8px; }
.ticket-grid .win { background: var(--gold-fill); color: var(--on-gold); }
.error-page { text-align: center; padding: 96px 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Payment method picker */
.pay-opt { display: flex; align-items: center; gap: 14px; cursor: pointer; padding: 14px 18px; min-height: 44px; }
.pay-opt:has(input:checked) { border-color: var(--gold); }
.pay-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.pay-opt input { accent-color: var(--gold-fill); width: 18px; height: 18px; }
.pay-logo { font: 700 12px/1 var(--font-sans); letter-spacing: .04em; border-radius: 6px; padding: 8px 10px; min-width: 66px; text-align: center; color: #fff; }
.pay-card { background: #3b4252; } .pay-mpaisa { background: #e60000; } .pay-mycash { background: #d5232a; font-style: italic; }
.pay-opt small { font-size: 12px; }
.brand-mark { display: block; }
