/* NIRMAN Mobile — native-style UI for an Android / iOS WebView */

:root {
  --navy: #0B2A5B;
  --deep: #071C3F;
  --gold: #E8A41C;
  --gold-ink: #8A5A00;
  --paper: #F2F4F7;
  --surface: #FFFFFF;
  --ink: #132033;
  --ink-2: #4E5D73;
  --ink-3: #8A97A9;
  --line: #E3E7ED;
  --vacant: #178A5B;
  --vacant-bg: #E4F4EC;
  --sold-bg: #E6ECF6;
  --danger: #C2362F;
  --press: rgba(11, 42, 91, .06);
  --sk: #E6EAF0;
  --radius-l: 18px;
  --radius-m: 12px;
  --radius-s: 8px;
  --tab-h: 58px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0A111D;
    --surface: #131C2B;
    --ink: #E8EDF5;
    --ink-2: #A9B5C6;
    --ink-3: #6E7C90;
    --line: #223047;
    --vacant: #3CC48A;
    --vacant-bg: rgba(60, 196, 138, .14);
    --sold-bg: rgba(120, 160, 230, .14);
    --press: rgba(255, 255, 255, .06);
    --sk: #1C2738;
    --danger: #FF6B62;
    --gold-ink: #F2BE52;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0A111D; --surface: #131C2B; --ink: #E8EDF5; --ink-2: #A9B5C6; --ink-3: #6E7C90;
  --line: #223047; --vacant: #3CC48A; --vacant-bg: rgba(60,196,138,.14); --sold-bg: rgba(120,160,230,.14);
  --press: rgba(255,255,255,.06); --sk: #1C2738; --danger: #FF6B62; --gold-ink: #F2BE52; color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.app, .appbar, .tabbar, .chips, .segmented, .cell, .row { -webkit-user-select: none; user-select: none; }
.kvs dd, .owner-name, .owner-mob { -webkit-user-select: text; user-select: text; }

/* ───────────── app frame ───────────── */
.app { position: fixed; inset: 0; overflow: hidden; background: var(--paper); }
.stage { position: absolute; inset: 0; }
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--paper);
  will-change: transform;
}
.scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px);
}
.no-tabs .scroll { padding-bottom: calc(var(--safe-b) + 28px); }
.content { max-width: 640px; margin: 0 auto; }

/* transitions */
.in-push  { animation: inPush .32s cubic-bezier(.2,.8,.2,1) both; z-index: 2; box-shadow: -8px 0 24px rgba(7,28,63,.12); }
.out-push { animation: outPush .32s cubic-bezier(.2,.8,.2,1) both; }
.in-pop   { animation: inPop .28s cubic-bezier(.2,.8,.2,1) both; }
.out-pop  { animation: outPop .28s cubic-bezier(.2,.8,.2,1) both; z-index: 2; }
.in-fade  { animation: fadeIn .18s ease-out both; z-index: 2; }
.out-fade { animation: none; }
@keyframes inPush  { from { transform: translateX(100%); } to { transform: none; } }
@keyframes outPush { to { transform: translateX(-28%); filter: brightness(.94); } }
@keyframes inPop   { from { transform: translateX(-28%); filter: brightness(.94); } to { transform: none; filter: none; } }
@keyframes outPop  { to { transform: translateX(100%); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }

/* ───────────── app bar ───────────── */
.appbar {
  flex: none;
  display: flex; align-items: center; gap: 4px;
  min-height: calc(52px + var(--safe-t));
  padding: var(--safe-t) 8px 0;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  position: relative; z-index: 3;
  transition: border-color .2s, background .2s;
}
.appbar-title {
  flex: 1; min-width: 0;
  font-weight: 600; font-size: 17px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity .18s;
  padding: 0 8px;
}
.appbar.scrolled { background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.appbar.scrolled .appbar-title,
.flat-screen .appbar-title { opacity: 1; }
.appbar-back, .appbar-act {
  width: 44px; height: 44px; border-radius: 22px;
  display: grid; place-items: center; flex: none;
}
.appbar-back svg, .appbar-act svg { width: 24px; height: 24px; }
.appbar-back:active, .appbar-act:active { background: var(--press); }
.appbar:not(:has(.appbar-back)) { padding-left: 52px; padding-right: 52px; }
.appbar.dark { background: var(--deep); color: #fff; }
.appbar.dark .appbar-back:active, .appbar.dark .appbar-act:active { background: rgba(255,255,255,.12); }
.appbar.dark.scrolled { background: var(--deep); border-bottom-color: rgba(255,255,255,.08); }

.largetitle { padding: 6px 20px 14px; }
.largetitle h1 { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.hello { color: var(--ink-2); font-size: 15px; margin-bottom: 2px; }

/* ───────────── tab bar ───────────── */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.tabbar.hidden { transform: translateY(110%); }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); font-size: 11.5px; font-weight: 600;
}
.tab svg { width: 25px; height: 25px; transition: transform .15s; }
.tab:active svg { transform: scale(.88); }
.tab.on { color: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tab.on { color: var(--gold); } }

/* ───────────── grouped lists ───────────── */
.section-h { font-size: 15px; font-weight: 600; color: var(--ink-2); padding: 22px 20px 8px; }
.group {
  list-style: none; margin: 0 16px; padding: 0;
  background: var(--surface); border-radius: var(--radius-l);
  overflow: hidden;
}
.group > li + li .row, .group > .row + .row { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; min-height: 60px; width: 100%; text-align: left;
  transition: background .12s;
}
a.row:active, button.row:active { background: var(--press); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chev { color: var(--ink-3); }
.chev svg { width: 18px; height: 18px; }
.tag { font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--paper); border-radius: 6px; padding: 2px 6px; vertical-align: 2px; }
.btnrow.danger .row-title { color: var(--danger); }

/* ───────────── overview (projects) ───────────── */
.overview {
  margin: 0 16px; padding: 18px 18px 16px;
  border-radius: var(--radius-l);
  background: var(--deep); color: #fff;
  position: relative; overflow: hidden;
}
.overview::after {
  content: ''; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px;
  border-radius: 50%; border: 18px solid rgba(232,164,28,.16);
}
.ov-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; z-index: 1; }
.ov-nums strong { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.ov-nums span { font-size: 13px; color: rgba(255,255,255,.72); display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.v { background: #4FD39A; }
.dot.s { background: var(--gold); }
.meter { height: 8px; border-radius: 4px; background: rgba(79,211,154,.35); overflow: hidden; margin-top: 16px; position: relative; z-index: 1; }
.meter i { display: block; height: 100%; background: var(--gold); border-radius: 4px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.ov-foot { font-size: 13px; color: rgba(255,255,255,.72); margin-top: 10px; position: relative; z-index: 1; }

.prj { align-items: flex-start; padding-top: 16px; padding-bottom: 16px; }
.prj-mark {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .02em;
  border-bottom: 3px solid var(--gold);
}
.prj .chev { align-self: center; }
.mini { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; font-weight: 600; }
.meter.sm { flex: 1; height: 5px; margin: 0; background: var(--vacant-bg); }
.mini .v { color: var(--vacant); white-space: nowrap; }
.mini .s { color: var(--gold-ink); white-space: nowrap; }

/* ───────────── project header ───────────── */
.project .scroll { background: linear-gradient(var(--deep) 0 180px, var(--paper) 180px); }
.phead { background: var(--deep); color: #fff; padding: 4px 20px 22px; }
.phead h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.paddr { color: rgba(255,255,255,.7); font-size: 14px; margin-top: 4px; }
.pstats { display: flex; gap: 28px; margin-top: 18px; }
.pstats strong { display: block; font-size: 24px; font-weight: 700; line-height: 1.1; }
.pstats span { font-size: 12.5px; color: rgba(255,255,255,.7); }
.pstats div:nth-child(2) strong { color: var(--gold); }
.pstats div:nth-child(1) strong { color: #4FD39A; }

.filters {
  position: sticky; top: 0; z-index: 2;
  background: var(--paper);
  padding: 14px 0 10px;
  border-radius: 20px 20px 0 0;
  margin-top: -12px;
}
.segmented {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 0 16px; padding: 3px; border-radius: 12px; background: var(--sk);
}
.segmented button {
  position: relative; z-index: 1; height: 36px; border-radius: 9px;
  font-size: 14.5px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.segmented button.on { color: var(--ink); }
.segmented .cnt { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.segmented .on.vacant .cnt { color: var(--vacant); }
.segmented .on.sold .cnt { color: var(--gold-ink); }
.seg-thumb {
  position: absolute; top: 3px; left: 3px; bottom: 3px; width: calc((100% - 6px) / 3);
  border-radius: 9px; background: var(--surface);
  box-shadow: 0 1px 3px rgba(7,28,63,.12);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 2px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 17px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
}
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ───────────── tower (the building view) ───────────── */
.legend { display: flex; gap: 16px; align-items: center; padding: 8px 20px 4px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-hint { margin-left: auto; color: var(--ink-3); }
.cell-key { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.cell-key.v { background: var(--surface); border: 2px solid var(--vacant); }
.cell-key.s { background: var(--navy); border-bottom: 3px solid var(--gold); }

.tower { margin: 14px 16px 6px; }
.tower-h { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 10px; }
.tower-h h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.tower-h span { font-size: 13px; color: var(--ink-2); }
.tower-h b.v { color: var(--vacant); }
.tower-h b.s { color: var(--gold-ink); }
.tower-body {
  background: var(--surface);
  border-radius: 14px 14px 4px 4px;
  padding: 12px 10px 6px;
  border: 1px solid var(--line);
  border-bottom: 0;
}
.tower-base { height: 8px; margin: 0 -6px; border-radius: 3px; background: var(--navy); }
.floor { display: flex; align-items: stretch; gap: 8px; padding: 4px 0; }
.floor + .floor { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.floor-l {
  flex: none; width: 34px; font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1;
  word-break: break-word;
}
.cells { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px; }
.cell {
  height: 58px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  transition: transform .1s, opacity .2s;
  position: relative;
}
.cell:active { transform: scale(.94); }
.cell-no { font-weight: 700; font-size: 15px; letter-spacing: -.01em; max-width: 100%; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-t { font-size: 11px; font-weight: 600; opacity: .75; }
.cell.v { background: var(--vacant-bg); color: var(--vacant); box-shadow: inset 0 0 0 2px var(--vacant); }
.cell.s { background: var(--navy); color: #fff; }
.cell.s::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 3px; border-radius: 2px; background: var(--gold); }
.cell.s .cell-t { margin-bottom: 4px; }
.cell.dim { opacity: .18; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cell.s { background: #2A4A85; } }

/* ───────────── flat rows ───────────── */
.flats .row { padding-top: 12px; padding-bottom: 12px; }
.unit {
  flex: none; width: 56px; height: 48px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; padding: 0 4px;
  position: relative;
}
.unit span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit.v { background: var(--vacant-bg); color: var(--vacant); box-shadow: inset 0 0 0 2px var(--vacant); }
.unit.s { background: var(--navy); color: #fff; }
.unit.s::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 5px; height: 3px; border-radius: 2px; background: var(--gold); }
.pill { flex: none; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 12px; }
.pill.v { color: var(--vacant); background: var(--vacant-bg); }
.pill.s { color: var(--gold-ink); background: rgba(232,164,28,.16); }
.count { padding: 4px 20px 8px; font-size: 13px; color: var(--ink-2); }

/* ───────────── flat detail ───────────── */
.fhead { padding: 4px 20px 20px; position: relative; }
.fproj { color: var(--ink-2); font-size: 15px; font-weight: 600; }
.fno {
  font-size: 64px; font-weight: 700; letter-spacing: -.04em; line-height: 1;
  margin: 6px 0 12px; word-break: break-word;
}
.fhead.s .fno { color: var(--navy); }
.fhead.v .fno { color: var(--vacant); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fhead.s .fno { color: #fff; } }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; padding: 6px 14px 6px 12px; border-radius: 20px; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.v { color: var(--vacant); background: var(--vacant-bg); }
.status.s { color: #fff; background: var(--navy); }
.status.s::before { background: var(--gold); }

.specs {
  display: grid; grid-template-columns: 1fr 1fr; margin: 0 16px;
  background: var(--surface); border-radius: var(--radius-l); overflow: hidden;
}
.specs div { padding: 14px 16px; }
.specs div:nth-child(odd) { border-right: 1px solid var(--line); }
.specs div:nth-child(n+3) { border-top: 1px solid var(--line); }
.specs span { display: block; font-size: 13px; color: var(--ink-2); }
.specs strong { display: block; font-size: 18px; font-weight: 700; margin-top: 2px; }
.specs small { font-size: 12px; font-weight: 500; color: var(--ink-3); }

dl.kvs { margin: 0; }
dl.group.kvs { margin: 0 16px; }
.kv { display: flex; gap: 16px; justify-content: space-between; padding: 13px 16px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv dt { color: var(--ink-2); font-size: 14.5px; flex: none; }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.kv.wrap { flex-direction: column; gap: 3px; }
.kv.wrap dd { text-align: left; font-weight: 500; line-height: 1.45; }
.kv dd a { color: var(--navy); }
.mono { letter-spacing: .08em; }
.note { color: var(--ink-2); font-size: 14px; padding: 12px 20px 0; }
.due { color: var(--danger); }
.ok { color: var(--vacant); }

.owner { margin: 0 16px; background: var(--surface); border-radius: var(--radius-l); overflow: hidden; }
.owner-top { display: flex; align-items: center; gap: 14px; padding: 18px 16px 14px; }
.avatar {
  width: 60px; height: 60px; border-radius: 50%; flex: none; object-fit: cover;
  display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 21px;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--gold);
}
.avatar.sm { width: 40px; height: 40px; font-size: 14px; box-shadow: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 23px; }
.owner-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.owner-mob { color: var(--ink-2); font-size: 15px; margin-top: 3px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px 16px; border-bottom: 1px solid var(--line); }
.act {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 0 8px; border-radius: var(--radius-m);
  background: var(--paper); color: var(--navy); font-size: 12.5px; font-weight: 600;
  transition: transform .1s;
}
.act svg { width: 22px; height: 22px; }
.act:active { transform: scale(.95); background: var(--sold-bg); }
.act.off { opacity: .35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .act, :root:not([data-theme="light"]) .kv dd a { color: var(--gold); } }
.round { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; background: var(--paper); color: var(--navy); flex: none; }
.round svg { width: 20px; height: 20px; }

.pay { padding-top: 16px; }
.pay-top { display: flex; justify-content: space-between; padding: 0 16px; }
.pay-top span { display: block; font-size: 13px; color: var(--ink-2); }
.pay-top strong { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.pay-top .r { text-align: right; }
.pay-m { margin: 12px 16px 0; background: var(--sk); }
.pay-m i { background: var(--vacant); }
.pay-pct { font-size: 13px; color: var(--ink-2); padding: 8px 16px 10px; border-bottom: 1px solid var(--line); }

.me { display: flex; align-items: center; gap: 16px; padding: 18px 16px; margin-bottom: 18px; }
.about { text-align: center; padding: 36px 20px; color: var(--ink-2); font-size: 14px; }
.about img { margin: 0 auto 8px; border-radius: 10px; }
.about p:first-of-type { font-weight: 600; color: var(--ink); }

/* ───────────── search ───────────── */
.searchbar {
  display: flex; align-items: center; gap: 8px;
  margin: 0 16px 12px; padding: 0 6px 0 12px; height: 46px;
  background: var(--surface); border-radius: 12px; border: 1px solid var(--line);
  color: var(--ink-3);
}
.searchbar:focus-within { border-color: var(--navy); }
.searchbar > svg { width: 20px; height: 20px; flex: none; }
.searchbar input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; color: var(--ink);
}
.searchbar input::-webkit-search-cancel-button { display: none; }
.searchbar .clear { width: 34px; height: 34px; display: grid; place-items: center; visibility: hidden; color: var(--ink-3); }
.searchbar .clear svg { width: 18px; height: 18px; }

/* ───────────── empty / error / skeleton ───────────── */
.empty { text-align: center; padding: 44px 32px; color: var(--ink-2); font-size: 14.5px; }
.empty.slim { margin: 16px; padding: 22px; background: var(--surface); border-radius: var(--radius-l); }
.empty-title { color: var(--ink); font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.btn-ghost { margin-top: 16px; height: 42px; padding: 0 20px; border-radius: 21px; border: 1.5px solid var(--navy); color: var(--navy); font-weight: 600; }

.skeleton { margin: 8px 16px; background: var(--surface); border-radius: var(--radius-l); padding: 4px 16px; }
.sk-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; }
.sk-row + .sk-row { border-top: 1px solid var(--line); }
.sk-col { flex: 1; }
.sk { background: var(--sk); border-radius: 6px; position: relative; overflow: hidden; }
.sk::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transform: translateX(-100%); animation: shimmer 1.2s infinite;
}
.sk.light { background: rgba(255,255,255,.14); }
.sk.light::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-a { width: 48px; height: 44px; border-radius: 10px; flex: none; }
.sk-b { height: 14px; width: 60%; margin-bottom: 8px; }
.sk-c { height: 11px; width: 38%; }
.sk-big { height: 54px; width: 46%; margin: 10px 0 14px; border-radius: 10px; }
.phead .sk-b { height: 26px; width: 70%; margin: 4px 0 12px; }

/* pull-to-refresh */
.ptr {
  position: absolute; left: 50%; top: calc(var(--safe-t) + 8px); z-index: 4;
  width: 36px; height: 36px; margin-left: -18px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 2px 10px rgba(7,28,63,.18);
  display: grid; place-items: center; opacity: 0; pointer-events: none;
  transition: transform .2s, opacity .2s;
}
.ptr span { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--navy); transition: transform .2s; }
.ptr.ready span { transform: rotate(180deg); border-top-color: var(--gold); }
.ptr.spin span { animation: spin .7s linear infinite; border-top-color: var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }

/* toast & offline */
.toast {
  position: absolute; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); z-index: 20;
  transform: translate(-50%, 20px); opacity: 0;
  background: var(--deep); color: #fff; padding: 11px 18px; border-radius: 22px;
  font-size: 14.5px; font-weight: 600; pointer-events: none;
  transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1);
  max-width: calc(100% - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.offline {
  position: absolute; left: 0; right: 0; top: 0; z-index: 30;
  padding: calc(var(--safe-t) + 8px) 16px 8px; text-align: center;
  background: var(--danger); color: #fff; font-size: 13.5px; font-weight: 600;
  transform: translateY(-100%); transition: transform .25s;
}
.offline.show { transform: none; }

/* ───────────── login ───────────── */
.login-body { background: var(--deep); }
.login { min-height: 100%; display: flex; flex-direction: column; }
.login-hero {
  position: relative; flex: 1 0 auto; min-height: 260px;
  display: flex; align-items: flex-end;
  padding: calc(var(--safe-t) + 28px) 24px 56px;
  color: #fff; overflow: hidden;
}
.login-skyline {
  position: absolute; left: 0; right: 0; bottom: 18px; width: 100%; height: 72%;
  color: rgba(255,255,255,.22);
}
.login-brand { position: relative; display: flex; align-items: center; gap: 14px; }
.login-icon { width: 64px; height: 64px; border-radius: 16px; background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.25); object-fit: cover; }
.login-name { font-size: 30px; font-weight: 700; letter-spacing: .04em; line-height: 1; }
.login-tag { font-size: 14px; color: rgba(255,255,255,.74); margin-top: 6px; }
.login-sheet {
  position: relative; margin-top: -24px;
  background: var(--surface); border-radius: 26px 26px 0 0;
  padding: 30px 24px calc(var(--safe-b) + 28px);
  animation: sheetUp .5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .login-sheet { animation: none; } }
.login-sheet h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.login-sub { color: var(--ink-2); font-size: 15px; margin-top: 6px; max-width: 34ch; }
.login-form { margin-top: 22px; display: grid; gap: 16px; }
.field span { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.field input {
  width: 100%; height: 52px; padding: 0 16px;
  border-radius: var(--radius-m); border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink);
  font: inherit; font-size: 17px; outline: 0;
  transition: border-color .15s, background .15s;
}
.field input:focus { border-color: var(--navy); background: var(--surface); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 54px; }
.pw-toggle { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-3); border-radius: 10px; }
.pw-toggle.on { color: var(--navy); }
.btn-primary {
  position: relative; height: 54px; margin-top: 6px; border-radius: 14px;
  background: var(--navy); color: #fff; font-size: 17px; font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--gold);
  transition: transform .1s, opacity .2s;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary .spinner { display: none; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-primary.loading .btn-label { visibility: hidden; }
.btn-primary.loading .spinner { display: block; }
.alert { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-m); background: rgba(194,54,47,.1); color: var(--danger); font-size: 14.5px; font-weight: 600; }
.login-foot { color: var(--ink-3); font-size: 13.5px; text-align: center; margin-top: 20px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pw-toggle.on,
  :root:not([data-theme="light"]) .field input:focus { border-color: var(--gold); }
}

@media (min-width: 700px) {
  .login { max-width: 460px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}


/* ───────────── booking cancellation ───────────── */
.pstats strong.cx { color: #FF8A7A; }
.segmented.four { grid-template-columns: repeat(4, 1fr); }
.segmented.four .seg-thumb { width: calc((100% - 6px) / 4); }
.segmented.four button { font-size: 13.5px; gap: 4px; }
.segmented .on.cancelled .cnt { color: var(--danger); }
.cell-key.x { background: var(--surface); border: 2px dashed var(--danger); }
.cell.cx::before {
  content: ''; position: absolute; top: 5px; right: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px var(--surface);
}
.cell.v.cx { box-shadow: inset 0 0 0 2px var(--vacant); }
.row-cx { font-size: 12.5px; font-weight: 600; color: var(--danger); margin-top: 3px; }
.cxcard { margin-bottom: 12px; border-left: 3px solid var(--danger); }
.cx-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px 10px; }
.cx-title { font-weight: 700; font-size: 16px; }
.cx-buyer { display: flex; align-items: center; gap: 12px; padding: 4px 16px 12px; border-bottom: 1px solid var(--line); }
.cx-buyer .avatar.sm { background: var(--ink-3); }
.pill.rf.pending { color: #A36A08; background: rgba(232,164,28,.16); }
.pill.rf.paid { color: var(--vacant); background: var(--vacant-bg); }
.pill.rf.none { color: var(--ink-2); background: var(--paper); }

/* privacy mode (masked owner) */
.owner.masked .owner-top { padding-bottom: 18px; }
.mono-mask { letter-spacing: .06em; }
.owner.masked + .section-h { margin-top: 0; }
.cxcard .cx-buyer:last-child { border-bottom: 0; }
