/* Apps – Gestaltung nach Apples Human Interface Guidelines:
   Systemschrift, gruppierte Listen, Tab-Leiste am Handy / Seitenleiste am Desktop,
   hell/dunkel automatisch nach Systemeinstellung. Kontraste ≥ 4,5:1 für Text. */
:root {
  --bg: #f2f2f7;            /* systemGroupedBackground */
  --karte: #ffffff;         /* secondarySystemGroupedBackground */
  --karte-2: #e5e5ea;
  --text: #000000;
  --text-2: #6c6c70;        /* 5,1:1 auf Weiß */
  --linie: #c6c6c8;
  --ak-h: #0066cc; --ak-d: #409cff;   /* Akzent hell / dunkel – über data-akzent wählbar */
  --akzent: var(--ak-h);
  --auf-akzent: #ffffff;    /* Schrift auf Akzentflächen */
  --akzent-bg: color-mix(in srgb, var(--akzent) 14%, transparent);
  --gruen: #248a3d; --rot: #d70015; --orange: #c93400; --orange-bg: #fff1e6;
  --balken: rgba(249, 249, 249, .86);
  --schatten: 0 12px 40px rgba(0, 0, 0, .18);
  --radius: 12px;
  --zeile: 48px;
  --schrift: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, sans-serif;
  --schrift-gross: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
/* Akzentfarben: jeweils hell (≥ 4,5:1 auf Weiß) und dunkel (≥ 4,5:1 auf Schwarz) */
:root[data-akzent="lila"]    { --ak-h: #8944ab; --ak-d: #da8fff; }
:root[data-akzent="pink"]    { --ak-h: #c4004f; --ak-d: #ff6482; }
:root[data-akzent="rot"]     { --ak-h: #d70015; --ak-d: #ff6961; }
:root[data-akzent="orange"]  { --ak-h: #c93400; --ak-d: #ffb340; }
:root[data-akzent="gruen"]   { --ak-h: #248a3d; --ak-d: #30d158; }
:root[data-akzent="tuerkis"] { --ak-h: #007d8f; --ak-d: #5ac8f5; }
:root[data-akzent="indigo"]  { --ak-h: #3634a3; --ak-d: #7d7aff; }
:root[data-akzent="graphit"] { --ak-h: #3a3a3c; --ak-d: #d1d1d6; }
/* Erscheinungsbild: automatisch nach System, oder fest hell / dunkel (data-theme) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) {
    --bg: #000000; --karte: #1c1c1e; --karte-2: #2c2c2e; --text: #ffffff; --text-2: #aeaeb2;
    --linie: #38383a; --akzent: var(--ak-d); --auf-akzent: #000000;
    --gruen: #30d158; --rot: #ff6961; --orange: #ffb340; --orange-bg: #3a2a12;
    --balken: rgba(22, 22, 24, .86); --schatten: 0 12px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dunkel"] {
    --bg: #000000; --karte: #1c1c1e; --karte-2: #2c2c2e; --text: #ffffff; --text-2: #aeaeb2;
    --linie: #38383a; --akzent: var(--ak-d); --auf-akzent: #000000;
    --gruen: #30d158; --rot: #ff6961; --orange: #ffb340; --orange-bg: #3a2a12;
    --balken: rgba(22, 22, 24, .86); --schatten: 0 12px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
}
@media (prefers-contrast: more) {
  :root { --text-2: color-mix(in srgb, var(--text) 78%, var(--karte)); --linie: #8e8e93; }
}

/* Kategorie-Farben (Systemfarben) – nur als Punkt neben dem Namen, nie als alleiniger Bedeutungsträger */
.farbe-blau { --kf: #007aff; } .farbe-gruen { --kf: #34c759; } .farbe-orange { --kf: #ff9500; }
.farbe-rot { --kf: #ff3b30; } .farbe-lila { --kf: #af52de; } .farbe-pink { --kf: #ff2d55; }
.farbe-gelb { --kf: #ffcc00; } .farbe-grau { --kf: #8e8e93; } .farbe-tuerkis { --kf: #30b0c7; }
.farbe-braun { --kf: #a2845e; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 17px/1.35 var(--schrift); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--akzent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9;
      stroke-linecap: round; stroke-linejoin: round; }
.ic.gross { width: 56px; height: 56px; stroke-width: 1.4; color: var(--text-2); }

/* ------------------------------------------------------------------ Rahmen */
.rahmen { min-height: 100vh; }
.inhalt { padding: 0 16px calc(96px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }
.inhalt.schmal { max-width: 760px; padding-bottom: 40px; }

.seitenleiste { display: none; }
.tableiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(4px + env(safe-area-inset-bottom));
  background: var(--balken); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--linie);
}
.tableiste a {
  flex: 1; min-width: 0; min-height: 48px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-2); font-size: 10.5px; font-weight: 500;
}
.tableiste a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tableiste a .ic { width: 26px; height: 26px; }
.tableiste a.aktiv { color: var(--akzent); }
.tableiste a.aktiv .ic { fill: var(--akzent-bg); }
@media (prefers-reduced-transparency: reduce) { .tableiste { background: var(--karte); backdrop-filter: none; } }

@media (min-width: 900px) {
  body { font-size: 15px; }
  :root { --zeile: 44px; }
  .tableiste { display: none; }
  .rahmen { display: grid; grid-template-columns: 236px 1fr; }
  .seitenleiste {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    padding: 18px 12px; border-right: .5px solid var(--linie); background: var(--bg);
  }
  .marke { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font: 700 20px/1 var(--schrift-gross); }
  .marke img { width: 30px; height: 30px; border-radius: 8px; }
  .seitenleiste ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .seitenleiste a {
    display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px;
    border-radius: 9px; color: var(--text); font-weight: 500;
  }
  .seitenleiste a .ic { color: var(--akzent); width: 20px; height: 20px; }
  .seitenleiste a:hover { background: var(--karte-2); }
  .seitenleiste a.aktiv { background: var(--akzent); color: var(--auf-akzent); }
  .seitenleiste a.aktiv .ic { color: var(--auf-akzent); }
  .seitenleiste .unten { margin-top: auto; }
  .inhalt { padding: 0 32px 48px; margin: 0; max-width: none; }
  .inhalt.schmal { margin: 0 auto; }
}

/* ------------------------------------------------------------------ Kopf mit großem Titel */
.kopf { padding-top: max(10px, env(safe-area-inset-top)); margin-bottom: 8px; }
.werkzeuge { display: flex; align-items: center; gap: 4px; min-height: 44px; position: relative; }
.abstand { flex: 1; }
.kopf h1 { font: 700 34px/1.15 var(--schrift-gross); letter-spacing: .01em; margin: 2px 0 10px; }
@media (min-width: 900px) { .kopf { padding-top: 22px; } .kopf h1 { font-size: 28px; } }
.unterzeile, .vorzeile { color: var(--text-2); margin: -4px 0 12px; font-size: 15px; }
.vorzeile { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.vorzeile .ic { width: 16px; height: 16px; }

.suche { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; margin-bottom: 14px;
         border-radius: 11px; background: var(--karte-2); color: var(--text-2); max-width: 520px; }
.suche .ic { width: 18px; height: 18px; }
.suche input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; color: var(--text); }
.suche input::placeholder { color: var(--text-2); }

/* ------------------------------------------------------------------ Knöpfe */
.knopf-text { border: 0; background: none; color: var(--akzent); padding: 0 8px; min-height: 44px; cursor: pointer; font-size: 17px; }
.knopf-text.fett { font-weight: 600; }
.knopf-text.klein { font-size: 15px; min-height: 36px; }
.knopf-icon {
  border: 0; background: none; color: var(--akzent); width: 44px; height: 44px; border-radius: 22px;
  display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
.knopf-icon:hover, .knopf-text:hover { background: var(--akzent-bg); border-radius: 10px; }
.knopf-icon.rot, .knopf-text.rot { color: var(--rot); }
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; padding: 0 22px;
  border-radius: 12px; border: 0; background: var(--karte-2); color: var(--akzent); font-weight: 600; cursor: pointer;
}
.knopf.primaer { background: var(--akzent); color: var(--auf-akzent); }
.knopf.voll { width: 100%; margin-top: 4px; }
@media (min-width: 900px) { .knopf-text { font-size: 15px; } .knopf { min-height: 40px; } }

/* Menü (Pull-down) */
.menue {
  position: absolute; right: 0; top: 46px; z-index: 30; min-width: 220px; padding: 6px;
  background: var(--karte); border-radius: 13px; box-shadow: var(--schatten); border: .5px solid var(--linie);
}
.menue button { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.menue button:hover, .menue button:focus-visible { background: var(--akzent-bg); }
.menue .ic { color: var(--akzent); }

/* ------------------------------------------------------------------ Gruppierte Listen */
.gruppe-titel { font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: .02em;
  color: var(--text-2); margin: 26px 16px 7px; }
.gruppe-fuss { font-size: 13px; color: var(--text-2); margin: 7px 16px 0; }
.gruppe {
  list-style: none; margin: 0 0 10px; padding: 0; background: var(--karte); border-radius: var(--radius); overflow: hidden;
}
.gruppe > * + *, .liste > * + * { border-top: .5px solid var(--linie); }
.gruppe > input[type=hidden] + *, .gruppe > input[hidden] + * { border-top: 0; }
.leer-zeile { margin: 0; padding: 14px 16px; color: var(--text-2); }
.leer-zeile .ic { width: 17px; height: 17px; vertical-align: -3px; }

.zeile { display: flex; align-items: center; min-height: var(--zeile); padding-right: 6px; position: relative; background: var(--karte); }
.zeile-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; min-height: var(--zeile);
  color: var(--text); border: 0; background: none; text-align: left; cursor: pointer; width: 100%;
}
.zeile-link:hover { background: var(--karte-2); }
.zeile-link:active { background: var(--linie); }
.fav { width: 28px; height: 28px; border-radius: 7px; flex: none; object-fit: contain; background: #fff; }
.fav.buchstabe, .fav.symbol { display: grid; place-items: center; font-weight: 600; font-size: 15px; color: #fff; background: var(--kf, #8e8e93); }
.fav.symbol { background: var(--akzent); color: var(--auf-akzent); }
.fav.symbol .ic { width: 18px; height: 18px; }
.txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u, .n { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.n { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pfeil { color: var(--linie); width: 18px; height: 18px; }
.zeile-knopf {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--zeile); padding: 0 16px;
  border: 0; background: var(--karte); color: var(--akzent); cursor: pointer; text-align: left;
}
.zeile-knopf:hover { background: var(--karte-2); }
.zeile-knopf.rot { color: var(--rot); }
.zeile-aktionen { display: flex; align-items: center; gap: 2px; }
.zeile-aktionen form { margin: 0; }
.freigabe .txt { padding: 10px 14px; }
.freigabe .u { white-space: normal; }
.freigabe.inaktiv .t { color: var(--text-2); text-decoration: line-through; }

/* Formularfelder in Gruppen (Beschriftung links, Wert rechts) */
.feld { display: flex; align-items: center; gap: 12px; min-height: var(--zeile); padding: 0 16px; }
.feld > span:first-child { flex: none; width: 108px; }
.feld input:not([type=checkbox]):not([type=radio]), .feld select {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 10px 0; color: var(--text);
}
.feld input::placeholder { color: var(--text-2); }
.feld input[type=file] { font-size: 14px; }
.feld .wert { color: var(--text-2); }
.gruppe textarea { display: block; width: 100%; border: 0; background: transparent; padding: 12px 16px; resize: vertical; outline: none; min-height: 110px; line-height: 1.4; }
.schalter-zeile { justify-content: space-between; }
.schalter-zeile > span:first-child { width: auto; }
input[role=switch] {
  appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; margin: 0;
  background: var(--karte-2); position: relative; cursor: pointer; transition: background .2s; flex: none;
}
input[role=switch]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .2s; }
input[role=switch]:checked { background: #34c759; }
input[role=switch]:checked::after { transform: translateX(20px); }

/* ------------------------------------------------------------------ Hinweise, Toast */
.hinweis { margin: 14px 0 0; padding: 12px 16px; border-radius: var(--radius); background: var(--karte); font-size: 15px; }
.hinweis.ok { box-shadow: inset 4px 0 0 var(--gruen); }
.hinweis.error { box-shadow: inset 4px 0 0 var(--rot); }
.fehler { color: var(--rot); font-size: 15px; margin: 8px 16px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 50;
  bottom: calc(84px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 14px;
  padding: 8px 8px 8px 18px; border-radius: 26px; background: #1c1c1e; color: #fff; box-shadow: var(--schatten);
  font-size: 15px; max-width: calc(100% - 32px);
}
.toast button { border: 0; background: none; color: #64b5ff; font-weight: 600; padding: 8px 12px; cursor: pointer; border-radius: 18px; }
.toast button:empty { display: none; }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* ------------------------------------------------------------------ Favoriten */
.kats { display: grid; gap: 22px 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: start; }
.kat { min-width: 0; }
.kat-kopf { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px 6px 16px; }
.kat-kopf .punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--kf); flex: none; }
.kat-kopf h2 { font: 600 20px/1.2 var(--schrift-gross); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kat-kopf .anzahl { color: var(--text-2); font-size: 15px; margin-right: auto; }
.kat-aktionen { display: flex; align-items: center; }
.liste { list-style: none; margin: 0; padding: 0; background: var(--karte); border-radius: var(--radius); overflow: hidden; min-height: 8px; }
.liste:empty { min-height: var(--zeile); background: transparent; border: 1.5px dashed var(--linie); }
.zeile-neu {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 6px; padding: 0 16px;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--akzent); cursor: pointer;
}
.zeile-neu:hover { background: var(--akzent-bg); }
.zeile .info { color: var(--text-2); width: 40px; height: 40px; }
.zeile .info:hover { color: var(--akzent); }
.griff { display: inline-grid; place-items: center; width: 44px; height: 44px; color: var(--text-2); cursor: grab; touch-action: none; flex: none; }
.nur-bearbeiten { display: none !important; }
.bearbeiten .nur-bearbeiten { display: flex !important; }
.bearbeiten span.griff.nur-bearbeiten { display: inline-grid !important; }
.bearbeiten .zeile .info { display: none; }
.bearbeiten .kats, #einst.bearbeiten [data-sort] { user-select: none; -webkit-user-select: none; }
.bearbeiten .zeile-link { pointer-events: none; }
#einst.bearbeiten .zeile-link { pointer-events: none; }
#einst.bearbeiten .zeile-link .pfeil { display: none; }

/* Ziehen: halbtransparente Kopie folgt dem Finger, Platzhalter zeigt die Einfügestelle */
.zieh-kopie { position: fixed; z-index: 100; pointer-events: none; opacity: .92; box-shadow: var(--schatten);
  border-radius: var(--radius); transform: scale(1.02); background: var(--karte); }
.platzhalter { background: var(--akzent-bg) !important; border-radius: 10px; box-shadow: inset 0 0 0 2px var(--akzent); }
.platzhalter > * { visibility: hidden; }
body.zieht { cursor: grabbing; user-select: none; -webkit-user-select: none; }

.leer, .leer-gross { color: var(--text-2); text-align: center; }
.leer-gross { padding: 64px 16px; display: grid; justify-items: center; gap: 4px; }
.leer-gross h2 { color: var(--text); font: 600 22px/1.2 var(--schrift-gross); margin: 10px 0 0; }
.leer-gross p { margin: 0 0 14px; }

/* ------------------------------------------------------------------ Apps */
.abschnitt .gruppe-titel { margin-top: 22px; }
.abschnitt-kopf { display: flex; align-items: flex-end; gap: 4px; }
.abschnitt-kopf .gruppe-titel { flex: 1; cursor: pointer; margin-bottom: 7px; }
.abschnitt-kopf .anzahl { text-transform: none; margin-left: 4px; }
.abschnitt-kopf .knopf-icon, .abschnitt-kopf .griff { width: 40px; height: 40px; }
.abschnitt.zu > .apps-liste { display: none; }
.apps-liste > li.app { display: flex; align-items: center; }
.apps-liste > li.app > .app-inhalt { flex: 1; min-width: 0; }
#apps.bearbeiten .abschnitte { user-select: none; -webkit-user-select: none; }
#apps.bearbeiten a.app-inhalt { pointer-events: none; }
.apps-liste > li { list-style: none; }
.app-inhalt { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 9px 14px; color: var(--text); }
a.app-inhalt:hover { background: var(--karte-2); }
.status { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--linie); }
.status.ok { background: var(--gruen); }
.status.aus { background: transparent; box-shadow: inset 0 0 0 2.5px var(--rot); }   /* Ring statt Punkt: nicht nur Farbe */
.app .u { white-space: normal; }
.pille { align-self: flex-start; margin-top: 4px; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600;
  color: var(--orange); background: var(--orange-bg); }
.rechts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; max-width: 42%; }
.port { font: 600 13px/1.4 ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; color: var(--text);
  background: var(--karte-2); padding: 1px 8px; border-radius: 7px; }
.domain { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
@media (max-width: 560px) { .domain { display: none; } }
@media (min-width: 1100px) {
  #apps .abschnitt { display: grid; grid-template-columns: 1fr; }
}
.dreht .ic { animation: drehen 1s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dreht .ic { animation: none; opacity: .5; } * { transition: none !important; } }

/* ------------------------------------------------------------------ Blätter (Sheets) */
dialog.blatt {
  border: 0; padding: 0 16px 24px; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh;
  border-radius: 14px 14px 0 0; background: var(--bg); color: var(--text); box-shadow: var(--schatten);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) dialog.blatt { --bg: #1c1c1e; --karte: #2c2c2e; --karte-2: #3a3a3c; --linie: #48484a; }
}
:root[data-theme="dunkel"] dialog.blatt { --bg: #1c1c1e; --karte: #2c2c2e; --karte-2: #3a3a3c; --linie: #48484a; }
dialog.blatt::backdrop { background: rgba(0, 0, 0, .4); }
dialog.blatt[open] { animation: hoch .28s cubic-bezier(.2, .9, .3, 1); }
@keyframes hoch { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 700px) { dialog.blatt { margin: auto; border-radius: 14px; } }
@media (prefers-reduced-motion: reduce) { dialog.blatt[open] { animation: none; } }
.blatt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 2;
  margin: 0 -16px 8px; padding: 8px 8px; background: var(--bg); border-bottom: .5px solid var(--linie); }
.blatt-kopf h2 { font-size: 17px; font-weight: 600; margin: 0; }
.blatt-text { color: var(--text-2); margin: 10px 4px 14px; font-size: 15px; }
.blatt-text.klein { font-size: 13px; margin-top: 8px; }
.blatt-text strong { color: var(--text); font-weight: 600; }
.blatt .gruppe-titel { margin-top: 18px; }
.blatt.neu .nur-alt, .blatt:not(.neu) .nur-neu { display: none !important; }
.ergebnis input { font-size: 14px; }
.farbwahl, .symbolwahl { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.farbwahl > *, .symbolwahl > * { border-top: 0 !important; }
.farbwahl label { width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; position: relative; }
.farbwahl .punkt { width: 30px; height: 30px; border-radius: 50%; background: var(--kf); }
.farbwahl input, .symbolwahl input { position: absolute; opacity: 0; }
.farbwahl input:checked + .punkt { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--kf); }
.farbwahl input:focus-visible + .punkt, .symbolwahl input:focus-visible + span { outline: 3px solid var(--akzent); outline-offset: 2px; }
.symbolwahl label { width: 48px; height: 48px; position: relative; cursor: pointer; }
.symbolwahl label span:not(.sr) { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: var(--karte-2); color: var(--text); }
.symbolwahl input:checked + span { background: var(--akzent) !important; color: var(--auf-akzent) !important; }

/* ------------------------------------------------------------------ Anmeldung, Freigabe */
.anmeldung { max-width: 400px; margin: 0 auto; padding: max(60px, env(safe-area-inset-top)) 16px 40px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.anmeldung .logo { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.anmeldung h1 { font: 700 28px/1.2 var(--schrift-gross); margin: 14px 0 0; }
.anmeldung form { width: 100%; text-align: left; margin-top: 18px; overflow: visible; padding-bottom: 12px; background: transparent; }
.anmeldung form .feld { background: var(--karte); }
.anmeldung form .feld:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.anmeldung form .feld:nth-last-of-type(1) { border-radius: 0 0 var(--radius) var(--radius); }
.anmeldung form > * + * { border-top: .5px solid var(--linie); }
.anmeldung form > .knopf, .anmeldung form > .fehler { border-top: 0; margin-top: 16px; }
.anmeldung .hinweis { width: 100%; text-align: left; }
.geteilt .kopf { padding-top: max(28px, env(safe-area-inset-top)); }
.fuss { text-align: center; color: var(--text-2); font-size: 13px; margin: 32px 0 0; }

/* ------------------------------------------------------------------ Darstellung, Protokoll */
.segment { display: flex; gap: 2px; padding: 2px; margin: 8px 12px; border-radius: 9px; background: var(--karte-2); }
.segment label { flex: 1; position: relative; }
.segment input { position: absolute; opacity: 0; }
.segment span { display: block; text-align: center; padding: 7px 4px; border-radius: 7px; font-size: 14px; cursor: pointer; min-height: 32px; }
.segment input:checked + span { background: var(--karte); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
:root[data-theme="dunkel"] .segment input:checked + span { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="hell"]) .segment input:checked + span { background: #636366; } }
.segment input:focus-visible + span { outline: 3px solid var(--akzent); outline-offset: 1px; }
.akzentwahl label { flex-direction: column; width: 56px; height: auto; gap: 4px; border-radius: 10px; padding: 4px 0; }
.akzentwahl .name { font-size: 11px; color: var(--text-2); }
.logo-zeile { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.logo-zeile img { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: var(--karte-2); }
.protokoll .zeile { padding: 8px 14px; gap: 12px; align-items: flex-start; }
.protokoll .ic-rund { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--karte-2); color: var(--text-2); }
.protokoll .ic-rund .ic { width: 15px; height: 15px; }
.protokoll .a-neu .ic-rund { color: var(--gruen); } .protokoll .a-geloescht .ic-rund { color: var(--rot); }
.protokoll .a-anmeldung .ic-rund, .protokoll .a-konto .ic-rund { color: var(--orange); }
.protokoll .t { white-space: normal; }
.protokoll .zeit { font-size: 13px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.symbol-zeile { display: flex; align-items: center; gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
.symbol-zeile .fav { width: 40px; height: 40px; border-radius: 9px; }
.symbol-zeile .knopf-text { min-height: 36px; font-size: 15px; }
.knopf-text.rot { color: var(--rot); }
.symbol-zeile .fav[hidden], .symbol-zeile .buchstabe[hidden] { display: none; }

/* ------------------------------------------------------------------ Notizen */
.notizen { columns: 300px; column-gap: 16px; }
.notiz { break-inside: avoid; margin: 0 0 16px; background: var(--karte); border-radius: var(--radius); padding: 12px 14px 10px;
  cursor: pointer; position: relative; }
.geteilt .notiz { cursor: default; }
.notiz:hover { box-shadow: 0 0 0 1px var(--linie); }
.notiz.angeheftet { box-shadow: inset 3px 0 0 var(--akzent); }
.notiz-kopf { display: flex; align-items: flex-start; gap: 6px; }
.notiz-kopf h2 { flex: 1; margin: 2px 0 4px; font: 600 17px/1.3 var(--schrift-gross); overflow-wrap: anywhere; }
.notiz-kopf .knopf-icon { margin: -8px -10px -6px auto; }
.angeheftet-ic { color: var(--akzent); padding-top: 2px; }
.angeheftet-ic .ic { width: 16px; height: 16px; }
.notiz-text { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; max-height: 22em; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 85%, transparent); mask-image: linear-gradient(#000 85%, transparent); }
.geteilt .notiz-text { max-height: none; -webkit-mask-image: none; mask-image: none; }
.notiz-text > :first-child { margin-top: 0; }
.notiz-text p { margin: 0 0 6px; }
.notiz-text h3 { font-size: 15px; font-weight: 600; margin: 10px 0 4px; }
.notiz-text ul, .notiz-text ol { margin: 0 0 6px; padding-left: 20px; }
.notiz-text li.aufgabe { list-style: none; margin-left: -20px; }
.notiz-text li.aufgabe label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; padding: 2px 0; }
.notiz-text li.aufgabe input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--akzent); flex: none; }
.notiz-text li.erledigt span { color: var(--text-2); text-decoration: line-through; }
.notiz-text code { font: 13px ui-monospace, "SF Mono", Consolas, monospace; background: var(--karte-2); padding: 1px 5px; border-radius: 5px; }
.notiz-text a { overflow-wrap: anywhere; }
.notiz-fuss { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.notiz-titel-feld { font-weight: 600; font-size: 17px; }
dialog.blatt.breit { max-width: 760px; }
#notiz-blatt textarea { min-height: 40vh; font-size: 16px; }

/* ------------------------------------------------------------------ Webcams & Wetter */
.wetter { background: var(--karte); border-radius: var(--radius); padding: 14px 16px 10px; margin-bottom: 18px; }
.wetter-jetzt { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wetter-ic { width: 52px; height: 52px; stroke-width: 1.5; color: var(--akzent); }
.wetter-wert { display: flex; flex-direction: column; }
.wetter-temp { font: 300 44px/1 var(--schrift-gross); font-variant-numeric: tabular-nums; }
.wetter-text { font-size: 15px; color: var(--text-2); }
.wetter-ort { display: flex; flex-direction: column; margin-left: auto; text-align: right; min-width: 0; }
.wetter-ort .t { font-weight: 600; white-space: normal; }
.wetter-ort .t .ic { width: 16px; height: 16px; vertical-align: -2px; margin-right: 3px; color: var(--text-2); }
.wetter-tage { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: .5px solid var(--linie);
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; text-align: center; }
.wetter-tage li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; }
.wetter-tage .tag { font-weight: 600; font-size: 13px; }
.wetter-tage .ic { width: 26px; height: 26px; }
.wetter-tage .mm { font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.wetter-tage .mm b { color: var(--text); font-weight: 600; }
.wetter-tage .nied { font-size: 12px; color: var(--akzent); }
.wetter-tage .nied.leer { color: var(--text-2); }
.wetter-quelle { margin: 10px 0 0; font-size: 12px; color: var(--text-2); }
.knopf-link { border: 0; background: none; padding: 0; color: var(--akzent); font: inherit; cursor: pointer; }
@media (max-width: 520px) { .wetter-ort { margin-left: 0; text-align: left; flex-basis: 100%; } .wetter-tage .nied { font-size: 11px; } }
.cams { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.cam { margin: 0; background: var(--karte); border-radius: var(--radius); overflow: hidden; }
.cam-bild { display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: var(--karte-2); cursor: zoom-in; position: relative; }
.cam-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-fehlt { position: absolute; inset: 0; display: none; place-content: center; justify-items: center; gap: 6px; color: var(--text-2); font-size: 14px; }
.cam.fehler .cam-fehlt { display: grid; } .cam.fehler img { visibility: hidden; }
.cam figcaption { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 14px; min-height: 52px; }
.cam-aktionen { display: flex; align-items: center; }
#cams.bearbeiten .cams { user-select: none; -webkit-user-select: none; }
#cam-gross { padding-bottom: 16px; }
#cam-gross-bild { display: block; width: 100%; height: auto; border-radius: 10px; }
.abstand-knopf { width: 60px; }

/* ------------------------------------------------------------------ Port-Liste */
.port-nr { flex: none; width: 64px; padding-left: 16px; font: 600 15px ui-monospace, "SF Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }
.portzeile .txt { padding: 8px 10px; }
.portzeile.frei .port-nr, .portzeile.frei .t { color: var(--text-2); }
.portzeile.frei .t { text-decoration: line-through; }
.pstatus { flex: none; font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; padding-right: 10px; white-space: nowrap; }
.pstatus:empty { display: none; }
.pstatus::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--linie); }
.pstatus.an::before { background: var(--gruen); }
.pstatus.an { color: var(--gruen); }
.frei-ports { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; }
.frei-ports > * + * { border-top: 0 !important; }
.frei-port { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px;
  background: var(--akzent-bg); color: var(--akzent); font: 600 16px ui-monospace, "SF Mono", Consolas, monospace; cursor: pointer; }
.frei-port .pstatus { padding: 0; font: 12px var(--schrift); }

/* Anhänge an Notizen */
.anhaenge { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.anhang-bild img { display: block; width: 76px; height: 76px; object-fit: cover; border-radius: 8px; background: var(--karte-2); }
.anhang-datei { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px; border-radius: 8px;
  background: var(--karte-2); color: var(--text); font-size: 13px; min-height: 36px; }
.anhang-datei .ic { width: 16px; height: 16px; color: var(--akzent); }
.anhang-datei .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.anhang-datei .u { font-size: 12px; }
.notiz-fuss .ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.anhang-liste img.fav { object-fit: cover; }
.anhang-liste[hidden] + .gruppe { margin-top: 0; }

/* Kategorien ein-/ausklappen */
.kat-kopf h2[data-aktion] { cursor: pointer; }
.kat-pfeil .ic { transform: rotate(90deg); transition: transform .2s; color: var(--text-2); width: 18px; height: 18px; }
.kat.zu .kat-pfeil .ic { transform: rotate(0deg); }
.kat.zu:not(.such-offen) > .liste, .kat.zu:not(.such-offen) > .zeile-neu { display: none; }
.kat.zu:not(.such-offen) .kat-kopf { padding-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .kat-pfeil .ic { transition: none; } }

/* Menü-Reihenfolge mit Pfeilen, weitere Seiten nur am Handy */
.verschieben { align-items: center; }
.verschieben .ic { width: 18px; height: 18px; }
.verschieben .hoch { transform: rotate(-90deg); } .verschieben .runter { transform: rotate(90deg); }
.verschieben button:disabled { opacity: .3; cursor: default; }
.verschieben button:disabled:hover { background: none; }
@media (min-width: 900px) { .nur-handy { display: none; } }
.abschnitt.zu .kat-pfeil .ic { transform: rotate(0deg); }
.gruppe-fuss.rot { color: var(--rot); }

/* ------------------------------------------------------------------ Webseite in der App */
body.webansicht .inhalt { max-width: none; padding: 0; }
.web { position: fixed; inset: 0 0 calc(61px + env(safe-area-inset-bottom)) 0; display: flex; flex-direction: column; background: var(--bg); }
.web-leiste { display: flex; align-items: center; gap: 4px; padding: max(6px, env(safe-area-inset-top)) 8px 6px; border-bottom: .5px solid var(--linie); }
.web-leiste .web-adresse { flex: 1; margin: 0; min-width: 0; }
.web-leiste [data-aktion="web-zurueck"] .ic { transform: rotate(180deg); }
.web-rahmen { flex: 1; width: 100%; border: 0; background: #fff; }
.web .leer-gross { overflow: auto; }
@media (min-width: 900px) { .web { inset: 0 0 0 236px; } .web-leiste { padding-top: 10px; } }
