/* Raleway LOKAL eingebunden (M-5d/T-17): der frühere Google-Fonts-Import übertrug bei jedem
   Seitenaufruf die IP-Adresse an Google (LG München I, 3 O 17493/20) — auch auf den
   öffentlichen Mieterseiten. Variable Schrift (ein File je Zeichensatz deckt 400–800). */
@font-face {
  font-family: 'Raleway'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('fonts/raleway-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Raleway'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('fonts/raleway-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* =====================================================================
   Immoservice-Agents – gemeinsames Erscheinungsbild (Theme)
   Orientiert am Webauftritt www.immoservice-luckei.de
   Markenfarben Teal/Waldgrün + Gold-Akzent, Schrift Raleway.
   Basisregeln nutzen :where() (geringe Spezifität), damit app-eigene
   Stile nicht überschrieben werden.
   ===================================================================== */
:root{
  --teal-dark:#005845; --teal:#007060; --teal-mid:#3d8a80; --teal-light:#e6f2f0;
  --sage:#7ba8a4; --sage-dark:#4a807a;
  --gold:#c8961e; --gold-dark:#a97d18;
  /* E-2 (04 B3): Werte für SCHRIFT. --teal-mid und --gold sind Flächenfarben und
     tragen als Schrift auf Weiß nur 4,08:1 bzw. 2,68:1 — dafür stehen hier eigene
     Werte. Gemessen nach WCAG 2.1 gegen Weiß (Testfall 38 rechnet sie nach):
       --text-muted 5,62:1  gedämpfte Erklär- und Hinweistexte (ISL-Briefgenerator hat
                            ein eigenes `--muted`; der Name hier ist deshalb bewusst anders).
                            Bericht 04 B3 schlug #5a6b68 vor — der trägt auf dem hellsten
                            Markenton #e6f2f0 exakt 4,4998:1 und verfehlt den Wert knapp.
       --teal-text 5,86:1   Verweise, Gruppentitel  ·  zugleich Flächenfarbe mit weißer Schrift
       --gold-text 4,90:1   Gold als Schrift auf hellem Grund
       --on-gold   5,18:1   Schrift AUF dem goldenen Knopf (weiß trug dort nur 2,68:1)
       --gold-hover 6,72:1  Überfahren hellt auf; --gold-dark wäre mit dunkler Schrift 3,72:1 */
  --text-muted:#5a6b68; --teal-text:#2f6f66; --gold-text:#8a6d1a;
  --on-gold:#3a2a05; --gold-hover:#d3a334;
  --gray:#d8e4e2; --line:#cfdad7;
  --bg:#f7faf9; --card:#ffffff;
  --text:#1e3330; --text-light:#5a7572;
  --ok:#0a7d4f; --warn:#a8071a;
  --font:'Raleway','Segoe UI',system-ui,Arial,sans-serif;
  --radius:12px;
  --shadow:0 4px 20px rgba(0,88,69,.10);
  --shadow-lg:0 14px 40px rgba(0,88,69,.16);
}

/* sanfte Grunddefaults (überschreibbar durch App-CSS) */
:where(body){ font-family:var(--font); color:var(--text); background:var(--bg); line-height:1.6; }
:where(h1,h2,h3,h4){ font-family:var(--font); color:var(--teal-dark); font-weight:800; letter-spacing:.2px; }
:where(a){ color:var(--teal-text); text-decoration:none; transition:color .2s; }
:where(a:hover){ color:var(--teal-dark); }
:where(.ok){ color:var(--ok); font-weight:700; }
:where(.warn){ color:var(--warn); font-weight:700; }

/* Buttons – gold (CTA), teal, outline – wie auf der Website */
:where(.btn){
  display:inline-flex;align-items:center;gap:7px;justify-content:center;
  padding:10px 18px;border-radius:9px;border:2px solid transparent;
  background:#fff;color:var(--teal-dark);font:inherit;font-weight:700;font-size:.9rem;letter-spacing:.3px;
  cursor:pointer;transition:transform .18s,background .2s,border-color .2s,box-shadow .2s;
}
:where(.btn:hover){ transform:translateY(-2px); }
:where(.btn-gold){ background:var(--gold);color:var(--on-gold);border-color:var(--gold); }
:where(.btn-gold:hover){ background:var(--gold-hover);border-color:var(--gold-hover);box-shadow:0 6px 20px rgba(200,150,30,.32); }
:where(.btn-teal){ background:var(--teal-dark);color:#fff;border-color:var(--teal-dark); }
/* E-2: Überfahren ging bisher auf --teal-mid — weiße Schrift trug dort 4,08:1. */
:where(.btn-teal:hover){ background:var(--teal-text);border-color:var(--teal-text);box-shadow:0 6px 20px rgba(0,88,69,.25); }
:where(.btn-outline){ background:#fff;color:var(--teal-dark);border-color:var(--gray); }
:where(.btn-outline:hover){ border-color:var(--teal-mid); }

:where(input,textarea,select){
  font:inherit;color:var(--text);background:#fff;
  border:1.5px solid var(--line);border-radius:8px;padding:9px 11px;outline:none;transition:border-color .2s,box-shadow .2s;
}
:where(input:focus,textarea:focus,select:focus){
  border-color:var(--teal-mid);box-shadow:0 0 0 3px rgba(61,138,128,.14);
}
:where(.card){ background:var(--card);border:1px solid var(--gray);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px 22px; }

/* =====================================================================
   E-2 (04 B5): sichtbarer Fokusrahmen — wer mit der Tastatur arbeitet,
   sieht, wo er steht. `:focus-visible` kam bisher NULL-mal vor.

   Warum `!important`: die Agenten setzen an vielen Stellen `outline:none`
   auf `:focus` (z. B. `.fld input:focus{outline:none;…}`). Diese Regeln
   greifen auch im Fall `:focus-visible` und haben mit ihrer Klasse die
   höhere Spezifität — eine Regel ohne `!important` bliebe wirkungslos.
   Dasselbe Muster nutzt schon die Mobil-Schicht weiter unten.

   Die Maus bleibt unberührt: `:focus-visible` greift nur bei Tastatur-
   bedienung. Der Rahmen liegt AUSSERHALB des Elements (outline-offset),
   deshalb gilt er auch auf goldenen und grünen Knöpfen gegen den hellen
   Seitengrund (8,46:1) und verschiebt kein Layout.
   ===================================================================== */
:where(a,button,summary,input,select,textarea,[role="button"],[tabindex]:not([tabindex="-1"])):focus-visible{
  outline:3px solid var(--teal-dark) !important;
  outline-offset:2px !important;
  border-radius:3px;
}
/* Auf dunklem Grund (App-Leiste, Sperrbild) wäre Waldgrün auf Waldgrün unsichtbar. */
:where(.immo-appbar,.appbar) :where(a,button,select,input):focus-visible{
  outline-color:#ffffff !important;
}

/* dezente, markenfarbene Scrollbalken */
*::-webkit-scrollbar{ width:11px;height:11px; }
*::-webkit-scrollbar-thumb{ background:#c2d6d1;border-radius:8px;border:3px solid transparent;background-clip:content-box; }
*::-webkit-scrollbar-thumb:hover{ background:#9fc0b9;border:3px solid transparent;background-clip:content-box; }

/* ===== Einheitliche App-Leiste (für eigenständig geöffnete Agenten) ===== */
.immo-appbar{
  display:flex;align-items:center;gap:12px;
  background:linear-gradient(135deg,var(--teal-dark) 0%,var(--teal) 60%,var(--teal-mid) 100%);
  color:#fff;padding:10px 18px;font-family:var(--font);
}
.immo-appbar .logo{
  width:34px;height:34px;border-radius:9px;background:#fff;
  display:flex;align-items:center;justify-content:center;font-size:18px;flex:0 0 auto;overflow:hidden;
}
.immo-appbar .logo img{ width:100%;height:100%;object-fit:contain; }
.immo-appbar .titles{line-height:1.2;}
.immo-appbar .titles b{display:block;font-size:.95rem;font-weight:800;letter-spacing:.3px;}
.immo-appbar .titles span{font-size:.74rem;opacity:.85;}
.immo-in-shell .immo-appbar{ display:none; }

/* =====================================================================
   ZENTRALE MOBIL-/KOMPAKT-SCHICHT  (nur Darstellung, keine Funktion)
   Greift ausschließlich, wenn <html class="is-mobile"> gesetzt ist – das
   übernimmt immo-core.js (automatisch via matchMedia(--mobile-bp) ODER
   manuell über den Ansicht-Umschalter Auto/Handy/Desktop).
   Erhöhte Spezifität (html.is-mobile …) überschreibt die Inline-<style>-
   Regeln der einzelnen Agenten, obwohl dieses Theme zuerst geladen wird.
   Stellschrauben unten als CSS-Variablen → leicht anpassbar.
   ===================================================================== */
:root{ --mobile-bp:720px; }

/* iOS-Auto-Zoom verhindern (16px) + Touch-freundlichere Buttons */
html.is-mobile :where(input,select,textarea){ font-size:16px; }
html.is-mobile :where(.btn){ padding:11px 16px; font-size:.95rem; }

/* Werkzeugleiste der Agenten (#bar) umbruchsicher */
html.is-mobile #bar{ flex-wrap:wrap; gap:8px; padding:10px 12px; }
html.is-mobile #bar select,
html.is-mobile #bar input{ font-size:16px; min-height:38px; }

/* Mehrspaltige Raster → einspaltig */
html.is-mobile .grid2,
html.is-mobile .grid3{ grid-template-columns:1fr; }
html.is-mobile .grid2>div,
html.is-mobile .grid3>div{ min-width:0; }

/* Modale Dialoge → Vollbild */
html.is-mobile .modal{ padding:0; }
html.is-mobile .modal .box{ width:100%; min-height:100%; max-width:none; border-radius:0; margin:0; box-shadow:none; }
html.is-mobile .modal :where(input,select,textarea){ font-size:16px; }

/* Breite Tabellen: standardmäßig horizontal wischbar (ohne Markup-Änderung) */
html.is-mobile :where(main,.card,.scrollx) table:not(.cards){ display:block; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }

/* Karten-Tabellen (Opt-in: <table class="… cards">, Zellen mit data-label="…") */
html.is-mobile table.cards{ display:block; width:100%; }
html.is-mobile table.cards thead{ display:none; }
html.is-mobile table.cards tbody{ display:block; }
html.is-mobile table.cards tr{ display:block; border:1px solid var(--line); border-radius:12px; margin-bottom:12px; background:#fff; box-shadow:0 2px 8px rgba(0,0,0,.05); overflow:hidden; }
html.is-mobile table.cards td{ display:flex; justify-content:space-between; align-items:center; gap:12px; border:none; border-bottom:1px solid #eef2f1; padding:9px 14px; min-height:40px; }
html.is-mobile table.cards td:last-child{ border-bottom:none; }
html.is-mobile table.cards td::before{ content:attr(data-label); font-weight:700; color:var(--text-light); font-size:11.5px; flex:0 0 auto; }
html.is-mobile table.cards td:empty{ display:none; }

/* Startseite: Kacheln als einspaltige Liste (Icon links, Titel + Kurztext rechts) */
html.is-mobile .tiles{ grid-template-columns:1fr; gap:10px; }
html.is-mobile .tile{ display:flex; align-items:flex-start; gap:12px; padding:13px 14px; }
html.is-mobile .tile .ic{ width:42px; height:42px; min-width:42px; margin-bottom:0; font-size:1.25rem; }
html.is-mobile .tile .t1{ margin:0 0 2px; }
html.is-mobile .tile .t2{ font-size:.8rem; }
html.is-mobile .tile .go{ display:none; }

/* Shell-App-Leiste umbruchsicher; Agenten-iframe-Höhe an (ggf. höhere) Leiste anpassen */
html.is-mobile .appbar{ flex-wrap:wrap; gap:8px 12px; padding:8px 12px; }
html.is-mobile .appbar .appsw{ margin-left:0; flex:1 1 100%; }
html.is-mobile .appbar .appsw select{ max-width:none; flex:1; }
html.is-mobile .appframe{ height:calc(100vh - var(--appbar-h, 92px)); height:calc(100dvh - var(--appbar-h, 92px)); }

/* =====================================================================
   Zentrale Hilfe / Anleitung (immo-core.js spritzt Knopf + Overlay ein)
   ===================================================================== */
.immo-help-fab{position:fixed;right:16px;bottom:16px;z-index:5000;display:inline-flex;align-items:center;gap:7px;
  background:#005845;color:#fff;border:none;border-radius:24px;padding:10px 16px;font:inherit;font-weight:700;font-size:.92rem;
  box-shadow:0 6px 20px rgba(0,0,0,.28);cursor:pointer;}
.immo-help-fab:hover{background:#00715a;}
.immo-help-fab .q{font-size:1.05rem;line-height:1;}
.immo-help-ov{position:fixed;inset:0;z-index:6000;background:rgba(15,30,27,.55);display:flex;align-items:center;justify-content:center;padding:24px;}
.immo-help-box{background:#fff;width:min(820px,96vw);max-height:92vh;display:flex;flex-direction:column;
  border-radius:14px;box-shadow:0 18px 60px rgba(0,0,0,.45);overflow:hidden;}
.immo-help-hd{display:flex;align-items:center;gap:10px;padding:13px 18px;background:#005845;color:#fff;}
.immo-help-hd b{flex:1;font-size:1.05rem;}
.immo-help-x{background:rgba(255,255,255,.18);color:#fff;border:none;border-radius:7px;width:32px;height:32px;font-size:1rem;cursor:pointer;}
.immo-help-x:hover{background:rgba(255,255,255,.32);}
.immo-help-bd{padding:18px 22px 26px;overflow:auto;line-height:1.6;color:#1e3330;font-size:.97rem;}
.immo-help-bd .immo-help-h1{font-size:1.4rem;font-weight:800;color:#005845;margin:0 0 6px;}
.immo-help-bd .immo-help-lead{font-size:1.02rem;color:#2c4a44;background:#eef6f3;border-left:4px solid #1d6f4f;border-radius:0 8px 8px 0;padding:10px 14px;margin:8px 0 14px;}
.immo-help-bd h3{color:#005845;font-size:1.1rem;margin:20px 0 6px;border-bottom:2px solid #e6f2f0;padding-bottom:4px;}
.immo-help-bd h4{color:#2f6f66;font-size:1rem;margin:14px 0 4px;}
.immo-help-bd p{margin:7px 0;}
.immo-help-bd ol,.immo-help-bd ul{margin:8px 0;padding-left:24px;}
.immo-help-bd li{margin:5px 0;}
.immo-help-bd b{color:#143b33;}
.immo-help-tbl{border-collapse:collapse;width:100%;margin:6px 0 2px;font-size:.93rem;}
.immo-help-tbl th{text-align:left;vertical-align:top;background:#f1f7f5;color:#005845;font-weight:700;border:1px solid #d8e6e1;padding:6px 9px;width:32%;}
.immo-help-tbl td{vertical-align:top;border:1px solid #d8e6e1;padding:6px 9px;}
.immo-help-acc{margin:12px 0;border:1px solid #d8e6e1;border-radius:9px;overflow:hidden;}
.immo-help-acc>summary{cursor:pointer;list-style:none;padding:11px 14px;background:#f1f7f5;color:#005845;font-weight:700;font-size:.98rem;}
.immo-help-acc>summary::-webkit-details-marker{display:none;}
.immo-help-acc>summary::before{content:"▸ ";color:#1d6f4f;}
.immo-help-acc[open]>summary::before{content:"▾ ";}
.immo-help-accbd{padding:6px 14px 14px;}
.immo-help-foot{margin-top:20px;padding-top:12px;border-top:1px solid #e6f2f0;color:#5a7572;font-size:.86rem;}
.immo-help-load{color:#5a7572;padding:14px 0;}
/* Mobil: Knopf kompakt, Overlay als Vollbild */
html.is-mobile .immo-help-fab{right:12px;bottom:12px;padding:11px 14px;}
html.is-mobile .immo-help-fab .t{display:none;}
html.is-mobile .immo-help-fab .q{font-size:1.25rem;}
html.is-mobile .immo-help-ov{padding:0;}
html.is-mobile .immo-help-box{width:100%;max-width:none;height:100%;max-height:100%;border-radius:0;}
html.is-mobile .immo-help-tbl th{width:auto;display:block;border-bottom:none;}
html.is-mobile .immo-help-tbl td{display:block;}
html.is-mobile .immo-help-tbl tr{display:block;margin-bottom:8px;border:1px solid #d8e6e1;border-radius:8px;overflow:hidden;}
/* Hilfe: Häufige Fragen (FAQ) */
.immo-help-faq{margin:6px 0;}
.immo-help-q{border:1px solid #e1ebe8;border-radius:8px;margin:6px 0;background:#fafdfc;}
.immo-help-q>summary{cursor:pointer;list-style:none;padding:9px 13px;font-weight:700;color:#1d6f4f;}
.immo-help-q>summary::-webkit-details-marker{display:none;}
.immo-help-q>summary::before{content:"❔ ";}
.immo-help-q[open]>summary{border-bottom:1px solid #e1ebe8;}
.immo-help-qa{padding:9px 13px;}
.immo-help-qa p{margin:6px 0;}

/* ---------- M-8b: angesprungene Zeile nach einem Sprung (IMMO.focusApply) ----------
   Kurz hervorheben, damit man beim Wechsel in den Zielagenten sieht, WELCHE Zeile
   gemeint war — ohne die Zeile dauerhaft umzufärben. */
.immo-focus-treffer{
  animation:immo-focus-puls 2.6s ease-out 1;
  scroll-margin-top:80px;
}
@keyframes immo-focus-puls{
  0%,55%{ background:#fff6d8; box-shadow:inset 3px 0 0 #d99100; }
  100%  { background:transparent; box-shadow:none; }
}
@media (prefers-reduced-motion:reduce){
  .immo-focus-treffer{ animation:none; background:#fff6d8; box-shadow:inset 3px 0 0 #d99100; }
}

/* ---------- S-6: unlesbarer Geldbetrag im Eingabefeld (IMMO.numField) ---------- */
input.immo-num-bad, textarea.immo-num-bad, [contenteditable].immo-num-bad{
  border:1px solid #a8071a !important;
  background:#fdf1f3 !important;
  box-shadow:0 0 0 2px rgba(168,7,26,.15) !important;
}
/* Sprechblase direkt unter dem Feld (IMMO.numHint) — sichtbar auch in langen iframes */
#immo-num-tip{
  position:fixed;z-index:99999;max-width:300px;pointer-events:none;
  background:#a8071a;color:#fff;padding:7px 11px;border-radius:7px;
  font-size:12.5px;line-height:1.35;box-shadow:0 5px 16px rgba(0,0,0,.28);
}
