/* Raajje Map design system — tokens, base, components, layout.
   Logical properties (inline/block) are used throughout so the Dhivehi
   right-to-left layout works without separate overrides. */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'MV Typewriter';
  src: url('https://dhivehi.mv/fonts/data/df/mvtyper.ttf') format('truetype');
  font-display: swap;
  unicode-range: U+0780-07BF, U+060C, U+061B, U+061F, U+FDF2, U+FDFD;
}

/* ---------- Tokens ---------- */
/* Brand: ocean blue (primary), lagoon turquoise (secondary), coral (selection only),
   sand (highlights). Neutrals are cool slate on a soft off-white canvas. */
:root {
  --ocean-950: #04162e;
  --ocean-900: #072146;
  --ocean-800: #0a3f99;
  --ocean-700: #0a5bd3;
  --ocean-600: #2f7cf0;
  --ocean-100: #e8f1fe;
  --ocean-50: #f3f8ff;
  --teal-700: #0b8a83;
  --teal-600: #0ea5a0;
  --teal-400: #2dd4c4;
  --teal-100: #dcf7f3;
  --sand-300: #ffc266;
  --sand-100: #fff5e5;
  --coral-600: #e5483d;
  --coral-500: #ff5a4e;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f3f6fa;
  --surface-3: #e9eef5;
  --text: #0b1324;
  --text-2: #3d4a5c;
  --text-3: #66758a;
  --border: #e4e9f0;
  --border-strong: #ced6e0;
  --primary: var(--ocean-700);
  --primary-hover: #0849ae;
  --primary-soft: var(--ocean-100);
  --on-primary: #ffffff;
  --secondary: var(--teal-700);
  --secondary-soft: var(--teal-100);
  --accent: var(--coral-500);
  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #92400e;
  --warning-soft: #fef3c7;
  --danger: #c81e1e;
  --danger-soft: #fee2e2;
  --focus: #2f7cf0;
  --overlay: rgba(4, 22, 46, .45);
  --tint: 13%;                 /* strength of tinted icon tiles */

  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-2: 0 4px 14px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .05);
  --shadow-3: 0 20px 48px rgba(16, 24, 40, .18);

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-pill: 999px;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-dv: 'MV Typewriter', 'Noto Sans Thaana', 'MV Faseyha', 'MV Waheed', 'Faruma', var(--font);
  --fs-xs: 12px; --fs-s: 13px; --fs-m: 15px; --fs-l: 17px; --fs-xl: 20px; --fs-2xl: 26px; --fs-3xl: 34px;

  --header-h: 64px;
  --panel-w: 400px;
  --nav-h: 66px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #070d19; --surface: #0e1626; --surface-2: #142035; --surface-3: #1b2a44;
    --text: #eaf0f7; --text-2: #b4c0d0; --text-3: #8796ab; --border: #1f2d45; --border-strong: #2c3d5a;
    --primary: #5b9dff; --primary-hover: #7db2ff; --primary-soft: #13284a; --on-primary: #04162e;
    --secondary: #2dd4c4; --secondary-soft: #0f3532; --accent: #ff7b70;
    --success: #4ade80; --success-soft: #0f2f1d; --warning: #fbbf24; --warning-soft: #33270b; --danger: #f87171; --danger-soft: #3a1414;
    --focus: #7db2ff; --overlay: rgba(0, 0, 0, .62); --tint: 22%;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .45); --shadow-2: 0 6px 18px rgba(0, 0, 0, .45); --shadow-3: 0 24px 60px rgba(0, 0, 0, .6);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #070d19; --surface: #0e1626; --surface-2: #142035; --surface-3: #1b2a44;
    --text: #eaf0f7; --text-2: #b4c0d0; --text-3: #8796ab; --border: #1f2d45; --border-strong: #2c3d5a;
    --primary: #5b9dff; --primary-hover: #7db2ff; --primary-soft: #13284a; --on-primary: #04162e;
    --secondary: #2dd4c4; --secondary-soft: #0f3532; --accent: #ff7b70;
    --success: #4ade80; --success-soft: #0f2f1d; --warning: #fbbf24; --warning-soft: #33270b; --danger: #f87171; --danger-soft: #3a1414;
    --focus: #7db2ff; --overlay: rgba(0, 0, 0, .62); --tint: 22%;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .45); --shadow-2: 0 6px 18px rgba(0, 0, 0, .45); --shadow-3: 0 24px 60px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-m);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
:lang(dv), [lang="dv"] { font-family: var(--font-dv); }
html[lang="dv"] body { font-family: var(--font-dv); line-height: 1.7; }
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 5000; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: var(--radius-s); }
.skip-link:focus { top: 8px; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* ---------- Icons ---------- */
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-s { width: 16px; height: 16px; }
.icon-l { width: 24px; height: 24px; }
html[dir="rtl"] .icon-flip { transform: scaleX(-1); }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--text); }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-name { font-weight: 750; font-size: 18px; letter-spacing: -.02em; color: var(--primary); white-space: nowrap; }
:root[data-theme="dark"] .brand-name { color: var(--text); }
.brand-tagline { font-size: 11.5px; color: var(--text-3); white-space: nowrap; letter-spacing: .01em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius-s);
  border: 1px solid transparent; background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: var(--fs-s); line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--teal-600); color: #fff; }
:root[data-theme="dark"] .btn-secondary { color: #061a30; }
.btn-outline { background: transparent; border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); filter: brightness(.92); color: #fff; }
.btn-s { min-height: 32px; padding: 5px 10px; font-size: var(--fs-xs); }
.btn-l { min-height: 48px; padding: 12px 20px; font-size: var(--fs-m); }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: var(--radius-s); border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); }

/* Action buttons on place details: icon above label */
.action-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 4px; }
.action {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: var(--radius-m);
  background: none; border: 0; color: var(--primary); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
}
.action .action-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); }
.action.is-primary .action-icon { background: var(--primary); color: var(--on-primary); }
.action[aria-pressed="true"] .action-icon { background: var(--sand-300); color: var(--ocean-900); }
.action:hover { background: var(--surface-2); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field, .field-row + .field, .field + .field-row { margin-top: var(--sp-4); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); align-items: end; }
.label { font-size: var(--fs-s); font-weight: 600; color: var(--text); }
.label .opt { font-weight: 400; color: var(--text-3); }
.hint { font-size: var(--fs-xs); color: var(--text-3); }
.error-text { font-size: var(--fs-xs); color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--radius-s);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: var(--fs-m);
}
.textarea { min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.select { appearance: none; padding-inline-end: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7b8c' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 18px; background-position: right 10px center; }
html[dir="rtl"] .select { background-position: left 10px center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-s); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }

/* Search field */
.search {
  position: relative; display: flex; align-items: center; gap: 4px; height: 48px; padding-inline: 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-m);
}
.search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.search .icon { color: var(--text-3); margin-inline: 6px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--text); }
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { display: none; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 12px;
  border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: var(--fs-s); font-weight: 550; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip .icon { width: 16px; height: 16px; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip .count { font-weight: 500; color: var(--text-3); font-size: var(--fs-xs); }
.chip[aria-pressed="true"] .count { color: inherit; opacity: .8; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 600; line-height: 18px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.badge-verified { background: var(--success-soft); color: var(--success); }
.badge-community { background: var(--secondary-soft); color: var(--secondary); }
.badge-unverified { background: var(--surface-3); color: var(--text-2); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-sample { background: var(--sand-100); color: #7a4a00; }

/* ---------- Cards, lists ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); }
.card-pad { padding: var(--sp-4); }
.section { padding: var(--sp-4); }
.section + .section { border-top: 1px solid var(--border); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-s); font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: var(--sp-3); }
.section-title a, .section-title button { text-transform: none; letter-spacing: 0; font-size: var(--fs-s); font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px var(--sp-4); min-height: 56px;
  background: none; border: 0; border-radius: 0; text-align: start; color: var(--text); text-decoration: none; cursor: pointer;
}
.list > li + li > .item { border-top: 1px solid var(--border); }
.item:hover { background: var(--surface-2); color: var(--text); }
.item-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; background: var(--text-3); }
.item-icon .icon { width: 18px; height: 18px; }
.item-icon.is-soft { background: var(--surface-3); color: var(--text-2); }
.item-body { flex: 1; min-width: 0; }
.item-title { display: block; font-weight: 600; font-size: var(--fs-m); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { display: block; font-size: var(--fs-s); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { font-size: var(--fs-xs); color: var(--text-3); flex: none; text-align: end; }
mark { background: color-mix(in srgb, var(--sand-300) 55%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tile {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 52px; border-radius: var(--radius-m);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; cursor: pointer; text-align: start;
}
.tile:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.tile .item-icon { width: 30px; height: 30px; }
.tile .item-icon .icon { width: 16px; height: 16px; }
.tile-label { font-size: var(--fs-s); font-weight: 600; line-height: 1.25; }
.tile-count { font-size: var(--fs-xs); color: var(--text-3); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: var(--fs-s); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.stat { padding: 12px; border-radius: var(--radius-m); background: var(--surface-2); }
.stat-value { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: var(--fs-xs); color: var(--text-3); }

/* ---------- Notices, empty states ---------- */
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-m); background: var(--primary-soft); color: var(--text); font-size: var(--fs-s); }
.notice .icon { color: var(--primary); margin-top: 1px; }
.notice-warning { background: var(--warning-soft); }
.notice-warning .icon { color: var(--warning); }
.notice-danger { background: var(--danger-soft); }
.notice-danger .icon { color: var(--danger); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: var(--sp-8) var(--sp-6); color: var(--text-2); }
.empty-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.empty-icon .icon { width: 26px; height: 26px; }
.empty h3 { font-size: var(--fs-l); color: var(--text); }
.empty p { font-size: var(--fs-s); max-width: 34ch; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: var(--radius-s); }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { flex: none; padding: 10px 12px; border: 0; background: none; color: var(--text-2); font-weight: 600; font-size: var(--fs-s); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; text-decoration: none; }
.tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.tab:hover { color: var(--text); }

/* ---------- Dialog, toast ---------- */
.dialog { border: 0; padding: 0; border-radius: var(--radius-l); background: var(--surface); color: var(--text); box-shadow: var(--shadow-3); width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.dialog::backdrop { background: var(--overlay); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 10px 20px; border-bottom: 1px solid var(--border); }
html[dir="rtl"] .dialog-head { padding: 14px 20px 10px 14px; }
.dialog-head h2 { font-size: var(--fs-l); }
.dialog-body { padding: 20px; overflow-y: auto; max-height: calc(100dvh - 160px); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.toast-region { position: fixed; inset-inline: 0; bottom: calc(var(--nav-h) + 16px); z-index: 4000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (min-width: 900px) { .toast-region { bottom: 24px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 480px; padding: 11px 16px; border-radius: var(--radius-m); background: var(--ocean-900); color: #fff; box-shadow: var(--shadow-2); font-size: var(--fs-s); animation: toast-in .2s var(--ease); }
:root[data-theme="dark"] .toast { background: #e6eef5; color: #0a2540; }
.toast.is-error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- App shell ---------- */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.app-header {
  height: var(--header-h); flex: none; display: flex; align-items: center; gap: var(--sp-4); padding-inline: var(--sp-4);
  background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 1200;
}
.main-nav { display: flex; align-items: center; gap: 2px; margin-inline-start: var(--sp-4); }
.main-nav a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: var(--radius-s); color: var(--text-2); text-decoration: none; font-weight: 600; font-size: var(--fs-s); }
.main-nav a:hover { background: var(--surface-2); color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.lang-btn { font-weight: 700; font-size: 13px; width: auto; padding: 0 10px; }
.app-body { position: relative; flex: 1; min-height: 0; display: flex; }

.panel {
  position: relative; z-index: 1100; width: var(--panel-w); flex: none; display: flex; flex-direction: column;
  background: var(--surface); border-inline-end: 1px solid var(--border); min-height: 0;
  transition: margin .25s var(--ease);
}
.panel-search { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.panel-content { flex: 1; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.panel-collapse { position: absolute; top: 12px; inset-inline-end: -29px; width: 28px; height: 44px; display: grid; place-items: center; border: 1px solid var(--border); border-inline-start: 0; background: var(--surface); border-radius: 0 var(--radius-s) var(--radius-s) 0; color: var(--text-2); cursor: pointer; box-shadow: var(--shadow-1); }
html[dir="rtl"] .panel-collapse { border-radius: var(--radius-s) 0 0 var(--radius-s); border-inline-start: 1px solid var(--border); border-inline-end: 0; }
.app.panel-hidden .panel { margin-inline-start: calc(-1 * var(--panel-w)); }
.app.panel-hidden .panel-collapse .icon { transform: rotate(180deg); }
html[dir="rtl"] .panel-collapse .icon { transform: rotate(180deg); }
html[dir="rtl"] .app.panel-hidden .panel-collapse .icon { transform: none; }
.drag-handle { display: none; }

.map-wrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; background: #aad3df; direction: ltr; }
:root[data-theme="dark"] #map { background: #0d2236; }
.map-overlay-top { position: absolute; top: 12px; inset-inline-start: 12px; inset-inline-end: 64px; z-index: 900; pointer-events: none; }
.map-overlay-top > * { pointer-events: auto; }
.map-mobile-search { display: none; }
.map-chips { max-width: 100%; }
.map-chips .chip { box-shadow: var(--shadow-1); border-color: transparent; }
.map-chips .chip[aria-pressed="true"] { border-color: var(--primary); }

.map-controls { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 900; display: flex; flex-direction: column; gap: 8px; }
.ctl-group { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow-2); overflow: hidden; }
.ctl { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--text); cursor: pointer; }
.ctl + .ctl { border-top: 1px solid var(--border); }
.ctl:hover { background: var(--surface-2); }
.ctl[aria-pressed="true"] { color: var(--primary); }
.ctl.is-active { color: #fff; background: var(--ocean-600); }
.ctl:disabled { opacity: .5; }
.map-fab { position: absolute; z-index: 900; inset-inline-end: 12px; bottom: 24px; }
.fab-add { box-shadow: var(--shadow-2); border-radius: var(--radius-pill); padding-inline: 18px; min-height: 48px; }
.map-status { position: absolute; z-index: 900; left: 50%; transform: translateX(-50%); top: 60px; display: flex; align-items: center; gap: 8px; padding: 7px 14px; background: var(--surface); border-radius: var(--radius-pill); box-shadow: var(--shadow-2); font-size: var(--fs-s); color: var(--text-2); white-space: nowrap; }
.map-status .spinner { width: 16px; height: 16px; border-width: 2px; }
.zoom-hint { position: absolute; z-index: 800; left: 50%; transform: translateX(-50%); bottom: 24px; padding: 8px 14px; background: color-mix(in srgb, var(--ocean-900) 88%, transparent); color: #fff; border-radius: var(--radius-pill); font-size: var(--fs-s); pointer-events: none; white-space: nowrap; }

.bottom-nav { display: none; }

/* Panel views */
.view-head { padding: var(--sp-4) var(--sp-4) var(--sp-3); display: flex; flex-direction: column; gap: 6px; }
.view-head h1, .view-head h2 { font-size: var(--fs-xl); }
.view-head p { color: var(--text-2); font-size: var(--fs-s); }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: var(--fs-s); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.back-link:hover { color: var(--primary); }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: var(--fs-xs); color: var(--text-3); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--primary); text-decoration: underline; }
.place-head { padding: var(--sp-4) var(--sp-4) var(--sp-2); display: flex; flex-direction: column; gap: 8px; }
.place-cat { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-s); color: var(--text-2); font-weight: 600; }
.place-cat .cat-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.place-cat .cat-dot .icon { width: 15px; height: 15px; }
.place-name { font-size: var(--fs-2xl); font-weight: 700; overflow-wrap: anywhere; }
.place-loc { color: var(--text-2); font-size: var(--fs-s); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.coord-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.photo-strip { display: flex; gap: 8px; overflow-x: auto; }
.photo-strip img { width: 140px; height: 100px; object-fit: cover; border-radius: var(--radius-m); flex: none; background: var(--surface-2); }
.qr-box { display: grid; place-items: center; padding: 16px; background: #fff; border-radius: var(--radius-m); border: 1px solid var(--border); }
.qr-box svg { width: 220px; height: 220px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); font-size: var(--fs-s); color: var(--text-3); }
.cta-card { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius-m); background: var(--sand-100); color: #4a3200; }
:root[data-theme="dark"] .cta-card { background: #2e2414; color: #f4dcb6; }
.cta-card .icon { color: var(--coral-600); }
.cta-card .btn { margin-inline-start: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: var(--sp-4); font-size: var(--fs-xs); color: var(--text-3); border-top: 1px solid var(--border); }
.footer-links a { color: var(--text-3); }

/* ---------- Map markers ---------- */
.mk { background: none; border: 0; }
.mk-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ocean-700); border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(10, 37, 64, .25); }
.mk-dot.is-land { background: #94a3b8; }
.mk-pin { position: relative; width: 28px; height: 36px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.mk-pin svg.pin-shape { width: 28px; height: 36px; }
.mk-pin .icon { position: absolute; top: 6px; left: 7px; width: 14px; height: 14px; stroke: #fff; stroke-width: 2.2; }
.mk-selected .mk-pin { transform: scale(1.35); transform-origin: 50% 100%; }
.mk-island { display: flex; align-items: center; gap: 6px; transform: translate(-7px, -7px); white-space: nowrap; }
.mk-island .i-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--teal-400); border: 2.5px solid var(--ocean-800); flex: none; }
.mk-island .i-label { font-size: 12px; font-weight: 650; color: var(--ocean-900); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; pointer-events: none; }
.map-z-low .mk-island .i-label { display: none; }
.mk-user { width: 18px; height: 18px; border-radius: 50%; background: #1f77bd; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(31, 119, 189, .25); }
.mc { display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; font-size: 12px; background: color-mix(in srgb, var(--ocean-700) 88%, transparent); border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.mc.is-islands { background: color-mix(in srgb, var(--teal-700) 92%, transparent); }
.leaflet-container { font-family: var(--font); }
.leaflet-control-attribution { font-size: 10.5px; }
:root[data-theme="dark"] .leaflet-control-attribution { background: rgba(15, 31, 48, .8) !important; color: #b0bfcd; }
:root[data-theme="dark"] .leaflet-control-attribution a { color: #7fc1f5; }

.leaflet-tooltip.mk-tip { font-family: var(--font); font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: var(--radius-s); border: 0; box-shadow: var(--shadow-2); }

/* Layer switcher popover */
.popover { position: absolute; z-index: 950; inset-inline-end: 64px; top: 12px; width: 240px; background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow-3); padding: 12px; }
.popover h3 { font-size: var(--fs-s); margin-bottom: 8px; color: var(--text-2); }
.basemap-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.basemap-opt { display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 8px; border-radius: var(--radius-m); border: 2px solid var(--border); background: none; cursor: pointer; font-size: var(--fs-xs); font-weight: 600; color: var(--text); }
.basemap-opt[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); }
.basemap-opt .swatch { width: 100%; height: 48px; border-radius: var(--radius-s); }
.swatch-standard { background: linear-gradient(135deg, #aad3df 0 45%, #f2efe9 45% 70%, #c8e6c9 70%); }
.swatch-satellite { background: linear-gradient(135deg, #0f4c6b 0 40%, #2a8fa8 40% 60%, #e2d3a8 60% 68%, #3f6b3a 68%); }

/* ---------- Mobile layout ---------- */
@media (max-width: 899.98px) {
  .app-header { display: none; }
  .map-mobile-search { display: flex; gap: 8px; align-items: center; }
  .map-mobile-search .search { flex: 1; box-shadow: var(--shadow-2); border-color: transparent; }
  .map-mobile-search .brand-mark { width: 26px; height: 26px; margin-inline: 4px 2px; }
  .map-overlay-top { inset-inline-end: 12px; top: max(10px, env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 8px; }
  .map-controls { top: 118px; }
  .popover { top: 118px; }
  .map-status { top: 116px; }
  .app-body { position: absolute; inset: 0 0 var(--nav-h) 0; }
  .map-wrap { position: absolute; inset: 0; }
  .panel {
    position: absolute; inset-inline: 0; bottom: 0; width: auto; height: calc(100% - 64px); margin: 0 !important;
    border: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(10, 37, 64, .16);
    transform: translateY(calc(100% - var(--sheet-peek, 148px))); transition: transform .28s var(--ease);
    z-index: 1000; will-change: transform;
  }
  .panel.sheet-half { transform: translateY(48%); }
  .panel.sheet-full { transform: translateY(0); }
  .panel.is-dragging { transition: none; }
  .panel-search { display: none; }
  .panel-collapse { display: none; }
  .drag-handle { display: grid; place-items: center; flex: none; height: 26px; cursor: grab; touch-action: none; border: 0; background: none; width: 100%; }
  .drag-handle::before { content: ''; width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); }
  .map-fab { bottom: calc(var(--sheet-peek, 148px) + 12px); }
  .zoom-hint { bottom: calc(var(--sheet-peek, 148px) + 14px); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 1300;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); text-decoration: none; font-size: 10.5px; font-weight: 600; min-width: 0; }
  .bottom-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  .bottom-nav a[aria-current="page"] { color: var(--primary); }
  .bottom-nav a[aria-current="page"] .icon { stroke-width: 2.3; }
  .field-row { grid-template-columns: 1fr; }
  .place-name { font-size: var(--fs-xl); }
}
@media (max-width: 899.98px) and (max-height: 560px) {
  .panel { --sheet-peek: 110px; }
}
@media (min-width: 900px) and (max-width: 1180px) {
  :root { --panel-w: 360px; }
  .main-nav a span { display: none; }
  .brand-tagline { display: none; }
}

/* ---------- Static content pages ---------- */
.page { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface-2); }
.page-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.page-header .inner, .page-main, .page-footer .inner { width: min(1080px, 100% - 32px); margin-inline: auto; }
.page-header .inner { height: var(--header-h); display: flex; align-items: center; gap: 16px; }
.page-header nav { margin-inline-start: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.page-header nav a { padding: 6px 10px; border-radius: var(--radius-s); text-decoration: none; color: var(--text-2); font-weight: 600; font-size: var(--fs-s); }
.page-header nav a:hover { background: var(--surface-2); color: var(--text); }
.page-main { flex: 1; padding: var(--sp-8) 0; display: flex; flex-direction: column; gap: var(--sp-6); }
.page-main h1 { font-size: var(--fs-3xl); }
.page-main .lede { color: var(--text-2); font-size: var(--fs-l); max-width: 65ch; }
.page-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--sp-6); align-items: start; }
.page-footer { background: var(--surface); border-top: 1px solid var(--border); padding: var(--sp-6) 0; font-size: var(--fs-s); color: var(--text-3); }
.page-footer .inner { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.page-footer a { color: var(--text-2); }
.static-map { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); }
.prose { max-width: 72ch; }
.prose h2 { font-size: var(--fs-xl); margin: var(--sp-8) 0 var(--sp-3); }
.prose h3 { font-size: var(--fs-l); margin: var(--sp-5) 0 var(--sp-2); }
.prose p, .prose li { color: var(--text-2); margin: 0 0 var(--sp-3); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.prose th, .prose td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.columns { columns: 3 220px; column-gap: var(--sp-6); }
.columns li { break-inside: avoid; margin-bottom: 4px; }
@media (max-width: 760px) {
  .page-grid { grid-template-columns: 1fr; }
  .page-main h1 { font-size: var(--fs-2xl); }
  .page-header nav { display: none; }
}

/* ---------- Admin ---------- */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-side { background: var(--ocean-900); color: #dce7f2; padding: var(--sp-4) var(--sp-3); display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand-name, .admin-side .brand-tagline { color: #fff; }
.admin-side .brand { margin: 4px 8px 16px; }
.admin-side a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); color: #c3d3e3; text-decoration: none; font-size: var(--fs-s); font-weight: 550; }
.admin-side a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.admin-side a[aria-current="page"] { background: rgba(46, 196, 182, .16); color: #fff; }
.admin-side .side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7f97ad; margin: 14px 10px 4px; }
.admin-side .count-pill { margin-inline-start: auto; background: var(--coral-500); color: #fff; border-radius: var(--radius-pill); font-size: 11px; padding: 0 7px; font-weight: 700; }
.admin-main { min-width: 0; background: var(--surface-2); }
.admin-top { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.admin-top h1 { font-size: var(--fs-xl); }
.admin-content { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .input, .toolbar .select { width: auto; min-width: 160px; min-height: 36px; padding-block: 6px; font-size: var(--fs-s); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.table th { text-align: start; font-weight: 600; color: var(--text-2); background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-clickable { cursor: pointer; }
.table tr.is-clickable:hover td { background: var(--surface-2); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.edit-map { height: 280px; border-radius: var(--radius-m); border: 1px solid var(--border); }
.diff { display: grid; grid-template-columns: 140px 1fr 1fr; gap: 6px 12px; font-size: var(--fs-s); }
.diff .old { color: var(--danger); text-decoration: line-through; }
.diff .new { color: var(--success); }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .admin-side .side-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Location picker, misc ---------- */
.map-crosshair { display: none; position: absolute; left: 50%; top: 50%; z-index: 850; width: 34px; height: 44px; transform: translate(-50%, -100%); pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 36'%3E%3Cpath fill='%23e8604c' stroke='%23fff' stroke-width='1.6' d='M14 1C6.8 1 1 6.7 1 13.8c0 9.3 11.6 19.9 12.2 20.4a1.2 1.2 0 0 0 1.6 0C15.4 33.7 27 23.1 27 13.8 27 6.7 21.2 1 14 1z'/%3E%3Ccircle cx='14' cy='13.5' r='4.5' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
body.picking .map-crosshair { display: block; }
body.picking .map-fab { display: none; }
.mobile-only { display: none; }
@media (max-width: 899.98px) {
  .mobile-only { display: flex; }
}
.main-nav .icon { width: 18px; height: 18px; }
.header-actions .btn .icon { width: 16px; height: 16px; }
.map-wrap { isolation: isolate; }
@media (min-width: 900px) { .map-overlay-top { inset-inline-start: 44px; } }
@media (max-width: 899.98px) {
  .leaflet-bottom { bottom: var(--sheet-peek, 148px); }
  .app.picking-hide-chips .map-chips { display: none; }
}
#place-form > .field, #place-form > #dupes:not(:empty) { margin-top: var(--sp-4); }
.mk-island.k-resort .i-dot { background: var(--sand-300); border-color: #c2410c; }
.mk-island.k-industrial .i-dot, .mk-island.k-institutional .i-dot { background: #d6d3d1; border-color: #57534e; }
.mk-island.is-minor .i-dot { width: 9px; height: 9px; border-width: 2px; background: #e2e8f0; border-color: #94a3b8; }
.mk-island.is-minor .i-label { font-weight: 500; color: #475569; font-size: 11px; }
.map-z-mid .mk-island.is-minor .i-label { display: none; }
.map-z-mid .mk-island:not(.k-residential) .i-label { display: none; }

/* ---------- Island statistics dashboard ---------- */
.dash { display: flex; flex-direction: column; gap: 14px; }
.dash-hero-value { font-size: 48px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; color: var(--text); }
.dash-hero-label { font-size: var(--fs-s); color: var(--text-2); margin-top: 4px; }
.dash-na { color: var(--text-3); }
.kpi-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi { padding: 12px; border-radius: var(--radius-m); background: var(--surface-2); min-width: 0; }
.kpi-label { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }
.kpi-value { font-size: var(--fs-xl); font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-sub { font-size: var(--fs-xs); color: var(--text-3); }
.dash-meter-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: var(--fs-s); color: var(--text-2); margin-bottom: 6px; }
.meter { height: 8px; border-radius: 4px; background: var(--primary-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.dash-sub { font-size: var(--fs-m); margin-top: 4px; }
.fac-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fac { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon value" "label label" "meta meta"; align-items: center; column-gap: 8px; row-gap: 2px;
  padding: 10px 12px; border-radius: var(--radius-m); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: start; cursor: pointer; min-width: 0; }
.fac:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }
.fac:disabled { cursor: default; opacity: .7; }
.fac-icon { grid-area: icon; }
.fac-value { grid-area: value; font-size: var(--fs-xl); font-weight: 700; }
.fac-label { grid-area: label; font-size: var(--fs-s); font-weight: 600; }
.fac-meta { grid-area: meta; font-size: var(--fs-xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-note { font-size: var(--fs-xs); }

/* ---------- Places to stay ---------- */
.stay-cta { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-m); background: var(--primary-soft); color: var(--text); text-decoration: none; }
.stay-cta:hover { color: var(--text); filter: brightness(.98); }
.stay-cta > .icon:first-child { color: var(--primary); }
.stay-cta > span { flex: 1; min-width: 0; font-size: var(--fs-s); }
.more-filters summary { cursor: pointer; font-weight: 600; font-size: var(--fs-s); color: var(--primary); }
.price-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.price-row .input { min-width: 0; flex: 1; }
.price-row .select { width: 90px; flex: none; }
.stay-list > li + li > .stay { border-top: 1px solid var(--border); }
.stay { display: flex; gap: 12px; padding: 12px var(--sp-4); color: var(--text); text-decoration: none; }
.stay:hover { background: var(--surface-2); color: var(--text); }
.stay-thumb { width: 88px; height: 88px; flex: none; border-radius: var(--radius-m); background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--text-3); }
.stay-thumb img { width: 100%; height: 100%; object-fit: cover; }
.stay-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.stay-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stay-meta, .stay-facts { font-size: var(--fs-s); color: var(--text-3); }
.stay-facts { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.stay-amen { display: flex; flex-wrap: wrap; gap: 4px; }
.stay-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.stay-price { font-weight: 650; font-size: var(--fs-s); }
.stay-keyfacts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stay-keyfacts > div { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: var(--radius-m); background: var(--surface-2); min-width: 0; }
.stay-keyfacts strong { font-size: var(--fs-s); overflow-wrap: anywhere; }
.amen-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.amen { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-pill); background: var(--secondary-soft); color: var(--text); font-size: var(--fs-s); }
.amen .icon { color: var(--secondary); }
.amen-check { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.guide { border: 1px solid var(--border); border-radius: var(--radius-m); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.guide-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-m); }
.guide-title .icon { color: var(--primary); }
.guide-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-s); }
.guide-facts li { display: flex; gap: 8px; align-items: flex-start; }
.guide-facts .icon { margin-top: 2px; color: var(--text-3); }
.guide-rules { margin: 0; padding-inline-start: 18px; font-size: var(--fs-s); color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.guide-notes { font-size: var(--fs-s); white-space: pre-line; }
@media (max-width: 899.98px) { .amen-check { grid-template-columns: 1fr; } }

/* ---------- Transport operator forms ---------- */
.op-form > .field, .op-form > .field-row { margin-top: var(--sp-4); }
.route-card { border: 1px solid var(--border); border-radius: var(--radius-m); padding: 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 10px; }
.route-card .field + .field, .route-card .field-row + .field, .route-card .field + .field-row { margin-top: 0; }
.sched-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.sched-row .input { width: 104px; min-height: 36px; padding-block: 4px; }
.days { display: flex; flex-wrap: wrap; gap: 4px; }
.day { display: inline-flex; }
.day input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day span { padding: 3px 7px; border-radius: var(--radius-s); border: 1px solid var(--border); font-size: var(--fs-xs); cursor: pointer; }
.day input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.day input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (max-width: 899.98px) { .sched-row { grid-template-columns: 1fr 1fr auto; } .sched-row .days { grid-column: 1 / -1; } .sched-row .input { width: auto; } }

/* ==========================================================================
   Skin — modern professional look
   Colourful category tiles (tinted background + coloured glyph from --c),
   sentence-case headings, softer surfaces and consistent radii.
   ========================================================================== */
/* Plus Jakarta Sans has a narrow word space at heavier weights. */
body { letter-spacing: 0; word-spacing: .06em; }
:lang(dv), [lang="dv"] { word-spacing: normal; }
h1, h2, h3, h4 { letter-spacing: -.01em; font-weight: 700; }

/* Coloured icon tiles: set --c on the element */
.item-icon, .cat-tile-icon, .place-cat .cat-dot, .fac-icon, .action .action-icon, .empty-icon { --c: var(--primary); }
.item-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: color-mix(in srgb, var(--c) var(--tint), var(--surface));
  color: var(--c);
}
.item-icon .icon { width: 20px; height: 20px; stroke-width: 2; }
.item-icon.is-soft { --c: #64748b; }
:root[data-theme="dark"] .item-icon, :root[data-theme="dark"] .cat-tile-icon, :root[data-theme="dark"] .place-cat .cat-dot, :root[data-theme="dark"] .fac-icon { color: color-mix(in srgb, var(--c) 70%, #fff); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .item-icon, :root:not([data-theme="light"]) .cat-tile-icon, :root:not([data-theme="light"]) .place-cat .cat-dot, :root:not([data-theme="light"]) .fac-icon { color: color-mix(in srgb, var(--c) 70%, #fff); }
}

/* Header */
.app-header { box-shadow: 0 1px 0 var(--border); border-bottom: 0; gap: 20px; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.01em; color: var(--text); }
.brand-tagline { font-weight: 500; }
.main-nav { gap: 4px; }
.main-nav a { height: 40px; padding: 0 14px; border-radius: 10px; font-size: 14px; color: var(--text-2); }
.main-nav a .icon { color: var(--text-3); }
.main-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.main-nav a[aria-current="page"] .icon { color: var(--primary); }
.header-actions { gap: 6px; }
.header-actions .btn-primary { border-radius: 10px; padding-inline: 14px; min-height: 40px; font-size: 14px; }

/* Buttons */
.btn { border-radius: 10px; font-weight: 650; letter-spacing: .005em; }
.btn-primary { box-shadow: 0 1px 2px rgba(10, 91, 211, .25); }
.btn-outline { border-color: var(--border-strong); background: var(--surface); }
.icon-btn { border-radius: 10px; }

/* Panel and search */
.panel { box-shadow: 1px 0 0 var(--border); border-inline-end: 0; }
.panel-search { border-bottom: 0; padding-bottom: 6px; }
.search { border-radius: 14px; border-color: var(--border); background: var(--surface-2); height: 50px; }
.search:focus-within { background: var(--surface); }
.map-mobile-search .search { background: var(--surface); border-radius: 16px; }

/* Section headings: sentence case */
.section { padding: 18px var(--sp-4); }
.section + .section { border-top: 0; }
.section-title { text-transform: none; letter-spacing: 0; font-size: var(--fs-l); font-weight: 700; color: var(--text); margin-bottom: 12px; }
.section-title a, .section-title button { font-weight: 650; text-decoration: none; }
.view-head h1, .view-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.015em; }

/* Lists */
.item { min-height: 60px; padding-block: 10px; border-radius: 12px; }
.list > li + li > .item { border-top: 0; }
.list { padding-inline: 4px; }
.item:hover { background: var(--surface-2); }
.item-title { font-weight: 650; }

/* Category grid (home) */
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 4px; }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px 6px; border-radius: 14px; color: var(--text); text-decoration: none; text-align: center; min-width: 0; }
.cat-tile:hover { background: var(--surface-2); color: var(--text); }
.cat-tile-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); color: var(--c); transition: transform .15s var(--ease); }
.cat-tile:hover .cat-tile-icon { transform: translateY(-1px); }
.cat-tile-icon .icon { width: 24px; height: 24px; stroke-width: 2; }
.cat-tile-label { font-size: 12.5px; font-weight: 650; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-tile-count { font-size: 11px; color: var(--text-3); margin-top: -4px; }

/* Generic tiles */
.tile { border-radius: 14px; border-color: var(--border); }
.tile .item-icon { width: 36px; height: 36px; border-radius: 11px; }

/* Chips: coloured glyph, filled with the category colour when active */
.chip { --c: var(--primary); height: 36px; border-radius: 999px; font-weight: 600; border-color: var(--border); }
.chip .icon { color: var(--c); }
.chip[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.chip[aria-pressed="true"] .icon { color: #fff; }
.chip[aria-pressed="true"] .count { color: rgba(255, 255, 255, .85); }
.map-chips .chip { background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 2px 8px rgba(16, 24, 40, .08); border-color: transparent; }
.map-chips .chip[aria-pressed="true"] { background: var(--c); border-color: var(--c); }

/* Map controls */
.ctl-group { border-radius: 14px; box-shadow: 0 2px 10px rgba(16, 24, 40, .12); }
.ctl { width: 46px; height: 46px; }
.ctl.is-active { background: var(--primary); }
.zoom-hint { background: rgba(11, 19, 36, .82); backdrop-filter: blur(6px); font-weight: 600; }
.map-status { font-weight: 600; }

/* Map markers */
.mc { background: var(--ocean-700); border: 0; box-shadow: 0 0 0 5px color-mix(in srgb, var(--ocean-700) 28%, transparent), 0 2px 6px rgba(0, 0, 0, .25); font-weight: 800; }
.mc.is-islands { background: var(--teal-600); box-shadow: 0 0 0 5px color-mix(in srgb, var(--teal-600) 30%, transparent), 0 2px 6px rgba(0, 0, 0, .25); }
.mk-dot { background: #475569; width: 9px; height: 9px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, .25); }
.mk-island .i-dot { background: var(--teal-400); border-color: #fff; box-shadow: 0 0 0 1.5px var(--teal-700); }
.mk-island .i-label { font-weight: 700; color: #0b1324; }

/* Place details */
.place-name { font-size: 28px; font-weight: 800; letter-spacing: -.015em; }
.place-cat .cat-dot { width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); color: var(--c); }
.place-cat .cat-dot .icon { width: 17px; height: 17px; stroke-width: 2.1; }
.place-cat { color: var(--text-2); }
.action { color: var(--text-2); font-weight: 650; }
.action .action-icon { width: 48px; height: 48px; border-radius: 16px; background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); color: var(--c); }
.action[data-action="directions"] .action-icon { background: var(--primary); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 35%, transparent); }
.action[data-action="save"] .action-icon { --c: #d97706; }
.action[data-action="share"] .action-icon { --c: #0d9488; }
.action[data-action="qr"] .action-icon { --c: #7c3aed; }
.action[aria-pressed="true"] .action-icon { background: #f59e0b; color: #fff; }
.action:hover { background: transparent; }
.action:hover .action-icon { filter: brightness(.96); }

/* Cards and statistics */
.card { border-radius: 14px; border-color: var(--border); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.kpi-value { letter-spacing: -.02em; }
.dash-hero-value { font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.fac { border-radius: 14px; }
.fac-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); color: var(--c); }
.fac-icon .icon { width: 18px; height: 18px; stroke-width: 2; }
.meter { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.stat { border-radius: 14px; }

/* Calls to action, notices, empty states */
.stay-cta { background: color-mix(in srgb, var(--teal-600) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--teal-600) 22%, var(--border)); border-radius: 16px; padding: 14px 16px; }
.stay-cta > .icon:first-child { width: 44px; height: 44px; padding: 10px; border-radius: 13px; background: var(--teal-600); color: #fff; box-sizing: border-box; }
.cta-card { border-radius: 16px; }
.notice { border-radius: 12px; }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); color: var(--c); }
.badge { font-weight: 650; }
.footer-links { border-top: 0; }

/* Bottom navigation: active indicator pill */
.bottom-nav { box-shadow: 0 -1px 0 var(--border); border-top: 0; }
.bottom-nav a { gap: 4px; color: var(--text-3); font-size: 11px; font-weight: 650; }
.bottom-nav a .icon { width: 22px; height: 22px; padding: 4px 18px; box-sizing: content-box; border-radius: 999px; transition: background .15s var(--ease); }
.bottom-nav a[aria-current="page"] { color: var(--text); }
.bottom-nav a[aria-current="page"] .icon { background: var(--primary-soft); color: var(--primary); }

/* Mobile sheet */
@media (max-width: 899.98px) {
  .panel { border-radius: 22px 22px 0 0; box-shadow: 0 -6px 24px rgba(16, 24, 40, .14); }
  .drag-handle::before { width: 44px; height: 5px; background: var(--border-strong); }
  .map-chips .chip { height: 38px; }
}

/* Static pages */
.page { background: var(--bg); }
.page-header { box-shadow: 0 1px 0 var(--border); border-bottom: 0; }
.kpi-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.kpi-icon { --c: var(--primary); width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); color: var(--c); }
.kpi-icon .icon { width: 15px; height: 15px; stroke-width: 2.2; }

/* ---------- Navigation: per-tab colour (--c), Lucide icons ---------- */
.main-nav a, .bottom-nav a, .header-actions [data-nav] { --c: var(--primary); }
.main-nav a .icon { width: 19px; height: 19px; stroke-width: 2; color: var(--c); opacity: .85; }
.main-nav a:hover { background: color-mix(in srgb, var(--c) 8%, var(--surface)); color: var(--text); }
.main-nav a:hover .icon { opacity: 1; }
.main-nav a[aria-current="page"] { background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: var(--text); }
.main-nav a[aria-current="page"] .icon { color: var(--c); opacity: 1; }
.header-actions [data-nav] .icon { color: var(--c); stroke-width: 2; width: 22px; height: 22px; }
.header-actions [data-nav][aria-current="page"] { background: color-mix(in srgb, var(--c) 13%, var(--surface)); }

.bottom-nav a .icon { stroke-width: 2; color: color-mix(in srgb, var(--c) 75%, var(--text-3)); }
.bottom-nav a[aria-current="page"] { color: var(--text); }
.bottom-nav a[aria-current="page"] .icon { background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--c); }
:root[data-theme="dark"] .main-nav a .icon, :root[data-theme="dark"] .bottom-nav a .icon, :root[data-theme="dark"] .header-actions [data-nav] .icon { color: color-mix(in srgb, var(--c) 70%, #fff); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .main-nav a .icon, :root:not([data-theme="light"]) .bottom-nav a .icon, :root:not([data-theme="light"]) .header-actions [data-nav] .icon { color: color-mix(in srgb, var(--c) 70%, #fff); }
}
