/* Gufel Workspace — shared look for every view. Tokens, fonts and ws-
   components mirror the "Gufel Workspace" design system
   (https://claude.ai/artifact/MyPETD36KLfvV91F3b2p8m); change both together.
   Fonts are self-hosted like on gufel.de (see fonts/README.md). */

@font-face { font-family: 'Work Sans'; font-style: normal; font-weight: 300 650; font-display: swap; src: url('/fonts/worksans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Work Sans'; font-style: normal; font-weight: 300 650; font-display: swap; src: url('/fonts/worksans-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Work Sans'; font-style: italic; font-weight: 300 650; font-display: swap; src: url('/fonts/worksans-italic-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Work Sans'; font-style: italic; font-weight: 300 650; font-display: swap; src: url('/fonts/worksans-italic-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Baskervville'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/baskervville-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Baskervville'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/baskervville-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Baskervville'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/baskervville-italic-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Baskervville'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/baskervville-italic-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --panel: #fbfaf8;
  --ink: #1b1a17;
  --ink-soft: #4c483f;
  --muted: #6e685c;
  --line: #d4cdbe;
  --line-strong: #8f8672;
  --accent: #3f5d3a;
  --accent-ink: #ffffff;
  --brand: #98483c;
  --error: #a3341c;
  --ok: #2f6b3a;
  --field: #46632f;
  --korn: #b07d2b;
  --shadow-float: 0 1px 2px rgba(30,28,20,.08), 0 10px 28px rgba(30,28,20,.10);

  --font-sans: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: Baskervville, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --page-width: 640px;
  --page-width-wide: 1040px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-pill: 999px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17150f; --panel: #221f16; --ink: #ece6d7; --ink-soft: #c9c1ae; --muted: #9a9179;
    --line: #383224; --line-strong: #766c57; --accent: #6fa668; --accent-ink: #10230f;
    --brand: #d0806f; --error: #e0705a; --ok: #7fca8b; --field: #8bb96a; --korn: #d9a752;
    --shadow-float: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17150f; --panel: #221f16; --ink: #ece6d7; --ink-soft: #c9c1ae; --muted: #9a9179;
  --line: #383224; --line-strong: #766c57; --accent: #6fa668; --accent-ink: #10230f;
  --brand: #d0806f; --error: #e0705a; --ok: #7fca8b; --field: #8bb96a; --korn: #d9a752;
  --shadow-float: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px rgba(0,0,0,.35);
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Page and header ────────────────────────────────────────────────────── */
.ws-page { max-width: var(--page-width); margin: 0 auto; padding: var(--space-4); }
.ws-page--wide { max-width: var(--page-width-wide); }
.ws-back { display: inline-block; color: var(--muted); font-size: 14px; text-decoration: none; margin-bottom: var(--space-2); }
.ws-back:hover { color: var(--ink); }
.ws-kicker {
  margin: 0 0 6px;
  font: 500 11.5px/16px var(--font-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
}
.ws-title { margin: 0 0 4px; font: 400 30px/34px var(--font-serif); letter-spacing: -0.006em; text-wrap: balance; }
.ws-sub { margin: 0 0 var(--space-5); color: var(--muted); font-size: 14px; line-height: 20px; }

.ws-bar {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 18px;
  padding: 10px var(--space-4);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.ws-bar__brand { font: 400 18px/1 var(--font-serif); color: var(--ink); text-decoration: none; margin-right: 6px; }
.ws-bar a:not(.ws-bar__brand) { color: var(--muted); text-decoration: none; font-size: 14px; padding-bottom: 3px; border-bottom: 2px solid transparent; }
.ws-bar a:not(.ws-bar__brand):hover { color: var(--ink); }
.ws-bar a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ── Link list ──────────────────────────────────────────────────────────── */
.ws-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 6px var(--space-4);
  margin: 0 0 var(--space-4);
}
.ws-section > header { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); padding-top: 8px; }
.ws-section > header h2 { margin: 0; font: 400 21px/26px var(--font-serif); }
.ws-section > header a { color: var(--muted); font-size: 14px; text-decoration: none; }
.ws-links { list-style: none; margin: 0; padding: 0; }
.ws-links li + li { border-top: 1px solid var(--line); }
.ws-links a { display: block; padding: 11px 0; color: inherit; text-decoration: none; }
.ws-links a strong { color: var(--accent); font-weight: 560; }
.ws-links a span { display: block; color: var(--muted); font-size: 14px; line-height: 20px; }
.ws-links a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.ws-empty { color: var(--muted); font-size: 14px; padding: 8px 0 11px; margin: 0; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.ws-fieldset {
  min-width: 0;
  margin: 0 0 var(--space-4);
  padding: 14px var(--space-4) 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.ws-fieldset > legend { padding: 0 6px; font-weight: 560; }
.ws-label { display: block; margin: 10px 0 var(--space-1); font-size: 13.5px; line-height: 18px; color: var(--muted); }
.ws-input, .ws-select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
textarea.ws-input { min-height: 4.5rem; resize: vertical; }
.ws-input::placeholder { color: var(--muted); }
.ws-input[aria-invalid="true"] { border-color: var(--error); }
.ws-hint { margin-top: 5px; font-size: 13.5px; line-height: 18px; color: var(--muted); }
.ws-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-3); }
.ws-inline { display: flex; gap: var(--space-2); }
.ws-inline .ws-input { flex: 1; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.ws-button {
  display: block; width: 100%;
  padding: 13px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: var(--accent-ink);
  font: 560 16px/1.3 var(--font-sans);
  cursor: pointer;
}
.ws-button:hover { filter: brightness(1.08); }
.ws-button:disabled { opacity: 0.55; cursor: default; filter: none; }
.ws-button--quiet {
  display: inline-block; width: auto;
  padding: 7px 13px;
  background: transparent;
  color: var(--accent);
  border-color: var(--line-strong);
  font-weight: 500;
}
.ws-button--quiet:hover { background: var(--bg); filter: none; }
.ws-icon-button {
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted);
  font: 400 18px/1 var(--font-sans); cursor: pointer;
}
.ws-icon-button:hover { background: var(--bg); color: var(--ink); }

/* ── Segmented choice ───────────────────────────────────────────────────── */
.ws-seg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; margin: 0; padding: 0; }
.ws-seg label {
  position: relative;
  flex: 1 0 auto; min-width: 44px;
  padding: 8px 6px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}
.ws-seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.ws-seg label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 560; }
.ws-seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Chips ──────────────────────────────────────────────────────────────── */
.ws-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-2); }
.ws-chips:empty { display: none; }
.ws-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg);
  font-size: 14px; line-height: 20px;
  font-variant-numeric: tabular-nums;
}
.ws-chip--removable { padding-right: 3px; }
.ws-chip button {
  width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--muted);
  font: 400 16px/1 var(--font-sans); cursor: pointer;
}
.ws-chip button:hover { background: var(--panel); color: var(--ink); }
.ws-chip--quiet { color: var(--muted); background: transparent; font-size: 12.5px; padding: 1px 8px; }
.ws-chip--quiet b { color: var(--ink); font-weight: 560; }

/* ── Feedback ───────────────────────────────────────────────────────────── */
.ws-preview {
  margin: 14px 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
.ws-preview:empty { display: none; }
.ws-preview--error { color: var(--error); }
.ws-msg { margin-top: 12px; font-size: 15px; min-height: 20px; }
.ws-msg--ok { color: var(--ok); }
.ws-msg--error { color: var(--error); }

/* ── Table ──────────────────────────────────────────────────────────────── */
.ws-scroll { overflow-x: auto; }
.ws-table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ws-table th { padding: 4px 5px; text-align: left; font: 500 12.5px/16px var(--font-sans); color: var(--muted); }
.ws-table td { padding: 7px 5px; border-top: 1px solid var(--line); }
.ws-table .num { text-align: right; }
.ws-table tfoot td { font-weight: 560; border-top: 1px solid var(--line-strong); }

/* ── Cards with a figure ────────────────────────────────────────────────── */
.ws-cards { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ws-card {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: 16px 18px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.ws-card header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.ws-card h2 { margin: 0; font: 400 21px/26px var(--font-serif); color: var(--field); }
.ws-card .ws-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ws-stat { display: flex; align-items: baseline; gap: 6px; }
.ws-stat .n { font: 400 30px/1 var(--font-serif); font-variant-numeric: tabular-nums lining-nums; }
.ws-stat .u { color: var(--muted); font-size: 12.5px; }
.ws-totals { display: grid; grid-template-columns: 1fr auto auto; gap: 3px 10px; font-size: 14px; font-variant-numeric: tabular-nums; align-items: baseline; }
.ws-totals .l { color: var(--muted); }
.ws-totals .t { text-align: right; font-weight: 560; }
.ws-totals .p { text-align: right; color: var(--muted); font-size: 12.5px; }
.ws-bar-meter { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.ws-bar-meter > i { display: block; height: 100%; background: var(--korn); }
