:root{
  --butter:#FFE08A; --butter-2:#FFF3C7; --mint:#E9FBF3; --teal:#29D3C2;
  --green:#3DC27A; --ink:#0E1B2E; --muted:#6B7A90; --card:#fff;
  --ring:rgba(41,211,194,.35); --shadow:0 20px 50px rgba(10,35,60,.08);
  --radius:18px;
  --container: 1200px;
  --page-gutter: clamp(16px, 5vw, 40px);
  /* centers content while keeping full-width backgrounds */
  --container-inset: max(var(--page-gutter), calc((100vw - var(--container)) / 2));
  /* Deal assessment colors */
  --deal-good: #10b981;
  --deal-good-bg: #ecfdf5;
  --deal-fair: #f59e0b;
  --deal-over: #ef4444;
  /* Text hierarchy */
  --text-secondary: #334a62;
  --text-tertiary: #94a3b8;

  /* Editorial design system (search-redesign-v2). Namespaced --ed-* so the
     existing teal/yellow palette keeps powering the public landing page,
     login, and any non-portal surface. Apply via .ed-* component classes
     or by overriding scoped portal selectors that opt in. */
  --ed-paper:    #FAF7F2;
  --ed-paper-2:  #F3EEE5;
  --ed-paper-3:  #EBE4D7;
  --ed-line:     #E3DBCB;
  --ed-line-soft:#EEE8DC;
  --ed-ink:      #1A1814;
  --ed-ink-2:    #3A362E;
  --ed-ink-3:    #6B6557;
  --ed-ink-4:    #9A9282;
  --ed-mint:     oklch(0.62 0.08 170);
  --ed-mint-2:   oklch(0.72 0.06 170);
  --ed-mint-soft:oklch(0.94 0.03 170);
  --ed-mint-ink: oklch(0.32 0.06 170);
  --ed-amber:    oklch(0.72 0.13 55);
  --ed-amber-soft:oklch(0.95 0.05 70);
  --ed-rose:     oklch(0.62 0.14 25);
  --ed-rose-soft:oklch(0.94 0.04 25);
  --ed-lock:     #B8AE9A;
  --ed-radius:   14px;
  --ed-radius-sm:10px;
}

/* Editorial typography helpers (search-redesign-v2). Opt-in only: they
   change nothing until applied as a class. Fonts are loaded from the
   shared <head> Google Fonts link in static/index.html. */
.ed-serif{font-family:Georgia, "Times New Roman", serif;font-optical-sizing:auto;letter-spacing:-0.01em}
.ed-mono{font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace}
.ed-tabular{font-variant-numeric:tabular-nums}

/* ============================================================
   Phase 2 - Site-wide editorial foundation
   Warm paper background + ink text + serif headings, applied
   site-wide so every page (landing, login, portal, legal, lt
   landing pages) shares the same visual feel. Component-level
   overhauls (cards, buttons, ad cards, tabs) come in later
   phases. Source-order overrides only - no !important added
   beyond what existed already in the appbar rules.
   ============================================================ */

/* (body bg+color moved into the canonical body rule below at line ~95
   so it actually wins the cascade. Earlier override was source-ordered
   BEFORE the original and silently lost.) */

/* Appbar: warmer translucent paper to match. */
.appbar{
  background: rgba(250,247,242,0.92);
  border-bottom-color: var(--ed-line-soft);
}
@media (min-width: 1025px){
  .appbar{ background: rgba(250,247,242,0.92) !important; }
}

/* Display typography: editorial serif on top-level headings and
   the brand mark, with optical sizing for a more refined render. */
h1, h2, h3, h4,
.brand{
  font-family:Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
}

/* Base */
*{ box-sizing:border-box; }
html{
  height:100%;
  overflow-x: hidden;  /* Prevent horizontal scrollbar */
  overflow-y: auto;
  width: 100%;
  scroll-behavior: smooth;
}
body{
  margin:0;
  /* min-height (NOT height) so body can grow with content. With
     `height: 100%`, body is locked at viewport height; sticky
     elements have body as their containing block and get released as
     soon as body scrolls past — which on iOS made tapping an input
     yank .lp-header / .appbar above the viewport.
     min-height keeps the "fill viewport when content is short"
     behavior while letting sticky work over the full scroll range. */
  min-height: 100%;
  /* Do NOT add `overflow-x: hidden` here. Combined with constrained
     body height it makes <body> a scroll container for sticky
     purposes, but <body> itself doesn't actually scroll — <html>
     does. html already has overflow-x: hidden so horizontal overflow
     is still clipped. */
  width: 100%;
  min-width: 0;  /* Allow shrinking */
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  /* Editorial palette (search-redesign-v2): flat paper. The original
     butter-yellow radial+linear gradient is gone so the sidebar and
     main column share one continuous warm-paper field. */
  color: var(--ed-ink);
  background: var(--ed-paper);
  letter-spacing:.1px;
}
a{ color:#0e7dc2; text-decoration:none; }
.hidden{ display:none!important; }

/* Hero */
.hero-wrap{
  min-height:auto;
  display:grid;
  grid-template-columns:1.15fr 1fr;
  grid-template-rows: minmax(calc(100vh - 60px), auto);
  gap:48px;
  align-items:center;
  background:
    radial-gradient(ellipse 800px 400px at 20% 0%, rgba(41,211,194,0.08), transparent 50%),
    linear-gradient(180deg, var(--mint) 0%, rgba(233,251,243,0.3) 60%, transparent 100%);
  padding-block: 80px;
  padding-inline: var(--container-inset);
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.hero-wrap > * {
  min-width: 0;  /* Allow grid children to shrink */
}
.hero-left h1{ 
  font-size:clamp(40px, 5.5vw, 68px); 
  line-height:1.1; 
  margin:0 0 16px; 
  font-weight:800; 
  letter-spacing:-.03em;
  color: var(--ink);
}
.hero-left p{ margin:0 0 24px; color:var(--muted); font-size:clamp(16px,2.1vw,18px); }
.hero-intro{ margin:12px 0 28px; color:#5a6a82; font-size:clamp(15px,2vw,17px); line-height:1.6; max-width:520px; }
.h1-highlight{ color:#0f766e; }
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.ai-features{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Override sr-only when visible class is present */
.ai-features.hero-features-visible{
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 8px 0 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  max-width: 520px;
}
.ai-features li{
  color:#3a4a61;
  font-size:clamp(13px,1.8vw,15px);
  line-height:1.5;
  padding-left:20px;
  position:relative;
}
.ai-features li::before{
  content:"✓";
  position:absolute;
  left:0;
  color:#0f766e;
  font-weight:600;
}
/* Hero browse CTA */
.hero-browse-cta{
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  scroll-behavior: smooth;
}
/* Hero "View ads" button */
.hero-view-ads-cta{
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
}
.hero-bullets{ display:grid; gap:10px; margin-top:8px; }
.bullet{ display:flex; gap:12px; align-items:flex-start; color:#3a4a61; }

/* Modern Icons */
.icon-sm{
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
.icon-xs{
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

/* Badge */
.badge{
  background:linear-gradient(180deg,var(--teal),#72E6DA);
  width:26px; height:26px; border-radius:10px;
  display:grid; place-items:center; font-size:14px; font-weight:800;
  color:#06423C; box-shadow:var(--shadow);
}
.hero-bullets .badge{
  --s:26px; width:var(--s); height:var(--s); min-width:var(--s); min-height:var(--s);
  border-radius:50%; padding:0; display:inline-grid; place-items:center; line-height:1;
  font-variant-numeric:tabular-nums; font-feature-settings:"tnum";
}

/* Auth */
.auth-card{
  background:rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border:1px solid rgba(234,245,247,0.8);
  border-radius:20px;
  box-shadow:0 8px 32px rgba(10,35,60,.08);
  padding:32px 28px;
  position: relative;
  min-width: 0;
  overflow: hidden;
  width: 100%;
}
.tabs{ display:flex; gap:8px; margin-bottom:18px; position:relative; }
.tab{
  flex:1; text-align:center; padding:12px 14px; border-radius:12px; cursor:pointer;
  font-weight:700; background:#F7FAFD; border:1px solid #e8eef5; color:#334a62;
  transition:transform .06s ease, box-shadow .12s ease; position:relative; overflow:hidden; z-index:1;
}
.tab:hover{ box-shadow:inset 0 0 0 2px #e3eef7; }
.tab:active{ transform:translateY(1px); }
/* Active state (class or ARIA) */
.tab.active,
.tabs .tab[aria-selected="true"]{
  background:#ECFFFB; border:1px solid #d6f5ef; color:#0f766e; box-shadow:none;
}
.tabs .indicator{ display:none; } /* intentionally hidden */

/* Layout helpers */
.grid{ display:grid; gap:12px; }
.row{ display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; }
.row>div{ flex:1 1 240px; }
label{ font-size:13px; color:#5a6a82; display:block; margin-bottom:6px; }
input,select,button{
  width:100%; padding:12px 14px; font:inherit; color:var(--ink);
  background:#fff; border:1px solid #e5edf5; border-radius:12px; outline:none;
}
input:focus,select:focus{ border-color:var(--teal); box-shadow:0 0 0 4px var(--ring); }

/* Custom select */
.select-wrap{ position:relative; }
.select-wrap select{
  appearance:none; background:#fff; border:1px solid #e5edf5; border-radius:12px;
  padding:12px 38px 12px 14px; width:100%; font:inherit; color:var(--ink); outline:none;
}
.select-wrap::after{
  content:"▾"; position:absolute; right:12px; top:50%; transform:translateY(-50%);
  color:#6B7A90; pointer-events:none; font-weight:700;
}

/* Closed select text is bold by default */
#source_name { font-weight: 700; }

/* If the placeholder (value="") is selected, make the closed select look like a placeholder */
#source_name:has(option:checked[value=""]) {
  font-weight: 400;
  color: var(--muted);   /* lighter text when nothing chosen */
}

/* Inside the dropdown list: keep the placeholder normal and the real categories bold */
#source_name option[value=""] { 
  font-weight: 400;
  color: var(--muted);
}
#source_name option:not([value=""]) { 
  font-weight: 700;
}

/* Buttons */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:10px; padding:12px 14px; border-radius:12px; font-weight:800; letter-spacing:.2px; cursor:pointer; border:0; position:relative; transition:transform .06s ease, box-shadow .12s ease, background .2s ease, opacity .2s ease; }
.btn:hover{ box-shadow:0 6px 18px rgba(10,35,60,.10); }
.btn:active{ transform:translateY(1px); }
.btn:focus-visible{ outline:0; box-shadow:0 0 0 4px var(--ring); }
.btn:disabled{ opacity:.55; cursor:not-allowed; box-shadow:none; }
.btn-primary{ background:linear-gradient(180deg,#FFD770,var(--butter)); color:#2d2200; box-shadow:var(--shadow); }
.btn-ghost{ background:#F5FAFF; color:#24405c; border:1px solid #e7eef7; }
.btn-danger{ background:linear-gradient(180deg,#FF7F8C,#EF4444); color:#fff; }
.btn.is-loading{ pointer-events:none; }
.btn.is-loading::after{
  content:""; position:absolute; right:12px; top:50%; transform:translateY(-50%);
  width:16px; height:16px; border-radius:50%; border:2px solid rgba(10,35,60,.25); border-top-color:rgba(10,35,60,.8); animation:spin .8s linear infinite;
}
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

/* Shell / Appbar */
.shell{ 
  min-height:100vh; 
  display:flex; 
  flex-direction:column; 
  overflow-x: hidden;  /* Prevent horizontal overflow */
  width: 100%;
  max-width: 100vw;     /* Never exceed viewport width */
  position: relative;   /* Ensure sticky positioning works */
  /* No padding-top by default (mobile - header scrolls with content) */
}

/* Add padding-top only on larger screens where header is fixed */
@media (min-width: 1025px) {
  .shell {
    padding-top: 60px;    /* Space for fixed header (approximate header height) */
  }
}
.appbar{
  position:sticky;  /* Sticky by default (mobile) - scrolls with content */
  top:0;
  z-index:100;  /* Higher z-index to ensure it stays on top */
  backdrop-filter:blur(6px);
  background:rgba(255,255,255,.95);
  border-bottom:1px solid #eef2f6;
  display:flex !important;
  align-items:center;
  justify-content:space-between !important;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  padding-bottom: 12px;
  padding-inline: var(--container-inset);
  width: 100%;
  box-sizing: border-box;
}

/* Force stack to right side of appbar on all screen sizes */
.appbar > .stack {
  margin-left: auto !important;
}

/* Fixed header only on larger screens */
@media (min-width: 1025px) {
  .appbar {
    position:fixed !important;  /* Fixed to viewport on desktop */
    left: 0 !important;
    right: 0 !important;
    background:rgba(255,255,255,.95) !important;  /* More opaque background for better visibility */
    will-change: transform;
  }
}

/* On smaller screens, reduce header padding */
@media (max-width: 1024px) {
  .appbar {
    padding-inline: var(--page-gutter);
    justify-content: space-between !important;
  }
  .appbar > .stack {
    margin-left: auto !important;
  }
}

@media (max-width: 768px) {
  .appbar {
    padding-inline: 8px;
    /* DO NOT use padding-block here — that's shorthand for both top and
       bottom and would wipe out the safe-area padding-top (line 363).
       On iOS that left the iOS status bar / Dynamic Island overlapping
       the header content (NTAlert logo, language toggles, hamburger).
       Only override the bottom; keep padding-top: calc(12px + safe-area). */
    padding-bottom: 6px;
    justify-content: space-between !important;
  }
  .appbar > .stack {
    margin-left: auto !important;
  }
}

@media (max-width: 480px) {
  .appbar {
    padding-inline: 4px;
    padding-bottom: 4px;
    justify-content: space-between !important;
  }
  .appbar > .stack {
    margin-left: auto !important;
  }
}
.brand{ display:flex; align-items:center; gap:12px; font-weight:800; letter-spacing:.2px; }
.brand-badge{ width:32px; height:32px; border-radius:10px; display:grid; place-items:center; overflow:hidden; }
.brand-badge img{ width:100%; height:100%; object-fit:contain; }
.who{ color:#6e819a; font-size:14px; }

/* --- Hamburger button: softer, crisper, animated --- */
.icon-btn{
  --size: 38px;
  width: var(--size); height: var(--size);
  display: inline-grid; place-items: center;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e7eef7;
  box-shadow: 0 3px 10px rgba(10,35,60,.06);
  cursor: pointer;
  transition: box-shadow .15s ease, transform .06s ease, border-color .15s ease, background .15s ease;
}
.icon-btn:hover{
  background:#F8FBFF;
  border-color:#dfe7f1;
  box-shadow: 0 6px 18px rgba(10,35,60,.10);
}
.icon-btn:active{ transform: translateY(1px); }
/* keep the strong ring for keyboard only */
.icon-btn:focus{ box-shadow:none; }
.icon-btn:focus:not(:focus-visible){ box-shadow:none; }
.icon-btn:focus-visible{ outline:0; box-shadow:0 0 0 3px var(--ring); }

/* icon */
.icon-btn{ display:flex; align-items:center; justify-content:center; }

.hamburger{
  /* tweak --w to 22–24px if you want even wider */
  --w: 22px;         /* bar width */
  --h: 2px;          /* bar thickness */
  --gap: 6px;        /* distance between bars */
  position: relative;
  width: var(--w);
  height: var(--h);
  margin: 0 auto;                      /* center the middle bar */
  background: #24405c;
  border-radius: 2px;
}

.appbar .icon-btn{ position: relative; }              /* ensure a containing block */

.appbar .icon-btn .hamburger{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);   /* same as the pseudos */
  margin: 0;                           /* kill auto-centering */
  width: var(--w);                     /* exact same width */
}

.hamburger::before,
.hamburger::after{
  content:"";
  position: absolute;
  left: 50%;                           /* anchor from the middle */
  transform: translateX(-50%);         /* exact centering */
  width: var(--w);
  height: var(--h);
  background:#24405c;
  border-radius: 2px;
}

.hamburger::before{ top: calc(-1 * var(--gap)); }
.hamburger::after { top: var(--gap); }


/* hover tint */
.icon-btn:hover .hamburger,
.icon-btn:hover .hamburger::before,
.icon-btn:hover .hamburger::after{
  background:#1a5b54; /* subtle teal tint on hover */
}

/* open state = morph to “X” */
.icon-btn.is-open .hamburger{ background: transparent; }
.icon-btn.is-open .hamburger::before{
  top: 0; transform: translateX(-50%) rotate(45deg);
}
.icon-btn.is-open .hamburger::after{
  top: 0; transform: translateX(-50%) rotate(-45deg);
}

/* --- Dropdown: add a small caret & tighter spacing --- */
.app-menu{ position:relative; }
.menu-dropdown{
  position:absolute; right:0; top:calc(100% + 10px); z-index:60;
  min-width:200px;
  background:#fff; border:1px solid #eaf1f7; border-radius:14px;
  box-shadow: var(--shadow);
  padding:6px;
  display:none;
}
.menu-dropdown.open{ display:block; }

/* caret that points to the button */
.menu-dropdown::before{
  content:""; position:absolute; right:14px; top:-6px;
  width:12px; height:12px; transform:rotate(45deg);
  background:#fff; border-left:1px solid #eaf1f7; border-top:1px solid #eaf1f7;
}

.menu-item{
  width:100%; text-align:left; border:0; background:#fff; cursor:pointer;
  padding:10px 12px; border-radius:10px; font-weight:700; color:#24405c;
  transition: background .12s ease, border-color .12s ease;
}
.menu-item:hover{
  background:#ECFFFB; border:1px solid #d6f5ef;
}
.menu-item:hover{
  background: var(--save-bg-hover);   /* #EEF7FF */
  border: 1px solid var(--save-border); /* #e7eef7 */
  color: var(--save-text);            /* keep text consistent */
}
.menu-item:focus-visible{ outline:0; box-shadow:0 0 0 4px var(--ring); }
.menu-item-danger{ color:#dc2626; }
.menu-item-danger:hover{ background:#fef2f2; border-color:#fecaca; color:#b91c1c; }

/* Menu submenu (expandable section) */
.menu-submenu-toggle{
  display:flex; align-items:center; justify-content:space-between; width:100%; cursor:pointer;
}
.menu-submenu-toggle .menu-chevron{
  width:14px; height:14px; transition:transform 0.2s ease; color:var(--muted);
}
.menu-submenu-toggle[aria-expanded="true"] .menu-chevron{
  transform:rotate(180deg);
}
.menu-submenu-body{
  max-height:0; overflow:hidden; transition:max-height 0.25s ease;
}
.menu-submenu-body.open{
  max-height:80px;
}
.menu-submenu-body .menu-item{
  padding-left:20px; font-size:13px;
}
.menu-divider{ border:0; border-top:1px solid #e5e7eb; margin:4px 0; }

/* Menu toggle switch (for push notifications) */
.menu-toggle{
  display:flex; align-items:center; justify-content:space-between; cursor:default;
}
.toggle-switch{
  position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0;
}
.toggle-switch input{ opacity:0; width:0; height:0; }
.toggle-switch .slider{
  position:absolute; cursor:pointer; top:0; left:0; right:0; bottom:0;
  background:#ccc; transition:.3s; border-radius:24px;
}
.toggle-switch .slider:before{
  position:absolute; content:""; height:18px; width:18px; left:3px; bottom:3px;
  background:#fff; transition:.3s; border-radius:50%;
}
.toggle-switch input:checked + .slider{ background:var(--teal); }
.toggle-switch input:checked + .slider:before{ transform:translateX(20px); }
.toggle-switch input:disabled + .slider{ opacity:0.5; cursor:not-allowed; }

/* Info tooltip for menu items */
.info-tooltip{
  position:relative; display:inline-flex; align-items:center; margin-left:4px;
  vertical-align:middle;
}
.info-icon{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:50%; background:#e0e7ef;
  font-size:13px; font-weight:700; color:#64748b; cursor:help;
  font-style:italic; font-family:Georgia,serif;
  flex-shrink:0;
}
.tooltip-text{
  visibility:hidden; opacity:0; position:absolute; bottom:calc(100% + 8px);
  left:50%; transform:translateX(-50%); white-space:nowrap;
  background:#1e293b; color:#fff; padding:6px 10px; border-radius:6px;
  font-size:12px; font-weight:400; z-index:100;
  transition:opacity .2s, visibility .2s;
  max-width:200px; white-space:normal; text-align:center;
}
.tooltip-text::after{
  content:""; position:absolute; top:100%; left:50%; transform:translateX(-50%);
  border:5px solid transparent; border-top-color:#1e293b;
}
.info-tooltip:hover .tooltip-text{ visibility:visible; opacity:1; }

/* Label with tooltip (for menu items) */
.label-tooltip{
  position:relative; cursor:help;
}
.label-tooltip .tooltip-text{
  visibility:hidden; opacity:0; position:absolute; bottom:calc(100% + 8px);
  left:50%; transform:translateX(-50%);
  background:#1e293b; color:#fff; padding:6px 10px; border-radius:6px;
  font-size:12px; font-weight:400; z-index:100;
  transition:opacity .2s, visibility .2s;
  max-width:200px; white-space:normal; text-align:center;
}
.label-tooltip .tooltip-text::after{
  content:""; position:absolute; top:100%; left:50%; transform:translateX(-50%);
  border:5px solid transparent; border-top-color:#1e293b;
}
.label-tooltip:hover .tooltip-text{ visibility:visible; opacity:1; }

/* Not supported state for push notifications */
.menu-item.not-supported{ opacity:0.6; cursor:not-allowed; }
.menu-item.not-supported .toggle-switch{ pointer-events:none; }
.menu-item.not-supported .slider{ background:#cbd5e1; }

@media (max-width: 1025px){
  .app-menu {
    position: relative;
    margin-right: 8px;     /* Add spacing from right edge */
  }

  .app-menu .menu-dropdown{
    right: 0;              /* anchor to the right edge */
    left: auto;            /* don't anchor left */
    min-width: 220px;      /* wide enough for toggle */
    max-width: calc(100vw - 24px); /* never exceed viewport */
  }
  .app-menu .menu-dropdown::before{
    right: 14px;           /* caret on right side */
    left: auto;
  }
}

@media (max-width: 480px){
  .app-menu {
    margin-right: 12px;    /* More spacing on very small screens */
  }
  .app-menu .menu-dropdown{
    min-width: 200px;
  }
}

/* Main grid */
.main{
  padding:28px;
  padding-inline: var(--container-inset);
  display:grid; gap:18px; grid-template-columns:1.2fr 1fr;
  align-items:stretch; grid-auto-rows:minmax(0,auto);
  min-width: 0;           /* Allow grid to shrink */
  max-width: var(--container);  /* Match header max-width (1200px) - content width only */
  margin: 0 auto;          /* Center the grid */
  width: 100%;
  box-sizing: content-box;  /* Padding is outside max-width, like header */
  overflow-x: hidden;      /* Prevent horizontal overflow */
}

/* Reduce gap on desktop when showing 3 columns */
@media (min-width: 1025px) {
  .main {
    gap: 8px;  /* Further reduced from 10px for better fit */
  }
}

/* On smaller screens, adjust padding and constraints */
@media (max-width: 1024px) {
  .main {
    padding: 6px;  /* Further reduced from 8px */
    padding-inline: 6px;  /* Further reduced from 8px */
    max-width: 100%;  /* Remove max-width constraint on smaller screens */
    box-sizing: border-box;  /* Include padding in width calculation */
    width: 100%;
    gap: 6px;  /* Further reduced from 8px */
  }
}

/* On mobile, use even smaller padding */
@media (max-width: 768px) {
  .main {
    padding: 2px;  /* Further reduced from 4px */
    padding-inline: 2px;  /* Further reduced from 4px */
    gap: 2px;  /* Further reduced from 4px */
  }
}

/* On very small mobile, use minimal padding */
@media (max-width: 480px) {
  .main {
    padding: 0;  /* No padding on very small mobile */
    padding-inline: 2px;  /* Further reduced from 4px */
    gap: 2px;  /* Further reduced from 4px */
  }
}

/* Ensure preview column doesn't shrink below minimum */
@media (min-width: 1025px) {
  .main {
    grid-template-columns: minmax(400px, 450px) minmax(550px, 1fr);  /* Fixed search width, min 550px for preview */
  }
  
  /* Ensure preview doesn't shrink */
  .main > #cardPreview {
    min-width: 550px;
  }
}

/* Prevent search widget from shrinking on larger screens */
.main > #cardCreate {
  min-width: 400px;                  /* Minimum width for search form */
  max-width: 450px;                  /* Maximum width to prevent it from getting too wide */
  width: 100%;
}

/* On larger screens, ensure search widget maintains its size and preview doesn't shrink */
@media (min-width: 1400px) {
  .main:not(:has(#cardCreate:not(.hidden))) {
    grid-template-columns: 450px 1fr;  /* Fixed search, flexible preview (only when form hidden) */
  }
  
  .main > #cardPreview {
    min-width: 600px;
  }
  
  /* When form is visible, maintain fixed preview width */
  .main:has(#cardCreate:not(.hidden)) {
    grid-template-columns: minmax(400px, 450px) minmax(550px, 750px) !important;  /* Fixed max preview width */
  }
  
  #cardCreate:not(.hidden) ~ #cardPreview {
    max-width: 750px !important;  /* Prevent preview from growing too much */
  }
}

/* On very large screens, ensure preview maintains minimum width */
@media (min-width: 1600px) {
  .main:not(:has(#cardCreate:not(.hidden))) {
    grid-template-columns: 450px 1fr;  /* Fixed search, flexible preview (only when form hidden) */
  }
  
  .main > #cardPreview {
    min-width: 650px;
  }
  
  /* When form is visible, maintain fixed preview width */
  .main:has(#cardCreate:not(.hidden)) {
    grid-template-columns: minmax(400px, 450px) minmax(550px, 750px) !important;  /* Fixed max preview width */
  }
  
  #cardCreate:not(.hidden) ~ #cardPreview {
    max-width: 750px !important;  /* Prevent preview from growing too much */
  }
}

/* When preview-only, make it full width for three-column layout */
.shell.preview-only .main {
  grid-template-columns: 1fr;
  max-width: var(--container);      /* Match header max-width (1200px) - content only */
  margin: 0 auto;
  box-sizing: content-box;          /* Padding outside max-width, like header */
}
.main > *{ min-width:0; }     /* overflow guard */
.wide{ grid-column:1 / -1; }

/* Cards */
.card{
  background:var(--card); border:1px solid #eef2f6; border-radius:var(--radius);
  box-shadow:var(--shadow); padding:18px; display:flex; flex-direction:column;
  min-height:0; height:100%;
}

/* Reduce card padding on mobile */
@media (max-width: 768px) {
  .card {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 6px;
  }
}
.card h3{ margin:0 0 12px; font-size:18px; }
.split{ display:grid; gap:12px; grid-template-columns:1fr 1fr; }
.stack{ display:flex; gap:12px; flex-wrap:wrap; }
.pill{ 
  display:inline-flex; 
  gap:8px; 
  align-items:center; 
  padding:10px 16px; 
  border-radius:999px; 
  background:rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border:1px solid rgba(41,211,194,0.25); 
  font-size:13px; 
  font-weight:600;
  color:#0f766e;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(10,35,60,.06);
  transition: all 0.2s ease;
}
.pill:hover{
  box-shadow: 0 4px 12px rgba(10,35,60,.1);
  border-color: rgba(41,211,194,0.35);
  transform: translateY(-1px);
}
.pill svg{
  width: 16px;
  height: 16px;
  color: #29D3C2;
  flex-shrink: 0;
}
.log{
  background:#0b1525; border:1px solid #1a2b45; border-radius:14px; padding:12px;
  white-space:pre-wrap; max-height:480px; overflow:auto;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace; color:#baf7c8;
}

/* Ads preview (desktop base) */
#cardPreview{
  display:flex; flex-direction:column; height:100%; min-height:0; align-self:stretch;
  overflow:hidden; contain:size;               /* lock height to its own content (desktop) */
  min-width: 550px;                            /* Minimum width to prevent shrinking */
  flex: 1 1 auto;                               /* Allow growing and shrinking */
  width: 100%;                                  /* Full width of grid cell */
  max-width: 100%;                              /* Don't exceed grid cell */
  box-sizing: border-box;                       /* Include padding/border in width */
}
#cardPreview .results{
  background:linear-gradient(180deg,#fff,#FAFEFD);
  padding:16px;                    /* Increased padding for better spacing */
  flex:1 1 auto;
  min-height:140px;
  overflow:auto;
  overscroll-behavior:contain;
  border:0;                /* ⬅ no border */
  border-radius:0;         /* ⬅ no rounded frame */
  box-shadow:none;         /* safety: no shadow from wrapper */
  width: 100%;             /* Ensure full width */
  min-width: 0;            /* Allow shrinking */
  box-sizing: border-box;  /* Include padding in width */
  max-width: 100%;         /* Don't exceed container */
}

/* Reduce padding in preview results on desktop for 3 columns */
@media (min-width: 1025px) {
  #cardPreview .results {
    padding: 8px;  /* Further reduced from 10px for better fit with 3 columns */
  }
}
.results-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:8px;
  grid-template-columns: 1fr;
  align-items: stretch;              /* Equal height cards per row */
}

/* Tablet/Medium screens: Two columns with constrained width */
@media (min-width: 768px) and (max-width: 1024px) {
  .results-list {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));  /* Further reduced min from 280px */
    gap: 8px;  /* Further reduced from 10px */
    justify-content: center;
  }
  
  .results-item {
    max-width: 100%;                  /* Allow full width on tablet */
  }
}

/* Desktop: Three columns with constrained card sizes */
@media (min-width: 1025px) {
  .results-list {
    grid-template-columns: repeat(3, minmax(250px, 1fr));  /* Further reduced min from 260px to 250px */
    gap: 8px;  /* Further reduced from 10px */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .results-item {
    max-width: 100%;                  /* Use full grid cell width */
    width: 100%;
    min-width: 0;                     /* Allow shrinking within grid cell */
    box-sizing: border-box;
  }
  
  /* When form is visible, show single column in preview */
  #cardCreate:not(.hidden) ~ #cardPreview .results-list {
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
    width: 100% !important;
    gap: 6px !important;  /* Smaller gap when single column */
  }
}

/* Large screens: Keep three columns with consistent card sizes */
@media (min-width: 1400px) {
  .results-list {
    gap: 8px;  /* Further reduced from 10px */
    grid-template-columns: repeat(3, minmax(260px, 1fr));  /* Further reduced min from 270px to 260px */
  }
}

/* Extra large screens: Prevent cards from getting too wide */
@media (min-width: 1600px) {
  .results-list {
    gap: 10px;  /* Further reduced from 12px */
    grid-template-columns: repeat(3, minmax(280px, 1fr));  /* Further reduced min from 290px to 280px */
  }
}

/* Very large screens: Keep consistent card sizes */
@media (min-width: 1800px) {
  .results-list {
    gap: 10px;  /* Consistent with extra large */
    grid-template-columns: repeat(3, minmax(280px, 1fr));  /* Consistent sizing */
  }
}

.results-item{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;        /* Content at top, extra space at bottom */
  gap:0;
  padding:0;
  border:1px solid #eaf1f7;
  border-radius:16px;
  background:#fff;
  box-shadow:0 4px 16px rgba(10,35,60,.06);
  transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  text-decoration:none;
  color:inherit;
  min-width:0;
  height:100%;                       /* Fill grid cell */
  width:100%;
  overflow:hidden;
  position: relative;
  contain: layout style;
}
.results-item:hover{ 
  transform:translateY(-2px); 
  border-color:#d6f5ef; 
  box-shadow:0 8px 24px rgba(10,35,60,.12); 
}

/* Image container - full width on desktop */
.results-image{
  width:100%;
  height:180px;                      /* Increased from 160px for better visual balance */
  aspect-ratio: 16 / 9;
  border-radius:0;                   /* No radius, card handles it */
  overflow:hidden;
  background:#f8fafc;
  flex-shrink:0;
  position:relative;
  align-self:stretch;
}

/* Subtle gradient overlay for price/badge legibility */
.results-image::after{
  content:'';
  position:absolute;
  bottom:0; left:0; right:0;
  height:60px;
  background:linear-gradient(transparent, rgba(0,0,0,0.08));
  pointer-events:none;
  z-index:1;
}

.results-image-img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform 0.2s ease, opacity 0.3s ease;
  opacity:0;
  animation:fadeInImage 0.3s ease forwards;
}

@keyframes fadeInImage{
  from{ opacity:0; }
  to{ opacity:1; }
}

.results-item:hover .results-image-img{
  transform:scale(1.05);
}

/* Placeholder when no image */
.results-image-placeholder{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border:1px solid #d6f5ef;
  color:#6B7A90;
}

.results-image-placeholder-content{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-align:center;
}

.results-image-placeholder-content svg{
  color:#94a3b8;
  opacity:0.7;
}

.results-image-placeholder-content span{
  font-size:11px;
  font-weight:500;
  color:#6B7A90;
}
.results-city{ 
  font-size:12px; 
  color:#256b43; 
  background:#F0FFF8; 
  border:1px solid #d6f5e5; 
  border-radius:999px; 
  padding:4px 10px; 
  white-space:nowrap;
  flex-shrink:0;
  height:28px;
  display:inline-flex;
  align-items:center;
  box-sizing:border-box;
  line-height:1.2;
}

.results-addr{                       /* title/address bigger */
  color:#24405c;
  font-weight:600;
  font-size:16px;
  line-height:1.4;
  margin:0;
  margin-top:8px;                    /* Space from header row */
  width:100%;
  flex: 0 0 auto;                    /* Don't grow, maintain natural height */
}
/* Price row - keeps price and price-change on same row */
.price-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

/* Desktop: Price row in header - always visible */
.results-price-wrapper > .price-row {
  display: flex !important;  /* Always visible */
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  opacity: 1 !important;  /* Always visible */
  visibility: visible !important;  /* Always visible */
}

/* Desktop: Position price on image overlay - always visible */
@media (min-width: 1025px) {
  .results-item {
    position: relative !important;  /* Ensure price is positioned relative to card, not page */
  }
  
  .results-price-wrapper {
    position: absolute !important;
    right: 12px !important;
    top: 12px !important;  /* Position on top of image */
    z-index: 10 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }
  
  /* Ensure price elements are visible */
  .results-price-wrapper .results-price,
  .results-price-wrapper .price-change,
  .results-price-wrapper .results-button-group {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }
}

/* In preview widget ONLY when edit form is visible, stack price and price-change vertically */
#cardCreate:not(.hidden) ~ #cardPreview .price-row {
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.results-price{
  font-weight:700;
  font-size:14px;
  color:#fff;
  background:#1e293b;               /* Dark slate - modern neutral */
  border:none;
  border-radius:8px;
  padding:6px 12px;
  white-space: nowrap;
  line-height:1.2;
  height:28px;
  display:inline-flex;
  align-items:center;
  box-sizing:border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

/* Price lift effect on card hover */
.results-item:hover .results-price{
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.25);
  background:#334155;               /* Lighter slate on hover */
}

/* Price change indicator - badge style like feature-tags */
.price-change {
  /* <button> reset - keep identical footprint as the old <span> */
  margin:0;
  font-family:inherit;
  line-height:1.2;
  text-align:center;
  vertical-align:middle;
  -webkit-appearance:none;
  appearance:none;
  -webkit-tap-highlight-color:transparent;
  /* Visual styling */
  padding:3px 8px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:6px;
  font-size:11px;
  font-weight:600;
  white-space:nowrap;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  color:#64748b;
  height:28px;
  cursor:pointer;
}

.price-change.price-decrease {
  color:#047857;
}

.price-change.price-increase {
  color:#b91c1c;
}

/* Blurred price change for free users */
.price-change.price-change-blurred {
  color:#6B7A90;
  background:#f1f5f9;
  border:1px solid #cbd5e1;
  cursor:pointer;
  user-select:none;
  -webkit-user-select:none;
  -moz-user-select:none;
  -ms-user-select:none;
}

.price-change.price-change-blurred:hover {
  background:#e2e8f0;
  border-color:#94a3b8;
}

/* Desktop: Card layout with image on top, content below */
.results-item > a.results-item {
  display:flex;
  flex-direction:column;
  padding:0;
  gap:0;
}

.results-left{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
  overflow:visible;
  padding:16px;
  position:relative;
}
.results-head{
  display:flex;
  align-items:center;
  justify-content:space-between;   /* Price left, buttons right */
  gap:8px;
  min-width:0;
  margin-bottom:6px;
}

/* Header: price + price per m² + buttons */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Price per square meter */
.price-per-sqm {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

.header-right .price-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-right .results-button-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.results-meta{
  font-size:13px;
  line-height:1.5;
  color:var(--muted);
  overflow:visible;
  max-width:100%;
  white-space:normal;
  word-break: break-word;
  display:flex;
  flex-direction:column;
  overflow-wrap: break-word;
}

/* make time plain text (not a pill) */
.results-time{
  font:inherit;
  color:inherit;
  background:transparent;
  border:0;
  padding:0;
  margin:0;
  white-space:normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Structured metadata: Key specs row with separators */
.specs-grid{
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  gap:0;
  padding-bottom:10px;
  border-bottom:1px solid #f1f5f9;
}

.spec-item{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:13px;
  font-weight:500;
  color:#64748b;
  white-space:nowrap;
  padding:0 12px;
  border-right:1px solid #e2e8f0;
}

.spec-item:first-child{
  padding-left:0;
}

.spec-item:last-child{
  border-right:none;
  padding-right:0;
}

.spec-icon{
  width:16px;
  height:16px;
  color:#94a3b8;
  flex-shrink:0;
}

/* Structured metadata: Feature tags */
.feature-tags{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:8px;
}

.feature-tag{
  padding:3px 8px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:6px;
  font-size:11px;
  font-weight:500;
  color:#64748b;
  white-space:nowrap;
}

.feature-tag.highlight{
  background:#e2e8f0;              /* One tone darker than regular */
  border-color:#cbd5e1;
  color:#334155;                   /* Slightly darker text */
  font-weight:600;                 /* Slightly bolder */
}

/* Structured metadata: Time stamp */
.meta-time{
  display:block;
  margin-top:8px;                    /* Space from content above */
  font-size:12px;
  color:var(--text-tertiary);
}

/* Detail CTA for stripped ads (free users) */
.detail-cta-wrap{
  position:relative;
  overflow:hidden;
  border-radius:10px;
  margin-top:2px;
}

.detail-cta-fake{
  filter:blur(3px);
  user-select:none;
  pointer-events:none;
  overflow:hidden;
  padding:4px 0 0;
  opacity:1;
}

.detail-cta-btn{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:rgba(255,255,255,0.35);
  border:none;
  border-radius:10px;
  color:#475569;
  font-size:12.5px;
  font-weight:500;
  cursor:pointer;
  transition:all 0.2s ease;
  padding:0 16px;
  letter-spacing:0.01em;
}
.detail-cta-btn:hover{
  background:rgba(241,245,249,0.45);
  color:#1e293b;
}
.detail-cta-btn .cta-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#e2e8f0;
  color:#64748b;
  flex-shrink:0;
}
.detail-cta-btn .cta-arrow{
  margin-left:2px;
  color:#94a3b8;
  font-size:14px;
  transition:transform 0.2s ease;
}
.detail-cta-btn:hover .cta-icon{
  background:#cbd5e1;
  color:#475569;
}
.detail-cta-btn:hover .cta-arrow{
  transform:translateX(2px);
  color:#64748b;
}

/* Tablet/small screen adjustments (720-767px range) */
@media (min-width: 721px) and (max-width: 767px) {
  .specs-grid {
    gap: 6px 12px;
  }

  .spec-item {
    font-size: 13px;
  }

  .feature-tag {
    font-size: 11px;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
  .results-image{
    height:170px;
  }

  .specs-grid{
    gap:8px 12px;
  }
}

.box{ border:1px solid #eef2f6; border-radius:14px; padding:12px; background:#fff; }
.muted{ color:#6B7A90; }

/* Chips */
.chips{ display:flex; gap:8px; flex-wrap:wrap; }
.chip{ padding:6px 10px; border:1px solid #e5edf5; border-radius:10px; cursor:pointer; user-select:none; }
/* Mirror .active styling for chips that wrap a checked checkbox - the
   "Ne pirmas" / "Ne paskutinis" floor toggles are <label class="chip">
   <input type="checkbox" hidden /></label>; without this the click
   silently flips the hidden checkbox but the chip looks unchanged.
   Applies to both desktop and mobile (the wizard reuses #cardCreate). */
.chip.active,
.chip:has(input[type="checkbox"]:checked){ background:#ECFFFB; border-color:#d6f5ef; color:#0f766e; font-weight:700; }

/* Toast */
.session-toast{
  position:fixed; left:50%; top:12px; transform:translateX(-50%);
  background:#0b1525; color:#fff; border:1px solid #1a2b45;
  padding:10px 14px; border-radius:12px; box-shadow:var(--shadow);
  z-index:9999; font-weight:700;
}

/* Login helpers */
#loginForm .forgot-link{
  margin-left:auto; align-self:center; font-size:13px; cursor:pointer;
  padding:0; border:0; background:transparent; line-height:1.2;
}
#loginForm .forgot-link:hover{ text-decoration:underline; }
.remember-col{ flex:0 0 auto; align-self:flex-end; }
.checkline{
  display:inline-flex; align-items:center; gap:8px; padding:10px 12px;
  border:1px solid #e5edf5; border-radius:12px; background:#F7FAFD; color:#334a62;
  font-weight:600; user-select:none; cursor:pointer; box-shadow:0 1px 0 rgba(10,35,60,.02);
}
.checkline input{ width:16px; height:16px; accent-color:var(--teal); margin:0; }
label.checkline > input#notify_enabled{ margin-right:8px; }

/* Notifications + Floors rows */
#notifyWrap label.checkline{
  height:42px; padding:0 12px; white-space:nowrap;
}
#notifyWrap .select-wrap select{
  height:42px; padding:0 38px 0 14px; line-height:1.2;
}
#notifyWrap .row > div:first-child{ align-self:auto; }
#notifyWrap .row > div:last-child > label{ display:none; }

#notifyWrap .row { align-items: flex-end; }

#floorsWrap .row:last-of-type > div{ flex:0 0 auto; }
#floorsWrap .row:last-of-type label{
  display:inline-flex; align-items:center; gap:8px; height:42px; padding:0 12px;
  border:1px solid #e5edf5; border-radius:12px; background:#F7FAFD; color:#334a62;
  font-weight:600; user-select:none; cursor:pointer; box-shadow:0 1px 0 rgba(10,35,60,.02);
}
#floorsWrap .row:last-of-type label input{ width:16px; height:16px; margin:0; accent-color:var(--teal); }

/* Notification Channels */
.notify-channels { margin-top: 12px; }
.channels-label {
  display: block;
  font-size: 13px;
  color: #5a6a7a;
  margin-bottom: 8px;
  font-weight: 500;
}
.channels-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.channel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 2px solid #e5edf5;
  border-radius: 12px;
  background: #fff;
  color: #4a5a6a;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  position: relative;
}
.channel-toggle:hover:not(.disabled) {
  border-color: #c5d5e5;
  background: #f8fafc;
}
.channel-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.channel-icon {
  display: flex;
  color: #7a8a9a;
  transition: color 0.15s;
}
.channel-name { transition: color 0.15s; }
.channel-check {
  display: none;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
}
/* Checked state */
.channel-toggle:has(input:checked) {
  border-color: var(--teal);
  background: linear-gradient(135deg, #e6f9f1 0%, #f0fdf7 100%);
  color: #0f766e;
}
.channel-toggle:has(input:checked) .channel-icon { color: var(--teal); }
.channel-toggle:has(input:checked) .channel-check { display: flex; }

/* Email always-on styling */
.channel-email {
  border-color: var(--teal);
  background: linear-gradient(135deg, #e6f9f1 0%, #f0fdf7 100%);
  color: #0f766e;
  cursor: default;
}
.channel-email .channel-icon { color: var(--teal); }
.channel-email .channel-check { display: flex; }

/* Disabled/locked state */
.channel-toggle.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f5f7f9;
  border-color: #e0e5ea;
}
.channel-toggle.disabled:hover {
  border-color: #e0e5ea;
  background: #f5f7f9;
}

/* Premium badge */
.channel-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}
.channel-badge-max {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 4px rgba(255, 165, 0, 0.35);
}
.channel-toggle:not(.disabled) .channel-badge-max { display: none; }

/* Price-change threshold input (shown below the channel row when enabled) */
.pc-threshold-row {
  margin-top: 10px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e5edf5;
  border-radius: 10px;
}
.pc-threshold-row label {
  display: block;
  font-size: 13px;
  color: #5a6a7a;
  margin-bottom: 8px;
  font-weight: 500;
}
.pc-threshold-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pc-threshold-input-row input[type="number"] {
  width: 80px;
  padding: 8px 10px;
  border: 2px solid #e5edf5;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #0E1B2E;
  background: #fff;
}
.pc-threshold-input-row input[type="number"]:focus {
  outline: none;
  border-color: var(--teal, #0f766e);
}
.pc-threshold-input-row span {
  font-weight: 600;
  color: #334a62;
  font-size: 14px;
}

/* SMS phone inline input */
.sms-phone-inline {
  margin-top: 10px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e5edf5;
  border-radius: 10px;
}
.sms-phone-inline label {
  display: block;
  font-size: 13px;
  color: #5a6a7a;
  margin-bottom: 8px;
  font-weight: 500;
}
.sms-phone-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sms-phone-prefix {
  font-weight: 600;
  color: #334a62;
  font-size: 14px;
  padding: 10px 0 10px 12px;
  background: #fff;
  border: 2px solid #e5edf5;
  border-right: none;
  border-radius: 8px 0 0 8px;
}
.sms-phone-inline input {
  flex: 1;
  min-width: 100px;
  max-width: 120px;
  padding: 10px 12px;
  border: 2px solid #e5edf5;
  border-left: none;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}
.sms-phone-inline input:focus {
  outline: none;
  border-color: var(--teal);
}
.sms-phone-inline input:focus + .sms-phone-prefix,
.sms-phone-prefix:has(+ input:focus) {
  border-color: var(--teal);
}
.btn-test-sms {
  margin-left: 8px;
  white-space: nowrap;
}

/* SMS phone display (when phone is set) */
.sms-phone-display {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 14px;
  background: #f0fdf7;
  border: 1px solid #d1fae5;
  border-radius: 10px;
  font-size: 13px;
}
.sms-phone-number {
  font-weight: 600;
  color: #0f766e;
}
.btn-link {
  background: none;
  border: none;
  color: var(--teal);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
}
.btn-link:hover {
  color: #0f766e;
}
#btnRemovePhoneInline {
  color: #dc2626;
}
#btnRemovePhoneInline:hover {
  color: #b91c1c;
}
.sms-test-status {
  font-size: 12px;
  margin-left: 4px;
}

/* Marketing */
.hero-left .hero-sub{ margin:6px 0 14px; color:#3a4a61; font-size:clamp(16px,2.2vw,19px); }
.promise-bar{
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  gap:10px;
  margin:24px 0 0;
  color:#0f766e;
  font-weight:600;
  font-size:14px;
  background:rgba(236,255,251,0.8);
  backdrop-filter: blur(8px);
  border:1px solid rgba(41,211,194,0.3);
  border-radius:12px;
  padding:12px 16px;
  white-space:nowrap;
}
.promise-item{
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.promise-sep{
  color: rgba(15,118,110,0.3);
  margin: 0 2px;
}
.promise-item svg{
  color: #29D3C2;
  flex-shrink: 0;
}
/* Breadcrumbs */
.breadcrumbs{
  font-size: 14px;
  color: var(--muted);
}
.breadcrumbs a{
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumbs a:hover{
  color: var(--ink);
}
.breadcrumbs span{
  color: var(--ink);
}

/* ============================================
   Statistics Section
   ============================================ */
.stats-section {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(41,211,194,0.06), rgba(255,224,138,0.04));
  border: 1px solid rgba(41,211,194,0.15);
  border-radius: 20px;
  padding: 32px 28px;
  margin-top: 32px;
  box-shadow: 0 4px 24px rgba(10,35,60,.06);
  min-width: 0;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.stats-container {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.stats-title {
  margin: 0 0 20px;
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: center;
}

/* Period Tabs */
.stats-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.stats-tab {
  padding: 10px 20px;
  border: 1px solid rgba(41,211,194,0.3);
  border-radius: 24px;
  background: rgba(255,255,255,0.6);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stats-tab:hover {
  background: rgba(255,255,255,0.9);
  border-color: var(--teal);
  color: var(--teal);
}

.stats-tab.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

/* Charts Grid */
.stats-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  min-width: 0;
  width: 100%;
}

.stats-card {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(234,245,247,0.8);
  border-radius: 16px;
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  overflow: hidden;
}

.stats-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(10,35,60,.08);
}

.stats-card h3 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.chart-wrap canvas {
  max-width: 100% !important;
  height: auto !important;
}

.chart-wrap-donut {
  max-width: 240px;
  margin: 0 auto;
}

.chart-wrap-bar {
  /* Explicit height (not just min-height) so Chart.js with
     maintainAspectRatio:false has a measurable container in iOS WebKit;
     otherwise the canvas can size to 0 inside an opacity:0 .reveal. */
  height: 220px;
}

.chart-wrap-bar canvas {
  height: 100% !important;
}

.stats-total {
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.stats-total strong {
  color: var(--teal);
  font-size: 18px;
}

/* Stats loading state */
.stats-section.loading .stats-charts {
  opacity: 0.5;
  pointer-events: none;
}

/* Responsive: Tablet */
@media (max-width: 1024px) {
  .stats-charts {
    gap: 16px;
  }

  .stats-card {
    padding: 16px;
  }

  .chart-wrap-donut {
    max-width: 200px;
  }
}

/* Responsive: Mobile */
@media (max-width: 767px) {
  .stats-section {
    padding: 20px 16px;
    margin-top: 24px;
  }

  .stats-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }

  .stats-tab {
    padding: 8px 14px;
    font-size: 13px;
    flex: 1;
    min-width: 80px;
    text-align: center;
  }

  .stats-charts {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .chart-wrap-donut {
    max-width: 180px;
  }

  .chart-wrap-bar {
    height: 200px;
  }
}

/* Responsive: Small Mobile */
@media (max-width: 480px) {
  .stats-title {
    font-size: 20px;
  }

  .stats-tab {
    padding: 8px 10px;
    font-size: 12px;
  }
}

.marketing{
  grid-column:1 / -1;
  background:rgba(248,255,253,0.5);
  backdrop-filter: blur(10px);
  border:1px solid rgba(234,245,247,0.6);
  border-radius:20px;
  box-shadow:0 4px 24px rgba(10,35,60,.06);
  padding:32px 28px;
  margin-top: 32px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.marketing > * {
  min-width: 0;
}
.marketing h3{ 
  margin:0 0 24px; 
  font-size:clamp(22px, 2.5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.value-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:20px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.value-card{
  background:rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  min-width: 0;
  overflow: hidden;
  border:1px solid rgba(234,245,247,0.8); 
  border-radius:16px; 
  padding:24px 20px; 
  transition: all 0.2s ease;
}
/* Cards with icons - horizontal layout */
.value-card:has(.ic) {
  display:flex; 
  gap:16px; 
  align-items:flex-start;
}
/* Cards without icons - vertical layout (reviews, kontaktai) */
.value-card:not(:has(.ic)) {
  display:flex;
  flex-direction: column;
  gap:12px;
}
.value-card:first-child{
  background: rgba(236,255,251,0.6);
  border-color: rgba(41,211,194,0.3);
  box-shadow: 0 4px 16px rgba(41,211,194,.08);
}
.value-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(10,35,60,.08);
  border-color: rgba(41,211,194,0.3);
  background: rgba(255,255,255,0.95);
}
.value-card .ic{
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  color: #29D3C2;
  margin-top: 2px;
}
.value-card .ic svg{
  width: 100%;
  height: 100%;
}
.value-card h4{ 
  margin:0 0 8px; 
  font-size:16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.value-card p{ 
  margin:0; 
  color:#51627a; 
  font-size:14px;
  line-height: 1.6;
}

.hiw{ margin-top:14px; background:linear-gradient(180deg,#fff,#F7FFFC); border:1px solid #d6f5ef; border-radius:14px; padding:14px; }
.steps{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.step{ 
  background:rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  border:1px solid rgba(214,245,239,0.5); 
  border-radius:18px; 
  padding:28px 20px;
  text-align: center;
  position: relative;
  transition: all var(--anim-fast) ease;
}
.step:hover{
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(10,35,60,.1);
  border-color: rgba(41,211,194,0.4);
  background: rgba(255,255,255,0.9);
}
.step-number{
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-teal);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  margin: 0 auto 16px;
  box-shadow: 0 4px 12px rgba(41,211,194,0.3);
}
.step strong{ 
  display:block; 
  margin-bottom:8px;
  font-size: clamp(16px, 1.8vw, 18px);
  font-weight: 700;
  color: var(--ink);
}
.step h4{
  margin: 0 0 16px;
  font-size: clamp(17px, 1.9vw, 19px);
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(41,211,194,0.2);
}
.step p{
  margin:0 0 8px;
  color:#51627a;
  font-size:clamp(13px, 1.6vw, 15px);
  line-height: 1.6;
  text-align: left;
}
.step ul, .step ol{
  text-align: left;
  margin: 12px 0;
  padding-left: 20px;
}
.step li{
  margin-bottom: 6px;
}

/* Scroll reveal animations (landing pages) */
.reveal{
  opacity:0;
  transform:translateY(40px);
  transition:opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1);
}
.reveal.visible{opacity:1;transform:translateY(0)}
.reveal-delay-1{transition-delay:.1s}
.reveal-delay-2{transition-delay:.2s}
.reveal-delay-3{transition-delay:.3s}
.reveal-delay-4{transition-delay:.4s}
.reveal-delay-5{transition-delay:.5s}
.sr{
  opacity:0;
  transform:translateY(32px);
  transition:opacity .65s cubic-bezier(.22,1,.36,1), transform .65s cubic-bezier(.22,1,.36,1);
}
.sr.visible{opacity:1;transform:translateY(0)}
.sr-d1{transition-delay:.1s}
.sr-d2{transition-delay:.2s}
.sr-d3{transition-delay:.25s}

/* Language switcher */
.lang-switch{
  position:fixed; top:12px; right:clamp(18px,5vw,46px); z-index:10000;
  display:flex; gap:6px; background:#fff; border:1px solid #e7eef7; border-radius:999px;
  padding:4px; box-shadow:var(--shadow);
}
/* Fix lang-switch position on mobile to prevent overlap with content */
@media (max-width: 480px) {
  .lang-switch:not(.appbar .lang-switch) {
    top: 8px;
    right: 12px;
    padding: 3px;
  }
  .lang-switch:not(.appbar .lang-switch) button {
    padding: 5px 8px;
    font-size: 13px;
  }
}
/* When inside appbar, override fixed positioning completely */
.appbar .lang-switch,
.appbar .stack .lang-switch {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  z-index: auto !important;
}
.lang-switch button,
.appbar .lang-switch button{
  background:transparent; border:0; padding:6px 10px; border-radius:999px; font-weight:800; color:#24405c; cursor:pointer;
}
.lang-switch button.active,
.appbar .lang-switch button.active{
  background:#ECFFFB; border:1px solid #d6f5ef; color:#0f766e;
}

/* Put the language toggle inside the appbar when it exists */
.appbar .stack{
  display: flex !important;
  align-items: center;
  gap: 10px;          /* space between Atsijungti and the toggle */
  flex-wrap: nowrap !important;  /* don't wrap on wide screens */
  flex-shrink: 0;     /* prevent shrinking */
  justify-content: flex-end;     /* align items to the right */
  margin-left: auto;              /* push to the right */
}
.appbar .stack .btn{ width: auto; }

/* Override the fixed positioning only when the switch lives in the appbar */
.appbar .lang-switch{
  position: static !important;   /* stop being fixed to the viewport */
  top: auto !important; 
  right: auto !important;
  margin-left: 8px;   /* a little separation from the button */
  display: inline-flex;
  gap: 6px;
  background: #fff;
  border: 1px solid #e7eef7;
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow);
}

/* keep toggle on the right on smaller screens */
@media (max-width:1024px){
  .appbar{ 
    flex-wrap: nowrap !important;                /* keep items in same row */
    justify-content: space-between !important;   /* brand left, stack right */
    align-items: center;
  }
  
  /* Brand stays on left, doesn't take full width */
  .appbar .brand {
    flex: 0 1 auto;
    min-width: 0;
    flex-shrink: 1;     /* allow shrinking if needed */
    order: 1;
  }

  /* Stack stays on right in same row - force it to the right */
  .appbar .stack{
    flex: 0 0 auto !important;
    order: 2;
    display: flex !important;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;       /* align hamburger and lang toggle to the right */
    margin-top: 0;
    margin-left: auto;               /* push to the right */
    flex-shrink: 0;                  /* don't shrink */
  }

  /* ensure the toggle sits at the far right */
  .appbar .lang-switch{
    position: static !important;   /* force static positioning */
    top: auto !important;
    right: auto !important;
    margin-left: 0;
    margin-right: 0;
  }
  
  /* ensure hamburger menu is properly aligned */
  .appbar .app-menu {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
}

/* Terms modal */
.modal{ position:fixed; inset:0; background:rgba(14,27,46,.55); display:none; z-index:20000; }
.modal.show{ display:block; }
/* When the editorial sidebar is mounted, the body content is offset
   right of the 300px sidebar AND --ed-shell-margin centers it in the
   remaining viewport. The modal otherwise centers its panel against the
   raw viewport (margin:40px auto) so it visually drifts left. Mirror the
   shell's left/right padding on .modal so its panel auto-centers within
   the body content area instead of the full viewport. */
@media (min-width: 1100px){
  body.has-ed-sidebar .modal{
    padding-left:  calc(var(--ed-shell-margin, 0px) + 300px);
    padding-right: var(--ed-shell-margin, 0px);
  }
}
.modal .panel:not(.prediction-panel){
  position:relative; margin:40px auto; background:#fff; max-width:880px; height:80vh; border-radius:16px;
  display:flex; flex-direction:column; box-shadow:var(--shadow); border:1px solid #e5edf5;
}
.modal header{ padding:12px 16px; border-bottom:1px solid #eef2f6; font-weight:800; display:flex; justify-content:space-between; align-items:center; }
.modal .body{
  flex:1; min-height:0; overflow:hidden; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
}
.modal footer{ padding:12px 16px; border-top:1px solid #eef2f6; display:flex; gap:10px; justify-content:flex-end; }
body.modal-open{ overflow:hidden; overscroll-behavior:none; }

/* Terms text */
#agreeRow .checkline{ align-items:flex-start; }
#agreeRow .checkline span{ white-space:normal; line-height:1.35; }

/* Global guard rails */
.main, .card, .box { min-width:0; }
img, iframe { max-width:100%; }

/* ---------- Responsive ---------- */
@media (max-width:1024px){
  /* Collapse to 1 column and allow children to shrink */
  .main{ 
    grid-template-columns:minmax(0,1fr); 
    gap:12px;
  }
  
  /* Remove min-width constraint on mobile/tablet */
  .main > #cardCreate {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
  
  /* Remove min-width from preview on smaller screens */
  .main > #cardPreview {
    min-width: 0 !important;
    width: 100%;
    max-width: 100%;
  }
  
  /* Ensure cards don't overflow */
  .main .card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  /* Preview becomes natural height, no inner scroller */
  #cardPreview{ 
    height:auto; 
    max-height:none; 
    contain:none; 
    overflow:visible; 
    align-self:stretch; 
    grid-column:1 / -1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  #cardPreview .results{
    background:linear-gradient(180deg,#fff,#FAFEFD);
    padding:12px;
    flex:1 1 auto;
    min-height:140px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;

    /* merged overflow settings */
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior:contain;

    border:0;                /* ⬅ remove border here too */
    border-radius:0;
    box-shadow:none;
  }
}

/* On mobile, reduce padding in preview results */
@media (max-width: 768px) {
  #cardPreview .results {
    padding: 4px;
  }
}

@media (max-width: 480px) {
  #cardPreview .results {
    padding: 0;
  }
}

/* Appbar can wrap; long emails don't force width */
@media (max-width: 480px) {
  .appbar{ 
    flex-wrap: nowrap !important;                /* keep items in same row */
    justify-content: space-between !important;   /* brand left, stack right */
    align-items: center;
  }
  .appbar .brand{ 
    min-width:0; 
    flex: 0 1 auto;
    flex-shrink: 1;
    order: 1;
  }
  .appbar .who{
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:100%;
  }
  .appbar .stack{ 
    flex-wrap: nowrap !important; 
    gap:6px; 
    flex: 0 0 auto !important;
    order: 2;
    justify-content: flex-end;       /* keep hamburger and lang toggle on the right */
    margin-top: 0;
    margin-left: auto;               /* push to the right */
    flex-shrink: 0;
  }
  
  /* ensure language switch is not fixed positioned */
  .appbar .lang-switch{
    position: static !important;
    top: auto !important;
    right: auto !important;
  }
}

@media (max-width:1100px){
  /* Stack info cards earlier on medium screens to prevent clipping */
  .value-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:900px){
  .value-grid, .steps{ grid-template-columns:1fr; }
}

@media (max-width:640px){
  .remember-col{ width:100%; }
  .checkline{ display:flex; justify-content:center; width:100%; }
}

/* ---------- Hero → stack vertically on small screens ---------- */
@media (max-width: 900px){
  .hero-wrap{
    grid-template-columns: 1fr;   /* one column */
    grid-template-rows: auto;     /* reset viewport-height row for mobile */
    align-items: start;
    gap: 16px;
    padding-block: 40px;          /* a bit tighter vertically */
  }

  /* center/fit the auth card */
  .auth-card{
    width: 100%;
    max-width: 560px;
    margin-inline: auto;          /* center the card below the hero text */
  }

  /* keep hero text tidy on narrow screens */
  .hero-wrap{
    gap: 40px;
    padding-block: 64px;
    background:
      radial-gradient(ellipse 600px 300px at 50% 0%, rgba(41,211,194,0.06), transparent 50%),
      linear-gradient(180deg, var(--mint) 0%, rgba(233,251,243,0.2) 60%, transparent 100%);
  }
  .hero-left{
    text-align: left;
  }
  .hero-left h1{
    font-size: clamp(36px, 6vw, 56px);
  }
  .ai-features.hero-features-visible{
    gap: 4px;
  }
  .ai-features.hero-features-visible li{
    font-size: 14px;
  }
  .hero-browse-cta{
    font-size: 14px;
    padding: 10px 18px;
  }
  .hero-view-ads-cta{
    font-size: 15px;
    padding: 11px 24px;
  }
  .promise-bar{
    justify-content: flex-start;
    padding: 10px 14px;
    gap: 8px;
  }
  .promise-item{
    font-size: 13px;
    padding: 4px 0;
  }
  .marketing{
    padding: 28px 20px;
    margin-left: 0;
    margin-right: 0;
  }
  .value-grid{
    gap: 16px;
  }
  .value-card{
    padding: 20px 16px;
    gap: 14px;
  }
  .breadcrumbs{
    padding: 12px var(--page-gutter);
  }
}
@media (max-width: 768px){
  .hero-wrap{
    padding-block: 48px;
    gap: 32px;
    padding-inline: var(--page-gutter);
  }
  .promise-bar{
    flex-direction: column;
    flex-wrap: wrap;
    white-space: normal;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }
  .promise-item{
    font-size: 14px;
    padding: 3px 0;
  }
  .promise-sep{
    display: none;
  }
  .value-grid{
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .value-card{
    padding: 20px 18px;
  }
  .steps{
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .marketing{
    padding: 24px 18px;
    margin-left: 0;
    margin-right: 0;
  }
  .breadcrumbs{
    padding: 12px var(--page-gutter);
    font-size: 13px;
  }
}
@media (max-width: 540px){
  .value-card{
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 14px;
    gap: 10px;
  }
  .value-card .ic{
    width: 36px;
    height: 36px;
    margin-top: 0;
  }
}
@media (max-width: 480px){
  .hero-wrap{
    padding-block: 40px;
    gap: 24px;
    padding-inline: var(--page-gutter);
  }
  .hero-left h1{
    font-size: clamp(28px, 9vw, 40px);
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .hero-intro{
    font-size: 14px;
    margin-bottom: 16px;
  }
  .ai-features.hero-features-visible{
    gap: 3px;
    margin-top: 4px;
  }
  .ai-features.hero-features-visible li{
    font-size: 13px;
    padding-left: 18px;
  }
  .hero-browse-cta{
    font-size: 13px;
    padding: 9px 16px;
    margin-top: 14px;
  }
  .hero-view-ads-cta{
    font-size: 14px;
    padding: 10px 20px;
    margin-top: 14px;
    width: 100%;
    justify-content: center;
  }
  .promise-bar{
    padding: 10px 12px;
  }
  .promise-item{
    font-size: 13px;
    padding: 3px 0;
  }
  .marketing{
    padding: 20px 14px;
    margin-left: 0;
    margin-right: 0;
    border-radius: 16px;
  }
  .marketing h3{
    font-size: clamp(20px, 4vw, 24px);
    margin-bottom: 20px;
  }
  .value-card{
    padding: 18px 14px;
    gap: 12px;
  }
  .value-card .ic{
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  .steps{
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .step{
    padding: 20px 16px;
  }
  .step-number{
    width: 40px;
    height: 40px;
    font-size: 18px;
    margin-bottom: 12px;
  }
  .breadcrumbs{
    padding: 10px var(--page-gutter);
    font-size: 12px;
  }
  /* Stack goes column on mobile, EXCEPT in appbar */
  .stack:not(.appbar .stack){
    flex-direction: column;
    width: 100%;
  }
  .stack:not(.appbar .stack) .btn{
    width: 100%;
  }
  /* Ensure appbar stack stays horizontal on mobile */
  .appbar .stack {
    flex-direction: row !important;
    width: auto !important;
  }
}

/* Extra comfy on very narrow phones */
@media (max-width: 480px){
  .auth-card{ padding: 18px; border-radius: 14px; }
  .tab{ padding: 10px 12px; }
  .row>div{ flex: 1 1 100%; }     /* form inputs full-width per row */
}

/* Modern mobile-first design for listings */
@media (max-width: 720px){
  .results-list{ 
    gap: 16px;                       /* Increased spacing between cards */
  }

  /* Card-based layout with larger image */
  .results-item{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;                          /* No gap, we'll control spacing manually */
    padding: 0;                      /* Remove padding, add to inner elements */
    min-height: auto;
    border-radius: 16px;             /* More rounded corners */
    overflow: hidden;                /* Clip image to card edges */
    box-shadow: 0 2px 12px rgba(10,35,60,.08); /* Softer shadow */
  }

  .results-item:hover {
    transform: translateY(-2px);     /* Subtle lift on hover */
    box-shadow: 0 4px 20px rgba(10,35,60,.12);
  }

  /* Large, prominent image at top */
  a.results-item > .results-image {
    order: 0;
    width: 100%;
    height: 240px;                    /* Increased from 200px */
    max-height: none;                /* Remove max-height constraint */
    aspect-ratio: 4 / 3;             /* Better aspect ratio for property photos */
    border-radius: 0;                /* Remove border radius, card handles it */
    margin-bottom: 0;
    flex-shrink: 0;
  }

  a.results-item > .results-image .results-image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Placeholder styling for mobile */
  a.results-item > .results-image.results-image-placeholder {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Anchor tag structure - image first, then content */
  a.results-item {
    display: flex;
    flex-direction: column;
    padding: 0;                      /* No padding on anchor, image goes edge-to-edge */
    gap: 0;
  }

  /* Content wrapper - everything after image */
  a.results-item > .results-left {
    padding: 16px;
    order: 1;
    min-width: 0;
    gap: 8px;
    position: relative;
  }

  /* Header row: city badge + price/buttons on same row */
  .results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    margin-bottom: 6px;
    flex-wrap: nowrap;
  }

  .results-city {
    flex: 0 0 auto;
    font-size: 12px;                 /* Slightly smaller on mobile */
    padding: 4px 10px;
    white-space: nowrap;
    line-height: 1.2;                /* Tighter line height for better alignment */
    height: 24px;                    /* Fixed height for consistent alignment */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;           /* Include padding in height */
  }

  /* Header right: price + buttons in header row */
  .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }

  .header-right .price-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .header-right .results-price {
    font-size: 18px;
    font-weight: 700;
    padding: 8px 14px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    border-radius: 10px;
  }

  .header-right .price-per-sqm {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
  }

  .header-right .price-change {
    font-size: 13px;
    font-weight: 600;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    height: 38px;
    min-width: 38px;
  }

  .header-right .price-change.price-decrease {
    color: #047857;
  }

  .header-right .price-change.price-increase {
    color: #b91c1c;
  }

  .header-right .results-button-group {
    display: flex;
    gap: 6px;
    align-items: center;
  }

  .header-right .btn-predict,
  .header-right .btn-map,
  .header-right .btn-price-change {
    height: 38px;
    min-width: 38px;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 10px;
  }

  /* Price wrapper - positioned in header row, inline with city */
  /* price-wrapper is a sibling of results-left, both children of anchor */
  a.results-item {
    position: relative;              /* For positioning price-wrapper */
  }

  a.results-item > .results-price-wrapper {
    position: absolute !important;   /* Force absolute positioning relative to anchor */
    right: 12px !important;          /* Position on image */
    top: 12px !important;            /* Position on top of image, not below */
    display: flex !important;         /* Always visible */
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    z-index: 10 !important;
    opacity: 1 !important;           /* Always visible */
    visibility: visible !important;  /* Always visible */
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
  }

  /* Price row - inline with buttons */
  a.results-item > .results-price-wrapper > .price-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: 38px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  /* Price badge - prominent on mobile */
  a.results-item > .results-price-wrapper .results-price {
    font-size: 16px !important;
    font-weight: 700 !important;
    padding: 8px 14px !important;
    line-height: 1.2 !important;
    height: 38px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  /* Price per sqm - matches price change size */
  a.results-item > .results-price-wrapper .price-per-sqm {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #64748b !important;
  }

  /* Price change indicator - match btn-map/btn-predict sizing on mobile */
  a.results-item > .results-price-wrapper .price-change {
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 8px 10px !important;
    line-height: 1.2 !important;
    height: 38px !important;
    min-width: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
  }

  a.results-item > .results-price-wrapper .price-change.price-decrease {
    color: #047857 !important;
  }

  a.results-item > .results-price-wrapper .price-change.price-increase {
    color: #b91c1c !important;
  }

  /* Buttons - inline with price, match price height */
  a.results-item > .results-price-wrapper > .results-button-group {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: 38px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  /* Button styling - same height as price */
  a.results-item > .results-price-wrapper .btn-predict,
  a.results-item > .results-price-wrapper .btn-map {
    height: 38px !important;
    min-width: 38px !important;
    padding: 8px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  /* Address is now separate row */
  .results-addr {
    display: block;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 16px;
    line-height: 1.4;
    margin: 0 0 6px 0;
  }

  /* Meta information */
  .results-meta {
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
  }

  /* Price row - horizontal layout */
  .price-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
  }

  /* Price badge - larger and more prominent */
  .results-price {
    font-size: 20px;                 /* Larger price on mobile */
    font-weight: 800;
    padding: 10px 14px;
    white-space: nowrap;
  }

  /* Price change indicator - badge style */
  .price-change {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    height: 36px;
  }

  .price-change.price-decrease {
    color: #047857;
  }

  .price-change.price-increase {
    color: #b91c1c;
  }

  /* Button group - horizontal layout */
  .results-button-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    width: 100%;
    margin-top: 4px;
  }

  /* Buttons - slightly larger on mobile */
  .btn-predict,
  .btn-map {
    min-width: 44px;                 /* Touch-friendly size */
    height: 36px;
    padding: 6px 10px;
    font-size: 14px;
  }

  /* Image comes first in the flex order */
  a.results-item > .results-image {
    order: 0;
  }

  /* Hide the arrow on mobile */
  .results-item .result-open {
    display: none;
  }

  /* Structured metadata styles for mobile */
  .specs-grid {
    flex-wrap: nowrap;
    gap: 0;
    padding-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .specs-grid::-webkit-scrollbar {
    display: none;
  }

  .spec-item {
    font-size: 14px;
    gap: 6px;
    padding: 0 10px;
    flex-shrink: 0;
  }

  .spec-item:first-child {
    padding-left: 0;
  }

  .spec-icon {
    width: 16px;
    height: 16px;
  }

  .feature-tags {
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
  }

  .feature-tag {
    padding: 2px 6px;
    font-size: 10px;
  }

  .meta-time {
    margin-top: 6px;
    font-size: 10px;
    color: #94a3b8;
  }

  .deal-badge {
    padding: 4px 8px;
    font-size: 9px;
    top: 10px;
    right: 10px;
  }
}

/* Extra small phones - further optimizations */
@media (max-width: 480px){
  .results-list {
    gap: 12px;
  }

  .results-item {
    border-radius: 14px;
  }

  a.results-item > .results-image {
    height: 220px;                    /* Slightly smaller on very small screens */
  }

  a.results-item > .results-left {
    padding: 14px 14px 0 14px;       /* Slightly less padding */
  }

  a.results-item > .results-price-wrapper {
    padding: 0 14px 14px 14px;
  }

  .results-addr {
    font-size: 15px;
  }

  /* Header right in extra small screens - keep readable sizes */
  .header-right .results-price {
    font-size: 16px;
    font-weight: 700;
    padding: 6px 12px;
    height: 36px;
    border-radius: 10px;
  }

  .header-right .price-per-sqm {
    font-size: 13px;
  }

  .header-right .price-change {
    font-size: 12px;
    font-weight: 600;
    padding: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    height: 36px;
    min-width: 36px;
  }

  .header-right .price-change.price-decrease {
    color: #047857;
  }

  .header-right .price-change.price-increase {
    color: #b91c1c;
  }

  .header-right .btn-predict,
  .header-right .btn-map,
  .header-right .btn-price-change {
    height: 36px;
    min-width: 36px;
    padding: 6px;
    border-radius: 10px;
  }

  .results-meta {
    font-size: 12px;
  }

  .specs-grid {
    gap: 0;
  }

  .spec-item {
    font-size: 13px;
    padding: 0 8px;
  }

  .spec-icon {
    width: 15px;
    height: 15px;
  }

  .feature-tag {
    font-size: 10px;
    padding: 3px 6px;
  }

  .meta-time {
    font-size: 10px;
  }
}

/* Hide the trailing arrow/chevron in the ads list for all screen sizes */
.results-item .results-arrow,
.results-item .arrow,
.results-item .chevron,
.results-item .go,
.results-item .result-open,
/* hide arrow that comes after price wrapper, but NOT the button inside wrapper */
.results-item .results-price-wrapper + .result-open{
  display: none !important;
}

/* Hide the trailing arrow SVG, but NOT SVGs inside buttons */
.results-item > svg:last-child,
.results-item > i:last-child {
  display: none !important;
}

/* Single-column layout when the editor is hidden */
.shell.preview-only .main{
  grid-template-columns: minmax(0,1fr);   /* 1 column */
}

/* Make the preview span full width and drop the height lock */
.shell.preview-only #cardPreview{
  grid-column: 1 / -1;
  height: auto;
  max-height: none;
  contain: none;
  overflow: visible;
}
.shell.preview-only #cardPreview .results{
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}

/* When form is visible, keep side-by-side layout and show single column ads in preview */
@media (min-width: 1025px) {
  /* When form is visible (not hidden), preview shows single column */
  #cardCreate:not(.hidden) ~ #cardPreview .results-list {
    grid-template-columns: 1fr !important;  /* Single column when form is visible */
    max-width: 100% !important;
    width: 100% !important;
  }
  
  /* Ensure main grid stays side by side when form is visible */
  .main:has(#cardCreate:not(.hidden)) {
    grid-template-columns: minmax(400px, 450px) minmax(550px, 750px) !important;  /* Fixed search, fixed max preview width */
    max-width: var(--container) !important;  /* Enforce max-width (content only) */
    box-sizing: content-box !important;  /* Padding outside max-width */
    margin: 0 auto !important;  /* Center the grid */
  }
  
  /* Ensure preview container maintains fixed width when form is visible */
  #cardCreate:not(.hidden) ~ #cardPreview {
    min-width: 550px !important;  /* Prevent preview from shrinking too much */
    max-width: 750px !important;  /* Prevent preview from growing too much */
    flex: 0 1 auto !important;     /* Don't grow beyond max-width */
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  #cardCreate:not(.hidden) ~ #cardPreview .results {
    width: 100% !important;
    min-width: 0;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }
}

/* Saved Searches: keep action buttons in a single row, don't stretch */
section.card.wide .row > div:first-child .btn{
  width: auto;               /* override the global button{width:100%} */
  min-width: max-content;    /* never shrink below text width */
  white-space: nowrap;       /* prevent wrapping inside the button */
  flex: 0 0 auto;            /* don't grow/shrink in the tiny flex container */
}

/* (optional) if they still collide on very narrow screens, allow the pair to wrap to 2 lines */
section.card.wide .row > div:first-child{
  flex-wrap: wrap;           /* each button stays one-line, container may wrap */
}

/* Visual indicator for ads from email notification (deeplink) */
.results-list .results-item.is-new {
  border: 3px solid #fbbf24 !important;  /* Prominent yellow border */
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2), 0 4px 12px rgba(251, 191, 36, 0.15) !important;
  position: relative;
  transition: all 0.2s ease;
}

/* Add subtle yellow glow effect */
.results-list .results-item.is-new::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
  border-radius: 16px;
  z-index: -1;
  pointer-events: none;
}

/* Hover effect for deeplink ads */
.results-list .results-item.is-new:hover {
  border-color: #f59e0b !important;  /* Slightly darker yellow on hover */
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.3), 0 6px 16px rgba(245, 158, 11, 0.2) !important;
  transform: translateY(-2px);
}

.results-list .badge-new { display:none !important; }
@media (prefers-color-scheme: dark){
  body.theme-dark .results-list .badge-new { display:none !important; }
}

/* Tighten the preview card gutter */
.card#cardPreview{
  padding: 18px;            /* was 18px */
}

/* Remove the inner wrapper padding so rows sit close to the border */
#cardPreview .results{
  padding: 0;              /* was 12px */
}

/* Keep it tight on mobile too (overrides the mobile block above) */
@media (max-width:1024px){
  .card#cardPreview{ padding: 18px; }
  #cardPreview .results{ padding: 0; }
}

/* Optional: if your preview has a heading and you want that gap smaller too */
.card#cardPreview > h3{
  margin: 0 0 12px;         /* was 0 0 12px globally */
  padding: 0 8px;          /* keeps the title aligned with the tighter gutter */
}

/* City + address: drop address to next line when they don't fit */
.results-head{
  display: flex;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  min-width: 0;
  flex-wrap: wrap;                 /* allow a second row */
}
.results-city{ flex: 0 0 auto; }   /* chip keeps its natural width */

/* Address styling - separate row below header */
.results-addr{
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  width: 100%;
}

/* Additional mobile refinements - consolidated with above */

/* Cancel — buttery ghost */
.btn-cancel{
  background: linear-gradient(180deg, var(--butter-2), #FFF4C9);
  border: 1px solid var(--butter);
  color: #5a4600;                 /* readable on light yellow */
}

.btn-cancel:hover{
  background: linear-gradient(180deg, var(--butter-2), var(--butter));
  box-shadow: 0 6px 18px rgba(255, 208, 92, .20);
}

.btn-cancel:focus-visible{
  outline: 0;
  box-shadow: 0 0 0 4px rgba(255,224,138,.45);
}

.btn-cancel:disabled{
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

/* --- Save (pale-blue) tokens --- */
:root{
  --save-bg:#F5FAFF;
  --save-bg-hover:#EEF7FF;
  --save-border:#e7eef7;
  --save-text:#24405c;
}

/* Share one visual for all "Save" buttons */
.btn-save,
.btn-ghost{                          /* your edit-mode Save already uses .btn-ghost */
  background: var(--save-bg);
  border: 1px solid var(--save-border);
  color: var(--save-text);
  box-shadow: none;
}
.btn-save:hover,
.btn-ghost:hover{
  background: var(--save-bg-hover);
  box-shadow: 0 6px 18px rgba(14,125,194,.08);
}

/* Legacy #cardCreate .btn-primary lavender override removed - it was
   stealing the Išsaugoti / Sukurti buttons from the editorial dark-ink
   treatment in .sc-form .sc-foot .btn-primary (line ~11834) and
   leaving an almost-invisible light-blue hover with white text. The
   editorial style now wins by default. */

/* ---------- Plans UI ---------- */
/* compact plan strip for subscriptions modal */
#planCurrent.plan-strip,
.plan-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 2px;
  font-size: 13px;
  border-radius: 10px;
}

/* keep plan chip visible but compact */
.plan-strip .plan-chip {
  background: transparent;
  padding: 4px 8px;
  font-weight: 700;
}

/* hide the long-perks sentence */
#planPerks {
  display: none !important;
}

.plan-chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px; font-weight:800;
  background:#ECFFFB; border:1px solid #d6f5ef; color:#0f766e;
}

/* Old grid layout - kept for backwards compatibility */
.plans-grid{
  display:grid; gap:14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* New vertical stack layout */
.plans-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-card-horizontal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-card-horizontal .plan-info {
  width: 100%;
}

.plan-card-horizontal .plan-info header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.plan-card-horizontal .plan-action {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-card-horizontal .feat {
  margin: 0;
  padding-left: 18px;
}

.plan-card-horizontal .feat li {
  margin-bottom: 2px;
}

/* Free card - more compact */
.plan-card.plan-card-free {
  background: #f8fafc;
  border-color: #e2e8f0;
  padding: 16px 20px;
}

.plan-card.plan-card-free header {
  margin-bottom: 4px;
}

.plan-card.plan-card-free h4 {
  font-size: 18px;
  color: #64748b;
}

.plan-card.plan-card-free .price {
  font-size: 18px;
  color: #64748b;
}

.plan-card.plan-card-free .feat.feat-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding-left: 0;
  list-style: none;
  color: #64748b;
  font-size: 13px;
}

.plan-card.plan-card-free .feat.feat-inline li::before {
  content: "•";
  margin-right: 6px;
  color: #94a3b8;
}

.plan-card{
  background:#fff; border:1px solid #eef2f6; border-radius:14px; padding:16px;
  box-shadow: var(--shadow);
  display:flex; flex-direction:column; gap:10px;
}

.plan-card header{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-left:-8px; margin-right:-8px; padding:0 8px; }
.plan-card h4{ margin:0; font-size:22px; font-weight:800; }
.plan-card .price{ font-weight:800; font-size:22px; display:flex; align-items:baseline; gap:2px; }
.plan-card .price .per{ font-weight:700; font-size:14px; color:#6B7A90; }
.plan-card .price.has-discount{ display:flex; flex-direction:row; align-items:baseline; gap:10px; }
.plan-card .price.has-discount .price-original{ font-size:18px; font-weight:600; color:#EF4444; text-decoration:line-through; order:1; }
.plan-card .price.has-discount .price-new{ font-size:22px; font-weight:800; color:#0f766e; display:flex; align-items:baseline; gap:2px; order:2; }
.plan-card .price.has-discount .price-new .per{ margin-left:0; color:#6B7A90; }
.plan-card .promo-wrap{ border:1px solid #e3ecf7; background:#f7fbff; border-radius:16px; padding:16px; display:flex; flex-direction:column; gap:10px; }
.plan-card .promo-wrap label{ font-size:14px; font-weight:700; color:#25324b; }
.plan-card .promo-wrap input{ 
  width: 100%;
  border: 1px solid #d7e1f0; 
  border-radius: 12px; 
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2d3d;
  background: #fff; 
  box-sizing: border-box;
  line-height: 1.4;
}

.plan-card .promo-wrap input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.plan-card .promo-wrap input:focus{ 
  outline: 2px solid var(--teal); 
  outline-offset: 1px;
}
.plan-card .promo-hint{ margin:0; font-size:12px; color:#5a6a84; }
.plan-card .promo-feedback{ min-height:18px; font-size:13px; font-weight:600; color:#3a4a61; margin:0; }
.plan-card .promo-feedback.error{ color:#c23832; }
.plan-card .promo-feedback.success{ color:#1f8a5f; }
.plan-card .promo-wrap .btn{ min-width:112px; }
.plan-card .feat{ margin:0; padding-left:18px; color:#3a4a61; }
/* Highlight key features in subscription plans */
.plan-card .feat li strong {
  color: #0A8A6B !important;
  font-weight: 700 !important;
  
  text-decoration-color: #0A8A6B;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.plan-card.highlight{
  outline: 2px solid #d6f5ef;
  background: linear-gradient(180deg,#FCFFFE,#FFFFFF);
}
.plan-card .best{
  background: linear-gradient(180deg, var(--teal), #72E6DA);
  color: #063d37; font-size:12px; font-weight:800; padding:4px 8px;
  border-radius: 999px; align-self:flex-start;
}

.plan-manage{ display:flex; gap:10px; justify-content:flex-end; }

/* ---------- Plans UI (Enhanced) ---------- */

/* Modal backdrop - darker, more dramatic */
#planModal.modal{
  background: rgba(14,27,46,.75);
}

/* Panel - bigger, more breathing room */
#planModal .panel{
  max-width: 560px;
  height: 85vh;
  border-radius: 20px;
  border: 1px solid #dfe7f1;
  box-shadow: 0 30px 80px rgba(10,35,60,.20);
  overflow: hidden;  /* ✅ Clip the body content to the rounded corners */
}

/* Header - hidden; close button floats in top-right corner */
#planModal > .panel > header{
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  z-index: 10;
  padding: 0;
  border: none;
  background: transparent;
}

#planModal #planTitle{
  display: none;
}

/* Body - extra top padding to account for hidden header + close button */
#planModal .body{
  padding: 48px 24px 28px;
  overflow-y: auto;
  background: #fff;
}

/* Footer - match the header/body */
#planModal footer{
  padding: 16px 24px;
  border-top: 1px solid #eef2f6;
  background: #fff;  /* ✅ Changed from #F8FBFF to white */
}

/* Close button in header - small, subtle, top-right corner */
#planModal > .panel > header #btnClosePlan{
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  color: #94a3b8;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(14,27,46,0.08);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
  box-shadow: none !important;
}
#planModal > .panel > header #btnClosePlan:hover{
  color: var(--ink);
  background: #fff;
  border-color: rgba(14,27,46,0.18);
}
/* Footer close button */
#planModal footer button{
  color: var(--ink);
}

/* Plan cards - fix the border radius issue */
.plan-card{
  background: #fff;
  border: 3px solid #e7eef7;  /* ✅ Thicker border */
  border-radius: 20px;  /* ✅ Slightly bigger radius */
  padding: 24px;
  box-shadow: 0 4px 16px rgba(10,35,60,.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}

/* Highlight card - the teal border was the problem */
.plan-card.highlight{
  border: 3px solid #72E6DA;  /* ✅ Match thickness */
  background: linear-gradient(180deg, #FCFFFE, #FFFFFF);
  box-shadow: 0 8px 32px rgba(41,211,194,.18);
  overflow: hidden;
}

/* Top gradient bar */
.plan-card.highlight::before{
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), #72E6DA, var(--teal));
  z-index: 1;
}

/* Maksimalus/UNLIMITED card - gold/amber highlight */
.plan-card.highlight-max{
  border: 3px solid #F59E0B;
  background: linear-gradient(180deg, #FFFBF5, #FFFFFF);
  box-shadow: 0 8px 32px rgba(245,158,11,.18);
  overflow: hidden;
}

.plan-card.highlight-max::before{
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #F59E0B, #FBBF24, #F59E0B);
  z-index: 1;
}

/* Pažangus subscribe button - green to match border */
.plan-card.highlight .btn-primary {
  background: linear-gradient(180deg, #14B8A6, #0D9488) !important;
  border-color: #0D9488 !important;
  color: #fff !important;
}

.plan-card.highlight .btn-primary:hover {
  background: linear-gradient(180deg, #2DD4BF, #14B8A6) !important;
}

/* Maksimalus bold text - gold/amber instead of green */
.plan-card.highlight-max .feat li strong {
  color: #D97706 !important;
}

/* Maksimalus subscribe button - gold/amber */
.plan-card.highlight-max .btn-primary {
  background: linear-gradient(180deg, #F59E0B, #D97706) !important;
  border-color: #D97706 !important;
  color: #fff !important;
}

.plan-card.highlight-max .btn-primary:hover {
  background: linear-gradient(180deg, #FBBF24, #F59E0B) !important;
}

/* Best Value badge - gold/amber style */
.plan-card .best.best-value{
  background: linear-gradient(180deg, #F59E0B, #FBBF24);
  color: #78350F;
}

/* Ensure everything inside respects corners */
.plan-card > *:last-child{
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* ========== PLAN MODAL V2 - 3-COLUMN GRID ========== */

/* Widen the plan modal panel */
#planModal .panel{
  max-width: 920px;
  height: auto;
  max-height: 92vh;
}

/* 3-column grid */
.plans-grid-v2{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

/* Base card v2 */
.plan-card-v2{
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
  overflow: visible;
}
.plan-card-v2-inner{
  padding: 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* Cards with badges need extra top padding so plan name clears the badge */
.plan-recommended .plan-card-v2-inner,
.plan-best-value .plan-card-v2-inner{
  padding-top: 32px;
}

/* Recommended (Advanced) card */
.plan-card-v2.plan-recommended{
  border: 2px solid #14b8a6;
  box-shadow: 0 8px 32px rgba(20,184,166,.2);
  z-index: 1;
}

/* Best value (Unlimited) card */
.plan-card-v2.plan-best-value{
  border: 2px solid #f59e0b;
  box-shadow: 0 8px 32px rgba(245,158,11,.12);
}

/* Badges */
.plan-badge-v2{
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  z-index: 2;
}
.plan-badge-v2.badge-teal{
  background: linear-gradient(180deg, #14b8a6, #0d9488);
  color: #fff;
}
.plan-badge-v2.badge-amber{
  background: linear-gradient(180deg, #f59e0b, #d97706);
  color: #fff;
}

/* Card header - reset .modal header base styles */
.plan-header-v2{
  position: static;
  display: block;
  padding: 0 0 12px;
  border-bottom: 1px solid #eef2f6;
  margin-bottom: 4px;
  background: none;
}
.plan-header-v2 h4{
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0e1b2e;
}

/* Price display */
.plan-price-v2{
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 4px 0 8px;
}
.plan-price-v2 .plan-amount{
  font-size: 40px;
  font-weight: 800;
  color: #0e1b2e;
  line-height: 1;
}
.plan-price-v2 .plan-currency{
  font-size: 18px;
  font-weight: 700;
  color: #64748b;
}
.plan-price-v2 .plan-period{
  font-size: 16px;
  font-weight: 600;
  color: #94a3b8;
}
/* Discount layout */
.plan-price-v2.has-discount{
  flex-wrap: wrap;
  gap: 6px;
}
.plan-price-v2.has-discount .price-original{
  font-size: 22px;
  font-weight: 600;
  color: #EF4444;
  text-decoration: line-through;
}
.plan-price-v2.has-discount .price-new{
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.plan-price-v2.has-discount .price-new .plan-amount{
  color: #059669;
}

/* Feature list */
.plan-features-v2{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.feat-row{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #334155;
  line-height: 1.4;
}
.feat-row strong{
  font-weight: 700;
  color: #0e1b2e;
}
.feat-row.feat-disabled{
  color: #94a3b8;
}
.feat-row.feat-disabled strong{
  color: #94a3b8;
}

/* Check icon */
.feat-check{
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feat-check::after{
  content: '';
  display: block;
  width: 10px;
  height: 6px;
  border-left: 2px solid #059669;
  border-bottom: 2px solid #059669;
  transform: rotate(-45deg) translateY(-1px);
}

/* Cross icon */
.feat-cross{
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feat-cross::after{
  content: '';
  display: block;
  width: 10px;
  height: 2px;
  background: #cbd5e1;
  border-radius: 1px;
}

/* Recommended card - green checks */
.plan-recommended .feat-check{
  background: #d1fae5;
}
.plan-recommended .feat-row strong{
  color: #0d9488;
}

/* Best value card - amber checks */
.plan-best-value .feat-check{
  background: #fef3c7;
}
.plan-best-value .feat-check::after{
  border-color: #d97706;
}
.plan-best-value .feat-row strong{
  color: #b45309;
}

/* CTA area */
.plan-cta-v2{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  margin-top: auto;
}

/* Button styles */
.btn-outline-muted{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-outline-muted:hover{
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-primary-teal{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
  border: none;
  background: linear-gradient(180deg, #14b8a6, #0d9488);
  color: #fff;
  cursor: pointer;
  transition: background .15s, transform .1s;
  box-shadow: 0 4px 14px rgba(20,184,166,.25);
}
.btn-primary-teal:hover{
  background: linear-gradient(180deg, #2dd4bf, #14b8a6);
  transform: translateY(-1px);
}
.btn-primary-teal:disabled{
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary-amber{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
  border: none;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  color: #fff;
  cursor: pointer;
  transition: background .15s, transform .1s;
  box-shadow: 0 4px 14px rgba(245,158,11,.25);
}
.btn-primary-amber:hover{
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  transform: translateY(-1px);
}
.btn-primary-amber:disabled{
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* Promo <details> collapsed */
.promo-details{
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}
.promo-details summary{
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.promo-details summary::-webkit-details-marker{ display: none; }
.promo-details summary::before{
  content: '+';
  font-size: 16px;
  font-weight: 800;
  color: #94a3b8;
  transition: transform .15s;
}
.promo-details[open] summary::before{
  content: '-';
}
.promo-details-body{
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.promo-details-body input{
  width: 100%;
  border: 1px solid #d7e1f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2d3d;
  background: #fff;
  box-sizing: border-box;
}
.promo-details-body input:focus{
  outline: 2px solid #14b8a6;
  outline-offset: 1px;
}
.promo-details-body input::placeholder{
  color: #9ca3af;
}
.promo-details .promo-hint{
  margin: 0;
  font-size: 12px;
  color: #64748b;
}
.promo-details .promo-feedback{
  min-height: 16px;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}
.promo-details .promo-feedback.error{ color: #c23832; }
.promo-details .promo-feedback.success{ color: #059669; }

/* "Current plan" badge on active card */
.plan-card-v2.is-current-plan{
  outline: 2px solid #14b8a6;
  outline-offset: -1px;
}
.plan-card-v2.is-current-plan::after{
  content: attr(data-current-label);
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #0d9488;
  color: #fff;
  white-space: nowrap;
}

/* Mobile tab switcher - hidden on desktop */
.plan-tabs-mobile{
  display: none;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 8px;
}
.plan-tab{
  flex: 1;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.plan-tab.active{
  background: #fff;
  color: #0e1b2e;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ---------- PLAN V2 RESPONSIVE ---------- */

/* Tablet: narrower 3 columns */
@media (max-width: 960px){
  #planModal .panel{
    max-width: 96vw;
  }
  .plans-grid-v2{
    gap: 12px;
  }
  .plan-card-v2.plan-recommended{
    transform: scale(1.01);
  }
  .plan-card-v2-inner{
    padding: 22px 18px;
  }
  .plan-price-v2 .plan-amount{
    font-size: 32px;
  }
}

/* Mobile: single column with tab switcher */
@media (max-width: 640px){
  #planModal .panel{
    max-width: 100vw;
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 95vh;
  }
  #planModal > .panel > header #btnClosePlan{
    top: 8px;
    right: 8px;
  }
  #planModal .body{
    padding: 16px;
  }
  .plans-grid-v2{
    grid-template-columns: 1fr;
    gap: 0;
  }
  .plan-tabs-mobile{
    display: flex;
  }
  .plan-tab{
    font-size: 12px;
    padding: 8px 2px;
  }
  .plan-card-v2{
    display: none;
    border-radius: 16px;
    margin-bottom: 8px;
  }
  .plan-card-v2.mobile-active{
    display: flex;
  }
  .plan-card-v2.plan-recommended{
    /* no transform to reset on mobile */
  }
  .plan-card-v2-inner{
    padding: 22px 20px;
  }
}

/* ---------- UNIVERSAL BUTTON HEIGHT FIX ---------- */

/* Reset ALL buttons in the plan modal to consistent height */
#planModal .plan-cta-v2 .btn,
#planModal .plan-cta-v2 button,
.plan-manage .btn,
.plan-manage button {
  min-height: 48px !important;
  height: auto !important;
  padding: 0 20px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
/* Keep old plan-card button rules for backward compat */
#planModal .btn,
#planModal button,
#planModal .btn-primary,
#planModal .btn-ghost,
#planModal .btn-danger,
.plan-card .btn,
.plan-card button,
.plan-manage .btn,
.plan-manage button {
  min-height: 52px !important;
  height: 52px !important;
  padding: 0 20px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 14px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.plan-card small.muted {
  display: none;
}

/* (blur-teaser / upgrade-hint styles removed - detail stripping is backend-enforced) */

/* Upgrade prompt at bottom of listings */
.upgrade-prompt {
  margin-top: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #FFF6D6 0%, #FFEED4 100%);
  border: 2px solid var(--butter);
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(255,224,138,.20);
}

.upgrade-prompt-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.upgrade-prompt-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: #29D3C2;
}
.upgrade-prompt-icon svg{
  width: 100%;
  height: 100%;
}

.upgrade-prompt-text {
  flex: 1;
  min-width: 200px;
}

.upgrade-prompt-text h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.upgrade-prompt-text p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

.upgrade-prompt .btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 180px;
}

/* Mobile adjustments */
@media (max-width: 720px) {
  .upgrade-prompt-content {
    flex-direction: column;
    text-align: center;
  }
  
  .upgrade-prompt .btn {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .plan-card header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .plan-card .best {
    align-self: flex-start;
  }

  .plan-card h4 {
    font-size: 20px;
  }

  .plan-card .price,
  .plan-card .price.has-discount {
    align-self: flex-start;
  }
}

/* Hide when not needed */
.upgrade-prompt.hidden {
  display: none !important;
}

/* ========== COOKIE CONSENT BANNER - ADD HERE ========== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid #eef2f6;
  box-shadow: 0 -4px 20px rgba(10,35,60,0.15);
  z-index: 10000;
  padding: 20px;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1;
  min-width: 300px;
}

.cookie-banner-text h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.cookie-banner-text p {
  margin: 0;
  font-size: 14px;
  color: #6B7A90;
  line-height: 1.5;
}

.cookie-banner-text a {
  color: #0e7dc2;
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-banner.hidden {
  display: none;
}

@media (max-width: 640px) {
  .cookie-banner {
    padding: 16px;
  }
  
  .cookie-banner-content {
    flex-direction: column;
    text-align: center;
  }
  
  .cookie-banner-actions {
    width: 100%;
    justify-content: center;
  }
}

/* ========== SITE FOOTER ========== */
.site-footer {
  padding: 40px 0 24px;
  color: var(--muted);
  font-size: 14px;
  background: #f8fafb;
  border-top: 1px solid #eef2f6;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--page-gutter);
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-brand-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.footer-brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer-copyright {
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links-title {
  font-weight: 700;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 4px;
}

.footer-app-download {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-app-download a {
  display: inline-block;
  transition: opacity 0.2s ease;
}

.footer-app-download a:hover {
  opacity: 0.8;
}

.footer-app-subtitle {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.footer-desktop-only {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
}

.footer-mobile-only {
  display: none;
}

.footer-qr-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 768px) {
  .footer-desktop-only {
    display: none !important;
  }
  .footer-mobile-only {
    display: block !important;
  }
}

/* Landing page footer badge - mobile only */
.footer-app-badge {
  text-align: center;
  padding: 12px 0;
}

@media (min-width: 769px) {
  .footer-app-badge {
    display: none !important;
  }
}

.site-footer a {
  color: #0e7dc2;
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 14px;
}

.site-footer a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.footer-bottom {
  max-width: var(--container);
  margin: 24px auto 0;
  padding-inline: var(--page-gutter);
  padding-top: 16px;
  border-top: 1px solid #eef2f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-separator {
  color: var(--muted);
  user-select: none;
}


@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
  }
  .footer-separator {
    display: none;
  }
}
/* ========== END SITE FOOTER ========== */

/* ========== TRUST / SOCIAL PROOF SECTION ========== */
.trust-section {
  grid-column: 1 / -1;
  padding: 48px 0;
  margin-top: 32px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.trust-section > * {
  min-width: 0;
}

.testimonial-carousel {
  position: relative;
  max-width: 700px;
  margin: 0 auto 32px;
  min-height: 200px;
}

.testimonial-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(234,245,247,0.8);
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 4px 24px rgba(10,35,60,.06);
}

.testimonial-slide {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.testimonial-slide.active {
  position: relative;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  clip-path: none;
  opacity: 1;
}

.testimonial-stars {
  color: #f59e0b;
  font-size: 16px;
  letter-spacing: 1px;
  margin-right: 8px;
}

.testimonial-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.testimonial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.testimonial-dot.active {
  background: var(--teal);
  transform: scale(1.25);
}

.testimonial-quote-mark {
  font-size: 48px;
  line-height: 1;
  color: var(--teal);
  opacity: 0.4;
  font-family: Georgia, serif;
  position: absolute;
  top: 16px;
  left: 20px;
}

.testimonial-text {
  font-size: 17px;
  line-height: 1.7;
  color: #3a4a61;
  font-style: italic;
  margin: 0 0 16px;
  padding-left: 8px;
}

.testimonial-attribution {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.testimonial-date {
  font-size: 13px;
  color: var(--muted);
  margin-left: 8px;
  font-weight: 400;
}

.portal-strip {
  text-align: center;
  margin-bottom: 24px;
}

.portal-strip-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.portal-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  align-items: center;
}

.portal-name {
  font-size: 15px;
  font-weight: 700;
  color: #51627a;
  padding: 8px 16px;
  background: rgba(255,255,255,0.8);
  border: 1px solid #eef2f6;
  border-radius: 10px;
}

.trust-rating {
  text-align: center;
  margin-top: 8px;
}

.trust-rating-stars {
  color: #f59e0b;
  font-size: 20px;
  letter-spacing: 2px;
}

.trust-rating-text {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .testimonial-card {
    padding: 24px 20px;
  }
  .testimonial-text {
    font-size: 15px;
  }
  .portal-logos {
    gap: 12px;
  }
  .portal-name {
    font-size: 13px;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  .trust-section {
    padding: 32px 0;
  }
  .testimonial-card {
    padding: 20px 16px;
  }
  .testimonial-text {
    font-size: 14px;
  }
  .testimonial-quote-mark {
    font-size: 36px;
    top: 10px;
    left: 14px;
  }
}
/* ========== END TRUST SECTION ========== */

/* ========== STATS STRIP ========== */
.stats-strip {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  padding: 20px 0;
  margin-top: 20px;
}

.stats-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stats-strip-number {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
}

.stats-strip-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 480px) {
  .stats-strip {
    gap: 24px;
  }
  .stats-strip-number {
    font-size: 20px;
  }
  .stats-strip-label {
    font-size: 12px;
  }
}
/* ========== END STATS STRIP ========== */

/* ========== PRIVACY MODAL STYLING (match Terms) ========== */
#privacyModal .panel {
  position: relative;
  margin: 40px auto;
  background: #fff;
  max-width: 880px;
  height: 80vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  border: 1px solid #e5edf5;
}

#privacyModal header {
  padding: 12px 16px;
  border-bottom: 1px solid #eef2f6;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#privacyModal .body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

#privacyModal footer {
  padding: 12px 16px;
  border-top: 1px solid #eef2f6;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Style the iframe content */
#privacyFrame {
  width: 100%;
  height: 100%;
  border: 0;
}

.plan-manage {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.plan-manage .btn {
  flex: 1 1 0;
  min-width: 0;
}

/* Mobile: "Valdyti prenumeratą" / "Nutraukti prenumeratą" labels are
   too long to share a row with "Uždaryti" at 358px-ish viewport widths,
   so stack the trio full-width. Still visually grouped as one block,
   each button is full-width and thumb-sized. */
@media (max-width: 540px){
  .plan-manage{
    flex-direction: column;
    gap: 8px;
  }
  .plan-manage .btn,
  .plan-manage button{
    width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    padding: 0 14px !important;
    font-size: 14px !important;
    min-height: 46px !important;
    height: 46px !important;
    border-radius: 12px !important;
  }
}

/* Payment history table — rendered inline above the manage row for
   paid (or previously-paid) users. Replaces the old toggle-button UX.
   Editorial cream paper to match the rest of the plan modal; overrides
   the inline white/cool-blue styles emitted by loadPaymentHistory(). */
.plan-payment-history{
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ed-line-soft, #EEE8DC);
}
.plan-payment-history-title{
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ed-ink-3, #6B6557);
}
.plan-payment-history-table{
  max-height: 240px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid var(--ed-line, #E3DBCB);
  background: var(--ed-paper, #FAF7F2);
}
.plan-payment-history-table table{
  margin: 0;
  background: transparent !important;
}
.plan-payment-history-table thead tr{
  border-bottom: 1px solid var(--ed-line, #E3DBCB) !important;
  background: var(--ed-paper-2, #F3EEE5) !important;
}
.plan-payment-history-table thead th{
  color: var(--ed-ink-3, #6B6557);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.plan-payment-history-table tbody tr{
  border-bottom: 1px solid var(--ed-line-soft, #EEE8DC) !important;
  background: transparent !important;
}
.plan-payment-history-table tbody tr:last-child{
  border-bottom: 0 !important;
}
.plan-payment-history-table tbody td{
  color: var(--ed-ink-2, #3A362E);
}
@media (max-width: 540px){
  .plan-payment-history-table{
    overflow-x: hidden;
  }
  .plan-payment-history-table table{
    font-size: 12px !important;
  }
  .plan-payment-history-table th,
  .plan-payment-history-table td{
    padding: 6px 4px !important;
  }
  /* Drop the "Laikotarpis" (period) column on narrow screens — date,
     amount, status, and the invoice link cover the essentials. */
  .plan-payment-history-table th:nth-child(3),
  .plan-payment-history-table td:nth-child(3){
    display: none !important;
  }
}

.btn-google {
  background: white;
  color: #3c4043;
  border: 1px solid #dadce0;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-google:hover {
  background: #f8f9fa;
  border-color: #d2d3d4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-google:active {
  background: #e8eaed;
}

.btn-apple {
  background: #000;
  color: #fff;
  border: 1px solid #000;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-apple:hover {
  background: #333;
  border-color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-apple:active {
  background: #555;
}

/* ========== GUEST BROWSING MODE ========== */

.demo-banner {
  background: linear-gradient(135deg, #e0f7ec 0%, #fef9e7 100%);
  border: 1px solid #b2dfdb;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 0 0 12px;
  text-align: center;
  grid-column: 1 / -1;
}
.demo-banner p {
  margin: 0 0 12px;
  font-size: 0.93rem;
  color: #37474f;
  line-height: 1.5;
}
.demo-banner-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.guest-appbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

body.guest-mode .main {
  grid-template-columns: 1fr;
  max-width: var(--container);
  margin: 0 auto;
}

body.guest-mode #cardPreview {
  grid-column: 1 / -1;
  max-width: none;
  min-width: 0;
  height: auto;
  max-height: none;
  contain: none;
  overflow: visible;
}

/* (ad-blur-badge / ad-lock-badge / ad-lock-overlay styles removed - replaced by backend detail stripping) */

/* --- Modern Ads Listing Tabs --- */
.ads-tabs-container {
  margin-top: -10px;
  margin-bottom: 20px;
}

.ads-tabs-modern {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e8eef5;
}

.ads-tab-modern {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  background: transparent;
  color: #6B7A90;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  width: auto;
}

.ads-tab-modern::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  border-radius: 3px 3px 0 0;
  transition: background 0.2s ease;
}

.ads-tab-modern:hover {
  color: #0f766e;
}

.ads-tab-modern.active,
.ads-tab-modern[aria-selected="true"] {
  color: #0f766e;
  font-weight: 700;
}

.ads-tab-modern.active::after,
.ads-tab-modern[aria-selected="true"]::after {
  background: #0f766e;
}

.tab-star-icon {
  width: 18px;
  height: 18px;
  color: #FFD700;
}

.ads-tab-modern:not(.active) .tab-star-icon {
  color: #CBD5E1;
}

.tab-badge {
  background: #0f766e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.ads-tab-modern:not(.active) .tab-badge {
  background: #CBD5E1;
  color: #64748B;
}

/* --- Star button on ad cards --- */
.ad-star-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: rgba(100, 116, 139, 0.85);
  border-radius: 50%;
  cursor: pointer;
  line-height: 0;
  transition: all 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-star-btn:hover {
  transform: scale(1.1);
  background: rgba(100, 116, 139, 0.95);
}

.ad-star-btn svg {
  width: 20px;
  height: 20px;
  transition: all 0.2s ease;
}

.ad-star-btn svg path {
  fill: rgba(255, 255, 255, 0.6);
  stroke: #fff;
  stroke-width: 1.5;
}

.ad-star-btn:hover svg path {
  fill: rgba(255, 215, 0, 0.5);
  stroke: #FFD700;
}

.ad-star-btn.starred {
  background: rgba(100, 116, 139, 0.85);
}

.ad-star-btn.starred svg path {
  fill: #FFD700;
  stroke: #DAA520;
  stroke-width: 1;
}

.ad-star-btn.starred:hover {
  background: rgba(100, 116, 139, 0.95);
}

.ad-star-btn.starred:hover svg path {
  fill: #FFEC8B;
  stroke: #DAA520;
}

.ad-star-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ad-star-btn:disabled:hover {
  transform: none;
}

/* --- Deal badge on ad cards (good deal / fair / overpriced) --- */
.deal-badge{
  position:absolute;
  top:12px;
  right:12px;
  padding:5px 10px;
  border-radius:8px;
  font-size:11px;
  font-weight:700;
  letter-spacing:0.3px;
  text-transform:uppercase;
  z-index:5;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

.deal-badge.good-deal{
  background:rgba(16, 185, 129, 0.95);
  color:#fff;
  box-shadow:0 2px 8px rgba(16, 185, 129, 0.3);
}

.deal-badge.fair-price{
  background:rgba(255, 255, 255, 0.9);
  color:#64748b;
  border:1px solid #e2e8f0;
}

.deal-badge.overpriced{
  background:rgba(239, 68, 68, 0.1);
  color:#dc2626;
  border:1px solid rgba(239, 68, 68, 0.3);
}

/* --- Card border glow for good deals --- */
.results-item.is-good-deal{
  border-color:rgba(16, 185, 129, 0.4);
  box-shadow:
    0 4px 16px rgba(10,35,60,.06),
    0 0 0 2px rgba(16, 185, 129, 0.12);
}

.results-item.is-good-deal:hover{
  border-color:rgba(16, 185, 129, 0.6);
  box-shadow:
    0 8px 24px rgba(10,35,60,.12),
    0 0 0 3px rgba(16, 185, 129, 0.18);
}

/* Category badge for starred ads (shows which type of ad) */
.ad-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #E8F4F3;
  color: #0f766e;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  margin-bottom: 4px;
}

/* Ad gone indicator */
.ad-gone-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #FEE2E2;
  color: #991B1B;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  margin-left: 6px;
}

/* Mobile adjustments */
@media (max-width: 720px) {
  .ads-tab-modern {
    padding: 12px 16px;
    font-size: 14px;
    gap: 6px;
  }

  .tab-star-icon {
    width: 16px;
    height: 16px;
  }

  .ad-star-btn {
    width: 32px;
    height: 32px;
    top: 12px;
    left: 12px;
  }

  .ad-star-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* (mobile blur/lock badge styles removed) */

/* (blur-reveal-container / blur-locker styles removed - replaced by backend detail stripping) */

/* ===========================
   PRICE PREDICTION STYLES
   =========================== */

/* Price wrapper - positioned on image overlay on desktop */
.results-price-wrapper {
  position: absolute;
  right: 12px;
  top: 12px;                          /* Position on image, not page corner */
  display: flex !important;  /* Always visible */
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  z-index: 10;  /* Higher z-index to ensure visibility above image */
  opacity: 1 !important;  /* Always visible */
  visibility: visible !important;  /* Always visible */
}

/* Desktop: Position price on image overlay */
@media (min-width: 1025px) {
  .results-item {
    position: relative !important;  /* Ensure price is positioned relative to card, not page */
  }
  
  .results-price-wrapper {
    position: absolute !important;
    right: 12px !important;
    top: 12px !important;  /* Position on top of image, not page corner */
    z-index: 10 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }
  
  /* Ensure price elements are always visible */
  .results-price-wrapper .results-price,
  .results-price-wrapper .price-change,
  .results-price-wrapper .results-button-group {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
  }
  
  /* Ensure buttons are visible */
  .results-price-wrapper .btn-predict,
  .results-price-wrapper .btn-map {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
  }
}

/* Button group container - holds prediction and map buttons side by side */
.results-button-group {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

/* Desktop: Buttons in header row */
.results-price-wrapper > .results-button-group {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
}

/* Button group container - wraps buttons horizontally when both are present */
.results-price-wrapper .btn-predict,
.results-price-wrapper .btn-map {
  display: inline-flex;
  flex-shrink: 0;
}

/* Prediction Button on Cards */
.btn-predict {
  padding: 4px 6px;
  font-size: 14px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: none;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  min-width: 32px;
  height: 28px;
  width: fit-content;
  position: relative;
}

.btn-predict:hover:not(.btn-predict-disabled) {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(30,41,59,.15);
}

.btn-predict:active:not(.btn-predict-disabled) {
  transform: translateY(0);
}

.btn-predict-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #e2e8f0;
}

.btn-predict-content {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.btn-predict-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.predict-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  color: currentColor;
}

/* Badge for remaining count */
.btn-predict-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  line-height: 1;
  background: #1e293b;
  color: #fff;
  box-shadow: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-predict:hover .btn-predict-badge {
  background: #fff;
  color: #1e293b;
}

/* On mobile, show slightly larger badge to accommodate "X/Y" format */
@media (max-width: 640px) {
  .btn-predict-badge {
    min-width: 28px;
    padding: 0 5px;
    font-size: 10px;
  }
}

/* Badge states */
.btn-predict-badge.badge-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.btn-predict-badge.badge-low {
  background: rgba(245, 158, 11, 0.2);
  color: #d97706;
  animation: pulse 2s ease-in-out infinite;
}

.btn-predict-badge.badge-zero {
  background: rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

.btn-predict-badge.badge-unlimited {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
  font-size: 12px;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Map Button on Cards */
.btn-map {
  padding: 4px 6px;
  font-size: 14px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: none;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  min-width: 32px;
  height: 28px;
  width: fit-content;
  position: relative;
  overflow: visible;
}

.btn-map:hover {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(30,41,59,.15);
}

.btn-map:active {
  transform: translateY(0);
}

.btn-map-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-map svg,
.btn-map .map-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  color: currentColor;
  transition: color .15s ease;
}

.btn-map svg path,
.btn-map .map-icon path {
  fill: currentColor;
  transition: fill .15s ease;
}

/* Price Change Button on Cards - same footprint as btn-map/btn-predict */
.btn-price-change {
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: none;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  min-width: 32px;
  height: 28px;
  width: fit-content;
  position: relative;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn-price-change:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(30,41,59,.15);
}
.btn-price-change:active {
  transform: translateY(0);
}
.btn-price-change.price-increase {
  color: #b91c1c;
}
.btn-price-change.price-decrease {
  color: #047857;
}
.btn-price-change.btn-price-change-locked {
  color: #64748b;
}
.btn-price-change svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

/* Prediction Modal */
.prediction-panel {
  max-width: 560px;
  width: 92%;
  max-height: 90vh;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 25px 60px rgba(10,35,60,.12), 0 0 0 1px rgba(0,0,0,.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#predictionModal.modal.show {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 40px;
  overflow-y: auto;
}

#predictionModal .prediction-panel {
  height: auto;
  max-height: 92vh;
  margin: 0;
  flex-shrink: 0;
}

#mapModal.modal.show {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 40px;
  overflow-y: auto;
}

#mapModal .prediction-panel {
  max-width: 900px;
  max-height: 90vh;
  height: 90vh;
  margin: 0;
}

.prediction-panel .body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 20px;
}

#predictionModal .prediction-panel .body {
  padding: 0 20px 16px;
  flex: 0 1 auto;
}

.prediction-panel .body:has(.prediction-map-container:only-child) {
  padding: 0;
  overflow: hidden;
}

/* Header */
.prediction-panel header {
  padding: 16px 20px;
  border-bottom: 1px solid #eef2f6;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.pred-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pred-header-icon {
  color: #0f766e;
  flex-shrink: 0;
}

.pred-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  transition: all .15s ease;
}

.pred-close-btn:hover {
  background: #f1f5f9;
  color: var(--ink);
}

/* Footer */
.prediction-panel footer {
  padding: 14px 20px;
  border-top: 1px solid #eef2f6;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Loading State */
.prediction-loading {
  text-align: center;
  padding: 56px 40px;
}

.pred-loading-pulse {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e9fbf3, #d6f5ef);
  margin: 0 auto 18px;
  position: relative;
  animation: pred-pulse 1.6s ease-in-out infinite;
}

.pred-loading-pulse::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #0f766e;
  border-right-color: transparent;
  border-bottom-color: transparent;
  animation: spin 0.9s linear infinite;
}

@keyframes pred-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

.search-loading {
  text-align: center;
  padding: 60px 40px;
}

.spinner {
  border: 3px solid #eef2f6;
  border-top: 3px solid var(--teal);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.prediction-loading p,
.search-loading p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

/* App Loading Overlay - full page loading state after login */
.app-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #e9fbf3 0%, #f0f9ff 50%, #fef3c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

.app-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.app-loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.app-loading-content {
  text-align: center;
  padding: 40px;
}

.app-loading-content .spinner {
  width: 56px;
  height: 56px;
  border-width: 4px;
  margin-bottom: 20px;
}

.app-loading-content p {
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  margin: 0;
}

/* ── Assessment Hero ── */
.pred-assessment-hero {
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  margin-bottom: 10px;
  transition: all .25s ease;
}

.pred-hero-good {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
}

.pred-hero-fair {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
}

.pred-hero-over {
  background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%);
  border: 1px solid #fecaca;
}

.pred-hero-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.pred-hero-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.pred-hero-good .pred-hero-icon {
  background: #059669;
  color: #fff;
}

.pred-hero-fair .pred-hero-icon {
  background: #d97706;
  color: #fff;
}

.pred-hero-over .pred-hero-icon {
  background: #dc2626;
  color: #fff;
}

.pred-hero-label {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pred-hero-good .pred-hero-label { color: #065f46; }
.pred-hero-fair .pred-hero-label { color: #92400e; }
.pred-hero-over .pred-hero-label { color: #991b1b; }

.pred-hero-diff {
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
}

.pred-hero-good .pred-hero-diff { color: #047857; }
.pred-hero-fair .pred-hero-diff { color: #b45309; }
.pred-hero-over .pred-hero-diff { color: #b91c1c; }

/* ── Price Comparison ── */
.pred-prices {
  background: #f8fafc;
  border: 1px solid #e8eef5;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 10px;
}

.pred-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.pred-price-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.pred-price-label-ai {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #0f766e;
}

.pred-price-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pred-price-ai {
  color: #0f766e;
}

.pred-price-divider {
  height: 1px;
  background: #e8eef5;
  margin: 4px 0;
}

/* ── Details Grid ── */
.pred-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.pred-detail-item {
  background: #f8fafc;
  border: 1px solid #e8eef5;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pred-detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pred-detail-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

/* ── Remaining ── */
.pred-remaining {
  text-align: center;
  padding: 8px 14px;
  background: #f0fdf9;
  border: 1px solid #d6f5ef;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.pred-remaining strong {
  color: #0f766e;
  font-size: 15px;
  font-weight: 800;
}

/* ── Insufficient Data State ── */
#predictionModal .pred-insufficient {
  text-align: center;
  padding: 24px 24px 8px;
}

#predictionModal .pred-insufficient:not(.hidden) {
  display: block;
}

.pred-insuf-icon {
  color: #94a3b8;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
}

.pred-insuf-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}

.pred-insuf-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

#predictionModal .pred-insufficient .pred-insuf-map {
  display: block;
  width: 100%;
  height: 200px;
  min-height: 200px;
  border-radius: 12px;
  margin-top: 16px;
  overflow: hidden;
}

/* ── Map Container ── */
.prediction-map-container {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e8eef5;
  box-shadow: 0 2px 8px rgba(10, 35, 60, 0.05);
}

#predictionModal .prediction-map-container {
  min-height: 300px;
}

#predictionModal .prediction-map {
  height: 300px;
  min-height: 300px;
}

.prediction-panel .body:has(.prediction-map-container:only-child) .prediction-map-container {
  margin: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.prediction-map {
  width: 100%;
  height: 300px;
  min-height: 300px;
  background: #f7fafd;
}

.prediction-panel .body:has(.prediction-map-container:only-child) .prediction-map {
  height: 100%;
  min-height: 400px;
  flex: 1;
}

/* Hide map attribution */
.prediction-map .leaflet-control-attribution,
#adMap .leaflet-control-attribution,
#predictionMap .leaflet-control-attribution {
  display: none !important;
}

/* Custom marker styles */
.custom-marker {
  background: transparent;
  border: none;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 0.3; }
  100% { transform: scale(1.2); opacity: 0; }
}

.custom-marker .pulse-ring {
  animation: pulse-ring 2s ease-out infinite;
}

/* ── Error State ── */
.prediction-error {
  text-align: center;
  padding: 48px 32px;
}

.pred-err-icon {
  color: #94a3b8;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prediction-error p {
  color: #b91c1c;
  font-size: 14px;
  line-height: 1.6;
  background: #fef2f2;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  margin: 0;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Override planModal button styles when hidden */
#planModal .btn.hidden,
#planModal button.hidden,
.plan-card .btn.hidden,
.plan-card button.hidden,
.plan-card-v2 .btn.hidden,
.plan-card-v2 button.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
  .prediction-panel {
    width: 96%;
    max-height: 95vh;
    border-radius: 16px;
  }

  #predictionModal.modal.show {
    padding-top: 8px;
    padding-bottom: 8px;
    align-items: center;
  }

  #predictionModal .prediction-panel {
    height: auto;
    max-height: calc(100vh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 16px);
    margin: 0;
    flex-shrink: 1;
  }

  #predictionModal .prediction-panel .body {
    padding: 0 14px 12px;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #predictionModal .prediction-map {
    height: 260px;
    min-height: 260px;
  }

  #predictionModal .prediction-map-container {
    min-height: 260px;
  }

  #mapModal.modal.show {
    padding-top: 20px;
  }

  #mapModal .prediction-panel {
    max-height: 85vh;
    height: 85vh;
  }

  #mapModal .prediction-panel header {
    flex-shrink: 0;
    z-index: 1000;
    position: relative;
    justify-content: space-between;
  }

  #mapModal .prediction-panel header #btnCloseMap {
    margin-left: auto;
  }

  #mapModal .prediction-panel footer {
    flex-shrink: 0;
    z-index: 1000;
    position: relative;
  }

  .pred-assessment-hero {
    padding: 16px;
    border-radius: 12px;
  }

  .pred-hero-label {
    font-size: 17px;
  }

  .pred-hero-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .pred-prices {
    padding: 12px 14px;
  }

  .pred-price-value {
    font-size: 16px;
  }

  .pred-details {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .pred-detail-item {
    padding: 10px 12px;
  }

  #predictionModal .pred-insufficient {
    padding: 20px 20px 8px;
  }

  .pred-insuf-title {
    font-size: 16px;
  }

  #predictionModal .pred-insufficient .pred-insuf-map {
    height: 160px;
    min-height: 160px;
  }

  .btn-predict {
    font-size: 14px;
    padding: 3px 5px;
    min-width: 32px;
    height: 24px;
    display: inline-flex !important;
    visibility: visible !important;
    position: relative !important;
  }

  .btn-map {
    font-size: 14px;
    padding: 3px 6px;
    min-width: 34px;
    height: 24px;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
  }

  .btn-map-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    flex-shrink: 0 !important;
  }

  .btn-map svg,
  .btn-map .map-icon {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #1E3A5F !important;
    flex-shrink: 0 !important;
  }

  .btn-map svg path,
  .btn-map .map-icon path {
    fill: #1E3A5F !important;
    stroke: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Force map button to show and not be hidden */
  .btn-map,
  .results-button-group .btn-map {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Ensure button group is visible on mobile */
  .results-button-group {
    display: flex !important;
    flex-direction: row !important;
    visibility: visible !important;
    width: auto !important;
    min-width: auto !important;
    flex-shrink: 0 !important;
    gap: 4px !important;
    align-items: center !important;
    justify-content: flex-end !important;
  }

  /* Ensure buttons inside group are visible */
  .results-button-group .btn-map,
  .results-button-group .btn-predict {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    min-width: 32px !important;
    overflow: visible !important;
  }

  .btn-predict-badge {
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    padding: 0 3px;
    position: relative !important;
    z-index: 2 !important;
  }

  .btn-predict-content {
    gap: 3px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .predict-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0 !important;
  }

  .results-price-wrapper {
    gap: 4px;
    display: flex !important;
    visibility: visible !important;
  }

  .results-price {
    font-size: 14px;
    padding: 5px 8px;
    display: inline-block !important;
    visibility: visible !important;
  }

}

/*════════════════════════════════════════════════════════════════════════════════
  PULSE HIGHLIGHT (used by the New Search button to nudge the form)
════════════════════════════════════════════════════════════════════════════════*/

.pulse-highlight {
  animation: pulse-border 1s ease-in-out infinite;
  border-color: var(--teal) !important;
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(41, 211, 194, 0.7);
    border-color: var(--teal);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(41, 211, 194, 0);
    border-color: var(--teal);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(41, 211, 194, 0.7);
    border-color: var(--teal);
  }
}

/* Mobile responsive - onboarding */
@media (max-width: 768px) {
  .onboarding-panel {
    width: 96%;
    max-height: 95vh;
    border-radius: 16px;
  }

  .onboarding-panel .body {
    padding: 24px 20px 0 20px;
  }

  .onboarding-panel footer {
    padding: 14px 20px 18px;
  }

  .onboarding-slide h2 {
    font-size: 22px;
  }

  .onboarding-slide h2::after {
    width: 32px;
    height: 2px;
    margin-top: 10px;
  }

  .onboarding-slide p {
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 16px;
  }

  .screenshot-placeholder {
    height: 200px;
  }

  .screenshot-container {
    margin-top: 12px;
    border-radius: 10px;
  }

  .onboarding-video {
    max-height: 280px;
    border-radius: 10px;
  }

  .upgrade-pricing {
    padding: 16px 18px;
    margin-top: 16px;
  }

  .upgrade-pricing .price {
    font-size: 36px;
  }

  .upgrade-pricing .price span {
    font-size: 18px;
  }

  .onboarding-panel footer .btn-primary {
    padding: 10px 22px;
    font-size: 14px;
  }

  .onboarding-panel footer .btn-ghost {
    padding: 10px 16px;
    font-size: 13px;
  }

  .onboarding-progress {
    padding-top: 14px;
    padding-bottom: 12px;
  }
}

/* ============================================================
   RESPONSIVE: Property Details on Small Screens
   ============================================================ */

/* Wrap earlier to prevent details from being cut off on mid-size screens */
@media (max-width: 1000px) {
  /* Allow property details to wrap to prevent overflow */
  .results-time {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Ensure container doesn't clip content */
  .results-meta {
    overflow: visible;
    max-width: 100%;
  }

  .results-left {
    overflow: visible;
    max-width: 100%;
  }

}

@media (max-width: 600px) {
  /* Reduce font size on mobile for better fit */
  .results-meta {
    font-size: 12px;
    line-height: 1.4;
  }
}

@media (max-width: 400px) {
  /* Further optimize for very small screens */
  .results-meta {
    font-size: 11px;
    line-height: 1.5;
  }
}

/* Advanced Filters - Premium Feature Styling */
.advanced-filter {
  position: relative;
}

.premium-badge {
  display: inline-block;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-size: 0.7em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(255, 165, 0, 0.3);
}

/* Premium Filters Section */
.premium-filters-section {
  position: relative;
  background: #fffbeb;
  border: 2px solid rgba(180, 83, 9, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

.premium-section-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
  margin: -16px;
  padding: 16px;
  border-radius: 12px;
}

.premium-section-header:hover {
  background-color: #f1f5f9;
}

.premium-section-header:focus {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

.premium-section-header label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.premium-section-desc {
  font-size: 0.9em;
  margin-top: 4px;
  color: #64748b;
}

/* Collapse arrow */
.collapse-arrow {
  transition: transform 0.25s ease;
  color: #64748b;
  flex-shrink: 0;
}

.premium-filters-section:not(.collapsed) .collapse-arrow {
  transform: rotate(180deg);
}

/* Collapsible content */
.premium-filters-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin-top 0.25s ease;
  max-height: 1000px;
  opacity: 1;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.premium-filters-section.collapsed .premium-filters-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Update description text when expanded */
.premium-filters-section:not(.collapsed) .premium-section-desc {
  display: none;
}

.premium-filter-item {
  margin-top: 12px;
}

/* Disabled state for free users - allow clicks but show visual indication */
.advanced-filter.disabled {
  opacity: 1;
  position: relative;
  cursor: pointer;
}

/* Semi-transparent overlay for disabled filters (no blur - let users see the options) */
.advanced-filter.disabled::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  z-index: 20;
  pointer-events: none;
  transition: background 0.2s;
}

.advanced-filter.disabled:hover::before {
  background: rgba(255, 255, 255, 0.6);
}

/* Centered lock badge for disabled filters */
.advanced-filter.disabled::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 25;
  pointer-events: none;
  /* Lock icon as SVG background */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 10V8C6 5.79086 7.79086 4 10 4H14C16.2091 4 18 5.79086 18 8V10M6 10H4C2.89543 10 2 10.8954 2 12V20C2 21.1046 2.89543 22 4 22H20C21.1046 22 22 21.1046 22 20V12C22 10.8954 21.1046 10 20 10H18M6 10H18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.advanced-filter.disabled:hover::after {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -50%) scale(1.05);
}

.advanced-filter.disabled input,
.advanced-filter.disabled select,
.advanced-filter.disabled input[type="range"] {
  background: #f5f5f5;
  cursor: not-allowed;
  pointer-events: none;
}

.advanced-filter.disabled label {
  cursor: pointer;
}

/* Gold focus styles for premium/max filter inputs */
.premium-filters-section input:focus,
.premium-filters-section select:focus {
  border-color: #b45309;
  box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.15);
}

/* Range Slider Styling */
.slider-container {
  position: relative;
  margin-top: 8px;
}

.slider-container input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #0f766e 0%, #0f766e var(--slider-progress, 0%), #e2e8f0 var(--slider-progress, 0%), #e2e8f0 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background 0.2s;
}

.slider-container.disabled input[type="range"] {
  background: #d1d5db;
  cursor: not-allowed;
  opacity: 0.6;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0f766e;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.3);
  transition: all 0.2s;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
  background: #0d9488;
  transform: scale(1.1);
}

.slider-container.disabled input[type="range"]::-webkit-slider-thumb {
  background: #9ca3af;
  cursor: not-allowed;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-container input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0f766e;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.3);
  transition: all 0.2s;
}

.slider-container input[type="range"]::-moz-range-thumb:hover {
  background: #0d9488;
  transform: scale(1.1);
}

.slider-container.disabled input[type="range"]::-moz-range-thumb {
  background: #9ca3af;
  cursor: not-allowed;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-container input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #0f766e 0%, #0f766e var(--slider-progress, 0%), #e2e8f0 var(--slider-progress, 0%), #e2e8f0 100%);
}

.slider-container.disabled input[type="range"]::-moz-range-track {
  background: #d1d5db;
}

.slider-value-display {
  margin-top: 8px;
  text-align: center;
  font-size: 0.9em;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.slider-container.disabled .slider-value-display {
  opacity: 0.6;
}

.slider-value-display strong {
  font-weight: 500;
  color: #475569;
}

.slider-container.disabled .slider-value-display strong {
  color: #9ca3af;
}

.slider-value-number {
  font-weight: 600;
  color: #0f766e;
  font-size: 0.95em;
}

.slider-container.disabled .slider-value-number {
  color: #9ca3af;
}

.slider-value-number.zero {
  color: #64748b;
  font-style: italic;
}

/* Mobile responsiveness for slider */
@media (max-width: 600px) {
  .slider-container input[type="range"]::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }

  .slider-container input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }
}

/* ============================================
   PUBLIC PREVIEW SECTION - SEO Crawlable Content
   ============================================ */
.public-preview {
  grid-column: 1 / -1;
  padding: 48px 0;
  margin-top: 32px;
  background: linear-gradient(180deg, rgba(233,251,243,0.3) 0%, rgba(255,255,255,0.8) 100%);
  border-top: 1px solid rgba(41,211,194,0.1);
  border-bottom: 1px solid rgba(41,211,194,0.1);
  width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.public-preview > * {
  min-width: 0;
}

.public-preview h2 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--ink);
}

.public-preview .preview-intro {
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 600px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 32px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
/* When JS replaces content with .preview-results, grid is on the <ul> instead */
.preview-grid:has(.preview-results) {
  display: block;
}

/* The dynamic <ul> grid for JS-rendered results-item cards */
.preview-grid .preview-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: stretch;
}

/* Cards in preview grid use vertical card layout (same as registered user cards) */
.preview-grid .results-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.preview-grid .results-image {
  width: 100%;
  height: 180px;
  border-radius: 0;
  flex-shrink: 0;
}

.preview-grid .results-left {
  padding: 16px;
}

.preview-grid .results-head {
  margin-bottom: 6px;
}

/* Preview cards: keep price in normal flow (no absolute overlay) */
.preview-grid .results-price-wrapper {
  position: static;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

/* Specs and features match registered user view */
.preview-grid .specs-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
}

.preview-grid .feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

/* Static fallback cards for SEO crawlers (keep existing .preview-card styles) */
.preview-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #eaf1f7;
  border-radius: 16px;
}

.preview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(10,35,60,.12);
  border-color: #d6f5ef;
}

.preview-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.preview-card .preview-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.preview-card .preview-img-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-card .preview-img-placeholder span {
  font-size: 12px;
  font-weight: 500;
  color: #6B7A90;
}

.preview-card .preview-left {
  padding: 16px;
}

.preview-card .preview-price-badge {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: #1e293b;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  white-space: nowrap;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}

.preview-card .preview-price-per-sqm {
  font-size: 12px;
  font-weight: 500;
  color: #6B7A90;
  margin-left: 6px;
}

.preview-card .preview-addr {
  color: #24405c;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  margin: 0;
  margin-top: 8px;
}

.preview-card .preview-specs {
  margin-top: 8px;
  font-size: 12px;
  color: #51627a;
}

.preview-cta {
  text-align: center;
  margin-top: 24px;
}

.preview-cta .btn-primary {
  font-size: 16px;
  padding: 14px 32px;
}

/* City Cross-Links Section */
.city-links {
  margin-top: 32px;
}
.city-links-intro {
  margin: -12px 0 20px;
  color: #51627a;
  font-size: 15px;
  line-height: 1.6;
}
.city-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
a.city-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.city-card:hover h4 {
  color: #29D3C2;
}
@media (max-width: 768px) {
  .city-grid {
    grid-template-columns: 1fr;
  }
}

/* SEO Hub styles */
.seo-hub {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.seo-hub .btn-ghost {
  font-size: 13px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(41,211,194,0.2);
}

.seo-hub .btn-ghost:hover {
  background: var(--mint);
  border-color: var(--teal);
}

/* Responsive adjustments for preview */

/* Tablet: 2 columns, matching registered user tablet layout */
@media (max-width: 1024px) {
  .preview-grid .preview-results {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
  }
  /* Static fallback grid */
  .preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .preview-grid:has(.preview-results) {
    display: block;
  }
}

/* Mobile: 2 columns, reduced image height */
@media (max-width: 768px) {
  .preview-grid .preview-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .preview-grid:has(.preview-results) {
    display: block;
  }
  .preview-grid .results-image {
    height: 140px;
  }
  .preview-card .preview-img {
    height: 140px;
  }
}

/* Small mobile: single column, larger images */
@media (max-width: 480px) {
  .preview-grid .preview-results {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .preview-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
  .preview-grid:has(.preview-results) {
    display: block;
  }

  .preview-grid .results-image {
    height: 220px;
  }

  .public-preview {
    padding: 32px 0;
  }

  .seo-hub {
    gap: 6px;
  }

  .seo-hub .btn-ghost {
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* ========== Pagination Controls (Modern Design) ========== */
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 20px 0 12px;
  margin-top: 8px;
}

.pagination-controls.hidden {
  display: none;
}

/* Arrow buttons */
.pag-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pag-arrow:hover:not(:disabled) {
  background: #f1f5f9;
  color: #1e293b;
}

.pag-arrow:active:not(:disabled) {
  background: #e2e8f0;
  transform: scale(0.95);
}

.pag-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pag-arrow svg {
  flex-shrink: 0;
}

/* Page numbers container */
.pag-nums {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 4px;
}

/* Individual page number */
.pag-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pag-num:hover:not(.active) {
  background: #f1f5f9;
  color: #1e293b;
}

.pag-num.active {
  background: #1E3A5F;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(30, 58, 95, 0.3);
}

/* Ellipsis dots */
.pag-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  color: #94a3b8;
  font-size: 12px;
  letter-spacing: 1px;
  user-select: none;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .pag-arrow {
    color: #94a3b8;
  }

  .pag-arrow:hover:not(:disabled) {
    background: #334155;
    color: #f1f5f9;
  }

  .pag-arrow:active:not(:disabled) {
    background: #475569;
  }

  .pag-num {
    color: #94a3b8;
  }

  .pag-num:hover:not(.active) {
    background: #334155;
    color: #f1f5f9;
  }

  .pag-num.active {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.4);
  }

  .pag-dots {
    color: #64748b;
  }
}

/* Mobile responsive */
@media (max-width: 480px) {
  .pagination-controls {
    gap: 2px;
    padding: 16px 0 8px;
  }

  .pag-arrow {
    width: 32px;
    height: 32px;
  }

  .pag-arrow svg {
    width: 16px;
    height: 16px;
  }

  .pag-num {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }

  .pag-dots {
    min-width: 28px;
    height: 32px;
    font-size: 10px;
  }
}

/* ========== APP QR MODAL ========== */
/* QR-code modal — editorial cream paper, hairline border, Fraunces title.
   Matches the search-redesign-v2 palette so the modal sits naturally over
   any page. Surface tokens fall back to literals for safety. */
.app-qr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 16, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: appQrFadeIn 0.2s ease;
}

.app-qr-overlay.hidden { display: none; }

@keyframes appQrFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.app-qr-modal {
  background: var(--ed-paper, #FAF7F2);
  border: 1px solid var(--ed-line, #E3DBCB);
  border-radius: 20px;
  padding: 32px 28px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 24px 60px rgba(28, 24, 16, 0.22);
  animation: appQrSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes appQrSlideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.app-qr-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  background: transparent;
  border: 1px solid var(--ed-line, #E3DBCB);
  color: var(--ed-ink-3, #6B6557);
  cursor: pointer;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.app-qr-modal-close:hover {
  background: var(--ed-paper-2, #F3EEE5);
  border-color: var(--ed-ink-4, #9A9282);
  color: var(--ed-ink, #1A1814);
}

.app-qr-modal-icon {
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(28, 24, 16, 0.10);
  margin-bottom: 16px;
}

.app-qr-modal h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ed-ink, #1A1814);
  margin: 0 0 8px;
}

.app-qr-modal p {
  font-size: 13.5px;
  color: var(--ed-ink-3, #6B6557);
  line-height: 1.5;
  margin: 0 0 22px;
}

.app-qr-modal-qr {
  border-radius: 14px;
  border: 1px solid var(--ed-line, #E3DBCB);
  padding: 10px;
  background: #fff;
}

.app-qr-modal-platform {
  display: block;
  margin-top: 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ed-ink-3, #6B6557);
  font-weight: 600;
}


/* Push toggle - locked state for free users */
.menu-toggle.push-locked {
  opacity: 0.55;
  cursor: pointer;
  position: relative;
}

.menu-toggle.push-locked .toggle-switch {
  pointer-events: none;
}

.menu-toggle.push-locked .slider {
  background: #c8ced6;
}

.menu-toggle.push-locked .slider:before {
  background: #e8ebef;
}

.push-lock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #0f766e;
  background: #e0f5f1;
  border: 1px solid #b2e0d8;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ========== More Ads Section (Collapsible Accordion) ========== */
.more-ads-accordion {
  margin: 32px 0 24px;
}

.more-ads-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.more-ads-toggle:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.more-ads-toggle:active {
  transform: scale(0.995);
}

.more-ads-toggle-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.more-ads-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #1E3A5F;
  border-radius: 8px;
  color: white;
  flex-shrink: 0;
}

.more-ads-toggle-text {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.more-ads-toggle-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: #fbbf24;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  margin-left: 8px;
}

.more-ads-toggle-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #64748b;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.more-ads-accordion.expanded .more-ads-toggle-chevron {
  transform: rotate(180deg);
}

.more-ads-accordion.expanded .more-ads-toggle {
  border-radius: 12px 12px 0 0;
  border-bottom-color: transparent;
}

/* Collapsible content container — editorial cream paper to match the
   rest of the listings page (was hard-coded #fff). */
.more-ads-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
  border: 1px solid var(--ed-line, #E3DBCB);
  border-top: none;
  border-radius: 0 0 12px 12px;
  background: var(--ed-paper, #FAF7F2);
  overflow: hidden;
}

.more-ads-accordion:not(.expanded) .more-ads-content {
  border-color: transparent;
}

.more-ads-accordion.expanded .more-ads-content {
  grid-template-rows: 1fr;
}

.more-ads-content-inner {
  min-height: 0;
  overflow: hidden;
}

.more-ads-container {
  padding: 16px;
}

.more-ads-list {
  /* Inherits from .results-list */
}

/* Loading state in toggle */
.more-ads-toggle-loading {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid #e2e8f0;
  border-top-color: #1E3A5F;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

.more-ads-accordion.loading .more-ads-toggle-loading {
  display: block;
}

.more-ads-accordion.loading .more-ads-toggle-chevron {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile responsive */
@media (max-width: 480px) {
  .more-ads-accordion {
    margin: 24px 0 16px;
  }

  .more-ads-toggle {
    padding: 14px 16px;
    border-radius: 10px;
  }

  .more-ads-toggle-content {
    gap: 10px;
  }

  .more-ads-toggle-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }

  .more-ads-toggle-icon svg {
    width: 14px;
    height: 14px;
  }

  .more-ads-toggle-text {
    font-size: 14px;
  }

  .more-ads-toggle-count {
    min-width: 22px;
    height: 22px;
    font-size: 12px;
    padding: 0 6px;
  }

  .more-ads-toggle-chevron {
    width: 24px;
    height: 24px;
  }

  .more-ads-accordion.expanded .more-ads-toggle {
    border-radius: 10px 10px 0 0;
  }

  .more-ads-content {
    border-radius: 0 0 10px 10px;
  }

  .more-ads-container {
    padding: 12px;
  }
}

/* Dark mode support */
body.theme-dark .more-ads-toggle {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-color: #475569;
}

body.theme-dark .more-ads-toggle:hover {
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
  border-color: #64748b;
}

body.theme-dark .more-ads-toggle-icon {
  background: #3b82f6;
}

body.theme-dark .more-ads-toggle-text {
  color: #f1f5f9;
}

body.theme-dark .more-ads-toggle-chevron {
  color: #94a3b8;
}

body.theme-dark .more-ads-content {
  background: #1e293b;
  border-color: #475569;
}

body.theme-dark .more-ads-accordion:not(.expanded) .more-ads-content {
  border-color: transparent;
}

/* Article layout */
.article-wrap {
  max-width: min(1200px, calc(100% - 2 * var(--page-gutter)));
  margin: 0 auto;
  padding: 32px var(--page-gutter);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
}
.article-header {
  width: 100%;
  max-width: 720px;
}
.article-body {
  max-width: 720px;
  width: 100%;
}
.article-body p {
  margin-bottom: 16px;
  line-height: 1.8;
}
.article-body-wide {
  width: 100%;
  max-width: 100%;
}

/* Article TOC */
.article-toc {
  max-width: 720px;
  background: rgba(233, 251, 243, 0.5);
  border: 1px solid rgba(29, 151, 108, 0.15);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 8px;
}
.article-toc h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink);
}
.article-toc ol {
  margin: 0;
  padding-left: 20px;
}
.article-toc li {
  margin-bottom: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.article-toc a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(29, 151, 108, 0.3);
}
.article-toc a:hover {
  color: #1D976C;
}

/* Article heading hierarchy */
.article-body h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(29, 151, 108, 0.2);
  font-weight: 700;
  line-height: 1.3;
}
.article-body h3 {
  font-size: clamp(1.15rem, 2.5vw, 1.375rem);
  margin-top: 32px;
  margin-bottom: 12px;
  font-weight: 700;
  line-height: 1.4;
}

/* Article metadata (date + reading time) */
.article-meta {
  font-size: 0.85rem;
  color: #9CA3AF;
  margin-top: 8px;
}

/* Landing page footer */
.landing-footer {
  padding: 28px clamp(16px, 5vw, 40px);
  color: #6B7A90;
  border-top: 1px solid rgba(234, 245, 247, 0.6);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}
.footer-column h4 {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
.footer-links a {
  color: #6B7A90;
  text-decoration: none;
}
.footer-links a:hover {
  color: #0E1B2E;
}
.footer-bottom {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid rgba(234, 245, 247, 0.6);
}
.footer-bottom a {
  color: #6B7A90;
  text-decoration: none;
  font-size: 14px;
}
.footer-copyright {
  margin-top: 16px;
  font-size: 12px;
}

/* District price badge */
.district-price {
  display: inline-block;
  background: rgba(236, 255, 251, 0.6);
  border: 1px solid rgba(214, 245, 239, 0.5);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #0f766e;
  margin-top: 8px;
}

/*════════════════════════════════════════════════════════════════════════════════
  PRICE HISTORY CHART - Popup / Bottom Sheet
  Appears when clicking the price-change badge on an ad card.
  Desktop: anchored popup near the badge.
  Mobile (<768px): bottom sheet sliding up from bottom edge.
════════════════════════════════════════════════════════════════════════════════*/

/* --- Backdrop overlay (shared desktop + mobile) --- */
.ph-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19999;
  background: rgba(14, 27, 46, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ph-backdrop.ph-visible {
  opacity: 1;
  pointer-events: auto;
}

/* --- Make price-change badge clickable when chart is available --- */
.price-change.ph-has-history {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.price-change.ph-has-history:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(14, 27, 46, 0.12);
}
.price-change.ph-has-history:active {
  transform: translateY(0);
}

/* --- Popup container (desktop) --- */
.ph-popup {
  position: fixed;
  z-index: 20001;
  width: 380px;
  max-height: 420px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(234, 241, 247, 0.7);
  border-radius: 16px;
  box-shadow:
    0 24px 48px rgba(14, 27, 46, 0.14),
    0 8px 16px rgba(14, 27, 46, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Entrance animation */
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.ph-popup.ph-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* --- Popup arrow (points toward the badge) --- */
.ph-popup::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 32px;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(234, 241, 247, 0.7);
  border-right: none;
  border-bottom: none;
  transform: rotate(45deg);
  z-index: -1;
}
/* When popup opens above the badge */
.ph-popup.ph-arrow-bottom::before {
  top: auto;
  bottom: -7px;
  transform: rotate(225deg);
}
/* When popup opens to the left, shift arrow right */
.ph-popup.ph-arrow-right::before {
  left: auto;
  right: 32px;
}

/* --- Header --- */
.ph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  flex-shrink: 0;
}
.ph-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.ph-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(14, 27, 46, 0.05);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease;
  padding: 0;
}
.ph-close:hover {
  background: rgba(14, 27, 46, 0.1);
  color: var(--ink);
}

/* --- Price summary strip --- */
.ph-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}
.ph-current-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}
.ph-change-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}
/* Price went down (positive for buyer) */
.ph-change-badge.ph-decrease {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
/* Price went up */
.ph-change-badge.ph-increase {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.ph-change-abs {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* --- Chart area --- */
.ph-chart-wrap {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 16px 4px;
  position: relative;
}
.ph-chart-svg {
  width: 100%;
  height: 160px;
  display: block;
  overflow: visible;
}

/* Step-line (the main price path) */
.ph-step-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Decrease = teal/green warm tone */
.ph-decrease .ph-step-line {
  stroke: #0d9488;
}
/* Increase = warm amber/red */
.ph-increase .ph-step-line {
  stroke: #ea580c;
}

/* Gradient fill under the step line */
.ph-area-fill {
  opacity: 0.12;
}
.ph-decrease .ph-area-fill {
  fill: url(#ph-grad-decrease);
}
.ph-increase .ph-area-fill {
  fill: url(#ph-grad-increase);
}

/* SVG gradient definitions (referenced by class, injected via JS) */
/* Decrease gradient: teal top fading to transparent */
/* Increase gradient: warm amber top fading to transparent */

/* Dot markers at price change points */
.ph-dot {
  r: 4;
  stroke-width: 2;
  stroke: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}
.ph-decrease .ph-dot {
  fill: #0d9488;
}
.ph-increase .ph-dot {
  fill: #ea580c;
}

/* "Today" dot - slightly larger, filled with background ring */
.ph-dot-today {
  r: 5;
  stroke-width: 2.5;
  stroke: #fff;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.15));
}
.ph-decrease .ph-dot-today {
  fill: #0d9488;
}
.ph-increase .ph-dot-today {
  fill: #ea580c;
}

/* Price annotation labels on chart */
.ph-price-label {
  font-size: 11px;
  font-weight: 700;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
}
.ph-price-label.ph-label-old {
  fill: var(--muted);
}
.ph-price-label.ph-label-new {
  fill: var(--ink);
}

/* Dashed vertical line at price change moment */
.ph-change-line {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.4;
}

/* --- Chart drawing animation --- */
@keyframes ph-draw-line {
  from { stroke-dashoffset: var(--ph-path-length, 1000); }
  to   { stroke-dashoffset: 0; }
}
@keyframes ph-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ph-dot-pop {
  0%   { r: 0; opacity: 0; }
  60%  { r: 5.5; opacity: 1; }
  100% { r: 4; opacity: 1; }
}
@keyframes ph-dot-pop-today {
  0%   { r: 0; opacity: 0; }
  60%  { r: 6.5; opacity: 1; }
  100% { r: 5; opacity: 1; }
}

.ph-popup.ph-visible .ph-step-line,
.ph-sheet.ph-visible .ph-step-line {
  stroke-dasharray: var(--ph-path-length, 1000);
  stroke-dashoffset: var(--ph-path-length, 1000);
  animation: ph-draw-line 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards;
}
.ph-popup.ph-visible .ph-area-fill,
.ph-sheet.ph-visible .ph-area-fill {
  opacity: 0;
  animation: ph-fade-in 0.5s ease 0.6s forwards;
}
.ph-popup.ph-visible .ph-dot,
.ph-sheet.ph-visible .ph-dot {
  animation: ph-dot-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) 0.75s forwards;
  r: 0;
  opacity: 0;
}
.ph-popup.ph-visible .ph-dot-today,
.ph-sheet.ph-visible .ph-dot-today {
  animation: ph-dot-pop-today 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) 0.85s forwards;
  r: 0;
  opacity: 0;
}
.ph-popup.ph-visible .ph-price-label,
.ph-sheet.ph-visible .ph-price-label {
  opacity: 0;
  animation: ph-fade-in 0.3s ease 0.9s forwards;
}
.ph-popup.ph-visible .ph-change-line,
.ph-sheet.ph-visible .ph-change-line {
  opacity: 0;
  animation: ph-fade-in 0.3s ease 0.7s forwards;
}

/* --- X-axis date labels --- */
.ph-dates {
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 2px;
}
.ph-date-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* --- Footer with metadata --- */
.ph-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-top: 1px solid rgba(234, 241, 247, 0.6);
  flex-shrink: 0;
}
.ph-footer-label {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.ph-footer-value {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}

/* --- Loading state inside popup --- */
.ph-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  gap: 12px;
}
.ph-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #eef2f6;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.ph-loading-text {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* --- Error state --- */
.ph-error {
  text-align: center;
  padding: 32px 16px;
}
.ph-error-icon {
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.6;
}
.ph-error-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* --- Empty state (only one price point, no history) --- */
.ph-empty {
  text-align: center;
  padding: 32px 16px;
}
.ph-empty-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/*════════════════════════════════════════════════════════════════════════════════
  PRICE HISTORY - Mobile Bottom Sheet (<768px)
════════════════════════════════════════════════════════════════════════════════*/

@media (max-width: 767px) {
  /* Hide the desktop popup on mobile */
  .ph-popup {
    display: none !important;
  }

  /* Show bottom sheet instead */
  .ph-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20001;
    max-height: 70vh;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border: 1px solid rgba(234, 241, 247, 0.6);
    border-bottom: none;
    box-shadow:
      0 -16px 48px rgba(14, 27, 46, 0.12),
      0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* Entrance: slide up from bottom */
    transform: translateY(100%);
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .ph-sheet.ph-visible {
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Drag handle indicator */
  .ph-sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(14, 27, 46, 0.15);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }

  /* Reuse header/chart/footer styles, just tweak spacing */
  .ph-sheet .ph-header {
    padding: 12px 20px 8px;
  }
  .ph-sheet .ph-summary {
    padding: 0 20px 14px;
  }
  .ph-sheet .ph-current-price {
    font-size: 26px;
  }
  .ph-sheet .ph-chart-wrap {
    padding: 0 20px 4px;
  }
  .ph-sheet .ph-chart-svg {
    height: 180px;
  }
  .ph-sheet .ph-dates {
    padding: 0 20px;
  }
  .ph-sheet .ph-footer {
    padding: 10px 20px 16px;
    /* Extra bottom padding for safe area on notched phones */
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* Hide desktop arrow on mobile */
  .ph-popup::before {
    display: none;
  }
}

/* Desktop: hide the bottom sheet container */
@media (min-width: 768px) {
  .ph-sheet {
    display: none !important;
  }
}

/*════════════════════════════════════════════════════════════════════════════════
  PRICE HISTORY - Tablet adjustments (768px - 1024px)
════════════════════════════════════════════════════════════════════════════════*/

@media (min-width: 768px) and (max-width: 1024px) {
  .ph-popup {
    width: 360px;
  }
  .ph-chart-svg {
    height: 140px;
  }
}

/*════════════════════════════════════════════════════════════════════════════════
  PRICE HISTORY - Small mobile (<480px)
════════════════════════════════════════════════════════════════════════════════*/

@media (max-width: 480px) {
  .ph-sheet {
    max-height: 75vh;
  }
  .ph-sheet .ph-current-price {
    font-size: 24px;
  }
  .ph-sheet .ph-chart-svg {
    height: 160px;
  }
}

/*════════════════════════════════════════════════════════════════════════════════
  PRICE HISTORY - Reduced motion preference
════════════════════════════════════════════════════════════════════════════════*/

@media (prefers-reduced-motion: reduce) {
  .ph-popup,
  .ph-sheet {
    transition-duration: 0.01ms !important;
  }
  .ph-popup.ph-visible .ph-step-line,
  .ph-sheet.ph-visible .ph-step-line {
    animation: none;
    stroke-dashoffset: 0;
  }
  .ph-popup.ph-visible .ph-area-fill,
  .ph-sheet.ph-visible .ph-area-fill {
    animation: none;
    opacity: 0.12;
  }
  .ph-popup.ph-visible .ph-dot,
  .ph-popup.ph-visible .ph-dot-today,
  .ph-sheet.ph-visible .ph-dot,
  .ph-sheet.ph-visible .ph-dot-today {
    animation: none;
    opacity: 1;
  }
  .ph-popup.ph-visible .ph-dot { r: 4; }
  .ph-popup.ph-visible .ph-dot-today { r: 5; }
  .ph-sheet.ph-visible .ph-dot { r: 4; }
  .ph-sheet.ph-visible .ph-dot-today { r: 5; }
  .ph-popup.ph-visible .ph-price-label,
  .ph-sheet.ph-visible .ph-price-label,
  .ph-popup.ph-visible .ph-change-line,
  .ph-sheet.ph-visible .ph-change-line {
    animation: none;
    opacity: 1;
  }
}

/*================================================================
  DRIVER.JS TOUR OVERRIDES (editorial palette)
  ─────────────────────────────────────────────
  Layout:
    .driver-popover  — outer surface (cream paper, ink border)
      .driver-popover-arrow
      .driver-popover-title
      .driver-popover-description
      ── horizontal hairline ──
      .driver-popover-footer  (injected at runtime by driverTour())
        .ntalert-tour-progress (segmented bar)
        .driver-popover-navigation-btns  (Atgal / Kitas)
    .ntalert-tour-close  — X button (injected at runtime)
================================================================*/
.driver-popover {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--ed-paper);
  color: var(--ed-ink);
  border: 1px solid var(--ed-line);
  border-radius: 18px;
  box-shadow: 0 18px 48px -16px rgba(26, 24, 20, 0.30);
  padding: 22px 22px 16px;
  max-width: 360px;
}
.driver-popover-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 19px; font-weight: 500;
  letter-spacing: -0.025em; line-height: 1.2;
  color: var(--ed-ink);
  margin: 0 0 8px;
  padding-right: 28px; /* room for the close X */
}
.driver-popover-description {
  font-size: 13.5px; line-height: 1.55;
  color: var(--ed-ink-3);
  margin: 0 0 14px;
}

/* Hairline divider between body and footer. We position it at the bottom
   of .description so it spans the full popover width regardless of which
   children Driver.js injects. */
.driver-popover-description::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--ed-line-soft);
  margin: 14px -22px 0;
}

/* Footer wrapper injected by driverTour() — contains the progress bar
   on the left and the navigation buttons on the right. */
.ntalert-tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

/* Segmented progress bar — N segments, the active one filled solid in
   ink. Pending (inactive) segments are noticeably shorter so the active
   step reads as the visual emphasis, like a tiny iOS-style track. */
.ntalert-tour-progress {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  /* Reserve the height of the tallest segment so the row doesn't shift
     when the active index moves. */
  min-height: 5px;
}
.ntalert-tour-progress-seg {
  flex: 1 1 0;
  height: 2px;
  border-radius: 999px;
  background: var(--ed-paper-3);
  transition: height .15s ease, background .15s ease;
}
.ntalert-tour-progress-seg.is-done {
  height: 3px;
  background: var(--ed-ink-3);
}
.ntalert-tour-progress-seg.is-active {
  height: 5px;
  background: var(--ed-ink);
}
.ntalert-tour-progress-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--ed-ink-4);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

/* Navigation buttons — match the paywall modal's primary/secondary
   pair (ink CTA + ghost back). */
.driver-popover-navigation-btns {
  display: inline-flex;
  gap: 8px;
  flex: 0 0 auto;
}
.driver-popover-next-btn,
.driver-popover-prev-btn {
  /* width:auto + flex:0 0 auto override the legacy global
     `button { width:100% }` rule. */
  width: auto;
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px; font-weight: 500;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.driver-popover-next-btn {
  background: var(--ed-ink);
  color: var(--ed-paper);
  border: 1px solid var(--ed-ink);
}
.driver-popover-next-btn:hover  { background: var(--ed-ink-2); border-color: var(--ed-ink-2); }
.driver-popover-next-btn:active { transform: translateY(1px); }
.driver-popover-prev-btn {
  background: var(--ed-paper);
  color: var(--ed-ink-3);
  border: 1px solid var(--ed-line);
}
.driver-popover-prev-btn:hover  { color: var(--ed-ink); border-color: var(--ed-ink-3); }
.driver-popover-prev-btn:active { transform: translateY(1px); }

/* Hide Driver.js's built-in close + progress text — we render our own
   close X and the segmented progress bar above. */
.driver-popover-close-btn,
.driver-popover-progress-text:not(.ntalert-tour-progress-text) {
  display: none !important;
}

/* Custom close X — anchored to the top-right of the popover. */
.ntalert-tour-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ed-ink-3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none; appearance: none;
  padding: 0;
  /* override legacy global `button { width:100% }` */
  flex: 0 0 auto;
}
.ntalert-tour-close:hover { background: var(--ed-paper-2); color: var(--ed-ink); }
.ntalert-tour-close svg { width: 14px; height: 14px; }

/* Block all interactions during Driver.js tour. */
body.tour-active header.appbar,
body.tour-active main.main,
body.tour-active .modal,
body.tour-active #cookieConsent {
  pointer-events: none;
}
body.tour-active .driver-active-element {
  pointer-events: none !important;
}
body.tour-active {
  cursor: not-allowed;
}
body.tour-active .driver-popover,
body.tour-active .driver-popover * {
  pointer-events: auto;
  cursor: pointer;
}

@media (max-width: 600px) {
  .driver-popover {
    max-width: calc(100vw - 32px);
    padding: 18px 18px 14px;
    border-radius: 16px;
  }
  .driver-popover-title { font-size: 17px; }
  .driver-popover-description { font-size: 13px; margin-bottom: 12px; }
  .driver-popover-description::after { margin: 12px -18px 0; }
  .ntalert-tour-footer { gap: 10px; }
  .driver-popover-next-btn,
  .driver-popover-prev-btn {
    min-height: 40px;
    padding: 11px 14px;
    font-size: 14px;
  }
}

/* ========== NATIVE-APP-ONLY ELEMENTS ========== */
.hero-view-ads-cta,
.btn-apple {
  display: none !important;
}
body.native-app .hero-view-ads-cta {
  display: inline-flex !important;
}
body.native-app .btn-apple {
  display: flex !important;
}
/* Push lang-switch below iOS safe area (notch/status bar) */
body.native-app .lang-switch:not(.appbar .lang-switch) {
  top: calc(env(safe-area-inset-top, 0px) + 8px);
}
/* Push toast messages below iOS safe area */
body.native-app .session-toast {
  top: calc(env(safe-area-inset-top, 0px) + 8px);
}
/* Hide website footer in native app */
body.native-app .site-footer {
  display: none !important;
}

/* ============================================================
   Editorial overrides (search-redesign-v2)
   These rules live at the END of the file so the natural CSS
   cascade lets them win over earlier teal/yellow rules without
   needing !important. Phase-by-phase blocks below.
   ============================================================ */

/* ---- Phase 3: Cards + buttons site-wide ----
   - Cards go from heavy white-on-cool-grey (radius 18, big shadow)
     to paper-on-warm-line (radius 14, near-flat shadow).
   - Buttons drop weight from 800 -> 500, ditch yellow gradient
     for ink-on-paper, ghost variant becomes minimal text+border.
   - Brand text stops inheriting font-weight:800 (now 500 - matches
     the design's editorial medium serif weight). */
.brand{ font-weight: 500; letter-spacing: -0.02em; }

.card{
  background: var(--ed-paper);
  border-color: var(--ed-line);
  border-radius: var(--ed-radius);
  box-shadow: 0 1px 0 rgba(26,24,20,0.02);
}

.btn{
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--ed-radius-sm);
  transition: transform .14s ease, box-shadow .14s ease, background .18s ease, opacity .18s ease;
}
.btn:hover{ box-shadow: 0 4px 12px -6px rgba(26,24,20,0.18); }
.btn:focus-visible{ box-shadow: 0 0 0 3px rgba(26,24,20,0.10); }

.btn-primary{
  background: var(--ed-ink);
  color: var(--ed-paper);
  box-shadow: none;
}
.btn-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -8px rgba(26,24,20,0.4);
}

.btn-ghost,
.btn-save{
  background: transparent;
  color: var(--ed-ink-2);
  border: 1px solid var(--ed-line);
  box-shadow: none;
}
.btn-ghost:hover,
.btn-save:hover{
  background: var(--ed-paper-3);
  box-shadow: 0 4px 12px -6px rgba(26,24,20,0.12);
}

.btn-danger{
  background: transparent;
  color: var(--ed-rose);
  border: 1px solid var(--ed-rose-soft);
  box-shadow: none;
}
.btn-danger:hover{
  background: var(--ed-rose-soft);
}

/* Mirror the new-search "Sukurti" button on the editorial palette
   (was overridden at line ~3419 to look like Save). Same look, ink-warm. */
#cardCreate .btn-primary{
  background: var(--ed-ink);
  color: var(--ed-paper);
  border: none;
  box-shadow: none;
}
#cardCreate .btn-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -8px rgba(26,24,20,0.4);
}

/* ---- Phase 4: Portal saved-search selector + tabs ----
   - Tabs: warm line under, ink underline on active (was teal-700),
     font-weight 500, count badges restyled with JetBrains Mono.
   - Select: warm line border, ink-4 caret. */

/* Ads tab bar (Naujausi / Pasikeite kainos / Isiminti) */
.ads-tabs-modern{
  border-bottom: 1px solid var(--ed-line-soft);
}
.ads-tab-modern{
  color: var(--ed-ink-3);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -0.005em;
  padding: 10px 16px 14px;
  gap: 8px;
}
.ads-tab-modern::after{
  height: 2px;
  bottom: -1px;
  border-radius: 0;
}
.ads-tab-modern:hover{
  color: var(--ed-ink-2);
}
.ads-tab-modern.active,
.ads-tab-modern[aria-selected="true"]{
  color: var(--ed-ink);
  font-weight: 500;
}
.ads-tab-modern.active::after,
.ads-tab-modern[aria-selected="true"]::after{
  background: var(--ed-ink);
}

/* Tab count badge - mono, paper-2 default, mint-soft on active. */
.tab-badge{
  background: var(--ed-paper-2);
  color: var(--ed-ink-4);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 500;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 18px;
}
.ads-tab-modern.active .tab-badge,
.ads-tab-modern[aria-selected="true"] .tab-badge{
  background: var(--ed-mint-soft);
  color: var(--ed-mint-ink);
}
.ads-tab-modern:not(.active) .tab-badge{
  background: var(--ed-paper-2);
  color: var(--ed-ink-4);
}

/* Star tab icon: amber on active, muted ink-4 on inactive
   (was bright FFD700/CBD5E1). */
.tab-star-icon{
  color: var(--ed-amber);
}
.ads-tab-modern:not(.active) .tab-star-icon{
  color: var(--ed-ink-4);
}

/* Saved-search dropdown - warm border, smaller radius, warm caret */
.select-wrap select{
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-radius-sm);
  background: var(--ed-paper);
}
.select-wrap select:focus{
  border-color: var(--ed-ink);
  box-shadow: 0 0 0 3px rgba(26,24,20,0.06);
}
.select-wrap::after{
  color: var(--ed-ink-4);
  font-weight: 500;
}

/* Generic selects + inputs in the portal pick up the same warmer
   border so the form feels cohesive (existing focus ring rule will
   still apply teal - acceptable functional indicator). */
input, select{
  border-color: var(--ed-line);
}

/* ---- Phase 5: Ad cards (editorial style) ----
   Transforms the listings grid items from cool slate + dark price
   pill + #f8fafc tag chips to: warm paper card, serif price + serif
   address, warm tag pills, and warm amber for new-arrival badges.
   The DOM stays the same - JS untouched. */

/* Outer card shell */
.results-item{
  background: var(--ed-paper);
  border-color: var(--ed-line);
  border-radius: var(--ed-radius);
  box-shadow: 0 1px 0 rgba(26,24,20,0.02);
}
.results-item:hover{
  border-color: var(--ed-ink-4);
  box-shadow: 0 14px 30px -18px rgba(26,24,20,0.25);
}

/* Image: 4:3 aspect ratio (matches the design) and warm placeholder.
   The base rule sets height:180px + aspect-ratio:16/9 which conflict
   under the editorial layout - clear height so aspect-ratio wins. */
.results-image{
  background: var(--ed-paper-3);
  aspect-ratio: 4 / 3;
  height: auto;
}

/* Source pill in the bottom-left of the image (e.g. ARUODAS, ALIO,
   DOMOPLIUS). Paper-translucent with backdrop blur so it sits cleanly
   over any photo. JS injects the .results-source element with the
   source name extracted from the ad URL host. */
.results-source{
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 10px;
  color: var(--ed-ink-2);
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

/* Card footer row - time on the left, "Kainos istorija >" on the right.
   Different bg (paper-2) and a top divider so it visually separates
   from the body content above. JS appends .results-footer to each
   .results-item as the last child. */
.results-footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--ed-line-soft);
  background: var(--ed-paper-2);
  font-size: 11px;
  color: var(--ed-ink-3);
  margin-top: auto;       /* push to bottom of the flex card */
}
.results-footer .results-footer-time{
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.results-footer .results-footer-history{
  color: var(--ed-mint-ink);
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 11px;
  line-height: 1.2;
  width: auto;
}
.results-footer .results-footer-history:hover{
  text-decoration: underline;
}
/* Free-tier paywall variant: link looks identical but a subtle lock glyph
   precedes "Kainos istorija" so the user understands it's gated. Click
   opens the price-change upgrade modal instead of the history modal. */
.results-footer .results-footer-history.results-footer-history-locked{
  color: var(--ed-ink-3);
}
.results-footer .results-footer-history.results-footer-history-locked::before{
  content: "🔒 ";
  font-size: 10px;
  margin-right: 2px;
  opacity: 0.7;
}
.results-footer .results-footer-history.results-footer-history-locked:hover{
  color: var(--ed-mint-ink);
}

/* ─────────────────────────────────────────────────────────────────────────
   Paywall / limit modals (search-redesign-v2)
   ─────────────────────────────────────────────────────────────────────────
   Single editorial CSS scope shared by all dynamic-injection paywall modals
   (price-change upgrade, prediction limit, ad-listing limit, search-limit,
   premium-filter upsell). Paired with createPaywallModal() in app.js.
   The modal content is built without inline styles so this stylesheet is
   the single source of truth for surface, typography, and CTA visuals. */
.paywall-overlay {
  position: fixed; inset: 0;
  background: rgba(26, 24, 20, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  z-index: 10000;
  animation: paywallOverlayIn 0.2s ease;
}
.paywall-overlay.is-closing { animation: paywallOverlayOut 0.18s ease forwards; }

.paywall-card {
  position: relative;
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  border-radius: 18px;
  padding: 28px 26px 22px;
  max-width: 460px; width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ed-ink);
  /* Border-only elevation per the editorial system — separation from the
     dimmed/blurred backdrop is enough; no drop-shadow needed. */
  animation: paywallCardIn 0.24s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.paywall-overlay.is-closing .paywall-card { animation: none; }

.paywall-eyebrow {
  display: block;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ed-ink-4);
  margin-bottom: 6px;
}
.paywall-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 22px; font-weight: 500;
  letter-spacing: -0.025em; line-height: 1.2;
  color: var(--ed-ink);
  margin: 0 0 10px;
}
.paywall-body {
  font-size: 13.5px; line-height: 1.55;
  color: var(--ed-ink-3);
  margin: 0 0 14px;
}
.paywall-body strong { color: var(--ed-ink); font-weight: 500; }

/* Benefit list — no native bullets; mint check glyph as marker.
   Glyph uses a CSS mask so the fill tracks --ed-mint-ink (the SVG holds
   no color — the background-color does). */
.paywall-benefits {
  list-style: none; padding: 0; margin: 0 0 18px;
  font-size: 13px; line-height: 1.5;
  color: var(--ed-ink-2);
}
.paywall-benefits li {
  position: relative;
  padding: 6px 0 6px 22px;
  border-bottom: 1px solid var(--ed-line-soft);
}
.paywall-benefits li:last-child { border-bottom: 0; }
.paywall-benefits li::before {
  content: "";
  position: absolute; left: 0; top: 11px;
  width: 14px; height: 14px;
  background-color: var(--ed-mint-ink);
  -webkit-mask: no-repeat center/14px 14px url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 8.5L6.5 12L13 4.5'/></svg>");
          mask: no-repeat center/14px 14px url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 8.5L6.5 12L13 4.5'/></svg>");
}
.paywall-benefits strong { color: var(--ed-ink); font-weight: 500; }

/* Reset-time callout (used by prediction-limit modal). */
.paywall-callout {
  background: var(--ed-mint-soft);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 18px;
  text-align: center;
  color: var(--ed-mint-ink);
}
.paywall-callout-label {
  display: block;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 4px;
}
.paywall-callout-value {
  font-family: "Fraunces", Georgia, serif;
  font-size: 22px; font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ed-ink);
  font-variant-numeric: tabular-nums;
}

/* Footer button row. width:auto + flex:0 0 auto override the legacy
   global `button { width:100% }` rule from the top of this file. */
.paywall-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 4px;
}
.paywall-btn {
  width: auto; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px; font-weight: 500;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.paywall-btn-primary {
  background: var(--ed-ink);
  color: var(--ed-paper);
  border: 1px solid var(--ed-ink);
}
.paywall-btn-primary:hover { background: var(--ed-ink-2); border-color: var(--ed-ink-2); }
.paywall-btn-primary:active { transform: translateY(1px); }
.paywall-btn-secondary {
  background: var(--ed-paper);
  color: var(--ed-ink-2);
  border: 1px solid var(--ed-line);
}
.paywall-btn-secondary:hover { border-color: var(--ed-ink-3); color: var(--ed-ink); }
.paywall-btn-secondary:active { transform: translateY(1px); }

/* Mobile tweaks — slightly tighter padding, full-width stacked buttons. */
@media (max-width: 540px) {
  .paywall-card { padding: 24px 20px 18px; border-radius: 16px; }
  .paywall-title { font-size: 20px; }
  .paywall-actions { flex-direction: column-reverse; gap: 8px; }
  .paywall-btn { width: 100%; padding: 14px 18px; }
}

@keyframes paywallOverlayIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes paywallOverlayOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes paywallCardIn     { from { opacity: 0; transform: translateY(12px) scale(0.985); }
                                to  { opacity: 1; transform: translateY(0) scale(1); } }

/* Price - was a dark slate pill (.results-price #1e293b bg, white text,
   28px tall). Now a Fraunces serif amount, ink color, no background. */
.results-price{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ed-ink);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  height: auto;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
  transition: none;
}
.results-item:hover .results-price{
  transform: none;
  box-shadow: none;
  background: transparent;
}

/* Price per sqm - keep small, warm. */
.price-per-sqm{
  color: var(--ed-ink-3);
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* Address - serif, warm ink. */
.results-addr{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ed-ink);
  line-height: 1.3;
}

/* Feature tags - warm paper pill with soft warm line border. */
.feature-tag{
  background: var(--ed-paper-2);
  border: 1px solid var(--ed-line-soft);
  border-radius: 999px;
  color: var(--ed-ink-2);
  font-weight: 500;
  padding: 3px 8px;
}
.feature-tag.highlight{
  background: var(--ed-mint-soft);
  color: var(--ed-mint-ink);
  border-color: transparent;
}

/* Spec items (sq m, rooms, floors, year) - warm muted. */
.spec-item{
  color: var(--ed-ink-3);
}

/* Meta time + results time - warm muted. */
.results-time,
.meta-time,
.results-meta{
  color: var(--ed-ink-3);
}

/* "Naujas" amber border - warm editorial amber instead of cool #fbbf24.
   The earlier rule uses !important so we match it to win. */
.results-list .results-item.is-new{
  border: 1px solid var(--ed-amber) !important;
  box-shadow: 0 0 0 1px var(--ed-amber),
              0 10px 24px -16px oklch(0.72 0.13 55 / 0.5) !important;
  border-radius: var(--ed-radius);
}
.results-list .results-item.is-new:hover{
  border-color: var(--ed-amber) !important;
  box-shadow: 0 0 0 1px var(--ed-amber),
              0 18px 34px -18px oklch(0.72 0.13 55 / 0.55) !important;
}
.results-list .results-item.is-new::before{
  background: linear-gradient(135deg,
              oklch(0.72 0.13 55 / 0.10) 0%,
              oklch(0.72 0.13 55 / 0.04) 100%);
}
/* Editorial "NAUJAS" pill - small amber chip in the top-right of the
   image. Built via ::after on the image container so we don't need to
   touch renderLatestAds() in app.js. Cards may live in .results-list
   (legacy listList) or .preview-grid (newer preview path), so the
   selector intentionally doesn't require a specific container. */
.results-item.is-new .results-image::after{
  content: "NAUJAS";
  position: absolute;
  top: 10px;
  right: 10px;
  height: auto;
  padding: 4px 10px;
  background: var(--ed-amber);
  color: var(--ed-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: 999px;
  z-index: 2;       /* above the gradient overlay (which is also ::after) */
  pointer-events: none;
  /* Override the base .results-image::after gradient defaults. */
  bottom: auto; left: auto;
  background-image: none;
  background-color: var(--ed-amber);
  line-height: 1;
}

/* Same fix for the amber border + glow - was scoped to .results-list. */
.results-item.is-new{
  border: 1px solid var(--ed-amber) !important;
  box-shadow: 0 0 0 1px var(--ed-amber),
              0 10px 24px -16px oklch(0.72 0.13 55 / 0.5) !important;
  border-radius: var(--ed-radius);
}
.results-item.is-new:hover{
  border-color: var(--ed-amber) !important;
  box-shadow: 0 0 0 1px var(--ed-amber),
              0 18px 34px -18px oklch(0.72 0.13 55 / 0.55) !important;
}

/* Star fav button - paper translucent with backdrop blur.
   Was rgba(100,116,139,.85) cool slate. */
.ad-star-btn{
  background: rgba(250,247,242,0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ed-ink-2);
}
.ad-star-btn:hover{
  background: var(--ed-paper);
}
.ad-star-btn.starred,
.ad-star-btn.is-starred{
  background: var(--ed-ink);
  color: var(--ed-amber);
}

/* Price-change pill (down green / up red) - rebrand to mint/rose
   editorial soft tones. The base .price-change rule sets neutral grey
   pill; hue overrides for .price-decrease / .price-increase variants. */
.price-change{
  background: var(--ed-paper-2);
  border-color: var(--ed-line-soft);
  color: var(--ed-ink-3);
  border-radius: 999px;
}
.price-change.price-decrease{
  background: var(--ed-mint-soft);
  color: var(--ed-mint-ink);
  border-color: transparent;
}
.price-change.price-increase{
  background: var(--ed-rose-soft);
  color: var(--ed-rose);
  border-color: transparent;
}

/* ---- Phase 6: Market median panel ----
   Sits above #adsTabsContainer inside #cardPreview. Three states are
   rendered by the JS in app.js: data (header + KPIs + chart), locked
   (paid-only CTA for FREE/ADVANCED), empty (no history yet). */

.med-panel{
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  border-radius: 16px;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(26,24,20,0.02);
}
.med-panel.hidden{ display:none !important; }

/* Header row */
.med-head{
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--ed-line-soft);
  flex-wrap: wrap;
}
.med-panel[data-state="data"] .med-head{ border-bottom: 1px solid var(--ed-line-soft); }
.med-head-icon{
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--ed-mint-soft);
  color: var(--ed-mint-ink);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.med-head-body{ flex: 1; min-width: 180px; }
.med-eyebrow{
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ed-ink-4);
  font-weight: 600;
}
.med-title{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ed-ink);
  margin-top: 2px;
}

/* Range / metric segmented toggles */
.med-toggle{
  display: inline-flex;
  border: 1px solid var(--ed-line);
  border-radius: 999px;
  padding: 2px;
  background: var(--ed-paper-2);
}
.med-toggle button{
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: transparent;
  color: var(--ed-ink-3);
  border: none;
  cursor: pointer;
  width: auto;
}
.med-toggle button.on{
  background: var(--ed-ink);
  color: var(--ed-paper);
}

/* Collapse chevron button - borderless, larger icon */
.med-collapse{
  width: 36px; height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ed-ink-3);
  /* Zero out the global button padding (12px 14px) — with border-box and
     a 22px SVG, that padding shrank the grid's content area to 8x12 and
     pushed the chevron into the bottom-right corner instead of centering
     it within the 36x36 button. */
  padding: 0;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.med-collapse:hover{
  background: var(--ed-paper-2);
  color: var(--ed-ink);
}
.med-collapse svg{ width: 22px; height: 22px; }

/* Body: KPI column + chart column */
.med-body{
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
}
@media (max-width: 860px){
  .med-body{ grid-template-columns: 1fr; }
}

.med-kpis{
  padding: 18px 20px;
  border-right: 1px solid var(--ed-line-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (max-width: 860px){
  .med-kpis{ border-right: none; border-bottom: 1px solid var(--ed-line-soft); }
}
.med-kpi-label,
.med-kpi-mini-label{
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ed-ink-4);
  font-weight: 600;
}
.med-kpi-value{
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}
.med-kpi-num{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ed-ink);
  font-variant-numeric: tabular-nums;
}
.med-kpi-unit{
  font-size: 12px;
  color: var(--ed-ink-3);
}
.med-kpi-delta{
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  align-self: flex-start;
}
.med-kpi-delta.up{
  background: var(--ed-rose-soft);
  color: var(--ed-rose);
}
.med-kpi-delta.down{
  background: var(--ed-mint-soft);
  color: var(--ed-mint-ink);
}
.med-kpi-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.med-kpi-mini-value{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ed-ink);
  margin-top: 2px;
}
.med-kpi-note{
  font-size: 11px;
  color: var(--ed-ink-3);
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--ed-paper-2);
  border-radius: 10px;
  border-left: 2px solid var(--ed-mint);
}
.med-kpi-note b{ color: var(--ed-ink); font-weight: 600; }

.med-chart{
  padding: 18px 16px 14px;
  position: relative;
}
.med-svg{
  width: 100%;
  height: auto;
  display: block;
}

/* Locked state - paid-only CTA */
.med-locked{
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.med-locked-icon{
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--ed-paper-2);
  color: var(--ed-ink-3);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.med-locked-body{ flex: 1; min-width: 200px; }
.med-locked-eyebrow{
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ed-ink-4);
  font-weight: 600;
}
.med-locked-title{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ed-ink);
  margin-top: 2px;
}
.med-locked-sub{
  font-size: 12px;
  color: var(--ed-ink-3);
  margin-top: 4px;
}
.med-locked-cta{
  flex-shrink: 0;
  width: auto;
  padding: 9px 16px;
  font-size: 12px;
}

/* Empty state */
.med-empty{
  padding: 22px 20px;
  text-align: center;
}
.med-empty-title{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 16px;
  font-weight: 500;
  color: var(--ed-ink);
}
.med-empty-sub{
  font-size: 12px;
  color: var(--ed-ink-3);
  margin-top: 4px;
}

/* ============================================================
   Phase 7 - Editorial sidebar (search-redesign-v2)
   On desktop (>=1100px) the page becomes a 2-col grid:
     [ 280px sidebar | 1fr main ]
   On smaller screens the sidebar is hidden via .hidden and the
   layout reverts to the legacy single-column with the
   #cardSavedSearches dropdown card. JS toggles `.has-sidebar`
   on `#appView` once the user is authenticated and the viewport
   is wide enough.
   ============================================================ */

.ed-sidebar{
  display: none;
  background: var(--ed-paper);
  border-right: 1px solid var(--ed-line);
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: env(safe-area-inset-top, 0px);
}
.ed-sidebar.hidden{ display: none !important; }

@media (min-width: 1100px){
  /* Sidebar pins to viewport with position:fixed so it never scrolls
     away with the page. position:sticky was unreliable here because
     .shell has overflow-x:hidden, which breaks sticky in most browsers.
     Main content + appbar are pushed right by 300px so they don't
     sit underneath the sidebar. */
  /* Body (appbar + .main + footer) stays centered in the viewport via
     --ed-shell-margin so the content keeps its symmetric whitespace at
     wide widths. The sidebar alone is pinned to the left edge of the
     viewport (override below) - that combination gives the warm-paper
     gap between the sidebar's right edge and the body's left edge that
     the user asked for, instead of attaching everything to the left. */
  /* Define the centering margin on body too so siblings of .shell
     (e.g. .modal at the body root) can also read the variable. */
  body.has-ed-sidebar,
  .shell.has-sidebar{
    --ed-shell-margin: max(var(--page-gutter), calc((100vw - var(--container) - 300px) / 2));
  }
  .shell.has-sidebar{
    padding-left:  calc(var(--ed-shell-margin) + 300px);
    padding-right: var(--ed-shell-margin);
    /* Clear the fixed appbar (~69px tall with the editorial padding).
       Override the body.banner-visible 112px rule so there's no phantom
       banner gap when we hide the install banner under the sidebar. */
    padding-top: 70px !important;
  }
  .shell.has-sidebar > .ed-sidebar{
    display: flex;
    position: fixed;
    top: 0;
    /* Pinned to the viewport's left edge regardless of --ed-shell-margin
       so only the sidebar attaches to the left while the body stays
       centered (appbar/main/footer keep using the centering margin). */
    left: 0;
    width: 300px;
    height: 100vh;
    z-index: 110;     /* above the appbar (z-index:100) so the sidebar
                         border-right paints cleanly across the topbar */
  }
  .shell.has-sidebar > .ed-sidebar.hidden{ display: none !important; }

  /* Existing .appbar at >=1025px is position:fixed; left:0; right:0
     - shift it right of the sidebar AND pin to viewport top. The banner
     rule (body.banner-visible .appbar { top: 52px }) was leaving a 52px
     gap above the appbar because we hide the iOS install banner via CSS
     while the body.banner-visible class stays set by older JS. */
  .shell.has-sidebar > .appbar{
    left:  calc(var(--ed-shell-margin) + 300px) !important;
    right: var(--ed-shell-margin) !important;
    top: 0 !important;
    /* Base .appbar has width:100% which would override the left/right
       sizing and push content past the viewport - clear it so the
       buttons actually land inside the visible area. */
    width: auto !important;
    /* Solid paper background (matches body) + thin warm line under
       header (per design) + tight inline padding so the search title
       left-aligns with the body content below (32px from sidebar's
       right edge), not centered via container-inset. */
    background: var(--ed-paper) !important;
    backdrop-filter: none !important;
    border-bottom: 1px solid var(--ed-line-soft) !important;
    padding-inline: 32px !important;
    /* Lock to exactly 69px (matches .ed-sidebar-brand height) so the
       bottom border of the brand and the bottom border of the topbar
       form one continuous full-width separator line. Without this,
       the appbar's natural height was driven by content (eyebrow +
       Fraunces title) and rendered ~66.4px, leaving the brand's line
       sitting ~2.6px below the topbar's line. box-sizing inherited
       from base .appbar (border-box) keeps the border included. */
    height: 69px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  /* main is now positioned correctly by shell padding - drop the
     legacy container-inset padding that double-centered it AND the
     28px padding-top that was leaving a fat gap below the appbar.
     The max-width:1200 cap stays in effect. */
  .shell.has-sidebar > .main{
    padding-inline: 0 !important;
    padding-top: 0 !important;
    margin: 0 !important;
  }
  /* cardPreview is the legacy <section class="card"> wrapper around
     the listings view. The design doesn't use an outer card here -
     the hint banner / median panel / cards sit directly on the body
     bg. Strip the wrapping styles. NO vertical margin/padding on the
     box itself - vertical spacing is on the .main grid container
     (padding-block:20 32). This is critical because applyPreviewHeightLock
     sets cardPreview.height to cardCreate's measured height, and
     grid align-items:stretch on cardCreate then re-measures larger
     when cardPreview has its own margins (margins push margin-box
     past border-box). With margins on the grid container instead,
     both cards stretch identically and the lock is stable. */
  .shell.has-sidebar #cardPreview{
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
  }
  /* Search edit / new search form (#cardCreate) sits in the same .main
     grid as #cardPreview. NO margins on the grid items - vertical and
     horizontal spacing live on .main's padding (below). With both items
     margin-free, grid align-items:stretch produces identical border-box
     tops and bottoms, which stabilizes applyPreviewHeightLock. */
  .shell.has-sidebar #cardCreate{
    margin: 0 !important;
  }
  /* The .main grid spans the full width inside .shell.has-sidebar (its
     padding-inline is killed at line ~10282). Padding lives on the grid
     container so column 1 (cardCreate) clears the sidebar by 32px and
     column 2 (cardPreview) clears the right viewport edge by 32px.
     Vertical padding gives the same gap below the topbar (20) and above
     the footer (32) without putting margins on grid items - margins on
     items break align-items:stretch parity between the two columns.

     Switch to border-box here: the base `.main` rule uses content-box
     with `width: 100%` plus 32px inline padding, which makes the outer
     box 64px wider than the shell's content area and pushes
     `#cardPreview`'s right edge ~49px past the appbar's right edge. With
     border-box, the 100% width includes the padding, so the body
     right-aligns with the topbar instead of bleeding past it. */
  .shell.has-sidebar > .main{
    box-sizing: border-box !important;
    max-width: 100% !important;
    padding-left: 32px !important;
    padding-right: 32px !important;
    padding-top: 20px !important;
    padding-bottom: 32px !important;
  }
  /* When both cards are visible side-by-side, keep cardPreview's normal
     32px left padding so there's a clear gap between the form and the
     listings. The grid gap alone is too tight, and cardCreate no longer
     contributes an extra 32px right margin. */
  /* The inner #listBox.results wrapper has a white-to-faint-mint
     gradient by default (line ~844) - kill it so the cards sit
     directly on the warm-paper canvas. */
  .shell.has-sidebar #cardPreview .results{
    background: transparent !important;
    padding: 0 !important;
  }

  /* Phase 7d - the legacy "Išsaugotos paieškos" card is replaced by
     the sidebar list. Keep it in the DOM so existing JS continues to
     read/write #search_select; just hide it visually on desktop. */
  .shell.has-sidebar #cardSavedSearches{ display: none !important; }

  /* Phase 7 - the iOS install banner overlaps the sidebar brand at top
     of viewport. Hide it on desktop where the sidebar provides more
     prominent surface for plan upgrades. body.has-ed-sidebar is set
     by the JS in the same module that mounts the sidebar. */

  /* Footer scoped to the listing-page sidebar layout. Other pages
     (login, landing, legal) use the legacy footer untouched.
     - bg + border-top recolored to match the editorial paper canvas
     - inner content shifted right of the fixed sidebar so it doesn't
       get truncated by it (mirrors the .shell.has-sidebar padding). */
  body.has-ed-sidebar .site-footer{
    --ed-shell-margin: max(var(--page-gutter), calc((100vw - var(--container) - 300px) / 2));
    background: var(--ed-paper);
    border-top-color: var(--ed-line-soft);
    /* +32px on each side matches cardPreview's inner padding so the
       footer columns line up with the body content (hint, tabs, cards). */
    padding-left:  calc(var(--ed-shell-margin) + 300px + 32px);
    padding-right: calc(var(--ed-shell-margin) + 32px);
  }
  body.has-ed-sidebar .site-footer .footer-inner{
    max-width: var(--container);
    margin: 0;
    padding-inline: 0;
  }

  /* Phase 7c - replace the topbar's brand+email block with breadcrumb
     + serif active-search title when the sidebar is showing. */
  .shell.has-sidebar > .appbar > .brand{ display: none !important; }
  .shell.has-sidebar > .appbar > .ed-topbar-context{ display: flex !important; }
}

/* ----------------------------------------------------------------------
   Narrow editorial layout (721-1099px). The desktop sidebar would steal
   too much horizontal space here, so the sidebar column itself is
   hidden, but every other piece of the editorial chrome (cream paper,
   fixed topbar, serif title, news carousel inside #cardPreview, hidden
   legacy brand and saved-searches card) carries over exactly as-is.
   That keeps tablet widths from regressing to the pre-redesign theme.
   ---------------------------------------------------------------------- */
@media (min-width: 721px) and (max-width: 1099px){
  body.has-ed-sidebar,
  .shell.has-sidebar{
    --ed-shell-margin: var(--page-gutter);
  }
  .shell.has-sidebar{
    padding-left:  var(--ed-shell-margin);
    padding-right: var(--ed-shell-margin);
    padding-top: 70px !important;
  }
  /* The sidebar element exists (kept in DOM for the sake of the
     mounting JS) but stays invisible at this width. */
  .shell.has-sidebar > .ed-sidebar{ display: none !important; }

  .shell.has-sidebar > .appbar{
    position: fixed !important;
    left:  var(--ed-shell-margin) !important;
    right: var(--ed-shell-margin) !important;
    top: 0 !important;
    width: auto !important;
    background: var(--ed-paper) !important;
    backdrop-filter: none !important;
    border-bottom: 1px solid var(--ed-line-soft) !important;
    padding-inline: 32px !important;
    height: 69px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    z-index: 100;
  }
  .shell.has-sidebar > .appbar > .brand{ display: none !important; }
  .shell.has-sidebar > .appbar > .ed-topbar-context{ display: flex !important; }
  .shell.has-sidebar .ed-topbar-icon-btn{ display: inline-flex; }

  .shell.has-sidebar > .main{
    padding-left: 32px !important;
    padding-right: 32px !important;
    padding-top: 20px !important;
    padding-bottom: 32px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }
  .shell.has-sidebar #cardSavedSearches{ display: none !important; }
  .shell.has-sidebar #cardPreview{
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
  }
  .shell.has-sidebar #cardPreview .results{
    background: transparent !important;
    padding: 0 !important;
  }
  .shell.has-sidebar #cardCreate{ margin: 0 !important; }


  body.has-ed-sidebar .site-footer{
    background: var(--ed-paper);
    border-top-color: var(--ed-line-soft);
  }
}

.ed-topbar-context{
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}
.ed-topbar-context.hidden{ display: none !important; }
.ed-topbar-context > div{
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.ed-topbar-eyebrow{
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ed-ink-4);
  font-weight: 600;
}
.ed-topbar-title{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ed-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60ch;
  line-height: 1.2;
}

/* Editorial title row: title + inline pencil affordance.
   The pencil is the editor's "manuscript margin mark" - it sits right
   next to the saved-search title so users instantly see the search is
   editable without hunting the chip in the tabs row. The label fades in
   on hover so the affordance starts compact (just the glyph) but reads
   loud and clear when the user shows interest. */
.ed-topbar-title-row{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ed-topbar-title-row .ed-topbar-title{
  flex: 0 1 auto;
  min-width: 0;
  /* When the row sits inside a column-stretch parent, the row inherits
     the parent's full width and the pencil's flex-shrink:1 default would
     eat the title. Locking the title to its intrinsic content width
     keeps it visible while the pencil sits to its right. */
  width: max-content;
  max-width: 60ch;
}
.ed-title-edit{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  margin: 0;
  border: 1px dashed var(--ed-line);
  border-radius: 999px;
  background: transparent;
  color: var(--ed-ink-3);
  cursor: pointer;
  font: 500 11px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background .18s, color .18s, border-color .18s, transform .18s;
  /* Lock to intrinsic content width - never grow to fill a parent row. */
  flex: 0 0 auto;
  width: max-content;
}
.ed-title-edit svg{
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.ed-title-edit-label{
  /* Always visible - editorial all-caps tag instead of just an icon so
     even non-hovering users see "REDAGUOTI" sitting next to the title. */
  display: inline;
}
.ed-title-edit:hover{
  background: var(--ed-mint-soft);
  color: var(--ed-mint-ink);
  border-color: var(--ed-mint);
  border-style: solid;
}
.ed-title-edit:active{
  transform: translateY(1px);
}
.ed-title-edit:focus-visible{
  outline: 2px solid var(--ed-mint);
  outline-offset: 2px;
}
.ed-title-edit:disabled,
.ed-title-edit.disabled{
  opacity: 0.35;
  pointer-events: none;
}

/* Editorial news carousel (search-redesign-v2)
   Sits at the top of the listings card, above the median panel and
   tabs. Mint-soft → paper-2 horizontal gradient. Replaces the legacy
   #trialBanner (top-fixed countdown) and #edHintBanner (single
   app-promo banner) — every site-wide news/notification flows through
   here. Slides translate horizontally inside .ed-news-track and
   auto-rotate every ~6.5s when there are 2+ slides. */
.ed-news{
  position: relative;
  margin: 0 0 18px;
  background: linear-gradient(90deg, var(--ed-mint-soft), var(--ed-paper-2));
  border: 1px solid var(--ed-line-soft);
  border-radius: 14px;
  overflow: hidden;
}
.ed-news.hidden{ display: none !important; }
.ed-news-track{
  display: flex;
  width: 100%;
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.ed-news-slide{
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  box-sizing: border-box;
}
.ed-news-icon{
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--ed-paper);
  color: var(--ed-mint-ink);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ed-news-body{ flex: 1; min-width: 0; }
.ed-news-title{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ed-ink);
}
.ed-news-sub{
  font-size: 12px;
  color: var(--ed-ink-3);
  margin-top: 2px;
}
.ed-news-actions{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
/* Defeat the legacy global `input,select,button { width:100% }` rule. */
.ed-news-cta{
  flex: 0 0 auto;
  width: auto;
  padding: 9px 14px;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Dot indicators sit pinned to the bottom-right corner. Only rendered
   when there are 2+ slides so a single-slide carousel still looks like
   a flat card. */
.ed-news-dots{
  position: absolute;
  right: 12px;
  bottom: 8px;
  display: flex;
  gap: 5px;
}
.ed-news-dots:empty{ display: none; }
.ed-news-dot{
  appearance: none;
  width: 6px;
  height: 6px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--ed-line);
  cursor: pointer;
  transition: background .15s, width .15s;
}
.ed-news-dot.is-active{
  width: 16px;
  border-radius: 3px;
  background: var(--ed-mint-ink);
}
@media (max-width: 720px){
  .ed-news-slide{ padding: 12px 14px; gap: 10px; }
  .ed-news-icon{ display: none; }
  .ed-news-title{ font-size: 14px; }
  .ed-news-sub{ font-size: 11.5px; }
  .ed-news-cta{ padding: 7px 11px; font-size: 11.5px; }
  .ed-news-dots{ right: 10px; bottom: 6px; }
}

/* Editorial topbar icon buttons (search, bell). Visible only when
   the sidebar is mounted - hidden by default to avoid showing on the
   public landing page. Match the design's small square icon-pill look. */
.ed-topbar-icon-btn{
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--ed-line);
  background: var(--ed-paper);
  color: var(--ed-ink-2);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background .12s, color .12s, border-color .12s;
  padding: 0;
  flex-shrink: 0;
}
.ed-topbar-icon-btn:hover{
  background: var(--ed-paper-2);
  color: var(--ed-ink);
  border-color: var(--ed-ink-4);
}
.ed-topbar-icon-dot{
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ed-mint);
  border: 1.5px solid var(--ed-paper);
}
/* Bell unread count chip - shown when there are unread ads across any
   saved search. Replaces the small dot when active; capped at "99+"
   in the JS so the chip never grows too wide. */
.ed-topbar-bell-count{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ed-amber);
  color: var(--ed-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--ed-paper);
  pointer-events: none;
  white-space: nowrap;
}
@media (min-width: 1100px){
  .shell.has-sidebar .ed-topbar-icon-btn{ display: inline-flex; }
}

/* Editorial paper canvas in app-mode at all widths.
   The desktop sidebar layout (>=1100px) already paints appbar/footer/
   results in cream via .shell.has-sidebar rules, but on tablet widths
   (721-1099px) the legacy white appbar + bluish footer + white result
   gradient bled through and looked like the "old" theme. Match the
   editorial cream everywhere body.app-mode is set so the redesign is
   coherent at every width above the mobile shell ceiling.

   Mobile shell (<=720px) handles its own chrome and sets its own
   background, so these rules are intentionally desktop+tablet only. */
@media (min-width: 721px){
  body.app-mode .appbar{
    background: var(--ed-paper) !important;
    backdrop-filter: none !important;
    border-bottom: 1px solid var(--ed-line-soft) !important;
  }
  body.app-mode .site-footer{
    background: var(--ed-paper);
    border-top-color: var(--ed-line-soft);
  }
  body.app-mode #cardPreview .results{
    background: transparent !important;
  }
  /* Bell icon was hidden by default and only revealed inside the
     sidebar layout. Show it whenever app-mode is active so the
     header always carries the same bell + menu + lang trio. */
  body.app-mode .ed-topbar-icon-btn{ display: inline-flex; }
}

/* ----------------------------------------------------------------------
   Editorial LANDING (search-redesign-v2, Phase 1: Hero + Auth card).
   Restyle the pre-login #authView / #authCard with cream-paper / mint /
   ink tokens. CSS-only: every legacy class (.pill, .hero-intro, .ai-
   features, .promise-bar, .stats-strip, .auth-card, .tabs, .tab,
   .checkline, .btn-google, .btn-apple, .or-divider, .h1-highlight)
   keeps its markup and SVGs - only colours, borders, radii, and
   shadows shift. Scoped to body.auth-mode so the post-login UI stays
   untouched.
   ---------------------------------------------------------------------- */
/* Pre-login editorial header (only shown on body.auth-mode). The
   post-login .appbar is gated to body.app-mode so the two headers
   never overlap. Reuses the existing NTAlert PNG logo. */
.lp-header{ display: none; }
body.auth-mode .lp-header{
  display: block;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ed-line-soft);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
body.auth-mode .lp-header-inner{
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
@media (max-width: 720px){
  body.auth-mode .lp-header-inner{ padding: 12px 16px; }
}
body.auth-mode .lp-nav{
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  margin-right: 16px;
  font-size: 13.5px;
  color: var(--ed-ink-2);
}
body.auth-mode .lp-nav a{
  color: var(--ed-ink-2);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s;
}
body.auth-mode .lp-nav a:hover{ color: var(--ed-ink); }
@media (max-width: 720px){
  body.auth-mode .lp-nav{ display: none; }
}
body.auth-mode .lp-brand{
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
body.auth-mode .lp-brand-mark{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
body.auth-mode .lp-brand-mark img{
  width: 28px;
  height: 28px;
  object-fit: contain;
}
body.auth-mode .lp-brand-mark::after{
  content: "";
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ed-mint);
  top: 5px; right: 5px;
  box-shadow: 0 0 0 2px var(--ed-paper);
}
body.auth-mode .lp-brand-text{
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
body.auth-mode .lp-brand-name{
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ed-ink);
}
body.auth-mode .lp-brand-eyebrow{
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ed-ink-4);
  font-weight: 600;
  margin-top: 2px;
}

/* Site footer in pre-login mode mirrors the app-mode cream treatment
   so the existing #footerBrandBadge PNG logo sits on warm paper, not
   the legacy bluish-grey. */
body.auth-mode .site-footer{
  background: var(--ed-paper);
  border-top: 1px solid var(--ed-line-soft);
  color: var(--ed-ink-3);
}


body.auth-mode #authView.hero-wrap{
  /* Hero gradient is constrained to ~720px tall (the visual height of
     the hero block before the marketing sections start). Beyond that
     the page sits on flat cream paper, so the green tint doesn't bleed
     into the Why grid / listings / stats. */
  background-color: var(--ed-paper);
  background-image:
    radial-gradient(circle at 80% 10%, oklch(0.94 0.04 170 / 0.6), transparent 45%),
    radial-gradient(circle at 10% 90%, oklch(0.95 0.03 70 / 0.4), transparent 50%),
    linear-gradient(180deg, oklch(0.97 0.025 170) 0%, var(--ed-paper) 100%);
  background-size: 100% 760px, 100% 760px, 100% 760px;
  background-position: top center, top center, top center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--ed-line-soft);
  color: var(--ed-ink);
  min-height: auto;
}
/* Constrain the hero rows to a single screen so the auth card sits
   above the fold and the marketing sections start clean below. */
body.auth-mode #authView.hero-wrap{
  grid-template-rows: auto;
}
body.auth-mode .hero-left h1{
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.04;
  color: var(--ed-ink);
}
body.auth-mode .hero-left .h1-highlight{
  position: relative;
  display: inline-block;
  color: var(--ed-ink);
}
body.auth-mode .hero-left .h1-highlight::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  height: 14px;
  background: var(--ed-mint-soft);
  z-index: -1;
}
body.auth-mode .hero-intro{
  color: var(--ed-ink-3);
  max-width: 50ch;
}
body.auth-mode .hero-intro b{ color: var(--ed-ink-2); font-weight: 600; }

body.auth-mode .pill{
  background: var(--ed-paper);
  border: 1px solid var(--ed-mint);
  color: var(--ed-mint-ink);
  box-shadow: none;
  font-weight: 600;
  padding: 7px 14px;
}
body.auth-mode .pill:hover{
  transform: none;
  border-color: var(--ed-mint);
  box-shadow: none;
}
body.auth-mode .pill svg{ color: var(--ed-mint); }

body.auth-mode .ai-features.hero-features-visible{
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
  padding: 0;
  margin: 28px 0 0;
}
body.auth-mode .ai-features.hero-features-visible li{
  color: var(--ed-ink-2);
  font-size: 14px;
  line-height: 1.5;
  padding-left: 28px;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
body.auth-mode .ai-features.hero-features-visible li::before{
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--ed-mint-soft) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23244840' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/11px no-repeat;
  font-weight: 0;
  color: transparent;
}

body.auth-mode .promise-bar{
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  border-radius: 14px;
  padding: 10px 14px;
  margin: 32px 0 0;
  color: var(--ed-mint-ink);
  font-weight: 600;
  font-size: 12.5px;
  white-space: normal;
}
body.auth-mode .promise-item{ color: var(--ed-mint-ink); }
body.auth-mode .promise-item svg{ color: var(--ed-mint); }
body.auth-mode .promise-sep{
  width: 4px; height: 4px;
  background: var(--ed-line);
  border-radius: 50%;
  color: transparent;
  align-self: center;
  margin: 0;
}

body.auth-mode .stats-strip{
  justify-content: flex-start;
  gap: 48px;
  margin-top: 48px;
  padding: 0;
}
body.auth-mode .stats-strip-item{
  align-items: flex-start;
  gap: 6px;
}
body.auth-mode .stats-strip-number{
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ed-ink);
  font-variant-numeric: tabular-nums;
}
body.auth-mode .stats-strip-label{
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ed-ink-4);
  font-weight: 600;
}

/* Hero promise-bar + stats-strip on mobile: keep both centered and on
   one line. The base auth-mode rules use big serif numerals (34px) and a
   48px stat-gap that wrap the third item below; the promise pill was
   inline-flex so it hugged its content and sat left-aligned. */
@media (max-width: 720px){
  body.auth-mode .promise-bar{
    display: flex;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    max-width: 100%;
  }
  body.auth-mode .stats-strip{
    flex-wrap: nowrap;
    gap: 18px;
    justify-content: space-between;
    margin-top: 32px;
  }
  body.auth-mode .stats-strip-item{
    flex: 1 1 0;
    min-width: 0;
  }
  body.auth-mode .stats-strip-number{
    font-size: 22px;
    letter-spacing: -0.02em;
  }
  body.auth-mode .stats-strip-label{
    font-size: 9.5px;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
}

body.auth-mode .hero-view-ads-cta{
  background: var(--ed-ink);
  color: var(--ed-paper);
  border: none;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  box-shadow: none;
}
body.auth-mode .hero-view-ads-cta:hover{
  background: var(--ed-ink-2);
  box-shadow: 0 8px 20px -10px rgba(26,24,20,0.35);
}

body.auth-mode .auth-card{
  background: var(--ed-paper);
  backdrop-filter: none;
  border: 1px solid var(--ed-line);
  border-radius: 18px;
  padding: 22px 22px 24px;
  box-shadow:
    0 30px 60px -28px rgba(26,24,20,0.18),
    0 1px 0 rgba(255,255,255,0.6) inset;
}

body.auth-mode .auth-card .tabs{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--ed-paper-2);
  border-radius: 12px;
  margin-bottom: 20px;
}
body.auth-mode .auth-card .tab{
  background: transparent;
  border: 1px solid transparent;
  color: var(--ed-ink-3);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}
body.auth-mode .auth-card .tab.active,
body.auth-mode .auth-card .tabs .tab[aria-selected="true"]{
  background: var(--ed-mint-soft);
  color: var(--ed-mint-ink);
  border: 1px solid var(--ed-mint);
}

body.auth-mode .auth-card label{
  font-size: 12px;
  color: var(--ed-ink-3);
  font-weight: 500;
  margin-bottom: 6px;
}
body.auth-mode .auth-card input[type="email"],
body.auth-mode .auth-card input[type="password"],
body.auth-mode .auth-card input[type="text"],
body.auth-mode .auth-card input:not([type]){
  padding: 12px 14px;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: var(--ed-paper);
  /* 16px (not 14px) so iOS Safari does NOT auto-zoom on focus.
     The whole viewport gets stretched when any focused input is
     under 16px - login was fine via autofill (no manual focus),
     but registration always zoomed and broke the layout. */
  font-size: 16px;
  color: var(--ed-ink);
  transition: border-color .15s, box-shadow .15s;
}
body.auth-mode .auth-card input[type="email"]:focus,
body.auth-mode .auth-card input[type="password"]:focus,
body.auth-mode .auth-card input[type="text"]:focus,
body.auth-mode .auth-card input:not([type]):focus{
  border-color: var(--ed-mint);
  box-shadow: 0 0 0 3px var(--ed-mint-soft);
  outline: none;
}
/* Override Chrome/Safari autofill yellow/white bg on cream inputs. */
body.auth-mode .auth-card input:-webkit-autofill,
body.auth-mode .auth-card input:-webkit-autofill:hover,
body.auth-mode .auth-card input:-webkit-autofill:focus{
  -webkit-text-fill-color: var(--ed-ink);
  -webkit-box-shadow: 0 0 0 1000px var(--ed-paper) inset;
  caret-color: var(--ed-ink);
  transition: background-color 99999s ease-in-out 0s;
}

body.auth-mode .auth-card .checkline{
  background: transparent;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ed-ink-2);
  box-shadow: none;
}
body.auth-mode .auth-card .checkline input[type="checkbox"]{
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--ed-line);
  background: var(--ed-paper);
  cursor: pointer;
  position: relative;
  margin: 0;
  flex-shrink: 0;
}
body.auth-mode .auth-card .checkline input[type="checkbox"]:checked{
  background: var(--ed-mint);
  border-color: var(--ed-mint);
}
body.auth-mode .auth-card .checkline input[type="checkbox"]:checked::after{
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/11px no-repeat;
}

body.auth-mode .auth-card #linkForgot,
body.auth-mode .auth-card .forgot-link{
  color: var(--ed-mint-ink);
  font-size: 12.5px;
  font-weight: 500;
}
body.auth-mode .auth-card #linkForgot:hover,
body.auth-mode .auth-card .forgot-link:hover{ text-decoration: underline; }

body.auth-mode .auth-card .btn-primary{
  background: var(--ed-ink);
  color: var(--ed-paper);
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 13px 16px;
  box-shadow: none;
}
body.auth-mode .auth-card .btn-primary:hover{
  background: var(--ed-ink-2);
  box-shadow: 0 8px 20px -10px rgba(26,24,20,0.35);
}

body.auth-mode .auth-card .or-divider{
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ed-ink-4);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 16px 0;
}
body.auth-mode .auth-card .or-divider::before,
body.auth-mode .auth-card .or-divider::after{
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ed-line);
}

body.auth-mode .auth-card .btn-google,
body.auth-mode .auth-card .btn-apple{
  background: var(--ed-paper);
  color: var(--ed-ink);
  border: 1px solid var(--ed-line);
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 500;
  padding: 12px 16px;
  box-shadow: none;
}
body.auth-mode .auth-card .btn-google:hover,
body.auth-mode .auth-card .btn-apple:hover{
  background: var(--ed-paper-2);
  border-color: var(--ed-ink-4);
  box-shadow: none;
}

/* Auth card form rows: stack email/password full-width on every
   viewport (matches the design's vertical layout), then run the
   remember-col + forgot link as a horizontal pair on a single line
   below. The legacy .row had `flex: 1 1 240px` on its children which
   caused the inputs to wrap mid-card on narrow widths. */
body.auth-mode .auth-card .row{
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
body.auth-mode .auth-card .row > div:not(.remember-col){
  flex: 0 0 100%;
  min-width: 0;
}
body.auth-mode .auth-card .row .remember-col{
  flex: 1 1 auto;
  width: auto;
  align-self: center;
}
body.auth-mode .auth-card .row #linkForgot{
  flex: 0 0 auto;
  margin-left: auto;
  align-self: center;
}

/* All anchor links inside the auth card pick up the mint-ink colour
   (terms / privacy / "Back to login"). The legacy default was a
   bright teal (#0e7dc2) that clashed with the editorial palette. */
body.auth-mode .auth-card a,
body.auth-mode .auth-card .muted{
  color: var(--ed-mint-ink);
  font-weight: 500;
  text-decoration: none;
}
body.auth-mode .auth-card a:hover{
  text-decoration: underline;
  color: var(--ed-mint-ink);
}
/* The terms checkbox (reg_agree) inherits .checkline styling above,
   but the .row wrapper around it adds extra padding/border. Strip it
   so the row sits flush like the rest of the form. */
body.auth-mode .auth-card #agreeRow{
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 0 16px;
}
body.auth-mode .auth-card #agreeRow .remember-col{
  width: 100%;
}
body.auth-mode .auth-card #agreeRow .checkline{
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  color: var(--ed-ink-3);
  line-height: 1.45;
}
/* Version stamp next to the terms link - small, muted. */
body.auth-mode .auth-card #agreement_version,
body.auth-mode .auth-card .agreement-version{
  color: var(--ed-ink-4);
  font-size: 11px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ----------------------------------------------------------------------
   Editorial LANDING (search-redesign-v2, Phase 2: marketing sections).
   Restyle the sections below the hero - "Kodėl verta naudoti", listings
   preview, testimonial carousel, stats dashboard, city grid, site footer
   - so the entire pre-login page sits on the same cream-paper canvas.
   CSS-only, scoped to body.auth-mode. No icon/text/font replacements.
   ---------------------------------------------------------------------- */
body.auth-mode #marketing,
body.auth-mode #publicPreview,
body.auth-mode .trust-section,
body.auth-mode #statsSection,
body.auth-mode .city-links,
body.auth-mode .seo-hub{
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
}

body.auth-mode #marketing > h3,
body.auth-mode .city-links > h3{
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ed-ink);
  margin: 0 0 28px;
}
body.auth-mode #publicPreview h2,
body.auth-mode .stats-title{
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ed-ink);
}
body.auth-mode .preview-intro{
  color: var(--ed-ink-3);
  max-width: 58ch;
}

/* "Why" grid - editorial bordered container with clean hairline
   dividers between cells. The "gap-fill" trick: the grid container's
   background paints the gap between cells (1px wide), so we don't
   need per-cell borders that fight with the outer rounded clip. */
body.auth-mode #marketing .value-grid{
  background: var(--ed-line-soft);
  border: 1px solid var(--ed-line);
  border-radius: 18px;
  overflow: hidden;
  gap: 1px;
}
body.auth-mode #marketing .value-card{
  background: var(--ed-paper);
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 30px 28px;
  transform: none !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.auth-mode #marketing .value-card:hover{
  background: var(--ed-paper-2);
  transform: none;
  box-shadow: none;
}
/* Round individual corner cards so they hug the wrapper's rounded outer edge
   cleanly even if a child stacking context escapes overflow:hidden. */
body.auth-mode #marketing .value-grid > .value-card:nth-child(1){ border-top-left-radius: 17px; }
body.auth-mode #marketing .value-grid > .value-card:nth-child(3){ border-top-right-radius: 17px; }
body.auth-mode #marketing .value-grid > .value-card:nth-child(4){ border-bottom-left-radius: 17px; }
body.auth-mode #marketing .value-grid > .value-card:nth-child(6){ border-bottom-right-radius: 17px; }
/* Single-column fallback (≤1100px): only first and last card carry rounding. */
@media (max-width: 1100px){
  body.auth-mode #marketing .value-grid > .value-card{ border-radius: 0; }
  body.auth-mode #marketing .value-grid > .value-card:first-child{
    border-top-left-radius: 17px;
    border-top-right-radius: 17px;
  }
  body.auth-mode #marketing .value-grid > .value-card:last-child{
    border-bottom-left-radius: 17px;
    border-bottom-right-radius: 17px;
  }
}
body.auth-mode #marketing .value-card .ic{
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--ed-mint-soft);
  color: var(--ed-mint-ink);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  box-shadow: none;
}
/* Last 3 cards get the warm amber accent (matches the design's split). */
body.auth-mode #marketing .value-card:nth-child(n+4) .ic{
  background: oklch(0.96 0.05 70);
  color: oklch(0.55 0.13 55);
}
body.auth-mode #marketing .value-card .ic svg{
  width: 19px;
  height: 19px;
  stroke-width: 1.7;
  color: inherit;
}
body.auth-mode #marketing .value-card h4{
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ed-ink);
  margin: 0 0 8px;
}
body.auth-mode #marketing .value-card p{
  font-size: 13.5px;
  color: var(--ed-ink-3);
  line-height: 1.55;
  margin: 0;
}

/* Listings preview - cards on cream paper with hairline border. */
body.auth-mode #publicPreview .preview-grid > .results-item{
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  border-radius: 14px;
  box-shadow: none;
  overflow: hidden;
}
body.auth-mode #publicPreview .preview-grid > .results-item:hover{
  border-color: var(--ed-ink-4);
  box-shadow: 0 12px 28px -20px rgba(26,24,20,0.18);
}

/* Testimonial carousel - editorial paper card with mint quote mark. */
body.auth-mode .trust-section .testimonial-card{
  background: var(--ed-paper);
  border: 1px solid var(--ed-line-soft);
  border-radius: 18px;
  box-shadow: 0 12px 28px -20px rgba(26,24,20,0.18);
  padding: 32px 36px 30px;
}
body.auth-mode .trust-section .testimonial-quote-mark{
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 48px;
  line-height: 1;
  color: var(--ed-mint);
  font-weight: 700;
}
body.auth-mode .trust-section .testimonial-text{
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ed-ink-2);
  font-weight: 400;
}
body.auth-mode .trust-section .testimonial-stars,
body.auth-mode .trust-section .trust-rating-stars{
  color: oklch(0.78 0.13 85);
  letter-spacing: 1px;
}
body.auth-mode .trust-section .testimonial-attribution{
  color: var(--ed-ink-2);
  font-weight: 600;
}
body.auth-mode .trust-section .testimonial-date{
  color: var(--ed-ink-4);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
body.auth-mode .trust-section .testimonial-dots .testimonial-dot,
body.auth-mode .trust-section .testimonial-dots > *{
  background: var(--ed-line);
}
body.auth-mode .trust-section .testimonial-dots .active,
body.auth-mode .trust-section .testimonial-dots [aria-current="true"]{
  background: var(--ed-mint);
}
body.auth-mode .trust-section .trust-rating-text{
  color: var(--ed-ink-3);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
body.auth-mode .trust-section .trust-rating-text b{ color: var(--ed-ink); }

/* Stats panel - mint→paper gradient container with cream chart cards. */
body.auth-mode #statsSection .stats-container{
  background: linear-gradient(180deg, oklch(0.97 0.025 170) 0%, var(--ed-paper) 100%);
  border: 1px solid var(--ed-line-soft);
  border-radius: 24px;
  padding: 40px 36px;
}
body.auth-mode #statsSection .stats-tabs{
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  border-radius: 14px;
  padding: 5px;
  gap: 6px;
}
body.auth-mode #statsSection .stats-tab{
  background: transparent;
  color: var(--ed-ink-3);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  box-shadow: none;
}
body.auth-mode #statsSection .stats-tab.active,
body.auth-mode #statsSection .stats-tab[aria-selected="true"]{
  background: var(--ed-mint);
  color: var(--ed-ink);
}
body.auth-mode #statsSection .stats-container{ align-items: stretch; }
body.auth-mode #statsSection .stats-card{
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  border-radius: 18px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}
body.auth-mode #statsSection .stats-card h3{
  color: var(--ed-ink-2);
  font-weight: 600;
}
body.auth-mode #statsSection .stats-total{
  color: var(--ed-ink-3);
  border-top: 1px solid var(--ed-line-soft);
  margin-top: auto;
}
body.auth-mode #statsSection .stats-total b{ color: var(--ed-mint-ink); }

/* Cities grid - mint-soft tile cards with circular icon. */
body.auth-mode .city-links .value-card{
  background: oklch(0.97 0.025 170);
  border: 1px solid var(--ed-line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: none;
}
body.auth-mode .city-links .value-card:hover{
  background: var(--ed-mint-soft);
  border-color: var(--ed-mint);
  transform: none;
  box-shadow: none;
}
body.auth-mode .city-links .value-card .ic{
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  color: var(--ed-mint-ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: none;
  margin-top: 2px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.auth-mode .city-links .value-card:hover .ic{
  background: var(--ed-paper-2);
  border-color: var(--ed-mint);
}
body.auth-mode .city-links .value-card .ic svg{
  width: 20px;
  height: 20px;
  stroke-width: 1.7;
  color: inherit;
  display: block;
}
body.auth-mode .city-links .value-card h4{
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ed-ink);
}
body.auth-mode .city-links .value-card p{
  font-size: 12px;
  color: var(--ed-ink-3);
  line-height: 1.4;
}

/* SEO link hub - editorial outline pill row. */
body.auth-mode .seo-hub .btn-ghost{
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  color: var(--ed-ink-2);
  border-radius: 11px;
  font-weight: 500;
  box-shadow: none;
}
body.auth-mode .seo-hub .btn-ghost:hover{
  background: var(--ed-paper-2);
  border-color: var(--ed-ink-4);
  color: var(--ed-ink);
  box-shadow: none;
}

/* Site footer - cream paper, JetBrains Mono copyright. */
body.auth-mode .site-footer{ color: var(--ed-ink-3); }
body.auth-mode .site-footer a{ color: var(--ed-ink-2); text-decoration: none; }
body.auth-mode .site-footer a:hover{ color: var(--ed-ink); }
/* Footer brand badge mirrors the lp-header logo treatment so both
   anchor points use the same NTAlert glyph. */
body.auth-mode .footer-brand-badge{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: none;
}
body.auth-mode .footer-brand-badge::after{
  content: "";
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ed-mint);
  top: 5px; right: 5px;
  box-shadow: 0 0 0 2px var(--ed-paper);
}
body.auth-mode .footer-brand-badge img{
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}
body.auth-mode .footer-brand-name{
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ed-ink);
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
body.auth-mode .footer-copyright{
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--ed-ink-4);
}

/* Cookie consent banner - cream paper, editorial border + buttons.
   Existing markup uses .btn-primary / .btn-ghost; both inherit the
   pre-redesign yellow gradient by default, so re-skin them inside
   the cookie scope. */
body.auth-mode .cookie-banner{
  background: var(--ed-paper);
  border-top: 1px solid var(--ed-line);
  box-shadow: 0 -10px 28px -18px rgba(26,24,20,0.18);
  padding: 22px 32px;
}
body.auth-mode .cookie-banner-text h3{
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ed-ink);
}
body.auth-mode .cookie-banner-text p{
  color: var(--ed-ink-3);
}
body.auth-mode .cookie-banner-text a{
  color: var(--ed-mint-ink);
  text-decoration: none;
  font-weight: 500;
}
body.auth-mode .cookie-banner-text a:hover{ text-decoration: underline; }
body.auth-mode .cookie-banner .btn-primary{
  background: var(--ed-ink);
  color: var(--ed-paper);
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 11px 20px;
  box-shadow: none;
  border: 1px solid var(--ed-ink);
}
body.auth-mode .cookie-banner .btn-primary:hover{
  background: var(--ed-ink-2);
  border-color: var(--ed-ink-2);
  box-shadow: 0 8px 20px -10px rgba(26,24,20,0.35);
}
body.auth-mode .cookie-banner .btn-ghost{
  background: var(--ed-paper);
  color: var(--ed-ink);
  border: 1px solid var(--ed-line);
  border-radius: 11px;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 20px;
  box-shadow: none;
}
body.auth-mode .cookie-banner .btn-ghost:hover{
  background: var(--ed-paper-2);
  border-color: var(--ed-ink-4);
  color: var(--ed-ink);
}

/* Lang-switch pill on the landing - cream paper, ink active state.
   Lives inside the lp-header (mountLangSwitch moves it there at
   startup) so it composes with the nav row instead of floating. */
body.auth-mode .lp-header .lang-switch{
  position: static !important;
  top: auto !important;
  right: auto !important;
  z-index: auto !important;
  flex: 0 0 auto;
  align-self: center;
}
body.auth-mode .lang-switch:not(.appbar .lang-switch){
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  border-radius: 999px;
  box-shadow: none;
  padding: 3px;
}
body.auth-mode .lang-switch:not(.appbar .lang-switch) button{
  background: transparent;
  color: var(--ed-ink-3);
  border: none;
  border-radius: 999px;
  width: 32px;
  height: 28px;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
}
body.auth-mode .lang-switch:not(.appbar .lang-switch) button.active{
  background: var(--ed-ink);
  color: var(--ed-paper);
  border: none;
}

/* Edit / actions chip in the tabs row - small editorial pill on the
   right edge, sits visually with the tab list (right-aligned via
   margin-left:auto on the wrapper). */
.ed-tabs-actions{
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
}
.ed-tabs-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--ed-line);
  border-radius: 999px;
  background: var(--ed-paper);
  color: var(--ed-ink-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  width: auto;
  transition: background .12s, color .12s, border-color .12s;
}
.ed-tabs-chip:hover{
  background: var(--ed-paper-2);
  border-color: var(--ed-ink-4);
  color: var(--ed-ink);
}
.ed-tabs-chip:disabled,
.ed-tabs-chip.disabled{
  opacity: 0.4;
  cursor: not-allowed;
}

/* Brand block at top of sidebar - height matches the appbar exactly
   so the bottom border of the brand and the bottom border of the
   topbar form one continuous full-width separator line. */
.ed-sidebar-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  height: 69px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--ed-line-soft);
  flex-shrink: 0;
}
.ed-sidebar-mark{
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--ed-ink);
  color: var(--ed-paper);
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.02em;
  position: relative;
  flex-shrink: 0;
}
.ed-sidebar-mark::after{
  content: "";
  position: absolute;
  top: -3px; right: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ed-mint);
  box-shadow: 0 0 0 2px var(--ed-paper);
}
/* When the brand mark uses the actual NTAlert icon image instead of the
   "NT" placeholder, drop the dark fill + serif typography and just show
   the image at the same footprint. */
.ed-sidebar-mark.ed-sidebar-mark-img{
  background: transparent;
  color: inherit;
  font-size: 0;
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: contain;
  overflow: hidden;
}
.ed-sidebar-name{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ed-ink);
  line-height: 1.1;
}
.ed-sidebar-sub{
  font-size: 11px;
  color: var(--ed-ink-3);
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Saved-searches section */
.ed-sidebar-section{
  padding: 18px 14px 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.ed-sidebar-label{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ed-ink-4);
  font-weight: 600;
}
.ed-sidebar-count{
  color: var(--ed-ink-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
}
.ed-sidebar-new{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--ed-line);
  border-radius: 10px;
  color: var(--ed-ink-2);
  font-weight: 500;
  font-size: 13px;
  background: transparent;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background .15s, border-color .15s, color .15s;
}
.ed-sidebar-new:hover{
  background: var(--ed-paper-2);
  border-color: var(--ed-ink-4);
  color: var(--ed-ink);
}
.ed-sidebar-plus{
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ed-ink);
  color: var(--ed-paper);
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

/* Saved-search rows */
.ed-sidebar-list{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ed-sidebar-item{
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s, color .12s;
  position: relative;
  align-items: flex-start;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--ed-ink);
}
.ed-sidebar-item:hover{ background: var(--ed-paper-2); }
.ed-sidebar-item.active{ background: var(--ed-ink); color: var(--ed-paper); }
.ed-sidebar-item.active .ed-sidebar-item-meta{ color: rgba(250,247,242,0.65); }

/* Hover-revealed editorial pencil on each saved-search row.
   - Hidden by default (opacity:0, pointer-events:none) so the row stays
     visually clean until the user shows interest.
   - Fades in on row hover (and on the row's :focus-within so keyboard
     users can also reach it).
   - Stop event propagation so clicking the pencil edits the search
     instead of just selecting it (handled in JS).
   - On the active row the row uses the dark ink background, so the
     pencil flips to mint-on-ink for contrast. */
.ed-sidebar-item-edit{
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ed-ink-3);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s, background .14s, color .14s, border-color .14s;
  padding: 0;
}
.ed-sidebar-item-edit svg{ width: 14px; height: 14px; }
.ed-sidebar-item{ position: relative; }
.ed-sidebar-item:hover .ed-sidebar-item-edit,
.ed-sidebar-item:focus-within .ed-sidebar-item-edit{
  opacity: 1;
  pointer-events: auto;
}
.ed-sidebar-item-edit:hover{
  background: var(--ed-paper);
  color: var(--ed-mint-ink);
  border-color: var(--ed-line);
}
.ed-sidebar-item.active .ed-sidebar-item-edit{
  color: rgba(250,247,242,0.55);
}
.ed-sidebar-item.active .ed-sidebar-item-edit:hover{
  background: rgba(255,255,255,0.08);
  color: var(--ed-mint-2);
  border-color: rgba(255,255,255,0.15);
}
/* When the row already has the unread-count badge on the right, push
   the pencil left so they don't overlap. The badge stays visible at all
   times; the pencil only appears on hover. */
.ed-sidebar-item:has(.ed-sidebar-badge):hover .ed-sidebar-item-edit,
.ed-sidebar-item:has(.ed-sidebar-badge):focus-within .ed-sidebar-item-edit{
  right: 46px;
}
.ed-sidebar-item-icon{
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--ed-paper-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--ed-ink-2);
  font-size: 14px;
  margin-top: 1px;
}
.ed-sidebar-item.active .ed-sidebar-item-icon{
  background: rgba(255,255,255,0.08);
  color: var(--ed-mint-2);
}
.ed-sidebar-item-body{ flex: 1; min-width: 0; }
.ed-sidebar-item-title{
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ed-sidebar-item-meta{
  font-size: 11px;
  color: var(--ed-ink-3);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Mint dot prefix on the meta line when there are unread ads.
   Matches the design's "● 3 nauji" pattern. */
.ed-sidebar-dot{
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ed-mint);
  display: inline-block;
  flex-shrink: 0;
}
.ed-sidebar-item.active .ed-sidebar-dot{
  background: var(--ed-mint-2);
}

/* Right-edge unread chip badge. Ink on paper for inactive rows;
   mint chip on the ink-filled active row to keep contrast. */
.ed-sidebar-badge{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--ed-ink);
  color: var(--ed-paper);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.2;
}
.ed-sidebar-item.active .ed-sidebar-badge{
  background: var(--ed-mint);
  color: var(--ed-ink);
}

/* Locked saved-search row (free user with searches over plan cap).
   Muted text so the row reads as inactive at a glance; the 🔒 takes the
   place of the house/flat/land icon on the left, while the unread chip
   on the right keeps showing the new-ad teaser. Click stays active - it
   opens the upgrade modal. */
.ed-sidebar-item.locked .ed-sidebar-item-title,
.ed-sidebar-item.locked .ed-sidebar-item-meta{
  opacity: 0.7;
}
.ed-sidebar-item.locked .ed-sidebar-item-title{
  font-weight: 400;
}
.ed-sidebar-item-icon.locked{
  background: var(--ed-paper-2);
  color: var(--ed-ink-3);
  font-size: 14px;
  line-height: 1;
}

/* Foot: plan card + user */
.ed-sidebar-foot{
  margin-top: auto;
  padding: 14px 14px 18px;
  border-top: 1px solid var(--ed-line-soft);
  flex-shrink: 0;
}
.ed-plan-card{
  padding: 12px;
  border-radius: 12px;
  background: var(--ed-paper-2);
  border: 1px solid var(--ed-line-soft);
}
.ed-plan-title{
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ed-ink-3);
  font-weight: 600;
}
.ed-plan-name{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 18px;
  font-weight: 500;
  margin-top: 2px;
  letter-spacing: -0.02em;
  color: var(--ed-ink);
}
.ed-plan-upgrade{
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ed-ink);
  color: var(--ed-paper);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: transform .12s;
}
.ed-plan-upgrade:hover{ transform: translateY(-1px); }
.ed-sidebar-user{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 0;
}
.ed-sidebar-avatar{
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--ed-mint-soft);
  color: var(--ed-mint-ink);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.ed-sidebar-email{
  font-size: 12px;
  color: var(--ed-ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/*════════════════════════════════════════════════════════════════════════════════
  EDITORIAL OVERRIDES: Price-history modal (popup + bottom sheet)
════════════════════════════════════════════════════════════════════════════════*/

/* Backdrop: warm ink wash instead of cool blue */
body.has-ed-sidebar .ph-backdrop,
.ph-backdrop {
  background: rgba(26, 24, 20, 0.32) !important;
}

/* Popup container: paper bg, warm line, soft shadow */
.ph-popup {
  width: 392px !important;
  max-height: none !important;
  background: var(--ed-paper) !important;
  border: 1px solid var(--ed-line) !important;
  border-radius: 14px !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow:
    0 18px 40px rgba(26, 24, 20, 0.16),
    0 6px 14px rgba(26, 24, 20, 0.06) !important;
  padding-bottom: 2px !important;
}
.ph-popup::before {
  background: var(--ed-paper) !important;
  border-color: var(--ed-line) !important;
}

/* Header: KAINOS ISTORIJA eyebrow */
.ph-popup .ph-header,
.ph-sheet .ph-header {
  padding: 16px 18px 8px !important;
}
.ph-popup .ph-title,
.ph-sheet .ph-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: var(--ed-ink-4) !important;
}
.ph-popup .ph-close,
.ph-sheet .ph-close {
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--ed-ink-3) !important;
  font-size: 22px !important;
  border: 1px solid transparent !important;
  transition: background .15s ease, color .15s ease !important;
}
.ph-popup .ph-close:hover,
.ph-sheet .ph-close:hover {
  background: var(--ed-paper-2) !important;
  color: var(--ed-ink) !important;
}

/* Summary: big serif price + delta pill */
.ph-popup .ph-summary,
.ph-sheet .ph-summary {
  padding: 0 18px 14px !important;
  align-items: baseline !important;
  gap: 12px !important;
}
.ph-popup .ph-current-price,
.ph-sheet .ph-current-price {
  font-family: Georgia, "Times New Roman", serif !important;
  font-optical-sizing: auto;
  font-size: 32px !important;
  font-weight: 500 !important;
  letter-spacing: -0.02em !important;
  color: var(--ed-ink) !important;
}
.ph-popup .ph-change-badge,
.ph-sheet .ph-change-badge {
  border-radius: 999px !important;
  padding: 4px 10px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  border: none !important;
}
.ph-popup .ph-change-badge.ph-decrease,
.ph-sheet .ph-change-badge.ph-decrease {
  background: var(--ed-mint-soft) !important;
  color: var(--ed-mint-ink) !important;
}
.ph-popup .ph-change-badge.ph-increase,
.ph-sheet .ph-change-badge.ph-increase {
  background: var(--ed-rose-soft) !important;
  color: var(--ed-rose) !important;
}
.ph-popup .ph-change-abs,
.ph-sheet .ph-change-abs {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  color: var(--ed-ink-4) !important;
  font-weight: 500 !important;
  font-size: 11px !important;
  letter-spacing: 0.02em !important;
}

/* Chart: mint/rose tones from the editorial palette */
.ph-popup .ph-chart-wrap,
.ph-sheet .ph-chart-wrap {
  padding: 4px 16px 6px !important;
}
.ph-popup .ph-chart-svg {
  height: 168px !important;
}
.ph-popup .ph-decrease .ph-step-line,
.ph-sheet .ph-decrease .ph-step-line {
  stroke: var(--ed-mint-ink) !important;
}
.ph-popup .ph-increase .ph-step-line,
.ph-sheet .ph-increase .ph-step-line {
  stroke: var(--ed-rose) !important;
}
.ph-popup .ph-decrease .ph-area-fill,
.ph-sheet .ph-decrease .ph-area-fill {
  fill: var(--ed-mint) !important;
  opacity: 0.18 !important;
}
.ph-popup .ph-increase .ph-area-fill,
.ph-sheet .ph-increase .ph-area-fill {
  fill: var(--ed-rose) !important;
  opacity: 0.16 !important;
}
.ph-popup .ph-decrease .ph-dot,
.ph-sheet .ph-decrease .ph-dot {
  fill: var(--ed-mint-ink) !important;
  stroke: var(--ed-paper) !important;
  filter: none !important;
}
.ph-popup .ph-increase .ph-dot,
.ph-sheet .ph-increase .ph-dot {
  fill: var(--ed-rose) !important;
  stroke: var(--ed-paper) !important;
  filter: none !important;
}
.ph-popup .ph-decrease .ph-dot-today,
.ph-sheet .ph-decrease .ph-dot-today {
  fill: var(--ed-mint-ink) !important;
  stroke: var(--ed-paper) !important;
  filter: drop-shadow(0 0 6px color-mix(in oklab, var(--ed-mint-ink) 50%, transparent)) !important;
}
.ph-popup .ph-increase .ph-dot-today,
.ph-sheet .ph-increase .ph-dot-today {
  fill: var(--ed-rose) !important;
  stroke: var(--ed-paper) !important;
  filter: drop-shadow(0 0 6px color-mix(in oklab, var(--ed-rose) 45%, transparent)) !important;
}
.ph-popup .ph-change-line,
.ph-sheet .ph-change-line {
  stroke: var(--ed-line) !important;
  opacity: 0.55 !important;
}
.ph-popup .ph-price-label,
.ph-sheet .ph-price-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-weight: 500 !important;
  font-size: 10.5px !important;
  letter-spacing: 0.02em !important;
}
.ph-popup .ph-price-label.ph-label-old,
.ph-sheet .ph-price-label.ph-label-old { fill: var(--ed-ink-4) !important; }
.ph-popup .ph-price-label.ph-label-new,
.ph-sheet .ph-price-label.ph-label-new { fill: var(--ed-ink) !important; }

/* X-axis date labels */
.ph-popup .ph-dates,
.ph-sheet .ph-dates {
  padding: 2px 18px 8px !important;
}
.ph-popup .ph-date-label,
.ph-sheet .ph-date-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--ed-ink-4) !important;
}

/* Footer: stats row (Pokyčių / Max / Min) */
.ph-popup .ph-footer,
.ph-sheet .ph-footer {
  padding: 12px 18px 14px !important;
  border-top: 1px solid var(--ed-line-soft) !important;
  gap: 16px !important;
  justify-content: flex-start !important;
}
.ph-popup .ph-stat,
.ph-sheet .ph-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
}
.ph-popup .ph-stat-label,
.ph-sheet .ph-stat-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
  color: var(--ed-ink-4);
  font-weight: 500;
}
.ph-popup .ph-stat-value,
.ph-sheet .ph-stat-value {
  color: var(--ed-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Loading + error + empty states: warm tones */
.ph-popup .ph-loading-spinner,
.ph-sheet .ph-loading-spinner {
  border-color: var(--ed-paper-2) !important;
  border-top-color: var(--ed-mint-ink) !important;
}
.ph-popup .ph-loading-text,
.ph-sheet .ph-loading-text,
.ph-popup .ph-error-text,
.ph-sheet .ph-error-text,
.ph-popup .ph-empty-text,
.ph-sheet .ph-empty-text {
  color: var(--ed-ink-3) !important;
}

/* Mobile sheet: editorial paper */
@media (max-width: 767px) {
  .ph-sheet {
    background: var(--ed-paper) !important;
    border: 1px solid var(--ed-line) !important;
    border-bottom: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 -16px 40px rgba(26, 24, 20, 0.18) !important;
  }
  .ph-sheet-handle {
    background: var(--ed-line) !important;
  }
  .ph-sheet .ph-current-price {
    font-size: 28px !important;
  }
  .ph-sheet .ph-chart-svg {
    height: 180px !important;
  }
}

/*════════════════════════════════════════════════════════════════════════════════
  EDITORIAL SEARCH FORM (#cardCreate.sc-form): hero, stepper, sections,
  category tiles, range/chips, advanced accordion, frequency pills,
  notification cards, footer.
════════════════════════════════════════════════════════════════════════════════*/

body.has-ed-sidebar #cardCreate.sc-form,
.sc-form{
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  border-radius: 20px;
  overflow: hidden;
  padding: 0;
}

/* Hero block */
.sc-form .sc-hero{
  padding: 22px 24px;
  border-bottom: 1px solid var(--ed-line-soft);
  background: linear-gradient(180deg, var(--ed-paper) 0%, var(--ed-paper) 60%, color-mix(in oklab, var(--ed-paper-3) 30%, transparent) 100%);
}
.sc-form .sc-eyebrow{
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ed-mint-ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sc-form .sc-h1{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 26px;
  letter-spacing: -0.025em;
  margin: 6px 0 0;
  font-weight: 500;
  line-height: 1.18;
  color: var(--ed-ink);
}
.sc-form .sc-sub{
  font-size: 13px;
  color: var(--ed-ink-3);
  margin: 6px 0 0;
  max-width: 56ch;
  line-height: 1.5;
}

/* Stepper */
.sc-form .sc-stepper{
  display: flex;
  border-bottom: 1px solid var(--ed-line-soft);
  background: var(--ed-paper-2);
}
.sc-form .sc-step{
  flex: 1;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ed-ink-3);
  border-right: 1px solid var(--ed-line-soft);
  cursor: pointer;
  transition: background .12s;
}
.sc-form .sc-step:last-child{ border-right: none; }
.sc-form .sc-step:hover{ background: var(--ed-paper); }
.sc-form .sc-step .n{
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ed-ink-3);
}
.sc-form .sc-step.done .n{
  background: var(--ed-mint);
  color: var(--ed-ink);
  border-color: var(--ed-mint);
}
.sc-form .sc-step.current{ color: var(--ed-ink); background: var(--ed-paper); }
.sc-form .sc-step.current .n{
  background: var(--ed-ink);
  color: var(--ed-paper);
  border-color: var(--ed-ink);
}

/* Sections */
.sc-form .sc-section{
  padding: 20px 24px;
  border-bottom: 1px solid var(--ed-line-soft);
}
.sc-form .sc-section:last-of-type{ border-bottom: none; }
.sc-form .sec-head{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.sc-form .sec-num{
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--ed-ink);
  color: var(--ed-paper);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  flex-shrink: 0;
}
.sc-form .sc-section.done .sec-num{
  background: var(--ed-mint);
  color: var(--ed-ink);
}
.sc-form .sec-title{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 18px;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--ed-ink);
}
.sc-form .sec-summary{
  font-size: 12px;
  color: var(--ed-ink-3);
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  max-width: 50%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-form .sec-hint{
  font-size: 12px;
  color: var(--ed-ink-3);
  margin: -4px 0 14px;
  line-height: 1.5;
}

/* Field + input */
.sc-form .field{ margin-bottom: 14px; }
.sc-form .field-label{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ed-ink-2);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.sc-form .field-label .fl-i{
  width: 13px;
  height: 13px;
  color: var(--ed-ink-4);
}
.sc-form .field-label .opt{
  color: var(--ed-ink-4);
  font-weight: 400;
  margin-left: 4px;
}
.sc-form .input,
.sc-form input[type="text"],
.sc-form input[type="number"],
.sc-form input[type="tel"],
.sc-form select{
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: var(--ed-paper);
  font-size: 13px;
  color: var(--ed-ink);
  transition: border-color .12s, box-shadow .12s;
  font-family: inherit;
}
.sc-form .input:focus,
.sc-form input:focus,
.sc-form select:focus{
  outline: none;
  border-color: var(--ed-ink);
  box-shadow: 0 0 0 3px rgba(26,24,20,0.06);
}
.sc-form .input-lg{
  padding: 14px 16px;
  font-size: 15px;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.01em;
}

/* Range row (price/area/rooms-range/floors-range) */
.sc-form .range-row{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}
.sc-form .range-dash{ color: var(--ed-ink-4); font-size: 14px; text-align: center; }

/* Chips */
.sc-form .chips{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.sc-form .chip{
  padding: 7px 12px;
  border: 1px solid var(--ed-line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ed-ink-2);
  background: var(--ed-paper);
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.sc-form .chip:hover{ border-color: var(--ed-ink-4); }
.sc-form .chip.on,
.sc-form .chip.is-on,
.sc-form .chip.active,
.sc-form .chip:has(input[type="checkbox"]:checked){
  background: var(--ed-ink);
  color: var(--ed-paper);
  border-color: var(--ed-ink);
}
.sc-form .chip.mini{
  padding: 4px 10px;
  font-size: 11px;
  border: none;
  background: transparent;
  color: var(--ed-ink-4);
}
.sc-form .chip.mini:hover{ color: var(--ed-ink); background: var(--ed-paper-2); }

/* Category tiles (5 across desktop, 2 across mobile) */
.sc-form .catgrid{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
@media (max-width: 900px){
  .sc-form .catgrid{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px){
  .sc-form .catgrid{ grid-template-columns: repeat(2, 1fr); }
}
.sc-form .cat{
  border: 1px solid var(--ed-line);
  background: var(--ed-paper);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all .14s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ed-ink);
  font-family: inherit;
}
.sc-form .cat:hover{ border-color: var(--ed-ink-4); }
.sc-form .cat.on{
  border-color: var(--ed-ink);
  background: var(--ed-ink);
  color: var(--ed-paper);
}
.sc-form .cat .cicon{
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ed-paper-2);
  display: grid;
  place-items: center;
  color: var(--ed-ink-2);
  transition: all .14s;
}
.sc-form .cat .cicon svg{ width: 18px; height: 18px; }
.sc-form .cat.on .cicon{
  background: rgba(255,255,255,0.08);
  color: var(--ed-mint-2);
}
.sc-form .cat-label{ font-size: 12px; font-weight: 500; }
.sc-form .cat-sub{
  font-size: 10px;
  color: var(--ed-ink-4);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.sc-form .cat.on .cat-sub{ color: rgba(250,247,242,0.55); }

/* Advanced accordion */
.sc-form .advanced{
  margin-top: 8px;
  border: 1px solid var(--ed-amber);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--ed-amber-soft) 0%, var(--ed-paper-2) 100%);
  overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--ed-amber) 22%, transparent);
}
.sc-form .adv-head{
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ed-ink);
}
.sc-form .adv-head:hover{ background: var(--ed-amber-soft); }
.sc-form .adv-head .caret{
  margin-left: 0;
  transition: transform .18s;
  color: var(--ed-ink-3);
}
.sc-form .advanced[aria-expanded="true"] .adv-head .caret,
.sc-form .advanced.open .adv-head .caret{ transform: rotate(90deg); }
.sc-form .adv-body{
  padding: 16px;
  background: var(--ed-paper);
  border-top: 1px solid color-mix(in oklab, var(--ed-amber) 35%, transparent);
}
/* Hide adv-body when accordion collapsed */
.sc-form .advanced[aria-expanded="false"] .adv-body{ display: none; }
.sc-form .adv-max{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  color: var(--ed-ink);
  background: var(--ed-amber);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-left: auto;
}

/* Premium filters inner content (preserved IDs - just spacing tweaks) */
.sc-form #premiumFiltersContent .box{
  background: transparent;
  border: 0;
  padding: 0;
  margin-bottom: 14px;
}
.sc-form #premiumFiltersContent .box:last-child{ margin-bottom: 0; }
.sc-form #premiumFiltersContent label > strong{
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--ed-ink-2);
  display: block;
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}

/* Frequency pills */
.sc-form .freq-row{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sc-form .freq{
  padding: 8px 14px;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: var(--ed-paper);
  color: var(--ed-ink-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  cursor: pointer;
  transition: all .12s;
  font-family: inherit;
}
.sc-form .freq:hover{ border-color: var(--ed-ink-4); }
.sc-form .freq.on{
  background: var(--ed-ink);
  color: var(--ed-paper);
  border-color: var(--ed-ink);
}
.sc-form .freq .fv{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 15px;
  letter-spacing: -0.01em;
  font-weight: 500;
}
.sc-form .freq .fu{
  font-size: 10px;
  color: var(--ed-ink-4);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.sc-form .freq.on .fu{ color: rgba(250,247,242,0.6); }
.sc-form .freq.locked{ opacity: 0.45; cursor: not-allowed; }

/* Inline "Other" frequency input */
.sc-form .freq-other-input{
  display: none;
  margin-top: 8px;
  align-items: center;
  gap: 8px;
}
.sc-form .freq-other-input.is-open{ display: flex; }
.sc-form .freq-other-input input{
  width: 100px;
  padding: 8px 10px;
  border: 1px solid var(--ed-line);
  border-radius: 8px;
  background: var(--ed-paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.sc-form .freq-other-input span{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--ed-ink-4);
}

/* Notification cards (4-grid + price-change full-width) */
.sc-form .noti-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
@media (max-width: 720px){
  .sc-form .noti-grid{ grid-template-columns: 1fr; }
}
/* Price-change card sits outside .noti-grid so it would otherwise span
   the full form width. Constrain it to one grid-column width and centre
   it under the "Papildomai" label so it lines up visually with the
   other notification channel cards. Falls back to full width on mobile
   (matching the grid's 1-column collapse). */
.sc-form #channelPriceChangeWrap{
  max-width: calc(50% - 5px);
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 720px){
  .sc-form #channelPriceChangeWrap{ max-width: 100%; }
}
.sc-form .noti{
  position: relative;
  border: 1px solid var(--ed-line);
  border-radius: 14px;
  padding: 14px;
  background: var(--ed-paper);
  cursor: pointer;
  transition: all .14s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 110px;
}
.sc-form .noti:hover{ border-color: var(--ed-ink-4); }
.sc-form .noti.on{
  border-color: var(--ed-ink);
  background: var(--ed-paper);
  box-shadow: 0 0 0 3px rgba(26,24,20,0.05);
}
.sc-form .noti.locked{ opacity: 0.55; cursor: not-allowed; }
.sc-form .noti-head{
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.sc-form .noti-icon{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ed-paper-2);
  display: grid;
  place-items: center;
  color: var(--ed-ink-2);
  flex-shrink: 0;
}
.sc-form .noti.on .noti-icon{
  background: var(--ed-mint-soft);
  color: var(--ed-mint-ink);
}
.sc-form .noti-title{
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ed-ink);
}
.sc-form .noti-desc{
  font-size: 11px;
  color: var(--ed-ink-3);
  line-height: 1.4;
  margin-top: 2px;
}
.sc-form .noti-toggle{ flex-shrink: 0; }
.sc-form .noti-badge-row{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sc-form .noti-badge-row .adv-max{ margin-left: 0; }
.sc-form .tg{
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: var(--ed-line);
  position: relative;
  transition: all .18s;
  display: inline-block;
}
.sc-form .tg::after{
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ed-paper);
  top: 2px;
  left: 2px;
  transition: all .18s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.sc-form .noti.on .tg{ background: var(--ed-ink); }
.sc-form .noti.on .tg::after{ left: 14px; }
.sc-form .noti-footer{
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--ed-line-soft);
  font-size: 11px;
  color: var(--ed-ink-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sc-form .noti-meta{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--ed-ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Inline "Testas" button on the browser-push card so users can prove a
   real desktop notification fires after enabling the toggle. Mirrors the
   .btn-link visual but kept compact so it fits on the same row as the
   status text. Hidden when the test isn't possible (no permission, no
   subscription, or per-search push_enabled is off). */
.sc-form .noti-test-btn{
  flex: 0 0 auto;
  padding: 4px 10px;
  height: auto;
  border: 1px solid var(--ed-line);
  border-radius: 999px;
  background: transparent;
  color: var(--ed-ink-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  width: auto;
}
.sc-form .noti-test-btn:hover{
  background: var(--ed-mint-soft);
  color: var(--ed-mint-ink);
  border-color: var(--ed-mint);
}
.sc-form .noti-test-btn:disabled,
.sc-form .noti-test-btn[hidden]{
  opacity: 0.4;
  pointer-events: none;
}
.sc-form .pc-threshold-input-row{
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Footer */
.sc-form .sc-foot{
  padding: 18px 24px;
  background: var(--ed-paper-2);
  border-top: 1px solid var(--ed-line-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sc-form .sc-foot .btn{
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.005em;
  transition: all .14s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.sc-form .sc-foot .btn-primary{ background: var(--ed-ink); color: var(--ed-paper); }
.sc-form .sc-foot .btn-primary:hover:not(:disabled){
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -8px rgba(26,24,20,0.4);
}
.sc-form .sc-foot .btn-primary:disabled{ opacity: 0.4; cursor: not-allowed; }
.sc-form .sc-foot .btn-ghost{ background: transparent; color: var(--ed-ink-2); }
.sc-form .sc-foot .btn-ghost:hover{ background: var(--ed-paper-3); }
.sc-form .sc-foot .btn-danger{
  background: transparent;
  color: var(--ed-rose);
  margin-left: auto;
}
.sc-form .sc-foot .btn-danger:hover:not(:disabled){ background: var(--ed-rose-soft); }
.sc-form .sc-foot-plan{
  margin-left: auto;
  font-size: 11px;
  color: var(--ed-ink-4);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}
/* When delete is also present, plan goes between ghost and delete */
.sc-form .sc-foot:has(#btnDeleteSearch:not([hidden])) .sc-foot-plan{ margin-left: auto; }
.sc-form .sc-foot:has(#btnDeleteSearch:not([hidden])) .btn-danger{ margin-left: 0; }

/*════════════════════════════════════════════════════════════════════════════════
  EDITORIAL FOCUS MODE: when create/edit form is open, dim other surfaces
  - Hide market median (it's noise while configuring)
  - Widen the form column, narrow the preview column
════════════════════════════════════════════════════════════════════════════════*/

/* Hide market median when the form is visible */
body:has(#cardCreate:not(.hidden)) #marketMedianPanel{
  display: none !important;
}

/* Form-focused layout: form takes the bulk of the width, preview shrinks */
@media (min-width: 1100px){
  .main:has(#cardCreate:not(.hidden)){
    grid-template-columns: minmax(560px, 1.7fr) minmax(320px, 1fr) !important;
    gap: 18px !important;
  }
  #cardCreate:not(.hidden) ~ #cardPreview{
    max-width: none !important;
    min-width: 320px;
  }
}
@media (min-width: 1400px){
  .main:has(#cardCreate:not(.hidden)){
    grid-template-columns: minmax(620px, 1.8fr) minmax(340px, 460px) !important;
  }
  #cardCreate:not(.hidden) ~ #cardPreview{
    max-width: 460px !important;
    min-width: 340px;
  }
}
@media (min-width: 1600px){
  .main:has(#cardCreate:not(.hidden)){
    grid-template-columns: minmax(720px, 1.8fr) minmax(360px, 480px) !important;
  }
  #cardCreate:not(.hidden) ~ #cardPreview{
    max-width: 480px !important;
  }
}

/* Override the legacy max-width / min-width caps when the editorial form is
   open so the grid template above can actually take effect. */
.main > #cardCreate.sc-form:not(.hidden){
  max-width: none !important;
  min-width: 0 !important;
}
@media (min-width: 1100px){
  .main:has(#cardCreate.sc-form:not(.hidden)) > #cardPreview{
    min-width: 0 !important;
  }
}
@media (min-width: 1400px){
  .main:has(#cardCreate.sc-form:not(.hidden)) > #cardPreview{
    min-width: 0 !important;
    max-width: 460px !important;
  }
}
@media (min-width: 1600px){
  .main:has(#cardCreate.sc-form:not(.hidden)) > #cardPreview{
    min-width: 0 !important;
    max-width: 480px !important;
  }
}

/* Override the legacy global `input,select,button { width: 100% }` rule for
   the editorial form so frequency pills, category tiles, and footer buttons
   sit horizontally at their natural width instead of stretching full-row. */
.sc-form .freq,
.sc-form .cat,
.sc-form .sc-foot .btn{
  width: auto;
}

/* Notifications topbar chip (sibling of the Redaguoti chip): teal accent
   when the active search has any notification type enabled. Visually
   reuses the same .ed-tabs-chip baseline, but flips colors when "active". */
.ed-tabs-chip.has-active-notifs{
  background: var(--ed-mint-soft);
  color: var(--ed-mint-ink);
  border-color: var(--ed-mint);
}
.ed-tabs-chip.has-active-notifs:hover{
  background: var(--ed-mint);
  color: var(--ed-paper);
}
.ed-tabs-chip.has-active-notifs svg{
  stroke: currentColor;
}
.ed-tabs-chip.disabled,
.ed-tabs-chip[disabled]{ opacity: 0.45; cursor: not-allowed; }

/* SMS card footer hosts three states (default text + inline phone setup
   + masked phone display). They share the footer row; only one shows at
   a time (toggled by syncSmsCardFooter()). */
.sc-form .noti-footer-sms{
  flex-wrap: wrap;
  gap: 8px;
}
.sc-form .noti-footer-sms .sms-phone-inline,
.sc-form .noti-footer-sms .sms-phone-display{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}
.sc-form .noti-footer-sms .sms-phone-prefix{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--ed-ink-3);
  /* Override the global .sms-phone-prefix rule that paints the prefix
     white with a light-blue border; inside the editorial SMS card we
     want it to match the cream-paper input next to it. */
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  padding: 6px 8px;
  border-radius: 6px;
}
.sc-form .noti-footer-sms input[type="tel"]{
  width: auto;
  flex: 1 1 100px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border: 1px solid var(--ed-line);
  border-radius: 6px;
  background: var(--ed-paper);
}
.sc-form .noti-footer-sms .sms-phone-number{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--ed-ink);
}
.sc-form .noti-footer-sms .btn-link{
  font-size: 11px;
  color: var(--ed-mint-ink);
  background: transparent;
  border: 0;
  padding: 2px 4px;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-decoration: underline;
}
.sc-form .noti-footer-sms .btn-link:hover{ color: var(--ed-ink); }

/*════════════════════════════════════════════════════════════════════════════════
  EDITORIAL SMS card footer polish (overrides legacy mint-green link style).
  - Strip the card-within-card green block; use a single quiet inline row.
  - Phone number in JBMono, ink-2.
  - Pašalinti / Testas as small mint-ink / rose pills, no underline.
════════════════════════════════════════════════════════════════════════════════*/

/* Container resets: kill the legacy green block + spacing. */
.sc-form .noti-footer-sms .sms-phone-display{
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin-top: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap;
  width: 100%;
}
/* The two display-flex !important rules above and on .sms-phone-inline win
   over the global .hidden { display: none !important } because they're more
   specific (3 classes vs 1). Re-assert hidden at matching specificity so
   toggling .hidden actually hides the inline phone-entry / phone-display
   blocks instead of leaving them visible. */
.sc-form .noti-footer-sms .sms-phone-inline.hidden,
.sc-form .noti-footer-sms .sms-phone-display.hidden{
  display: none !important;
}

/* Phone number: ink-2, JBMono. */
.sc-form .noti-footer-sms .sms-phone-number{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--ed-ink-2) !important;
  letter-spacing: 0.04em;
  flex: 1 1 auto;
  min-width: 0;
}

/* Pill-style action buttons inside the SMS footer. */
.sc-form .noti-footer-sms .btn-link{
  width: auto !important;             /* override legacy `button { width:100% }` */
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  background: var(--ed-paper-2) !important;
  color: var(--ed-ink-3) !important;
  border: 1px solid var(--ed-line-soft) !important;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  flex: 0 0 auto;
}
.sc-form .noti-footer-sms .btn-link:hover{
  background: var(--ed-mint-soft) !important;
  color: var(--ed-mint-ink) !important;
  border-color: var(--ed-mint) !important;
}
/* The destructive "Pašalinti" button: mute → rose on hover. */
.sc-form .noti-footer-sms #btnRemovePhoneInline{
  color: var(--ed-ink-3) !important;
}
.sc-form .noti-footer-sms #btnRemovePhoneInline:hover{
  background: var(--ed-rose-soft) !important;
  color: var(--ed-rose) !important;
  border-color: var(--ed-rose) !important;
}

/* Test-status feedback inline (e.g. "Sent ✓"). */
.sc-form .noti-footer-sms .sms-test-status{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 10px !important;
  color: var(--ed-mint-ink) !important;
  letter-spacing: 0.02em;
}

/* Inline phone setup (when SMS is on but no phone on file). */
.sc-form .noti-footer-sms .sms-phone-inline{
  background: var(--ed-paper-2);
  border: 1px solid var(--ed-line-soft);
  border-radius: 10px;
  padding: 8px 10px;
}
.sc-form .noti-footer-sms .sms-phone-inline input[type="tel"]{
  background: var(--ed-paper) !important;
}

/*════════════════════════════════════════════════════════════════════════════════
  EDITORIAL POLISH BATCH — banner hide, footer alignment, compact icon button,
  modern range slider, bell modal
════════════════════════════════════════════════════════════════════════════════*/

/* "Naujiena: NTAlert mobile app" hint banner is noise while editing. */
body:has(#cardCreate:not(.hidden)) #edHintBanner{
  display: none !important;
}

/* Equalize the noti-card footer height so the dashed top-borders align
   across cards in the same row. The footer is anchored bottom via
   margin-top:auto, so a fixed min-height is enough — the dashed line
   then sits at a consistent y across both cards. */
.sc-form .noti-footer{
  min-height: 30px;
}

/* Compact icon-only button (used for the SMS "Pašalinti" X). */
.sc-form .noti-footer-sms .btn-link.btn-icon{
  width: 26px !important;
  height: 22px !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.sc-form .noti-footer-sms .btn-link.btn-icon svg{ display: block; }

/* Modern range slider (water/centre distance + any other range inputs in
   the editorial form). Thin paper-2 track + black thumb, à la the design.
   `appearance: none` is required to escape the OS chrome. */
.sc-form input[type="range"]{
  -webkit-appearance: none;
  appearance: none;
  width: 100% !important;
  height: 22px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  outline: none;
  cursor: pointer;
}
/* Track: thin warm rule */
.sc-form input[type="range"]::-webkit-slider-runnable-track{
  height: 2px;
  background: var(--ed-line);
  border-radius: 2px;
}
.sc-form input[type="range"]::-moz-range-track{
  height: 2px;
  background: var(--ed-line);
  border-radius: 2px;
  border: 0;
}
/* Thumb: solid ink circle */
.sc-form input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ed-ink);
  border: 0;
  margin-top: -7px;       /* center on 2px track */
  box-shadow: 0 1px 3px rgba(26,24,20,0.25);
  cursor: grab;
  transition: transform .12s ease;
}
.sc-form input[type="range"]::-webkit-slider-thumb:active{ cursor: grabbing; transform: scale(1.08); }
.sc-form input[type="range"]::-moz-range-thumb{
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ed-ink);
  border: 0;
  box-shadow: 0 1px 3px rgba(26,24,20,0.25);
  cursor: grab;
}
.sc-form input[type="range"]::-moz-range-thumb:active{ cursor: grabbing; }
.sc-form input[type="range"]:focus-visible::-webkit-slider-thumb{
  box-shadow: 0 0 0 4px var(--ed-mint-soft), 0 1px 3px rgba(26,24,20,0.25);
}

/* Slider value display: uppercase JBMono caption above the track. */
.sc-form .slider-container .slider-value-display{
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ed-ink-4);
}
.sc-form .slider-container .slider-value-number{
  color: var(--ed-ink-2);
  font-weight: 500;
}

/*── Bell modal ────────────────────────────────────────────────────────────*/
.bell-modal{
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 80px 24px 24px;
  pointer-events: none;
}
.bell-modal:not(.hidden){ pointer-events: auto; }
.bell-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(26,24,20,0.32);
  opacity: 0;
  transition: opacity .2s ease;
}
.bell-modal.open .bell-modal-backdrop{ opacity: 1; }
.bell-modal-panel{
  position: relative;
  width: 360px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 110px);
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(26,24,20,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
}
.bell-modal.open .bell-modal-panel{ transform: translateY(0); opacity: 1; }
.bell-modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--ed-line-soft);
}
.bell-modal-eyebrow{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ed-ink-4);
  font-weight: 500;
}
.bell-modal-close{
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--ed-ink-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  width: auto;
  min-width: 26px;
}
.bell-modal-close:hover{ background: var(--ed-paper-2); color: var(--ed-ink); }
.bell-modal-new{
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 14px 8px;
  padding: 10px 12px;
  background: var(--ed-paper-2);
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ed-ink);
  width: auto;
  transition: background .12s, border-color .12s;
  font-family: inherit;
}
.bell-modal-new:hover{ background: var(--ed-paper); border-color: var(--ed-ink-4); }
.bell-modal-list{
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  flex: 1 1 auto;
  padding: 0 6px 12px;
}
.bell-modal-empty{
  text-align: center;
  padding: 24px 16px;
  color: var(--ed-ink-3);
  font-size: 12px;
}
.bell-modal-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: 100%;
  transition: background .12s;
  position: relative;
}
.bell-modal-item:hover{ background: var(--ed-paper-2); }
.bell-modal-item.active{ background: var(--ed-ink); color: var(--ed-paper); }
.bell-modal-item.active .bell-modal-item-meta{ color: rgba(250,247,242,0.6); }
.bell-modal-item-icon{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ed-paper-2);
  color: var(--ed-ink-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.bell-modal-item.active .bell-modal-item-icon{ background: rgba(255,255,255,0.08); color: var(--ed-mint-2); }
.bell-modal-item-icon svg{ width: 16px; height: 16px; }

/* Locked saved-search row in the bell modal - mirrors the sidebar
   treatment: 🔒 in place of the type icon, muted text, click opens
   the upgrade modal. The unread chip on the right keeps showing. */
.bell-modal-item.locked .bell-modal-item-title,
.bell-modal-item.locked .bell-modal-item-meta{
  opacity: 0.7;
}
.bell-modal-item.locked .bell-modal-item-title{
  font-weight: 400;
}
.bell-modal-item-icon.locked{
  font-size: 14px;
  line-height: 1;
  color: var(--ed-ink-3);
}
.bell-modal-item-body{
  flex: 1 1 auto;
  min-width: 0;
}
.bell-modal-item-title{
  font-size: 13px;
  font-weight: 500;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bell-modal-item-meta{
  margin-top: 2px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ed-ink-4);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}
.bell-modal-dot{
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ed-mint-ink);
  display: inline-block;
  flex-shrink: 0;
}
.bell-modal-badge{
  background: var(--ed-ink);
  color: var(--ed-paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.bell-modal-item.active .bell-modal-badge{
  background: var(--ed-mint-ink);
  color: var(--ed-paper);
}

/*════════════════════════════════════════════════════════════════════════════════
  EDITORIAL: Market median panel — loading scaffold (data-state="loading")
  Mirrors the data state's structure so layout doesn't shift when real data
  lands. Dimmed toggles, breathing em-dashes for KPIs, faint dashed baseline
  + 3 mint-ink ghost dots pulsing in sequence for the chart. No spinner, no
  shimmer — calm "FPO" placeholder in the editorial register.
════════════════════════════════════════════════════════════════════════════════*/

.med-panel[data-state="loading"] .med-toggle-loading{
  opacity: 0.35;
  pointer-events: none;
}
.med-panel[data-state="loading"] .med-toggle-loading button{
  cursor: default;
}

.med-panel[data-state="loading"] .med-title-loading{
  /* Reserve the same vertical room as the real Fraunces title so the
     header doesn't bounce when data arrives. */
  min-height: 1.18em;
  display: flex;
  align-items: center;
}
.med-panel[data-state="loading"] .med-loading-ellipsis{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--ed-ink-4);
  font-weight: 500;
  animation: med-breathe 1.6s ease-in-out infinite;
}

.med-panel[data-state="loading"] .med-loading-num{
  color: var(--ed-ink-4);
  animation: med-breathe 1.6s ease-in-out infinite;
}

.med-panel[data-state="loading"] .med-svg-loading{
  height: 140px;
}

.med-loading-dot{
  opacity: 0.2;
  animation: med-dot-pulse 1.2s ease-in-out infinite;
}

@keyframes med-breathe {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 0.85; }
}

/* SVG circle r animation: directly animating the `r` attribute is
   well-supported in modern browsers via CSS (matches the existing
   ph-popup dot-pop pattern). The opacity ramp accompanies the size
   ramp so each dot "breathes" rather than blinks. */
@keyframes med-dot-pulse {
  0%, 100% { opacity: 0.2;  r: 2;   }
  50%      { opacity: 0.65; r: 3.2; }
}

@media (prefers-reduced-motion: reduce){
  .med-panel[data-state="loading"] .med-loading-ellipsis,
  .med-panel[data-state="loading"] .med-loading-num,
  .med-panel[data-state="loading"] .med-loading-dot{
    animation: none;
  }
  .med-panel[data-state="loading"] .med-loading-ellipsis,
  .med-panel[data-state="loading"] .med-loading-num{
    opacity: 0.65;
  }
  .med-panel[data-state="loading"] .med-loading-dot{
    opacity: 0.4;
  }
}

/*════════════════════════════════════════════════════════════════════════════════
  EDITORIAL: Sidebar plan card — expanded layout with frequency + price
  + dynamic upgrade CTA (or manage link for top-tier users), plus a gear
  icon next to the email row that opens the profile-edit modal.
════════════════════════════════════════════════════════════════════════════════*/

.ed-plan-card-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.ed-plan-card-head .ed-plan-title{
  /* re-using existing .ed-plan-title typography (uppercase JBMono caption) */
}
.ed-plan-price{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--ed-ink-3);
  font-weight: 500;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.ed-plan-freq{
  margin-top: 4px;
  font-size: 11px;
  color: var(--ed-ink-3);
  letter-spacing: -0.005em;
}
.ed-plan-freq:empty{ display: none; }

/* Manage-subscription link sits below the upgrade slot for top-tier users.
   Quieter visual register — it's not a primary action. */
.ed-plan-manage{
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--ed-ink-3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  border: 1px solid var(--ed-line-soft);
  transition: background .12s, color .12s, border-color .12s;
}
.ed-plan-manage:hover{
  background: var(--ed-paper);
  color: var(--ed-ink);
  border-color: var(--ed-line);
}
.ed-plan-manage.hidden,
.ed-plan-upgrade.hidden{ display: none !important; }

/* Gear icon next to the email row — same footprint as .ed-hint-close pattern. */
.ed-sidebar-foot-btn{
  width: 28px !important;     /* override the legacy `button { width:100% }` global */
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--ed-ink-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background .12s, color .12s;
}
.ed-sidebar-foot-btn:hover{
  background: var(--ed-paper);
  color: var(--ed-ink);
}
.ed-sidebar-foot-btn svg{ width: 15px; height: 15px; display: block; }

/*════════════════════════════════════════════════════════════════════════════════
  EDITORIAL: Profile edit modal — opened by sidebar gear button.
  Templated on .bell-modal: paper bg, --ed-line border, JBMono eyebrow,
  centered overlay (vs bell modal's right-aligned position). Three sections
  stacked, each with its own Save button. Danger zone uses rose accents.
════════════════════════════════════════════════════════════════════════════════*/
.profile-modal{
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  pointer-events: none;
}
.profile-modal:not(.hidden){ pointer-events: auto; }
.profile-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(26,24,20,0.40);
  opacity: 0;
  transition: opacity .2s ease;
}
.profile-modal.open .profile-modal-backdrop{ opacity: 1; }
.profile-modal-panel{
  position: relative;
  width: 560px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 64px);
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(26,24,20,0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform .22s cubic-bezier(0.4,0,0.2,1), opacity .22s ease;
}
.profile-modal.open .profile-modal-panel{
  transform: translateY(0) scale(1);
  opacity: 1;
}

.profile-modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--ed-line-soft);
  flex-shrink: 0;
}
.profile-modal-eyebrow{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ed-ink-4);
  font-weight: 500;
}
.profile-modal-close{
  width: auto !important;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--ed-ink-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background .12s, color .12s;
}
.profile-modal-close:hover{ background: var(--ed-paper-2); color: var(--ed-ink); }

.profile-modal-body{
  overflow-y: auto;
  padding: 8px 0 18px;
  flex: 1 1 auto;
}

.profile-section{
  padding: 16px 22px;
  border-bottom: 1px solid var(--ed-line-soft);
}
.profile-section:last-child{ border-bottom: none; }
.profile-section-title{
  font-family: Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ed-ink);
  margin: 0 0 14px;
}

.profile-field{ margin-bottom: 12px; }
.profile-field:last-child{ margin-bottom: 0; }
.profile-field-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 520px){
  .profile-field-row{ grid-template-columns: 1fr; }
}
.profile-label{
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ed-ink-2);
  margin-bottom: 5px;
  letter-spacing: -0.005em;
}
.profile-input{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: var(--ed-paper);
  font-size: 13px;
  color: var(--ed-ink);
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.profile-input:focus{
  outline: none;
  border-color: var(--ed-ink);
  box-shadow: 0 0 0 3px rgba(26,24,20,0.06);
}
.profile-input:disabled{
  background: var(--ed-paper-2);
  color: var(--ed-ink-3);
  cursor: not-allowed;
}

.profile-phone-row{
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: var(--ed-paper);
  overflow: hidden;
}
.profile-phone-row .profile-phone-prefix{
  display: grid;
  place-items: center;
  padding: 0 10px;
  background: var(--ed-paper-2);
  color: var(--ed-ink-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  border-right: 1px solid var(--ed-line);
  flex-shrink: 0;
}
.profile-phone-row .profile-input{
  border: 0;
  border-radius: 0;
  background: transparent;
}
.profile-phone-row:focus-within{
  border-color: var(--ed-ink);
  box-shadow: 0 0 0 3px rgba(26,24,20,0.06);
}

.profile-hint{
  font-size: 11px;
  color: var(--ed-ink-4);
  margin-top: 6px;
  line-height: 1.4;
}
.profile-hint-danger{ color: var(--ed-rose); }

.profile-section-foot{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.profile-status{
  flex: 1 1 auto;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ed-ink-4);
  letter-spacing: 0.02em;
}
.profile-status.is-ok    { color: var(--ed-mint-ink); }
.profile-status.is-error { color: var(--ed-rose); }

/* Buttons */
.profile-btn{
  width: auto !important;     /* override legacy `button { width:100% }` */
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: background .12s, color .12s, border-color .12s, transform .06s;
}
.profile-btn:active{ transform: translateY(1px); }
.profile-btn:disabled{ opacity: 0.5; cursor: not-allowed; }
.profile-btn-primary{
  background: var(--ed-ink);
  color: var(--ed-paper);
  border-color: var(--ed-ink);
}
.profile-btn-primary:hover:not(:disabled){ background: var(--ed-ink-2); }
.profile-btn-secondary{
  background: var(--ed-paper-2);
  color: var(--ed-ink);
  border-color: var(--ed-line);
}
.profile-btn-secondary:hover:not(:disabled){ background: var(--ed-paper); }
.profile-btn-ghost{
  background: transparent;
  color: var(--ed-ink-3);
  border: 0;
}
.profile-btn-ghost:hover:not(:disabled){ color: var(--ed-ink); background: var(--ed-paper-2); }
.profile-btn-danger-outline{
  background: transparent;
  color: var(--ed-rose);
  border-color: var(--ed-rose-soft);
}
.profile-btn-danger-outline:hover:not(:disabled){ background: var(--ed-rose-soft); }
.profile-btn-danger{
  background: var(--ed-rose);
  color: var(--ed-paper);
  border-color: var(--ed-rose);
}
.profile-btn-danger:hover:not(:disabled){ background: oklch(0.55 0.15 25); }

/* Danger zone rows */
.profile-section-danger .profile-section-title{ color: var(--ed-rose); }
.profile-danger-row{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--ed-line-soft);
}
.profile-danger-row:last-of-type{ border-bottom: none; }
.profile-danger-text{ flex: 1 1 auto; min-width: 0; }
.profile-danger-title{
  font-size: 13px;
  font-weight: 500;
  color: var(--ed-ink);
}
.profile-danger-sub{
  font-size: 11px;
  color: var(--ed-ink-3);
  margin-top: 2px;
  line-height: 1.4;
}
.profile-delete-confirm{
  margin-top: 12px;
  padding: 12px;
  background: var(--ed-rose-soft);
  border: 1px solid var(--ed-rose);
  border-radius: 10px;
}
.profile-delete-confirm .profile-input{ margin-top: 8px; }

@media (max-width: 520px){
  .profile-danger-row{
    flex-direction: column;
    align-items: stretch;
  }
  .profile-danger-row .profile-btn{ align-self: flex-end; }
}

/*════════════════════════════════════════════════════════════════════════════════
  EDITORIAL: Subscriptions modal (#planModal) restyle.
  Same content, same JS, just paint with --ed-* tokens. Mint-soft check
  bubbles, amber-soft for the max plan, dashed nuolaidos kodas border,
  Fraunces 24/42 px for plan name + price, 4×1 trust strip below the grid.
════════════════════════════════════════════════════════════════════════════════*/

#planModal.modal{
  background: rgba(26, 24, 20, 0.42);
}
#planModal .panel{
  background: var(--ed-paper) !important;
  border: 1px solid var(--ed-line) !important;
  border-radius: 22px !important;
  box-shadow: 0 24px 60px rgba(26, 24, 20, 0.24) !important;
}
#planModal .body{
  background: var(--ed-paper) !important;
  padding: 32px 28px 22px !important;
}
#planModal footer{
  background: var(--ed-paper) !important;
  border-top: 1px solid var(--ed-line-soft) !important;
}

/* Floating close button — paper bubble with warm border. */
#planModal #btnClosePlan{
  background: var(--ed-paper) !important;
  border: 1px solid var(--ed-line) !important;
  color: var(--ed-ink-3) !important;
  border-radius: 10px !important;
  width: 34px !important;
  height: 34px !important;
}
#planModal #btnClosePlan:hover{
  background: var(--ed-paper-2) !important;
  color: var(--ed-ink) !important;
}

/* Plan-tabs (mobile-only switcher) */
#planModal .plan-tabs-mobile{
  background: var(--ed-paper-2) !important;
  border: 1px solid var(--ed-line-soft) !important;
  border-radius: 12px !important;
}
#planModal .plan-tab{ color: var(--ed-ink-3) !important; }
#planModal .plan-tab.active{
  background: var(--ed-paper) !important;
  color: var(--ed-ink) !important;
  box-shadow: 0 1px 3px rgba(26,24,20,0.10) !important;
}

/* Grid + cards */
#planModal .plans-grid-v2{
  gap: 18px !important;
  align-items: stretch !important;
}
#planModal .plan-card-v2{
  background: var(--ed-paper) !important;
  border: 1px solid var(--ed-line) !important;
  border-radius: 18px !important;
  box-shadow: 0 1px 0 rgba(26,24,20,0.02) !important;
  overflow: hidden;
}
#planModal .plan-card-v2.plan-recommended{
  border: 1.5px solid var(--ed-mint) !important;
  box-shadow: 0 18px 36px -22px rgba(26, 24, 20, 0.30) !important;
  transform: translateY(-4px);
}
#planModal .plan-card-v2.plan-best-value{
  border: 1.5px solid var(--ed-amber) !important;
  box-shadow: 0 18px 36px -22px rgba(26, 24, 20, 0.30) !important;
  transform: translateY(-4px);
}
#planModal .plan-card-v2.is-current-plan{
  outline: 2px solid var(--ed-ink) !important;
  outline-offset: -2px;
}
#planModal .plan-card-v2-inner{
  padding: 26px 22px !important;
  gap: 18px !important;
}

/* Header (plan name) */
#planModal .plan-header-v2{
  border-bottom: 1px solid var(--ed-line-soft) !important;
  padding: 0 0 12px !important;
  background: transparent !important;
}
#planModal .plan-header-v2 h4{
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 24px !important;
  font-weight: 500 !important;
  letter-spacing: -0.025em !important;
  color: var(--ed-ink) !important;
  margin: 0 !important;
}

/* Price block */
#planModal .plan-price-v2{
  display: flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
#planModal .plan-price-v2 .plan-amount{
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 42px !important;
  font-weight: 500 !important;
  letter-spacing: -0.03em !important;
  color: var(--ed-ink) !important;
  line-height: 1 !important;
}
#planModal .plan-price-v2 .plan-currency{
  font-size: 14px !important;
  color: var(--ed-ink-3) !important;
  font-weight: 500;
}
#planModal .plan-price-v2 .plan-period{
  font-size: 13px !important;
  color: var(--ed-ink-4) !important;
  font-weight: 400;
}

/* Plan badge — colored accent strip across the top of recommended/best */
#planModal .plan-badge-v2{
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  height: 28px !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 10px !important;
  letter-spacing: 0.10em !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
  background: var(--ed-mint) !important;
  color: var(--ed-ink) !important;
  box-shadow: none !important;
}
#planModal .plan-badge-v2.badge-amber{
  background: var(--ed-amber) !important;
}
/* Push the inner content down to clear the badge strip */
#planModal .plan-card-v2.plan-recommended .plan-card-v2-inner,
#planModal .plan-card-v2.plan-best-value  .plan-card-v2-inner{
  padding-top: 38px !important;
}

/* Feature list */
#planModal .plan-features-v2{
  gap: 10px !important;
}
#planModal .feat-row{
  font-size: 13px !important;
  line-height: 1.45 !important;
  color: var(--ed-ink-2) !important;
  align-items: flex-start !important;
}
#planModal .feat-row strong{ color: var(--ed-ink) !important; font-weight: 600 !important; }
#planModal .feat-row.feat-disabled{
  color: var(--ed-ink-4) !important;
  opacity: 0.7;
}
#planModal .feat-row.feat-disabled strong{ color: var(--ed-ink-3) !important; }

/* Check / cross bubbles */
#planModal .feat-check{
  width: 18px !important;
  height: 18px !important;
  background: var(--ed-mint-soft) !important;
  border-radius: 999px !important;
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
#planModal .feat-check::after{
  content: "" !important;
  display: block !important;
  width: 9px !important;
  height: 5px !important;
  border: 0 !important;
  border-left: 1.6px solid var(--ed-mint-ink) !important;
  border-bottom: 1.6px solid var(--ed-mint-ink) !important;
  transform: rotate(-45deg) translate(0px, -1px) !important;
  background: transparent !important;
}
/* Amber check bubble for the Maksimalus plan */
#planModal .plan-best-value .feat-check{
  background: var(--ed-amber-soft) !important;
}
#planModal .plan-best-value .feat-check::after{
  border-left-color: var(--ed-amber) !important;
  border-bottom-color: var(--ed-amber) !important;
}
#planModal .feat-cross{
  width: 18px !important;
  height: 18px !important;
  background: var(--ed-paper-2) !important;
  border-radius: 999px !important;
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
#planModal .feat-cross::after{
  content: "" !important;
  display: block !important;
  width: 8px !important;
  height: 1.5px !important;
  background: var(--ed-ink-4) !important;
  border-radius: 1px;
}

/* CTAs */
#planModal .plan-cta-v2{
  gap: 10px !important;
  margin-top: auto !important;
}
#planModal .plan-cta-v2 .btn{
  min-height: 46px !important;
  height: auto !important;
  padding: 12px 16px !important;
  border-radius: 11px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: -0.005em !important;
  border: 1px solid transparent !important;
  width: 100%;
}
#planModal .btn-outline-muted{
  background: var(--ed-paper) !important;
  color: var(--ed-ink-3) !important;
  border: 1px solid var(--ed-line) !important;
}
#planModal .btn-outline-muted:hover{
  background: var(--ed-paper-2) !important;
  color: var(--ed-ink) !important;
}
#planModal .btn-primary-teal{
  background: var(--ed-ink) !important;
  color: var(--ed-paper) !important;
  border-color: var(--ed-ink) !important;
  box-shadow: none !important;
}
#planModal .btn-primary-teal:hover{ background: var(--ed-ink-2) !important; }
#planModal .btn-primary-amber{
  background: var(--ed-amber) !important;
  color: var(--ed-ink) !important;
  border-color: var(--ed-amber) !important;
  box-shadow: none !important;
}
#planModal .btn-primary-amber:hover{ filter: brightness(0.96); }

/* Promo code accordion — dashed editorial border */
#planModal .promo-details{
  background: transparent !important;
  border: 1px dashed var(--ed-line) !important;
  border-radius: 10px !important;
}
#planModal .promo-details summary{
  padding: 9px 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--ed-ink-3) !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  letter-spacing: 0.02em;
}
#planModal .promo-details summary:hover{ color: var(--ed-ink) !important; }
#planModal .promo-details-body{
  padding: 4px 12px 12px !important;
  gap: 6px !important;
}
#planModal .promo-details input{
  background: var(--ed-paper) !important;
  border: 1px solid var(--ed-line) !important;
  color: var(--ed-ink) !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  padding: 8px 10px !important;
}
#planModal .promo-hint{ font-size: 11px !important; color: var(--ed-ink-4) !important; }

/* Plan strip / chip (current-plan indicator at top) */
#planModal .plan-chip{
  background: var(--ed-paper-2) !important;
  border: 1px solid var(--ed-line) !important;
  color: var(--ed-ink-2) !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  letter-spacing: -0.005em !important;
}

/* Trust strip — 4×1 reassurances row */
.plan-trust-strip{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
  padding: 16px 18px;
  background: var(--ed-paper-2);
  border: 1px solid var(--ed-line-soft);
  border-radius: 14px;
}
@media (max-width: 720px){
  .plan-trust-strip{ grid-template-columns: 1fr; }
}
.plan-trust-item{
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.plan-trust-icon{
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--ed-paper);
  border: 1px solid var(--ed-line);
  display: grid; place-items: center;
  color: var(--ed-ink-2);
  flex-shrink: 0;
}
.plan-trust-text{ min-width: 0; }
.plan-trust-title{
  font-size: 12px;
  font-weight: 600;
  color: var(--ed-ink);
  letter-spacing: -0.005em;
}
.plan-trust-sub{
  font-size: 11px;
  color: var(--ed-ink-3);
  margin-top: 1px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

/*════════════════════════════════════════════════════════════════════════════════
  EDITORIAL: Burger menu (#appMenu) + language toggle (.lang-switch).
  Both surfaces previously used #fff bg + cool grey/blue borders that
  clashed with the warm paper palette. Restyle to match the rest of the
  editorial UI: paper bg, --ed-line borders, --ed-ink text, --ed-paper-2
  hover. Also matches the typography register (smaller, lighter weight)
  per the user's Q4 answer.
════════════════════════════════════════════════════════════════════════════════*/

/* Burger trigger button */
.icon-btn#appMenuBtn{
  background: var(--ed-paper) !important;
  border: 1px solid var(--ed-line) !important;
  color: var(--ed-ink-2) !important;
}
.icon-btn#appMenuBtn:hover{
  background: var(--ed-paper-2) !important;
  border-color: var(--ed-ink-4) !important;
}
.icon-btn#appMenuBtn .hamburger,
.icon-btn#appMenuBtn .hamburger::before,
.icon-btn#appMenuBtn .hamburger::after{
  background: var(--ed-ink-2) !important;
}
/* Open state: the X morph hides the middle bar via background:transparent
   but the editorial !important above re-asserted the ink color and kept
   the middle bar visible (rendering as an asterisk/3-pointed shape). Add
   matching !important to the open-state transparent so the middle bar
   actually disappears, leaving just the rotated ::before/::after as a
   clean X. */
.icon-btn#appMenuBtn.is-open .hamburger{
  background: transparent !important;
}

/* Dropdown panel */
.app-menu .menu-dropdown{
  background: var(--ed-paper) !important;
  border: 1px solid var(--ed-line) !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 40px rgba(26,24,20,0.16),
              0 6px 14px rgba(26,24,20,0.06) !important;
  padding: 6px !important;
}
/* Caret triangle */
.app-menu .menu-dropdown::before{
  background: var(--ed-paper) !important;
  border-color: var(--ed-line) !important;
}

/* Menu items: editorial typography (lighter weight, JBMono not used here —
   keep Inter/system but at 500 weight, slightly smaller, ed-ink-2 color). */
.app-menu .menu-item{
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--ed-ink-2) !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  letter-spacing: -0.005em !important;
  padding: 9px 12px !important;
  border-radius: 9px !important;
  transition: background .12s, color .12s, border-color .12s;
}
.app-menu .menu-item:hover{
  background: var(--ed-paper-2) !important;
  border-color: var(--ed-line-soft) !important;
  color: var(--ed-ink) !important;
}
.app-menu .menu-item .menu-chevron{
  color: var(--ed-ink-4);
}

/* Submenu body */
.app-menu .menu-submenu-body{
  background: transparent;
}
.app-menu .menu-submenu-body .menu-item{
  font-size: 12px !important;
  color: var(--ed-ink-3) !important;
}

/* Divider */
.app-menu hr.menu-divider{
  border-top: 1px solid var(--ed-line-soft) !important;
  margin: 4px 6px !important;
}

/* Danger item */
.app-menu .menu-item-danger{
  color: var(--ed-rose) !important;
}
.app-menu .menu-item-danger:hover{
  background: var(--ed-rose-soft) !important;
  border-color: var(--ed-rose-soft) !important;
  color: var(--ed-rose) !important;
}

/* Language toggle (.lang-switch) — mirrors the .med-toggle pill pattern.
   Active button uses ink-on-paper instead of the legacy teal. */
.appbar .lang-switch{
  background: var(--ed-paper-2) !important;
  border: 1px solid var(--ed-line) !important;
  border-radius: 999px !important;
  padding: 2px !important;
  box-shadow: none !important;
}
.appbar .lang-switch button{
  background: transparent !important;
  border: 0 !important;
  color: var(--ed-ink-3) !important;
  font-weight: 500 !important;
  font-size: 11px !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  letter-spacing: 0.02em;
  transition: background .12s, color .12s;
}
.appbar .lang-switch button:hover{
  color: var(--ed-ink) !important;
}
.appbar .lang-switch button.on,
.appbar .lang-switch button.active{
  background: var(--ed-ink) !important;
  color: var(--ed-paper) !important;
  border: 0 !important;
}

/* Floating top-right lang switch (when not in appbar) — same treatment. */
.lang-switch:not(.appbar .lang-switch){
  background: var(--ed-paper) !important;
  border: 1px solid var(--ed-line) !important;
  box-shadow: 0 6px 16px rgba(26,24,20,0.10) !important;
}
.lang-switch:not(.appbar .lang-switch) button.on,
.lang-switch:not(.appbar .lang-switch) button.active{
  background: var(--ed-ink) !important;
  color: var(--ed-paper) !important;
  border: 0 !important;
}

/* Suppress the legacy "Dabartinis planas" pseudo-badge that was positioned
   bottom:-10px and gets clipped by the editorial card's overflow:hidden.
   Redundant: the modal header already shows "Dabartinis planas: <name>"
   AND the editorial outline (var(--ed-ink)) already marks the current
   card visually. */
#planModal .plan-card-v2.is-current-plan::after{
  content: none !important;
  display: none !important;
}
