/* Kanzlei Kastellan & Cie AG: calm single column, floating cards, neutral palette, semantic colours only */
:root {
  --bg: #fafaf9; --card: #ffffff; --soft: #f4f4f3; --line: #e7e5e4; --faint: #d6d3d1;
  --text: #0a0a0a; --muted: #57534e; --scrim: rgba(12, 10, 9, .32);
  --ok: #15803d; --ok-bg: #f0fdf4; --warn: #a16207; --warn-bg: #fefce8; --bad: #b91c1c; --bad-bg: #fef2f2;
  --shadow: 0 10px 30px rgba(12, 10, 9, .06); --shadow-lg: 0 24px 60px rgba(12, 10, 9, .18);
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "Geist Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a; --card: #161514; --soft: #1c1b1a; --line: #292524; --faint: #44403c; --text: #fafaf9; --muted: #a8a29e; --scrim: rgba(0, 0, 0, .6);
    --ok: #4ade80; --ok-bg: #0f2a19; --warn: #facc15; --warn-bg: #2a2410; --bad: #f87171; --bad-bg: #2d1414;
    --shadow: 0 10px 30px rgba(0, 0, 0, .4); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; margin: 0; }
[hidden] { display: none; }
#app { max-width: 960px; margin: 0 auto; padding-inline: 16px; padding-block: 24px 96px; display: grid; gap: 16px; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
p { margin: 0; }
a { color: inherit; }
.muted { color: var(--muted); } .note { font-size: 12px; color: var(--muted); } .center { text-align: center; padding: 48px 16px; }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 12px; min-width: 0; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: var(--card); box-shadow: var(--shadow); }
.nav a { text-decoration: none; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.nav a.on { background: var(--soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn { font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 8px; padding: 8px 12px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--faint); }
.btn-p { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
  font: inherit; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--card); color: var(--text); }
textarea { resize: vertical; min-height: 72px; }
:focus-visible { outline: 2px solid var(--faint); outline-offset: 2px; }
.field { display: grid; gap: 4px; }
.err { color: var(--bad); font-size: 12px; }
.st { font-size: 11px; border-radius: 999px; padding: 1px 8px; white-space: nowrap; border: 1px solid transparent; font-variant-numeric: tabular-nums; }
.st-offen { color: var(--bad); background: var(--bad-bg); }
.st-inputs { color: var(--warn); background: var(--warn-bg); }
.st-arbeit { color: var(--text); background: var(--soft); border-color: var(--line); }
.st-wartet { color: var(--muted); border-color: var(--line); }
.st-ok { color: var(--ok); background: var(--ok-bg); }
.st-dec { color: var(--bg); background: var(--text); }
.st-bed { color: var(--bad); border-color: var(--bad); }
button.st { font: inherit; font-size: 11px; cursor: pointer; }
button.st[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.grp { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.grp > summary { list-style: none; cursor: pointer; display: flex; gap: 12px; align-items: center; padding: 12px 16px; }
.grp > summary::-webkit-details-marker { display: none; }
.g-num { font-family: var(--mono); font-size: 12px; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); flex: none; }
.g-t { font-weight: 600; flex: 1; }
.sub-t { display: block; padding: 8px 16px; background: var(--soft); border-top: 1px solid var(--line); }
.item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.item:hover { background: var(--soft); }
.num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
@media (max-width: 520px) { .item { grid-template-columns: 44px minmax(0, 1fr); } .badges { grid-column: 2; justify-content: flex-start; } }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.entry { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: grid; gap: 4px; background: var(--card); }
.entry .meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.entry p { white-space: pre-wrap; overflow-wrap: anywhere; }
.entry.bedenken { border-color: var(--bad); background: var(--bad-bg); }
.entry.entscheid { border-color: var(--ok); background: var(--ok-bg); }
.entry.status { background: var(--soft); }
.entry.vertragstext { border-style: dashed; }
.list { display: grid; gap: 8px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--card); }
.seg button { font: inherit; font-size: 12px; border: 0; background: transparent; color: var(--muted); padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.fb-btn { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); font: inherit; font-size: 13px; background: var(--text); color: var(--bg); border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer; box-shadow: var(--shadow-lg); z-index: 5; }
.overlay { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; padding: 16px; z-index: 10; }
.overlay[hidden] { display: none; }
.dlg { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 16px; width: min(560px, 100%); display: grid; gap: 12px; max-height: 90vh; overflow: auto; }
.dlg.doc { width: min(960px, 100%); height: 90vh; grid-template-rows: auto 1fr; }
.dlg.doc iframe { width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.login { max-width: 380px; margin: 10vh auto 0; }
.f-head { position: sticky; top: 0; z-index: 4; background: var(--bg); display: grid; gap: 12px; padding-block: 12px; margin-block: -12px; }
.f-tabs { justify-self: start; }
.f-cl { border-top: 1px solid var(--line); }
.f-cl:first-child { border-top: 0; }
.f-cl > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; }
.f-cl > summary::-webkit-details-marker { display: none; }
.f-cl[open] > summary { background: var(--bg); }
.f-clb { padding: 8px 16px 16px 60px; display: grid; gap: 4px; background: var(--bg); }
/* roadmap: summary numbers, points that open in place, decision block */
.f-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.f-kpi { font: inherit; color: inherit; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); cursor: pointer; display: grid; gap: 4px; transition: transform .15s ease, box-shadow .15s ease; }
.f-kpi:hover { transform: translateY(-2px); }
.f-kpi[aria-pressed="true"] { border-color: var(--text); }
.f-kpi b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.f-bar { display: block; height: 4px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.f-bar i { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width .3s ease; }
.grp { overflow: hidden; }
.f-gp { display: grid; gap: 4px; justify-items: end; }
.f-gp .f-bar { width: 96px; }
.f-sub { padding: 12px 16px 4px; border-top: 1px solid var(--line); }
.f-row { font: inherit; color: inherit; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; transition: background .15s ease; scroll-margin-top: 16px; }
.f-row:hover, .f-row[aria-expanded="true"] { background: var(--bg); }
.f-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.f-chev { width: 8px; height: 8px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg); transition: transform .2s ease; margin: 0 4px; }
.f-row[aria-expanded="true"] .f-chev { transform: rotate(225deg); }
.f-who { display: inline-flex; gap: 4px; }
.f-doc { border-color: var(--line); color: var(--muted); background: var(--card); }
button.f-doc[aria-pressed="true"] { color: var(--text); background: var(--soft); border-color: var(--text); box-shadow: none; }
.f-row.f-child { padding-left: 48px; }
.f-dot { width: 20px; height: 20px; border-radius: 999px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--muted); background: var(--card); }
.f-dot.on { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.f-panel { border-top: 1px solid var(--line); background: var(--bg); padding: 16px 16px 24px 76px; display: grid; gap: 16px; animation: f-in .2s ease; }
@keyframes f-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.f-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 8px; min-width: 0; }
.f-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.f-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.f-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.f-src { position: relative; display: inline-block; }
.f-src > button { font: inherit; font-size: 12px; color: inherit; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 0 12px; line-height: 24px; cursor: pointer; }
.f-pop { display: none; position: absolute; z-index: 5; left: 0; top: 28px; width: min(360px, 80vw); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px; gap: 8px; }
.f-src:hover .f-pop, .f-src:focus-within .f-pop { display: grid; }
.f-appr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f-appr > div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 4px; }
.f-appr > div.on { background: var(--ok-bg); border-color: var(--ok); }
.f-h > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.f-hist { display: grid; gap: 8px; margin-top: 8px; }
.f-hist div { display: grid; grid-template-columns: 88px 96px minmax(0, 1fr); gap: 8px; font-size: 12px; }
@media (max-width: 720px) {
  .f-kpis { grid-template-columns: 1fr 1fr; }
  .f-row { grid-template-columns: 40px minmax(0, 1fr); }
  .f-right { grid-column: 2; justify-content: flex-start; }
  .f-panel { padding: 16px; }
  .f-cols, .f-appr { grid-template-columns: 1fr; }
  .f-gp .f-bar { width: 64px; }
  .f-hist div { grid-template-columns: 1fr 1fr; }
  .f-hist div span:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none; transition: none; } }
