@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 500; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin-800-normal.woff2) format('woff2'); }

:root {
  --accent: #0F766E;
  --accent-dark: #0B5A54;
  --accent-soft: #ECFDF5;
  --accent-text: #065F46;
  --text: #17201D;
  --muted: #6B7280;
  --muted-2: #9CA3AF;
  --label: #374151;
  --surface: #F4F6F5;
  --card: #FFFFFF;
  --line: #E5E7EB;
  --line-2: #D1D5DB;
  --star: #F59E0B;
  --amber-text: #B45309;
  --amber-soft: #FEF3C7;
  --danger: #B91C1C;
  --danger-soft: #FEE2E2;
  --radius: 16px;
  --radius-sm: 12px;
  --tab-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--surface);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; background: var(--surface); }
#main { flex: 1; display: flex; flex-direction: column; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
#main.no-tabs { padding-bottom: 0; }

/* Screen scaffolding */
.screen { display: flex; flex-direction: column; min-height: 100%; }
.topbar { background: var(--card); padding: calc(16px + env(safe-area-inset-top)) 20px 14px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-row { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; flex: 1; min-width: 0; }
.topbar-sub { font-size: 13px; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm); background: #F3F4F6; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.icon-btn svg { width: 20px; height: 20px; }
.content { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.content-white { background: var(--card); flex: 1; }
.sticky-footer { position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); padding: 12px 20px; z-index: 4; }
#main.no-tabs .sticky-footer { bottom: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 40px; height: 40px; border-radius: 12px; }
.wordmark { font-weight: 800; letter-spacing: -0.04em; line-height: 1; display: inline-flex; align-items: baseline; gap: 0.18em; }
.wordmark .k { color: var(--accent); }
.wordmark .dot { display: inline-block; width: 0.26em; height: 0.26em; border-radius: 999px; background: var(--star); }

/* Buttons */
.btn { height: 50px; padding: 0 18px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-lg { height: 54px; font-size: 16px; }
.btn-sm { height: 40px; font-size: 13px; border-radius: 12px; width: auto; padding: 0 14px; }
.btn-outline { background: var(--card); color: var(--accent); border: 1.5px solid var(--accent); }
.btn-ghost { background: #F3F4F6; color: var(--label); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; padding: 8px; text-align: center; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field-label { font-size: 13px; font-weight: 600; color: var(--label); }
.input, .field input[type=text], .field input[type=tel], .field input[type=password], .field input[type=number], .field input[type=date], .field textarea, .field select {
  border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); padding: 0 14px; height: 50px; width: 100%; background: var(--card); font-size: 16px; color: var(--text); outline: none;
}
.field textarea { height: auto; padding: 12px 14px; resize: none; min-height: 88px; }
.field input:focus, .field textarea:focus, .field select:focus, .input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,118,110,0.15); }
.input-wrap { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); padding: 0 14px; height: 52px; background: var(--card); }
.input-wrap input, .field .input-wrap input[type=tel], .field .input-wrap input[type=text], .field .input-wrap input[type=number] { flex: 1; border: 0 !important; outline: 0; background: transparent; font-size: 16px; min-width: 0; height: 100%; padding: 0; box-shadow: none !important; }
.field .input-wrap select, .input-wrap select { width: auto; flex: 0 0 auto; height: 100%; padding: 0 4px; border: 0 !important; background: transparent; font-size: 13px; color: var(--muted); max-width: 40%; }
.input-wrap .prefix { font-size: 15px; color: var(--muted); font-weight: 600; }
.input-wrap .suffix { font-size: 13px; color: var(--muted); }
.input-wrap input.big { font-size: 20px; font-weight: 800; }
.help { font-size: 12px; color: var(--muted); line-height: 1.4; }
.error-text { font-size: 12px; color: var(--danger); font-weight: 600; }
.field.has-error input, .field.has-error textarea, .field.has-error .input-wrap { border-color: var(--danger); }
.radio-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.radio-card span { display: flex; align-items: center; justify-content: center; height: 48px; border: 1.5px solid var(--line-2); border-radius: 14px; background: var(--card); font-size: 13px; font-weight: 600; color: var(--label); text-align: center; padding: 0 6px; }
.radio-card input:checked + span { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.radio-card input:focus-visible + span { box-shadow: 0 0 0 3px rgba(15,118,110,0.25); }
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cat-grid .radio-card span { height: 72px; flex-direction: column; gap: 6px; }
.cat-grid svg { width: 22px; height: 22px; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); color: var(--label); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; flex-shrink: 0; }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; background: #F3F4F6; color: var(--label); font-size: 12px; font-weight: 600; }
.tag.good { background: var(--accent-soft); color: var(--accent-text); }
.tag.bad { background: var(--amber-soft); color: var(--amber-text); }
.tag-select { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-select .radio-card span { height: 40px; border-radius: 999px; padding: 0 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 700; text-decoration: none; }
.pill svg { width: 16px; height: 16px; }
.badge { position: absolute; top: 2px; right: calc(50% - 20px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); }
.card.selected { border: 2px solid var(--accent); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.card-price { font-size: 16px; font-weight: 800; white-space: nowrap; }
.kicker { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.meta-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--label); flex-wrap: wrap; }
.rating-num { color: var(--amber-text); font-weight: 700; }
.card-text { font-size: 13px; color: var(--muted); line-height: 1.4; }
.card-link { text-decoration: none; color: inherit; }
.section-title { font-size: 14px; font-weight: 700; color: var(--label); }
.list { background: var(--card); border-radius: 14px; border: 1px solid var(--line); display: flex; flex-direction: column; }
.list-item { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid #F3F4F6; text-decoration: none; color: inherit; }
.list-item:last-child { border-bottom: 0; }
.list-item .l1 { font-size: 13px; font-weight: 600; }
.list-item .l2 { font-size: 11px; color: var(--muted); }
.list-item.unread { background: var(--accent-soft); }
.amount-plus { font-size: 14px; font-weight: 700; color: var(--accent-text); }
.amount-minus { font-size: 14px; font-weight: 700; color: var(--amber-text); }

/* Avatar */
.avatar { width: 48px; height: 48px; border-radius: 999px; background: #D1FAE5; color: var(--accent-text); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; flex-shrink: 0; overflow: hidden; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person { display: flex; gap: 12px; align-items: center; }
.person .name { font-size: 16px; font-weight: 700; }
.person .sub { font-size: 12px; color: var(--muted); }
.verified { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-size: 11px; font-weight: 700; }
.verified svg { width: 14px; height: 14px; }

/* Status */
.status { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-open { background: var(--accent-soft); color: var(--accent-text); }
.status-accepted { background: #DBEAFE; color: #1E40AF; }
.status-done { background: #F3F4F6; color: var(--label); }
.status-cancelled, .status-expired, .status-rejected { background: var(--danger-soft); color: var(--danger); }
.status-pending { background: var(--amber-soft); color: var(--amber-text); }

/* Hero / balance */
.hero { background: var(--accent); color: #fff; border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.hero .big { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.hero .dim { opacity: 0.85; font-size: 13px; }
.pack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pack { padding: 14px 8px; border: 1.5px solid var(--line-2); border-radius: 14px; background: var(--card); display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--text); }
.pack.selected { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.pack .n { font-size: 22px; font-weight: 800; }
.pack .u { font-size: 11px; color: var(--muted); }
.pack.selected .u { color: var(--accent-text); }
.pack .p { font-size: 13px; font-weight: 700; }
.info-box { padding: 14px; border-radius: 14px; background: var(--surface); display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--label); line-height: 1.45; }
.info-box svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.bank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bank-box { padding: 12px; border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; font-size: 13px; font-weight: 700; }
.bank-box .lbl { font-size: 11px; color: var(--muted); font-weight: 400; }
.qris { padding: 8px; border-radius: 12px; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.qris img { max-height: 160px; border-radius: 8px; }

/* Stars */
.stars { display: flex; justify-content: center; gap: 10px; }
.stars button { background: none; border: 0; padding: 0; cursor: pointer; width: 44px; height: 44px; }
.stars svg { width: 44px; height: 44px; fill: var(--line-2); stroke: var(--line-2); }
.stars button.on svg { fill: var(--star); stroke: var(--star); }
.stars-sm { display: inline-flex; gap: 2px; }
.stars-sm svg { width: 14px; height: 14px; fill: var(--line-2); stroke: var(--line-2); }
.stars-sm svg.on { fill: var(--star); stroke: var(--star); }

/* Tab bar */
#tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; background: var(--card); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; z-index: 10; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
#tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; }
#tabbar a.active { color: var(--accent); font-weight: 700; }
#tabbar svg { width: 22px; height: 22px; }

/* Misc */
.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty svg { width: 48px; height: 48px; color: var(--line-2); }
.skeleton { background: linear-gradient(90deg, #ECEEED 25%, #F4F6F5 50%, #ECEEED 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); height: 140px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.banner { background: var(--text); color: #fff; padding: 12px 16px; border-radius: 14px; display: flex; gap: 12px; align-items: center; font-size: 13px; }
.banner .btn { width: auto; height: 36px; padding: 0 12px; font-size: 13px; background: #fff; color: var(--text); }
.banner .x { background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; padding: 0 4px; }
.notice { background: var(--amber-soft); color: var(--amber-text); padding: 12px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-grid .slot { aspect-ratio: 4/3; border-radius: 12px; background: var(--surface); border: 1.5px dashed var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; overflow: hidden; position: relative; cursor: pointer; }
.photo-grid .slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat .n { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.stat .l { font-size: 12px; color: var(--muted); }
.prose { font-size: 14px; line-height: 1.6; color: var(--label); display: flex; flex-direction: column; gap: 10px; }
.prose h2 { font-size: 16px; font-weight: 800; color: var(--text); margin-top: 8px; }
.prose ol, .prose ul { margin: 0; padding-left: 20px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); z-index: 50; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
#toast.show { opacity: 1; }
#toast.error { background: var(--danger); }
#toast.success { background: var(--accent); }
