/* Kompanion-App im neuen Design der App (seit 24.11.2026): Dreiecksnetz-Hintergrund (Gelbgrün → Grün → Pink, `bg.svg`),
   Kopfleiste in Logo-Grün mit schwarzem Titel, Liquid-Glass-Karten (durchscheinend, weichgezeichnet), weiße Knöpfe mit
   feiner Linie und weichem Schatten, Systemschrift. Farben wie shared/design/tokens.json. */
:root {
  --paper: #a9d97a;
  --green: #51af46;
  --green-dark: #2f8a3a;
  --ink-green: #124a24;
  --go: #3f9a37;
  --pink: #e6007e;
  --pink-light: #ffd1e8;
  --ink: #111;
  --line: rgba(81, 175, 70, .38);
  --card: rgba(255, 255, 255, .55);
  --muted: #5b6b5e;
  --off: #e6e9e6;
  --danger: #d92b34;
  --shadow: 0 2px 8px rgba(0, 0, 0, .10);
  --marker: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--paper) url("bg.svg") center / cover fixed no-repeat;
  color: var(--ink);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: max(5px, env(safe-area-inset-top)) max(5px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left));
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-text-size-adjust: 100%;
}

/* Kopfleiste wie in der App: Logo-Grün, schwarzer Titel, bis unter die Statusleiste. */
.appbar {
  position: sticky; top: 0; z-index: 30;
  margin: 0 calc(-1 * max(14px, env(safe-area-inset-left))) 14px calc(-1 * max(14px, env(safe-area-inset-right)));
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: var(--green); color: #000;
  font-size: 20px; font-weight: 700; text-align: center;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}

.page { max-width: 760px; margin: 0 auto; }

.card {
  background: var(--card);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 26px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .10), inset 0 1px 0 rgba(255, 255, 255, .7);
  padding: 14px;
  margin: 0 0 5px;
}

.title {
  color: var(--ink-green);
  font-size: 40px;
  line-height: 1.05;
  margin: 20px 0 10px;
  font-weight: 800;
}
.title2, .areaTitle {
  color: var(--ink-green);
  font-weight: 800;
  margin: 0 0 10px;
  font-size: 22px;
}
.lead { font-size: 18px; font-weight: 600; }
.small { font-size: 13px; color: #1d3a26; }

label { display: block; font-weight: 600; margin: 0 0 12px; }
input:not([type=checkbox]), textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  font: inherit;
  font-size: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  -webkit-user-select: text;
  user-select: text;
}
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 22px; height: 22px; }
.error { color: var(--danger); font-weight: 700; min-height: 1.3em; margin: 8px 0 0; }

/* Knöpfe */
.btn {
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  min-height: 48px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .06s, opacity .06s;
}
.btn:active:not(:disabled), .btn.pressed { transform: scale(.97); opacity: .85; }
.btn:disabled { background: var(--off); color: #888; border-color: #c8cdc8; box-shadow: none; cursor: default; }
.btn.go { background: var(--go); color: #fff; }
.btn.pink { background: var(--pink); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.selected { background: var(--go); color: #fff; }
.btn.big { width: 100%; min-height: 64px; font-size: 20px; margin-top: 8px; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 14px; border-radius: 999px; }
.btn .sym { margin-right: 6px; }

/* Kopf */
.head { padding-bottom: 10px; }
.headrow { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.headbtns { display: flex; gap: 8px; flex-shrink: 0; }
.device { font-size: 22px; line-height: 1.1; font-weight: 800; color: var(--ink-green); }
.status { color: var(--go); font-weight: 700; }
.connection { margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: #fff3b0; border: 1px solid var(--line); font-weight: 600; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.controls .full { grid-column: 1 / -1; }
.controls .btn { min-height: 60px; font-size: 20px; }
.countdown { grid-column: 1 / -1; text-align: center; font-size: 64px; font-weight: 800; color: var(--pink); text-shadow: none; }
.hint { grid-column: 1 / -1; text-align: center; color: var(--muted); font-weight: 600; }

.empty { text-align: center; padding: 28px 16px; }
.bigicon { font-size: 56px; }
.grid1 { display: grid; gap: 10px; }

/* Abzweige und Wenden */
.info { font-weight: 700; text-align: center; margin-bottom: 8px; min-height: 1.3em; }
.junction { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.junction .btn { min-height: 108px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px; font-size: 14px; }
.junction .btn svg { width: 44px; height: 44px; }
.junction .btn .road { overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; line-height: 1.15; max-width: 100%; }
.junction .placeholder { grid-column: 1 / -1; }
.turn { width: 100%; min-height: 76px; font-size: 22px; margin-top: 12px; }
.reason { text-align: center; color: var(--muted); font-size: 14px; margin-top: 6px; }
.guest { text-align: center; font-weight: 700; padding: 6px 0; }

/* Schalten */
.seghead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seghead .areaTitle { margin: 0; }
.seghead .btn.small { padding: 6px 12px; font-size: 14px; min-height: 0; }
.btn.segment { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: left; padding: 12px 14px; margin-top: 8px; }
.btn.segment .segname { font-weight: 800; font-size: 17px; }
.btn.segment .segbar { height: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.btn.segment .segbar i { display: block; height: 100%; background: #fc5200; }
.btn.segment .segvals { font-variant-numeric: tabular-nums; font-weight: 700; }
.btn.segment small { opacity: .8; }
.shift { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 10px; align-items: center; }
.shift .btn { min-height: 72px; font-size: 30px; }
.shift .value { text-align: center; font-size: 22px; font-weight: 800; line-height: 1.1; }
.shift .value small { display: block; font-family: inherit; font-size: 13px; color: var(--muted); }
.shift .reason { grid-column: 1 / -1; margin: 0; }

/* Menübereiche */
details.area summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; }
details.area summary::-webkit-details-marker { display: none; }
details.area summary .areaTitle { margin: 0; }
details.area .more { color: var(--muted); font-weight: 700; font-size: 14px; }
details.area .more::after { content: " ▾"; }
details.area[open] .more::after { content: " ▴"; }
details.area[open] summary { margin-bottom: 10px; }
.area .summary { color: var(--muted); font-size: 14px; margin: -6px 0 10px; }
.area h3 { font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.options .btn { min-height: 56px; font-size: 15px; text-align: left; display: flex; align-items: center; line-height: 1.15; }
.options .btn .sym { font-size: 18px; flex-shrink: 0; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.overlay[hidden], [hidden] { display: none !important; }
.dialog { width: 100%; max-width: 420px; margin: 0; }
/* Abstand vor „Ohne Speichern verlassen“ (19.11.2026). */
.finishgap { height: 48px; border-bottom: 1px solid rgba(0,0,0,.12); margin-bottom: 12px; }
.finishgap + .btn { width: 100%; min-height: 48px; }

@media (min-width: 700px) {
  .options { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .junction .btn { min-height: 130px; font-size: 17px; }
}

/* Gruppe: Sprachnachrichten (seit 15.11.2026) */
.grouphead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.grouphead .title2 { margin: 0; }
.btn.talk { touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.btn.talk small { display: block; font-size: 13px; font-weight: 600; opacity: .9; }
.btn.talk.live { background: var(--danger); color: #fff; transform: scale(.97); box-shadow: none; }
#talkAll { min-height: 84px; font-size: 24px; }
.voicestatus { min-height: 1.3em; font-weight: 700; text-align: center; margin: 8px 0 4px; color: var(--green); }
.voicestatus.bad { color: var(--danger); }
.members { display: grid; gap: 10px; margin-top: 8px; }
.member { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 10px; align-items: center;
          border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fafafa; }
.member.away { opacity: .55; }
.member .dot, .bubble .dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); display: inline-block; }
.member .who { min-width: 0; }
.member .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .who small { color: var(--muted); font-weight: 600; }
.member .who small.on { color: var(--green); }
.member .btn { min-height: 52px; }
.member .btn.talk { padding: 6px 10px; font-size: 15px; }
.member .btn.mute { width: 52px; padding: 0; font-size: 20px; }
.btn.mute[aria-pressed="true"] { background: var(--pink-light); }
.bubble { position: relative; margin: 10px 0 12px; padding: 12px 14px; background: #fff7c2; border: 1px solid var(--line);
          border-radius: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bubble::after { content: ""; position: absolute; left: 26px; bottom: -14px; border: 7px solid transparent;
                 border-top: 10px solid var(--ink); }
.bubble .text { flex: 1; min-width: 0; font-weight: 700; }
.bubble .text small { display: block; font-weight: 600; color: var(--muted); }
.bubble.playing .wave { animation: wave .6s infinite alternate; display: inline-block; }
@keyframes wave { from { transform: scale(1); } to { transform: scale(1.35); } }
.recording { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 20;
             background: var(--danger); color: #fff; border: 1px solid var(--line); border-radius: 14px;
             box-shadow: var(--shadow); padding: 10px 14px; pointer-events: none; max-width: 728px; margin: 0 auto; }
.rectext { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.recdot { width: 14px; height: 14px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.recbar { height: 8px; background: rgba(255,255,255,.35); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.recbar i { display: block; height: 100%; background: #fff; width: 100%; transition: width .2s linear; }

/* Idee für die App */
textarea { resize: vertical; min-height: 140px; font: inherit; font-size: 17px; margin-top: 10px; }
textarea[readonly] { background: #fffbe0; }
.counter { text-align: right; font-size: 13px; color: var(--muted); margin-top: 4px; }
.ideamsg { min-height: 1.3em; font-weight: 700; margin: 8px 0 0; color: var(--green); }
.ideamsg.bad { color: var(--danger); }
#ideaMic.live { background: var(--danger); }
.dialog { max-height: calc(100vh - 32px); overflow-y: auto; }

/* Funk (offener Sprechkanal zu zweit) */
.radio { margin: 6px 0 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #eaf8df; }
.radioinfo { font-weight: 700; min-height: 1.3em; }
.radioinfo small { display: block; font-weight: 600; color: var(--muted); }
.radioinfo.live { color: var(--green); }
.radioinfo.bad { color: var(--danger); }
.radiobtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radiobtns .btn.big { margin-top: 8px; }
.radiobtns .btn[hidden] { display: none; }
.radiobtns:has(#radioMic[hidden]) { grid-template-columns: 1fr; }
#radioMic.off { background: var(--danger); color: #fff; }

/* Kurze Meldung unten (Toast) */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; z-index: 100;
  max-width: calc(100% - 32px); padding: 12px 20px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); font-weight: 700; text-align: center;
  transition: opacity 0.25s, transform 0.25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Startmenü (seit 20.11.2026): Fahrt vom Handy starten */
.launch .tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.launch .tabs .btn { flex: 1 1 auto; min-height: 40px; font-size: 15px; }
.launch .map { height: 52vh; min-height: 280px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.launch .mapbox .row { display: flex; gap: 8px; margin-top: 8px; }
.launch .hint { margin: 6px 0; font-size: 15px; }
.launch .list { display: grid; gap: 8px; margin: 8px 0; }
.launch .item { text-align: left; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.launch .item small { opacity: .75; white-space: nowrap; }
.launch h3 { margin: 14px 0 4px; font-size: 20px; font-weight: 800; color: var(--ink-green); }
.launch .field { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 16px; }
.launch .field input, .launch .field select { font-size: 18px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; width: 6em; }
#launchHome { margin-top: 12px; }

.launch .btn.go:disabled { background: var(--off); color: #888; }

/* Startmenü wie in der App (seit 24.11.2026): Ziele für heute, Fahren, Mehr …, Einstellungen */
.hubcard { padding: 12px; }
.hubtop { display: flex; justify-content: space-between; align-items: center; }
.hubtitle { color: var(--ink-green); font-size: 22px; font-weight: 800; margin: 0 0 8px; background: none; border: 0; padding: 0; text-align: left; font-family: inherit; }
.morebtn { display: block; width: 100%; cursor: pointer; margin: 0; }
.morebtn[aria-expanded="true"] { margin-bottom: 8px; }
.iconbtn { background: #fff; border: 1px solid var(--line); border-radius: 999px; width: 40px; height: 40px; font-size: 20px; box-shadow: var(--shadow); cursor: pointer; }
.goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.goal { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; min-height: 72px; display: flex; flex-direction: column; gap: 4px; }
.goalsym { font-size: 22px; }
.goaltext { font-size: 13px; font-weight: 700; line-height: 1.2; }
.goal.done .goaltext { text-decoration: line-through; opacity: .7; }
.today { margin-top: 8px; display: flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; min-height: 56px; }
.today .todaytext { padding: 6px 12px; display: flex; flex-direction: column; }
.today small { color: var(--go); font-weight: 800; font-size: 12px; }
.tileimg.small { width: 84px; align-self: stretch; flex-shrink: 0; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile { position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); cursor: pointer; font: inherit; text-align: left; touch-action: manipulation; }
.tile:active { transform: scale(.97); opacity: .9; }
.tile .tileimg { display: block; height: 96px; background-size: cover; background-position: center; background-color: #dfeadb; }
.tile .tiletitle { padding: 10px 12px; font-weight: 800; font-size: 16px; color: var(--ink); }
.tileimg { background-size: cover; background-position: center; background-color: #dfeadb; display: block; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } .tile .tileimg { height: 130px; } }
.detailhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.detailhead .title2 { margin: 0; }

/* Einstellungen */
.setsection { margin: 14px 0 4px; font-size: 14px; color: var(--ink-green); font-weight: 800; text-transform: none; }
.setrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px; margin: 6px 0; box-shadow: var(--shadow); }
.settitle { font-weight: 700; }
.settitle small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; margin-top: 2px; }
.switch { position: relative; width: 52px; height: 32px; border-radius: 999px; border: 0; background: #cfd5cf; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch.on { background: var(--go); }
.switch.on i { transform: translateX(20px); }
.choice { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.slider { width: 46%; accent-color: var(--go); }
