/* ==========================================================================
   CENOVÁ MAPA — Varianta A "Editorial Paper"
   Premium redesign postavený na stávající DNA:
   teplý papír #f7f5ef · inková zeleno-černá #132526 · terakota #de6549 · aqua #bde3de
   Fonty: DM Sans (UI) + Manrope (headline)
   --------------------------------------------------------------------------
   Obsah
     01  Design tokeny
     02  Reset a základ dokumentu
     03  Layout shell
     04  Topbar (brand, model-status)
     05  Hero
     06  Estimator — rám a formulář
     07  Pole, čísla, typ nemovitosti
     08  Adresní napovídání
     09  Tlačítko, loader, hláška formuláře
     10  Výsledek — rám a hlavička
     11  Cenová karta (hrdina stránky)
     12  Grid výsledku, info karty, detaily
     13  Mapa, legenda, Leaflet
     14  Srovnatelné nemovitosti
     15  Skeleton / shimmer / vstupní animace
     16  Responsivita
     17  Přístupnost — reduced motion, forced colors, tisk
   ========================================================================== */


/* ==========================================================================
   01  DESIGN TOKENY
   ========================================================================== */

:root {
  /* --- Barvy: inkoust ------------------------------------------------ */
  --ink:            #132526;
  --ink-soft:       #345051;
  --ink-mute:       #5d7273;
  --muted:          #718080;
  --muted-light:    #98a5a4;

  /* --- Barvy: papír --------------------------------------------------- */
  --paper:          #f7f5ef;
  --paper-warm:     #fbf9f4;
  --paper-deep:     #ece9df;
  --surface:        #ffffff;

  /* --- Barvy: akcenty -------------------------------------------------- */
  --accent:         #de6549;
  --accent-deep:    #bd4830;
  --accent-soft:    #f0b19f;
  --accent-tint:    #fdf1ec;
  --aqua:           #bde3de;
  --aqua-deep:      #7fbcb4;
  --aqua-tint:      #eef8f6;

  /* --- Barvy: stavy ---------------------------------------------------- */
  --ok:             #167454;
  --ok-bg:          #ddf2e8;
  --warn:           #9a5f1e;
  --warn-bg:        #fdeed6;
  --danger:         #bd4830;

  /* --- Linky a předěly -------------------------------------------------- */
  --line:           rgba(19, 37, 38, .12);
  --line-strong:    rgba(19, 37, 38, .20);
  --line-hair:      rgba(19, 37, 38, .07);

  /* --- Typografie ------------------------------------------------------- */
  --sans:           'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --headline:       'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --fs-micro:       .6875rem;  /* 11px — štítky, eyebrow */
  --fs-tiny:        .75rem;    /* 12px */
  --fs-small:       .8125rem;  /* 13px */
  --fs-base:        .9375rem;  /* 15px */
  --fs-body:        1rem;      /* 16px */
  --fs-lead:        1.0625rem; /* 17px */

  --tracking-label: .14em;
  --tracking-tight: -.035em;
  --tracking-display: -.055em;

  /* --- Spacing scale (4 / 8 / 12 / 16 / 24 / 32 / 48 / 64) -------------- */
  --sp-1:  .25rem;   /*  4px */
  --sp-2:  .5rem;    /*  8px */
  --sp-3:  .75rem;   /* 12px */
  --sp-4:  1rem;     /* 16px */
  --sp-5:  1.25rem;  /* 20px */
  --sp-6:  1.5rem;   /* 24px */
  --sp-8:  2rem;     /* 32px */
  --sp-10: 2.5rem;   /* 40px */
  --sp-12: 3rem;     /* 48px */
  --sp-16: 4rem;     /* 64px */
  --sp-20: 5rem;     /* 80px */

  /* --- Rádiusy ---------------------------------------------------------- */
  --r-sm:   .5rem;    /*  8px */
  --r-md:   .75rem;   /* 12px */
  --r-lg:   1rem;     /* 16px */
  --r-xl:   1.25rem;  /* 20px */
  --r-2xl:  1.75rem;  /* 28px */
  --r-pill: 999px;

  /* --- Vrstvení: vícevrstvé měkké stíny --------------------------------- */
  --shadow-xs:
      0 1px 2px rgba(19, 37, 38, .05);
  --shadow-sm:
      0 1px 2px rgba(19, 37, 38, .05),
      0 2px 6px rgba(19, 37, 38, .04);
  --shadow-md:
      0 1px 2px rgba(19, 37, 38, .05),
      0 4px 10px rgba(19, 37, 38, .05),
      0 12px 24px rgba(19, 37, 38, .05);
  --shadow-lg:
      0 1px 2px rgba(19, 37, 38, .04),
      0 6px 16px rgba(19, 37, 38, .06),
      0 20px 40px rgba(19, 37, 38, .08);
  --shadow-xl:
      0 2px 4px rgba(19, 37, 38, .04),
      0 10px 24px rgba(19, 37, 38, .08),
      0 32px 64px rgba(19, 37, 38, .12);
  --shadow-ink:
      0 2px 6px rgba(19, 37, 38, .18),
      0 14px 32px rgba(19, 37, 38, .22),
      0 40px 72px rgba(19, 37, 38, .18);

  /* Jemné vnitřní světlo na kartách */
  --inset-light:  inset 0 1px 0 rgba(255, 255, 255, .85);
  --inset-dark:   inset 0 1px 0 rgba(255, 255, 255, .12);

  /* --- Pohyb ------------------------------------------------------------ */
  --ease:       cubic-bezier(.22, .61, .36, 1);
  --ease-out:   cubic-bezier(.16, 1, .3, 1);
  --t-fast:     140ms;
  --t-base:     220ms;
  --t-slow:     420ms;

  /* --- Focus ring -------------------------------------------------------- */
  --ring-color: var(--accent-deep);
  --ring:       0 0 0 2px var(--paper), 0 0 0 4px var(--ring-color);
}


/* ==========================================================================
   02  RESET A ZÁKLAD DOKUMENTU
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  font-optical-sizing: auto;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Teplé světlo v pravém horním rohu + terakotový dech vlevo dole */
  background:
      radial-gradient(ellipse 42rem 30rem at 96% -4%, rgba(189, 227, 222, .70), transparent 70%),
      radial-gradient(ellipse 34rem 26rem at -8% 58%, rgba(235, 183, 151, .18), transparent 70%),
      var(--paper);
  background-attachment: fixed;
}

/* Jemná papírová mřížka — tiskový rastr, ne wireframe */
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: '';
  pointer-events: none;
  opacity: .5;
  background-image:
      linear-gradient(rgba(19, 37, 38, .022) 1px, transparent 1px),
      linear-gradient(90deg, rgba(19, 37, 38, .022) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 100%);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Jednotný focus-visible ring ------------------------------------------ */
:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ring-color);
  outline-offset: 3px;
}

/* Utilita pro čísla, která mají držet sloupec */
.tnum,
#totalPrice,
#pricePerM2,
#priceRange,
#detailArea,
#detailPricePerM2,
.price-card strong,
.price-range b,
.nearby-price b,
.nearby-price small,
.details-card dd {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}


/* ==========================================================================
   03  LAYOUT SHELL
   ========================================================================== */

.page-shell {
  width: min(100% - var(--sp-12), 1200px);
  margin: 0 auto;
  padding: var(--sp-8) 0 var(--sp-20);
}


/* ==========================================================================
   04  TOPBAR
   ========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-1) 0;
  color: var(--ink);
  font-family: var(--headline);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: var(--tracking-display);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: opacity var(--t-fast) var(--ease);
}

.brand:hover {
  opacity: .78;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50% 50% 50% var(--sp-2);
  color: #fff;
  background:
      linear-gradient(150deg, #22403f 0%, var(--ink) 62%);
  box-shadow:
      3px 3px 0 var(--accent),
      var(--shadow-sm);
  font-family: var(--headline);
  font-size: .9375rem;
  font-weight: 800;
  letter-spacing: 0;
  transition: box-shadow var(--t-base) var(--ease),
              transform var(--t-base) var(--ease);
}

.brand:hover .brand-mark {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--accent), var(--shadow-sm);
}

.model-status {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .58);
  box-shadow: var(--shadow-xs), var(--inset-light);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}

.model-status i {
  position: relative;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2ca47d;
  box-shadow: 0 0 0 4px rgba(44, 164, 125, .14);
}

.model-status i::after {
  position: absolute;
  inset: 0;
  content: '';
  border-radius: 50%;
  background: inherit;
  animation: status-pulse 2.6s var(--ease-out) infinite;
}

@keyframes status-pulse {
  0%   { transform: scale(1);   opacity: .55; }
  70%  { transform: scale(3.2); opacity: 0; }
  100% { transform: scale(3.2); opacity: 0; }
}


/* ==========================================================================
   05  HERO
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(380px, 42vw, 520px);
  margin-top: var(--sp-6);
  padding:
      clamp(var(--sp-12), 6vw, var(--sp-16))
      clamp(var(--sp-6), 5vw, var(--sp-16))
      clamp(var(--sp-20), 11vw, 9rem);
  overflow: hidden;
  border-radius: var(--r-2xl);
  color: #fff;

  /* Fallback pro prohlížeče bez image-set() */
  background-image:
      linear-gradient(96deg,
          rgba(4, 16, 26, .95) 0%,
          rgba(4, 16, 26, .78) 34%,
          rgba(4, 16, 26, .30) 66%,
          rgba(4, 16, 26, .06) 100%),
      url('/cenova-mapa/assets/hero-prague-blue-hour.png');
  background-position: center 42%;
  background-size: cover;
  background-repeat: no-repeat;

  box-shadow: var(--shadow-xl);
}

/* Moderní prohlížeče: webp s PNG fallbackem */
@supports (background-image: image-set(url('a.webp') type('image/webp'))) {
  .hero {
    background-image:
        linear-gradient(96deg,
            rgba(4, 16, 26, .95) 0%,
            rgba(4, 16, 26, .78) 34%,
            rgba(4, 16, 26, .30) 66%,
            rgba(4, 16, 26, .06) 100%),
        image-set(
            url('/cenova-mapa/assets/hero-prague-blue-hour.webp') type('image/webp'),
            url('/cenova-mapa/assets/hero-prague-blue-hour.png')  type('image/png')
        );
  }
}

/* Spodní ztmavení, aby estimator „vyrostl" ze snímku */
.hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: '';
  background: linear-gradient(0deg, rgba(4, 16, 26, .55), transparent 46%);
}

/* Terakotový prstenec — podpis značky */
.hero::before {
  position: absolute;
  z-index: 0;
  right: clamp(var(--sp-6), 4vw, var(--sp-12));
  bottom: clamp(var(--sp-8), 5vw, var(--sp-12));
  width: clamp(56px, 7vw, 92px);
  height: clamp(56px, 7vw, 92px);
  content: '';
  border: 1px solid rgba(255, 255, 255, .40);
  border-radius: 50%;
  box-shadow: -18px -18px 0 -9px var(--accent);
}

.eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-4);
  color: var(--accent-soft);
  font-size: var(--fs-micro);
  font-weight: 800;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.eyebrow::before {
  width: var(--sp-6);
  height: 1px;
  content: '';
  background: currentColor;
  opacity: .55;
}

.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 16ch;
  margin: 0;
  color: #fff;
  font-family: var(--headline);
  font-size: clamp(2.75rem, 6.4vw, 5.25rem);
  font-weight: 800;
  line-height: .92;
  letter-spacing: -.055em;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(4, 16, 26, .35);
}

.hero h1 span {
  color: var(--accent-soft);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 46ch;
  margin: var(--sp-6) 0 0;
  color: rgba(255, 255, 255, .84);
  font-size: clamp(var(--fs-base), 1.1vw, var(--fs-lead));
  line-height: 1.62;
  text-wrap: pretty;
}


/* ==========================================================================
   06  ESTIMATOR — RÁM A FORMULÁŘ
   ========================================================================== */

.estimator {
  position: relative;
  z-index: 2;
  margin: clamp(-5.5rem, -6vw, -3.5rem) clamp(var(--sp-4), 3vw, var(--sp-12)) 0;
  padding: var(--sp-2);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: var(--r-2xl);
  background: rgba(247, 245, 239, .66);
  box-shadow:
      var(--shadow-xl),
      inset 0 1px 0 rgba(255, 255, 255, .7);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.estimator form {
  padding: clamp(var(--sp-5), 2.4vw, var(--sp-8));
  border-radius: calc(var(--r-2xl) - var(--sp-2));
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--inset-light);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 180px);
  gap: var(--sp-4);
}


/* ==========================================================================
   07  POLE, ČÍSLA, TYP NEMOVITOSTI
   ========================================================================== */

.field {
  display: grid;
  gap: var(--sp-2);
  min-width: 0;
}

.field > span,
.property-types legend {
  color: var(--ink-soft);
  font-size: var(--fs-micro);
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.field em {
  color: var(--muted-light);
  font-style: normal;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: none;
}

input {
  width: 100%;
  height: 3.5rem;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  outline: none;
  color: var(--ink);
  background: var(--paper-warm);
  box-shadow: inset 0 1px 2px rgba(19, 37, 38, .04);
  font-size: var(--fs-body);
  font-weight: 700;
  letter-spacing: -.01em;
  transition:
      border-color var(--t-fast) var(--ease),
      background var(--t-fast) var(--ease),
      box-shadow var(--t-fast) var(--ease);
}

input::placeholder {
  color: var(--muted-light);
  font-weight: 500;
  letter-spacing: 0;
}

input:hover {
  border-color: var(--line-strong);
  background: #fff;
}

input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow:
      0 0 0 4px rgba(222, 101, 73, .32),
      inset 0 1px 2px rgba(19, 37, 38, .03);
}

input:focus-visible {
  outline: none;
}

.field-location {
  position: relative;
  min-width: 0;
}

.field-location input {
  font-size: 1.0625rem;
  letter-spacing: -.015em;
}

/* --- Číselné pole s jednotkou -------------------------------------------- */
.field-area {
  min-width: 0;
}

.number-wrap {
  position: relative;
}

.number-wrap input {
  padding-right: 3rem;
  font-variant-numeric: tabular-nums;
}

.number-wrap b {
  position: absolute;
  top: 50%;
  right: var(--sp-4);
  transform: translateY(-50%);
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 700;
  pointer-events: none;
}

/* Skryjeme nativní spinnery — jednotka „m²" je čitelnější kotva */
.number-wrap input::-webkit-outer-spin-button,
.number-wrap input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.number-wrap input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* --- Typ nemovitosti ------------------------------------------------------ */
.property-types {
  min-width: 0;
  margin: var(--sp-6) 0 0;
  padding: 0;
  border: 0;
}

.property-types legend {
  margin-bottom: var(--sp-3);
  padding: 0;
}

.type-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.type-options label {
  position: relative;
  min-width: 0;
}

.type-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.type-options span {
  display: grid;
  min-width: 6.5rem;
  min-height: 2.75rem;
  place-items: center;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .6);
  box-shadow: var(--shadow-xs), var(--inset-light);
  font-size: var(--fs-tiny);
  font-weight: 800;
  letter-spacing: .01em;
  cursor: pointer;
  user-select: none;
  transition:
      color var(--t-fast) var(--ease),
      border-color var(--t-fast) var(--ease),
      background var(--t-fast) var(--ease),
      box-shadow var(--t-base) var(--ease),
      transform var(--t-fast) var(--ease);
}

.type-options label:hover span {
  border-color: var(--line-strong);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm), var(--inset-light);
}

.type-options input:checked + span {
  border-color: var(--ink);
  color: #fff;
  background: linear-gradient(160deg, #22403f, var(--ink) 70%);
  box-shadow:
      3px 3px 0 var(--accent),
      var(--shadow-sm),
      var(--inset-dark);
}

.type-options input:focus-visible + span {
  outline: 2px solid var(--ring-color);
  outline-offset: 3px;
}

.field-disposition {
  margin-top: var(--sp-5);
}


/* ==========================================================================
   08  ADRESNÍ NAPOVÍDÁNÍ
   ========================================================================== */

.address-control {
  position: relative;
}

.address-hint {
  min-height: 1.125rem;
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: .005em;
}

.address-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + var(--sp-2));
  right: 0;
  left: 0;
  overflow: hidden auto;
  max-height: min(22rem, 50vh);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
  animation: suggest-in 160ms var(--ease-out) both;
}

@keyframes suggest-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.address-suggestion {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border: 0;
  border-top: 1px solid var(--line-hair);
  color: var(--ink);
  background: #fff;
  font-size: var(--fs-small);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition:
      color var(--t-fast) var(--ease),
      background var(--t-fast) var(--ease),
      padding-left var(--t-fast) var(--ease);
}

.address-suggestion:first-child {
  border-top: 0;
}

.address-suggestion:hover,
.address-suggestion:focus-visible,
.address-suggestion[aria-selected='true'] {
  outline: none;
  color: var(--accent-deep);
  background: var(--accent-tint);
  padding-left: var(--sp-5);
}

.address-suggestion small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}


/* ==========================================================================
   09  TLAČÍTKO, LOADER, HLÁŠKA FORMULÁŘE
   ========================================================================== */

.estimate-button {
  display: flex;
  width: 100%;
  min-height: 3.5rem;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  padding: 0 var(--sp-6);
  border: 0;
  border-radius: var(--r-md);
  color: #fff;
  background: linear-gradient(160deg, #24413f 0%, var(--ink) 68%);
  box-shadow:
      5px 6px 0 var(--accent),
      var(--shadow-md),
      var(--inset-dark);
  font-family: var(--headline);
  font-size: var(--fs-base);
  font-weight: 800;
  letter-spacing: -.01em;
  cursor: pointer;
  transition:
      transform var(--t-fast) var(--ease),
      box-shadow var(--t-fast) var(--ease),
      opacity var(--t-fast) var(--ease);
}

.estimate-button span {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform var(--t-base) var(--ease);
}

.estimate-button:hover:not(:disabled) span {
  transform: translateX(3px);
}

.estimate-button:hover:not(:disabled) {
  transform: translate(2px, 3px);
  box-shadow:
      3px 3px 0 var(--accent),
      var(--shadow-sm),
      var(--inset-dark);
}

.estimate-button:active:not(:disabled) {
  transform: translate(5px, 6px);
  box-shadow: 0 0 0 var(--accent), var(--inset-dark);
}

.estimate-button:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

.loader {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .32);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .68s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-message {
  margin: var(--sp-4) 0 0;
  color: var(--muted);
  font-size: var(--fs-tiny);
  line-height: 1.5;
  text-align: center;
  text-wrap: pretty;
}

.form-message.error {
  color: var(--danger);
  font-weight: 700;
}


/* ==========================================================================
   10  VÝSLEDEK — RÁM A HLAVIČKA
   ========================================================================== */

.result {
  margin-top: var(--sp-12);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  background: rgba(255, 255, 255, .58);
  box-shadow: var(--shadow-lg), var(--inset-light);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.result-heading,
.price-card,
.result-grid,
.comparables-card {
  margin-right: var(--sp-4);
  margin-left: var(--sp-4);
}

.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-5);
  padding: var(--sp-6) 0 var(--sp-5);
}

.result-heading .eyebrow {
  color: var(--accent-deep);
  margin-bottom: var(--sp-2);
}

.result-heading h2 {
  margin: 0;
  font-family: var(--headline);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.confidence-badge {
  flex: 0 0 auto;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid rgba(22, 116, 84, .18);
  border-radius: var(--r-pill);
  color: var(--ok);
  background: var(--ok-bg);
  box-shadow: var(--inset-light);
  font-size: var(--fs-tiny);
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
}

.confidence-badge.low {
  border-color: rgba(154, 95, 30, .2);
  color: var(--warn);
  background: var(--warn-bg);
}


/* ==========================================================================
   11  CENOVÁ KARTA — hrdina stránky
   ========================================================================== */

.price-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(var(--sp-6), 3vw, var(--sp-10));
  border-radius: var(--r-xl) var(--r-xl) 3.25rem var(--r-xl);
  color: #fff;
  background:
      radial-gradient(120% 140% at 8% 0%, #234140 0%, transparent 55%),
      linear-gradient(150deg, #172c2d 0%, var(--ink) 70%);
  box-shadow: var(--shadow-ink), var(--inset-dark);
}

/* Soustředné prstence — terakota + aqua, decentnější než dřív */
.price-card::after {
  position: absolute;
  z-index: -1;
  right: -6.25rem;
  bottom: -10rem;
  width: 24.5rem;
  height: 24.5rem;
  content: '';
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  box-shadow:
      0 0 0 3.25rem rgba(222, 101, 73, .72),
      0 0 0 6.5rem rgba(189, 227, 222, .60);
  opacity: .95;
}

/* Světelný okraj nahoře — dojem lisovaného kovu */
.price-card::before {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  content: '';
  background: linear-gradient(90deg,
      transparent, rgba(255, 255, 255, .38) 30%, rgba(255, 255, 255, .12) 100%);
}

.price-card p,
.price-card strong,
.price-card > span,
.price-card__figure,
.price-range {
  position: relative;
  z-index: 1;
}

.price-card p {
  margin: 0;
  color: var(--aqua);
  font-size: var(--fs-micro);
  font-weight: 800;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  opacity: .92;
}

/* Volitelný wrapper (JS ho může přidat) — funguje i bez něj */
.price-card__figure {
  display: grid;
  gap: var(--sp-1);
  margin: var(--sp-3) 0 0;
}

.price-card strong {
  display: block;
  max-width: 20ch;
  margin: var(--sp-3) 0 var(--sp-2);
  font-family: var(--headline);
  font-size: clamp(2.5rem, 6.4vw, 4.5rem);
  font-weight: 800;
  line-height: .96;
  letter-spacing: -.05em;
  text-wrap: balance;
}

.price-card__figure strong {
  margin: 0;
}

.price-card > span,
.price-card__figure > span {
  display: block;
  color: #cfe3df;
  font-size: var(--fs-lead);
  font-weight: 700;
  letter-spacing: -.01em;
}

.price-range {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  max-width: 44rem;
  margin-top: var(--sp-8);
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(255, 255, 255, .18);
  color: var(--aqua);
  font-size: var(--fs-tiny);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.price-range b {
  color: #fff;
  font-size: var(--fs-base);
  font-weight: 800;
  letter-spacing: -.01em;
  text-align: right;
  text-transform: none;
}


/* ==========================================================================
   12  GRID VÝSLEDKU, INFO KARTY, DETAILY
   ========================================================================== */

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-4);
}

/* Na širokých displejích nechceme dvě stejně velké poloviny — mapa dostane víc */
@media (min-width: 1000px) {
  .result-grid {
    grid-template-columns: 1.2fr .8fr;
  }
}

.info-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow-sm), var(--inset-light);
  transition: box-shadow var(--t-base) var(--ease);
}

.info-card:hover {
  box-shadow: var(--shadow-md), var(--inset-light);
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line-hair);
  color: var(--ink-soft);
  font-size: var(--fs-tiny);
  font-weight: 800;
  letter-spacing: .02em;
}

.card-title small {
  flex: 0 0 auto;
  color: var(--accent-deep);
  font-size: var(--fs-micro);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.details-card dl {
  margin: 0;
  padding: var(--sp-1) var(--sp-5) var(--sp-4);
}

.details-card dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line-hair);
}

.details-card dl div:last-child {
  border-bottom: 0;
}

.details-card dt {
  color: var(--muted);
  font-size: var(--fs-tiny);
  font-weight: 600;
}

.details-card dd {
  max-width: 62%;
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 800;
  letter-spacing: -.005em;
  text-align: right;
  text-wrap: pretty;
}


/* ==========================================================================
   13  MAPA, LEGENDA, LEAFLET
   ========================================================================== */

.map-card {
  display: flex;
  flex-direction: column;
}

.map-card #estimateMap {
  height: clamp(240px, 34vh, 360px);
  background: var(--paper-deep);
}

/* Odbarvíme jen dlaždice — značky a tooltipy zůstanou plné barvy */
.map-card .leaflet-tile-pane {
  filter: saturate(.58) contrast(.94) brightness(1.04);
}

.map-key {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  margin-top: auto;
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  border-top: 1px solid var(--line-hair);
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: .02em;
}

.map-key span {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.key-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-xs);
}

.key-dot-estimate {
  background: var(--accent);
}

.key-dot-comparable {
  background: var(--ink);
}

/* --- Leaflet: sladění s designem ------------------------------------------ */
.leaflet-container {
  font-family: var(--sans);
  font-size: var(--fs-tiny);
  background: var(--paper-deep);
}

.leaflet-container a {
  color: var(--accent-deep);
}

.leaflet-control-zoom {
  border: 1px solid var(--line) !important;
  border-radius: var(--r-md) !important;
  overflow: hidden;
  box-shadow: var(--shadow-md) !important;
}

.leaflet-control-zoom a {
  color: var(--ink) !important;
  background: rgba(255, 255, 255, .92) !important;
  border-bottom-color: var(--line-hair) !important;
  font-weight: 700;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.leaflet-control-zoom a:hover {
  color: var(--accent-deep) !important;
  background: #fff !important;
}

.leaflet-control-attribution {
  border-radius: var(--r-sm) 0 0 0;
  color: var(--muted) !important;
  background: rgba(255, 255, 255, .78) !important;
  font-size: 10px !important;
}

.leaflet-tooltip {
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  border-radius: var(--r-sm);
  color: #fff;
  background: rgba(19, 37, 38, .95);
  box-shadow: var(--shadow-md);
  font-family: var(--sans);
  font-size: var(--fs-tiny);
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
}

.leaflet-tooltip b {
  font-weight: 800;
  letter-spacing: -.01em;
}

.leaflet-tooltip-top::before  { border-top-color: rgba(19, 37, 38, .95); }
.leaflet-tooltip-bottom::before { border-bottom-color: rgba(19, 37, 38, .95); }
.leaflet-tooltip-left::before { border-left-color: rgba(19, 37, 38, .95); }
.leaflet-tooltip-right::before { border-right-color: rgba(19, 37, 38, .95); }

.leaflet-popup-content-wrapper {
  border-radius: var(--r-md);
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
  margin: var(--sp-3) var(--sp-4);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.leaflet-popup-tip {
  box-shadow: var(--shadow-sm);
}

.leaflet-popup-close-button {
  color: var(--muted) !important;
  transition: color var(--t-fast) var(--ease);
}

.leaflet-popup-close-button:hover {
  color: var(--accent-deep) !important;
}


/* ==========================================================================
   14  SROVNATELNÉ NEMOVITOSTI
   ========================================================================== */

.comparables-card {
  margin-bottom: var(--sp-4);
  padding: clamp(var(--sp-5), 2.4vw, var(--sp-8));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
      linear-gradient(128deg,
          rgba(189, 227, 222, .48) 0%,
          rgba(255, 255, 255, .92) 50%,
          rgba(240, 177, 159, .20) 100%);
  box-shadow: var(--shadow-sm), var(--inset-light);
}

.comparables-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
}

.comparables-heading .eyebrow {
  margin-bottom: var(--sp-2);
  color: var(--accent-deep);
}

.comparables-heading h3 {
  margin: 0;
  font-family: var(--headline);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.comparables-status {
  flex: 0 0 auto;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--inset-light);
  font-size: var(--fs-micro);
  font-weight: 800;
  white-space: nowrap;
}

.comparables-intro {
  max-width: 68ch;
  margin: var(--sp-3) 0 var(--sp-5);
  color: var(--ink-soft);
  font-size: var(--fs-small);
  line-height: 1.6;
  text-wrap: pretty;
}

.nearby-properties {
  display: grid;
  gap: var(--sp-2);
}

.nearby-property {
  display: grid;
  width: 100%;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow-xs), var(--inset-light);
  text-align: left;
  cursor: pointer;
  transition:
      transform var(--t-fast) var(--ease),
      border-color var(--t-fast) var(--ease),
      background var(--t-fast) var(--ease),
      box-shadow var(--t-base) var(--ease);
}

.nearby-property:hover,
.nearby-property:focus-visible {
  border-color: var(--accent);
  background: #fff;
  transform: translateX(4px);
  box-shadow: var(--shadow-md), var(--inset-light);
}

.nearby-property:focus-visible {
  outline: 2px solid var(--ring-color);
  outline-offset: 2px;
}

.nearby-property:active {
  transform: translateX(2px) scale(.997);
}

.nearby-index {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(160deg, #24413f, var(--ink) 70%);
  box-shadow: var(--shadow-xs), var(--inset-dark);
  font-family: var(--headline);
  font-size: .625rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.nearby-property:hover .nearby-index {
  background: linear-gradient(160deg, var(--accent), var(--accent-deep) 75%);
}

.nearby-main,
.nearby-price {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nearby-main b,
.nearby-price b {
  overflow: hidden;
  font-size: var(--fs-small);
  font-weight: 800;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nearby-main small,
.nearby-price small {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nearby-price {
  text-align: right;
}

.empty-comparables {
  margin: 0;
  padding: var(--sp-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--muted);
  background: rgba(255, 255, 255, .6);
  font-size: var(--fs-small);
  line-height: 1.55;
  text-align: center;
  text-wrap: pretty;
}


/* ==========================================================================
   15  SKELETON / SHIMMER / VSTUPNÍ ANIMACE
   ========================================================================== */

/* Univerzální placeholder — přidej .skeleton na jakýkoli blok při načítání */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  color: transparent !important;
  background: linear-gradient(90deg,
      rgba(19, 37, 38, .06) 0%,
      rgba(19, 37, 38, .10) 50%,
      rgba(19, 37, 38, .06) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.35s linear infinite;
  user-select: none;
  pointer-events: none;
}

.skeleton * {
  visibility: hidden;
}

/* Skeleton uvnitř tmavé cenové karty */
.price-card .skeleton {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, .08) 0%,
      rgba(255, 255, 255, .18) 50%,
      rgba(255, 255, 255, .08) 100%);
  background-size: 200% 100%;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* Vstup výsledku: fade + rise, s jemným staggerem sekcí */
@keyframes result-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.result.is-entering {
  animation: result-rise var(--t-slow) var(--ease-out) both;
}

.result.is-entering > .result-heading { animation: result-rise 380ms var(--ease-out) 40ms both; }
.result.is-entering > .price-card     { animation: result-rise 460ms var(--ease-out) 90ms both; }
.result.is-entering > .result-grid    { animation: result-rise 460ms var(--ease-out) 160ms both; }
.result.is-entering > .comparables-card { animation: result-rise 460ms var(--ease-out) 220ms both; }

/* Fallback: i bez .is-entering se výsledek objeví plynule */
.result:not([hidden]) {
  animation: result-rise var(--t-slow) var(--ease-out) both;
}


/* ==========================================================================
   16  RESPONSIVITA
   ========================================================================== */

/* --- Ultrawide 2560×1080: udržet měřítko a čitelnou délku řádku ------------ */
@media (min-width: 1700px) {
  .page-shell {
    width: min(100% - var(--sp-16), 1320px);
  }

  .hero {
    min-height: 540px;
  }

  .hero h1 {
    font-size: 5.5rem;
  }

  .price-card strong {
    font-size: 4.75rem;
  }
}

/* --- Notebook 1440×900 a menší desktopy ----------------------------------- */
@media (max-width: 1200px) {
  .estimator {
    margin-right: var(--sp-6);
    margin-left: var(--sp-6);
  }
}

/* --- Tablet --------------------------------------------------------------- */
@media (max-width: 900px) {
  .page-shell {
    width: min(100% - var(--sp-8), 1200px);
  }

  .hero {
    padding-right: var(--sp-8);
    padding-left: var(--sp-8);
    background-position: 56% center;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr) 150px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Mobil 390×844 -------------------------------------------------------- */
@media (max-width: 700px) {
  .page-shell {
    width: min(100% - var(--sp-6), 1200px);
    padding: var(--sp-5) 0 var(--sp-12);
  }

  .model-status {
    display: none;
  }

  .hero {
    min-height: 420px;
    margin-top: var(--sp-5);
    padding: var(--sp-12) var(--sp-6) 6.5rem;
    border-radius: var(--r-xl);
    background-position: 58% center;
  }

  .hero h1 {
    max-width: 12ch;
    font-size: clamp(2.5rem, 12.5vw, 3.5rem);
  }

  .hero-copy {
    max-width: 36ch;
    margin-top: var(--sp-4);
    font-size: var(--fs-base);
  }

  .hero::before {
    right: var(--sp-5);
    bottom: var(--sp-6);
    width: 54px;
    height: 54px;
    box-shadow: -12px -12px 0 -6px var(--accent);
  }

  .estimator {
    margin: -3.25rem var(--sp-3) 0;
    border-radius: var(--r-xl);
  }

  .estimator form {
    padding: var(--sp-4);
    border-radius: calc(var(--r-xl) - var(--sp-2));
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }

  .type-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .type-options span {
    min-width: 0;
    padding: 0 var(--sp-2);
  }

  .address-suggestion {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--sp-1);
  }

  .address-suggestions {
    max-height: 15.5rem;
  }

  .result {
    margin-top: var(--sp-8);
    padding: var(--sp-2);
    border-radius: var(--r-xl);
  }

  .result-heading,
  .price-card,
  .result-grid,
  .comparables-card {
    margin-right: var(--sp-2);
    margin-left: var(--sp-2);
  }

  .result-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-5) 0 var(--sp-4);
  }

  .price-card {
    padding: var(--sp-6) var(--sp-5);
    border-radius: var(--r-lg) var(--r-lg) 2.25rem var(--r-lg);
  }

  .price-card::after {
    right: -11rem;
    bottom: -13rem;
    box-shadow:
        0 0 0 2.25rem rgba(222, 101, 73, .72),
        0 0 0 4.5rem rgba(189, 227, 222, .58);
  }

  .price-card strong {
    font-size: clamp(2.25rem, 11vw, 3.25rem);
  }

  .price-range {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--sp-1);
    margin-top: var(--sp-6);
  }

  .price-range b {
    text-align: left;
  }

  .map-card #estimateMap {
    height: 260px;
  }

  .card-title,
  .details-card dl,
  .map-key {
    padding-right: var(--sp-4);
    padding-left: var(--sp-4);
  }

  .comparables-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .nearby-property {
    grid-template-columns: 1.75rem minmax(0, 1fr);
    gap: var(--sp-2) var(--sp-3);
  }

  .nearby-price {
    grid-column: 2;
    text-align: left;
  }

  .nearby-index {
    width: 1.75rem;
    height: 1.75rem;
  }
}

/* --- Velmi úzké displeje (≤360 px) ---------------------------------------- */
@media (max-width: 380px) {
  .type-options {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2.375rem;
  }
}


/* ==========================================================================
   17  PŘÍSTUPNOST — REDUCED MOTION, FORCED COLORS, TISK
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .result.is-entering,
  .result:not([hidden]),
  .result.is-entering > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .skeleton {
    animation: none !important;
  }

  .estimate-button:hover:not(:disabled),
  .nearby-property:hover,
  .type-options label:hover span {
    transform: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(19, 37, 38, .3);
    --line-strong: rgba(19, 37, 38, .45);
    --muted: #4c5b5b;
    --muted-light: #6a7776;
  }
}

@media (forced-colors: active) {
  .type-options input:checked + span {
    border: 2px solid CanvasText;
  }

  .estimate-button,
  .nearby-property,
  .address-suggestion {
    border: 1px solid CanvasText;
  }
}

@media print {
  body::before,
  .estimator,
  .topbar {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .hero {
    box-shadow: none;
  }

  .result {
    box-shadow: none;
    border-color: #999;
    background: #fff;
  }

  .price-card {
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ====================================================================
 * Doplňkové stavy vyžádané klientskou logikou (app.js)
 * ==================================================================== */

/* --- Skeleton řádek srovnatelné nemovitosti ------------------------- */

.nearby-property.is-skeleton {
  cursor: default;
  pointer-events: none;
  transform: none;
}

.nearby-property.is-skeleton:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, .72);
  transform: none;
}

.skeleton-index {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: var(--r-pill);
}

.skeleton-line {
  display: block;
  width: 100%;
  height: .625rem;
  border-radius: var(--r-sm);
}

.skeleton-line + .skeleton-line {
  margin-top: var(--sp-2);
}

.skeleton-line-short {
  width: 58%;
}

.nearby-price .skeleton-line {
  width: 6.5rem;
  margin-left: auto;
}

/* --- Aktivní návrh adresy vybraný klávesnicí ------------------------ */

.address-suggestion.is-active {
  color: var(--accent-deep);
  background: var(--accent-tint);
}

.address-suggestion.is-active > span {
  font-weight: 800;
}

/* --- Značka odhadu v mapě ------------------------------------------- */

.estimate-marker {
  filter: drop-shadow(0 2px 6px rgba(19, 37, 38, .35));
}

@media (prefers-reduced-motion: no-preference) {
  .estimate-marker {
    animation: marker-pulse 2.6s ease-out infinite;
    transform-origin: center;
  }

  @keyframes marker-pulse {
    0%, 70%, 100% { opacity: 1; }
    35%           { opacity: .82; }
  }
}

/* --- Patička -------------------------------------------------------- */

.page-footer {
  max-width: 44rem;
  margin: var(--sp-12) auto 0;
  padding-top: var(--sp-6);
  border-top: 1px solid var(--line-hair);
  color: var(--muted);
  font-size: var(--fs-tiny);
  line-height: 1.65;
  text-align: center;
  text-wrap: pretty;
}

.page-footer p {
  margin: 0;
}

.page-footer-meta {
  margin-top: var(--sp-2);
  color: var(--muted-light);
  font-size: var(--fs-micro);
}

.page-footer strong {
  color: var(--ink-soft);
  font-weight: 700;
}

/* --- Srovnatelná nemovitost jako odkaz na inzerát -------------------- */

a.nearby-property {
  grid-template-columns: 2.25rem minmax(0, 1fr) auto 1.25rem;
  text-decoration: none;
}

.nearby-open {
  display: grid;
  place-items: center;
  color: var(--muted-light);
  font-size: 1rem;
  font-weight: 700;
  transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

a.nearby-property:hover .nearby-open,
a.nearby-property:focus-visible .nearby-open {
  color: var(--accent-deep);
  transform: translate(2px, -2px);
}

/* Na úzkém displeji nesmí šipka zabírat vlastní řádek — sedí v pravém horním rohu. */
@media (max-width: 700px) {
  a.nearby-property {
    position: relative;
    grid-template-columns: 2rem minmax(0, 1fr);
    padding-right: var(--sp-8);
  }

  a.nearby-property .nearby-price {
    grid-column: 2;
  }

  a.nearby-property .nearby-open {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
  }
}


/* --- Stavová kontrolka modelu (ověřuje se za běhu) ------------------- */

.model-status.is-checking i {
  background: var(--muted-light);
  box-shadow: 0 0 0 4px rgba(113, 128, 128, .14);
}

.model-status.is-checking i::after {
  animation: none;
}

.model-status.is-down {
  color: var(--danger);
  border-color: rgba(189, 72, 48, .3);
  background: var(--accent-tint);
}

.model-status.is-down i {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(189, 72, 48, .16);
}

.model-status.is-down i::after {
  animation: none;
}

/* --- Nález z katastru (co appka sama zjistila) ----------------------- */

.property-facts {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin: var(--sp-4) 0 0;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid rgba(127, 188, 180, .45);
  border-radius: var(--r-md);
  color: var(--ink-soft);
  background: var(--aqua-tint);
  font-size: var(--fs-small);
  line-height: 1.5;
  text-wrap: pretty;
}

.property-facts::before {
  flex: 0 0 auto;
  color: var(--aqua-deep);
  content: '⌖';
  font-size: 1rem;
  line-height: 1.2;
}

.property-facts.is-muted {
  border-color: var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, .6);
}

.property-facts.is-muted::before {
  color: var(--muted-light);
}

@media (prefers-reduced-motion: no-preference) {
  .property-facts {
    animation: facts-in var(--t-base) var(--ease-out) both;
  }

  @keyframes facts-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
  }
}

/* ══════════════════════════════════════════════════════════════════════
   Akce nad odhadem — doplneno 13. 8. 2026
   Zamerne pouziva stavajici tokeny (--accent, --r-pill, --sp-*, --shadow-*),
   aby to nevypadalo prilepene. Zadny novy font ani barva.
   ══════════════════════════════════════════════════════════════════════ */
.actions-card {
  margin-top: var(--sp-6);
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm);
}
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.action-btn {
  appearance: none;
  min-height: 44px;
  padding: 0 var(--sp-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--paper-warm);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.action-btn:hover {
  background: var(--surface);
  border-color: var(--accent-soft);
  color: var(--accent-deep);
  transform: translateY(-1px);
}
.action-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.action-btn[disabled] { opacity: .55; cursor: default; transform: none; }
.action-btn-primary {
  background: var(--accent);
  border-color: var(--accent-deep);
  color: #fff;
  box-shadow: var(--shadow-xs), var(--inset-dark);
}
.action-btn-primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff;
}
.action-message {
  margin: var(--sp-3) 0 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: var(--fs-tiny);
}
.action-message.is-ok { color: var(--ok); }
.action-message.is-bad { color: var(--danger); }

.explain-box {
  margin-top: var(--sp-5);
  padding: var(--sp-5);
  background: var(--aqua-tint);
  border: 1px solid var(--aqua);
  border-radius: var(--r-xl);
}
.explain-text {
  margin-top: var(--sp-2);
  color: var(--ink-soft);
  font-size: var(--fs-base);
  line-height: 1.66;
}
.explain-text b { color: var(--ink); font-weight: 700; }
.explain-text p { margin: 0 0 var(--sp-2); }
.explain-text p:last-child { margin-bottom: 0; }

/* historie hledani */
.history-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.history-label {
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.history-chip {
  appearance: none;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--paper-warm);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: var(--fs-tiny);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.history-chip:hover { border-color: var(--accent-soft); color: var(--accent-deep); }
.history-chip:focus-visible { outline: none; box-shadow: var(--ring); }

@media print {
  .actions-card, .history-row, .estimator, .topbar { display: none !important; }
}

/* ── Rozpad odhadu a porovnani — doplneno 13. 8. 2026 ────────────────
   Prevzato z verze V25, ktera mela znalecky panel. Data jdou z debug
   casti odpovedi (comp_m2, obec_m2, geo_conf), takze zadne dalsi volani.
   Opet jen stavajici tokeny, zadna nova barva ani font. */
.breakdown-card,
.compare-card {
  margin-top: var(--sp-6);
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm);
}
.breakdown-rows { margin-top: var(--sp-4); }
.breakdown-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line-hair);
}
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-row.is-main {
  margin: 0 calc(-1 * var(--sp-4));
  padding-left: var(--sp-4);
  padding-right: var(--sp-4);
  background: linear-gradient(90deg, var(--accent-tint), transparent);
  border-radius: var(--r-md);
}
.breakdown-label { color: var(--ink-soft); font-size: var(--fs-base); font-weight: 600; }
.breakdown-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--fs-tiny);
  font-weight: 400;
}
.breakdown-value {
  color: var(--ink);
  font-family: var(--headline);
  font-size: var(--fs-lead);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
}
.breakdown-row.is-main .breakdown-value { color: var(--accent-deep); }
.breakdown-diff {
  margin-left: var(--sp-2);
  font-family: var(--sans);
  font-size: var(--fs-tiny);
  font-weight: 600;
}
.breakdown-diff.is-up { color: var(--ok); }
.breakdown-diff.is-down { color: var(--danger); }

/* porovnani */
.compare-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.compare-form > input[type="text"] {
  flex: 1 1 240px;
  min-height: 44px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--paper-warm);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-base);
}
.compare-form > input[type="text"]:focus-visible { outline: none; box-shadow: var(--ring); }
.compare-area { flex: 0 0 120px; }
.compare-result { margin-top: var(--sp-4); }
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3);
}
.compare-col {
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--paper-warm);
}
.compare-col.is-cheaper { border-color: var(--aqua-deep); background: var(--aqua-tint); }
.compare-col h4 {
  margin: 0 0 var(--sp-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-small);
  font-weight: 700;
}
.compare-col strong {
  display: block;
  color: var(--ink);
  font-family: var(--headline);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
}
.compare-col span { color: var(--muted); font-size: var(--fs-tiny); }
.compare-verdict {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--aqua);
  border-radius: var(--r-lg);
  background: var(--aqua-tint);
  color: var(--ink-soft);
  font-size: var(--fs-base);
  line-height: 1.6;
}

@media print {
  .compare-card, #examplesRow { display: none !important; }
}
