/* Mikrolage – visual system, after the "Obi Band" CV guide (D:/Claude Projects/CV Builder/DESIGN.md).
   White panels on the map, one loud signal-orange band (the brand bar) with black ink, vivid violet as the
   one interactive accent, pink and sun only as rules. Sofia Sans in three widths. Square 2 px corners,
   hairline rules, thick coloured section rules. Every reading text is ink or ink-2 – never tone-on-tone.
   The product's own unit, the 100 m cell, stays the mark and the square score badge. */
:root {
  color-scheme: light;
  --desk: #eeedf6;
  --face: #ffffff;
  --face-2: #f6f5fb;
  --ink: #121212;
  --ink-2: #1e1e25;            /* secondary text is (near) ink: no grey on light – hierarchy by size and weight */
  --ink-3: #2a2a32;
  --rule: rgb(18 18 18 / .13);
  --rule-2: rgb(18 18 18 / .30);
  --orange: #ff5f1f; --orange-deep: #e84a0c; --orange-ink-2: #4a1c08;
  --violet: #6a3bff; --violet-deep: #5527e6; --violet-tint: #eee9ff; --on-violet: #ffffff;
  --pink: #ff7ab8; --sun: #ffc933;
  --good: #1a7a3c; --bad: #c0331f;
  --track: #ebe9f3;
  --shadow-sheet: 0 1px 2px rgb(18 18 18 / .10), 0 16px 34px -18px rgb(18 18 18 / .42);
  --k0: #c8402f; --k1: #ee8f3f; --k2: #f6d64f; --k3: #5fae6b; --k4: #145030;
  --k0-ink: #fff; --k1-ink: #121212; --k2-ink: #121212; --k3-ink: #121212; --k4-ink: #fff;
  --nodata: #d9d7e2;
  --r: 2px;
  --fs-xs: 0.8125rem; --fs-sm: 0.875rem; --fs-md: 0.9375rem; --fs-lg: 1.125rem; --fs-xl: 1.6rem; --fs-hero: 2.6rem;
  --font: "Sofia Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-semi: "Sofia Sans Semi Condensed", "Arial Narrow", sans-serif;
  --font-x: "Sofia Sans Extra Condensed", "Arial Narrow", sans-serif;
  --panel-w: 825px;              /* one width for every tab but Vergleich (1.25 x 660, room for the ranking columns) */
  /* the Vergleich tab only: wide enough for the flats side by side, never under the map display */
  --panel-wide: min(1080px, calc(100vw - 24px - 348px - 24px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --desk: #121118; --face: #1b1a23; --face-2: #24222f; --ink: #f4f2fa; --ink-2: #ecebf4; --ink-3: #e2e0ec;
    --rule: rgb(255 255 255 / .12); --rule-2: rgb(255 255 255 / .28);
    --violet: #9f86ff; --violet-deep: #b6a3ff; --violet-tint: #2c2550; --on-violet: #121212;
    --good: #7cd394; --bad: #ff8f7a; --track: #2c2a38; --nodata: #3a3846;
    --shadow-sheet: 0 1px 2px rgb(0 0 0 / .5), 0 16px 34px -18px rgb(0 0 0 / .8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --desk: #121118; --face: #1b1a23; --face-2: #24222f; --ink: #f4f2fa; --ink-2: #ecebf4; --ink-3: #e2e0ec;
  --rule: rgb(255 255 255 / .12); --rule-2: rgb(255 255 255 / .28);
  --violet: #9f86ff; --violet-deep: #b6a3ff; --violet-tint: #2c2550; --on-violet: #121212;
  --good: #7cd394; --bad: #ff8f7a; --track: #2c2a38; --nodata: #3a3846;
  --shadow-sheet: 0 1px 2px rgb(0 0 0 / .5), 0 16px 34px -18px rgb(0 0 0 / .8);
}

* { box-sizing: border-box; }
html { font-size: 100%; }
html, body { margin: 0; height: 100%; background: var(--desk); color: var(--ink); }
body { font: 400 var(--fs-md)/1.45 var(--font); font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
#map { position: fixed; inset: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; top: -60px; left: 12px; z-index: 10; padding: 8px 12px; background: var(--ink); color: var(--face); border-radius: var(--r); }
.skip:focus { top: 12px; }
.mark { width: 24px; height: 24px; color: var(--ink); flex: none; }
/* the wordmark is always two-coloured: MIKRO in ink, LAGE in white on the orange bar */
.word .lage, #reopen .lage { color: #FFFFFF; }

/* ------------------------------------------------------------ controls */
/* actions: line buttons (1px ink), primary = signal orange with ink */
.btn, .key, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
  background: transparent; color: var(--ink); border: 1px solid var(--ink); border-radius: var(--r); cursor: pointer;
  font-family: var(--font-semi); font-size: 0.8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  transition: background-color .15s, color .15s;
}
.btn:hover, .key:hover, .icon-btn:hover { background: var(--ink); color: var(--face); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #121212; }
.btn-primary:hover { background: var(--orange-deep); border-color: var(--orange-deep); color: #121212; }
.icon-btn { width: 34px; min-height: 34px; padding: 0; text-transform: none; letter-spacing: 0; font-family: var(--font); font-weight: 800; }
.icon-btn[aria-expanded="true"]#settings-btn { background: var(--ink); color: var(--face); }
button.link { background: none; border: 0; padding: 0; color: var(--violet); cursor: pointer; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px; font-size: var(--fs-sm); font-weight: 600; }

/* options: segmented, selected = violet */
.seg { display: grid; border: 1px solid var(--rule-2); border-radius: var(--r); overflow: hidden; background: var(--face); }
.seg-2 { grid-template-columns: repeat(2, 1fr); }
/* loading bar across the top while the map recolours */
.loadbar { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 2000; overflow: hidden; pointer-events: none;
  background: color-mix(in srgb, var(--violet) 22%, transparent); transition: opacity .2s ease-out; }
.loadbar[hidden] { display: none; }
.loadbar i { position: absolute; inset: 0 auto 0 0; width: 38%; background: var(--violet); animation: loadbar 1.1s cubic-bezier(.45, 0, .25, 1) infinite; }
.loadbar.done { opacity: 0; }
@keyframes loadbar { from { transform: translateX(-100%); } to { transform: translateX(265%); } }
@media (prefers-reduced-motion: reduce) { .loadbar i { animation: none; width: 100%; } }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg-layers { grid-template-columns: repeat(3, 1fr); }
.seg button { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 4px 4px; margin: 0;
  border: 0; border-left: 1px solid var(--rule); background: transparent; cursor: pointer; color: var(--ink);
  font-family: var(--font-semi); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.seg-2 button:first-child, .seg-3 button:first-child, .presets button:first-child { border-left: 0; }
.seg-layers button { border-left: 0; }
.seg-layers button.bl { border-left: 1px solid var(--rule); }
.seg-layers button.bt { border-top: 1px solid var(--rule); }
.seg button svg { width: 16px; height: 16px; flex: none; }
.seg button:hover { background: var(--face-2); }
.seg button[aria-checked="true"] { background: var(--violet); color: var(--on-violet); font-weight: 700; }
.seg-layers button { flex-direction: column; gap: 3px; min-height: 46px; }
.mini-seg { display: inline-grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.mini-seg button { border: 0; background: transparent; padding: 4px 8px; min-height: 30px; font-family: var(--font-semi); font-weight: 700; font-size: 0.8125rem; letter-spacing: .06em; cursor: pointer; color: var(--ink); }
.mini-seg button + button { border-left: 1px solid var(--ink); }
.mini-seg button[aria-checked="true"] { background: var(--ink); color: var(--orange); }

/* tabs: a full-width segmented strip, selected = solid ink */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 14px; border: 1px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.tabs button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 4px; background: var(--face); border: 0;
  cursor: pointer; font-family: var(--font-semi); font-size: 0.875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
.tabs button + button { border-left: 1px solid var(--ink); }
.tabs button:hover { background: var(--face-2); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--face); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: #121212; font-size: 11px; font-weight: 800; letter-spacing: 0; }

/* section labels: semi-condensed caps over a thick coloured rule (orange, violet, pink, sun in turn) */
.ctl-label, .rule-label { display: block; font-family: var(--font-semi); font-size: 0.8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.ctl { display: grid; gap: 7px; }
.sec { margin: 22px 0 8px; padding-bottom: 5px; border-bottom: 3px solid var(--c, var(--orange)); font-family: var(--font-semi); font-size: 0.875rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sec small { font-family: var(--font); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-2); font-size: var(--fs-xs); }
.c1 { --c: var(--orange); } .c2 { --c: var(--violet); } .c3 { --c: var(--pink); } .c4 { --c: var(--sun); }

/* ------------------------------------------------------------ panel: same width on every tab but Vergleich; only the tab content scrolls */
#panel {
  position: fixed; top: 12px; left: 12px; bottom: 12px; width: var(--panel-w); z-index: 3;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--face); border: 1px solid var(--rule-2); border-radius: var(--r); box-shadow: var(--shadow-sheet);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s;
}
#panel.wide { width: var(--panel-wide); }
/* stand-in sheet behind the panel while it narrows (see setWide in app.js) */
.panel-ghost { position: fixed; z-index: 2; pointer-events: none; background: var(--face); border: 1px solid var(--rule-2); border-radius: var(--r); box-shadow: var(--shadow-sheet); }
body.collapsed #panel { transform: translateX(calc(-100% - 24px)); opacity: 0; pointer-events: none; }
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--orange); color: #121212; }
.logo { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; padding: 0; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; }
.logo:hover .word { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
/* the website's lockup: grid + pin beside the wordmark (the pin alone is the small mark: favicon, folded button) */
.logo .tile { display: grid; place-items: center; width: 46px; height: 46px; background: #ffffff; border-radius: var(--r); flex: none; }
.logo .mark-grid { width: 36px; height: 42px; margin-top: -2px; }
.word { font-family: var(--font-x); font-size: 1.85rem; font-weight: 800; letter-spacing: .005em; line-height: .9; text-transform: uppercase; }
.city { display: block; font-family: var(--font-semi); font-size: var(--fs-sm); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #ffffff; }
/* brand: the logo button (tile + wordmark) and, under the wordmark, the city drop-down */
.brand { position: relative; margin-right: auto; padding-bottom: 17px; }
.brand .logo { margin-right: 0; }
.city-pick { position: absolute; left: 48px; bottom: -3px; }
.city-btn { display: inline-flex; align-items: center; gap: 5px; padding: 1px 2px; margin-left: -2px; background: none; border: 0; border-radius: var(--r); color: #ffffff; cursor: pointer; }
.city-btn:hover .city, .city-btn[aria-expanded="true"] .city { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.city-btn:focus-visible { outline: 2px solid #ffffff; outline-offset: 1px; }
.city-menu { position: absolute; z-index: 40; top: calc(100% + 6px); left: -50px; width: 260px; padding: 8px; background: var(--face); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow-sheet); }
.city-menu input { width: 100%; min-height: 34px; padding: 4px 10px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--face); color: var(--ink); font: inherit; font-size: var(--fs-sm); }
.city-menu input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.city-menu ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: min(52vh, 420px); overflow: auto; }
.city-menu li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: var(--r); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.city-menu li.active { background: var(--violet-tint); }
.city-menu li[aria-selected="true"] { font-weight: 800; }
.city-menu li[aria-selected="true"]::after { content: "✓"; color: var(--violet); font-weight: 800; }
.city-menu li[aria-disabled="true"] { color: color-mix(in srgb, var(--ink) 45%, var(--face)); cursor: default; }
.city-menu li[aria-disabled="true"] small { font-family: var(--font-semi); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.city-note { margin: 6px 4px 2px; font-size: var(--fs-xs); font-weight: 600; }
.city-note:empty { display: none; }
/* account box in Mein Bereich */
.account .acc-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.account .acc-note { margin: 8px 0 0; font-size: var(--fs-xs); }
.account .acc-msg { margin: 8px 0 0; font-size: var(--fs-sm); font-weight: 600; }
.account .acc-msg.err { color: var(--ink); background: color-mix(in srgb, var(--orange) 22%, var(--face)); padding: 4px 8px; border-radius: var(--r); }
.account .acc-confirm { margin: 10px 0 0; font-size: var(--fs-sm); }
.account .acc-sync { font-weight: 700; }
#gsi-btn:empty { display: none; }
#mine-btn.signed-in { background: #121212; color: var(--orange); }
body.city-open #panel { z-index: 5; }
/* phone: the panel is a bottom sheet, so the list opens over the map at the top */
@media (max-width: 720px) {
  .city-menu { position: fixed; z-index: 1500; top: 12px; left: 12px; right: 12px; width: auto; }
  .city-menu ul { max-height: 58vh; }
}
.bar-actions { display: flex; align-items: center; gap: 6px; }
.bar .icon-btn { border-color: #121212; color: #121212; }
.bar .icon-btn:hover { background: #121212; color: var(--orange); }
.bar .mini-seg { border-color: #121212; }
.bar .mini-seg button { color: #121212; }
.bar .mini-seg button + button { border-left-color: #121212; }
.bar .mini-seg button[aria-checked="true"] { background: #121212; color: var(--orange); }
#reopen { position: fixed; top: 12px; left: 12px; z-index: 3; display: none; gap: 8px; padding: 0 12px 0 6px; min-height: 40px;
  background: var(--orange); border-color: var(--orange); color: #121212; font-family: var(--font-x); font-size: 1.25rem; font-weight: 800; }
#reopen .mark { width: 26px; height: 32px; background: #fff; padding: 3px 4px 1px; border-radius: var(--r); }
#reopen .chev { margin-left: 2px; }
#reopen:hover .chev { transform: translateX(2px); }
body.collapsed #reopen { display: inline-flex; }

#search { position: relative; margin: 12px 14px 10px; }
.search-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
#q { width: 100%; min-height: 40px; padding: 8px 42px 8px 34px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--face); font-size: var(--fs-md); }
/* user choice: an orange box with a white × (an exception to black-on-orange; bold stroke, ~3:1 like an icon needs) */
.q-clear { position: absolute; right: 5px; top: 5px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
  background: var(--orange); border: 0; border-radius: var(--r); color: #ffffff; cursor: pointer; }
.q-clear svg path { stroke-width: 2.6; }
.q-clear:hover { background: var(--orange-deep); }
.q-clear[hidden] { display: none; }
#q::placeholder { color: var(--ink-3); }
#q:hover { border-color: var(--ink-3); }
#q:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; z-index: 6; max-height: 60vh; overflow-y: auto;
  background: var(--face); border: 1px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow-sheet); }
.results .grp { display: flex; align-items: baseline; gap: 8px; padding: 10px 10px 4px; font-family: var(--font-semi); font-size: 0.8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.results .grp small { font-family: var(--font); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0; text-transform: none; }
.results .grp .link { margin-left: auto; text-transform: none; letter-spacing: 0; }
.results .grp + [role="option"] { border-top: 1px solid var(--rule); }
.results .hint { padding: 8px 10px; margin-top: 4px; border-top: 1px solid var(--rule); font-size: var(--fs-sm); font-weight: 600; }
.results [role="option"] { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 7px 10px; border-radius: var(--r); cursor: pointer; }
.results [role="option"] small { display: block; color: var(--ink-2); font-size: var(--fs-xs); }
.results [role="option"][aria-selected="true"], .results [role="option"]:hover { background: var(--violet-tint); }

.tabpanel { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 14px 16px 22px; }
.tabpanel:focus { outline: none; }
.foot { display: flex; justify-content: space-between; gap: 12px; padding: 4px 16px 8px; min-height: 22px; font-size: var(--fs-xs); color: var(--ink-2); }
.foot-link { color: var(--ink-2); font-weight: 600; white-space: nowrap; text-underline-offset: 3px; }

/* ------------------------------------------------------------ map key */
.mapkey { position: fixed; top: 12px; right: 12px; z-index: 3; width: 348px; max-height: calc(100vh - 24px); overflow-y: auto; overflow-x: hidden;
  background: var(--face); border: 1px solid var(--rule-2); border-radius: var(--r); box-shadow: var(--shadow-sheet); }
.mk-head { display: flex; align-items: center; gap: 6px; padding: 9px 9px 9px 14px; border-bottom: 3px solid var(--violet); }
.mk-head h2 { margin: 0 auto 0 0; font-family: var(--font-x); font-size: 1.35rem; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: 1; }
.mk-body { display: grid; gap: 14px; padding: 12px 14px 14px; }
.mapkey.closed .mk-body { display: none; }
.mapkey.closed .mk-head { border-bottom-width: 0; }
.mapkey.closed #key-toggle svg { transform: rotate(180deg); }
.mk-mini { display: flex; align-items: center; gap: 8px; padding: 8px 14px 10px; font-size: var(--fs-sm); font-weight: 700; }
.mk-mini svg { width: 16px; height: 16px; flex: none; }
.mk-mini[hidden] { display: none; }
.mk-mini .strip { display: grid; grid-template-columns: repeat(5, 14px); height: 10px; box-shadow: 0 0 0 1px var(--ink); }
.mk-mini .strip i { display: block; }
.legend { display: grid; gap: 5px; }
.legend-title { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
.legend .bands { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--ink); }
.band { padding: 5px 2px 4px; text-align: center; font-family: var(--font-semi); font-size: 0.8125rem; font-weight: 700; line-height: 1.1; }
.band + .band { border-left: 1px solid rgb(0 0 0 / .25); }
.legend .ends { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
.overlays { display: grid; gap: 6px; }
.ov-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ov-veil { display: grid; grid-template-columns: auto 1fr 44px; align-items: center; gap: 10px; margin-top: 8px; font-size: var(--fs-sm); font-weight: 600; }
.ov-veil input { width: 100%; min-height: 28px; accent-color: var(--violet); }
.ov-veil output { text-align: right; font-family: var(--font-semi); font-weight: 700; font-variant-numeric: tabular-nums; }
.toggle { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 9px; font-size: var(--fs-sm); font-weight: 600; text-align: left;
  background: var(--face); border: 1px solid var(--rule-2); border-radius: var(--r); cursor: pointer; }
.toggle:hover { border-color: var(--ink); }
.toggle::before { content: ""; flex: none; width: 15px; height: 15px; border: 1.5px solid var(--ink); border-radius: var(--r); }
.toggle[aria-pressed="true"]::before { background: var(--violet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--violet); }
.sw-line { flex: none; width: 20px; height: 3px; }
.sw-line.rail { background: linear-gradient(90deg, #007734 0 33%, #115d91 33% 66%, #be1414 66%); }
.sw-line.rail.ring { height: 5px; background: #ff7ab8; box-shadow: 0 0 0 1.5px #ffffff, 0 0 0 2.5px var(--rule-2); }
.sw-line.dist { background: repeating-linear-gradient(90deg, var(--ink) 0 5px, transparent 5px 8px); }
.settings { margin: 0 12px 12px; padding: 14px; display: grid; gap: 14px; background: var(--face-2); border: 1px solid var(--rule); border-radius: var(--r); }
.settings[hidden] { display: none; }
.settings h2 { margin: 0; font-family: var(--font-x); font-size: 1.2rem; font-weight: 800; text-transform: uppercase; }
.set-row { display: grid; gap: 7px; }
.schemes { display: grid; gap: 5px; }
.schemes button { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; text-align: left; min-height: 36px; padding: 6px 9px;
  border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--face); cursor: pointer; font-size: var(--fs-sm); }
.schemes button[aria-checked="true"] { border-color: var(--violet); box-shadow: inset 0 0 0 1px var(--violet); font-weight: 700; }
.sw { display: grid; grid-template-columns: repeat(5, 1fr); height: 12px; box-shadow: 0 0 0 1px var(--ink); }
.sw i { display: block; }

/* ------------------------------------------------------------ score cells */
.k0 { background: var(--k0); color: var(--k0-ink); } .k1 { background: var(--k1); color: var(--k1-ink); }
.k2 { background: var(--k2); color: var(--k2-ink); } .k3 { background: var(--k3); color: var(--k3-ink); }
.k4 { background: var(--k4); color: var(--k4-ink); } .kn { background: var(--nodata); color: var(--ink-2); }
.chip { display: inline-grid; place-items: center; min-width: 32px; height: 24px; padding: 0 5px; border-radius: var(--r);
  font-family: var(--font-semi); font-size: var(--fs-sm); font-weight: 700; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .3); }
.pips { display: inline-flex; gap: 2px; vertical-align: middle; }
.pips i { width: 8px; height: 8px; border: 1.3px solid var(--ink); }
.pips i.on { background: var(--ink); }
.verdict { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin: 14px 0 0; }
.cell-badge { display: grid; place-items: center; width: 84px; height: 84px; border-radius: var(--r);
  font-family: var(--font-x); font-size: var(--fs-hero); font-weight: 800; line-height: 1; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .3); }
.verdict .cls { font-family: var(--font-x); font-size: 1.75rem; font-weight: 800; text-transform: uppercase; line-height: 1; }
.verdict .pct { margin: 6px 0 0; color: var(--ink); font-size: var(--fs-md); line-height: 1.4; }
.verdict .pct b { font-weight: 700; }
.verdict .delta { white-space: nowrap; font-weight: 700; }
.levels { margin: 14px 0 0; }
.levels button { flex-direction: row; justify-content: space-between; gap: 8px; min-height: 42px; padding: 4px 10px; font-size: 0.875rem; }
.levels button[aria-checked="true"] { background: var(--ink); color: var(--face); }
.levels .chip { min-width: 34px; }
.ranks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 12px 0 0; font-size: var(--fs-sm); font-weight: 600; }
.ranks svg { width: 16px; height: 16px; flex: none; }
.rank-link { padding: 4px 9px; background: var(--face); border: 1px solid var(--violet); border-radius: var(--r); color: var(--ink); cursor: pointer; font-size: var(--fs-sm); }
.rank-link b { color: var(--violet-deep); }
.rank-link:hover { background: var(--violet-tint); }

/* ------------------------------------------------------------ Ort tab (compact) */
.place-nav { min-height: 20px; margin-bottom: 6px; }
.place-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.btn-sm { min-height: 32px; padding: 0 10px; flex: none; }
.place-head h2 { margin: 0; font-family: var(--font-x); font-size: var(--fs-xl); font-weight: 800; line-height: 1; text-transform: uppercase; letter-spacing: .005em; }
.place-head h2:focus { outline: none; }
.place-head .sub { display: block; margin-top: 4px; color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.place-actions { margin: 12px 0 0; }
.bars { display: grid; gap: 6px; }
.pbar { display: grid; grid-template-columns: 18px 112px 1fr 28px; gap: 10px; align-items: center; font-size: var(--fs-sm); font-weight: 500; }
.pbar svg { width: 16px; height: 16px; color: var(--ink-2); }
.pbar .track { height: 10px; background: var(--track); overflow: hidden; }
.pbar .fill { height: 100%; box-shadow: inset -1px 0 0 rgb(0 0 0 / .3); }
.pbar .v { text-align: right; font-family: var(--font-semi); font-weight: 700; }
.pbar.dim { color: var(--ink-3); }
.pbar .off-tag { font-family: var(--font-semi); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1px solid currentColor; border-radius: var(--r); padding: 0 4px; margin-left: 4px; }
table.facts { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.facts th { text-align: right; font-family: var(--font-semi); font-weight: 700; color: var(--ink); font-size: 0.8125rem; letter-spacing: .06em; text-transform: uppercase; padding: 0 0 4px 8px; }
table.facts th:first-child { text-align: left; padding-left: 0; }
table.facts td { padding: 4px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; color: var(--ink); }
table.facts td + td { text-align: right; padding-left: 8px; white-space: nowrap; }
table.facts td:nth-child(2) { font-weight: 700; }
table.facts td:nth-child(3) { color: var(--ink-2); }
/* better / worse than Berlin: a small square with + or −, never an arrow (arrows read as a trend) */
.cmpto { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 5px; border: 1.5px solid currentColor; border-radius: var(--r);
  font-family: var(--font-semi); font-size: 0.8125rem; font-weight: 800; line-height: 1; vertical-align: 1px; color: var(--ink); }
.cmpto.up { color: var(--good); } .cmpto.down { color: var(--bad); }
.nodata { font-weight: 500; font-style: italic; color: var(--ink-2); }
table.facts .wrap { white-space: normal; }
.trend { font-weight: 700; } .trend.up { color: var(--good); } .trend.down { color: var(--bad); }
.note { font-size: var(--fs-sm); color: var(--ink); margin: 12px 0 0; max-width: 64ch; line-height: 1.45; }
.empty { padding: 12px 2px; }
.empty-title { margin: 0 0 8px; font-family: var(--font-x); font-size: var(--fs-xl); font-weight: 800; text-transform: uppercase; line-height: 1; }
.empty p { margin: 0 0 14px; color: var(--ink); max-width: 46ch; font-size: var(--fs-md); }
.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.recent button { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; padding: 6px 4px; background: none; border: 0; text-align: left; cursor: pointer; }
.recent button:hover { background: var(--violet-tint); }
.recent .nm { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .bz { display: block; font-size: var(--fs-xs); }
.example-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.example-list .btn { text-transform: none; letter-spacing: 0; font-family: var(--font); font-weight: 600; font-size: var(--fs-sm); padding: 0 10px 0 4px; }

/* ------------------------------------------------------------ Ranking tab */
.rk-head { display: grid; gap: 8px; margin-bottom: 8px; }
.rk-tools { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: center; }
.rk-tools > * { min-width: 0; }
.rk-tools.has-value { grid-template-columns: 1fr 1fr auto auto; }
.rk-tools .toggle { white-space: nowrap; }
.bez-pick { position: relative; }
.bez-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 36px; padding: 6px 10px; background: var(--face); color: var(--ink);
  border: 1px solid var(--rule-2); border-radius: var(--r); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; text-align: left; }
.bez-btn .bez-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bez-btn.on { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.bez-btn:focus-visible { outline: none; border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.bez-menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-height: 60vh; overflow: auto; padding: 6px;
  background: var(--face); border: 1.5px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow-sheet); }
.bez-quick { display: flex; gap: 14px; padding: 4px 6px 8px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.bez-opt { display: flex; align-items: center; gap: 8px; padding: 5px 6px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; border-radius: var(--r); }
.bez-opt:hover { background: var(--face-2); }
.bez-opt input { width: 16px; height: 16px; accent-color: var(--violet); margin: 0; }
.rk-tools input, .rk-tools select, .form input, .form textarea {
  min-height: 36px; padding: 6px 9px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--face); font-size: var(--fs-sm); }
.rk-tools input:focus, .rk-tools select:focus, .form input:focus, .form textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.rk-count { font-size: var(--fs-xs); color: var(--ink-2); margin: 6px 0; }
.rk-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); table-layout: fixed; }
.rk-table col.c-n { width: 50px; } .rk-table col.c-tot { width: 50px; } .rk-table col.c-v { width: 40px; } .rk-table col.c-land { width: 50px; }
/* the whole head is sticky: the column titles and, under them, the pinned place (separate borders, so rows never show through) */
.rk-table thead { position: sticky; top: -14px; z-index: 2; }
.rk-table thead th { background: var(--face); padding: 8px 0 6px; border-bottom: 3px solid var(--orange); text-align: left; vertical-align: bottom;
  font-family: var(--font-semi); font-size: 0.75rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); }
.rk-table th.num, .rk-table td.num { text-align: center; }
/* three fixed lines in every header: icon, short name, arrow slot (empty unless sorted) */
.rk-table th button { display: inline-grid; grid-template-rows: 20px 14px 12px; justify-items: center; align-items: center; gap: 2px; width: 100%;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.rk-table th button svg { width: 19px; height: 19px; }
.rk-table th .ico-eur { font-family: var(--font-x); font-size: 1.15rem; font-weight: 800; line-height: 20px; }
.rk-table th .lbl { font-size: 0.6875rem; line-height: 14px; white-space: nowrap; }
.rk-table th .arr { font-size: 0.625rem; line-height: 12px; color: var(--violet); }
.rk-table th button:hover { color: var(--violet); }
.rk-table th.on button { color: var(--violet); }
.rk-table td { padding: 8px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.rk-table td.sorted { background: var(--violet-tint); }
.rk-table .pin-row td { background: var(--face); border-bottom: 3px solid var(--violet); cursor: pointer; }
.rk-table .pin-row td:first-child { box-shadow: inset 4px 0 0 var(--violet); }
.rk-table .pin-row:hover td { background: var(--violet-tint); }
.rk-table td.pin-name { position: relative; padding-right: 34px; }
/* same as the search box's clear button: orange square, bold white × */
.unpin { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 28px; height: 28px; padding: 0; display: grid; place-items: center;
  background: var(--orange); border: 0; border-radius: var(--r); color: #ffffff; cursor: pointer; }
.unpin svg path { stroke-width: 2.6; }
.unpin:hover { background: var(--orange-deep); }
.rk-table tr.is-pin td { background: var(--violet-tint); }
/* the row last clicked (shown on the map) */
.rk-table tr.is-sel td { background: var(--face-2); }
.rk-table tr.is-sel td:first-child { box-shadow: inset 4px 0 0 var(--ink); }
/* pin a row on the map: the button sits at the end of the name cell, solid once pinned */
.rk-table td.name-cell { position: relative; padding-right: 34px; }
.map-pin-btn { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 28px; height: 28px; padding: 0; display: grid; place-items: center;
  background: var(--face); border: 1px solid var(--rule-2); border-radius: var(--r); color: var(--ink-3); cursor: pointer; opacity: 0; }
.rk-table tr:hover .map-pin-btn, .map-pin-btn:focus-visible, .map-pin-btn[aria-pressed="true"] { opacity: 1; }
.map-pin-btn:hover { border-color: var(--ink); color: var(--ink); }
.map-pin-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--face); }
.map-pin-btn[aria-pressed="true"] circle { fill: var(--ink); }
.pins-note { font-weight: 700; }
/* pins on the map: the brand pin with the score in its head, the name beside it; the tip marks the place */
.rank-pin { position: relative; width: 34px; height: 52px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--ink); }
.rank-pin .pin-shape { position: absolute; inset: 0; width: 34px; height: 52px; overflow: visible; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .3)); }
.rank-pin .pin-shape path { fill: var(--violet); stroke: #ffffff; stroke-width: 4; paint-order: stroke; }
.rank-pin .pin-shape circle { fill: #ffffff; }
.rank-pin .pin-num { position: absolute; left: 0; width: 34px; top: 12px; text-align: center; font-family: var(--font-x); font-weight: 800; font-size: var(--fs-sm); line-height: 1; letter-spacing: -.02em; color: #121212; font-variant-numeric: tabular-nums; }
.rank-pin .lbl { position: absolute; left: 30px; top: 6px; padding: 2px 7px; background: var(--face); color: var(--ink); border: 1.5px solid var(--ink); border-radius: var(--r);
  font-family: var(--font-semi); font-weight: 700; font-size: var(--fs-xs); white-space: nowrap; box-shadow: var(--shadow-sheet); }
.rank-pin:hover .pin-shape path, .rank-pin:focus-visible .pin-shape path { fill: var(--ink); }
.rank-pin:focus-visible { outline: none; }
@media (hover: none) { .map-pin-btn { opacity: 1; } }
.rk-table tr.is-pin td:first-child { box-shadow: inset 4px 0 0 var(--violet); }
@keyframes row-flash { from { background: var(--sun); } }
.rk-table tr.flash td { animation: row-flash 1.2s ease-out; }
.rk-table tbody tr { cursor: pointer; }
.rk-table tbody tr:hover, .rk-table tbody tr:focus-visible { background: var(--face-2); outline: 2px solid var(--violet); outline-offset: -2px; }
.rk-table .nm { display: block; font-family: var(--font-semi); font-weight: 700; font-size: 0.9375rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
.rk-table .bz { display: block; margin-top: 1px; font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
.rk-table td.rk-n { padding: 8px 8px 8px 6px; text-align: right; font-family: var(--font-semi); font-weight: 700; white-space: nowrap; }
.rk-table td.rk-n + td { padding-left: 10px; }
.rk-table th.rk-hn { text-align: right; padding-right: 8px; }
.rk-table th.rk-hname { padding-left: 10px; }
.rk-table .chip { min-width: 34px; height: 24px; }
/* a theme value: the number in ink over a bar in its class colour */
.tick { display: inline-block; min-width: 28px; padding-bottom: 2px; border-bottom: 4px solid var(--kc, var(--nodata)); font-family: var(--font-semi); font-weight: 700; font-size: 0.875rem; line-height: 1.2; }
.t0 { --kc: var(--k0); } .t1 { --kc: var(--k1); } .t2 { --kc: var(--k2); } .t3 { --kc: var(--k3); } .t4 { --kc: var(--k4); } .tn { --kc: var(--nodata); }
.rk-table .ctx { font-family: var(--font-semi); font-weight: 700; font-size: 0.8125rem; }
.rk-table col.c-pl { width: 42px; }
.rk-table td.pl { font-family: var(--font-semi); font-weight: 800; color: var(--good); }
.rk-more { margin-top: 12px; }

/* ------------------------------------------------------------ Vergleich tab: wide, no scrolling */
.cmp-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cmp-top .muted { font-size: var(--fs-xs); margin-left: auto; }
.cmp-top .w-intro { margin: 0; }
.cmp-formview { max-width: 620px; }
/* a flat's pin: the brand pin, its number white in the violet head (panel 20 px wide, map 30 px) */
.pin { position: relative; display: inline-block; flex: none; width: 20px; height: 31px; vertical-align: middle; color: var(--on-violet); }
.pin .pin-shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pin .pin-shape path { fill: var(--violet); stroke: var(--face); stroke-width: 5; paint-order: stroke; }
.pin b { position: absolute; left: 0; right: 0; top: 5px; text-align: center; font-family: var(--font-semi); font-weight: 800; font-size: var(--fs-xs); line-height: 1; font-variant-numeric: tabular-nums; }
.map-pin { cursor: pointer; border: 0; padding: 0; background: none; width: 30px; height: 46px; }
.map-pin .pin-shape { filter: drop-shadow(0 2px 3px rgb(0 0 0 / .35)); transform-origin: 50% 100%; }
.map-pin .pin-shape path { stroke: #ffffff; stroke-width: 4; }
.map-pin b { top: 9px; font-size: var(--fs-sm); }
.map-pin:hover .pin-shape path, .map-pin:focus-visible .pin-shape path { fill: var(--ink); }
.map-pin:hover b, .map-pin:focus-visible b { color: var(--face); }
.map-pin:focus-visible { outline: none; }
.subtabs { margin: 0 0 12px; }
.form { display: grid; gap: 10px; padding: 14px; background: var(--face-2); border: 1px solid var(--rule); border-radius: var(--r); }
.form .row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.form label { display: grid; gap: 3px; font-family: var(--font-semi); font-size: 0.75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); position: relative; }
.form label input, .form label select { width: 100%; min-width: 0; text-transform: none; letter-spacing: 0; font-family: var(--font); font-weight: 400; color: var(--ink); }
.form .fgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 10px; }
.form .s6 { grid-column: span 6; } .form .s3 { grid-column: span 3; } .form .s2 { grid-column: span 2; }
.form textarea { min-height: 130px; resize: vertical; }
.form .actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.form .msg { font-size: var(--fs-sm); color: var(--ink); margin: 0; max-width: 70ch; }
.form .msg.err { color: var(--bad); font-weight: 700; }
.bookmarklet { text-decoration: none; cursor: grab; }
.cmp-cards { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.fcard { display: grid; align-content: start; gap: 3px; min-width: 0; padding: 10px 12px; border: 1px solid var(--rule-2); border-top: 3px solid var(--violet); }
.fcard { position: relative; }
/* remove: the same orange × as search and unpin, top right; the card then asks once more */
.fc-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; display: grid; place-items: center;
  background: var(--orange); border: 0; border-radius: var(--r); color: #ffffff; cursor: pointer; }
.fc-x svg path { stroke-width: 2.6; }
.fc-x:hover { background: var(--orange-deep); }
.fcard .fc-head { padding-right: 30px; }
.fcard.confirm { align-content: space-between; background: var(--face-2); border-top-color: var(--orange); }
.fcard.confirm p { margin: 0 0 10px; font-size: var(--fs-sm); }
.fcard.confirm .acts { gap: 8px; }
.fc-head { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 2px; }
.fc-head .nm { flex: 1; min-width: 0; padding: 0; background: none; border: 0; text-align: left; cursor: pointer; color: var(--ink);
  font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.fc-head .nm:hover { color: var(--violet); }
/* "Karte" in Vergleich: the flat's pin hops (inner shape only; MapLibre owns the marker's own transform) */
@keyframes pin-hop { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-10px); } 60% { transform: translateY(0); } 75% { transform: translateY(-3px); } }
.map-pin.pulse .pin-shape, .map-pin.pulse b { animation: pin-hop .8s cubic-bezier(.3, .7, .4, 1) 2; }
@media (prefers-reduced-motion: reduce) { .map-pin.pulse .pin-shape, .map-pin.pulse b { animation: none; } }
.fcard .bz { font-size: var(--fs-xs); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fcard .tag.warn { background: var(--orange); color: #121212; border-color: var(--orange); font-weight: 700; }
/* Mietspiegel rows: the sign says above or below the cap; above, the number sits on orange like the card's tag */
.cmp .cap { font-weight: 700; }
.cmp .cap.over { padding: 1px 4px; background: var(--orange); color: #121212; border-radius: var(--r); }
.cmp td small { display: block; font-size: var(--fs-xs); font-weight: 500; line-height: 1.15; white-space: normal; }
.cmp .nodata-txt { display: block; font-size: var(--fs-xs); font-weight: 600; line-height: 1.15; white-space: normal; }
.msp-note { margin-top: 6px; }
.msp-note summary { cursor: pointer; font-weight: 700; color: var(--violet); }
.msp-note[open] summary { margin-bottom: 4px; }
.fgrid .fhint { margin: 0; font-size: var(--fs-xs); font-weight: 500; }
.tag { padding: 1px 6px; border-radius: var(--r); background: var(--violet-tint); color: var(--ink); font-family: var(--font-semi); font-size: 0.75rem; font-weight: 700; }
.fcard .acts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: var(--fs-sm); }
.fcard .acts a { color: var(--violet); font-weight: 600; font-size: var(--fs-sm); }
.cmp-secs { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(150px + var(--n) * 50px), 1fr)); gap: 0 22px; align-items: start; }
.cmp-sec .sec { margin-top: 0; }
.cmp-col { display: grid; gap: 18px; align-content: start; min-width: 0; }
.cmp .cmp-txt { display: block; font-size: var(--fs-xs); font-weight: 600; line-height: 1.2; white-space: normal; }
/* the listing's text, folded in the card */
.fc-text { margin-top: 8px; border-top: 1px solid var(--rule); padding-top: 6px; }
.fc-text summary { cursor: pointer; font-family: var(--font-semi); font-weight: 700; font-size: var(--fs-sm); color: var(--violet); }
.fc-text summary small { font-weight: 600; color: var(--ink); margin-left: 4px; }
.fc-text-body { max-height: 320px; overflow: auto; margin-top: 6px; padding-right: 4px; font-size: var(--fs-sm); line-height: 1.45; }
.fc-text-body h4 { margin: 8px 0 2px; font-family: var(--font-semi); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fc-text-body p { margin: 0; white-space: pre-line; }
.cmp { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); table-layout: fixed; }
.cmp th, .cmp td { height: 30px; padding: 3px 4px; border-bottom: 1px solid var(--rule); text-align: center; white-space: nowrap; }
.cmp thead th { height: auto; padding: 0 4px 6px; border-bottom: 1px solid var(--rule-2); }
.cmp thead th:first-child, .cmp tbody th { width: 44%; }
.cmp tbody th { text-align: left; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.cmp tbody th svg { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; color: var(--ink-2); }
.cmp tbody th span { overflow: hidden; text-overflow: ellipsis; }
.cmp td { font-family: var(--font-semi); font-weight: 600; }
.cmp .chip { min-width: 32px; height: 22px; }
.cmp td.best { font-weight: 800; background: var(--violet-tint); }
.cmp td.best::after { content: "★"; position: absolute; top: 2px; right: 3px; font-size: .62em; line-height: 1; color: var(--violet); }
.cmp td { position: relative; }
.approx { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: var(--r); background: var(--sun); color: #121212; font-size: 11px; font-weight: 800; }

/* ------------------------------------------------------------ Gewichtung tab */
.w-intro { margin: 0 0 12px; color: var(--ink); font-size: var(--fs-sm); max-width: 52ch; }
.presets { grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; }
#weights { display: grid; gap: 8px; }
.w { display: grid; grid-template-columns: 26px 18px 120px 1fr 34px; align-items: center; gap: 10px; font-size: var(--fs-sm); font-weight: 600; }
.w-on { width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--face); color: transparent; cursor: pointer; }
.w .w-on svg { width: 16px; height: 16px; color: inherit; }
.w-on[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: var(--on-violet); }
.w-on:disabled { cursor: not-allowed; }
.w-on:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.w.off .w-name, .w.off > svg { opacity: .55; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.w.off output { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; }
.w-offnote { margin-top: 10px; }
.w svg { width: 16px; height: 16px; color: var(--ink-2); }
.w input { width: 100%; accent-color: var(--violet); min-height: 28px; }
.w output { text-align: right; font-family: var(--font-x); font-weight: 800; font-size: 1.2rem; }
.w-scale { display: flex; justify-content: space-between; margin: 0 44px 0 194px; font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
.w-note { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin: 14px 0 0; padding: 9px 11px; background: var(--violet-tint); border-radius: var(--r); font-size: var(--fs-sm); }
.preview ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.preview li button { display: grid; grid-template-columns: 22px 34px minmax(0, 1fr); gap: 8px; align-items: center; width: 100%; padding: 4px; background: none; border: 0; text-align: left; cursor: pointer; }
.preview li button:hover { background: var(--violet-tint); }
.preview .n { font-family: var(--font-semi); color: var(--ink-2); font-weight: 700; }
.preview .nm { font-weight: 700; font-size: var(--fs-sm); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview .bz { font-size: var(--fs-xs); color: var(--ink-2); display: block; }

/* ------------------------------------------------------------ method */
.prose p, .prose li { color: var(--ink); font-size: var(--fs-sm); max-width: 62ch; }
.prose h2 { font-family: var(--font-x); font-size: var(--fs-xl); font-weight: 800; text-transform: uppercase; margin: 0 0 10px; line-height: 1; }
.prose h3 { margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 3px solid var(--violet); font-family: var(--font-semi); font-size: 0.875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.prose table { border-collapse: collapse; width: 100%; font-size: var(--fs-xs); }
.prose th, .prose td { text-align: left; padding: 5px 6px 5px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose td.num, .prose th.num { text-align: right; }
.prose ul { padding-left: 18px; }

/* ------------------------------------------------------------ Mein Bereich: my places */
.mine-title { margin: 0 0 12px; font-family: var(--font-x); font-size: var(--fs-xl); font-weight: 800; text-transform: uppercase; line-height: 1; }
.account { display: flex; gap: 12px; align-items: flex-start; padding: 12px; background: var(--face-2); border: 1px solid var(--rule); border-radius: var(--r); }
.account p { margin: 2px 0 0; font-size: var(--fs-sm); }
.myplaces { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.mp { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 40px 10px 10px; border: 1px solid var(--rule-2); }
.mp.off .mp-main > b, .mp.off .mp-main > .bz { text-decoration: line-through; text-decoration-thickness: 1px; }
.mp .bz { display: block; font-size: var(--fs-xs); margin-top: 1px; }
.mp-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; font-size: var(--fs-sm); font-weight: 600; }
.mp-ctl select, .form select { min-height: 32px; padding: 3px 6px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--face); font-size: var(--fs-sm); }
.mp-ctl .toggle { min-height: 32px; }
.mp .fc-x { top: 8px; right: 8px; }
.mp.confirm { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-right: 10px; background: var(--face-2); border-color: var(--orange); }
.mp.confirm .mp-acts { display: flex; gap: 8px; }
/* place kinds, 3 x 2: the frame colour shows through a 1 px gap, so every cell has a clear edge */
.mp-form .kinds { grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule-2); }
.mp-form .kinds button { border: 0; background: var(--face); min-height: 38px; }
.mp-form .kinds button:hover { background: var(--face-2); }
.mp-form .kinds button[aria-checked="true"] { background: var(--violet); }
.seg.modes { display: inline-grid; grid-template-columns: repeat(4, auto); }
.seg.modes button { min-height: 32px; padding: 3px 10px; }
.mp-form .seg.modes { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 3px; }
.mp-form .lbl { display: block; font-family: var(--font-semi); font-size: 0.75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.mine-global-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; font-size: var(--fs-sm); }
.mine-global { font-weight: 700; }
.myplaces.all-off, .w-mine.all-off { opacity: .55; }
#mine-key { gap: 7px; }
#mine-key[hidden] { display: none; }
.mp-form .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mine-pin { display: grid; place-items: center; width: 26px; height: 26px; background: var(--orange); color: #121212; border: 2px solid #ffffff; border-radius: var(--r);
  box-shadow: 0 2px 6px rgb(0 0 0 / .4); font-family: var(--font-semi); font-weight: 800; font-size: 0.875rem; cursor: default; }
.mine-pin.off { background: var(--face); color: var(--ink); border-color: var(--ink); box-shadow: none; }
.mine-pin.static { box-shadow: none; border-color: transparent; }
.mine-pin.static.off { border-color: var(--ink); }
.mine-facts tr.off td { text-decoration: line-through; text-decoration-thickness: 1px; }
.mine-facts .kind { font-weight: 500; }
.w-mine { display: grid; gap: 8px; }
.w-place.off span, .w-place.off output { text-decoration: line-through; }
.mp-check { width: 18px; height: 18px; padding: 0; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--face); cursor: pointer; }
.mp-check[aria-pressed="true"] { background: var(--violet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--violet); }
.w-mine-empty { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin: 16px 0 0; padding: 10px 12px; border: 1px dashed var(--rule-2); font-size: var(--fs-sm); }
/* quick zoom out to all of Berlin */
.fit-berlin { justify-self: start; gap: 8px; }
.key-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.key-acts .btn { gap: 8px; }
/* share picture dialog: preview on the left, headline / format / actions on the right */
.sharepic { padding: 0; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--face); color: var(--ink);
  width: min(980px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow-sheet); }
.sharepic::backdrop { background: rgb(18 18 18 / .55); }
.sp-box { display: flex; flex-direction: column; max-height: calc(100dvh - 36px); }
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 10px 18px; border-bottom: 3px solid var(--orange); }
.sp-head h2 { margin: 0; font-family: var(--font-x); font-weight: 800; font-size: var(--fs-xl); text-transform: uppercase; letter-spacing: .01em; }
.sp-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, 1fr); gap: 20px; padding: 18px; overflow: auto; }
.sp-stage { display: grid; place-items: center; min-height: 320px; background: var(--face-2); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px; }
.sp-stage.busy .sp-img { opacity: .45; }
.sp-img[hidden] { display: none; }
.sp-img { display: block; max-width: 100%; max-height: calc(100dvh - 190px); height: auto; box-shadow: 0 2px 10px rgb(0 0 0 / .18); transition: opacity .15s; }
.sp-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sp-whatline { margin: 0; font-size: var(--fs-sm); }
.sp-field { display: grid; gap: 6px; }
.sp-field input { min-height: 38px; padding: 6px 10px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--face); color: var(--ink); font: inherit; font-weight: 600; }
.sp-field input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.sp-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-acts .btn[hidden] { display: none; }
.sp-msg { margin: 0; min-height: 1.2em; font-size: var(--fs-sm); font-weight: 700; }
@media (max-width: 720px) {
  .sp-body { grid-template-columns: 1fr; }
  .sp-img { max-height: 52dvh; }
}
.ctrl-berlin { display: grid !important; place-items: center; color: var(--ink); }

/* ------------------------------------------------------------ first-visit tour */
.tour { position: fixed; z-index: 9; width: 300px; padding: 14px 14px 12px; background: var(--ink); color: var(--face); border-radius: var(--r); box-shadow: var(--shadow-sheet); }
.tour p { margin: 4px 0 12px; font-size: var(--fs-md); line-height: 1.45; }
.tour-n { font-family: var(--font-semi); font-size: 0.8125rem; font-weight: 700; letter-spacing: .08em; color: var(--orange); }
.tour-acts { display: flex; justify-content: space-between; align-items: center; }
.tour .link { color: var(--face); }
.tour::before { content: ""; position: absolute; width: 12px; height: 12px; background: var(--ink); transform: rotate(45deg); }
.tour-below::before { top: -6px; left: 22px; }
.tour-left::before { right: -6px; top: 22px; }
.tour-map::before, .tour-phone::before { display: none; }
.tour-phone { left: 12px !important; right: 12px; top: 12px !important; width: auto; }
.tour-target { outline: 3px solid var(--orange) !important; outline-offset: 3px; }

/* ------------------------------------------------------------ toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 8; display: flex; gap: 14px; align-items: center;
  padding: 10px 14px; background: var(--ink); color: var(--face); border-radius: var(--r); box-shadow: var(--shadow-sheet); font-size: var(--fs-sm); }
.toast[hidden] { display: none; }
.toast button { background: none; border: 0; color: var(--orange); font-weight: 800; text-decoration: underline; cursor: pointer; }

/* ------------------------------------------------------------ map chrome */
.maplibregl-popup-content { background: var(--face); color: var(--ink); padding: 7px 10px; border-radius: var(--r); box-shadow: var(--shadow-sheet); font-size: var(--fs-sm); border: 1px solid var(--ink); }
.maplibregl-popup-tip { border-top-color: var(--ink) !important; border-bottom-color: var(--ink) !important; }
.tip { display: flex; align-items: center; gap: 8px; }
.tip small { color: var(--ink-2); font-weight: 600; }
.maplibregl-ctrl-group { background: var(--face) !important; border: 1px solid var(--ink); border-radius: var(--r) !important; box-shadow: none !important; }
.maplibregl-ctrl-group button { width: 36px !important; height: 36px !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--ink) !important; }
:root[data-theme="dark"] .maplibregl-ctrl-icon { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .maplibregl-ctrl-icon { filter: invert(1); } }
.maplibregl-ctrl-attrib.maplibregl-compact { background: var(--face); color: var(--ink-2); }
.maplibregl-ctrl-attrib a { color: var(--ink-2); }

/* mid-size screens: panel and map key share the width without overlapping */
@media (min-width: 721px) and (max-width: 1240px) {
  :root { --panel-w: min(825px, calc(100vw - 352px)); --panel-wide: calc(100vw - 352px); }
  .mapkey { width: 314px; }
}

/* ------------------------------------------------------------ phone: bottom sheet, key as a strip */
@media (max-width: 720px) {
  #panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 56vh; }
  #panel.sheet-peek { height: 150px; }
  #panel.sheet-full { height: 92vh; }
  body.collapsed #panel { transform: translateY(calc(100% + 12px)); }
  .bar { padding: 8px 10px; }
  .word { font-size: 1.5rem; }
  #collapse svg { transform: rotate(-90deg); }
  #reopen .chev { transform: rotate(-90deg); }
  #reopen { top: auto; bottom: 14px; left: 50%; transform: translateX(-50%); }
  .mapkey { top: 8px; right: 8px; left: 8px; width: auto; max-height: 42vh; }
  .tabs button, .seg button, .btn, .toggle, .icon-btn, .mini-seg button { min-height: 44px; }
  .icon-btn { width: 44px; }
  .q-clear { top: 2px; right: 2px; width: 40px; height: 40px; }
  #q { min-height: 44px; padding-right: 48px; }
  .rk-tools { grid-template-columns: 1fr 1fr; }
  .rk-wrap { overflow-x: auto; }
  .rk-table { min-width: 600px; }
  #panel.wide { width: auto; }
  .cmp-cards { grid-template-columns: repeat(var(--n), minmax(150px, 1fr)); overflow-x: auto; }
  .form .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form .s6, .form .s3 { grid-column: span 2; } .form .s2 { grid-column: span 1; }
  .w { grid-template-columns: 26px 18px 100px 1fr 34px; }
  .w-scale { margin-left: 174px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
