/* Ski Tag Board: Liftschild-Kopf, Pistenfarben für Bereiche, eine Spalte (Zeitplan breit) */
:root {
  --bg: #f3f6f9; --surface: #ffffff; --ink: #142233; --muted: #5d6c7c; --line: #d9e1e9; --soft: #eaf0f5;
  --accent: #0b5fa5; --accent-ink: #ffffff; --sos: #c8202b; --done: #1d7a4c; --done-soft: #e2f3ea; --new: #fff4d6;
  --p-blau: #1667c4; --p-rot: #c8202b; --p-schwarz: #1b1f24; --p-gelb: #c98a00; --p-grau: #6b7785;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e151d; --surface: #16202b; --ink: #e6edf4; --muted: #95a4b3; --line: #273444; --soft: #1c2835;
    --accent: #5aa7ec; --accent-ink: #08131e; --sos: #ff6670; --done: #5ccf95; --done-soft: #15301f; --new: #3a3012;
    --p-blau: #5aa7ec; --p-rot: #ff6670; --p-schwarz: #c9d2db; --p-gelb: #f0b93e; --p-grau: #8e9aa7;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font-body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 960px; margin: 0 auto; padding-block: 24px 64px; display: grid; gap: 18px; }
main { display: grid; gap: 16px; min-width: 0; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: .01em; }
h1 { font-size: 40px; line-height: 1; }
h2 { font-size: 26px; }
h3 { font-size: 19px; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-size: .9em; }

/* Kopf */
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; }
.eyebrow { font-family: var(--font-display); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--sos); font-weight: 700; }
.head p { margin: 6px 0 0; color: var(--muted); }
.count { text-align: right; font-family: var(--font-display); }
.count b { display: block; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.count span { color: var(--muted); font-size: 15px; letter-spacing: .04em; }

.navbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 16px; border-bottom: 2px solid var(--line); }
.tabs { display: flex; gap: 2px; overflow-x: auto; min-width: 0; max-width: 100%; }
.tabs a {
  font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .03em;
  color: var(--muted); text-decoration: none; padding: 8px 12px; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .n { font-family: var(--font-body); font-size: 13px; font-weight: 700; background: var(--p-gelb); color: #1b1f24; border-radius: 999px; padding: 0 7px; margin-left: 4px; vertical-align: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-gelb) 30%, transparent), 0 0 12px var(--p-gelb); }
@media (prefers-reduced-motion: no-preference) { .tabs .n { animation: glow 1.8s ease-in-out infinite; } }
@keyframes glow { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--p-gelb) 15%, transparent), 0 0 18px var(--p-gelb); } }
.userbox { display: flex; gap: 12px; align-items: center; font-size: 14px; padding-bottom: 8px; color: var(--muted); }
.userbox img { width: 24px; height: 24px; border-radius: 50%; }

/* Bausteine */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 12px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.notice { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; color: var(--muted); font-size: 15px; }
.notice.err { border-color: var(--sos); color: var(--sos); }
.empty { color: var(--muted); margin: 0; }
img.av { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; }

form.add { display: grid; gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row > .grow { flex: 1 1 150px; min-width: 0; }
label.f { display: grid; gap: 2px; font-size: 13px; color: var(--muted); flex: 1 1 150px; min-width: 0; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; color: var(--ink); font-size: 16px;
}
textarea { resize: vertical; min-height: 64px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 8px 16px; font-weight: 600; cursor: pointer; flex: 0 0 auto; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 14px; text-decoration: underline; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 5px 12px; cursor: pointer; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* Pistenfarben */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chip::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--c, var(--p-grau)); }
.a-netzwerk { --c: var(--p-blau); }
.a-hardware { --c: var(--p-rot); }
.a-app { --c: var(--p-schwarz); }
.a-wirtschaft { --c: var(--p-gelb); }
.a-plan { --c: var(--p-grau); }
.pill { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
.pill.open { background: var(--sos); color: #fff; }
.pill.done { background: var(--done-soft); color: var(--done); }
.pill.new { background: var(--new); color: var(--ink); }

/* Team */
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: 36px 1fr; gap: 2px 10px; align-items: center; }
.person img { width: 36px; height: 36px; border-radius: 50%; grid-row: span 2; }
.person .name { font-weight: 600; overflow-wrap: anywhere; }
.person .meta { color: var(--muted); font-size: 14px; }

/* Listen */
.list { display: grid; }
.item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 0; }
.item.is-new { background: var(--new); border-radius: 8px; padding: 8px; margin: 2px -8px; border-top-color: transparent; }
.item .top { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 14px; color: var(--muted); }
.item .top b { color: var(--ink); font-size: 15px; }
.item p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.day-h { color: var(--muted); font-family: var(--font-display); font-size: 16px; text-transform: uppercase; letter-spacing: .08em; padding-top: 6px; }

/* Aufgaben */
.task { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--done); }
.task .t { overflow-wrap: anywhere; cursor: pointer; }
.task.done .t { color: var(--muted); text-decoration: line-through; }
.task .sub { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); margin-top: 2px; align-items: center; }
.who { display: inline-flex; gap: 2px; }
.who img { width: 22px; height: 22px; border-radius: 50%; }

/* Gantt */
.gantt-scroll { overflow-x: auto; }
.gantt { min-width: 720px; display: grid; grid-template-columns: 230px 1fr; font-size: 14px; }
.g-label, .g-track { border-top: 1px solid var(--line); min-height: 40px; }
.g-label { display: flex; flex-direction: column; justify-content: center; gap: 0; padding: 4px 10px 4px 0; cursor: pointer; min-width: 0; }
.g-label .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.g-label.done .t { color: var(--muted); text-decoration: line-through; }
.g-track { position: relative; }
.g-group { grid-column: 1 / -1; font-family: var(--font-display); font-weight: 700; font-size: 17px; padding: 12px 0 4px; letter-spacing: .03em; border-top: 2px solid var(--line); }
.g-head { position: relative; height: 44px; }
.g-month { position: absolute; top: 0; height: 22px; border-left: 1px solid var(--line); padding-left: 6px; font-family: var(--font-display); font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; }
.g-week { position: absolute; top: 22px; height: 22px; border-left: 1px solid var(--line); padding-left: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.g-grid { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--line); }
.g-bar { position: absolute; top: 9px; height: 22px; border-radius: 5px; background: var(--c, var(--p-grau)); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; border: 0; text-align: left; }
.g-bar.done { opacity: .45; }
.g-bar.a-app { color: var(--bg); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--sos); z-index: 2; pointer-events: none; }
.g-today-label { position: absolute; top: -2px; transform: translateX(-50%); background: var(--sos); color: #fff; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 0 5px; z-index: 3; white-space: nowrap; }
.g-goal { position: absolute; top: 4px; bottom: 4px; border-radius: 5px; background: repeating-linear-gradient(45deg, var(--sos) 0 6px, transparent 6px 12px); opacity: .35; }

/* Editor */
.editor { border: 2px solid var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* Fragen */
.q { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.q:first-child { border-top: 0; padding-top: 0; }
.q.is-new { background: var(--new); border-radius: 8px; padding: 10px; }
.q .title { font-weight: 600; font-size: 17px; overflow-wrap: anywhere; }
.q .body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.cmt { display: grid; grid-template-columns: 28px 1fr; gap: 10px; border-radius: 8px; padding: 8px 10px; background: var(--soft); }
.cmt.answer { background: var(--done-soft); }
.cmt p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Plan */
.plan-frame { width: 100%; border: 0; border-radius: 8px; min-height: 600px; background: var(--surface); }
.chart-box { position: relative; height: 260px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td input { min-width: 90px; }
table.costs { min-width: 560px; }
table.costs td:first-child { width: 48%; }
table.costs td:nth-child(3) { width: 130px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.stat { display: grid; gap: 2px; }
.stat b { font-family: var(--font-display); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

.login { max-width: 560px; }
.login ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
@media (max-width: 640px) { .count { text-align: left; } }
@media (max-width: 520px) {
  h1 { font-size: 32px; } .count b { font-size: 36px; }
  .gantt { grid-template-columns: 150px 1fr; }
}
@media (prefers-reduced-motion: no-preference) { .g-bar, .item, .btn { transition: opacity .2s ease, background .2s ease; } }

/* Fragen als aufklappbare Zeilen */
.qrow { border-top: 1px solid var(--line); }
.qrow:first-child { border-top: 0; }
.qrow > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; }
.qrow > summary::-webkit-details-marker { display: none; }
.qrow > summary .q-title { font-weight: 600; overflow-wrap: anywhere; }
.qrow > summary .q-meta { font-size: 13px; color: var(--muted); }
.qrow > summary .arrow { color: var(--muted); transition: transform .15s ease; }
.qrow[open] > summary .arrow { transform: rotate(90deg); }
.qrow .q-inner { display: grid; gap: 8px; padding: 0 0 14px 38px; }
.qrow textarea { min-height: 44px; }
.qrow.settled .q-title { color: var(--muted); font-weight: 500; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 15px; }

.navbar > * { min-width: 0; }
.is-new .pill.new { background: var(--sos); color: #fff; }
.wrap > *, .head > * { min-width: 0; }

/* Meldung unten mit „Rückgängig“ */
#status { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom, 0px));
  width: max-content; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 12px;
  background: var(--surface); color: var(--ink); border-style: solid; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
#status .undo { padding: 4px 12px; }

.task-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 12px; align-items: center; max-width: 260px; }
.link.danger { color: var(--sos); font-weight: 600; }

.item .top .del { margin-left: auto; display: inline-flex; gap: 10px; align-items: baseline; }
.x { background: none; border: 2px solid var(--sos); color: var(--sos); border-radius: 8px; width: 34px; height: 34px; line-height: 1; font-size: 22px; font-weight: 700; cursor: pointer; padding: 0; }
.x:hover { background: var(--sos); color: #fff; }
.item .top { width: 100%; }

.btn.danger { background: var(--sos); color: #fff; }
.btn.small { padding: 6px 14px; font-size: 15px; }
.confirm-q { font-weight: 700; color: var(--sos); }
.item .top .del { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .tabs { flex-wrap: wrap; overflow: visible; } .tabs a { padding: 6px 10px; font-size: 17px; } }

/* Seite „Neu“ */
.new-item { display: grid; grid-template-columns: 14px 28px 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.new-link { text-decoration: none; color: inherit; min-width: 0; }
.new-item:first-child { border-top: 0; }
.new-item .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--p-gelb); margin-top: 8px; box-shadow: 0 0 10px var(--p-gelb); }
.new-item .kind { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--p-gelb); }
.new-item p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.new-link:hover p { text-decoration: underline; }
@media (max-width: 520px) { .new-item { grid-template-columns: 14px 28px 1fr; } .new-item > .btn { grid-column: 3; justify-self: start; } }
