/* Bali Power, "Sawah" look: warm limestone paper, volcanic-stone ink, rice-terrace green as the accent,
   Indian Ocean teal and a little temple gold. See docs/design-bali.md. Token names kept from v1. */
:root {
  --paper: #FBF8F3; --paper2: #F1EBE1; --surface: #F7F2EA; --line: #E6DDCF;
  --ink: #1E1B17; --ink-soft: #6B6259;
  --sawah: #3F6B45; --sawah-soft: #E3EBD9;           /* primary accent (rice-terrace green, text-safe) */
  --terracotta: #2F5536; --terracotta-soft: #DCE6D2;  /* deep jungle green */
  --marigold: #C9973F; --ocean: #1F5E66;             /* temple gold, Indian Ocean teal */
  --padi: #4C7A4F; --padi-soft: #E3EBD9; --stone: #8A8174;
  --grad: linear-gradient(135deg, #5E8C56 0%, #44724A 55%, #2F5A3A 100%);
  --glow: 0 10px 28px -12px rgba(47,90,58,.5);
  --ok: #2F7D4A; --low: #B8741A; --critical: #C42D1E;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --text: "Plus Jakarta Sans", system-ui, sans-serif;
  --r-card: 24px; --r-control: 999px;
  --shadow: 0 1px 2px rgba(60,40,20,.05), 0 12px 32px -18px rgba(60,40,20,.22);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12100D; --paper2: #1E1A16; --surface: #191612; --line: #2F2923;
    --ink: #F4EEE5; --ink-soft: #ADA397;
    --sawah: #8FC28A; --sawah-soft: #1F2A1C;
    --terracotta: #A8D3A0; --terracotta-soft: #1F2A1C;
    --marigold: #E3B865; --ocean: #7FC4C6;
    --padi: #9CC48F; --padi-soft: #1F2A1C; --stone: #A79D90;
    --ok: #6FD08F; --low: #FFB15C; --critical: #FF7A6B;
    --shadow: 0 12px 32px -18px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 400; letter-spacing: -.015em; margin: 0; font-optical-sizing: auto; }
h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 300; letter-spacing: -.03em; line-height: 1.04; }
h2 { font-size: 21px; font-weight: 400; }
p { margin: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }

/* shell */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 14px 24px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 22px; font-weight: 500; letter-spacing: -.02em; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: var(--glow); }
.nav { display: flex; gap: 2px; margin-left: auto; background: var(--paper2); padding: 4px; border-radius: 999px; }
.nav a, .nav span > a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 500; color: var(--ink-soft); }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); background: var(--paper); box-shadow: 0 1px 3px rgba(18,18,18,.08); }
.page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 96px; display: grid; gap: 20px; }
.narrow { max-width: 720px; }

/* surfaces */
.card { background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: var(--r-card); padding: 22px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

/* controls */
.btn { appearance: none; border: 0; cursor: pointer; font: 600 15px var(--text); padding: 13px 20px; border-radius: var(--r-control);
  background: var(--grad); color: #fff; box-shadow: var(--glow); display: inline-flex; gap: 8px; align-items: center; justify-content: center; text-decoration: none;
  transition: transform .08s ease, filter .15s ease; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.accent { background: var(--grad); }
.btn.danger { background: var(--critical); box-shadow: none; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip { flex: none; cursor: pointer; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 500 14px var(--text);
  padding: 8px 14px; border-radius: 999px; transition: background .15s; }
.chip:hover { background: var(--paper2); }
.chip.on { background: var(--sawah-soft); color: var(--terracotta); border-color: color-mix(in srgb, var(--sawah) 45%, transparent); font-weight: 600; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.input { width: 100%; font: 16px var(--text); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: none; }
.input:focus { border-color: var(--sawah); box-shadow: 0 0 0 3px var(--sawah-soft); }
.error { color: var(--critical); font-weight: 500; }

/* power */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.gauge-wrap { position: relative; width: 200px; height: 200px; flex: none; }
.gauge { width: 200px; height: 200px; display: block; }
.gauge-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.gauge-center .num { font-family: var(--display); font-size: 60px; font-weight: 300; letter-spacing: -.03em; line-height: 1; }
.gauge-center .unit { font: 600 11px var(--text); letter-spacing: .16em; color: var(--ink-soft); margin-top: 6px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 6px 12px; border-radius: 999px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat .v { font-family: var(--display); font-size: 26px; font-weight: 400; letter-spacing: -.02em; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bars .b { flex: 1; border-radius: 8px 8px 3px 3px; background: var(--grad); min-height: 3px; position: relative; }
.bars .b.empty { background: var(--line); }
.bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.axis { display: flex; gap: 6px; font-size: 11px; color: var(--ink-soft); }
.axis span { flex: 1; text-align: center; }
.log { display: grid; }
.log .item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.log .item:first-child { border-top: 0; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--paper2); }
.pill.top { background: var(--sawah-soft); color: var(--sawah); }

/* living costs (browse) */
.browse { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
.browse .mapwrap { position: sticky; top: 84px; height: calc(100vh - 110px); border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); }
.browse .mapwrap iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 900px) { .browse { grid-template-columns: 1fr; } .browse .mapwrap { position: relative; top: 0; height: 56vh; } }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.lcard { text-decoration: none; display: grid; gap: 10px; }
.lcard .ph { aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: var(--paper2); position: relative; }
.lcard .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.lcard:hover .ph img { transform: scale(1.04); }
.lcard .ph .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-soft);
  background: radial-gradient(120% 90% at 20% 0%, var(--sawah-soft), transparent 60%), radial-gradient(90% 90% at 100% 100%, var(--terracotta-soft), transparent 60%), var(--paper2); }
.lcard .badge { position: absolute; top: 12px; left: 12px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; box-shadow: var(--shadow); }
.lcard .t { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.lcard .price { font-family: var(--display); font-size: 20px; font-weight: 500; white-space: nowrap; }
.costbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.gallery { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; height: 420px; border-radius: var(--r-card); overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery img:first-child { grid-row: span 2; }
@media (max-width: 640px) { .gallery { height: 260px; } }
.lines .ln { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px dashed var(--line); }
.big { font-family: var(--display); font-size: 52px; font-weight: 300; letter-spacing: -.03em; line-height: 1; }
.ad { min-height: 90px; display: grid; place-items: center; border-radius: 16px; border: 1px dashed var(--line); color: var(--ink-soft); font-size: 12px; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.thumbs .slot { aspect-ratio: 1; border-radius: 16px; background: var(--paper); border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; color: var(--ink-soft); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.footer { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 24px; }

.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* phones: app-style bottom tab bar */
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; backdrop-filter: none; background: var(--paper); }
  .nav { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; margin: 0; justify-content: space-around;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--line);
    border-radius: 999px; padding: 6px; gap: 0; box-shadow: 0 14px 34px -14px rgba(18,18,18,.4); }
  .nav a.on, .nav span > a.on { background: var(--grad); color: #fff; box-shadow: var(--glow); }
  .nav span { flex: 1; display: flex; }
  .nav span { min-width: 0; }
  .nav a, .nav span > a { flex: 1; text-align: center; font-size: 12.5px; padding: 10px 2px; white-space: nowrap; min-width: 0; }
  .brand { font-size: 19px; }
  .page { padding: 20px 16px 120px; }
  .card { padding: 18px; border-radius: 20px; }
  .footer { padding-bottom: 100px; }
  .log .item { align-items: center; }
  .log .item { display: grid; grid-template-columns: 1fr auto; }
  .log .item > .row:first-child { flex-wrap: wrap; gap: 6px 10px; }
  .log .item > .row:last-child .small { display: none; }
}

/* Google-Maps-style browse: full-bleed map, floating bar, results panel on the left */
.gm { position: relative; height: calc(100vh - 61px); overflow: hidden; }
.gm-map { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gm-bar { position: absolute; top: 14px; left: 444px; right: 16px; z-index: 5; display: flex; gap: 10px; align-items: center; pointer-events: none; }
.gm-bar > * { pointer-events: auto; }
.gm-search { display: none; }
.gm-chips .chip { box-shadow: 0 2px 6px rgba(30,26,22,.18); border-color: transparent; }
.gm-chips .chip.on { background: var(--grad); color: #fff; border-color: transparent; }
.filters-btn::before { content: ""; display: inline-block; width: 14px; height: 10px; margin-right: 8px; vertical-align: 0;
  background: linear-gradient(currentColor, currentColor) 0 0/100% 2px no-repeat, linear-gradient(currentColor, currentColor) 3px 4px/8px 2px no-repeat,
  linear-gradient(currentColor, currentColor) 5px 8px/4px 2px no-repeat; }
.gm-list { position: absolute; top: 0; left: 0; bottom: 0; width: 428px; z-index: 6; overflow-y: auto; background: var(--paper);
  border-right: 1px solid var(--line); padding: 18px 18px 40px; box-shadow: 4px 0 24px -16px rgba(30,26,22,.4); }
.cards.one { grid-template-columns: 1fr; gap: 26px; }
.gm-panel { position: absolute; top: 62px; left: 444px; z-index: 8; width: min(460px, calc(100% - 460px)); max-height: calc(100% - 80px);
  overflow-y: auto; gap: 16px; }
.rng-group { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.rng { display: grid; grid-template-columns: 1fr 110px 10px 110px; gap: 8px; align-items: center; font-size: 14px; }
.rng .input { padding: 9px 10px; font-size: 14px; }
.gm-panel-foot { position: sticky; bottom: -22px; background: var(--surface); padding: 12px 0 4px; }
.gm-sheet-toggle { display: none; }
@media (max-width: 900px) {
  .gm { height: calc(100vh - 57px); }
  .gm-bar { left: 12px; right: 12px; top: 10px; }
  .gm-list { width: 100%; top: auto; height: 34%; border-right: 0; border-top: 1px solid var(--line); border-radius: 22px 22px 0 0;
    padding-bottom: 100px; transition: height .3s ease; }
  .gm.sheet-open .gm-list { height: calc(100% - 64px); }
  .gm.sheet-open .gm-sheet-toggle { bottom: 96px; }
  .gm-panel { left: 12px; right: 12px; width: auto; top: 60px; max-height: calc(100% - 140px); }
  .gm-sheet-toggle { display: block; position: absolute; z-index: 9; bottom: calc(34% + 14px); left: 50%; transform: translateX(-50%); border: 0;
    background: var(--grad); color: #fff; font: 600 14px var(--text); padding: 12px 20px; border-radius: 999px; box-shadow: var(--glow); }
  .rng { grid-template-columns: 1fr 90px 8px 90px; }
}
.gm ~ .footer { display: none; }

.mobile-only { display: none; }
@media (max-width: 640px) { .mobile-only { display: inline; width: 100%; } }

/* ---------- v2: stars, toggles, avatars, places, friends, areas ---------- */
.stars { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stars .st { position: relative; color: var(--line); letter-spacing: 1px; }
.stars .st-on { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: var(--marigold); }
.stars b { font-weight: 600; }
.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .knob { flex: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; margin-top: 1px; }
.toggle .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.toggle input:checked + .knob { background: var(--grad); }
.toggle input:checked + .knob::after { transform: translateX(18px); }
.toggle input:focus-visible + .knob { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--paper2); color: var(--ink); font-weight: 600; flex: none; border: 1px solid var(--line); }
.avatar.friend { background: var(--grad); color: #fff; border-color: transparent; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.prompt { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; background: var(--grad); color: #fff; border: 0; border-radius: var(--r-card); padding: 24px; box-shadow: var(--glow); }
.prompt .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.18); color: #fff; font-size: 24px; }
.prompt .muted { color: rgba(255,255,255,.82); }
.prompt .btn { background: #fff; color: var(--terracotta); box-shadow: none; }
.prompt > div:nth-child(2) { flex: 1 1 320px; }
.prompt .ic { flex: none; }
.pcard { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid transparent; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: var(--ink-soft); transform: translateY(-1px); }
.pcard .cat { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-family: var(--display); font-size: 22px; color: #fff; }
.pcard h3 { margin: 0; font-size: 17px; font-family: var(--text); font-weight: 600; }
.tag { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--paper2); color: var(--ink-soft); margin: 2px 4px 2px 0; }
.tag.friend { background: var(--sawah-soft); color: var(--sawah); font-weight: 600; }
.tag.agent { background: color-mix(in srgb, var(--ocean) 16%, transparent); color: var(--ocean); font-weight: 600; }
.review { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.review:first-child { border-top: 0; }
.rate-pick { display: flex; gap: 6px; }
.rate-pick button { font-size: 28px; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--line); padding: 2px; }
.rate-pick button.on { color: var(--marigold); }
.rate-row { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; }
.rate-row .rate-pick button { font-size: 20px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.facts div span:first-child { color: var(--ink-soft); }
.wa { background: #1f7a4d; box-shadow: none; }
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.area-grid .stat { background: var(--paper); border-radius: 16px; padding: 14px; }
.qr { width: 196px; height: 196px; background: #fff; border-radius: 16px; padding: 10px; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; }
.codes { background: var(--paper) !important;  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: var(--paper2); padding: 16px; border-radius: 14px; }
.steps { display: flex; gap: 8px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--grad); }
.tabs { display: flex; gap: 4px; background: var(--paper2); padding: 4px; border-radius: 999px; }
.tabs button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 999px; font: 600 15px var(--text); color: var(--ink-soft); cursor: pointer; }
.tabs button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.person { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person .grow { flex: 1; min-width: 0; }

/* How long your money lasts */
.money { margin-top: 20px; }
.money-lead { font-size: 18px; line-height: 1.5; margin: 12px 0 18px; }
.money-lead b { font-family: var(--display); font-weight: 500; color: var(--terracotta); }
.lasts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.last { background: var(--paper); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px; }
.last .v { font-family: var(--display); font-size: 24px; font-weight: 400; letter-spacing: -.02em; }
.last .bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.last .bar i { display: block; height: 100%; background: var(--grad); border-radius: 3px; }
@media (max-width: 640px) { .lasts { grid-template-columns: repeat(2, 1fr); } .lasts .last:last-child { grid-column: span 2; } }

/* Alerts on this device (web push) */
.pushcard [data-show] { display: none; }
.pushcard[data-state="off"] [data-show~="off"],
.pushcard[data-state="on"] [data-show~="on"] { display: inline-flex; }
.pushcard[data-state="ios-install"] [data-show~="ios-install"] { display: block; }
.pushcard button[hidden] { display: none !important; }
.pushcard .on-pill { background: var(--sawah-soft); color: var(--sawah); font-weight: 600; font-size: 13px; padding: 4px 12px; border-radius: 999px; }
.ios-steps { margin: 4px 0 4px; padding-left: 22px; display: grid; gap: 6px; }
.ios-steps li::marker { color: var(--terracotta); font-weight: 600; }
/* Home-screen app: respect the notch and the home bar */
@media (display-mode: standalone) {
  .topbar { padding-top: max(12px, env(safe-area-inset-top)); }
  .nav { bottom: max(12px, env(safe-area-inset-bottom)) !important; }
}

/* Green hero panels */
.heat { background: var(--grad); color: #fff; border: 0; box-shadow: var(--glow), 0 30px 60px -40px rgba(47,90,58,.6); position: relative; overflow: hidden; }
.heat::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%); pointer-events: none; }
.heat > * { position: relative; }
.heat .muted, .heat .label, .heat .small.muted, .heat .gauge-center .unit { color: rgba(255,255,255,.8); }
.heat .stats { border-top-color: rgba(255,255,255,.25); }
.heat .gauge circle:first-child { stroke: rgba(255,255,255,.22); }
.heat .gauge circle:last-child { stroke: #fff; }
.heat .btn { background: #fff; color: var(--terracotta); box-shadow: 0 8px 20px -10px rgba(0,0,0,.35); }
.heat .btn.ghost { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.heat h1 { font-weight: 200; }
.status { background: var(--paper2); }
.label { font-weight: 600; letter-spacing: .14em; font-size: 11.5px; }
.label::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--sawah); margin-right: 8px; vertical-align: 2px; }
.heat .label::before { background: #fff; }
.heat .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.heat .stat .v { white-space: nowrap; }
@media (max-width: 640px) {
  .nav span { flex: 1 1 0; }
  .nav a, .nav span > a { font-size: 12px; letter-spacing: -.01em; padding: 11px 0; overflow: hidden; text-overflow: clip; }
}
@media (max-width: 360px) { .nav a, .nav span > a { font-size: 11px; } }
.nav span > span:empty { display: none; }
.heat .area-grid .stat { background: rgba(255,255,255,.14); backdrop-filter: blur(4px); }

/* Questions and answers */
.faq { display: grid; gap: 28px; }
.faq-group { display: grid; gap: 10px; }
.faq-item { background: var(--surface); border-radius: 18px; padding: 0 20px; transition: background .15s; }
.faq-item summary { list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative; font-family: var(--display); font-size: 18px; font-weight: 400; letter-spacing: -.01em; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+"; position: absolute; right: 0; top: 50%; width: 26px; height: 26px; line-height: 26px; margin-top: -13px; text-align: center;
  border-radius: 50%; background: var(--grad); color: #fff; font: 600 17px var(--text); transition: transform .2s; }
.faq-item[open] summary::before { transform: rotate(45deg); }
.faq-item p { padding: 0 0 18px; line-height: 1.6; }
.faq-home { display: grid; gap: 18px; margin-top: 12px; }
.isp-table { display: grid; background: var(--surface); border-radius: 18px; padding: 6px 20px 14px; }
.isp-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .9fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.isp-row.head { border-top: 0; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.isp-row > span:first-child { display: grid; gap: 2px; }
.isp-table > p { padding-top: 10px; }
@media (max-width: 640px) {
  .isp-row { grid-template-columns: 1fr auto; }
  .isp-row > span:nth-child(2) { grid-column: 1; grid-row: 2; }
  .isp-row > span:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; white-space: nowrap; }
  .isp-row.head > span:nth-child(2) { display: none; }
}

/* What's new + Report a problem */
.release { display: grid; gap: 14px; }
.release-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.release-head h2 { margin: 0; }
.release-group { display: grid; gap: 6px; }
.release-group ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.rtag { justify-self: start; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
        padding: 3px 10px; border-radius: 999px; }
.tag-new { background: var(--grad); color: #fff; }
.tag-better { background: color-mix(in srgb, var(--sawah) 14%, transparent); color: var(--terracotta); }
.tag-fixed { background: var(--paper2); color: var(--ink); border: 1px solid var(--line); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
textarea.input { resize: vertical; min-height: 120px; font: inherit; }

/* language picker: flag + name */
.flag { display: inline-block; border-radius: 3px; box-shadow: 0 0 0 1px rgba(18,18,18,.12); object-fit: cover; flex: none; }
.lang { position: relative; order: 3; }
.lang summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 12px;
  border-radius: 999px; background: var(--paper2); font-weight: 600; font-size: 13px; color: var(--ink); user-select: none; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); opacity: .5; }
.lang[open] summary { background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 18px; padding: 6px; box-shadow: 0 18px 40px -16px rgba(18,18,18,.35); display: grid; gap: 2px; z-index: 40; }
.lang-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none;
  color: var(--ink); font-weight: 500; }
.lang-item:hover { background: var(--paper2); }
.lang-item.on { background: color-mix(in srgb, var(--sawah) 12%, transparent); color: var(--terracotta); font-weight: 600; }
.lang-item.on::after { content: "✓"; margin-left: auto; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.lang-grid .lang-item { border: 1px solid var(--line); }
@media (max-width: 640px) { .lang { margin-left: auto; } .lang-menu { min-width: 210px; } }

/* "Something new is out" pop-out */
.toast { position: fixed; z-index: 50; right: 20px; bottom: 24px; max-width: 420px; display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px; border-radius: 20px; background: var(--ink); color: var(--paper);
  box-shadow: 0 20px 44px -18px rgba(18,18,18,.55); transform: translateY(16px); opacity: 0; transition: transform .25s ease, opacity .25s ease; }
.toast.in { transform: none; opacity: 1; }
.toast-icon { width: 34px; height: 34px; flex: none; border-radius: 11px; background: var(--grad); display: grid; place-items: center; color: #fff; }
.toast-body { display: grid; gap: 2px; min-width: 0; }
.toast-body .small { opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-go { flex: none; padding: 9px 14px; border-radius: 999px; background: var(--grad); color: #fff; font-weight: 600; font-size: 13px; text-decoration: none; }
.toast-x { flex: none; border: 0; background: none; color: inherit; opacity: .6; font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 6px; }
@media (max-width: 640px) { .toast { left: 12px; right: 12px; bottom: 92px; max-width: none; } }
.lang-item span { white-space: nowrap; }
.toast[hidden] { display: none; }

/* Several properties: switcher on My Power, boxes in Account */
.prop-switch { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.prop-switch::-webkit-scrollbar { display: none; }
.prop-switch .chip { text-decoration: none; white-space: nowrap; }
.prop-switch .chip.add { color: var(--sawah); border-style: dashed; }
.prop-box { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.prop-box:first-of-type { border-top: 0; }
.prop-box h3, .prop-box h4 { margin: 0; }
.prop-box h4 { font: 600 14px var(--text); }
.prop-box .row { align-items: end; flex-wrap: wrap; }
.prop-box .row .field { flex: 1 1 220px; margin: 0; }
.add-prop { align-items: end; flex-wrap: wrap; }
.add-prop .field { flex: 1 1 220px; margin: 0; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.people li { display: flex; align-items: center; gap: 8px; }
.people li .who { display: grid; min-width: 0; }
.people li .who > span:first-child { overflow-wrap: anywhere; }
.people li .chip { margin-left: auto; padding: 2px 10px; }
.btn.ghost.danger { background: var(--paper); color: var(--critical); }
.btn.danger:not(.ghost) { color: #fff; }
.demo-video{width:100%;aspect-ratio:16/10;border-radius:16px;background:#111;margin:8px 0 12px;display:block}
.demo-langs{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:16px}
.demo-langs .chip{display:inline-flex;align-items:center;gap:6px;text-decoration:none}
.demo-transcript summary{cursor:pointer;font-weight:600}
.demo-transcript p{margin:10px 0 0;line-height:1.55}
.consent { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; max-width: 460px; padding: 16px 18px; border-radius: 18px;
  background: var(--paper, #fff); color: var(--ink, #121212); box-shadow: 0 20px 50px -20px rgba(0,0,0,.35); border: 1px solid var(--line, #eee); display: grid; gap: 12px; }
.consent p { margin: 0; font-size: 14px; line-height: 1.5; }
.consent .row { display: flex; gap: 8px; }

/* social: profiles, messages, suburb talk */
.avatar.photo { object-fit: cover; padding: 0; background: var(--paper2); }
.ugc { white-space: pre-wrap; overflow-wrap: anywhere; }
.plain { text-decoration: none; }
.plain:hover { text-decoration: underline; }
.small-btn { padding: 9px 16px; font-size: 14px; display: inline-block; cursor: pointer; }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
         background: var(--grad); color: #fff; font-size: 12px; font-weight: 700; margin-left: 8px; }
.badge.light { background: #fff; color: var(--terracotta); }
.linkish { appearance: none; border: 0; background: none; padding: 0; color: var(--ink-soft); font: 500 13px var(--text); cursor: pointer; }
.linkish:hover { color: var(--terracotta); text-decoration: underline; }
.profile-hero .bio { font-size: 17px; }
.messages { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.conv-list { gap: 6px; }
.conv { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; text-decoration: none; color: inherit; }
.conv:hover, .conv.on { background: var(--sawah-soft); }
.conv-text { display: grid; min-width: 0; }
.conv-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat { min-height: 60vh; grid-template-rows: auto 1fr auto; }
.chat-head { gap: 10px; flex-wrap: nowrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.chat-head .back { display: none; text-decoration: none; }
.bubbles { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; padding: 6px 2px; }
.bubble { align-self: flex-start; max-width: 78%; background: var(--paper); border: 1px solid var(--line); border-radius: 20px 20px 20px 6px; padding: 10px 14px; }
.bubble.mine { align-self: flex-end; background: var(--grad); color: #fff; border: 0; border-radius: 20px 20px 6px 20px; }
.bubble-meta { font-size: 11px; opacity: .7; margin-top: 4px; display: flex; gap: 10px; justify-content: flex-end; }
.bubble.mine .linkish { color: #fff; }
.chat-input { display: flex; gap: 10px; align-items: flex-end; }
.chat-input textarea { resize: vertical; min-height: 48px; }
.vote { appearance: none; cursor: pointer; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 99px;
        padding: 8px 14px; font: 500 15px var(--text); }
.vote:hover { background: var(--paper2); }
.vote.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow); }
.vote.down.on { background: var(--ocean); box-shadow: none; }
@media (max-width: 760px) {
  .messages { grid-template-columns: 1fr; }
  .messages .conv-list.has-open { display: none; }
  .chat-head .back { display: inline-flex; }
  .bubble { max-width: 88%; }
}
a.chip, a.btn { text-decoration: none; display: inline-flex; align-items: center; }
@media (max-width: 640px) {
  .person { flex-wrap: wrap; }
  .person .grow { flex: 1 1 calc(100% - 60px); }
  .person > .btn, .person > .chip, .person > a.chip { margin-left: 54px; }
  .person > .btn ~ .btn, .person > .btn ~ .chip, .person > .chip ~ .chip { margin-left: 0; }
}

/* "Where should I live?" quiz */
.quiz .quiz-group h3 { margin: 6px 0 8px; font-size: 15px; }
.quiz-result .bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 10px 0 6px; }
.quiz-result .bar span { display: block; height: 100%; background: var(--grad); border-radius: 3px; }
.quiz-score strong { font-size: 24px; }
.quiz-why { margin: 6px 0; padding-left: 18px; display: grid; gap: 4px; }
.quiz-results { display: grid; gap: 14px; margin-top: 18px; }

/* Signed-out home page: the two main things, then the extras */
.landing { display: grid; gap: 28px; }
.landing-hero { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 18px 0 4px; }
.landing-hero h1 { font-size: clamp(34px, 6vw, 60px); max-width: 15ch; margin: 0; }
.landing-hero .lead { font-size: 18px; max-width: 46ch; margin: 0; }
.landing-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.main-card { padding: 30px; gap: 14px; align-content: start; }
.main-card h2 { font-size: clamp(24px, 3vw, 32px); margin: 0; }
.main-card .btn { justify-self: start; }
.main-icon { font-size: 34px; line-height: 1; }
.main-points { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.landing-extras { display: grid; gap: 8px; }
.landing-extras h2 { margin: 6px 0 0; }
.extras-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.extra-tile { display: grid; gap: 4px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.extra-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.extra-icon { font-size: 24px; }
@media (max-width: 640px) {
  .main-card { padding: 22px; }
  .extras-grid { grid-template-columns: 1fr 1fr; }
  .landing-hero { text-align: left; justify-items: start; }
}
@media (max-width: 380px) { .extras-grid { grid-template-columns: 1fr; } }
.extras-grid > :not(.extra-tile) { display: none; }

/* ---------- "Sawah": the Bali layer (see docs/design-bali.md) ---------- */
/* Rice-terrace contour lines (original, tiles seamlessly) and a five-petal frangipani (jepun) mark. */
:root {
  --terraces: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='80'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.4'%3E%3Cpath d='M0 10C40 0 80 0 120 10S200 20 240 10'/%3E%3Cpath d='M0 30C40 20 80 20 120 30S200 40 240 30'/%3E%3Cpath d='M0 50C40 40 80 40 120 50S200 60 240 50'/%3E%3Cpath d='M0 70C40 60 80 60 120 70S200 80 240 70'/%3E%3C/g%3E%3C/svg%3E");
  --jepun: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg%3E%3Cellipse cx='12' cy='6.4' rx='3.7' ry='5.6' transform='rotate(14 12 12)'/%3E%3Cellipse cx='12' cy='6.4' rx='3.7' ry='5.6' transform='rotate(86 12 12)'/%3E%3Cellipse cx='12' cy='6.4' rx='3.7' ry='5.6' transform='rotate(158 12 12)'/%3E%3Cellipse cx='12' cy='6.4' rx='3.7' ry='5.6' transform='rotate(230 12 12)'/%3E%3Cellipse cx='12' cy='6.4' rx='3.7' ry='5.6' transform='rotate(302 12 12)'/%3E%3C/g%3E%3C/svg%3E");
}
h1, h2, h3, .display { font-variation-settings: "SOFT" 50, "WONK" 0; }
h1 { font-weight: 300; letter-spacing: -.025em; }
.heat h1 { font-weight: 300; }
.label::before { width: 10px; height: 10px; border-radius: 0; vertical-align: -1px; background: var(--sawah);
  -webkit-mask: var(--jepun) center/contain no-repeat; mask: var(--jepun) center/contain no-repeat; }
.heat .label::before { background: #fff; }

/* green panels get rice-terrace lines instead of a plain glow */
.heat::before { inset: -35% -18% auto auto; width: 62%; background: radial-gradient(circle, rgba(255,250,230,.22), transparent 66%); }
.heat::after { content: ""; position: absolute; inset: auto 0 0 0; height: 58%; pointer-events: none; opacity: .16;
  background: var(--terraces) 0 100%/240px 80px repeat-x;
  -webkit-mask: linear-gradient(transparent, #000 70%); mask: linear-gradient(transparent, #000 70%); }

/* landing: morning over the rice terraces, under the headline */
.landing-hero { position: relative; isolation: isolate; overflow: hidden; padding: 56px 24px 250px;
  border-radius: var(--r-card); background: linear-gradient(180deg, #F6F5EF 0%, #EEF1EA 55%, #EFE8D6 100%); }
.landing-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; aspect-ratio: 1440 / 440; z-index: -1;
  min-height: 200px; pointer-events: none; background: url("/static/bali-hero.svg") center bottom/cover no-repeat; }
.landing-hero h1 { color: #1E1B17; }
.landing-hero .lead { color: #5E554C; }
.landing-hero .label { color: #6B6259; }
.landing-main { margin-top: -84px; position: relative; padding: 0 18px; }
@media (prefers-color-scheme: dark) {
  .landing-hero { background: linear-gradient(180deg, #1A1915 0%, #1C211A 60%, #232A1F 100%); }
  .landing-hero::after { filter: brightness(.55) saturate(.9); }
  .landing-hero h1 { color: #F4EEE5; }
  .landing-hero .lead, .landing-hero .label { color: #CDBFB0; }
}
@media (max-width: 640px) {
  .landing-hero { padding: 30px 18px 150px; border-radius: 20px; }
  .landing-hero::after { aspect-ratio: auto; height: 170px; background-position: 78% bottom; }
  .landing-main { margin-top: -40px; padding: 0 8px; }
}

/* small touches: stone-warm cards, brick-red step numbers, marigold stars, teal for agents */
.card { border-color: color-mix(in srgb, var(--line) 85%, transparent); }
.extra-tile:hover { border-color: color-mix(in srgb, var(--sawah) 35%, var(--line)); }
.tag.agent { background: color-mix(in srgb, var(--ocean) 14%, transparent); color: var(--ocean); }
.wa { background: #1F6E45; }
.footer::before { content: ""; display: block; width: 14px; height: 14px; margin: 0 auto 10px; background: var(--sawah); opacity: .7;
  -webkit-mask: var(--jepun) center/contain no-repeat; mask: var(--jepun) center/contain no-repeat; }
.brand { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; }
h2 { line-height: 1.22; }

/* line icons in soft rounded tiles (replace emoji) */
.main-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 0;
  background: var(--sawah-soft); color: var(--sawah); }
.heat .main-icon { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.extra-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 0; margin-bottom: 6px;
  background: var(--paper2); color: var(--terracotta); transition: background .15s, color .15s; }
.extra-tile:hover .extra-icon { background: var(--sawah-soft); color: var(--sawah); }
.ico { display: block; flex: none; }

/* Shown to a banned person: impossible to miss */
.banned-notice { display: flex; gap: 18px; align-items: flex-start; margin: 18px 0; padding: 22px 24px;
  background: var(--critical); color: #fff; border-radius: var(--r-card); box-shadow: 0 14px 36px -16px rgba(196,45,30,.7); }
.banned-notice h2 { margin: 0 0 8px; color: #fff; font-family: var(--display); font-size: clamp(24px, 5vw, 32px); line-height: 1.15; }
.banned-notice p { margin: 0 0 8px; color: #fff; line-height: 1.5; }
.banned-notice a { color: #fff; text-decoration: underline; font-weight: 700; }
.banned-icon { flex: none; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: #C42D1E;
  display: grid; place-items: center; font: 800 32px/1 var(--text); }
@media (prefers-color-scheme: dark) { .banned-notice { background: #A3241A; } .banned-icon { color: #A3241A; } }
@media (max-width: 520px) { .banned-notice { flex-direction: column; padding: 18px; } }

/* Privacy policy and terms: long English text, easy to read on a phone */
.legal { display: grid; gap: 18px; line-height: 1.6; overflow-wrap: anywhere; }
.legal-sec h3 { margin: 0 0 6px; font-size: 1.05rem; }
.legal-sec p { margin: 0 0 8px; }
.legal-sec ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }

/* Coworking finder: distance badge instead of the category square */
.pcard.cw .cw-dist { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: var(--paper2); color: var(--ink);
                     font-family: var(--display); font-size: 15px; text-align: center; line-height: 1.1; }
.pcard.cw h3 { margin: 0; }
.pcard.cw a { color: inherit; }
.cw-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 8px 0; }
.cw-facts dt { color: var(--ink-soft); }
.cw-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.cw-find { display: flex; gap: 8px; margin: 10px 0 4px; }
.cw-find .input { flex: 1; min-width: 0; }
@media (max-width: 420px) {
  .nav a, .nav span > a { font-size: 11.5px; letter-spacing: -.01em; }
}
