/* DormHost — responsive, mobile-first. Tokens on :root; light is the default, dark follows the OS
   (or [data-theme="dark"]). Every colour used in a component comes from these tokens. */
:root {
  /* brand: DormHost blue, with a warm amber accent for calls to action */
  --brand: #0279b8;
  --brand-600: #026196;
  --brand-50: #ecf7fd;
  --accent: #c2410c;
  --accent-600: #9a3412;
  --sky: #38bdf8;
  --sky-100: #e0f2fe;
  --navy: #0b2545;
  --on-brand: #ffffff;
  --on-accent: #ffffff;
  /* surfaces: a cool, airy canvas with white cards that lift off it */
  --bg: #f2f7fb;
  --surface-2: #f8fbfe;
  --card: #ffffff;
  --pill-bg: #ffffff;
  --input-bg: #ffffff;
  --ink: #0c2236;
  --ink-2: #37506a;
  --muted: #5a6f84;
  --line: #dbe8f3;
  --line-2: #edf5fb;
  /* status */
  --ok: #17663f;
  --ok-bg: #e3f5ea;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --danger: #b42318;
  --danger-bg: #fde8e6;
  --info: #075985;
  --info-bg: #e0f2fe;
  --dark: #0b2545;
  /* elevation: soft, brand-tinted shadows */
  --shadow-sm: 0 1px 2px rgba(12, 60, 100, .06);
  --shadow: 0 12px 30px -14px rgba(12, 60, 110, .22);
  --shadow-lg: 0 28px 60px -22px rgba(12, 60, 110, .32);
  --radius: 16px;
  --radius-sm: 12px;
  --hero-a: #0279b8;
  --hero-b: #0b2545;
  --hero-glow: rgba(56, 189, 248, .35);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Sinhala", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #38bdf8;
    --brand-600: #7dd3fc;
    --brand-50: #0f2b40;
    --accent: #fb923c;
    --accent-600: #fdba74;
    --sky-100: #16324a;
    --navy: #eaf4fb;
    --on-brand: #04202f;
    --on-accent: #2a1204;
    --bg: #07111c;
    --surface-2: #0d1a29;
    --card: #0f1d2c;
    --pill-bg: #14273a;
    --input-bg: #0b1826;
    --ink: #eaf4fb;
    --ink-2: #b9cfdf;
    --muted: #8fa6ba;
    --line: #1d3349;
    --line-2: #152739;
    --ok: #4ade80;
    --ok-bg: #0f2e1d;
    --warn: #fbbf24;
    --warn-bg: #352809;
    --danger: #f87171;
    --danger-bg: #3b1515;
    --info: #7dd3fc;
    --info-bg: #13283f;
    --dark: #1e3a52;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 14px 34px -14px rgba(0, 0, 0, .65), 0 0 0 1px rgba(56, 189, 248, .04);
    --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, .8), 0 0 0 1px rgba(56, 189, 248, .08);
    --hero-a: #0c4a6e;
    --hero-b: #050d17;
    --hero-glow: rgba(56, 189, 248, .22);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #38bdf8; --brand-600: #7dd3fc; --brand-50: #0f2b40; --accent: #fb923c; --accent-600: #fdba74;
  --sky-100: #16324a; --navy: #eaf4fb; --on-brand: #04202f; --on-accent: #2a1204;
  --bg: #07111c; --surface-2: #0d1a29; --card: #0f1d2c; --pill-bg: #14273a; --input-bg: #0b1826;
  --ink: #eaf4fb; --ink-2: #b9cfdf; --muted: #8fa6ba; --line: #1d3349; --line-2: #152739;
  --ok: #4ade80; --ok-bg: #0f2e1d; --warn: #fbbf24; --warn-bg: #352809; --danger: #f87171; --danger-bg: #3b1515;
  --info: #7dd3fc; --info-bg: #13283f; --dark: #1e3a52;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 14px 34px -14px rgba(0, 0, 0, .65), 0 0 0 1px rgba(56, 189, 248, .04);
  --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, .8), 0 0 0 1px rgba(56, 189, 248, .08);
  --hero-a: #0c4a6e; --hero-b: #050d17; --hero-glow: rgba(56, 189, 248, .22); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, .brand { font-family: var(--font); line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(1.5rem, 2.4vw + 1rem, 2.1rem); font-weight: 800; }
h2 { font-size: clamp(1.15rem, 1vw + .9rem, 1.4rem); font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
h4 { font-size: .95rem; font-weight: 700; }
p { margin: 0 0 .8em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--line-2); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.strong { font-weight: 700; }
.block { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 60%, transparent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 640px; }
.section { padding-top: 36px; }
.view { min-height: calc(100vh - 140px); }
.hidden, [hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; padding: 10px 18px;
  font-family: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; cursor: pointer; white-space: nowrap;
  background: var(--card); color: var(--ink); transition: transform .08s, background .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn .ic { width: 1.1em; height: 1.1em; }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.btn-primary:hover { background: var(--brand-600); color: var(--on-brand); }
.btn-accent { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 22px -10px rgba(194, 65, 12, .55); }
.btn-accent:hover { background: var(--accent-600); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); box-shadow: none; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost-light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); box-shadow: none; }
.btn-ghost-light:hover { background: rgba(255,255,255,.22); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; box-shadow: none; }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.link-accent { color: var(--accent-600) !important; font-weight: 700; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; flex: none;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; margin-right: 6px; vertical-align: -3px; }
.spinner.big { width: 36px; height: 36px; border-width: 3px; color: var(--brand); margin: 40px auto; display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { text-align: center; padding: 40px 0; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; height: 68px; display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.2rem; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; }
.brand-mark .ic { width: 20px; height: 20px; }
.brand-name b { color: var(--accent); }
.top-links { display: flex; gap: 4px; margin-left: 8px; }
.top-links a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.top-links a:hover { background: var(--line-2); text-decoration: none; }
.top-links a.active { color: var(--brand); background: var(--brand-50); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); }
.user-chip:hover { text-decoration: none; border-color: var(--brand); }
.user-meta { display: flex; flex-direction: column; line-height: 1.1; }
.user-meta b { font-size: .88rem; }
.user-meta small { color: var(--muted); text-transform: capitalize; font-size: .72rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.avatar-lg { width: 46px; height: 46px; font-size: 1rem; }

/* ---------- mobile tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: none; background: var(--card); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); font-family: inherit; font-weight: 600; font-size: .7rem; line-height: 1.1; background: none; border: 0; border-radius: 12px; cursor: pointer; }
.tabbar a:hover, .tabbar button:hover { text-decoration: none; }
.tabbar .ic { width: 22px; height: 22px; }
.tabbar a.active { color: var(--brand); background: var(--brand-50); }
.tabbar { display: flex; }

/* ---------- pills, chips, notices ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--pill-bg); color: var(--ink); box-shadow: var(--shadow-sm); }
.pill .ic { width: 14px; height: 14px; }
.pill-cat { color: var(--ink); }
.pill-ok { background: #16a34a; color: #fff; }
.pill-dark { background: var(--dark); color: #fff; }
.pill-muted { background: var(--line); color: var(--ink-2); }
.pill-archived, .pill-published { }
.pill-draft { background: var(--line); }
.chip { display: inline-flex; align-items: center; font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-danger { background: var(--danger-bg); color: var(--danger); }
.chip-dark { background: var(--dark); color: #fff; }
.chip-muted { background: var(--line-2); color: var(--muted); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--line-2); margin: 14px 0; }
.notice .ic { color: var(--brand); margin-top: 2px; }
.notice-warn { background: var(--warn-bg); } .notice-warn .ic { color: var(--warn); }
.notice-info { background: var(--info-bg); } .notice-info .ic { color: var(--info); }
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--line-2); padding: 6px 12px; border-radius: 999px; font-size: .88rem; color: var(--ink-2); margin: 0 6px 6px 0; }
.tag .ic { color: var(--ok); width: 14px; height: 14px; }
.tags { display: flex; flex-wrap: wrap; }
.stars { display: inline-flex; gap: 1px; color: var(--line); }
.stars .ic { width: 15px; height: 15px; }
.stars .on { color: #f5a524; }
.stars.sm .ic { width: 12px; height: 12px; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink); font-size: .9rem; }
.rating .ic { width: 15px; height: 15px; color: #f5a524; fill: #f5a524; }
.rating small { color: var(--muted); font-weight: 500; }
.rating.lg { font-size: 1rem; }
.verified { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-weight: 700; font-size: .82rem; }
.verified .ic { width: 16px; height: 16px; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); display: inline-block; margin: 0 4px; vertical-align: middle; }
.dot-on { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-right: 6px; }
.dot-off { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin-right: 6px; }

/* ---------- hero & home ---------- */
.hero { background: radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%), linear-gradient(180deg, var(--brand-50), var(--bg)); padding: 36px 0 28px; }
.hero-grid { display: grid; gap: 28px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; background: var(--card); color: var(--brand); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: .8rem; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.eyebrow .ic { width: 15px; height: 15px; }
.eyebrow.light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.hero h1 { font-size: clamp(1.9rem, 4vw + .6rem, 3.1rem); font-weight: 800; letter-spacing: -.02em; }
.lead { font-size: 1.05rem; color: var(--ink-2); max-width: 56ch; }
.search-card { display: grid; grid-template-columns: 1fr; gap: 8px; background: var(--card); border-radius: 22px; padding: 10px; box-shadow: var(--shadow-lg); margin: 22px 0 18px; border: 1px solid var(--line); }
.field { display: flex; align-items: center; gap: 8px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; min-height: 48px; color: var(--muted); }
.field .ic { width: 18px; height: 18px; flex: none; }
.field input, .field select { border: 0; background: transparent; color: var(--ink); font: inherit; width: 100%; min-width: 0; padding: 12px 0; outline: none; }
.field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.field-grow { flex: 1; }
.search-go { min-height: 50px; }
.search-go span { display: inline; }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 18px; justify-content: start; margin-top: 8px; }
.hero-stats b { display: block; font-size: 1.25rem; color: var(--ink); }
.hero-stats span { color: var(--muted); font-size: .8rem; }
.hero-art { display: none; }
.hero-svg { width: 100%; height: auto; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head p { margin: 0; }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cat-tile { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.cat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.cat-tile b { font-size: .98rem; }
.cat-tile small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.cat-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; margin-bottom: 4px; }
.cat-icon .ic { width: 22px; height: 22px; }
.bg-teal { background: linear-gradient(135deg, #0b7a75, #49b6a7); }
.bg-violet { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.bg-orange { background: linear-gradient(135deg, #ea580c, #fb923c); }
.bg-blue { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.bg-green { background: linear-gradient(135deg, #16a34a, #4ade80); }
.bg-cyan { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.bg-pink { background: linear-gradient(135deg, #d946ef, #f0abfc); }
.bg-slate { background: linear-gradient(135deg, #475569, #94a3b8); }
.steps-grid { display: grid; gap: 14px; margin-top: 14px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step > .ic { width: 34px; height: 34px; color: var(--brand); background: var(--brand-50); padding: 7px; border-radius: 12px; margin-bottom: 10px; }
.owner-cta { display: grid; gap: 24px; align-items: center; background: linear-gradient(135deg, var(--brand), #0a5c58); color: #fff; border-radius: 24px; padding: 28px; overflow: hidden; }
.owner-cta h2, .owner-cta p { color: #fff; }
.owner-cta p { opacity: .92; max-width: 60ch; }
.owner-art svg { width: 100%; max-width: 360px; margin: 0 auto; display: block; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* illustration palette used by inline SVG art (illustrationSvg) */
.art .art-a { fill: color-mix(in srgb, var(--brand) 22%, var(--card)); stroke: none; }
.art .art-b:not([fill="none"]) { fill: var(--brand); stroke: none; }
.art .art-b[fill="none"] { fill: none; stroke: var(--brand); stroke-width: 5; stroke-linecap: round; }
.art .art-c:not([fill="none"]) { fill: var(--accent); stroke: none; }
.art .art-c[fill="none"] { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
.art rect.art-a { stroke: none; }
.art path.art-a { stroke: none; }
.art circle.art-c { fill: var(--accent); }
.art .art-b.art-b-stroke { stroke: var(--brand); }

/* ---------- listing cards ---------- */
.grid { display: grid; gap: 16px; }
.grid.listings { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.groups { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.card.pad { padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.listing { display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.listing:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.listing-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--line-2); overflow: hidden; }
.listing-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.listing:hover .listing-media img { transform: scale(1.04); }
.listing-media .pill { position: absolute; top: 12px; left: 12px; }
.listing-media .pill + .pill { left: auto; right: 12px; top: 12px; }
.listing-media .pill-cat { top: auto; bottom: 12px; left: 12px; right: auto; }
.listing-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; color: var(--ink); flex: 1; }
.listing-body:hover { text-decoration: none; }
.listing-title { font-size: 1rem; margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.loc { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; margin: 0; }
.loc .ic { width: 15px; height: 15px; flex: none; }
.loc.lg { font-size: 1rem; }
.price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price strong { font-size: 1.12rem; color: var(--ink); font-weight: 800; }
.price span { color: var(--muted); font-size: .85rem; }
.price.big strong { font-size: 1.6rem; }
.facts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink-2); font-size: .86rem; margin-top: 4px; }
.facts .ic { width: 16px; height: 16px; color: var(--muted); }
.listing-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); gap: 8px; }
.fav { position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--pill-bg); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.fav .ic { width: 19px; height: 19px; }
.fav.on { color: #e11d48; }
.fav.on .ic { fill: #e11d48; }
.listing .fav { top: auto; bottom: auto; }
.listing-media + .fav { top: 56px; }
.mini-stats { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; margin-top: 8px; }
.mini-stats b { color: var(--ink); }
.manage .listing-body { gap: 6px; }

/* ---------- search ---------- */
.search-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 16px 0; position: sticky; top: 68px; z-index: 20; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters .btn { min-height: 48px; }
/* Phones: keyword, area, beds and the button take a full row; minimum and maximum rent sit side by side. */
@media (max-width: 639.98px) {
  .filters > .field-grow, .filters > .loc-field, .filters > .field:nth-of-type(4), .filters > .btn { grid-column: span 2; }
}
/* Location picker on search: type to narrow; the panel lists provinces, districts and towns with listing counts. */
.loc-field { position: relative; }
.loc-clear { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-right: -6px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.35rem; line-height: 1; cursor: pointer; }
.loc-clear:hover, .loc-clear:focus-visible { background: var(--line); color: var(--ink); outline: none; }
.loc-clear[hidden] { display: none; }
.loc-panel { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 300px; max-height: min(70vh, 540px); overflow-y: auto; z-index: 40; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.loc-panel[hidden] { display: none; }
.loc-group { margin: 12px 8px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.loc-grid { display: grid; gap: 2px; }
.loc-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.loc-opt:hover, .loc-opt:focus-visible { background: color-mix(in srgb, var(--brand) 10%, transparent); outline: none; }
.loc-opt > span { display: grid; min-width: 0; }
.loc-opt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-opt small { color: var(--muted); font-size: .78rem; }
.loc-opt em { flex: none; font-style: normal; font-size: .82rem; color: var(--ink-2); white-space: nowrap; }
.loc-opt.none em { color: var(--muted); }
.loc-all { font-weight: 700; color: var(--brand); border-radius: 10px 10px 0 0; }
.loc-empty { margin: 8px; color: var(--muted); }
@media (min-width: 640px) { .loc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.type-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: .88rem; white-space: nowrap; background: var(--card); }
.type-chip .ic { width: 16px; height: 16px; }
.type-chip.on, .type-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); text-decoration: none; }
.results { padding-top: 22px; padding-bottom: 40px; }
.results-bar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.results-bar p { margin: 0; }
.results-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .86rem; cursor: pointer; background: var(--card); color: var(--ink-2); }
.toggle input { accent-color: var(--brand); margin: 0; }
.toggle:has(input:checked) { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.sort { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.sort select { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; background: var(--card); color: var(--ink); font: inherit; font-size: .86rem; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.empty { text-align: center; padding: 36px 16px; }
.empty-art { width: min(240px, 70%); margin: 0 auto 12px; }
.empty h3 { margin-bottom: 6px; }
.empty p { max-width: 42ch; margin: 0 auto 14px; }
.empty-art .art { width: 100%; height: auto; }
.page-empty { text-align: center; padding: 60px 0; }
.page-empty .empty-art { width: 200px; }

/* ---------- property detail ---------- */
.detail { padding-top: 18px; padding-bottom: 40px; }
.crumbs { display: flex; gap: 8px; font-size: .86rem; color: var(--muted); flex-wrap: wrap; margin-bottom: 10px; }
.crumbs span:last-child { color: var(--ink-2); }
.detail-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 14px; }
.detail-head h1 { margin: 0 0 6px; font-size: clamp(1.4rem, 2.2vw + .8rem, 2rem); }
.detail-actions { display: flex; gap: 10px; align-items: center; }
.gallery { display: grid; grid-template-columns: 1fr; gap: 8px; border-radius: 20px; overflow: hidden; }
.gallery img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--line-2); }
.gallery-main { aspect-ratio: 16 / 10 !important; }
.detail-grid { display: grid; gap: 28px; margin-top: 22px; }
.fact-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 8px; }
.fact-row.slim { margin: 12px 0; }
.fact { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); padding: 14px; border-radius: var(--radius-sm); }
.fact > .ic { width: 22px; height: 22px; color: var(--brand); }
.fact b { display: block; }
.fact small { color: var(--muted); font-size: .8rem; }
.block-title { margin-top: 26px; }
.block { margin-top: 26px; }
.detail-main .block:first-of-type { margin-top: 18px; }
.prose { color: var(--ink-2); white-space: pre-line; }
.bills { display: flex; flex-wrap: wrap; gap: 8px; }
.bills span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--line-2); color: var(--muted); font-size: .88rem; text-decoration: line-through; text-decoration-color: transparent; }
.bills span.on { background: var(--ok-bg); color: var(--ok); text-decoration: none; }
.bills .ic { width: 16px; height: 16px; }
.map-card { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.map-card > .ic { color: var(--accent); width: 28px; height: 28px; flex: none; }
.map-card p { margin: 4px 0 6px; }
.reply { background: var(--brand-50); border-radius: var(--radius-sm); padding: 12px; margin: 10px 0; color: var(--ink-2); }
.review { border-bottom: 1px solid var(--line-2); padding: 14px 0; }
.review-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.review p { margin: 0; color: var(--ink-2); }
.review-form { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 10px; }
.review-form h4 { margin: 0; }
.detail-side { position: relative; }
.price-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.owner-box { display: flex; gap: 12px; align-items: center; margin: 14px 0; padding: 12px; border-radius: var(--radius-sm); background: var(--ok-bg); color: var(--ok); }
.owner-box .ic { width: 28px; height: 28px; }
.owner-box b { color: var(--ink); display: block; }
.owner-box small { color: var(--ok); font-weight: 600; }
.enquiry-cta { display: grid; gap: 10px; }
.mobile-cta { display: none; }
.stack { display: grid; gap: 14px; }
.stack > .field-stack { font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.field-stack { display: grid; gap: 6px; }
.field-stack input, .field-stack select, .field-stack textarea, .stack input, .stack select, .stack textarea, .inline-form input, .toolbar input, .toolbar select, .unit-row input, .sort select, .toolbar .field input {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--input-bg); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; min-width: 0; width: 100%;
}
.field-stack input:focus, .field-stack select:focus, .field-stack textarea:focus, .stack input:focus, .stack select:focus, .stack textarea:focus, .unit-row input:focus, .toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.field-stack input:disabled { opacity: .7; }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 1; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 76px; background: color-mix(in srgb, var(--bg) 90%, transparent); padding: 12px 0; backdrop-filter: blur(6px); z-index: 5; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg label { position: relative; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: .86rem; color: var(--ink-2); cursor: pointer; }
.seg a:hover { text-decoration: none; }
.seg a.on { background: var(--card); color: var(--brand); box-shadow: var(--shadow-sm); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--card); color: var(--brand); box-shadow: var(--shadow-sm); }
.enquire-hint { margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--line-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: 9px 10px; }
.table small { font-size: .78rem; }
.muted-row td { opacity: .6; }
.msg { max-width: 260px; color: var(--ink-2); }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* Phones: row buttons such as "Report an issue" are touch targets, so make them 44 px tall. */
@media (max-width: 639.98px) { .row-actions .btn-sm { min-height: 44px; } }
.row-actions.wrap { flex-wrap: wrap; }
.row-card { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.people { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.people li { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; flex-wrap: wrap; }
.people li > div { flex: 1; min-width: 160px; }
.people small { display: block; color: var(--muted); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0 6px; }
.inline-form .field { flex: 1; min-width: 220px; }
.narrow-form { max-width: 520px; }
.defs { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0 0 12px; }
.defs dt { color: var(--muted); }
.defs dd { margin: 0; font-weight: 600; }

/* detail tabs (owner property) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 18px; scrollbar-width: none; }
.tabs a { padding: 12px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.unit-row { display: grid; grid-template-columns: 2fr 1fr .8fr 1fr auto; gap: 8px; align-items: center; }
.cat-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cat-opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--card); font-weight: 600; }
.cat-opt input { position: absolute; opacity: 0; }
.cat-opt .cat-icon { width: 36px; height: 36px; margin: 0; border-radius: 11px; }
.cat-opt .cat-icon .ic { width: 18px; height: 18px; }
.cat-opt:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.cat-opt:focus-within { outline: 2px solid var(--brand); }
.roles { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.roles legend { font-weight: 700; font-size: .88rem; color: var(--ink-2); margin-bottom: 8px; }
.role-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 14px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--card); }
.role-card input { position: absolute; opacity: 0; }
.role-card b { font-size: .9rem; }
.role-card small { color: var(--muted); font-size: .72rem; line-height: 1.2; }
.role-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.role-card:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.file-drop { display: flex; align-items: center; gap: 10px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 14px; cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: .9rem; position: relative; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop:hover { border-color: var(--brand); color: var(--brand); }
.file-drop.big { flex-direction: column; text-align: center; padding: 28px; min-height: 140px; justify-content: center; }
.file-drop .ic { width: 26px; height: 26px; }
.upload-box { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; margin-bottom: 14px; }
.upload-box .file-drop { flex: 1; min-width: 240px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.photo { position: relative; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo .pill { position: absolute; left: 8px; top: 8px; }
.photo .btn { width: calc(100% - 16px); margin: 8px; }
.photo .icon-btn { position: absolute; top: 8px; right: 8px; background: var(--card); }
.photo.is-cover { border-color: var(--ok); }
.month-pick { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; background: var(--card); color: var(--muted); min-height: 42px; }
.month-pick input { border: 0; background: transparent; font: inherit; color: var(--ink); font-weight: 600; padding: 8px 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .field { flex: 1; min-width: 220px; background: var(--card); }
.toolbar > select { min-width: 160px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; background: var(--card); color: var(--ink); font: inherit; }
.toolbar input[name=month] { font-weight: 600; }
.toolbar .field input { border: 0; box-shadow: none; padding: 11px 0; }
.toolbar .field input:focus { box-shadow: none; }
.toolbar .field { border-radius: 12px; }

/* ---------- auth ---------- */
.auth { display: grid; gap: 24px; max-width: 980px; margin: 24px auto; padding: 0 16px; }
.auth-art { display: none; background: linear-gradient(160deg, var(--brand), #0a5c58); color: #fff; border-radius: 24px; padding: 28px; align-self: stretch; }
.auth-art h2 { color: #fff; margin-top: 12px; }
.auth-art p { opacity: .9; }
.auth-art .art { width: 100%; max-width: 280px; height: auto; margin: 0 auto; display: block; }
.auth-art .art-a { fill: rgba(255,255,255,.25); } .auth-art .art-b { fill: #ffffff; } .auth-art .art-c { fill: #ffd27a; }
.auth-art .art-b[fill="none"] { stroke: #fff; } .auth-art .art-c[fill="none"] { stroke: #ffd27a; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 26px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 16px; }
.auth-card form { margin-bottom: 14px; }
.demo-box { background: var(--line-2); border-radius: var(--radius-sm); padding: 12px; font-size: .86rem; margin-top: 12px; }
.demo-box .link { font-weight: 600; }
.auth-wide .auth-card { order: 2; }

/* ---------- plan cards ---------- */
.plan-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 16px 0; }
.plan-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.plan-card.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.plan-card.current { background: var(--brand-50); }
.plan-card h3 { font-size: 1.25rem; margin: 0; }
.ribbon { position: absolute; top: 14px; right: 14px; background: var(--accent); color: var(--on-accent); font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.checks { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 7px; font-size: .92rem; }
.checks li { display: flex; gap: 8px; align-items: center; }
.checks li .ic { width: 16px; height: 16px; color: var(--ok); flex: none; }
.checks li.off { color: var(--muted); }
.checks li.off .ic { color: var(--muted); }
.current-plan { display: grid; gap: 18px; margin-bottom: 14px; }
.usage-grid { display: grid; gap: 12px; }
.usage-row { display: grid; gap: 6px; }
.usage-row > div:first-child { display: flex; justify-content: space-between; font-size: .88rem; color: var(--ink-2); }
.usage-row b { color: var(--ink); }
.meter { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; flex: 1; min-width: 60px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #49b6a7); border-radius: 999px; }
.meter.warn span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.meter.danger span { background: linear-gradient(90deg, #dc2626, #f87171); }
.bar-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; margin: 8px 0; font-size: .88rem; }
.bar-row span { color: var(--ink-2); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row b { text-align: right; }
.two-col { display: grid; gap: 16px; }
.two-col-inner { display: grid; gap: 22px; margin-top: 16px; }

/* ---------- dashboard ---------- */
.dash { display: block; }
.dash-main { min-width: 0; padding: 18px 16px 110px; max-width: 1200px; }
.side { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
/* Phones: three summary tiles in one column, so amounts such as "LKR 50,000" do not wrap and labels are not cut off. */
@media (max-width: 639.98px) { .kpis.three { grid-template-columns: 1fr; } }
.kpi { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); box-shadow: var(--shadow-sm); min-width: 0; }
.kpi:hover { text-decoration: none; border-color: var(--brand); }
.kpi > div { min-width: 0; }
.kpi small { display: block; color: var(--muted); font-size: .78rem; font-weight: 600; }
.kpi b { display: block; font-size: 1.2rem; font-weight: 800; overflow-wrap: anywhere; line-height: 1.2; }
.kpi em { font-style: normal; font-size: .78rem; color: var(--muted); display: block; overflow-wrap: anywhere; }
.kpi em.warn-t { color: var(--warn); font-weight: 600; }
.kpi-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.kpi-ic .ic { width: 20px; height: 20px; }
.dash-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.span-2 { grid-column: auto; }
.chart { width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--brand); }
.chart .bar:hover { fill: var(--accent); }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.donut-wrap { display: flex; gap: 16px; align-items: center; }
.donut { width: 130px; height: 130px; flex: none; }
.donut .ring { fill: none; stroke: var(--line-2); stroke-width: 14; }
.donut .ring-on { fill: none; stroke: var(--brand); stroke-width: 14; stroke-linecap: round; }
.donut-n { font-size: 18px; font-weight: 800; fill: var(--ink); }
.donut-l { font-size: 9px; fill: var(--muted); }
.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .9rem; }
.legend i { display: inline-block; }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-sm); color: var(--ink-2); border: 1px solid var(--line-2); margin-bottom: 8px; }
.alert-row:hover { text-decoration: none; border-color: var(--brand); }
.alert-row > span { flex: 1; }
.alert-row b { background: var(--line-2); padding: 2px 10px; border-radius: 999px; }
.alert-row.hot { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.alert-row.hot b { background: var(--card); color: var(--warn); }
.alert-row > .ic { width: 20px; height: 20px; color: var(--brand); }
.alert-row.hot > .ic { color: var(--warn); }
.complaint .card-head h3 { margin: 0 0 2px; }
.complaint p { color: var(--ink-2); }
.card.complaint { margin-bottom: 0; }
.complaint-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.deposit-box { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.deposit-box ul { margin: 6px 0 0; padding-left: 18px; }
.complaint-photos img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 8px; }
.verify-card { display: grid; gap: 4px; }
.group-card { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.group-card .cat-icon { margin-bottom: 4px; }
.group-card h3 { margin: 0; }
.group-card .card-foot { margin-top: auto; padding-top: 12px; }
.row-card { padding: 16px 18px; }
.rental { padding: 0; margin-bottom: 14px; }
.rental-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 18px 0; align-items: flex-start; }
.rental-head h3 { margin: 0 0 4px; font-size: 1.1rem; }
.rental-head .loc { margin: 0; }
.rental .fact-row { padding: 0 18px; }
.rental-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line-2); margin-top: 12px; }
.history { padding: 0 18px 16px; }
.history summary { cursor: pointer; font-weight: 700; color: var(--brand); padding: 8px 0; }
.history .table-wrap { margin-top: 6px; }

/* sidebar shell (desktop) */
@media (min-width: 900px) {
  .tabbar { display: none !important; }
  .mobile-cta { display: none !important; }
  .top-links { display: flex; }
  .dash { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 0; max-width: 1280px; margin: 0 auto; min-height: calc(100vh - 68px); }
  .side { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 68px; align-self: start; height: calc(100vh - 68px); overflow-y: auto; border-right: 1px solid var(--line); background: var(--card); padding: 18px 14px; }
  .side-head { display: flex; gap: 12px; align-items: center; padding: 6px 8px 12px; border-bottom: 1px solid var(--line-2); }
  .side-head b { display: block; line-height: 1.2; }
  .side-head small { color: var(--muted); font-size: .8rem; }
  .side nav { display: grid; gap: 2px; }
  .side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
  .side nav a .ic { width: 18px; height: 18px; color: var(--muted); }
  .side nav a:hover { background: var(--line-2); text-decoration: none; color: var(--ink); }
  .side nav a.active { background: var(--brand-50); color: var(--brand); }
  .side nav a.active .ic { color: var(--brand); }
  .plan-chip { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--brand-50); color: var(--brand); }
  .plan-chip b { color: var(--ink); display: block; font-size: .9rem; }
  .plan-chip small { color: var(--muted); font-size: .75rem; }
  .plan-chip .ic { width: 20px; height: 20px; }
  .dash-main { padding: 28px 32px 48px; }
  .top-links a span { display: inline; }
  .dash .notice { margin-top: 0; }
  .view { min-height: calc(100vh - 68px); }
}
.plan-chip { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--brand-50); color: var(--brand); }
.plan-chip b { color: var(--ink); display: block; font-size: .9rem; }
.plan-chip small { color: var(--muted); font-size: .75rem; }
.plan-chip .ic { width: 20px; height: 20px; }

/* ---------- modal & toasts ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(12, 18, 24, .5); display: grid; place-items: end center; z-index: 80; padding: 0; animation: fade .15s ease-out; }
.modal { width: 100%; max-width: 620px; max-height: 92vh; background: var(--card); color: var(--ink); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: up .2s ease-out; }
.modal.sheet { max-width: 100%; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 6px; }
.modal-head h3 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 10px 20px 22px; overflow-y: auto; }
.menu-list { display: grid; gap: 4px; }
.menu-list a, .menu-logout { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; color: var(--ink); font-weight: 600; background: none; border: 0; font: inherit; cursor: pointer; width: 100%; text-align: left; }
.menu-list a:hover { background: var(--line-2); text-decoration: none; }
.menu-list a .ic, .menu-logout .ic { color: var(--brand); }
.menu-logout { color: var(--danger); }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; z-index: 100; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: center; background: var(--dark); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: .92rem; animation: up .2s ease-out; transition: opacity .3s, transform .3s; }
.toast .ic { width: 18px; height: 18px; }
.toast-success .ic { color: #4ade80; }
.toast-error .ic { color: #f87171; }
.toast-warn .ic { color: #fbbf24; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(14px); opacity: .5; } to { transform: none; opacity: 1; } }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--card); margin-top: 40px; padding: 32px 0 20px; }
.foot-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
.foot-grid h4 { margin-bottom: 8px; }
.foot-grid a, .foot-grid span { display: block; color: var(--ink-2); font-size: .92rem; margin-bottom: 5px; }
.foot-grid .brand { display: inline-flex; color: var(--ink); font-size: 1.1rem; margin-bottom: 0; }
.foot-grid .brand span { display: inline; margin: 0; }
.foot-grid .brand .brand-mark { display: grid; }
.foot-grid p { margin-top: 12px; max-width: 40ch; font-size: .92rem; }
.foot-base { border-top: 1px solid var(--line-2); margin-top: 22px; padding-top: 16px; font-size: .84rem; }

/* detail page / listing extras */
.detail-main .block:first-child { margin-top: 0; }
.bar-chart-note { font-size: .8rem; color: var(--muted); }
.bar-row .meter { min-width: 0; }

/* ---------- tablet & up ---------- */
@media (min-width: 640px) {
  .container { padding: 0 24px; }
  .hero-stats { grid-template-columns: repeat(4, auto); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr auto; }
  .filters .field:nth-child(5) { display: none; }
  .search-card { grid-template-columns: 1fr 1fr; }
  .search-card .field-grow, .search-card .search-go { grid-column: span 2; }
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .roles { grid-template-columns: repeat(3, 1fr); }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .fact-row { grid-template-columns: repeat(4, 1fr); }
  .gallery { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: auto auto; }
  .gallery.multi .gallery-main { grid-row: span 2; }
  .gallery img { aspect-ratio: 4 / 3; }
  .gallery-main { aspect-ratio: auto !important; height: 100%; }
  .gallery img:not(.gallery-main) { aspect-ratio: 4 / 3; }
  .gallery.multi img:nth-child(n+3) { display: block; }
  .gallery:not(.multi) { grid-template-columns: 1fr; }
  .gallery:not(.multi) .gallery-main { aspect-ratio: 16 / 9 !important; }
  .foot-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .cat-pick { grid-template-columns: repeat(4, 1fr); }
  .cat-opt { flex-direction: column; text-align: center; }
  .results-bar { flex-direction: row; justify-content: space-between; align-items: center; }
  .pager { justify-content: center; gap: 24px; }
  .pager > span:first-child, .pager > span:last-child { display: none; }
  .two-col { grid-template-columns: 1fr 1fr; }
  .card.pad { padding: 22px; }
  .unit-row { grid-template-columns: 2fr 1fr .8fr 1fr auto; }
  .auth-card { padding: 34px; }
  .modal-backdrop { place-items: center; }
  .modal { border-radius: 22px; }
  .modal.sheet { max-width: 480px; }
  .toolbar .field { flex: 1 1 280px; }
  .two-col-inner { grid-template-columns: 1fr 1fr; }
  .donut-wrap { gap: 22px; }
  .roles { grid-template-columns: repeat(3, 1fr); }
  .rental .fact-row { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 40px; }
  .hero-art { display: block; }
  .hero { padding-top: 56px; padding-bottom: 40px; }
  .hero-copy { padding-top: 6px; }
  .filters { grid-template-columns: 2.2fr 1.2fr 1fr 1fr 1fr auto; }
  .filters .field:nth-child(5) { display: flex; }
  .grid.listings { grid-template-columns: repeat(3, 1fr); }
  .grid.groups { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .owner-cta { grid-template-columns: 1.2fr .8fr; padding: 44px; }
  .auth { grid-template-columns: 1fr 1fr; align-items: stretch; margin: 56px auto; }
  .auth-art { display: flex; flex-direction: column; justify-content: center; }
  .auth-wide { grid-template-columns: 1fr 1fr; }
  .auth-wide .auth-art { order: 1; }
  .auth-wide .auth-card { order: 2; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; }
  .detail-side { position: sticky; top: 92px; align-self: start; }
  .mobile-cta { display: none !important; }
  .detail { padding-top: 26px; }
  .detail-head h1 { font-size: 2rem; }
  .kpis { gap: 14px; }
  .dash-grid { grid-template-columns: repeat(3, 1fr); }
  .span-2 { grid-column: span 2; }
  .dash-grid > .span-2 { grid-column: span 2; }
  .dash-grid > section:nth-child(n+5) { grid-column: auto; }
  .plan-grid { grid-template-columns: repeat(3, 1fr); }
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
  .two-col { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: span 2; }
  .sticky-actions { bottom: 0; }
  .search-head { top: 68px; }
  .kpis.three { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- phone (below 900px) ---------- */
@media (max-width: 899px) {
  .topbar-inner { height: 60px; gap: 10px; }
  .top-links { display: none; }
  .top-actions .btn { display: none; }
  .user-meta { display: none; }
  .user-chip { padding: 3px; border: 0; }
  #logoutBtn { display: none; }
  .brand-name { font-size: 1.05rem; }
  .brand-mark { width: 32px; height: 32px; }
  .tabbar { display: flex; }
  .view { padding-bottom: 80px; min-height: calc(100vh - 60px); }
  .dash { display: block; }
  .dash-main { padding: 16px 16px 100px; }
  .search-head { top: 60px; }
  .hero { padding: 22px 0 26px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .search-card { padding: 12px; }
  .search-go { width: 100%; }
  .toolbar { gap: 8px; }
  .toolbar > select, .toolbar .field { flex: 1 1 100%; }
  .sticky-actions { bottom: 78px; }
  .mobile-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: fixed; left: 0; right: 0; bottom: 64px; z-index: 44; background: var(--card); border-top: 1px solid var(--line); padding: 10px 16px; box-shadow: var(--shadow); }
  .mobile-cta b { display: block; font-size: 1.05rem; }
  .mobile-cta small { color: var(--muted); }
  .mobile-cta .btn { padding: 12px 24px; }
  .detail { padding-bottom: 130px; }
  .detail-head { flex-direction: column; }
  .rental-head { flex-direction: column; }
  .row-card { flex-direction: column; align-items: stretch; }
  .row-card .row-actions { justify-content: flex-end; }
  .table-wrap { border: 0; background: transparent; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; }
  .table td { border: 0; padding: 4px 0; }
  .table td.row-actions { padding-top: 8px; }
  .page-head .page-actions { width: 100%; }
  .page-head .page-actions .btn { flex: 1; }
  .unit-row { grid-template-columns: 1fr 1fr; }
  .unit-row input:first-child { grid-column: span 2; }
  .unit-row .icon-btn { justify-self: end; }
  .kpi { padding: 12px; }
  .kpi b { font-size: 1rem; }
  .bar-row { grid-template-columns: 92px 1fr 36px; }
  .auth { margin-top: 18px; }
  .auth-card { padding: 22px; }
  #toasts { bottom: 150px; }
  .sticky-actions { position: sticky; bottom: 70px; }
  .modal-backdrop { place-items: end stretch; }
  .modal { border-radius: 22px 22px 0 0; }
  .modal-body { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .facts { font-size: .82rem; }
  .fact-row { grid-template-columns: repeat(2, 1fr); }
  .kpi em { font-size: .72rem; }
  .gallery-main { aspect-ratio: 4 / 3 !important; }
  .gallery { border-radius: 16px; }
  .gallery:not(.multi) img { aspect-ratio: 4 / 3; }
  .gallery.multi { grid-template-columns: 1fr 1fr; }
  .gallery.multi .gallery-main { grid-column: span 2; }
  .gallery.multi img:nth-child(n+3) { display: none; }
  .gallery.multi img:nth-child(2) { display: block; }
}
@media (max-width: 380px) {
  .container { padding: 0 14px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cat-tile { padding: 12px; }
  .cat-tile small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Ramble-inspired layer ---------- */
.topbar { box-shadow: 0 1px 0 var(--line); }
.brand-name b { color: var(--brand); }
.brand-mark { border-radius: 12px; }
.hero { background: radial-gradient(900px 380px at 88% -20%, var(--hero-glow), transparent 70%), var(--bg); padding: 12px 0 20px; }
.hero::before { display: none; }
.hero-grid { background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); border-radius: 24px; padding: 26px 20px; color: #ffffff; position: relative; overflow: hidden; }
.hero-grid h1, .hero-grid .lead, .hero-grid .hero-stats b, .hero-grid .hero-stats span { color: #ffffff; }
.hero-grid .lead { opacity: .92; }
.hero-grid .hero-stats span { opacity: .85; }
.hero-grid .eyebrow { background: rgba(255, 255, 255, .14); color: #ffffff; border-color: rgba(255, 255, 255, .3); box-shadow: none; }
.hero-grid .search-card { color: var(--ink); }
.hero-grid .search-card .field { color: var(--muted); }
.hero-grid .hero-art { opacity: .95; }
.search-card { border-radius: 18px; }
.search-card .btn-accent { box-shadow: 0 10px 22px -10px rgba(2, 121, 184, .5); }
.type-chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.type-chip.on .ic { color: var(--on-brand); }
.type-chip:hover { border-color: var(--sky); color: var(--brand); background: var(--sky-100); }
.tabbar a, .tabbar button { position: relative; }
.tabbar a.active { background: none; color: var(--brand); font-weight: 700; }
.tabbar a.active::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.tabbar { box-shadow: 0 -4px 20px rgba(10, 60, 100, .06); }
.cat-tile { border-color: var(--line); }
.cat-tile:hover { border-color: var(--sky); }
.side nav a.active { background: var(--sky-100); color: var(--brand-600); }
.side nav a.active .ic { color: var(--brand); }
.chip-row::-webkit-scrollbar { display: none; }
.card.listing:hover { border-color: var(--sky); }
.btn-primary:hover { background: var(--brand-600); }
.section-head h2, h2 { color: var(--navy); }
.dark-note { display: none; }

/* ---------- illustrations ---------- */
.art-svg { display: block; width: 100%; height: auto; }
.cat-art { display: block; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 6px; background: var(--brand-50); }
.cat-art .art-svg { height: auto; }
.cat-tile { transition: transform .15s, box-shadow .15s; }
.cat-tile:hover .cat-art { box-shadow: var(--shadow); }
.step .art-svg { border-radius: 14px; margin-bottom: 10px; }
.verify-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.verify-head > div { min-width: 0; }
.verify-art { width: 96px; flex: none; border-radius: 14px; overflow: hidden; }
.billing-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.billing-head > div { flex: 1 1 260px; }
.billing-art { width: 150px; flex: none; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.empty-art .art-svg { border-radius: 16px; }
@media (max-width: 899px) { .verify-art { width: 80px; } .billing-art { width: 120px; } }
.theme-toggle { color: var(--ink-2); }
.theme-toggle .ic { width: 18px; height: 18px; }
