:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --amber: #f59e0b;
  --amber-d: #d97706;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --green: #059669;
  --green-bg: #ecfdf5;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --blue-bg: #eff6ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
@media (min-width: 860px) { body { padding-bottom: 0; } }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--navy); color: #fff; padding-top: env(safe-area-inset-top); }
.topbar-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; flex-shrink: 0; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--amber); color: var(--navy); display: grid; place-items: center; font-weight: 800; }
.logo-text b { color: var(--amber); }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: 0 14px; height: 42px; max-width: 560px; }
.search:focus-within { background: #fff; color: var(--text); }
.search svg { width: 18px; height: 18px; fill: currentColor; opacity: .7; flex-shrink: 0; }
.search input { flex: 1; background: none; border: 0; outline: 0; min-width: 0; }
.search input::placeholder { color: inherit; opacity: .65; }
.topnav { display: none; align-items: center; gap: 6px; margin-left: auto; }
.topnav a { padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.topnav a:hover { background: rgba(255,255,255,.1); }
@media (min-width: 860px) { .topnav { display: flex; } }
@media (max-width: 520px) { .logo-text { display: none; } }

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.bottomnav a.active { color: var(--navy); }
.bottomnav svg { width: 22px; height: 22px; fill: currentColor; }
.bottomnav a.sell span.ic { background: var(--amber); color: var(--navy); border-radius: 10px; padding: 2px 10px; }
@media (min-width: 860px) { .bottomnav { display: none; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; cursor: pointer; transition: transform .05s, background .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-amber { background: var(--amber); color: var(--navy); }
.btn-amber:hover { background: var(--amber-d); }
.btn-ghost { background: #fff; border-color: var(--line); }
.btn-ghost:hover { background: #f8fafc; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-block { width: 100%; }
.btn-lg { height: 52px; font-size: 16px; }
.topnav .btn-amber { color: var(--navy); }

/* ---------- Home ---------- */
.hero { margin: 20px 0 8px; padding: 28px 24px; border-radius: 20px; background: linear-gradient(135deg, var(--navy) 0%, #1e4d8c 100%); color: #fff; display: grid; gap: 14px; }
.hero h1 { margin: 0; font-size: clamp(24px, 4vw, 34px); line-height: 1.15; letter-spacing: -.02em; }
.hero p { margin: 0; opacity: .85; max-width: 560px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0 14px; flex-wrap: wrap; }
.toolbar h2 { margin: 0; font-size: 18px; }
.select { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.card .thumb { aspect-ratio: 4 / 3; background: #e2e8f0 center / cover no-repeat; position: relative; display: grid; place-items: center; font-size: 36px; }
.card .badge-pos { position: absolute; top: 8px; left: 8px; line-height: 1; }
.card .body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.card .title { font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.card .price { font-weight: 800; font-size: 17px; color: var(--navy); }
.card .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #fff; color: var(--navy); }
.badge.hot { background: var(--red); color: #fff; }
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.bad { background: var(--red-bg); color: var(--red); }
.badge.info { background: var(--blue-bg); color: #1d4ed8; }
.badge.gray { background: #f1f5f9; color: var(--muted); }
.cd.urgent { color: var(--red); font-weight: 700; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); background: #fff; border-radius: var(--radius); border: 1px dashed var(--line); }
.empty .big { font-size: 40px; margin-bottom: 6px; }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%); background-size: 400% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }

/* ---------- Detail ---------- */
.crumbs { margin: 16px 0 10px; font-size: 13px; color: var(--muted); }
.crumbs a:hover { text-decoration: underline; }
.detail { display: grid; gap: 20px; }
@media (min-width: 900px) { .detail { grid-template-columns: 1.3fr 1fr; align-items: start; } .bidbox { position: sticky; top: 80px; } }
.gallery .main { aspect-ratio: 4 / 3; border-radius: var(--radius); background: #e2e8f0 center / contain no-repeat; display: grid; place-items: center; font-size: 64px; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.gallery .thumbs button { width: 70px; height: 56px; border-radius: 8px; border: 2px solid transparent; background: #e2e8f0 center / cover; cursor: pointer; flex-shrink: 0; }
.gallery .thumbs button.active { border-color: var(--amber); }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel h3 { margin: 0 0 10px; font-size: 16px; }
.dtitle { margin: 0 0 6px; font-size: clamp(20px, 3vw, 26px); line-height: 1.25; letter-spacing: -.01em; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.bigprice { font-size: 32px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; line-height: 1.1; transition: color .3s; }
.bigprice.flash { color: var(--amber-d); }
.timer { display: flex; gap: 8px; margin: 14px 0; }
.timer div { flex: 1; background: #f1f5f9; border-radius: 10px; text-align: center; padding: 8px 0; }
.timer b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.timer span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.timer.urgent div { background: var(--red-bg); color: var(--red); }
.status-banner { padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.status-banner.win { background: var(--green-bg); color: var(--green); }
.status-banner.lose { background: var(--red-bg); color: var(--red); }
.status-banner.info { background: var(--blue-bg); color: #1d4ed8; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.quick button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 4px; font-weight: 700; cursor: pointer; font-size: 14px; }
.quick button:hover, .quick button.active { border-color: var(--navy); background: #f8fafc; }
.quick small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.moneyin { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; height: 52px; }
.moneyin:focus-within { border-color: var(--navy); }
.moneyin span { padding: 0 12px; font-weight: 700; color: var(--muted); }
.moneyin input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: 20px; font-weight: 700; height: 100%; }
.bidrow { display: flex; gap: 8px; margin-top: 8px; }
.bidrow .moneyin { flex: 1; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.bids { list-style: none; margin: 0; padding: 0; }
.bids li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.bids li:last-child { border-bottom: 0; }
.bids li.me { font-weight: 700; color: var(--navy); }
.bids li:first-child .amt { color: var(--green); font-weight: 800; }
.desc { white-space: pre-wrap; word-wrap: break-word; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* ---------- Forms ---------- */
.formcard { max-width: 460px; margin: 28px auto; }
.formcard.wide { max-width: 760px; }
.formcard h1 { margin: 0 0 4px; font-size: 24px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 14px; }
.field .opt { font-weight: 400; color: var(--muted); }
.input, textarea.input, select.input { width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; background: #fff; outline: 0; }
textarea.input { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--navy); }
.field.error .input, .field.error .moneyin { border-color: var(--red); }
.field .msg { font-size: 13px; color: var(--red); }
.field .help { font-size: 13px; color: var(--muted); }
.row2 { display: grid; gap: 0 14px; }
@media (min-width: 600px) { .row2 { grid-template-columns: 1fr 1fr; } }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 14px; background: #fff; }
.seg input:checked + span { border-color: var(--navy); background: var(--navy); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--amber); }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; cursor: pointer; background: #fafbfd; }
.dropzone.drag { border-color: var(--navy); background: var(--blue-bg); }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 10px; }
.previews div { position: relative; aspect-ratio: 1; border-radius: 10px; background: #e2e8f0 center / cover; }
.previews div:first-child::after { content: "Kulit"; position: absolute; bottom: 4px; left: 4px; background: var(--amber); color: var(--navy); font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.previews button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(15,23,42,.75); color: #fff; cursor: pointer; line-height: 1; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 22px 0 10px; }
.alt { text-align: center; margin-top: 14px; font-size: 14px; }
.alt a { color: var(--navy); font-weight: 700; }

/* ---------- Account ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--navy); border-color: var(--amber); }
.list { display: grid; gap: 10px; }
.item { display: flex; gap: 12px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; align-items: center; }
.item .th { width: 76px; height: 76px; border-radius: 10px; background: #e2e8f0 center / cover; flex-shrink: 0; display: grid; place-items: center; font-size: 28px; }
.item .in { flex: 1; min-width: 0; display: grid; gap: 3px; }
.item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }

/* ---------- Steps (cara bida) ---------- */
.steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 16px 0; }
.steps .panel b.n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--amber); color: var(--navy); margin-bottom: 8px; }

/* ---------- Toasts & sheet ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
@media (min-width: 860px) { .toasts { bottom: 24px; } }
.toast { background: var(--text); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; animation: tin .2s ease-out; }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
.backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 70; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@media (min-width: 600px) { .backdrop { align-items: center; } }
@keyframes fade { from { opacity: 0; } }
.sheet { background: #fff; width: 100%; max-width: 440px; border-radius: 20px 20px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
@media (min-width: 600px) { .sheet { border-radius: 20px; } }
@keyframes up { from { transform: translateY(30px); } }
.sheet h3 { margin: 0 0 6px; font-size: 18px; }
.sheet .amt { font-size: 34px; font-weight: 800; color: var(--navy); margin: 8px 0; }
.sheet .acts { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 16px; }

.footer { margin-top: 40px; padding: 24px 0; border-top: 1px solid var(--line); font-size: 14px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.footer a:hover { text-decoration: underline; }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
