/* =========================================================
   Liburan Bareng — tema tropis (laut toska + sunset)
   ========================================================= */
:root {
  --bg: #F5F2EC;
  --bg-2: #EEE9E0;
  --card: #FFFFFF;
  --text: #102530;
  --muted: #6A7B86;
  --line: #E8E2D8;
  --primary: #0B8A92;
  --primary-strong: #07707A;
  --primary-soft: #DCF2F1;
  --accent: #FF7A59;
  --accent-soft: #FFE8E0;
  --sun: #FFB547;
  --danger: #E5484D;
  --danger-soft: #FDE8E8;
  --ok: #17905C;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(16, 37, 48, .05), 0 6px 18px -8px rgba(16, 37, 48, .14);
  --shadow-lg: 0 18px 40px -16px rgba(7, 60, 70, .45);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
  --nav-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C171D;
    --bg-2: #182A33;
    --card: #142530;
    --text: #E6F0F2;
    --muted: #8DA2AD;
    --line: #223844;
    --primary: #38C6C6;
    --primary-strong: #5ED6D3;
    --primary-soft: #12363C;
    --accent: #FF8A6B;
    --accent-soft: #3A221C;
    --danger: #FF6B6F;
    --danger-soft: #3A1C1E;
    --ok: #4ED39A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 18px 40px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: 110px; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
button { font-family: inherit; }
main { padding: 14px 16px; }
main.with-nav { padding-bottom: calc(var(--nav-h) + 90px); }

.ic { width: 20px; height: 20px; flex: none; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.tiny { font-size: .74rem; }
.pre { white-space: pre-wrap; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
.warn { color: #B26A00; margin-top: 10px; }
.stack { display: grid; gap: 12px; }

.card {
  display: block; background: var(--card); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); color: inherit; margin-bottom: 12px;
}
.stack > .card { margin-bottom: 0; }
.card.list { padding: 4px 0; overflow: hidden; }

.section-head { display: flex; align-items: baseline; gap: 10px; margin: 24px 2px 10px; }
.section-head h2 { flex: 1; font-size: 1.05rem; font-weight: 800; }
.section-head a { font-size: .84rem; font-weight: 600; }

/* ---------- Tombol ---------- */
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 0; background: transparent; color: inherit; cursor: pointer; list-style: none; flex: none;
}
.icon-btn:hover { background: rgba(127, 127, 127, .12); }
.icon-btn::-webkit-details-marker { display: none; }
.btn {
  border: 0; background: var(--bg-2); color: var(--text);
  padding: 11px 18px; border-radius: 14px; font-size: .95rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: #fff; box-shadow: 0 8px 18px -8px var(--primary); }
.btn.outline { background: var(--card); color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary-soft); }
.btn.danger { color: var(--danger); background: transparent; }
.btn.danger-soft { color: var(--danger); background: var(--danger-soft); margin-top: 18px; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 6px 12px; font-size: .8rem; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.btn.block { width: 100%; padding: 14px; }
.btn:disabled { opacity: .6; }
.link { border: 0; background: none; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.link.small { font-size: .82rem; }

.fab {
  position: fixed; z-index: 20; right: max(16px, calc(50% - 304px));
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 18px; padding: 15px 20px;
  background: linear-gradient(135deg, var(--accent), #FF5E62); color: #fff; font-size: .95rem; font-weight: 800;
  box-shadow: 0 12px 26px -10px rgba(255, 94, 98, .75); cursor: pointer;
}
.fab:active { transform: scale(.96); }
#app > .fab { bottom: calc(20px + env(safe-area-inset-bottom)); }

/* ---------- Header beranda ---------- */
.home-head {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 4px;
  padding: 12px 12px 10px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.brand { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 1.12rem; font-weight: 500; letter-spacing: -.02em; }
.brand img { border-radius: 10px; }
.brand b { font-weight: 800; color: var(--primary); }
.hello { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; margin: 6px 2px 18px; line-height: 1.15; }
.hello span { display: inline-block; animation: sway 3s ease-in-out infinite; transform-origin: bottom; }
@keyframes sway { 50% { transform: rotate(8deg); } }

/* Kartu trip */
.trip-card { display: block; background: var(--card); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); color: inherit; transition: transform .15s; }
.trip-card:active { transform: scale(.985); }
.trip-cover {
  position: relative; padding: 18px 18px 34px; color: #fff; min-height: 128px;
  background: radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.25), transparent 50%), linear-gradient(135deg, var(--c1), var(--c2));
}
.trip-cover .status { position: absolute; top: 14px; right: 14px; }
.cover-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin-top: 18px; padding-right: 90px; }
.cover-sub { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: .85rem; opacity: .92; margin-top: 4px; }
.cover-sub .ic { width: 15px; height: 15px; }
.cover-sub i { font-style: normal; opacity: .7; }
.wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 22px; fill: var(--card); }
.trip-body { display: flex; align-items: center; gap: 14px; padding: 4px 18px 16px; }
.trip-money .bar { margin: 6px 0 0; }

.status { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: .74rem; font-weight: 800; background: rgba(255,255,255,.22); color: #fff; backdrop-filter: blur(6px); }
.status.st-ongoing { background: #fff; color: var(--ok); }

.avatars { display: inline-flex; flex: none; }
.av {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: .8rem;
  box-shadow: 0 0 0 2.5px var(--card);
}
.avatars .av + .av { margin-left: -9px; }
.avatars .av:nth-child(2) { background: var(--accent-soft); color: var(--accent); }
.avatars .av:nth-child(3) { background: #EEE8FF; color: #6D4AE0; }
.avatars .av:nth-child(4) { background: #FFF2D6; color: #B7791F; }
.av.more { background: var(--bg-2); color: var(--muted); }
.av.lg { width: 42px; height: 42px; font-size: 1rem; box-shadow: none; }

.join-tile {
  width: 100%; margin-top: 14px; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; border-radius: 20px; border: 2px dashed var(--line); background: transparent; color: var(--text); cursor: pointer;
}
.join-tile .ic { color: var(--primary); width: 24px; height: 24px; }
.join-tile small { display: block; color: var(--muted); font-size: .8rem; }

/* ---------- Menu ---------- */
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: 46px; min-width: 240px; background: var(--card);
  border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.18); padding: 6px; z-index: 30;
}
.menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 12px; border-radius: 10px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.menu-pop button:hover { background: var(--bg); }
.menu-pop .ic { color: var(--primary); }

/* ---------- Header trip & navigasi bawah ---------- */
.trip-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 6px; color: #fff;
  padding: 10px 8px 12px; padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 6px 20px -12px rgba(0,0,0,.4);
}
.trip-top h1 { font-size: 1.08rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-top .sub { font-size: .8rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-top .icon-btn:hover { background: rgba(255,255,255,.18); }
main.tab-overview .hero, main.tab-members .code-card { margin-top: -14px; }
.trip-top + main.tab-overview, .trip-top + main.tab-members { padding-top: 14px; }

.bottom-nav {
  position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 640px; display: flex; justify-content: space-around;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0 5px; border-radius: 14px; color: var(--muted); font-size: .7rem; font-weight: 700;
}
.bottom-nav a .ic { width: 23px; height: 23px; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a.active .ic { background: var(--primary-soft); border-radius: 10px; padding: 3px 12px; width: 48px; height: 29px; margin: -3px 0; stroke-width: 2.2; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar h1 { font-size: 1.1rem; font-weight: 800; }

.offline { background: #FFF1D6; color: #8A5300; padding: 9px 16px; font-size: .84rem; font-weight: 600; text-align: center; }
@media (prefers-color-scheme: dark) { .offline { background: #3A2A10; color: #FFC46B; } }

/* ---------- Ringkasan ---------- */
.hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px;
  margin: 0 -16px 14px; padding: 16px 20px 40px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 120% at 100% 0%, rgba(255,255,255,.22), transparent 55%); pointer-events: none; }
.hero .wave { fill: var(--bg); height: 26px; }
.hero-count {
  position: relative; width: 96px; height: 96px; flex: none; border-radius: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}
.hero-count b { font-size: 2.3rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.hero-count span { font-size: .72rem; font-weight: 700; opacity: .9; margin: 3px 0; }
.hero > .grow { position: relative; }
.hero-label { font-size: .74rem; font-weight: 800; opacity: .85; text-transform: uppercase; letter-spacing: .08em; }
.hero-dest { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 2px 0 4px; }
.hero-date { font-size: .84rem; opacity: .92; margin-bottom: 10px; }
.hero .av { box-shadow: 0 0 0 2.5px rgba(255,255,255,.9); }

.budget-card { display: flex; align-items: center; gap: 18px; }
.ring {
  --p: 0; width: 108px; height: 108px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--bg-2) 0);
}
.ring.over { background: conic-gradient(var(--danger) 100%, var(--bg-2) 0); }
.ring > span { width: 80px; height: 80px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring b { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.ring small { font-size: .68rem; color: var(--muted); font-weight: 600; text-align: center; line-height: 1.2; }
.budget-lines { flex: 1; min-width: 0; display: grid; gap: 7px; }
.budget-lines > div { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; }
.budget-lines span { color: var(--muted); }
.budget-lines b { font-weight: 800; white-space: nowrap; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick a { background: var(--card); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); color: inherit; display: flex; flex-direction: column; gap: 1px; }
.quick .q-ic { font-size: 1.25rem; margin-bottom: 4px; }
.quick b { font-size: 1.15rem; font-weight: 800; }
.quick small { color: var(--muted); font-size: .76rem; font-weight: 600; }

.add-tile {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px;
  border-radius: 18px; border: 2px dashed var(--line); background: transparent; color: var(--primary); font-weight: 700; font-size: .92rem; cursor: pointer;
}

/* ---------- Rencana (timeline) ---------- */
.summary-pill { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 18px; background: var(--primary-soft); color: var(--primary-strong); font-size: .86rem; font-weight: 600; }
.summary-pill b { font-size: 1.1rem; font-weight: 800; }
.day { margin-top: 22px; }
.day-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.day-badge { padding: 5px 11px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: .76rem; font-weight: 800; white-space: nowrap; }
.day-head b { font-size: .92rem; }
.day-total { font-size: .82rem; font-weight: 700; color: var(--muted); }

.timeline { position: relative; }
.plan { position: relative; display: grid; grid-template-columns: 44px 18px 1fr; align-items: start; padding-bottom: 10px; }
.plan::before { content: ""; position: absolute; left: 52px; top: 22px; bottom: -4px; width: 2px; background: var(--line); }
.plan-time { font-size: .8rem; font-weight: 700; color: var(--muted); padding-top: 14px; font-variant-numeric: tabular-nums; }
.plan-dot { width: 12px; height: 12px; border-radius: 50%; margin: 17px 0 0 3px; background: var(--card); box-shadow: inset 0 0 0 3px var(--primary); position: relative; z-index: 1; }
.plan.done .plan-dot { background: var(--primary); }
.plan-card { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border-radius: 16px; padding: 12px 12px 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.plan-main { flex: 1; min-width: 0; cursor: pointer; }
.plan-title { font-weight: 700; display: flex; gap: 7px; }
.plan-emoji { flex: none; }
.plan.done .plan-title { text-decoration: line-through; color: var(--muted); }
.plan.done .plan-card { opacity: .75; }
.plan-loc { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; font-weight: 600; margin-top: 3px; max-width: 100%; }
.plan-loc .ic { width: 14px; height: 14px; }
.plan-cost { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: .86rem; }
.paid { display: inline-flex; align-items: center; gap: 3px; color: var(--ok); font-size: .78rem; font-weight: 700; }
.paid .ic { width: 14px; height: 14px; }
.plan-check-wrap { position: relative; flex: none; cursor: pointer; }
.plan-check { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.plan-check-wrap > span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--line); color: transparent; transition: all .15s; }
.plan-check-wrap .ic { width: 16px; height: 16px; stroke-width: 3; }
.plan-check:checked + span { background: var(--primary); box-shadow: none; color: #fff; }
.plan-check:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.mini-date { margin: 6px 0 6px 62px; font-size: .74rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.add-line {
  display: flex; align-items: center; gap: 6px; margin-left: 62px; padding: 10px 14px; border-radius: 14px;
  border: 2px dashed var(--line); background: transparent; color: var(--primary); font-weight: 700; font-size: .85rem; cursor: pointer; width: calc(100% - 62px);
}
.add-line .ic { width: 16px; height: 16px; }
.add-line.in-card { margin: 4px 12px 10px; width: calc(100% - 24px); flex-wrap: wrap; text-align: left; }

/* ---------- Tiket (boarding pass) ---------- */
.searchbar { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); margin-bottom: 12px; color: var(--muted); }
.searchbar input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; padding: 14px 0; outline: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; background: var(--card); color: var(--text); border-radius: 99px; padding: 8px 14px; font-size: .84rem; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.chip.active { background: var(--text); color: var(--bg); }

.pass { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.pass-main { display: flex; gap: 12px; align-items: flex-start; padding: 16px 16px 12px; cursor: pointer; }
.pass-icon { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: var(--primary-soft); }
.pass-type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pass-title { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; margin-top: 1px; overflow-wrap: anywhere; }
.pass-price { font-size: .86rem; font-weight: 800; white-space: nowrap; color: var(--primary-strong); }
.pass-cut { position: relative; height: 18px; }
.pass-cut::before { content: ""; position: absolute; left: 18px; right: 18px; top: 50%; border-top: 2px dashed var(--line); }
.pass-cut::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 0 50%, var(--bg) 9px, transparent 10px), radial-gradient(circle at 100% 50%, var(--bg) 9px, transparent 10px);
}
.pass-foot { display: flex; gap: 16px; align-items: center; padding: 8px 16px 12px; }
.pass-meta span, .pass-code span { display: flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pass-meta b { font-size: .92rem; font-weight: 800; white-space: nowrap; }
.pass-code { margin-left: auto; text-align: right; border: 0; background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: 6px 12px; cursor: pointer; }
.pass-code span { justify-content: flex-end; color: var(--accent); }
.pass-code .ic { width: 12px; height: 12px; }
.pass-code b { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .12em; }
.pass-note { margin: 0 16px 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: .84rem; color: var(--muted); white-space: pre-wrap; }
.pass-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 0; border-radius: 12px; padding: 9px 12px;
  background: var(--primary-soft); color: var(--primary-strong); font-size: .82rem; font-weight: 700; cursor: pointer;
}
.file-chip .ic { width: 16px; height: 16px; }
.file-chip .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.file-chip .muted { font-weight: 500; }
.file-chip.add { background: transparent; box-shadow: inset 0 0 0 2px var(--line); color: var(--muted); }
.pass-by { padding: 0 16px 14px; margin-top: -6px; font-size: .76rem; color: var(--muted); }

/* ---------- Uang ---------- */
.legend { display: flex; gap: 12px; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.dot.actual { background: var(--primary); }
.dot.plan { background: var(--sun); }
.bar { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--primary), #2EC4B6); border-radius: 99px; transition: width .4s; }
.bar.over > div { background: var(--danger); }
.bar.plan > div { background: var(--sun); }
.bar.thin { height: 4px; margin: 0 0 4px; }
.bar.actual.over > div { background: linear-gradient(90deg, var(--primary), #2EC4B6); }
.cat-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; padding-bottom: 0; }
.cat-row:first-child { padding-top: 0; }
.cat-emoji { font-size: 1.05rem; }

.split { padding: 4px 16px 16px; }
.split-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.split-row .av { width: 36px; height: 36px; box-shadow: none; }
.bal { font-weight: 800; font-size: .9rem; white-space: nowrap; }
.settle-box { margin-top: 12px; border-radius: 14px; background: var(--bg); padding: 12px 14px; }
.settle-title { font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.settle-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: .9rem; }
.settle-row .arrow { color: var(--accent); font-weight: 800; }
.settle-row .amt { font-weight: 800; color: var(--primary-strong); white-space: nowrap; }
.settle-ok { display: flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 700; }

.exp-date { display: flex; justify-content: space-between; margin: 16px 4px 8px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.exp { display: flex; gap: 12px; align-items: center; padding: 12px 16px; cursor: pointer; }
.exp + .exp { border-top: 1px solid var(--line); }
.exp-ic { width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--bg); font-size: 1.15rem; }
.exp-title { font-weight: 700; }
.exp-amt { font-weight: 800; white-space: nowrap; }

/* ---------- Anggota & kode ---------- */
.code-card {
  position: relative; overflow: hidden; margin: 0 -16px 6px; padding: 20px 18px 46px; color: #fff; text-align: center;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}
.code-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 120% at 100% 0%, rgba(255,255,255,.22), transparent 55%); pointer-events: none; }
.code-card > * { position: relative; }
.code-card .wave { position: absolute; fill: var(--bg); height: 26px; }
.code-label { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; opacity: .9; }
.code-boxes { display: inline-flex; gap: 6px; margin: 12px 0 8px; border: 0; background: none; cursor: pointer; padding: 0; }
.code-boxes span {
  width: 44px; height: 54px; border-radius: 12px; display: grid; place-items: center;
  background: #fff; color: #102530; font-family: var(--mono); font-size: 1.6rem; font-weight: 800;
  box-shadow: 0 6px 14px -6px rgba(0,0,0,.35);
}
.code-hint { font-size: .78rem; opacity: .9; padding: 0 10px; }
.code-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.code-actions .btn { padding: 11px 14px; }
.btn.wa { background: #fff; color: #128C4A; }
.btn.glass { background: rgba(255,255,255,.2); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; }
.member + .member { border-top: 1px solid var(--line); }
.me-tag { display: inline-block; margin-left: 4px; padding: 2px 8px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-size: .72rem; font-weight: 800; }

/* ---------- Landing & gabung ---------- */
.landing-hero, .join-hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  padding: max(52px, calc(env(safe-area-inset-top) + 40px)) 24px 64px;
  background: radial-gradient(80% 70% at 85% 10%, rgba(255, 194, 75, .55), transparent 60%), linear-gradient(160deg, #17C3B2 0%, #0B7C8E 55%, #0A4F6B 100%);
}
.landing-hero .wave, .join-hero .wave { fill: var(--bg); height: 34px; }
.landing-logo { border-radius: 24px; box-shadow: var(--shadow-lg); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px) rotate(-2deg); } }
.landing-hero h1 { font-size: 2.1rem; font-weight: 500; letter-spacing: -.035em; margin-top: 16px; }
.landing-hero h1 b { font-weight: 800; color: #FFE2A8; }
.landing-hero p { margin: 8px 0 0; opacity: .92; font-size: .98rem; }
.landing-body { padding-top: 0; margin-top: -18px; position: relative; }
.code-form { padding: 20px; }
.code-form label { display: block; font-weight: 800; font-size: 1rem; margin-bottom: 10px; }
.code-form input {
  width: 100%; border: 0; border-radius: 16px; background: var(--bg); color: var(--text); padding: 16px;
  font-family: var(--mono); font-size: 1.6rem; font-weight: 800; text-align: center; letter-spacing: .3em; text-transform: uppercase; margin-bottom: 12px;
}
.code-form input::placeholder { color: var(--muted); opacity: .45; }
.code-form input:focus { outline: 2px solid var(--primary); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; font-weight: 600; margin: 18px 4px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.features { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.features li { display: flex; gap: 14px; align-items: center; }
.features li > span { width: 46px; height: 46px; flex: none; border-radius: 15px; display: grid; place-items: center; font-size: 1.3rem; background: var(--card); box-shadow: var(--shadow); }
.features b { display: block; font-size: .92rem; }
.features small { color: var(--muted); font-size: .8rem; }

.join-hero { text-align: left; padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: 56px; }
.join-hero .icon-btn { color: #fff; margin: 0 0 18px -8px; }
.join-kicker { font-size: .8rem; font-weight: 700; opacity: .9; }
.join-hero h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 6px; }
.join-sub { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: .88rem; opacity: .92; }
.join-sub .ic { width: 15px; height: 15px; }
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 18px; border: 0; background: var(--card); color: var(--text); font-size: .95rem; font-weight: 700; cursor: pointer; text-align: left; box-shadow: var(--shadow); min-width: 0; }
.pick > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick:active { transform: scale(.97); }
.pick:hover, .pick:focus-visible { box-shadow: inset 0 0 0 2px var(--primary), var(--shadow); }

/* ---------- Kosong ---------- */
.empty { text-align: center; padding: 36px 20px; }
.empty-art { width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 28px; display: grid; place-items: center; font-size: 2.6rem; background: var(--card); box-shadow: var(--shadow); }
.empty h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 6px; }
.empty p { margin: 0 auto 16px; max-width: 320px; font-size: .9rem; }

/* ---------- Form (bottom sheet di HP) ---------- */
.modal {
  border: 0; padding: 0; border-radius: 26px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  background: var(--card); color: var(--text); box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.modal::backdrop { background: rgba(6, 22, 28, .5); backdrop-filter: blur(3px); }
.modal form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.modal header, .modal footer { position: relative; display: flex; align-items: center; gap: 8px; padding: 14px 16px; }
.modal header { padding-top: 20px; }
.modal header h2 { flex: 1; font-size: 1.15rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal header .icon-btn { background: var(--bg); width: 34px; height: 34px; border-radius: 50%; font-size: .9rem; }
.modal footer { border-top: 1px solid var(--line); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.modal footer .btn.primary { min-width: 110px; }
.spacer { flex: 1; }
.form-body { padding: 6px 16px 16px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.field.half { width: calc(50% - 7px); }
.field > span { font-size: .8rem; color: var(--muted); font-weight: 700; }
.field small { color: var(--muted); font-size: .76rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1.5px solid transparent;
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px; min-height: 48px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); background: var(--card); }
.field input[type=file] { padding: 12px; font-size: .85rem; }
.check { display: flex; align-items: center; gap: 10px; width: 100%; font-size: .92rem; font-weight: 600; padding: 4px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { display: inline-flex; gap: 6px; align-items: center; font-size: .84rem; background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.card.form-body { padding: 18px; }

@media (max-width: 600px) {
  .modal:not(.viewer) {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 26px 26px 0 0; max-height: 92dvh;
    animation: sheet .28s cubic-bezier(.2, .9, .3, 1);
  }
  .modal:not(.viewer) form { max-height: 92dvh; }
  .modal:not(.viewer) header::before {
    content: ""; position: absolute; left: 50%; top: 7px; width: 40px; height: 4px; margin-left: -20px; border-radius: 9px; background: var(--line);
  }
}
@keyframes sheet { from { transform: translateY(100%); } }

.viewer { width: min(900px, calc(100vw - 16px)); height: calc(100dvh - 24px); display: none; flex-direction: column; }
.viewer[open] { display: flex; }
.viewer-body { flex: 1; overflow: auto; background: var(--bg); display: grid; place-items: center; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* ---------- Toast ---------- */
#toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 6px; width: max-content; max-width: calc(100vw - 32px);
  bottom: calc(var(--nav-h) + 86px + env(safe-area-inset-bottom));
}
.toast { background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-size: .9rem; font-weight: 600; box-shadow: 0 10px 24px rgba(0,0,0,.25); animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }

@media (max-width: 380px) {
  .field.half { width: 100%; }
  .hero-count { width: 82px; height: 82px; }
  .hero-count b { font-size: 1.9rem; }
  .code-boxes span { width: 38px; height: 48px; font-size: 1.35rem; }
  .ring { width: 92px; height: 92px; }
  .ring > span { width: 68px; height: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Online realtime ---------- */
.live { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; padding: 1px 8px 1px 6px; border-radius: 99px; background: rgba(255,255,255,.22); font-weight: 700; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #5CFF9D; box-shadow: 0 0 0 0 rgba(92,255,157,.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(92,255,157,0); } 100% { box-shadow: 0 0 0 0 rgba(92,255,157,0); } }
.av { position: relative; }
.av.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 2px var(--card); }
.av.lg.on::after { width: 12px; height: 12px; }
.on-text { color: var(--ok); font-weight: 700; }

/* ---------- Tanya nama (sekali saja) ---------- */
.ask-name { text-align: center; padding: 24px 20px; }
.ask-emoji { font-size: 2.4rem; animation: wave-hand 2.4s ease-in-out infinite; transform-origin: 70% 70%; display: inline-block; }
@keyframes wave-hand { 10%, 30% { transform: rotate(16deg); } 20% { transform: rotate(-8deg); } 40%, 100% { transform: rotate(0); } }
.ask-name h2 { font-size: 1.3rem; font-weight: 800; margin: 6px 0 4px; }
.ask-name p { margin: 0 0 16px; }
.ask-name input {
  width: 100%; border: 0; border-radius: 16px; background: var(--bg); color: var(--text); padding: 16px;
  font: inherit; font-size: 1.25rem; font-weight: 700; text-align: center; margin-bottom: 12px;
}
.ask-name input:focus { outline: 2px solid var(--primary); }
.join-members { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: .84rem; font-weight: 600; }
.join-members .av { box-shadow: 0 0 0 2.5px rgba(255,255,255,.9); }
.small-hero { padding-top: max(36px, calc(env(safe-area-inset-top) + 24px)); padding-bottom: 56px; }
.small-hero h1 { font-size: 1.7rem; margin-top: 10px; }

.join-sub, .cover-sub { display: block; }
.join-sub .ic, .cover-sub .ic { display: inline-block; vertical-align: -2px; margin-right: 3px; }
.cover-sub i { margin: 0 4px; }

/* ---------- Ikon kategori (pengganti emoji) ---------- */
.ci { --cbg: #EEF0F2; --cfg: #5D6B76; display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 13px; background: var(--cbg); color: var(--cfg); }
.ci .ic { width: 20px; height: 20px; }
.ci.sm { width: 24px; height: 24px; border-radius: 8px; }
.ci.sm .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.ci.lg { width: 46px; height: 46px; border-radius: 14px; }
.ci.lg .ic { width: 23px; height: 23px; }
.ci-transport { --cbg: #E3EEFF; --cfg: #2F6FE4; }
.ci-stay { --cbg: #EEE8FF; --cfg: #6D4AE0; }
.ci-food { --cbg: #FFEBDD; --cfg: #E0661C; }
.ci-tour { --cbg: #DCF2F1; --cfg: #0B8A92; }
.ci-shop { --cbg: #FFE4EE; --cfg: #D63F7A; }
.ci-other { --cbg: #EEF0F2; --cfg: #5D6B76; }
@media (prefers-color-scheme: dark) {
  .ci-transport { --cbg: rgba(47,111,228,.2); --cfg: #8DB4FF; }
  .ci-stay { --cbg: rgba(109,74,224,.22); --cfg: #B9A6FF; }
  .ci-food { --cbg: rgba(224,102,28,.2); --cfg: #FFB27F; }
  .ci-tour { --cbg: rgba(56,198,198,.18); --cfg: #6FE0DC; }
  .ci-shop { --cbg: rgba(214,63,122,.2); --cfg: #FF9CC2; }
  .ci-other { --cbg: rgba(255,255,255,.08); --cfg: #A9B8C1; }
}
.plan-title { align-items: flex-start; }
.plan-title .ci.sm { margin-top: -1px; }
.cat-row .ci.sm { margin-right: 2px; }
.hello-ic { display: inline-grid; vertical-align: -4px; color: var(--sun); animation: spin 18s linear infinite; }
.hello-ic .ic { width: 30px; height: 30px; stroke-width: 2.4; }
@keyframes spin { to { transform: rotate(360deg); } }
.quick .q-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); margin-bottom: 6px; }
.quick .q-ic .ic { width: 18px; height: 18px; }
.features li > span { color: var(--primary); }
.features li > span .ic { width: 22px; height: 22px; }
.empty-art { color: var(--primary); }
.empty-art .ic { width: 38px; height: 38px; stroke-width: 1.8; }
.hero-count b .ic { width: 40px; height: 40px; stroke-width: 3; }
.ask-ic { width: 64px; height: 64px; margin: 0 auto; border-radius: 22px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.ask-ic .ic { width: 30px; height: 30px; }
.name-error { display: flex; align-items: flex-start; gap: 8px; text-align: left; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: .85rem; font-weight: 600; }
.name-error[hidden] { display: none; }
.name-error .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.with-ic { display: inline-flex; align-items: center; gap: 5px; }
.with-ic .ic { width: 15px; height: 15px; }
.warn.with-ic { display: flex; }
.offline { display: flex; align-items: center; justify-content: center; gap: 8px; }
.offline .ic { width: 17px; height: 17px; }
.chip .ic { width: 15px; height: 15px; vertical-align: -3px; margin-right: 2px; }
.chip-check .ic { width: 15px; height: 15px; color: var(--danger); }
.modal header .icon-btn .ic { width: 17px; height: 17px; }
.viewer footer .ic { width: 18px; height: 18px; }

/* ---------- Responsif & anti-tabrakan ---------- */
.fab { width: 58px; height: 58px; padding: 0; justify-content: center; border-radius: 20px; }
.fab .ic { width: 26px; height: 26px; stroke-width: 2.6; }
.code-actions { flex-wrap: wrap; }
.code-actions .btn { flex: 1 1 auto; min-width: 0; }
.code-actions .btn.glass[aria-label] { flex: 0 0 auto; }
.pass-title, .exp-title, .plan-title, .cover-title, .hero-dest, .join-hero h1, .member b, .split-row b, .settle-row b { overflow-wrap: anywhere; }
.member .grow, .split-row .grow, .exp .grow, .plan-main, .pass-main .grow { min-width: 0; }
.exp-amt, .bal, .pass-price { flex: none; }
.pass-foot { flex-wrap: wrap; row-gap: 10px; }
.settle-row { flex-wrap: wrap; }
.settle-row .grow { flex-basis: 0; }
.trip-body { flex-wrap: wrap; }
.trip-money { min-width: 150px; }
.budget-lines > div { flex-wrap: wrap; }
.day-head .grow b { overflow-wrap: anywhere; }
.trip-cover { padding-top: 16px; }
.trip-cover .status { position: static; display: inline-block; }
.cover-title { margin-top: 12px; padding-right: 0; }
.trip-money .small { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; }
.split-row { flex-wrap: wrap; row-gap: 2px; }
.split-row .grow { flex: 1 1 130px; }
.split-row .bal { margin-left: auto; }
.m-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.m-name .me-tag { margin-left: 0; }
.pass-foot { column-gap: 18px; }
.pass-code { flex: 0 1 auto; }
.code-actions { display: grid; grid-template-columns: 1fr 1fr auto; max-width: 420px; margin-left: auto; margin-right: auto; }
.code-actions .btn { white-space: nowrap; }
@media (max-width: 420px) {
  .exp { flex-wrap: wrap; align-items: flex-start; row-gap: 2px; }
  .exp .grow { flex: 1 1 calc(100% - 52px); }
  .exp .exp-amt { margin-left: 52px; }
  .settle-row { display: grid; grid-template-columns: auto auto 1fr; column-gap: 6px; align-items: baseline; }
  .settle-row .grow { display: none; }
  .settle-row .amt { grid-column: 1 / -1; }
}
.file-chip .muted { white-space: nowrap; flex: none; }
.file-chip .fname { min-width: 0; }

/* =========================================================
   iPhone / Safari (iOS) — notch, Dynamic Island, home bar, input
   ========================================================= */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body { overscroll-behavior-y: none; }
#app { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
main.with-nav { padding-bottom: calc(var(--nav-h) + 90px + env(safe-area-inset-bottom)); }
button, a, label, summary, .exp, .pass-main, .plan-main { touch-action: manipulation; }

/* Kolom input: Safari punya gaya bawaan yang bikin tanggal/jam/select meluber */
input, select, textarea, button { -webkit-appearance: none; appearance: none; border-radius: 0; }
input[type=checkbox] { -webkit-appearance: auto; appearance: auto; }
.field input, .field select, .field textarea, .searchbar input, .code-form input, .ask-name input { border-radius: 14px; }
.searchbar input { border-radius: 0; }
input[type=date], input[type=time] { display: block; min-width: 0; max-width: 100%; text-align: left; line-height: 1.3; }
input::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.3em; }
input[type=search]::-webkit-search-decoration, input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.field select {
  padding-right: 38px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236A7B86' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.field input[type=file] { -webkit-appearance: auto; appearance: auto; }
.field input[type=file]::file-selector-button { font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 8px 12px; margin-right: 10px; background: var(--primary-soft); color: var(--primary-strong); }

/* Efek blur di Safari butuh awalan -webkit- */
.status { -webkit-backdrop-filter: blur(6px); }
.modal::backdrop { -webkit-backdrop-filter: blur(3px); }
/* fallback untuk iOS lama tanpa color-mix */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .home-head, .topbar { background: var(--bg); }
  .bottom-nav { background: var(--card); }
}

/* Bottom sheet: tidak ketutup home bar & aman saat keyboard muncul */
@media (max-width: 600px) {
  .modal:not(.viewer) { max-height: calc(100dvh - env(safe-area-inset-top) - 12px); }
  .modal:not(.viewer) form { max-height: calc(100dvh - env(safe-area-inset-top) - 12px); }
  .form-body { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
}
.viewer { height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px); }

/* Toast di atas home bar */
#toasts { bottom: calc(var(--nav-h) + 86px + env(safe-area-inset-bottom)); }

/* Layar iPhone besar (Pro Max / Plus, 430px): manfaatkan ruang */
@media (min-width: 420px) and (max-width: 600px) {
  .hello { font-size: 1.85rem; }
  .pick-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Kode pribadi */
.pin-box { text-align: left; margin-bottom: 12px; }
.pin-box[hidden] { display: none; }
.pin-box p { margin: 0 0 8px; font-size: .84rem; color: var(--muted); }
.pin-box input {
  width: 100%; border: 0; border-radius: 14px; background: var(--bg); color: var(--text); padding: 14px;
  font-family: var(--mono); font-size: 1.15rem; font-weight: 800; letter-spacing: .25em; text-align: center; text-transform: uppercase;
}
.pin-box input:focus { outline: 2px solid var(--primary); }
.pin-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.pin-card .grow { flex: 1 1 180px; }
.pin-code {
  display: inline-flex; align-items: center; gap: 8px; margin-left: auto; border: 0; cursor: pointer;
  padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text);
  font-family: var(--mono); font-size: 1.1rem; font-weight: 800; letter-spacing: .14em;
}
.pin-code .ic { width: 16px; height: 16px; color: var(--accent); }
.pin-box input::placeholder, .code-form input::placeholder { letter-spacing: .04em; font-family: var(--font); font-weight: 600; text-transform: none; }

/* ---------- Perbaikan dari tes iPhone asli ---------- */
/* 1. Tanggal & Jam meluber: kolom form harus boleh menyempit di bawah lebar bawaan input iOS */
.form-body > .field { min-width: 0; }
.field > input, .field > select, .field > textarea { min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; }
.field input[type=date], .field input[type=time] { -webkit-appearance: none; appearance: none; padding-left: 14px; padding-right: 10px; overflow: hidden; }
.field input::-webkit-date-and-time-value { text-align: left; margin: 0; }
.field input::-webkit-datetime-edit { padding: 0; }

/* 2. Checkbox gaya app (bukan kotak hitam bawaan iOS) */
.check input[type=checkbox], .chip-check input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); background: var(--card);
  display: inline-grid; place-content: center; transition: background .15s, border-color .15s;
}
.chip-check input[type=checkbox] { width: 18px; height: 18px; border-radius: 6px; }
.check input[type=checkbox]:checked, .chip-check input[type=checkbox]:checked { background: var(--primary); border-color: var(--primary); }
.check input[type=checkbox]:checked::after, .chip-check input[type=checkbox]:checked::after {
  content: ""; width: 10px; height: 5px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: translateY(-1px) rotate(-45deg);
}
.chip-check input[type=checkbox]:checked { background: var(--danger); border-color: var(--danger); }
.check input[type=checkbox]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 3. Titik online tidak ketutup avatar berikutnya: pindah ke kiri-bawah */
.av.on::after { right: auto; left: -1px; }
.avatars .av:first-child.on::after { left: -1px; }

/* Form pakai grid dengan kolom terkunci: input (termasuk tanggal/jam iOS) tidak bisa melebarkan kolom */
.form-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-content: start; }
.form-body > * { grid-column: 1 / -1; min-width: 0; }
.form-body > .field.half { grid-column: auto; width: auto; justify-content: flex-end; }
.form-body > .field { width: auto; }
@media (max-width: 380px) { .form-body > .field.half { grid-column: 1 / -1; } }
/* Di HP: Tanggal & Jam satu baris penuh (lebar bawaan input iOS bisa lebih besar dari setengah layar) */
@media (max-width: 600px) { .form-body > .field.dt { grid-column: 1 / -1; } }
