/* MyProp — mobile first; one breakpoint at 900px turns the bottom tab bar into a top bar and the
   map's bottom sheet into a side panel. cpprop (.site-cp) uses the darker "Control" accent. */

:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #f1efe8;
  --text: #1f1e1c;
  --text-2: #5f5e5a;
  --text-3: #8a8984;
  --border: rgba(0, 0, 0, 0.12);
  --border-2: rgba(0, 0, 0, 0.22);
  --accent: #185fa5;
  --accent-bg: #e6f1fb;
  --accent-border: #85b7eb;
  --primary: #1f1e1c;
  --on-primary: #ffffff;
  --danger: #a32d2d;
  --danger-bg: #fcebeb;
  --danger-border: #f09595;
  --warning: #854f0b;
  --radius: 10px;
  --tabbar-h: 60px;
  --topbar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --surface: #222120;
    --surface-2: #2c2b29;
    --text: #f1efe8;
    --text-2: #b4b2a9;
    --text-3: #888780;
    --border: rgba(255, 255, 255, 0.12);
    --border-2: rgba(255, 255, 255, 0.24);
    --accent: #85b7eb;
    --accent-bg: #0c447c;
    --accent-border: #185fa5;
    --primary: #f1efe8;
    --on-primary: #1f1e1c;
    --danger: #f09595;
    --danger-bg: #501313;
    --danger-border: #a32d2d;
    --warning: #ef9f27;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans Thai', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
body.has-nav { padding-bottom: calc(var(--tabbar-h) + var(--safe-b)); }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; font-weight: 600; margin: 0; line-height: 1.3; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
input, select, textarea, button { font: inherit; color: inherit; }
button { cursor: pointer; }

.muted { color: var(--text-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 32px 16px; }
.pad-x { padding: 0 4px; }
.grow { flex: 1; }
.min0 { min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre { white-space: pre-wrap; }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.row-gap { display: flex; gap: 8px; align-items: center; }
.row-gap.wrap { flex-wrap: wrap; }

/* Tab bar: bottom on phones, top bar on wide screens */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; color: var(--text-3);
}
.tabbar a i { font-size: 23px; }
.tabbar a span { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.site-cp .tabbar a { font-size: 11px; }
/* A tab whose name is too long for the phone tab bar shows a short name there. */
.tabbar .tab-long { display: none; }
.tabbar a.active { color: var(--accent); }
.tabbar .tabbar-brand { display: none; }

/* Page layout */
.page { max-width: 960px; margin: 0 auto; padding: 16px 16px 24px; }
.page.narrow { max-width: 640px; }
.page-head, .detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; min-height: 40px; }
.page-head h1 { flex: 1; }
.detail-head h1 { font-size: 19px; }
.detail-title { margin: 4px 0 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 22px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.btn i { font-size: 18px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-danger { color: var(--danger); border-color: var(--danger-border); background: transparent; }
.btn-dashed { border-style: dashed; background: transparent; margin-top: 12px; }
.btn-block { display: flex; width: 100%; }
.btn-google { background: var(--surface); }
.btn:disabled { opacity: 0.5; }
.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: none; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text); font-size: 21px;
}
.icon-btn.sm { width: 34px; height: 34px; font-size: 17px; }
.icon-btn.outline { border: 1px solid var(--border-2); width: 44px; height: 44px; }
.icon-btn.raised { background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.icon-btn.raised.on { color: var(--accent); }
.icon-btn.danger { color: var(--danger); border: 1px solid var(--danger-border); width: 44px; height: 44px; }
.icon-btn:disabled { opacity: 0.3; }
button.plain { border: none; background: none; padding: 0; text-align: inherit; }
button.left { text-align: left; }

/* Chips, pills, dots */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 32px; padding: 0 13px;
  border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 13px; white-space: nowrap;
}
.chip.on { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-border); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.dot.lg { width: 14px; height: 14px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.muted-pill { background: var(--surface-2); color: var(--text-2); }

/* Cards, stats, lists */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.stat span { display: block; font-size: 12px; color: var(--text-2); }
.stat b { font-size: 19px; font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.list > li + li { border-top: 1px solid var(--border); }
.list-row {
  display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 8px 12px 8px 14px;
  color: var(--text); width: 100%; background: none; border: none; text-align: left;
}
.list-row.on { background: var(--surface-2); }
.list-row.inactive, .member.inactive { opacity: 0.5; }
.list-row .title { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .sub { display: block; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .grow { min-width: 0; }
.list.menu .list-row > i:first-child { font-size: 21px; color: var(--text-2); }
.badge-icon {
  width: 38px; height: 38px; border-radius: 11px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; background: var(--surface-2);
}
.status-text { font-size: 12px; white-space: nowrap; }
.empty { text-align: center; padding: 40px 16px; color: var(--text-2); }
.empty > i { font-size: 44px; color: var(--text-3); }
.empty h1, .empty h2 { color: var(--text); margin: 8px 0; }
.empty .btn { margin-top: 8px; }

/* Search */
.search {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-3);
}
.search input { flex: 1; min-width: 0; border: none; background: none; outline: none; color: var(--text); font-size: 15px; }
.search-row { margin-bottom: 10px; }

/* Forms */
.form .card h2 { margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 13px; color: var(--text-2); }
.field small { font-size: 12px; color: var(--text-3); }
.field input, .field select, .field textarea, .inline-input {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: var(--radius);
  border: 1px solid var(--border-2); background: var(--surface); font-size: 16px; /* 16px stops iOS zoom */
}
.field textarea { resize: vertical; }
.inline-input { min-height: 36px; padding: 5px 8px; border-color: transparent; background: transparent; }
.inline-input:focus { border-color: var(--border-2); background: var(--surface); }
.grid-2, .grid-3 { display: grid; gap: 0 10px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; }
.check-row input, .radio-row input, .import-list input[type='checkbox'] { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.alert { background: var(--danger-bg); color: var(--danger); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; font-size: 14px; }
.alert p { margin: 0; }
.danger-zone { margin-top: 24px; }
.action-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); z-index: 10;
  display: flex; gap: 8px; margin-top: 16px; padding: 10px; border-radius: 30px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px);
}
body:not(.has-nav) .action-bar { bottom: calc(var(--safe-b) + 8px); }
.action-bar .btn { flex: 1; }

/* Flash */
.flash {
  position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 3000; width: min(92vw, 480px);
  background: var(--primary); color: var(--on-primary); border-radius: 14px; padding: 10px 16px;
  font-size: 14px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); transition: opacity 0.4s;
}
.flash p { margin: 2px 0; }
.flash.gone { opacity: 0; pointer-events: none; }

/* Login */
.login { max-width: 400px; margin: 0 auto; padding: 18vh 20px 32px; display: flex; flex-direction: column; gap: 14px; }
.login-brand { text-align: center; margin-bottom: 12px; }
.login-brand h1 { font-size: 30px; }
.login-brand p { color: var(--text-2); margin: 4px 0 0; }
.login-icon { font-size: 44px; color: var(--accent); }
.dev-login { margin-top: 20px; }

/* Map page */
.page-map.has-nav { padding-bottom: 0; }
.map-page { position: fixed; inset: 0 0 calc(var(--tabbar-h) + var(--safe-b)) 0; }
.map-area { position: absolute; inset: 0; }
.map { position: absolute; inset: 0; background: var(--surface-2); }
.map-top { position: absolute; top: 0; left: 0; right: 0; z-index: 1000; padding: 10px 12px 0; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.map-top .search { box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15); }
.map-top .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-top: 8px; padding-bottom: 4px; }
.map-top .chips::-webkit-scrollbar { display: none; }
.map-top .chip { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); }
.map-summary {
  position: absolute; left: 12px; top: 104px; z-index: 1000; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px;
  font-size: 12px; line-height: 1.6; color: var(--text-2); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.map-summary:empty { display: none; }
.map-tools { position: absolute; right: 12px; top: 104px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.fab {
  position: absolute; right: 14px; bottom: 16px; z-index: 1000; width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 28px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}
@media (prefers-color-scheme: dark) { .fab { background: #378add; } }
.map-page.has-sel .fab { display: none; }
.map-panel .plist { display: none; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1100;
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 8px 16px 14px;
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.15);
}
.sheet p { margin: 6px 0 0; }
.grabber { width: 38px; height: 4px; border-radius: 2px; background: var(--border-2); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: flex-start; gap: 8px; }
.sheet-head .title { font-size: 17px; font-weight: 600; }
.sheet-head .sub { font-size: 13px; color: var(--text-2); }
.sheet-actions { display: flex; gap: 8px; margin-top: 12px; }

/* Pins (Leaflet divIcon) */
.pin { background: none; border: none; display: flex; flex-direction: column; align-items: center; }
.pin b {
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 2px solid #fff; color: #fff; font-size: 17px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.pin-on b { font-size: 21px; }
.pin-tip { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid; margin-top: -1px; }
.leaflet-container { font-family: inherit; }
/* Merged pins (big rooms). */
.pin-cluster { background: none; border: none; }
.pin-cluster b {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 600;
  border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow { transition: transform 0.3s ease-out, opacity 0.3s ease-in; }
.leaflet-cluster-spider-leg { transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in; }
.list-more { padding: 16px; }

/* Detail page */
.notice {
  display: flex; align-items: center; gap: 10px; margin: 0 0 4px; padding: 10px 8px 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--warning) 12%, var(--surface)); color: var(--warning); font-size: 14px;
}
.notice > i { font-size: 20px; }
.notice-text { color: var(--text); white-space: pre-wrap; word-break: break-word; }
.notice .muted-on { color: inherit; opacity: 0.85; }
.notice-danger { background: var(--danger-bg); color: var(--danger); }
.notice .icon-btn { color: inherit; }
.banner-danger { display: flex; gap: 8px; align-items: flex-start; background: var(--danger-bg); color: var(--danger); border-radius: 12px; padding: 10px 12px; margin: 12px 0 0; font-size: 14px; }
.banner-danger i { font-size: 18px; margin-top: 1px; }
.minimap { height: 190px; border-radius: 14px; overflow: hidden; margin: 12px 0; background: var(--surface-2); }
.minimap-link { cursor: pointer; }
.form-sub { margin-bottom: 14px; }
.minimap-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-2); font-size: 13px; height: 110px; }
.minimap-empty i { font-size: 28px; color: var(--text-3); }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin: 8px 0 4px; }
.tabs a, .tabs button {
  flex: 1; text-align: center; padding: 11px 0; font-size: 14px; color: var(--text-2);
  border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs .on { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv > div.block { flex-direction: column; gap: 4px; }
.kv dt { color: var(--text-2); flex: none; }
.kv dd { margin: 0; text-align: right; }
.kv > div.block dd { text-align: left; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 18px 12px; }
.timeline li::before { content: ''; position: absolute; left: -21px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-2); }
.timeline li.tl-danger::before { border-color: var(--danger); }
.tl-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tl-line { font-size: 14px; color: var(--text-2); word-break: break-word; }

/* Dialog — bottom sheet on phones, centred card on wide screens */
.sheet-dialog {
  border: none; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 90dvh;
  border-radius: 20px 20px 0 0; background: var(--surface); color: var(--text);
}
.sheet-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.sheet-dialog form { padding: 10px 16px calc(16px + var(--safe-b)); }
.dialog-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dialog-head h2 { margin: 0; }
.dialog-actions { display: flex; gap: 8px; margin-top: 8px; }
.radio-list { margin-bottom: 12px; }
.radio-row { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--border); font-size: 15px; }
.icon-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.icon-pick {
  height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.icon-pick.on { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-border); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface); background: var(--c);
  box-shadow: 0 0 0 1px var(--border); padding: 0; position: relative; overflow: hidden;
}
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.swatch.custom { background: conic-gradient(#e24b4a, #ef9f27, #639922, #1d9e75, #378add, #7f77dd, #d4537e, #e24b4a); }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Members, profile */
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 26px; }
.profile { display: flex; gap: 14px; align-items: center; }
.profile .title { font-size: 17px; font-weight: 600; }
.profile .pill { margin-top: 6px; }
.member-form { display: flex; align-items: center; gap: 4px; }
.member-form select { min-height: 36px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); padding: 0 6px; font-size: 13px; max-width: 130px; }
.list.menu { margin-bottom: 16px; }

/* ---------- Wide screens ---------- */
@media (min-width: 900px) {
  body.has-nav { padding-bottom: 0; padding-top: var(--topbar-h); }
  .tabbar {
    top: 0; bottom: auto; height: var(--topbar-h); padding: 0 20px; gap: 4px;
    border-top: none; border-bottom: 1px solid var(--border);
  }
  .tabbar a, .site-cp .tabbar a { flex: none; flex-direction: row; gap: 6px; padding: 0 14px; font-size: 14px; }
  .tabbar a i { font-size: 19px; }
  .nav-avatar { width: 30px; height: 30px; }
  .tabbar .nav-me span { display: none; }
  .tabbar .tab-long { display: inline; }
  .tabbar .tab-short { display: none; }
  .tabbar a.active { color: var(--text); font-weight: 500; }
  .tabbar .tabbar-brand { display: flex; margin-right: auto; font-size: 17px; font-weight: 600; color: var(--text); padding-left: 0; }
  .tabbar .tabbar-brand i { color: var(--accent); }
  .tabbar .tabbar-brand + a { margin-left: 0; }

  .page { padding-top: 24px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .action-bar { bottom: 12px; }

  .map-page { inset: var(--topbar-h) 0 0 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
  .map-area { position: relative; inset: auto; }
  .map-top { right: auto; width: min(560px, calc(100% - 80px)); padding: 14px 16px 0; }
  .map-top .chips { flex-wrap: wrap; overflow: visible; }
  .map-summary, .map-tools { top: auto; bottom: 20px; }
  .map-summary { left: 16px; }
  .map-tools { right: 16px; bottom: 96px; }
  .fab { right: 16px; bottom: 20px; }
  .map-page.has-sel .fab { display: flex; }
  .map-panel { border-left: 1px solid var(--border); background: var(--bg); overflow-y: auto; }
  .map-panel .plist { display: block; padding: 8px; }
  .map-panel .plist .list-row { border-radius: 12px; }
  .sheet { position: sticky; top: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--border); padding: 16px; }
  .sheet .grabber { display: none; }

  .sheet-dialog { margin: auto; width: 440px; border-radius: 18px; }
  .sheet-dialog .grabber { display: none; }
}

/* ---------- v2: brand, rooms, platform ---------- */
:root { --brand: #0f6e56; --brand-2: #fac775; }
.site-cp { --brand: #2c2c2a; --brand-2: #5dcaa5; }
.logo { flex: none; display: block; }
.light { font-weight: 400; }
.top-gap { margin-top: 12px; }
.tabbar-brand span { white-space: nowrap; }
.brand-room { font-size: 13px; font-weight: 400; color: var(--text-2); max-width: 200px; }
.login-brand .logo { margin: 0 auto 10px; }

.platform-banner {
  position: sticky; top: 0; z-index: 2100; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: #2c2c2a; color: #f1efe8; font-size: 13px;
}
.platform-banner a { color: #5dcaa5; font-weight: 600; }
.platform-banner i { color: #5dcaa5; font-size: 18px; }
.has-banner .map-page { top: 36px; }

.hero { display: flex; flex-direction: column; gap: 2px; background: var(--brand); color: #fff; border: none; }
button.hero { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-chevron { font-size: 20px; color: rgba(255, 255, 255, 0.8); transition: transform 0.3s ease; }
.hero[aria-expanded='true'] .hero-chevron { transform: rotate(180deg); }
/* Collapsible panel: animates its height from 0 to the content's height. */
.reveal { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.3s ease, opacity 0.3s ease; }
.reveal.open { grid-template-rows: 1fr; opacity: 1; }
.reveal-inner { overflow: hidden; min-height: 0; }
@media (prefers-reduced-motion: reduce) { .reveal, .hero-chevron { transition: none; } }
.nav-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--border); }
.tabbar a.active .nav-avatar { box-shadow: 0 0 0 2px var(--accent); }
.hero .muted { color: rgba(255, 255, 255, 0.75); }
.hero-value { font-size: 30px; font-weight: 600; line-height: 1.2; }
.hero-value small { font-size: 15px; font-weight: 400; }
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.cat-card {
  display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.cat-card .cat-label { font-size: 14px; color: var(--text-2); }
.cat-card b { font-size: 18px; }
.section-title { display: flex; align-items: center; gap: 6px; margin: 18px 0 8px; }
/* Notifications card on the overview: the list sits flush inside the card. */
.notif-card { margin-top: 16px; padding-bottom: 6px; }
.notif-title { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; }
.notif-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--danger-bg); color: var(--danger); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.notif-list { border: none; border-radius: 0; background: none; margin: 0 -16px; }
.notif-empty { margin: 4px 0 8px; }
.sub-title { font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.badge-icon.sm { width: 30px; height: 30px; font-size: 16px; border-radius: 9px; }
.list-row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.small-chips .chip { height: 28px; font-size: 12px; }
/* Asset filters: selects on phones, chips on wide screens. */
.filter-chips { display: none; }
.filter-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.filter-selects select {
  min-height: 44px; width: 100%; padding: 0 34px 0 14px; border-radius: 22px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 15px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: right 18px center, right 13px center; background-size: 5px 5px; background-repeat: no-repeat;
}
.filter-selects select:has(option:checked:not([value=''])) { border-color: var(--accent-border); background-color: var(--accent-bg); color: var(--accent); }
.small-chips { margin-top: -4px; }
.code-line { margin: 0; letter-spacing: 0.02em; }
.grant-row { display: flex; align-items: center; gap: 10px; min-height: 46px; border-bottom: 1px solid var(--border); font-size: 14px; }
.grant-row select, .fb select, .fb input {
  min-height: 36px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); padding: 0 8px; font-size: 14px;
}
.field.inner { margin-bottom: 0; }
details.card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2 { margin: 0; flex: 1; }
details.card.fold > summary { min-height: 28px; }
details.card.fold:not([open]) { padding-top: 12px; padding-bottom: 12px; }
/* Files and links */
.att-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.att-thumb { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-del, .att-lock {
  position: absolute; top: 4px; width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(0, 0, 0, 0.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.att-del { right: 4px; cursor: pointer; }
.att-lock { left: 4px; }
.att-list { margin-bottom: 12px; }
.att-list a { color: var(--text); }
.att-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.att-pick { cursor: pointer; }
.att-link input:not([type='checkbox']) {
  flex: 1 1 160px; min-width: 0; min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--border-2); background: var(--surface); font-size: 14px;
}
.files-tab { padding-top: 12px; }
details.card > summary::after { content: '\ea5f'; font-family: 'tabler-icons'; color: var(--text-3); }
details.card[open] > summary { margin-bottom: 12px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-3); }
.link-btn { border: none; background: none; padding: 0; color: var(--accent); font-size: 12px; font-weight: 600; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.inline-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.fb { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.fb-row { border: 1px solid var(--border); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.fb-row.inactive { opacity: 0.55; }
.fb-main { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 6px; }
.fb-extra { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.fb-extra input:not([type='checkbox']) { flex: 1; }
.fb-extra input.tiny { flex: none; width: 60px; }
.fb-flags { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.fb-flags .fb-push { margin-left: auto; }
.fb-flags .icon-btn.sm { width: 30px; height: 30px; }
.tl-platform::before { border-color: #5dcaa5 !important; background: #2c2c2a !important; }

@media (min-width: 900px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-selects { display: none; }
  .filter-chips { display: flex; }
  .sheet-dialog.wide { width: 560px; }
  .has-banner.has-nav { padding-top: calc(var(--topbar-h) + 36px); }
  .has-banner .tabbar { top: 36px; }
  .has-banner .map-page { top: calc(var(--topbar-h) + 36px); }
  .platform-banner { position: fixed; left: 0; right: 0; top: 0; }
}

/* Log pages: year filter + order toggle, and the lazy "load more" under the timeline. */
.log-tools { display: flex; gap: 8px; align-items: center; margin: -4px 0 12px; }
.log-tools select { width: auto; min-height: 36px; padding: 0 32px 0 12px; font-size: 13px; }
.tl-more { display: flex; margin: 0 auto 16px; }

/* Public pages: /about, /privacy */
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.doc-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 18px; color: var(--text); text-decoration: none; }
.doc-links { display: flex; gap: 14px; font-size: 14px; }
.doc h1 { font-size: 26px; margin-bottom: 4px; }
.doc h2 { font-size: 17px; margin: 24px 0 6px; }
.doc p, .doc li { line-height: 1.7; color: var(--text-2); }
.doc ul { padding-left: 20px; margin: 6px 0; }
.doc li { margin-bottom: 4px; }
.doc b { color: var(--text); font-weight: 600; }
.doc .lead { font-size: 17px; margin-top: 0; }
.doc-cta { margin-top: 28px; }
.login-links { text-align: center; margin-top: 8px; }
