/* ============================================================
   FIELD SERVICE SYSTEM - foundation
   Loaded first by index, site, app and admin.

   Light, clean and premium. Paper-white surfaces on a cool
   grey ground, one electric blue as the brand accent, and the
   three status colours (good / attention / failed) kept exactly
   where they carry meaning.

   Dark is a real second theme: deep navy rather than black, so
   the blue accent glows instead of clashing.

   Motion: every interactive element has a soft hover lift, and
   motion.js adds reveal-on-scroll, staggered lists and number
   count-ups. All of it respects prefers-reduced-motion.
   ============================================================ */

:root {
  color-scheme: light;

  /* ground */
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #eef2f8;
  --raise: #e3e8f2;

  /* hairlines */
  --line: #e4e9f2;
  --line-strong: #cfd7e5;

  /* ink: navy-black instead of pure black, so text and the
     blue accent feel like one family */
  --ink: #0b1a33;
  --ink-2: #2a3c5e;
  --muted: #5d6981;
  --dim: #6e7a92;
  --inverse: #ffffff;

  /* brand blue: the only decorative colour in the system */
  /* AIRCON KING: sky blue to ice cyan, from the crown logo */
  --brand: #3d8ff5;
  --brand-2: #66a6fe;
  --brand-3: #7de8ff;
  --brand-ink: #1f6fd6;
  --brand-bg: #eef5ff;
  --brand-line: #c6ddff;
  --brand-soft: rgba(61, 143, 245, .14);
  --brand-glow: 0 10px 30px -10px rgba(61, 143, 245, .55);
  --brand-grad: linear-gradient(135deg, #4a8ffc 0%, #66b6ff 50%, #88f7ff 100%);
  --brand-grad-soft: linear-gradient(135deg, rgba(61, 143, 245, .10), rgba(136, 247, 255, .10));

  /* status colours */
  --ok: #15803d;
  --ok-bg: #effdf4;
  --ok-line: #bbf0cd;
  --warn: #b4530a;
  --warn-bg: #fff8eb;
  --warn-line: #fde3a7;
  --danger: #c2262b;
  --danger-bg: #fef2f2;
  --danger-line: #fbcaca;
  --note: #3d8ff5;
  --note-bg: #eef5ff;
  --note-line: #c6ddff;

  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* radii: a touch rounder than before, reads softer */
  --r-xs: 8px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-xs: 0 1px 2px rgba(11, 18, 32, .04), 0 1px 1px rgba(11, 18, 32, .02);
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, .04), 0 6px 16px -6px rgba(11, 18, 32, .10);
  --shadow: 0 2px 4px rgba(11, 18, 32, .04), 0 20px 48px -16px rgba(11, 18, 32, .16);
  --shadow-lg: 0 4px 8px rgba(11, 18, 32, .05), 0 40px 90px -24px rgba(11, 18, 32, .28);

  --ease: cubic-bezier(.32, .72, .26, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  /* deep sea blue behind the ice-blue crown */
  --bg: #081527;
  --surface: #0f1f38;
  --surface-2: #0c1a30;
  --surface-3: #162a47;
  --raise: #1f3556;

  --line: #1e3252;
  --line-strong: #2c4569;

  --ink: #eef5ff;
  --ink-2: #c6d6ee;
  --muted: #8fa5c4;
  --dim: #7f95b5;
  --inverse: #081527;

  --brand: #5aa3ff;
  --brand-2: #7dbaff;
  --brand-3: #88f7ff;
  --brand-ink: #a6ccff;
  --brand-bg: #14284a;
  --brand-line: #24457a;
  --brand-soft: rgba(90, 163, 255, .2);
  --brand-glow: 0 10px 34px -8px rgba(90, 163, 255, .6);
  --brand-grad: linear-gradient(135deg, #4a8ffc 0%, #66b6ff 50%, #88f7ff 100%);
  --brand-grad-soft: linear-gradient(135deg, rgba(90, 163, 255, .16), rgba(136, 247, 255, .10));

  --ok: #4ade80;
  --ok-bg: #0c2a19;
  --ok-line: #17512f;
  --warn: #fbbf24;
  --warn-bg: #2b1f06;
  --warn-line: #573c0b;
  --danger: #fb7185;
  --danger-bg: #2c1015;
  --danger-line: #591d26;
  --note: #7dbaff;
  --note-bg: #14284a;
  --note-line: #24457a;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 16px -6px rgba(0, 0, 0, .5);
  --shadow: 0 2px 4px rgba(0, 0, 0, .5), 0 20px 48px -16px rgba(0, 0, 0, .7);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, .5), 0 40px 90px -24px rgba(0, 0, 0, .85);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  animation: ak-body-in .5s var(--ease-out) both;
}

@keyframes ak-body-in { from { opacity: 0; } to { opacity: 1; } }

img { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; }

a { color: inherit; }

::selection { background: var(--brand-soft); color: var(--ink); }

/* ------------------------------------------------------------
   ICONS
   ------------------------------------------------------------ */
svg.i {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  display: inline-block;
  vertical-align: -.18em;
  color: inherit;
  stroke: currentColor;
  fill: none;
  pointer-events: none;
}

svg.i.xs { width: 13px; height: 13px; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.md { width: 18px; height: 18px; }
svg.i.lg { width: 22px; height: 22px; }
svg.i.xl { width: 28px; height: 28px; }

/* ------------------------------------------------------------
   FOCUS
   ------------------------------------------------------------ */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------
   TYPE ROLES
   ------------------------------------------------------------ */
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.lab-xs {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--dim);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -.022em;
  color: var(--ink);
  line-height: 1.2;
}

.display {
  font-weight: 800;
  letter-spacing: -.038em;
  line-height: 1.03;
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -.035em;
}

.t-muted { color: var(--muted); }
.t-dim { color: var(--dim); }

/* gradient text, used on hero headlines */
.grad-text {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------
   BRAND PLACEHOLDER
   A soft gradient tile with a snowflake-ish spark. Still reads
   as a placeholder, but a handsome one for a demo.
   ------------------------------------------------------------ */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  overflow: hidden;
  position: relative;
  box-shadow: var(--brand-glow);
  transition: transform .3s var(--spring), box-shadow .3s var(--ease);
}

.brand-mark::after { display: none; }

.brand:hover .brand-mark { transform: translateY(-1px) rotate(-3deg); }

.brand-mark img { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); object-fit: contain; }

.brand-mark span {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  text-align: center;
  text-transform: none;
  position: relative;
}

.brand-mark span br { display: none; }

.brand-mark.lg { width: 46px; height: 46px; border-radius: 14px; }
.brand-mark.lg span { font-size: 16px; }

.brand-text { display: grid; line-height: 1.15; min-width: 0; }

.brand-text b {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text span {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 3px;
}

/* ------------------------------------------------------------
   SIGNATURE - the perforated docket, now with a soft card face
   ------------------------------------------------------------ */
.ticket {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}

.ticket:hover { box-shadow: var(--shadow-sm); border-color: var(--line-strong); transform: translateY(-1px); }

.ticket::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--line-strong);
}

.ticket.st-today::before { background: var(--brand-grad); }
.ticket.st-pending::before { background: var(--warn); }
.ticket.st-review::before { background: var(--note); }
.ticket.st-done::before { background: var(--ok); }

.ticket-head { position: relative; padding: 16px 18px 14px 22px; }

.ticket-perf {
  position: relative;
  height: 0;
  margin-left: 4px;
  border-top: 1px dashed var(--line-strong);
}

.ticket-perf::before,
.ticket-perf::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
}

.ticket-perf::before { left: -11px; }
.ticket-perf::after { right: -7px; }

.ticket-body { padding: 16px 18px 18px 22px; }

/* ------------------------------------------------------------
   PILLS
   ------------------------------------------------------------ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.6;
}

.pill.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.pill.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.pill.danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.pill.note { color: var(--note); background: var(--note-bg); border-color: var(--note-line); }
.pill.solid { color: #fff; background: var(--brand-grad); border-color: transparent; }

.pill svg.i { width: 11px; height: 11px; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.dot.pulse { animation: ak-pulse 2.2s ease-in-out infinite; }

@keyframes ak-pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70% { box-shadow: 0 0 0 6px transparent; opacity: .55; }
}

/* ------------------------------------------------------------
   BUTTONS
   Primary is the brand gradient with a soft glow; secondary is
   a white card button. Both lift a hair on hover.
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -.008em;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  transition: background .2s var(--ease), border-color .2s var(--ease),
              color .2s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease);
}

.btn:hover { background: var(--surface-2); border-color: var(--brand-line); color: var(--brand-ink); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); box-shadow: none; }

.btn svg.i { width: 15px; height: 15px; }

.btn.primary {
  background: var(--brand-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--brand-glow);
}

.btn.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .18), transparent);
  opacity: 0;
  transition: opacity .2s var(--ease);
}

.btn.primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 14px 34px -10px rgba(31, 94, 255, .65); }
.btn.primary:hover::after { opacity: 1; }
.btn.primary:active { transform: translateY(0); box-shadow: var(--brand-glow); }

.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--ink); box-shadow: none; }

.btn.go { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.btn.go:hover { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }

.btn.stop { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.btn.stop:hover { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }

.btn.sm { padding: 6px 12px; font-size: 12px; border-radius: var(--r-xs); gap: 6px; }
.btn.sm svg.i { width: 13px; height: 13px; }

.btn.lg { padding: 13px 22px; font-size: 14px; border-radius: var(--r); }
.btn.lg svg.i { width: 17px; height: 17px; }

.btn.block { width: 100%; }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none !important; }

/* icon-only */
.ibtn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--spring);
}

.ibtn:hover { background: var(--brand-bg); color: var(--brand); border-color: var(--brand-line); transform: translateY(-1px); }
.ibtn svg.i { width: 17px; height: 17px; }
.ibtn.sm { width: 28px; height: 28px; }
.ibtn.sm svg.i { width: 14px; height: 14px; }
.ibtn.bordered { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-xs); }
.ibtn.danger:hover { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.ibtn.ok:hover { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }

/* ------------------------------------------------------------
   CHIPS
   ------------------------------------------------------------ */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}

.chip:hover { color: var(--brand-ink); border-color: var(--brand-line); background: var(--brand-bg); transform: translateY(-1px); }

.chip[aria-selected="true"] {
  background: var(--brand-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--brand-glow);
}

.chip .n {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--dim);
}

.chip[aria-selected="true"] .n { background: rgba(255, 255, 255, .22); color: #fff; }

/* ------------------------------------------------------------
   FIELDS
   ------------------------------------------------------------ */
.field { display: block; margin-bottom: 16px; }

.field > .lab {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: -.008em;
}

.field .req { color: var(--danger); font-weight: 500; }

.input,
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  box-shadow: var(--shadow-xs);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.field select { cursor: pointer; }

.input:hover,
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--brand-2); }

.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.field textarea { resize: vertical; min-height: 88px; line-height: 1.55; }

.field .hint { display: block; font-size: 11.5px; color: var(--dim); margin-top: 6px; line-height: 1.5; }

.field .err { display: none; font-size: 11.5px; color: var(--danger); margin-top: 6px; font-weight: 500; }
.field.bad .err { display: block; animation: ak-shake .4s var(--ease); }
.field.bad input,
.field.bad select,
.field.bad textarea { border-color: var(--danger); }

@keyframes ak-shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.field[readonly] input, .input[readonly] { background: var(--surface-3); color: var(--muted); cursor: default; }

::placeholder { color: var(--dim); opacity: 1; }

.radio-row { display: flex; gap: 20px; padding-top: 2px; }

.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink);
}

.radio input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* ------------------------------------------------------------
   BARS
   ------------------------------------------------------------ */
.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  border: 1px solid var(--line);
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand-grad);
  transition: width 1s var(--ease-out);
}

.bar.low > i { background: var(--danger); }
.bar.ok > i { background: var(--ok); }

/* ------------------------------------------------------------
   THEME TOGGLE
   ------------------------------------------------------------ */
.theme-btn { position: relative; overflow: hidden; }
.theme-btn .sun, .theme-btn .moon { transition: transform .45s var(--spring), opacity .3s var(--ease); display: grid; }
.theme-btn .moon { position: absolute; }
:root:not([data-theme="dark"]) .theme-btn .moon { transform: translateY(120%) rotate(-40deg); opacity: 0; }
:root[data-theme="dark"] .theme-btn .sun { transform: translateY(-120%) rotate(40deg); opacity: 0; }

/* ------------------------------------------------------------
   MAPS
   ------------------------------------------------------------ */
.mapbox {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-3);
  isolation: isolate;
  box-shadow: var(--shadow-xs);
}

.mapbox .leaflet-container {
  width: 100%;
  height: 100%;
  background: var(--surface-3);
  font-family: var(--font);
}

.leaflet-tile-pane { filter: saturate(.55) contrast(.95) brightness(1.03); }

:root[data-theme="dark"] .leaflet-tile-pane {
  filter: grayscale(.4) invert(1) hue-rotate(180deg) contrast(.85) brightness(.85);
}

.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
  font-weight: 500;
}

.leaflet-control-zoom a:hover { background: var(--brand-bg) !important; color: var(--brand) !important; }

.leaflet-control-attribution {
  background: var(--surface) !important;
  color: var(--dim) !important;
  font-family: var(--mono);
  font-size: 9.5px !important;
  border-radius: var(--r-xs) 0 0 0;
}

.leaflet-control-attribution a { color: var(--muted) !important; }

.leaflet-bar, .leaflet-popup-content-wrapper, .leaflet-popup-tip {
  box-shadow: var(--shadow-sm) !important;
}

.mk-wrap { background: none !important; border: 0 !important; }

.mk {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line-strong);
  background: var(--dim);
  position: relative;
  transition: transform .2s var(--spring);
}

.mk:hover, .mk.sel { transform: scale(1.45); z-index: 5; }

.mk-on { background: var(--ok); }
.mk-on::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--ok);
  opacity: 0;
  animation: mk-ring 2.4s ease-out infinite;
}

@keyframes mk-ring {
  0% { transform: scale(.7); opacity: .8; }
  100% { transform: scale(2.1); opacity: 0; }
}

.mk-off { background: var(--dim); }
.mk-busy { background: var(--warn); }
.mk-job { background: var(--brand); }

.mk i {
  position: absolute;
  top: -7px; right: -7px;
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
  font-weight: 600;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--inverse);
  display: grid;
  place-items: center;
  border: 1.5px solid var(--surface);
}

.mk.abs, .mk-drop.abs { position: absolute; margin: -8px 0 0 -8px; }

.mk-drop {
  display: block;
  width: 30px;
  height: 30px;
  color: var(--brand);
  filter: drop-shadow(0 4px 8px rgba(31, 94, 255, .4));
  animation: mk-drop-in .5s var(--spring) both;
}

@keyframes mk-drop-in {
  from { transform: translateY(-14px) scale(.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.mk-drop.abs { margin: -29px 0 0 -15px; }
.mk-drop svg { width: 100%; height: 100%; }

.map-base { position: absolute; inset: 0; width: 100%; height: 100%; }
.mk-layer { position: absolute; inset: 0; }

.map-offline {
  position: absolute;
  left: 12px; bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 7px 11px;
  display: grid;
  pointer-events: none;
  box-shadow: var(--shadow-xs);
}

.map-offline b { font-size: 11.5px; color: var(--ink); }
.map-offline span { font-family: var(--mono); font-size: 9.5px; color: var(--dim); margin-top: 2px; }

/* ------------------------------------------------------------
   EMPTY STATE
   ------------------------------------------------------------ */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
}

.empty > svg.i {
  width: 34px; height: 34px;
  margin: 0 auto 14px;
  color: var(--brand);
  display: block;
  stroke-width: 1.3;
  padding: 0;
}

.empty h4 { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.empty p { margin: 0 auto; font-size: 13px; max-width: 38ch; line-height: 1.6; }

/* ------------------------------------------------------------
   SCROLLBARS
   ------------------------------------------------------------ */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--dim); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------
   UTILITY
   ------------------------------------------------------------ */
.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

.stack { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.spacer { margin-left: auto; }

.demo-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
  border: 1px solid var(--brand-line);
  background: var(--brand-bg);
  border-radius: 999px;
  padding: 4px 11px;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   MOTION SYSTEM
   motion.js adds .rv to elements it watches and .in once they
   scroll into view. --i is the stagger index within a parent.
   ------------------------------------------------------------ */
.rv {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}

.rv.in { opacity: 1; transform: none; }

/* stagger children of a list on first paint */
.stagger > * { animation: ak-rise .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); }

@keyframes ak-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes ak-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes ak-drift {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 20px) scale(.96); }
  100% { transform: translate(0, 0) scale(1); }
}

/* soft aurora background, used on the launcher and the hero */
.aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .42;
  animation: ak-drift 18s ease-in-out infinite;
}

.aurora i:nth-child(1) { width: 520px; height: 520px; left: -140px; top: -180px; background: var(--brand-2); }
.aurora i:nth-child(2) { width: 460px; height: 460px; right: -120px; top: -60px; background: var(--brand-3); animation-delay: -6s; animation-duration: 22s; }
.aurora i:nth-child(3) { width: 380px; height: 380px; right: 22%; bottom: -220px; background: #8fb4ff; animation-delay: -12s; animation-duration: 26s; }

:root[data-theme="dark"] .aurora i { opacity: .28; }

/* fine dot grid, sits on top of the aurora */
.dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 70%);
  opacity: .6;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .rv { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   COMBO - select to search
   ------------------------------------------------------------ */
.combo { position: relative; }
.combo > input { padding-right: 36px; }
.combo-ic { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; display: grid; }
.combo-ic svg.i { width: 15px; height: 15px; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; padding: 6px;
  display: none; animation: ak-rise .18s var(--ease-out) both;
}
.combo.open .combo-list { display: block; }
.combo-group { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); padding: 8px 10px 4px; }
.combo-opt { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--r-xs); cursor: pointer; color: var(--ink); font-size: 13px; }
.combo-opt small { font-size: 11px; color: var(--muted); margin-top: 2px; }
.combo-opt:hover, .combo-opt.active { background: var(--brand-bg); color: var(--brand-ink); }
.combo-empty { padding: 12px 10px; font-size: 12.5px; color: var(--muted); }

/* SweetAlert2 in the house style */
.ak-swal { border-radius: var(--r-lg) !important; font-family: var(--font) !important; box-shadow: var(--shadow-lg) !important; }
.ak-swal .swal2-title { font-size: 20px !important; letter-spacing: -.02em; }
.ak-swal .swal2-html-container { font-size: 14px !important; color: var(--muted) !important; }
.ak-swal .swal2-confirm, .ak-swal .swal2-cancel { border-radius: 10px !important; font-weight: 600 !important; font-size: 13.5px !important; padding: 10px 18px !important; box-shadow: none !important; }
