/* global-weather.net – Hell/Dunkel über CSS-Variablen, Links/Rechts über logische Eigenschaften (RTL für Arabisch) */
@font-face { font-family: 'Inter'; src: url('fonts/Inter-Medium.otf') format('opentype'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/Inter-ExtraBold.otf') format('opentype'); font-weight: 700 900; font-display: swap; }

:root {
  --bg: #f4f6f9; --fg: #0f1b2d; --muted: #5b6b80; --card: rgba(255,255,255,.92); --card-solid: #fff; --line: rgba(15,27,45,.12);
  --accent: #1f6feb; --accent-fg: #fff; --hover: rgba(31,111,235,.08); --shadow: 0 8px 30px rgba(15,27,45,.16);
  --bar: rgba(255,255,255,.86); --ok: #16a34a; --warn: #d4a106; --bad: #dc2626; --new: #94a3b8;
  --r: 14px; --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Arabic', Tahoma, sans-serif;
  color-scheme: light;
}
html[data-mode="dark"] {
  --bg: #0b1424; --fg: #e6edf7; --muted: #93a4bb; --card: rgba(16,26,44,.9); --card-solid: #111c30; --line: rgba(230,237,247,.12);
  --accent: #58a6ff; --accent-fg: #06101f; --hover: rgba(88,166,255,.12); --shadow: 0 8px 30px rgba(0,0,0,.5);
  --bar: rgba(11,20,36,.82); --ok: #22c55e; --warn: #facc15; --bad: #f87171; --new: #64748b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.45; }
[hidden] { display: none !important; }
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
.gw-skip { position: absolute; inset-inline-start: -999px; }
.gw-skip:focus { inset-inline-start: 8px; top: 8px; z-index: 99; background: var(--card-solid); padding: 6px 10px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Kopfzeile ---------- */
.gw-bar { position: fixed; z-index: 20; inset: 0 0 auto 0; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--bar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.gw-logo { display: flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-weight: 800; white-space: nowrap; letter-spacing: -.01em; }
.gw-logo svg { width: 26px; height: 26px; color: var(--accent); }
.gw-logo b { color: var(--accent); font-weight: 800; }
.gw-views { flex: 1; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; padding: 0 4px; }
.gw-views::-webkit-scrollbar { display: none; }
.gw-views a { display: flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; color: var(--muted); text-decoration: none; white-space: nowrap; font-weight: 500; }
.gw-views a:hover { background: var(--hover); color: var(--fg); }
.gw-views a[aria-current] { background: var(--accent); color: var(--accent-fg); }
.gw-sep { width: 1px; background: var(--line); margin: 6px 4px; flex: none; }
.gw-ic { width: 18px; height: 18px; flex: none; }
.gw-flex { flex: 1; }
.gw-tools { display: flex; gap: 4px; align-items: center; }
.gw-btn { position: relative; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: transparent; white-space: nowrap; }
.gw-btn:hover, .gw-btn[aria-expanded="true"] { background: var(--hover); }
.gw-badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: var(--accent-fg); font: 700 11px/18px var(--font); text-align: center; padding: 0 4px; font-style: normal; }
.gw-units { direction: ltr; unicode-bidi: isolate; }
.gw-units b { opacity: .4; font-weight: 700; }
html[data-units="metric"] .gw-units b[data-u="metric"], html[data-units="imperial"] .gw-units b[data-u="imperial"] { opacity: 1; color: var(--accent); }
.gw-langwrap { position: relative; }
.gw-langmenu { position: absolute; inset-inline-end: 0; top: 44px; width: 250px; background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.gw-langmenu a { padding: 7px 10px; border-radius: 8px; color: var(--fg); text-decoration: none; }
.gw-langmenu a:hover { background: var(--hover); }
.gw-langmenu a[aria-current] { background: var(--accent); color: var(--accent-fg); }
.gw-more { grid-column: 1 / -1; border-top: 1px solid var(--line); margin-top: 6px; padding: 8px 6px 4px; display: grid; gap: 4px; }
.gw-more label { font-weight: 600; font-size: 13px; }
.gw-more select { font: inherit; padding: 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.gw-more small { color: var(--muted); font-size: 11.5px; }

/* ---------- Karte ---------- */
.gw-mapwrap { position: fixed; inset: 56px 0 0 0; }
#gw-map { position: absolute; inset: 0; background: #06101f; }
html[data-mode="light"] #gw-map { background: #dfe8f2; }
.gw-busy { position: absolute; top: 12px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 5; background: var(--card); padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow); font-size: 13px; display: flex; gap: 8px; align-items: center; }
html[dir="rtl"] .gw-busy { transform: translateX(50%); }
.gw-busy::before { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); border-top-color: transparent; animation: gw-spin .8s linear infinite; }
@keyframes gw-spin { to { transform: rotate(360deg); } }
.gw-legend { position: absolute; z-index: 4; bottom: 34px; inset-inline-start: 12px; background: var(--card); backdrop-filter: blur(8px); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 12px; min-width: 240px; max-width: min(360px, 70vw); font-size: 12.5px; }
.gw-legend h3 { margin: 0 0 4px; font-size: 13px; }
.gw-legend .gw-bar2 { height: 10px; border-radius: 5px; }
html[dir="rtl"] .gw-legend .gw-bar2 { transform: scaleX(-1); }
.gw-legend .gw-ticks { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .gw-legend .gw-ticks { flex-direction: row-reverse; }
.gw-legend .gw-ticks { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.gw-legend p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.gw-time { position: absolute; z-index: 4; bottom: 34px; inset-inline-end: 12px; width: min(460px, calc(100vw - 24px)); background: var(--card); backdrop-filter: blur(8px); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; }
.gw-prod { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.gw-prod button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; }
.gw-prod button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.gw-trow { display: flex; align-items: center; gap: 10px; }
.gw-play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-fg); flex: none; }
.gw-slider { flex: 1; accent-color: var(--accent); }
.gw-tlabel { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 60px; text-align: end; }
.gw-tinfo { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.gw-tinfo img { display: block; max-width: 100%; height: 28px; margin: 4px 0; background: #fff; border-radius: 4px; }
.gw-hint { position: absolute; z-index: 3; top: 10px; inset-inline-end: 12px; margin: 0; background: var(--card); padding: 5px 10px; border-radius: 999px; font-size: 12px; color: var(--muted); box-shadow: var(--shadow); transition: opacity .6s; }
.gw-hint.is-gone { opacity: 0; pointer-events: none; }

/* MapLibre an Hell/Dunkel anpassen */
.maplibregl-popup-content { background: var(--card-solid); color: var(--fg); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; font: 13px/1.45 var(--font); min-width: 200px; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; inset-inline-end: 4px; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--card-solid); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--card-solid); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--card-solid); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--card-solid); }
.maplibregl-ctrl-group { background: var(--card-solid) !important; }
html[data-mode="dark"] .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { background: var(--card) !important; color: var(--muted); font-size: 10.5px; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
html[data-mode="dark"] .maplibregl-ctrl-attrib-button { filter: invert(1); }
.gw-pop h4 { margin: 0 24px 2px 0; font-size: 14px; }
html[dir="rtl"] .gw-pop h4 { margin: 0 0 2px 24px; }
.gw-pop .gw-pv, .gw-pop td + td, .gw-istat b { unicode-bidi: isolate; direction: ltr; }
.gw-pop .gw-pv { display: inline-block; margin: 6px 0; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: 18px; color: #fff; background: var(--c); text-shadow: 0 1px 2px rgba(0,0,0,.35); font-variant-numeric: tabular-nums; }
.gw-pop table { border-collapse: collapse; width: 100%; margin: 4px 0; }
.gw-pop td { padding: 2px 0; } .gw-pop td + td { text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; }
.gw-pop small { color: var(--muted); display: block; margin-top: 4px; }
.gw-pop img.gw-flag { width: 18px; height: 13px; vertical-align: -1px; border-radius: 2px; margin-inline-end: 4px; }

/* ---------- Seitenleisten (Netze, Gestalten) ---------- */
.gw-panel { position: fixed; z-index: 15; top: 64px; bottom: 8px; inset-inline-end: 8px; width: min(380px, calc(100vw - 16px)); overflow-y: auto; background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px 18px; animation: gw-slide .25s ease-out; }
@keyframes gw-slide { from { opacity: 0; transform: translateY(-8px); } }
.gw-phead { display: flex; justify-content: space-between; align-items: center; }
.gw-phead h2 { margin: 0; font-size: 18px; }
.gw-x { border: 0; background: transparent; font-size: 18px; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.gw-x:hover { background: var(--hover); }
.gw-pintro { color: var(--muted); margin: 6px 0 10px; font-size: 13.5px; }
.gw-netbtns, .gw-pbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.gw-netbtns button, .gw-pbtns button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.gw-netbtns button:hover, .gw-pbtns button:hover { background: var(--hover); }
.gw-netcount { font-weight: 600; margin: 10px 0 4px; }
.gw-netlist h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 4px; }
.gw-net { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 6px; border-radius: 10px; }
.gw-net:hover { background: var(--hover); }
.gw-net.is-dim { opacity: .55; }
.gw-net .gw-nname { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.gw-net .gw-nname img { width: 18px; height: 13px; border-radius: 2px; flex: none; }
.gw-net .gw-nmeta { grid-column: 2 / 4; color: var(--muted); font-size: 12px; }
.gw-net .gw-nmeta a { color: var(--muted); }
.gw-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--new); box-shadow: 0 0 0 2px var(--card-solid); }
.gw-dot.is-gruen { background: var(--ok); box-shadow: 0 0 0 2px var(--card-solid), 0 0 8px var(--ok); }
.gw-dot.is-gelb { background: var(--warn); }
.gw-dot.is-rot { background: var(--bad); }
.gw-dot.is-neu, .gw-dot.is-aus, .gw-dot.is-hidden { background: var(--new); }
.gw-switch { position: relative; width: 38px; height: 22px; flex: none; }
.gw-switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.gw-switch span { position: absolute; inset: 0; border-radius: 11px; background: var(--line); transition: background .2s; }
.gw-switch span::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: inset-inline-start .2s; }
.gw-switch input:checked + span { background: var(--accent); }
.gw-switch input:checked + span::after { inset-inline-start: 19px; }
.gw-switch input:disabled + span { opacity: .4; }
.gw-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.gw-states { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12px; }
.gw-states li { display: flex; align-items: center; gap: 6px; }
fieldset { border: 0; padding: 0; margin: 14px 0 0; }
legend { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.gw-maps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gw-maps button { border: 2px solid var(--line); border-radius: 12px; background: var(--bg); padding: 0; overflow: hidden; text-align: start; font-size: 12px; }
.gw-maps button[aria-pressed="true"] { border-color: var(--accent); }
.gw-maps button i { display: block; height: 54px; background-size: cover; background-position: center; }
.gw-maps button span { display: block; padding: 5px 8px; }
.gw-radio, .gw-check { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.gw-radio input, .gw-check input { accent-color: var(--accent); width: 16px; height: 16px; }
.gw-seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gw-seg button { flex: 1; border: 0; background: transparent; padding: 7px 6px; font-size: 13px; }
.gw-seg button + button { border-inline-start: 1px solid var(--line); }
.gw-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.gw-seg small { display: block; font-size: 10.5px; opacity: .8; }
.gw-pbtns { margin-top: 16px; }
.gw-toast { position: fixed; z-index: 50; bottom: 60px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-weight: 600; animation: gw-fade 2.4s forwards; }
@keyframes gw-fade { 0% { opacity: 0; } 10%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Fusszeile ---------- */
.gw-foot { position: fixed; z-index: 3; bottom: 0; inset-inline: 0; height: 26px; display: flex; gap: 14px; align-items: center; padding: 0 12px; font-size: 11.5px; background: var(--bar); backdrop-filter: blur(8px); border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.gw-foot a { color: var(--muted); text-decoration: none; }
.gw-foot a:hover { color: var(--fg); }
.gw-disc { color: var(--muted); overflow: hidden; text-overflow: ellipsis; margin-inline-start: auto; }
.is-map .maplibregl-ctrl-bottom-right, .is-map .maplibregl-ctrl-bottom-left { bottom: 26px; }

/* WhatsApp teilen (klein, in der Fusszeile) */
.gw-wa { display: inline-flex !important; align-items: center; gap: 5px; background: #25d366; color: #fff !important; border-radius: 999px; padding: 2px 10px 2px 7px; font-weight: 700; font-size: 11.5px; line-height: 18px; }
.gw-wa:hover { background: #1ebe5a; }
.gw-wa svg { width: 14px; height: 14px; }

/* ---------- Begrüssung: Weltkugel dreht, hält an, Texte kommen ---------- */
#gw-intro { position: fixed; z-index: 30; inset: 56px 0 26px 0; display: grid; place-items: center; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(3,8,18,.55) 100%); transition: opacity .7s; }
#gw-intro.is-out { opacity: 0; }
.gw-ibox { pointer-events: auto; text-align: center; color: #fff; max-width: min(720px, 92vw); padding: 24px; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.gw-ibox > * { opacity: 0; transform: translateY(14px); }
#gw-intro.is-text .gw-ibox > * { animation: gw-up .8s cubic-bezier(.2,.7,.2,1) forwards; }
#gw-intro.is-text .gw-itag { animation-delay: .25s; }
#gw-intro.is-text .gw-iwelcome { animation-delay: .5s; }
#gw-intro.is-text .gw-istats { animation-delay: .8s; }
#gw-intro.is-text .gw-igo { animation-delay: 1.2s; }
@keyframes gw-up { to { opacity: 1; transform: none; } }
.gw-ititle { font-size: clamp(30px, 6vw, 58px); margin: 0; font-weight: 900; letter-spacing: -.03em; }
.gw-ititle b { color: #7cc4ff; }
.gw-itag { font-size: clamp(15px, 2.2vw, 19px); margin: 6px 0 0; opacity: .92; }
.gw-iwelcome { font-size: clamp(20px, 3.4vw, 30px); font-weight: 800; margin: 18px 0 14px; color: #ffe08a; }
.gw-istats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 76px; }
.gw-istat { background: rgba(8,16,32,.8); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 10px 14px; min-width: 128px; text-shadow: none; animation: gw-pop .6s cubic-bezier(.2,.9,.3,1.3) both; }
.gw-istat b { display: block; font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.gw-istat span { font-size: 12px; opacity: .8; }
.gw-istat em { display: block; font-style: normal; font-size: 12px; opacity: .9; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes gw-pop { from { opacity: 0; transform: scale(.8); } }
.gw-iload { opacity: .85; }
.gw-igo { margin-top: 22px; border: 0; border-radius: 999px; padding: 12px 26px; font-weight: 800; font-size: 16px; background: #fff; color: #0b1424; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.gw-igo:hover { transform: translateY(-1px); }
.gw-iskip { pointer-events: auto; position: absolute; bottom: 16px; inset-inline-end: 16px; border: 1px solid rgba(255,255,255,.4); background: rgba(0,0,0,.3); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { #gw-intro.is-text .gw-ibox > *, .gw-istat { animation-duration: .01s !important; animation-delay: 0s !important; } }

/* ---------- Textseiten ---------- */
.is-page .gw-page { padding: 80px 16px 60px; }
.gw-page article { max-width: 760px; margin: 0 auto; background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 28px; }
.gw-page h1 { margin-top: 0; }
.gw-page h2 { font-size: 17px; margin-top: 26px; }
.gw-src { padding-inline-start: 18px; } .gw-src li { margin: 8px 0; } .gw-src .is-off { opacity: .55; }

/* ---------- schmale Bildschirme ---------- */
@media (max-width: 900px) {
  .gw-views a span, .gw-lbl { display: none; }
  .gw-views a { padding: 8px 9px; }
  .gw-logo span { display: none; }
  .gw-disc { display: none; }
}
@media (max-width: 600px) {
  .gw-bar { padding: 0 6px; gap: 4px; }
  .gw-btn { padding: 0 7px; }
  .gw-legend { min-width: 0; inset-inline-end: 12px; bottom: 34px; }
  .gw-time { bottom: 110px; }
  .gw-panel { top: auto; bottom: 30px; max-height: 70vh; }
  .gw-hint { display: none; }
}
