/* Costa Ibérica UI 0.10.0: tokens, fonts, base and components in one file.
 * Generated by scripts/build_static.py from the files named below; edit those,
 * not this file. To adopt the system screen by screen, link tokens.css,
 * fonts.css and components.css on their own and leave base.css out.
 */

/* ===== tokens.css ===== */

/* Costa Ibérica design tokens.
 *
 * Brand colours are the exact values from the Mediaelx brand manual v1.0
 * (Aug 2026). Never add a new brand colour: everything else in this file is
 * a tint or shade of them, or a functional status colour.
 *
 * Proportions from the manual: navy ~55 %, bone ~35 %, gold ~10 %. Gold is an
 * accent (rules, details, the one main action), never a large area, and never
 * the colour of text people must read on a light background (2.6:1).
 */
:root {
  /* Brand */
  --ci-navy: #1E2A42;          /* Marino profundo: dominant */
  --ci-bone: #F4F3F1;          /* Blanco de apoyo: page background */
  --ci-gold: #B79E68;          /* Oro cálido: accent only */
  --ci-gold-shadow: #A78655;   /* Oro sombra: monogram depth, gold hover */
  --ci-white: #FFFFFF;

  /* Tints and shades of the brand colours */
  --ci-navy-deep: #141D30;     /* pressed navy */
  --ci-navy-raised: #2C3C58;   /* hover on navy */
  --ci-gold-tint: #ECE3D1;     /* gold badge background */
  --ci-gold-wash: #F8F4EC;     /* selected row, highlighted block */

  /* Text */
  --ci-text: var(--ci-navy);
  --ci-text-muted: #5B6476;          /* 5.9:1 on white, 5.4:1 on bone */
  --ci-text-on-navy: var(--ci-white);
  --ci-text-on-navy-muted: #AEB6C6;  /* 7:1 on navy */
  --ci-text-on-navy-accent: var(--ci-gold); /* 5.5:1 on navy */
  --ci-text-on-navy-gold: #CEB888;   /* lighter gold for the app's name, 7.4:1 on navy */

  /* Surfaces and lines */
  --ci-page: var(--ci-bone);
  --ci-surface: var(--ci-white);
  --ci-surface-sunk: #ECEAE5;        /* photo placeholder, inset areas */
  --ci-line: #E2DED6;                /* dividers, panel borders */
  --ci-line-strong: #868D9C;         /* form control borders, 3.4:1 on white */
  --ci-rule: var(--ci-gold);         /* el filete: the hairline from the logo */

  /* Chart series, in this fixed order (never cycled; a 7th series folds into
     "Other"). Brand-led: navy blue, ochre (a deeper gold than --ci-gold, which
     is too pale for a mark), sea green, terracotta, plum, olive. Validated on
     white: adjacent pairs ΔE >= 9.6 under protan/deutan simulation, >= 16.2
     with full colour vision, every one >= 3:1. Charts where any two series can
     touch (scatter) use the first three only. Status colours stay for states. */
  --ci-series-1: #3A5F9C;
  --ci-series-2: #B8862B;
  --ci-series-3: #0E917C;
  --ci-series-4: #C0583C;
  --ci-series-5: #8A4F8C;
  --ci-series-6: #6E8B2E;

  /* Status colours: functional, deliberately outside the brand palette and
     muted so they sit next to navy and gold. Text on tint is >= 5:1. */
  --ci-success: #2F6B4A;  --ci-success-tint: #E4EFE8;
  --ci-warning: #8A5A0B;  --ci-warning-tint: #F6ECD9;
  --ci-danger:  #A8322A;  --ci-danger-tint:  #F7E6E3;
  --ci-info:    var(--ci-navy); --ci-info-tint: #E5E8EF;

  /* Typography. Superior Title: page and section titles, highlighted figures
     (prices). Never body text, tables or form labels. Elms Sans: everything
     else; Light for running text, Regular for data, Medium for emphasis. */
  --ci-font-title: "Superior Title", Georgia, "Times New Roman", serif;
  --ci-font-text: "Elms Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  --ci-fs-xs: 0.75rem;     /* 12 */
  --ci-fs-sm: 0.8125rem;   /* 13 */
  --ci-fs-md: 0.9375rem;   /* 15: base */
  --ci-fs-lg: 1.0625rem;   /* 17 */
  --ci-fs-xl: 1.3125rem;   /* 21 */
  --ci-fs-2xl: 1.625rem;   /* 26 */
  --ci-fs-3xl: 2.125rem;   /* 34 */
  --ci-fs-4xl: 2.75rem;    /* 44 */

  --ci-lh-text: 1.55;
  --ci-lh-prose: 1.65;
  --ci-lh-title: 1.12;

  /* Secondary labels and signage: uppercase with wide spacing (manual p. 09). */
  --ci-tracking-caps: 0.18em;

  /* Space, on a 4 px grid */
  --ci-space-1: 4px;
  --ci-space-2: 8px;
  --ci-space-3: 12px;
  --ci-space-4: 16px;
  --ci-space-5: 24px;
  --ci-space-6: 32px;
  --ci-space-7: 48px;
  --ci-space-8: 64px;

  /* Shape (owner, 2026-10-28). Table rows stay square; only the table's box
     is rounded. Photos are clipped to their card's corners.
       sm   chips in tables, small buttons
       md   form fields, buttons, selects, menus
       lg   cards, table boxes, sections, panels
       xl   offer photos and offer cards
       full pills: statuses, filters, counts */
  --ci-radius-sm: 8px;
  --ci-radius-md: 12px;
  --ci-radius-lg: 16px;
  --ci-radius-xl: 20px;
  --ci-radius-full: 999px;
  --ci-radius: var(--ci-radius-md);  /* before 0.10.0 this was 2px */
  --ci-hairline: 1px;
  --ci-page-warm: #EDE8DE;           /* warm page under white panels (ciui_page="warm") */
  --ci-shadow-card: 0 1px 2px rgba(20, 29, 48, 0.06), 0 6px 18px -10px rgba(20, 29, 48, 0.25);
  --ci-shadow-card-hover: 0 2px 4px rgba(20, 29, 48, 0.08), 0 16px 32px -14px rgba(20, 29, 48, 0.35);
  --ci-content-max-wide: 1680px;     /* ciui_page="wide" */
  --ci-shadow-overlay: 0 18px 40px -18px rgba(20, 29, 48, 0.45);
  --ci-focus-ring: 0 0 0 3px rgba(183, 158, 104, 0.55);

  /* Layout */
  --ci-header-height: 64px;
  --ci-content-max: 1240px;
  --ci-gutter: clamp(16px, 4vw, 40px);

  --ci-ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ===== fonts.css ===== */

/* Brand fonts, self-hosted. No CDN: apps must work offline on the office
 * network. URLs are relative to this file, so the static folder can be
 * mounted at any path.
 *
 * Elms Sans: SIL Open Font License 1.1 (fonts/elms-sans/OFL.txt).
 * Superior Title: commercial (MCKL), licensed through Mediaelx for Costa
 * Ibérica. Keep these files in private repos only; never publish them.
 */
@font-face {
  font-family: "Elms Sans";
  src: url("../fonts/elms-sans/ElmsSans-Light.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Elms Sans";
  src: url("../fonts/elms-sans/ElmsSans-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Elms Sans";
  src: url("../fonts/elms-sans/ElmsSans-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Elms Sans";
  src: url("../fonts/elms-sans/ElmsSans-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Elms Sans";
  src: url("../fonts/elms-sans/ElmsSans-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
/* Superior Title has one weight. The range stops browsers from faking a
   bold version when a title is set in a heavier weight. */
@font-face {
  font-family: "Superior Title";
  src: url("../fonts/superior-title/SuperiorTitle-Regular.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ===== base.css ===== */

/* Base styles: element defaults for any web app, whatever its stack.
 *
 * Every selector is wrapped in :where(), so it has zero specificity and an
 * app's own CSS always wins. An app that is migrating screen by screen can
 * leave this file out and use only tokens, fonts and components.
 */
:where(*, *::before, *::after) { box-sizing: border-box; }

:where(html) {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:where(body) {
  margin: 0;
  min-height: 100vh;
  background: var(--ci-page);
  color: var(--ci-text);
  font-family: var(--ci-font-text);
  font-size: var(--ci-fs-md);
  font-weight: 400;
  line-height: var(--ci-lh-text);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Titles: Superior Title for h1 and h2 only. Smaller headings stay in Elms
   Sans; the manual rules the serif out at small sizes. */
:where(h1, h2) {
  font-family: var(--ci-font-title);
  font-weight: 400;
  font-synthesis: none;
  line-height: var(--ci-lh-title);
  letter-spacing: 0.005em;
  color: var(--ci-navy);
  margin: 0 0 var(--ci-space-4);
  text-wrap: balance;
}
:where(h1) { font-size: var(--ci-fs-3xl); }
:where(h2) { font-size: var(--ci-fs-xl); }
:where(h3, h4) {
  font-family: var(--ci-font-text);
  font-weight: 600;
  font-size: var(--ci-fs-md);
  line-height: 1.35;
  color: var(--ci-navy);
  margin: 0 0 var(--ci-space-2);
}

:where(p) { margin: 0 0 var(--ci-space-4); max-width: 72ch; }

:where(a) {
  color: var(--ci-navy);
  text-decoration: underline;
  text-decoration-color: var(--ci-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
:where(a:hover) { text-decoration-thickness: 2px; }

:where(strong, b) { font-weight: 600; }
:where(small) { font-size: var(--ci-fs-sm); }

:where(hr) {
  border: 0;
  border-top: var(--ci-hairline) solid var(--ci-line);
  margin: var(--ci-space-6) 0;
}

:where(img, svg, video) { display: block; max-width: 100%; }
:where(img) { height: auto; }

:where(button, input, select, textarea) {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

:where(table) { border-collapse: collapse; }

/* One focus style everywhere: a gold halo, visible on navy and on bone. */
:where(:focus-visible) {
  outline: 2px solid var(--ci-gold);
  outline-offset: 2px;
}

:where(::selection) { background: var(--ci-gold-tint); color: var(--ci-navy); }

@media (prefers-reduced-motion: reduce) {
  :where(*, *::before, *::after) {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ===== components.css ===== */

/* Components. Every class starts with "ci-" so an app can adopt them
 * screen by screen without clashing with its old styles.
 *
 * The one recurring device is el filete: the thin gold rule that runs under
 * the logo. It marks the edge of the header, the active page in the
 * navigation and the line after a page title. Everything else stays quiet.
 */

/* ---------- Layout ---------- */

.ci-main {
  max-width: calc(var(--ci-content-max) + 2 * var(--ci-gutter));
  margin: 0 auto;
  padding: 0 var(--ci-gutter) var(--ci-space-8);
}

.ci-grid {
  display: grid;
  gap: var(--ci-space-5);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.ci-split {
  display: grid;
  gap: var(--ci-space-5);
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: start;
}
/* 2 : 1 — a wide main column (e.g. a listing's large photo and its text) and
   a narrow side column (0.7.0). One column below 900 px, like .ci-split. */
.ci-split--wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) {
  .ci-split { grid-template-columns: minmax(0, 1fr); }
}

.ci-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--ci-space-4);
  margin: var(--ci-space-7) 0 var(--ci-space-4);
}
.ci-section-head > :where(h2) { margin: 0; }

/* ---------- Header ---------- */

/* "Skip to content" link, visible only when reached with the keyboard. */
.ci-skip {
  position: absolute;
  top: -100px;
  left: var(--ci-space-4);
  z-index: 10;
  padding: var(--ci-space-2) 14px;
  background: var(--ci-white);
  color: var(--ci-navy);
  border-radius: var(--ci-radius-sm);
  box-shadow: var(--ci-shadow-overlay);
}
.ci-skip:focus { top: var(--ci-space-3); }

.ci-header {
  background: var(--ci-navy);
  color: var(--ci-text-on-navy);
  border-bottom: var(--ci-hairline) solid var(--ci-rule);
}
.ci-header__inner {
  max-width: calc(var(--ci-content-max) + 2 * var(--ci-gutter));
  height: var(--ci-header-height);
  margin: 0 auto;
  padding: 0 var(--ci-gutter);
  display: flex;
  align-items: stretch;
  gap: var(--ci-space-4);
}
.ci-header__brand {
  display: flex;
  align-items: center;
  gap: var(--ci-space-4);
  flex-shrink: 0;
  color: inherit;
  text-decoration: none;
}
.ci-header__logo { height: 26px; width: auto; }
.ci-header__mark { display: none; height: 30px; width: auto; }
/* The app name sits right of the logo behind a vertical gold rule, the
   manual's alternative position for the claim. It tells the apps apart, so
   it is as large as the menu and in a lighter gold. */
.ci-header__app {
  display: flex;
  align-items: center;
  height: 24px;
  padding-left: var(--ci-space-4);
  border-left: var(--ci-hairline) solid var(--ci-rule);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ci-text-on-navy-gold);
}

/* The menu: plain links in a row that scrolls sideways when it is too long,
   then the groups, which stay in place so their menus are never cut off. */
.ci-header { --ci-nav-pad: 9px; }  /* each link's side padding: 18 px between two links */
.ci-header__menu { display: flex; align-items: stretch; flex: 1; min-width: 0; }
.ci-nav {
  display: flex;
  align-items: stretch;
  flex: 0 1 auto;  /* the groups follow the last link; the links scroll when the row is full */
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
/* A menu wider than its row scrolls sideways. Each edge with more of the
   menu hidden behind it fades into the navy; ciui.js sets data-ciui-more to
   "start", "end" or "both" from the scroll position. */
.ci-nav[data-ciui-more] {
  --ci-nav-fade-start: #000;
  --ci-nav-fade-end: #000;
  -webkit-mask-image: linear-gradient(to right, var(--ci-nav-fade-start), #000 48px, #000 calc(100% - 48px), var(--ci-nav-fade-end));
  mask-image: linear-gradient(to right, var(--ci-nav-fade-start), #000 48px, #000 calc(100% - 48px), var(--ci-nav-fade-end));
}
.ci-nav[data-ciui-more="start"], .ci-nav[data-ciui-more="both"] { --ci-nav-fade-start: transparent; }
.ci-nav[data-ciui-more="end"], .ci-nav[data-ciui-more="both"] { --ci-nav-fade-end: transparent; }
.ci-nav__link {
  display: flex;
  align-items: center;
  padding: 0 var(--ci-nav-pad);
  color: var(--ci-text-on-navy-muted);
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms var(--ci-ease);
}
.ci-nav__link:hover { color: var(--ci-text-on-navy); }
/* A count after a menu item, e.g. enquiries waiting to be sent. */
.ci-nav__badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 7px;
  padding: 0 6px;
  border-radius: var(--ci-radius-full);
  background: var(--ci-gold);
  color: var(--ci-navy-deep);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ci-nav__badge[hidden] { display: none; }

/* A group of menu items under one label (a native disclosure). */
.ci-navgroup { position: relative; display: flex; flex-shrink: 0; }
.ci-navgroup__toggle { gap: 6px; list-style: none; cursor: pointer; user-select: none; }
.ci-navgroup__toggle::-webkit-details-marker { display: none; }
.ci-navgroup__chevron { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 150ms var(--ci-ease); }
.ci-navgroup[open] .ci-navgroup__chevron { transform: rotate(180deg); }
.ci-navgroup[open] > .ci-navgroup__toggle { color: var(--ci-text-on-navy); }
.ci-navgroup--current > .ci-navgroup__toggle { color: var(--ci-text-on-navy); box-shadow: inset 0 -3px 0 var(--ci-rule); }
.ci-navgroup__menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  min-width: 232px;
  padding: var(--ci-space-2) 0;
  background: var(--ci-surface);
  border: var(--ci-hairline) solid var(--ci-line);
  border-top: 2px solid var(--ci-rule);
  border-radius: var(--ci-radius-md);
  box-shadow: var(--ci-shadow-overlay);
}
.ci-navgroup__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ci-space-3);
  padding: 10px var(--ci-space-4);
  color: var(--ci-navy);
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
}
.ci-navgroup__link:hover { background: var(--ci-gold-wash); }
.ci-navgroup__link:focus-visible { outline-color: var(--ci-navy); outline-offset: -2px; }
.ci-navgroup__link[aria-current="page"] { font-weight: 500; box-shadow: inset 3px 0 0 var(--ci-rule); }
.ci-nav__link:focus-visible { outline-offset: -2px; }
/* The active page thickens the filete under its own link. */
.ci-nav__link[aria-current="page"] {
  color: var(--ci-text-on-navy);
  box-shadow: inset 0 -3px 0 var(--ci-rule);
}

/* The user's menu (<details>): avatar and name open a small panel with the
   name, role and "log out". */
.ci-user { position: relative; flex-shrink: 0; }
.ci-user__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 4px;
  border-radius: var(--ci-radius-md);
  color: var(--ci-text-on-navy);
  cursor: pointer;
  list-style: none;
}
.ci-user__toggle::-webkit-details-marker { display: none; }
.ci-user__toggle:hover .ci-user__chevron { color: var(--ci-text-on-navy); }
.ci-user__chevron {
  width: 14px;
  height: 14px;
  color: var(--ci-text-on-navy-muted);
  transition: transform 150ms var(--ci-ease), color 150ms var(--ci-ease);
}
.ci-user[open] .ci-user__chevron { transform: rotate(180deg); }
.ci-user__menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  min-width: 232px;
  padding: var(--ci-space-4);
  background: var(--ci-surface);
  border: var(--ci-hairline) solid var(--ci-line);
  border-top: 2px solid var(--ci-rule);
  border-radius: var(--ci-radius-md);
  box-shadow: var(--ci-shadow-overlay);
  color: var(--ci-navy);
}
.ci-user__menu-name { margin: 0; font-weight: 500; }
.ci-user__menu-role { margin: 2px 0 0; font-size: var(--ci-fs-sm); color: var(--ci-text-muted); }
.ci-user__menu form { margin: var(--ci-space-4) 0 0; }
.ci-user__menu :focus-visible { outline-color: var(--ci-navy); }
.ci-avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ci-navy-raised);
  box-shadow: inset 0 0 0 1px var(--ci-rule);
  color: var(--ci-gold-tint);
  font-size: var(--ci-fs-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
}
.ci-user__text { display: grid; line-height: 1.25; text-align: left; }
.ci-user__name { font-size: var(--ci-fs-sm); font-weight: 500; }
.ci-user__role { font-size: var(--ci-fs-xs); color: var(--ci-text-on-navy-muted); }

/* Right end of the header: language switcher, then the user. */
.ci-header__end {
  display: flex;
  align-items: center;
  gap: var(--ci-space-4);
  margin-left: auto;  /* on the right also on a page without a menu */
  flex-shrink: 0;
}

/* ---------- Language switcher ---------- */

/* PL · ES · EN as text, no flags. Tone "dark" (on navy): the active language
   is gold. Tone "light" (on bone or white): gold text would be unreadable,
   so the active language is navy with the gold rule under it. */
.ci-lang {
  --ci-lang-idle: var(--ci-text-on-navy-muted);
  --ci-lang-hover: var(--ci-text-on-navy);
  --ci-lang-active: var(--ci-text-on-navy-accent);
  --ci-lang-mark: transparent;
  margin: 0;
}
.ci-lang--light {
  --ci-lang-idle: var(--ci-text-muted);
  --ci-lang-hover: var(--ci-navy);
  --ci-lang-active: var(--ci-navy);
  --ci-lang-mark: var(--ci-rule);
}
.ci-lang__options { display: flex; align-items: center; gap: 2px; }
.ci-lang__option {
  min-width: 32px;
  padding: 7px 4px 6px;
  background: none;
  border: 0;
  border-radius: var(--ci-radius-sm);
  color: var(--ci-lang-idle);
  font-family: var(--ci-font-text);
  font-size: var(--ci-fs-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: color 150ms var(--ci-ease);
}
.ci-lang__option:hover { color: var(--ci-lang-hover); text-decoration: none; }
.ci-lang__option[aria-current="true"] {
  color: var(--ci-lang-active);
  text-decoration: underline;
  text-decoration-color: var(--ci-lang-mark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.55em;
  cursor: default;
}
.ci-lang__sep { color: var(--ci-lang-idle); font-size: var(--ci-fs-xs); opacity: 0.6; }

/* Narrower screens: initials only. The name stays in the button for screen
   readers and is shown in the menu, so it is reachable by touch too. */
@media (max-width: 1280px) {
  .ci-user__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
@media (max-width: 1080px) {
  .ci-header__inner { height: auto; flex-wrap: wrap; row-gap: 0; }
  .ci-header__brand, .ci-header__end { min-height: 56px; }
  .ci-header__end { margin-left: auto; }
  .ci-header__menu {
    order: 3;
    flex-basis: 100%;
    height: 44px;
    margin: 0 calc(-1 * var(--ci-gutter));
    padding: 0 calc(var(--ci-gutter) - var(--ci-nav-pad));
    border-top: var(--ci-hairline) solid rgba(255, 255, 255, 0.08);
  }
  /* The groups end the menu's row, near the screen's right edge. */
  .ci-navgroup__menu { left: auto; right: 0; }
}
@media (max-width: 520px) {
  .ci-header__logo { display: none; }
  .ci-header__mark { display: block; }
  /* On a phone: monogram and the app's name, never without the name; the
     name a size smaller, so "Transacciones" fits beside the switcher. */
  .ci-header__brand { gap: var(--ci-space-3); }
  .ci-header__app { padding-left: var(--ci-space-3); font-size: 0.75rem; letter-spacing: 0.14em; }
  .ci-header__end { gap: var(--ci-space-2); }
  .ci-user .ci-user__chevron { display: none; }
  .ci-user__toggle { padding: 4px; }
  .ci-lang__option { min-width: 28px; }
}
/* Small phones (360 px): a little tighter, so the name still fits beside the
   switcher. */
@media (max-width: 389px) {
  .ci-header__brand { gap: var(--ci-space-2); }
  .ci-header__app { padding-left: var(--ci-space-2); font-size: 0.6875rem; letter-spacing: 0.08em; }
  .ci-lang__option { min-width: 24px; padding-left: 2px; padding-right: 2px; }
}

/* ---------- Page head ---------- */

.ci-pagehead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: var(--ci-space-5);
  margin: var(--ci-space-7) 0 var(--ci-space-6);
}
.ci-pagehead__back {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--ci-space-3);
  color: var(--ci-text-muted);
  font-size: var(--ci-fs-sm);
  text-decoration: none;
}
.ci-pagehead__back:hover { color: var(--ci-navy); }
.ci-pagehead__back svg { width: 16px; height: 16px; }
.ci-pagehead__title { margin: 0; font-size: var(--ci-fs-3xl); }
.ci-pagehead__actions { display: flex; flex-wrap: wrap; gap: var(--ci-space-2); }
/* Meta line, then the filete runs to the edge, as "REAL ESTATE" and its
   rule do in the logo. */
.ci-pagehead__meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--ci-space-4);
  max-width: none;
  margin: var(--ci-space-3) 0 0;
  color: var(--ci-text-muted);
  font-size: var(--ci-fs-sm);
}
.ci-pagehead__meta::after {
  content: "";
  flex: 1;
  min-width: var(--ci-space-7);
  height: var(--ci-hairline);
  background: var(--ci-rule);
}
@media (max-width: 640px) {
  .ci-pagehead { grid-template-columns: minmax(0, 1fr); row-gap: var(--ci-space-4); }
  .ci-pagehead__title { font-size: var(--ci-fs-2xl); }
  .ci-pagehead__actions { order: 3; }
}

/* The settings-icon group ("More"): the menu items past the sixth. */
.ci-navgroup__toggle--icon { padding: 0 10px; }
.ci-navgroup[hidden] { display: none; }
.ci-navgroup__toggle--icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ci-navgroup:last-child .ci-navgroup__menu { left: auto; right: 0; }

/* ---------- App switcher (A-S-T-R-O) ---------- */

.ci-apps { position: relative; flex-shrink: 0; }
.ci-apps__toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--ci-radius-md);
  color: var(--ci-text-on-navy-muted);
  list-style: none;
  cursor: pointer;
}
.ci-apps__toggle::-webkit-details-marker { display: none; }
.ci-apps__toggle:hover, .ci-apps[open] > .ci-apps__toggle { color: var(--ci-white); background: var(--ci-navy-raised); }
.ci-apps__toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ci-apps__menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  width: 320px;
  padding: var(--ci-space-3);
  background: var(--ci-surface);
  border: var(--ci-hairline) solid var(--ci-line);
  border-top: 2px solid var(--ci-rule);
  border-radius: var(--ci-radius-md);
  box-shadow: var(--ci-shadow-overlay);
  color: var(--ci-navy);
}
.ci-apps__title {
  margin: 4px 8px 8px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ci-text-muted);
}
.ci-apps__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.ci-apps__item {
  display: flex;
  align-items: center;
  gap: var(--ci-space-3);
  padding: 8px;
  border-radius: var(--ci-radius-sm);
  color: var(--ci-navy);
  text-decoration: none;
}
.ci-apps__item:hover { background: var(--ci-gold-wash); }
.ci-apps__item:focus-visible { outline-color: var(--ci-navy); outline-offset: -2px; }
.ci-apps__item[aria-current="page"] { background: var(--ci-gold-wash); box-shadow: inset 3px 0 0 var(--ci-rule); }
.ci-apps__icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--ci-radius-sm); }
.ci-apps__text { display: grid; min-width: 0; }
.ci-apps__name { font-weight: 500; }
.ci-apps__sub { overflow: hidden; font-size: var(--ci-fs-sm); color: var(--ci-text-muted); white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 520px) {
  /* On a phone the first row holds the monogram, the app's name, the
     languages and the user; the switcher moves to the right end of the menu
     row, so the header keeps two rows. */
  .ci-header__inner:has(.ci-header__menu) { position: relative; }
  .ci-header__inner:has(.ci-header__menu) .ci-apps { position: absolute; top: 60px; right: calc(var(--ci-gutter) - 6px); }
  .ci-header__inner:has(.ci-header__menu) .ci-header__menu { padding-right: 44px; }
  .ci-apps__menu { position: fixed; top: 108px; left: var(--ci-space-3); right: var(--ci-space-3); width: auto; }
}

/* ---------- Buttons ----------
   Three variants: primary (gold, the one main action on a screen),
   secondary (navy, every other action) and tertiary (a text link, no frame).
   Sentence case, never capitals. "accent" and "quiet" are the names before
   0.10.0 and draw primary and tertiary; "danger" is for destructive actions. */

.ci-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ci-space-2);
  min-height: 40px;
  padding: 0 18px;
  border: var(--ci-hairline) solid var(--ci-navy);
  border-radius: var(--ci-radius-md);
  background: var(--ci-navy);
  color: var(--ci-white);
  font-family: var(--ci-font-text);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms var(--ci-ease), border-color 150ms var(--ci-ease), color 150ms var(--ci-ease);
}
.ci-btn:hover { background: var(--ci-navy-raised); border-color: var(--ci-navy-raised); }
.ci-btn:active { background: var(--ci-navy-deep); border-color: var(--ci-navy-deep); }
.ci-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Primary: gold, at most once per screen. */
.ci-btn--primary,
.ci-btn--accent {
  background: var(--ci-gold);
  border-color: var(--ci-gold);
  color: var(--ci-navy-deep);
}
.ci-btn--primary:hover, .ci-btn--accent:hover { background: var(--ci-gold-shadow); border-color: var(--ci-gold-shadow); }
.ci-btn--primary:active, .ci-btn--accent:active { background: var(--ci-gold-shadow); border-color: var(--ci-navy-deep); }

/* Tertiary: a text link with the gold underline, no frame. */
.ci-btn--tertiary,
.ci-btn--quiet {
  min-height: 32px;
  padding: 0 var(--ci-space-1);
  background: transparent;
  border-color: transparent;
  color: var(--ci-navy);
  text-decoration: underline;
  text-decoration-color: var(--ci-gold);
  text-underline-offset: 0.3em;
}
.ci-btn--tertiary:hover, .ci-btn--tertiary:active,
.ci-btn--quiet:hover, .ci-btn--quiet:active { background: transparent; border-color: transparent; text-decoration-thickness: 2px; }

.ci-btn--danger { background: var(--ci-white); border-color: var(--ci-danger); color: var(--ci-danger); }
.ci-btn--danger:hover,
.ci-btn--danger:active { background: var(--ci-danger-tint); border-color: var(--ci-danger); }

.ci-btn--sm { border-radius: var(--ci-radius-sm); min-height: 32px; padding: 0 var(--ci-space-3); font-size: var(--ci-fs-sm); }
.ci-btn--lg { min-height: 48px; padding: 0 var(--ci-space-5); font-size: var(--ci-fs-md); }
.ci-btn--block { width: 100%; }

.ci-btn:disabled,
.ci-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* ---------- Forms ---------- */

.ci-field { display: grid; align-content: start; gap: 6px; margin-bottom: 20px; min-width: 0; }
.ci-label { font-size: var(--ci-fs-sm); font-weight: 500; color: var(--ci-navy); }
.ci-label__optional { font-weight: 400; color: var(--ci-text-muted); }

.ci-input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  background: var(--ci-white);
  border: var(--ci-hairline) solid var(--ci-line-strong);
  border-radius: var(--ci-radius-md);
  color: var(--ci-navy);
  font-family: var(--ci-font-text);
  font-size: var(--ci-fs-md);
  line-height: 1.4;
  transition: border-color 150ms var(--ci-ease), box-shadow 150ms var(--ci-ease);
}
.ci-input::placeholder { color: var(--ci-text-muted); opacity: 0.85; }
.ci-input:hover { border-color: var(--ci-navy); }
.ci-input:focus,
.ci-input:focus-visible { outline: none; border-color: var(--ci-navy); box-shadow: var(--ci-focus-ring); }
.ci-input:disabled { background: var(--ci-surface-sunk); color: var(--ci-text-muted); cursor: not-allowed; }
select.ci-input {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231E2A42' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 11px 8px;
}
textarea.ci-input { min-height: 112px; resize: vertical; line-height: var(--ci-lh-text); }

.ci-input-icon { position: relative; }
.ci-input-icon > svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--ci-text-muted);
  pointer-events: none;
}
.ci-input-icon > .ci-input { padding-left: 38px; }

.ci-hint { margin: 0; font-size: var(--ci-fs-sm); color: var(--ci-text-muted); }
.ci-field--error .ci-input { border-color: var(--ci-danger); }
.ci-field--error .ci-input:focus { box-shadow: 0 0 0 3px rgba(168, 50, 42, 0.22); }
.ci-error-text { margin: 0; font-size: var(--ci-fs-sm); font-weight: 500; color: var(--ci-danger); }

.ci-fieldset { margin: 0 0 var(--ci-space-5); padding: 0; border: 0; min-width: 0; }
.ci-legend {
  display: flex;
  align-items: center;
  gap: var(--ci-space-3);
  width: 100%;
  margin-bottom: var(--ci-space-4);
  padding: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: var(--ci-tracking-caps);
  text-transform: uppercase;
  color: var(--ci-text-muted);
}
.ci-legend::after { content: ""; flex: 1; height: var(--ci-hairline); background: var(--ci-line); }

.ci-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--ci-fs-md);
  cursor: pointer;
}
.ci-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ci-navy); flex-shrink: 0; }

.ci-form-row {
  display: grid;
  gap: 0 var(--ci-space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.ci-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--ci-space-3);
  margin-bottom: var(--ci-space-4);
}
.ci-toolbar .ci-field { margin: 0; }
.ci-toolbar__grow { flex: 1 1 260px; }
/* Half the row (0.7.0), e.g. a short search field with its button beside it. */
.ci-toolbar__half { flex: 0 1 50%; min-width: min(100%, 240px); }

/* ---------- Tables ---------- */

/* Only the table's box is rounded; rows stay square. */
.ci-table-wrap {
  overflow-x: auto;
  background: var(--ci-surface);
  border: var(--ci-hairline) solid var(--ci-line);
  border-radius: var(--ci-radius-lg);
}
.ci-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.ci-table th {
  padding: 14px 16px 12px;
  border-bottom: var(--ci-hairline) solid var(--ci-navy);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ci-text-muted);
}
.ci-table td {
  padding: 14px 16px;
  border-bottom: var(--ci-hairline) solid var(--ci-line);
  vertical-align: middle;
}
.ci-table tbody tr:last-child td { border-bottom: 0; }
.ci-table tbody tr:hover { background: var(--ci-gold-wash); }
.ci-table .ci-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ci-table__primary { display: block; font-weight: 500; color: var(--ci-navy); }
a.ci-table__primary { text-decoration: none; }
a.ci-table__primary:hover { text-decoration: underline; text-decoration-color: var(--ci-gold); }
.ci-table__sub { display: block; margin-top: 2px; font-size: var(--ci-fs-sm); color: var(--ci-text-muted); }
.ci-table__ref { font-variant-numeric: tabular-nums; color: var(--ci-text-muted); white-space: nowrap; }
.ci-table__none { color: var(--ci-text-muted); }
.ci-table tbody tr.ci-table__empty:hover { background: none; }
.ci-table__empty td { padding: 0; }

/* Sortable headers: the whole label is the control; the arrows show the
   order (aria-sort says it to screen readers). */
.ci-table__sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -4px -6px;
  padding: 4px 6px;
  border: 0;
  border-radius: var(--ci-radius-sm);
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: none;
  cursor: pointer;
}
.ci-table__sort:hover { color: var(--ci-navy); }
.ci-table__sort:focus-visible { outline-color: var(--ci-navy); }
.ci-table th[aria-sort="ascending"], .ci-table th[aria-sort="descending"] { color: var(--ci-navy); }
.ci-table__sort-icon { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ci-table__sort-icon path { opacity: 0.35; }
.ci-table__sort-icon path.is-on { opacity: 1; stroke: var(--ci-gold-shadow); stroke-width: 1.8; }
.ci-num .ci-table__sort { flex-direction: row-reverse; }

/* A long table keeps its header in view: it scrolls inside its own box. */
.ci-table-wrap--sticky { max-height: var(--ci-table-max-height, 70vh); overflow: auto; }
.ci-table-wrap--sticky thead th { position: sticky; top: 0; z-index: 1; background: var(--ci-surface); box-shadow: inset 0 -1px 0 var(--ci-navy); border-bottom: 0; }

/* On a phone a table marked stack=true shows each row as a card: the primary
   column as its title, the others as "label  value" lines. */
@media (max-width: 640px) {
  .ci-table-wrap:has(.ci-table--stack) { border: 0; background: none; overflow: visible; max-height: none; }
  .ci-table--stack, .ci-table--stack tbody, .ci-table--stack tr, .ci-table--stack td { display: block; }
  .ci-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ci-table--stack tbody tr {
    border-radius: var(--ci-radius-lg);
    margin-bottom: var(--ci-space-3);
    padding: var(--ci-space-3) var(--ci-space-4);
    background: var(--ci-surface);
    border: var(--ci-hairline) solid var(--ci-line);
  }
  .ci-table--stack tbody tr:hover { background: var(--ci-surface); }
  .ci-table--stack td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--ci-space-4);
    padding: 6px 0;
    border-bottom: 0;
    text-align: right;
  }
  .ci-table--stack td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: left;
    color: var(--ci-text-muted);
  }
  .ci-table--stack td.ci-table__cell--primary {
    display: block;
    margin-bottom: 4px;
    padding: 0 0 8px;
    border-bottom: var(--ci-hairline) solid var(--ci-line);
    text-align: left;
    font-size: var(--ci-fs-md);
  }
  .ci-table--stack td.ci-table__cell--primary::before { content: none; }
  .ci-table--stack td.ci-table__cell--wide { display: none; }
  .ci-table--stack .ci-table__empty td { display: block; text-align: center; }
  .ci-table--stack .ci-table__empty td::before { content: none; }
}

/* ---------- Badges ---------- */

.ci-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px 3px;
  border-radius: var(--ci-radius-full);
  background: var(--ci-info-tint);
  color: var(--ci-navy);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}
.ci-badge--neutral { background: var(--ci-surface-sunk); color: var(--ci-text-muted); }
/* Gold on navy: the brand's own pairing, kept for exclusive listings. */
.ci-badge--gold { background: var(--ci-navy); color: var(--ci-gold); }
.ci-badge--success { background: var(--ci-success-tint); color: var(--ci-success); }
.ci-badge--warning { background: var(--ci-warning-tint); color: var(--ci-warning); }
.ci-badge--danger { background: var(--ci-danger-tint); color: var(--ci-danger); }

/* ---------- Panels ---------- */

.ci-panel { background: var(--ci-surface); border: var(--ci-hairline) solid var(--ci-line); border-radius: var(--ci-radius-lg); min-width: 0; }
/* No boxes in boxes: inside a panel, a panel or a table drops its own frame. */
.ci-panel .ci-panel,
.ci-panel .ci-table-wrap { border: 0; border-radius: 0; }
.ci-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ci-space-4);
  padding: 18px var(--ci-space-5);
  border-bottom: var(--ci-hairline) solid var(--ci-line);
}
.ci-panel__title { margin: 0; font-family: var(--ci-font-title); font-weight: 400; font-size: var(--ci-fs-xl); line-height: var(--ci-lh-title); }
.ci-panel__body { padding: var(--ci-space-5); }

/* ---------- Property card ---------- */

.ci-property {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;                   /* the photo follows the card's corners */
  border-radius: var(--ci-radius-xl);
  background: var(--ci-surface);
  border: var(--ci-hairline) solid var(--ci-line);
  color: var(--ci-navy);
  text-decoration: none;
  transition: border-color 150ms var(--ci-ease);
}
a.ci-property:hover { border-color: var(--ci-line-strong); }
.ci-property__media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--ci-surface-sunk);
}
.ci-property__img { width: 100%; height: 100%; object-fit: cover; }
.ci-property__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--ci-space-3);
  font-size: var(--ci-fs-sm);
  color: var(--ci-text-muted);
}
.ci-property__placeholder img { width: 52px; opacity: 0.35; }
.ci-property__badge { position: absolute; top: var(--ci-space-3); left: var(--ci-space-3); }
.ci-property__score {
  position: absolute;
  top: var(--ci-space-3);
  right: var(--ci-space-3);
  padding: 3px 9px;
  border-radius: var(--ci-radius-full);
  background: var(--ci-navy);
  color: var(--ci-gold);
  font-size: var(--ci-fs-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ci-property__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px 20px 20px;
}
.ci-property__kicker {
  display: flex;
  justify-content: space-between;
  gap: var(--ci-space-3);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ci-text-muted);
}
.ci-property__ref { letter-spacing: 0.06em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ci-property__title { margin: 8px 0 0; font-size: var(--ci-fs-md); font-weight: 500; line-height: 1.4; }
.ci-property__price {
  margin: 10px 0 0;
  font-family: var(--ci-font-title);
  font-size: var(--ci-fs-2xl);
  line-height: 1.1;
  font-synthesis: none;
}
.ci-property__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ci-space-2) 20px;
  margin: auto 0 0;
  padding: 14px 0 0;
  list-style: none;
}
.ci-property__price + .ci-property__facts { margin-top: 16px; border-top: var(--ci-hairline) solid var(--ci-line); }
.ci-property__fact { display: inline-flex; align-items: center; gap: 7px; font-size: 0.875rem; }
.ci-property__fact svg { width: 18px; height: 18px; fill: none; stroke: var(--ci-gold); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
/* How the listing meets the request: one line per criterion, the mark in
   the state's colour and the text in navy, so it reads without colour too. */
.ci-property__criteria {
  display: grid;
  gap: 4px;
  margin: 14px 0 0;
  padding: 12px 0 0;
  border-top: var(--ci-hairline) solid var(--ci-line);
  list-style: none;
  font-size: var(--ci-fs-sm);
}
.ci-property__criterion { display: flex; gap: 8px; }
.ci-property__mark { flex-shrink: 0; width: 1em; font-weight: 600; text-align: center; }
.ci-property__criterion--ok .ci-property__mark { color: var(--ci-success); }
.ci-property__criterion--part .ci-property__mark { color: var(--ci-warning); }
.ci-property__criterion--miss .ci-property__mark { color: var(--ci-danger); }
.ci-property__criterion--unknown { color: var(--ci-text-muted); }
.ci-property__extra { margin-top: 16px; padding-top: 14px; border-top: var(--ci-hairline) solid var(--ci-line); }

/* ---------- Empty states ---------- */

.ci-empty {
  display: grid;
  justify-items: center;
  padding: 56px var(--ci-space-5);
  text-align: center;
}
.ci-empty__mark { width: 44px; height: auto; }
.ci-empty__title {
  margin: 20px 0 6px;
  font-family: var(--ci-font-title);
  font-weight: 400;
  font-size: var(--ci-fs-xl);
  line-height: var(--ci-lh-title);
  color: var(--ci-navy);
}
.ci-empty__text { max-width: 44ch; margin: 0 0 20px; color: var(--ci-text-muted); }

/* Empty start screen: a whole page with nothing in it yet. It is the one
   in-app place that carries the large monogram watermark. */
.ci-empty--page {
  position: relative;
  overflow: hidden;
  border-radius: var(--ci-radius-lg);
  min-height: 420px;
  align-content: center;
  background: var(--ci-surface);
  border: var(--ci-hairline) solid var(--ci-line);
}
.ci-empty--page > * { position: relative; }
.ci-empty--page .ci-empty__title { font-size: var(--ci-fs-2xl); }
/* The gold monogram, as on the login and error pages. It is decoration, not
   text, so it stays faint on white and never competes with the title. */
.ci-empty__watermark {
  position: absolute !important;
  right: -4%;
  bottom: -22%;
  width: 52%;
  max-width: 460px;
  opacity: 0.22;
  pointer-events: none;
}

/* ---------- Alerts ---------- */

.ci-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--ci-space-3);
  padding: var(--ci-space-4) 20px;
  border-radius: var(--ci-radius-lg);
  background: var(--ci-info-tint);
  color: var(--ci-navy);
}
.ci-alert__icon { width: 20px; height: 20px; margin-top: 1px; }
.ci-alert__title { margin: 0 0 2px; font-weight: 600; }
.ci-alert__text { margin: 0; max-width: none; }
.ci-alert__text a { font-weight: 500; }
.ci-alert--danger { background: var(--ci-danger-tint); }
.ci-alert--danger .ci-alert__icon,
.ci-alert--danger .ci-alert__title { color: var(--ci-danger); }
.ci-alert--warning { background: var(--ci-warning-tint); }
.ci-alert--warning .ci-alert__icon,
.ci-alert--warning .ci-alert__title { color: var(--ci-warning); }
.ci-alert--success { background: var(--ci-success-tint); }
.ci-alert--success .ci-alert__icon,
.ci-alert--success .ci-alert__title { color: var(--ci-success); }

/* ---------- Figures (KPI tiles) ---------- */

.ci-stats {
  display: grid;
  gap: var(--ci-space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.ci-stat {
  border-radius: var(--ci-radius-lg);
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 18px 20px;
  background: var(--ci-surface);
  border: var(--ci-hairline) solid var(--ci-line);
  color: var(--ci-navy);
  text-decoration: none;
}
a.ci-stat:hover { border-color: var(--ci-line-strong); }
.ci-stat__label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ci-text-muted);
}
.ci-stat__value {
  margin: 0;
  font-family: var(--ci-font-title);
  font-size: var(--ci-fs-3xl);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  font-synthesis: none;
}
.ci-stat__change { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin: 0; font-size: var(--ci-fs-sm); }
.ci-stat__arrow { font-size: 0.625rem; }
.ci-stat__delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.ci-stat__change--good { color: var(--ci-success); }
.ci-stat__change--bad { color: var(--ci-danger); }
.ci-stat__change--neutral { color: var(--ci-text-muted); }
.ci-stat__period { font-weight: 400; color: var(--ci-text-muted); }
.ci-stat__spark { margin-top: 6px; }
.ci-spark { display: block; width: 100%; max-width: 160px; height: auto; overflow: visible; }
.ci-spark polyline { fill: none; stroke: var(--ci-series-1); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ci-spark circle { fill: var(--ci-series-1); }
@media (max-width: 640px) {
  .ci-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ci-space-3); }
  .ci-stat { padding: 14px; }
  .ci-stat__value { font-size: var(--ci-fs-2xl); }
}

/* ---------- Charts ---------- */

.ci-chart {
  border-radius: var(--ci-radius-lg);
  position: relative;
  margin: 0;
  padding: 18px 20px 14px;
  background: var(--ci-surface);
  border: var(--ci-hairline) solid var(--ci-line);
}
.ci-chart__title { margin: 0 0 var(--ci-space-3); font-weight: 500; color: var(--ci-navy); }
/* The plot shows once ciui.js draws it; without JavaScript the table shows instead. */
.ci-chart:not(.is-drawn) .ci-chart__plot { display: none; }
.ci-chart__plot { position: relative; height: var(--ci-chart-height, 240px); }
.ci-chart__plot svg { display: block; width: 100%; height: 100%; overflow: visible; touch-action: pan-y; }
.ci-chart__legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 var(--ci-space-3); padding: 0; list-style: none; font-size: var(--ci-fs-sm); color: var(--ci-text); }
.ci-chart__legend li { display: inline-flex; align-items: center; gap: 7px; }
.ci-chart__swatch { width: 12px; height: 3px; border-radius: 2px; background: var(--swatch); }
.ci-chart--bar .ci-chart__swatch { height: 10px; width: 10px; }
.ci-chart .ci-grid-line { stroke: var(--ci-line); stroke-width: 1; shape-rendering: crispEdges; }
.ci-chart .ci-axis-line { stroke: var(--ci-line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.ci-chart .ci-axis-text { fill: var(--ci-text-muted); font-family: var(--ci-font-text); font-size: 12px; font-variant-numeric: tabular-nums; }
.ci-chart .ci-series-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ci-chart .ci-crosshair { stroke: var(--ci-line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.ci-chart .ci-hover-dot { stroke: var(--ci-surface); stroke-width: 2; }
.ci-chart .ci-bar { transition: opacity 120ms var(--ci-ease); }
.ci-chart.is-hovering .ci-bar:not(.is-hover) { opacity: 0.45; }
.ci-chart__tooltip {
  position: absolute;
  z-index: 5;
  min-width: 140px;
  padding: 10px 12px;
  background: var(--ci-surface);
  border: var(--ci-hairline) solid var(--ci-line);
  border-top: 2px solid var(--ci-rule);
  border-radius: var(--ci-radius-md);
  box-shadow: var(--ci-shadow-overlay);
  font-size: var(--ci-fs-sm);
  color: var(--ci-text);
  pointer-events: none;
}
.ci-chart__tooltip[hidden] { display: none; }
.ci-chart__tooltip-title { margin: 0 0 6px; font-weight: 600; color: var(--ci-navy); }
.ci-chart__tooltip-row { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; }
.ci-chart__tooltip-row .ci-chart__swatch { flex-shrink: 0; }
.ci-chart__tooltip-value { margin-left: auto; padding-left: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ci-chart__data { margin-top: var(--ci-space-3); font-size: var(--ci-fs-sm); }
.ci-chart__data > summary { cursor: pointer; color: var(--ci-text-muted); }
.ci-chart__data > summary:hover { color: var(--ci-navy); }
.ci-chart__data[open] > summary { margin-bottom: var(--ci-space-2); }
.ci-chart__data .ci-table th[scope="row"] { font-size: 0.875rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ci-text); border-bottom: var(--ci-hairline) solid var(--ci-line); }

/* ---------- Tabs and segmented control ---------- */

.ci-tabs { margin: 0 0 var(--ci-space-5); border-bottom: var(--ci-hairline) solid var(--ci-line); }
.ci-tabs__list { display: flex; gap: var(--ci-space-5); overflow-x: auto; scrollbar-width: none; }
.ci-tabs__list[data-ciui-more] {
  --ci-nav-fade-start: #000;
  --ci-nav-fade-end: #000;
  -webkit-mask-image: linear-gradient(to right, var(--ci-nav-fade-start), #000 40px, #000 calc(100% - 40px), var(--ci-nav-fade-end));
  mask-image: linear-gradient(to right, var(--ci-nav-fade-start), #000 40px, #000 calc(100% - 40px), var(--ci-nav-fade-end));
}
.ci-tabs__list[data-ciui-more="start"], .ci-tabs__list[data-ciui-more="both"] { --ci-nav-fade-start: transparent; }
.ci-tabs__list[data-ciui-more="end"], .ci-tabs__list[data-ciui-more="both"] { --ci-nav-fade-end: transparent; }
.ci-tabs__tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 0 12px;
  border: 0;
  background: none;
  color: var(--ci-text-muted);
  font: inherit;
  font-size: 0.875rem;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.ci-tabs__tab:hover { color: var(--ci-navy); }
.ci-tabs__tab:focus-visible { outline-color: var(--ci-navy); outline-offset: -2px; }
.ci-tabs__tab[aria-current="page"], .ci-tabs__tab[aria-selected="true"] { color: var(--ci-navy); font-weight: 500; box-shadow: inset 0 -2px 0 var(--ci-rule); }
.ci-tabs__tab .ci-nav__badge { margin-left: 6px; }
.ci-tabpanel:focus-visible { outline-color: var(--ci-navy); outline-offset: 4px; }
.ci-tabpanel[hidden] { display: none; }

.ci-segmented {
  display: inline-flex;
  margin: 0;
  padding: 2px;
  border: var(--ci-hairline) solid var(--ci-line-strong);
  border-radius: var(--ci-radius-full);
  background: var(--ci-surface);
}
.ci-segmented__option { position: relative; display: flex; }
.ci-segmented__option input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ci-segmented__option span {
  padding: 6px 14px;
  border-radius: var(--ci-radius-full);
  font-size: 0.875rem;
  color: var(--ci-text-muted);
  white-space: nowrap;
}
.ci-segmented__option:hover span { color: var(--ci-navy); }
.ci-segmented__option input:checked + span { background: var(--ci-navy); color: var(--ci-white); }
.ci-segmented__option input:focus-visible + span { outline: 2px solid var(--ci-navy); outline-offset: 2px; }

/* ---------- Date range ---------- */

.ci-range { min-width: 0; margin: 0; padding: 0; border: 0; }
.ci-range > .ci-label { padding: 0; margin-bottom: 6px; }
.ci-range__fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ci-space-2); }
.ci-range__field { display: grid; gap: 4px; }
.ci-range__name { font-size: var(--ci-fs-xs); color: var(--ci-text-muted); }
.ci-range__field .ci-input { width: auto; min-width: 9.5em; }
.ci-range__dash { padding-bottom: 10px; color: var(--ci-text-muted); }
.ci-range__presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--ci-space-2); }
.ci-range__presets[hidden] { display: none; }
.ci-range__preset {
  padding: 4px 10px;
  border: var(--ci-hairline) solid var(--ci-line);
  border-radius: var(--ci-radius-full);
  background: var(--ci-surface);
  color: var(--ci-navy);
  font: inherit;
  font-size: var(--ci-fs-sm);
  cursor: pointer;
}
.ci-range__preset:hover { border-color: var(--ci-navy); }
.ci-range__preset[aria-pressed="true"] { background: var(--ci-navy); border-color: var(--ci-navy); color: var(--ci-white); }
.ci-range__preset:focus-visible { outline-color: var(--ci-navy); }

/* ---------- Loading (skeletons) ---------- */

.ci-skeleton { display: grid; gap: 10px; }
.ci-skeleton__bar, .ci-skeleton__block {
  display: block;
  border-radius: var(--ci-radius-sm);
  background: linear-gradient(90deg, var(--ci-surface-sunk) 0%, #F6F5F2 45%, var(--ci-surface-sunk) 90%) 0 0 / 300% 100%;
  animation: ci-shimmer 1.4s var(--ci-ease) infinite;
}
.ci-skeleton__bar { height: 12px; }
.ci-skeleton__bar--short { width: 45%; }
.ci-skeleton__bar--big { height: 30px; width: 60%; }
.ci-skeleton__block { height: 180px; }
.ci-skeleton__block--media { height: auto; aspect-ratio: 3 / 2; }
.ci-skeleton__row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--ci-space-4); padding: 6px 0; }
.ci-skeleton--stat, .ci-skeleton--chart, .ci-skeleton--card, .ci-skeleton--table {
  padding: 18px 20px;
  background: var(--ci-surface);
  border: var(--ci-hairline) solid var(--ci-line);
}
@keyframes ci-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .ci-skeleton__bar, .ci-skeleton__block { animation: none; }
}

/* ---------- Toasts ---------- */

.ci-toasts {
  position: fixed;
  right: var(--ci-space-5);
  bottom: var(--ci-space-5);
  z-index: 50;
  display: grid;
  gap: var(--ci-space-2);
  width: min(380px, calc(100vw - 2 * var(--ci-space-5)));
  pointer-events: none;
}
.ci-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--ci-space-3);
  padding: 12px 12px 12px 16px;
  background: var(--ci-navy);
  color: var(--ci-white);
  border-radius: var(--ci-radius-md);
  box-shadow: var(--ci-shadow-overlay);
  pointer-events: auto;
  animation: ci-toast-in 180ms var(--ci-ease);
}
.ci-toast__icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; color: var(--ci-gold); }
.ci-toast--danger { background: var(--ci-danger); }
.ci-toast--danger .ci-toast__icon, .ci-toast--warning .ci-toast__icon { color: inherit; }
.ci-toast--warning { background: var(--ci-warning-tint); color: var(--ci-navy); border-left: 3px solid var(--ci-warning); }
.ci-toast__text { flex: 1; margin: 0; max-width: none; font-size: var(--ci-fs-sm); line-height: 1.5; }
.ci-toast__close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: -4px -4px -4px 0;
  border: 0;
  border-radius: var(--ci-radius-sm);
  background: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.8;
}
.ci-toast__close:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.ci-toast--warning .ci-toast__close:hover { background: rgba(30, 42, 66, 0.08); }
.ci-toast__close svg { width: 16px; height: 16px; }
.ci-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 160ms var(--ci-ease), transform 160ms var(--ci-ease); }
@keyframes ci-toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .ci-toast, .ci-toast.is-leaving { animation: none; transition: none; }
}
@media (max-width: 640px) {
  .ci-toasts { right: var(--ci-space-3); left: var(--ci-space-3); bottom: var(--ci-space-3); width: auto; }
}

/* ---------- Banner: a problem every screen must show ---------- */

.ci-banner { background: var(--ci-danger); color: var(--ci-white); }
.ci-banner__inner {
  display: flex;
  align-items: flex-start;
  gap: var(--ci-space-3);
  max-width: calc(var(--ci-content-max) + 2 * var(--ci-gutter));
  margin: 0 auto;
  padding: var(--ci-space-3) var(--ci-gutter);
}
.ci-banner__icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.ci-banner__text { margin: 0; max-width: none; font-size: var(--ci-fs-sm); line-height: 1.5; }
.ci-banner__text strong { font-weight: 600; }
.ci-banner__text a { color: inherit; text-decoration: underline; }
.ci-banner--warning { background: var(--ci-warning-tint); color: var(--ci-navy); border-bottom: var(--ci-hairline) solid var(--ci-warning); }
.ci-banner--warning .ci-banner__icon, .ci-banner--warning strong { color: var(--ci-warning); }
.ci-banner--info { background: var(--ci-info-tint); color: var(--ci-navy); }
.ci-banner + .ci-banner { border-top: var(--ci-hairline) solid rgba(255, 255, 255, 0.25); }

/* ---------- Brand pages: login and error pages ---------- */

/* A full page in two halves: flat navy with the logo, the claim and the
   monogram watermark; bone with the form or message. Every app's login and
   error pages use it unchanged. */
.ci-brandpage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  min-height: 100vh;
}
.ci-brandpage__brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--ci-space-8) clamp(32px, 6vw, 96px);
  background: var(--ci-navy);
  color: var(--ci-text-on-navy);
}
.ci-brandpage__logo { position: relative; width: min(400px, 100%); height: auto; }
/* The claim's main position: centred under the logo, gold, uppercase,
   wide spacing (manual p. 13). */
.ci-brandpage__claim {
  position: relative;
  margin: 28px 0 0;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ci-gold);
}
/* Watermark: the monogram at low opacity, as on the back of the business
   card. */
.ci-brandpage__watermark {
  position: absolute;
  right: -12%;
  bottom: -18%;
  width: 70%;
  max-width: 640px;
  opacity: 0.07;
  pointer-events: none;
}
/* The company line: bottom left of the navy half; on a phone, the last line
   of the page. */
.ci-brandpage__company {
  position: absolute;
  left: clamp(32px, 6vw, 96px);
  bottom: var(--ci-space-6);
  margin: 0;
  font-size: var(--ci-fs-xs);
  color: var(--ci-text-on-navy-muted);
}
/* The language switcher in the top right corner of the page. */
.ci-brandpage__lang {
  position: absolute;
  top: var(--ci-space-5);
  right: clamp(16px, 4vw, 48px);
  z-index: 1;
}
.ci-brandpage__main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ci-space-7) var(--ci-space-5);
  background: var(--ci-page);
}
.ci-brandpage__panel { width: 100%; max-width: 380px; }
.ci-brandpage__code {
  margin: 0 0 var(--ci-space-3);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: var(--ci-tracking-caps);
  text-transform: uppercase;
  color: var(--ci-text-muted);
}
/* The app's icon above its name on the login page: the same gold letter on
   navy as the browser tab and the phone home screen. On the error page a
   smaller one heads the panel, next to the app's name. */
.ci-brandpage__app-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--ci-space-5);
  background: var(--ci-navy);
  border-radius: var(--ci-radius-md);
  font-family: var(--ci-font-title);
  font-size: 34px;
  line-height: 1;
  color: var(--ci-gold);
}
.ci-brandpage__app {
  display: flex;
  align-items: center;
  gap: var(--ci-space-3);
  margin: 0 0 var(--ci-space-6);
  font-weight: 500;
  color: var(--ci-navy);
}
.ci-brandpage__app .ci-brandpage__app-icon { width: 32px; height: 32px; margin: 0; font-size: 20px; }
.ci-brandpage__title { margin: 0 0 var(--ci-space-2); font-size: var(--ci-fs-3xl); }
.ci-brandpage__lead { margin: 0 0 var(--ci-space-6); color: var(--ci-text-muted); }
.ci-brandpage__panel .ci-alert { margin-bottom: var(--ci-space-5); }
.ci-brandpage__help { margin: var(--ci-space-5) 0 0; font-size: var(--ci-fs-sm); color: var(--ci-text-muted); }
/* An app's own line under it (block after_help) stays close to it. */
.ci-brandpage__help + .ci-brandpage__help { margin-top: var(--ci-space-2); }

@media (max-width: 860px) {
  .ci-brandpage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; }
  .ci-brandpage__brand { padding: var(--ci-space-7) var(--ci-space-5) var(--ci-space-6); }
  .ci-brandpage__logo { width: min(280px, 100%); }
  .ci-brandpage__claim { margin-top: 18px; font-size: 0.625rem; letter-spacing: 0.26em; }
  .ci-brandpage__company {
    position: static;
    padding: var(--ci-space-5) var(--ci-space-5) var(--ci-space-6);
    background: var(--ci-page);
    text-align: center;
    color: var(--ci-text-muted);
  }
  /* On a phone the top of the page is the navy band: use the dark tone. */
  .ci-brandpage__lang .ci-lang {
    --ci-lang-idle: var(--ci-text-on-navy-muted);
    --ci-lang-hover: var(--ci-text-on-navy);
    --ci-lang-active: var(--ci-text-on-navy-accent);
    --ci-lang-mark: transparent;
  }
  .ci-brandpage__lang { top: var(--ci-space-3); }
  .ci-brandpage__main { align-items: flex-start; padding-top: var(--ci-space-6); }
}

/* ---------- Footer ---------- */

.ci-footer {
  max-width: calc(var(--ci-content-max) + 2 * var(--ci-gutter));
  margin: 0 auto;
  padding: 0 var(--ci-gutter);
}
.ci-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--ci-space-2) var(--ci-space-5);
  padding: var(--ci-space-5) 0 var(--ci-space-6);
  border-top: var(--ci-hairline) solid var(--ci-line);
  font-size: var(--ci-fs-xs);
  color: var(--ci-text-muted);
}
.ci-footer__inner p { margin: 0; }

/* ---------- Keyboard focus on light areas ---------- */

/* The gold outline (base.css) is clear on navy but too faint on bone and
   white, so on light areas it turns navy. */
:where(.ci-main, .ci-brandpage__main, .ci-brandpage__lang, .ci-footer) :focus-visible { outline-color: var(--ci-navy); }
@media (max-width: 860px) {
  :where(.ci-brandpage__lang) :focus-visible { outline-color: var(--ci-gold); }
}

/* ---------- Utilities ---------- */

.ci-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}
.ci-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ci-space-2); }
.ci-stack { display: grid; gap: var(--ci-space-5); align-content: start; }
.ci-caps {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: var(--ci-tracking-caps);
  text-transform: uppercase;
}
.ci-muted { color: var(--ci-text-muted); }
.ci-figure { font-family: var(--ci-font-title); font-weight: 400; font-synthesis: none; }
.ci-prose { font-weight: 300; line-height: var(--ci-lh-prose); max-width: 68ch; }
/* Long text to read, e.g. a listing's description (0.7.0): larger, about 70
   characters a line. */
.ci-prose--reading { font-size: 1.125rem; line-height: 1.6; max-width: 70ch; }
.ci-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Page kinds (ciui_page, 0.5.0) ---------- */

.ci-page--wide { --ci-content-max: var(--ci-content-max-wide); }
.ci-page--warm { background: var(--ci-page-warm); }
.ci-page--warm .ci-panel,
.ci-page--warm .ci-filters,
.ci-page--warm .ci-property { box-shadow: var(--ci-shadow-card); }

/* ---------- Cards in a grid: 1 / 2 / 3 / 4 across ---------- */

.ci-cards { display: grid; gap: var(--ci-space-5); grid-template-columns: minmax(0, 1fr); align-items: stretch; }
@media (min-width: 640px)  { .ci-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .ci-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .ci-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Property card: lists of many (0.5.0) ---------- */

.ci-property--4x3 .ci-property__media { aspect-ratio: 4 / 3; }
.ci-property__media-link { display: block; width: 100%; height: 100%; }
.ci-property__badge { display: flex; flex-wrap: wrap; gap: 6px; right: var(--ci-space-3); pointer-events: none; }
.ci-property__per { margin-left: 8px; font-family: var(--ci-font-text); font-size: var(--ci-fs-sm); color: var(--ci-text-muted); white-space: nowrap; }
.ci-property__main { display: flex; flex: 1; flex-direction: column; color: inherit; text-decoration: none; }
.ci-property__foot {
  display: grid; flex: 1 1 auto; align-content: start; gap: 6px; padding: 12px 20px 14px;
  border-top: var(--ci-hairline) solid var(--ci-line); background: var(--ci-gold-wash);
  font-size: var(--ci-fs-sm);
}
/* One line of the foot: text cut with "…" on the left, a small link or note on the right. */
.ci-property__line { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.ci-property__line > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-property__line > :last-child:not(:first-child) { flex: none; color: var(--ci-text-muted); font-size: var(--ci-fs-xs); }
.ci-property--link { transition: border-color 150ms var(--ci-ease), transform 180ms var(--ci-ease), box-shadow 180ms var(--ci-ease); }
.ci-property--link:hover { border-color: var(--ci-line-strong); transform: translateY(-3px); box-shadow: var(--ci-shadow-card-hover); }
.ci-property--link .ci-property__img { transition: transform 400ms var(--ci-ease); }
.ci-property--link:hover .ci-property__img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) {
  .ci-property--link, .ci-property--link .ci-property__img { transition: none; }
  .ci-property--link:hover, .ci-property--link:hover .ci-property__img { transform: none; }
}
.ci-property--compact .ci-property__body { flex: 0 0 auto; padding-bottom: 0; }
/* Compact: the text keeps one height, so the foot starts on the same line in
   every card of a row and fills the rest of the card. */
.ci-property--compact .ci-property__main { flex: 0 0 auto; }
.ci-property--compact .ci-property__kicker > span:first-child,
.ci-property--compact .ci-property__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-property--compact .ci-property__title { margin-top: 6px; }
.ci-property--compact .ci-property__price { margin-top: 8px; min-height: 2.1rem; white-space: nowrap; }
.ci-property--compact .ci-property__facts { flex-wrap: nowrap; margin-top: 12px; padding: 12px 0 14px; border-top: var(--ci-hairline) solid var(--ci-line); }
.ci-property__nav {
  position: absolute; top: 50%; z-index: 1; display: grid; place-content: center;
  width: 36px; height: 36px; margin-top: -18px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: var(--ci-navy);
  box-shadow: 0 2px 8px rgba(20, 29, 48, 0.25); cursor: pointer; opacity: 0;
  transition: opacity 150ms var(--ci-ease);
}
.ci-property__nav svg { width: 20px; height: 20px; }
.ci-property__nav--prev { left: 10px; }
.ci-property__nav--next { right: 10px; }
.ci-property:hover .ci-property__nav, .ci-property__nav:focus-visible { opacity: 1; }
@media (hover: none) { .ci-property__nav { opacity: 1; } }
.ci-property__count {
  position: absolute; right: 10px; bottom: 10px; padding: 3px 9px; border-radius: var(--ci-radius-full);
  background: rgba(20, 29, 48, 0.72); color: var(--ci-white); font-size: var(--ci-fs-xs); font-variant-numeric: tabular-nums;
}

/* Badges in full colour (badge(..., solid=true)), e.g. on a photo. */
.ci-badge--solid { background: var(--ci-info); color: var(--ci-white); }
.ci-badge--solid.ci-badge--success { background: var(--ci-success); color: var(--ci-white); }
.ci-badge--solid.ci-badge--danger { background: var(--ci-danger); color: var(--ci-white); }
.ci-badge--solid.ci-badge--warning { background: var(--ci-warning); color: var(--ci-white); }
.ci-badge--solid.ci-badge--gold { background: var(--ci-gold); color: var(--ci-navy); }
.ci-badge--solid.ci-badge--neutral { background: rgba(20, 29, 48, 0.72); color: var(--ci-white); }

/* ---------- Filters ---------- */

.ci-filters { background: var(--ci-surface); border: var(--ci-hairline) solid var(--ci-line); border-radius: var(--ci-radius-lg); overflow: hidden; }
.ci-filters__section { padding: 14px 20px; border-top: var(--ci-hairline) solid var(--ci-line); }
.ci-filters__section:first-child { border-top: 0; }
.ci-filters__title {
  margin: 0 0 8px; font-size: 0.6875rem; font-weight: 600;
  letter-spacing: var(--ci-tracking-caps); text-transform: uppercase; color: var(--ci-gold-shadow);
}
.ci-filters__section .ci-form-row { align-items: end; }
.ci-filters__actions {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--ci-space-3);
  padding: 10px 20px; border-top: var(--ci-hairline) solid var(--ci-line); background: var(--ci-gold-wash);
}
.ci-filters input[type="checkbox"] { accent-color: var(--ci-gold-shadow); }
/* Compact inside the panel (0.6.0): the whole panel about half as tall as in 0.5.0. */
.ci-filters .ci-field { gap: 3px; margin-bottom: 8px; }
.ci-filters .ci-label { font-size: var(--ci-fs-xs); }
.ci-filters .ci-input { min-height: 34px; padding: 5px 10px; font-size: var(--ci-fs-sm); }
.ci-filters .ci-input-icon > .ci-input { padding-left: 34px; }
.ci-filters .ci-btn { min-height: 34px; padding: 0 14px; font-size: var(--ci-fs-sm); }
.ci-filters .ci-toolbar { gap: 8px; margin-bottom: 8px; }
.ci-filters .ci-form-row { gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.ci-filters .ci-chips { gap: 6px; }
.ci-filters .ci-chips + .ci-chips { margin-top: 8px; padding-top: 8px; }
.ci-filters .ci-chip span { min-height: 30px; padding: 0 12px; }
.ci-filters .ci-disclosures { gap: 6px; }
.ci-filters .ci-disclosure__summary { padding: 8px 14px; font-size: var(--ci-fs-md); }
.ci-filters .ci-disclosure__body { padding: 10px 14px 12px; }
.ci-filters .ci-disclosure--plain > .ci-disclosure__summary { padding: 0; font-size: var(--ci-fs-sm); }
.ci-filters .ci-disclosure--plain > .ci-disclosure__body { padding: 10px 0 0; }
.ci-filters .ci-stack { gap: 10px; }
.ci-filters .ci-toolbar .ci-switch { min-height: 34px; }
.ci-filters .ci-toolbar > .ci-btn--quiet { min-height: 34px; }
/* A field's message in a toolbar (0.7.0) hangs under the field, so the
   button beside it stays level with the input; the row makes room for it. */
.ci-filters .ci-toolbar .ci-field { margin-bottom: 0; }
.ci-toolbar .ci-field--error { position: relative; }
.ci-toolbar .ci-field--error .ci-error-text { position: absolute; top: calc(100% + 3px); left: 0; margin: 0; white-space: nowrap; }
.ci-toolbar:has(.ci-field--error) { margin-bottom: 30px; }

/* ---------- Filter bar: filters folded into one line that stays on top (0.6.0) ---------- */

.ci-filterbar { --ci-filterbar-height: 48px; margin: 0 0 var(--ci-space-4); }
/* Closed (after a search) it stays at the top of the screen while scrolling;
   opened from there (ciui.js adds --stuck) the filters show under it. */
.ci-filterbar:not([open]),
.ci-filterbar--stuck { position: sticky; top: 0; z-index: 30; }
.ci-filterbar__line {
  display: flex; align-items: center; gap: 10px; min-height: var(--ci-filterbar-height); padding: 0 16px;
  list-style: none; cursor: pointer; background: var(--ci-surface); color: var(--ci-navy);
  border: var(--ci-hairline) solid var(--ci-line); border-radius: var(--ci-radius-md);
  box-shadow: var(--ci-shadow-card); font-size: var(--ci-fs-sm);
}
.ci-filterbar__line::-webkit-details-marker { display: none; }
.ci-filterbar__line:hover { border-color: var(--ci-gold-shadow); }
.ci-filterbar__line:focus-visible { outline: 2px solid var(--ci-navy); outline-offset: 2px; }
.ci-filterbar__line > svg { flex: none; width: 16px; height: 16px; transition: transform 150ms var(--ci-ease); }
.ci-filterbar[open] > .ci-filterbar__line > svg:last-child { transform: rotate(180deg); }
.ci-filterbar__summary { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ci-filterbar__more, .ci-filterbar__less { flex: none; color: var(--ci-gold-shadow); font-weight: 600; }
.ci-filterbar[open] .ci-filterbar__more, .ci-filterbar:not([open]) .ci-filterbar__less { display: none; }
.ci-filterbar__body { margin-top: 8px; }
.ci-filterbar--stuck[open] > .ci-filterbar__body {
  max-height: calc(100vh - var(--ci-filterbar-height) - 24px); overflow: auto; overscroll-behavior: contain;
  border-radius: var(--ci-radius-lg); box-shadow: var(--ci-shadow-overlay);
}
/* A link to a place on the page (e.g. the first offer of the next page) does
   not end up under the line. */
body:has(.ci-filterbar) :target { scroll-margin-top: calc(var(--ci-filterbar-height, 48px) + 16px); }
@media (max-width: 639px) { .ci-filterbar__line { padding: 0 12px; } .ci-filterbar__more, .ci-filterbar__less { display: none; } }

/* ---------- Chips ---------- */

.ci-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ci-chips + .ci-chips { margin-top: var(--ci-space-4); padding-top: var(--ci-space-4); border-top: var(--ci-hairline) dashed var(--ci-line); }
.ci-chips__label { flex-basis: 100%; font-size: var(--ci-fs-xs); font-weight: 500; color: var(--ci-text-muted); }
.ci-chip { position: relative; display: inline-flex; }
.ci-chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ci-chip span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border: var(--ci-hairline) solid var(--ci-line-strong); border-radius: var(--ci-radius-full);
  background: var(--ci-surface); color: var(--ci-navy); font-size: var(--ci-fs-sm);
  transition: background 120ms var(--ci-ease), border-color 120ms var(--ci-ease);
}
.ci-chip:hover span { border-color: var(--ci-gold-shadow); }
.ci-chip input:checked + span { background: var(--ci-gold); border-color: var(--ci-gold); color: var(--ci-navy); font-weight: 500; }
.ci-chip input:focus-visible + span { outline: 2px solid var(--ci-navy); outline-offset: 2px; }

/* ---------- Options in columns: 1 / 2 / 3 / 4 equal columns across the box, filled top-down ---------- */

/* Every line has one height (--ci-row) and groups have no gap between them,
   so the lines of neighbouring columns sit on the same lines (0.6.0). The
   columns share the box's width — no empty space on the right. */
.ci-columns { --ci-row: 28px; --ci-column-gap: 32px; column-count: 1; column-gap: var(--ci-column-gap); column-fill: balance; }
@media (min-width: 640px)  { .ci-columns { column-count: 2; } }
@media (min-width: 1000px) { .ci-columns { column-count: 3; } }
@media (min-width: 1400px) { .ci-columns { column-count: 4; } }
.ci-columns__group { break-inside: avoid; padding: 0; }
.ci-columns { --ci-columns: 1; }
@media (min-width: 640px)  { .ci-columns { --ci-columns: 2; } }
@media (min-width: 1000px) { .ci-columns { --ci-columns: 3; } }
@media (min-width: 1400px) { .ci-columns { --ci-columns: 4; } }
/* With JavaScript: the groups split in order into the columns, so that the
   tallest column is as low as it can be (ciui.js). */
.ci-columns--balanced { display: grid; grid-template-columns: repeat(var(--ci-columns), minmax(0, 1fr)); column-count: auto; gap: 0 var(--ci-column-gap); align-items: start; }
.ci-option {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; column-gap: 8px;
  height: var(--ci-row, 28px); font-size: var(--ci-fs-sm); line-height: 1.4; cursor: pointer;
}
.ci-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--ci-gold-shadow); }
.ci-option > span:not(.ci-option__count) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-option__count { min-width: 2.5em; text-align: right; color: var(--ci-text-muted); font-variant-numeric: tabular-nums; }
.ci-option--0 > span:not(.ci-option__count) { font-weight: 600; }
.ci-option--1 { padding-left: 24px; }
/* A chosen line stands out (0.8.0): the tint of a tag behind it, the name in
   full ink and bold - gold text alone read lighter than the lines around it. */
.ci-option:has(input:checked) { background: var(--ci-gold-tint); box-shadow: 0 0 0 3px var(--ci-gold-tint); border-radius: 3px; }
.ci-option input:checked ~ span:not(.ci-option__count) { color: var(--ci-text); font-weight: 600; }
.ci-option input:checked ~ .ci-option__count { color: var(--ci-text); }
/* Tree (0.9.0): a third level, and a line with only part of its branch
   chosen: half the tint of a chosen line, the name in full ink. */
.ci-option--2 { padding-left: 48px; }
.ci-option:has(input:indeterminate) { background: color-mix(in srgb, var(--ci-gold-tint) 50%, transparent); border-radius: 3px; }
.ci-option input:indeterminate ~ span { color: var(--ci-text); }

/* ---------- Tags and switch ---------- */

.ci-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ci-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: var(--ci-radius-full); background: var(--ci-gold); color: var(--ci-navy); font-size: var(--ci-fs-sm); font-weight: 500; }
.ci-tag__remove { display: inline-grid; place-content: center; width: 24px; height: 24px; border-radius: 50%; color: var(--ci-navy); }
.ci-tag__remove svg { width: 14px; height: 14px; }
.ci-tag__remove:hover { background: rgba(20, 29, 48, 0.12); }
.ci-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-size: var(--ci-fs-sm); cursor: pointer; white-space: nowrap; }
.ci-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.ci-switch__track { position: relative; flex: none; width: 38px; height: 22px; border-radius: var(--ci-radius-full); background: var(--ci-line-strong); transition: background 150ms var(--ci-ease); }
.ci-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ci-white); transition: transform 150ms var(--ci-ease); }
.ci-switch input:checked + .ci-switch__track { background: var(--ci-gold-shadow); }
.ci-switch input:checked + .ci-switch__track::after { transform: translateX(16px); }
.ci-switch input:focus-visible + .ci-switch__track { outline: 2px solid var(--ci-navy); outline-offset: 2px; }

/* ---------- Disclosure ---------- */

.ci-disclosures { display: grid; gap: 8px; }
.ci-disclosure { border: var(--ci-hairline) solid var(--ci-line); border-radius: var(--ci-radius-lg); overflow: hidden; }
.ci-disclosure__summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; list-style: none; cursor: pointer;
  background: var(--ci-gold-wash); font-family: var(--ci-font-title); font-size: var(--ci-fs-lg);
}
.ci-disclosure__summary::-webkit-details-marker { display: none; }
.ci-disclosure__summary:hover { background: var(--ci-gold-tint); }
.ci-disclosure__summary:focus-visible { outline: 2px solid var(--ci-navy); outline-offset: -2px; }
.ci-disclosure__count { margin-left: auto; font-family: var(--ci-font-text); font-size: var(--ci-fs-sm); color: var(--ci-text-muted); font-variant-numeric: tabular-nums; }
.ci-disclosure__summary svg { flex: none; width: 16px; height: 16px; transition: transform 150ms var(--ci-ease); }
.ci-disclosure__count + svg { margin-left: 0; }
.ci-disclosure__summary > span:first-child + svg { margin-left: auto; }
.ci-disclosure[open] > .ci-disclosure__summary svg { transform: rotate(180deg); }
.ci-disclosure__body { padding: 14px 16px 16px; border-top: var(--ci-hairline) solid var(--ci-line); }
.ci-disclosure--plain { border: 0; border-radius: 0; overflow: visible; }
.ci-disclosure--plain > .ci-disclosure__summary { padding: 0; background: none; font-family: var(--ci-font-text); font-size: var(--ci-fs-md); font-weight: 500; }
.ci-disclosure--plain > .ci-disclosure__summary > span:first-child + svg { margin-left: 0; }
.ci-disclosure--plain > .ci-disclosure__summary:hover { background: none; color: var(--ci-gold-shadow); }
.ci-disclosure--plain > .ci-disclosure__body { padding: 16px 0 0; border: 0; }

/* ---------- Quick filters, results head, pager ---------- */

.ci-quick { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 var(--ci-space-5); }
.ci-quick__item {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 16px;
  background: var(--ci-surface); border: var(--ci-hairline) solid var(--ci-line); border-radius: var(--ci-radius-full);
  box-shadow: var(--ci-shadow-card); color: var(--ci-navy); text-decoration: none; font-size: var(--ci-fs-sm);
  transition: transform 150ms var(--ci-ease), box-shadow 150ms var(--ci-ease);
}
.ci-quick__item:hover { transform: translateY(-2px); box-shadow: var(--ci-shadow-card-hover); }
.ci-quick__item strong { font-family: var(--ci-font-title); font-size: var(--ci-fs-xl); font-weight: 400; line-height: 1; color: var(--ci-info); }
.ci-quick__item--success strong { color: var(--ci-success); }
.ci-quick__item--danger strong { color: var(--ci-danger); }
.ci-quick__item--gold strong { color: var(--ci-gold-shadow); }
.ci-quick__item[aria-current="true"] { background: var(--ci-navy); border-color: var(--ci-navy); color: var(--ci-text-on-navy); }
.ci-quick__item[aria-current="true"] strong { color: var(--ci-gold); }
.ci-results-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--ci-space-3); margin: var(--ci-space-6) 0 var(--ci-space-4); }
.ci-results-head__count { margin: 0; color: var(--ci-text-muted); font-size: var(--ci-fs-sm); }
.ci-results-head__count strong { margin-right: 4px; font-family: var(--ci-font-title); font-size: var(--ci-fs-2xl); font-weight: 400; color: var(--ci-navy); }
.ci-results-head__tools { display: flex; align-items: end; gap: var(--ci-space-3); }
.ci-results-head__tools .ci-field { margin: 0; }
.ci-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: var(--ci-space-6) 0; }
.ci-pager__page, .ci-pager__step {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 38px; height: 38px; padding: 0 10px;
  border: var(--ci-hairline) solid var(--ci-line); border-radius: var(--ci-radius-md); background: var(--ci-surface);
  color: var(--ci-navy); font-size: var(--ci-fs-sm); text-decoration: none; font-variant-numeric: tabular-nums;
}
.ci-pager__step svg { width: 16px; height: 16px; }
a.ci-pager__page:hover, .ci-pager__step:hover { border-color: var(--ci-gold-shadow); }
.ci-pager__page[aria-current="page"] { background: var(--ci-navy); border-color: var(--ci-navy); color: var(--ci-white); }
.ci-pager__gap { color: var(--ci-text-muted); }
@media (max-width: 639px) { .ci-pager__step span { display: none; } }

/* ---------- Gallery ---------- */

.ci-gallery { display: grid; gap: 10px; min-width: 0; }
/* Phones (0.8.1): a tap on the photo does nothing; arrows and a swipe change
   it; two fingers zoom the photo INSIDE its frame (ciui.js) and it springs back
   when the fingers lift or the photo changes. pan-y keeps the page scrolling
   up and down but leaves sideways moves and pinches to the gallery, so the
   browser never zooms or slides the whole page. */
.ci-gallery__stage { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--ci-radius-xl); background: var(--ci-navy-deep); touch-action: pan-y; }
.ci-gallery__img, .ci-gallery__dialog-img { transform-origin: 50% 50%; transition: transform 0.2s ease; }
.ci-gallery__img.is-zooming, .ci-gallery__dialog-img.is-zooming { transition: none; }
.ci-gallery__img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ci-gallery__nav, .ci-gallery__full, .ci-gallery__close {
  position: absolute; z-index: 1; display: grid; place-content: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: var(--ci-navy); cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 29, 48, 0.3);
  touch-action: manipulation;   /* quick taps on an arrow are taps, never Safari's double-tap zoom */
}
.ci-gallery__nav svg, .ci-gallery__full svg, .ci-gallery__close svg { width: 22px; height: 22px; }
.ci-gallery__nav { top: 50%; margin-top: -22px; }
.ci-gallery__nav--prev { left: 14px; }
.ci-gallery__nav--next { right: 14px; }
.ci-gallery__full { top: 14px; right: 14px; width: 38px; height: 38px; }
.ci-gallery__count { position: absolute; left: 14px; bottom: 14px; padding: 4px 10px; border-radius: var(--ci-radius-full); background: rgba(20, 29, 48, 0.72); color: var(--ci-white); font-size: var(--ci-fs-sm); font-variant-numeric: tabular-nums; }
.ci-gallery__thumbs { display: flex; gap: 8px; margin: 0; padding: 0 0 4px; overflow-x: auto; list-style: none; scroll-snap-type: x proximity; }
.ci-gallery__thumb { flex: none; width: 96px; aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: var(--ci-radius-sm); overflow: hidden; background: var(--ci-surface-sunk); cursor: pointer; scroll-snap-align: start; opacity: 0.75; }
.ci-gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ci-gallery__thumb:hover { opacity: 1; }
.ci-gallery__thumb[aria-current="true"] { border-color: var(--ci-gold); opacity: 1; }
/* Full screen = the visible screen: fixed to all four edges, not 100vw/100vh
   (on an iPhone 100vh is taller than what shows between Safari's bars, so the
   photo sat lower and ran off the bottom). */
.ci-gallery__dialog {
  position: fixed; inset: 0; width: auto; height: auto; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden; background: rgba(10, 14, 24, 0.96); touch-action: none;
}
.ci-gallery__dialog::backdrop { background: rgba(10, 14, 24, 0.96); }
.ci-gallery__dialog-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ci-gallery__dialog .ci-gallery__count { left: 50%; transform: translateX(-50%); bottom: 20px; }
.ci-gallery__close { top: 16px; right: 16px; }
@media (pointer: coarse) {
  /* A finger is bigger than a cursor: 48 px arrows, a little closer to the edge. */
  .ci-gallery__nav { width: 48px; height: 48px; margin-top: -24px; }
  .ci-gallery__nav--prev { left: 8px; }
  .ci-gallery__nav--next { right: 8px; }
}
.ci-gallery__all { display: grid; gap: 10px; }
.ci-gallery__all img { width: 100%; height: auto; }

/* ---------- Reference to copy ---------- */

.ci-ref { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; font-size: var(--ci-fs-sm); }
.ci-ref__label { color: var(--ci-text-muted); }
.ci-ref__value { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.ci-ref__copy {
  display: inline-grid; place-content: center; width: 26px; height: 26px; padding: 0;
  border: var(--ci-hairline) solid var(--ci-line); border-radius: var(--ci-radius-sm); background: var(--ci-surface);
  color: var(--ci-navy); cursor: pointer;
}
.ci-ref__copy svg { width: 15px; height: 15px; }
.ci-ref__copy:hover { border-color: var(--ci-gold-shadow); }
.ci-ref__copy:focus-visible { outline: 2px solid var(--ci-navy); outline-offset: 2px; }
.ci-ref__copy[data-ciui-copied] { border-color: var(--ci-success); color: var(--ci-success); }
.ci-ref__link { font-size: var(--ci-fs-xs); }
.ci-ref__link::after { content: " ↗"; }
.ci-ref__hint { flex-basis: 100%; color: var(--ci-text-muted); font-size: var(--ci-fs-xs); }

/* ---------- One object in detail: facts, features, map (0.6.0) ---------- */

/* Two columns only when the box has room for two of 240 px (not the screen:
   in a narrow side column the pairs stay one under another). */
.ci-facts {
  display: grid; gap: 0 var(--ci-space-6); margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(max(240px, calc(50% - var(--ci-space-6))), 1fr));
}
.ci-facts__row {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--ci-space-3); min-width: 0;
  padding: 7px 0; border-bottom: var(--ci-hairline) solid var(--ci-line);
}
.ci-facts__row dt { color: var(--ci-text-muted); }
.ci-facts__row dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.ci-features { columns: 3 190px; column-gap: var(--ci-space-6); margin: 0; padding: 0; list-style: none; }
.ci-features li { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; break-inside: avoid; }
.ci-features__icon { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--ci-success); }

.ci-map { display: grid; gap: 8px; margin: 0; min-width: 0; }
.ci-map__frame {
  display: block; width: 100%; aspect-ratio: 16 / 9; border: var(--ci-hairline) solid var(--ci-line);
  border-radius: var(--ci-radius-lg); background: var(--ci-surface-sunk);
}
.ci-map__caption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: var(--ci-fs-sm); }
.ci-map__caption a::after { content: " ↗"; }
.ci-map__approximate { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.ci-map__approximate svg { width: 16px; height: 16px; color: var(--ci-warning); }
.ci-map__note { flex-basis: 100%; color: var(--ci-text-muted); font-size: var(--ci-fs-xs); }
