@font-face {
  font-family: "Geist";
  src: url("/static/fonts/geist-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --brand-50:  #fcfcf1;
  --brand-100: #f7f6da;
  --brand-200: #f2f0b9;
  --brand-300: #edeb8c;
  --brand-400: #ddd961;
  --brand-500: #c6c23f;
  --brand-600: #9c982a;
  --brand-700: #6f6c1c;

  --ink:       #16181b;
  --ink-2:     #2e3338;
  --ink-3:     #454c53;
  --muted:     #646b72;
  --line:      #e6e6de;
  --line-2:    #d2d2c6;

  --panel:     #ffffff;
  --surface:   #f8f8f0;
  --backdrop-a:#faf9ef;
  --backdrop-b:#f0efe0;

  --action:      #1f2328;
  --action-hov:  #363c43;
  --on-action:   #ffffff;

  --danger:    #b3261e;
  --danger-bg: #fdecea;
  --danger-line:#f3c9c4;
  --success:   #4a7c2f;
  --success-bg:#eaf3e3;
  --success-line:#cbe3bb;
  --success-ink:#35601f;

  --panel-soft:  rgba(255,255,255,.7);
  --placeholder: #8d9298;
  --disabled-ink:#6f7378;
  --disabled-bg: #e0dfd2;
  --focus-ring:  rgba(237,235,140,.55);

  --font-sans: "Geist", -apple-system, system-ui, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(22,24,27,.07);
  --shadow-md: 0 6px 20px -8px rgba(22,24,27,.16);
  --shadow-lg: 0 30px 60px -24px rgba(22,24,27,.28), 0 8px 24px -14px rgba(22,24,27,.16);

  --fs-meta: 0.8125rem;
  --fs-body: 0.9375rem;
  --fs-sub:  1.0625rem;
  --fs-h2:   clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --fs-h1:   clamp(1.625rem, 1.4rem + 1.1vw, 2.25rem);
  --fs-mono-lg: clamp(1.125rem, 1rem + 0.9vw, 1.5rem);

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;
  --space-4: 16px; --space-5: 20px; --space-6: 24px;
  --space-8: 32px; --space-10: 40px; --space-12: 48px;

  --measure: 1040px;
  --measure-narrow: 460px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(1100px 620px at 82% -8%, #f4f2b8 0%, rgba(244,242,184,0) 62%),
    radial-gradient(900px 560px at -8% 108%, #eeecc9 0%, rgba(238,236,201,0) 58%),
    linear-gradient(160deg, var(--backdrop-a) 0%, var(--backdrop-b) 100%);
  background-attachment: fixed;
}

a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--ink); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    calc(clamp(16px, 4vw, 40px) + env(safe-area-inset-top))
    calc(var(--space-4) + env(safe-area-inset-right))
    calc(var(--space-10) + env(safe-area-inset-bottom))
    calc(var(--space-4) + env(safe-area-inset-left));
  gap: var(--space-6);
}
.page--center { justify-content: center; }

.stack { display: grid; gap: var(--space-4); }
.stack--tight { gap: var(--space-2); }
.stack--loose { gap: var(--space-6); }

.shell { width: 100%; max-width: var(--measure); display: grid; gap: var(--space-6); }

.brandbar {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 650;
}
.brandbar svg { width: 34px; height: 34px; flex: none; }
.brandbar span { font-size: var(--fs-sub); letter-spacing: -0.015em; }
.brandbar span b { font-weight: 750; }

.topbar {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap;
}

.panel {
  width: 100%;
  max-width: var(--measure-narrow);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(20px, 5vw, 30px);
  display: grid;
  gap: var(--space-5);
}
.panel--wide { max-width: var(--measure); }
.panel__head { display: grid; gap: 6px; }

.title {
  font-size: var(--fs-h1); line-height: 1.15; letter-spacing: -0.02em;
  color: var(--ink); font-weight: 700; text-wrap: balance;
}
.title em { font-style: normal; color: var(--brand-700); }
.title--sm { font-size: var(--fs-h2); letter-spacing: -0.015em; }
.subtitle { font-size: var(--fs-body); color: var(--muted); text-wrap: pretty; }

.eyebrow {
  font-size: var(--fs-meta); font-weight: 650; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}

.field { display: grid; gap: 6px; }
.label { font-size: var(--fs-meta); font-weight: 600; color: var(--ink-2); }
.label .opt { font-weight: 500; color: var(--muted); }
.hint { font-size: var(--fs-meta); color: var(--muted); }

.input, .textarea, .select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 11px 13px;
  min-height: 46px;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.textarea { resize: vertical; min-height: 84px; field-sizing: content; }
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--brand-500); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--action);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.input--mono { font-family: var(--font-mono); font-size: var(--fs-meta); }
.input--narrow { width: 7rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font: inherit; font-weight: 650; font-size: var(--fs-body);
  min-height: 48px; padding: 0 var(--space-5);
  border: 1px solid transparent; border-radius: var(--r-md); cursor: pointer;
  color: var(--on-action); background: var(--action);
  transition: background .15s var(--ease-out), color .15s var(--ease-out), transform .08s var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: var(--action-hov); color: var(--on-action); }
.btn:active { transform: translateY(1px); }
.btn:disabled {
  cursor: not-allowed;
  color: var(--disabled-ink); background: var(--disabled-bg); border-color: transparent;
  box-shadow: none;
}
.btn:disabled:hover { color: var(--disabled-ink); background: var(--disabled-bg); }
.btn--block { width: 100%; }
.btn--auto { justify-self: start; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: var(--fs-meta); border-radius: var(--r-sm); }

.btn-accent { color: var(--ink); background: var(--brand-300); border-color: var(--brand-400); }
.btn-accent:hover { color: var(--ink); background: var(--brand-400); border-color: var(--brand-500); }

.btn-ghost {
  color: var(--ink-2); background: var(--panel);
  border-color: var(--line-2); box-shadow: none;
}
.btn-ghost:hover { color: var(--ink); background: var(--brand-50); border-color: var(--brand-500); }

.btn-danger { color: var(--danger); background: var(--panel); border-color: var(--danger-line); box-shadow: none; }
.btn-danger:hover { color: var(--on-action); background: var(--danger); border-color: var(--danger); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 14px;
  border-radius: var(--r-pill); font-size: var(--fs-meta); font-weight: 600;
  color: var(--ink-3); background: var(--panel-soft);
  border: 1px solid var(--line);
  transition: background .15s, color .15s, border-color .15s;
}
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--ink); background: var(--brand-100); border-color: var(--brand-400); }
.tab[aria-current="page"] { color: var(--on-action); background: var(--action); border-color: var(--action); }
.tab[aria-current="page"]:hover { color: var(--on-action); background: var(--action-hov); }

.toolgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
@media (min-width: 600px) { .toolgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.tool {
  display: grid; justify-items: center; align-content: start; gap: 6px;
  text-align: center;
  padding: var(--space-4) var(--space-2);
  font: inherit; cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  color: var(--ink-3);
  transition: border-color .15s var(--ease-out), background .15s var(--ease-out), transform .12s var(--ease-out);
}
.tool:hover { border-color: var(--brand-500); background: var(--brand-50); transform: translateY(-1px); }
.tool__icon {
  width: 40px; height: 40px; border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
  transition: background .15s var(--ease-out), border-color .15s var(--ease-out);
}
.tool__icon svg { width: 20px; height: 20px; }
.tool__name { font-size: var(--fs-body); font-weight: 650; color: var(--ink); line-height: 1.25; }
.tool__desc { font-size: var(--fs-meta); color: var(--muted); line-height: 1.3; text-wrap: pretty; }
.tool[aria-selected="true"] {
  border-color: var(--brand-500);
  background: var(--brand-100);
  box-shadow: var(--shadow-sm);
}
.tool[aria-selected="true"] .tool__icon { background: var(--brand-300); border-color: var(--brand-400); }
.tool[aria-selected="true"] .tool__desc { color: var(--ink-3); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(16px, 3vw, 24px);
  display: grid; gap: var(--space-4);
}
.card__head { display: grid; gap: 4px; }
.card__title { font-size: var(--fs-h2); color: var(--ink); font-weight: 700; letter-spacing: -0.015em; }
.card__hint { font-size: var(--fs-meta); color: var(--muted); text-wrap: pretty; }

.grid-2 { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.copyfield { display: grid; gap: var(--space-2); grid-template-columns: 1fr; }
@media (min-width: 520px) { .copyfield { grid-template-columns: 1fr auto; align-items: center; } }

.secretbox {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-lg);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: var(--space-4);
  word-break: break-all;
  white-space: pre-wrap;
  user-select: all;
}

.qr-frame {
  display: grid; place-items: center;
  padding: var(--space-4);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}
.qr-frame svg, .qr-frame img { width: 100%; max-width: 240px; height: auto; display: block; }

.alert {
  font-size: var(--fs-meta); border-radius: var(--r-sm);
  padding: 10px 12px;
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid var(--danger-line);
}
.note {
  font-size: var(--fs-meta); border-radius: var(--r-md);
  padding: 11px 13px;
  background: var(--brand-100); color: var(--ink-3);
  border: 1px solid var(--brand-300);
}
.note b { color: var(--ink); }
.note--plain { background: var(--surface); border-color: var(--line); }
.note svg, .hint svg, .footnote svg, .card__hint svg, .subtitle svg {
  width: 1.35em; height: 1.35em;
  vertical-align: -0.3em;
  margin-right: 0.25em;
  color: var(--brand-700);
}

.stats { display: grid; gap: var(--space-3); grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 600px) { .stats { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--space-3) var(--space-4);
  display: grid; gap: 2px;
}
.stat__num { font-size: var(--fs-h2); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat__label { font-size: var(--fs-meta); color: var(--muted); }

.tablewrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.table th {
  text-align: left; font-size: var(--fs-meta); font-weight: 650; color: var(--muted);
  padding: var(--space-2) 10px; white-space: nowrap; border-bottom: 1px solid var(--line-2);
}
.table td {
  padding: 11px 10px; border-bottom: 1px solid var(--line);
  color: var(--ink-2); vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .mono { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--ink); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-meta); font-weight: 600; white-space: nowrap;
  background: var(--surface); color: var(--ink-3); border: 1px solid var(--line-2);
}
.pill--ok { background: var(--success-bg); color: var(--success-ink); border-color: var(--success-line); }
.pill--wait { background: var(--brand-100); color: var(--brand-700); border-color: var(--brand-300); }
.pill--warn { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }

.success { display: grid; justify-items: center; gap: 14px; text-align: center; padding: var(--space-3) 0; }
.success__check {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--brand-300); color: var(--ink);
  display: grid; place-items: center;
  animation: pop .4s var(--ease-out) both;
}
.success__check svg { width: 32px; height: 32px; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.empty {
  text-align: center; color: var(--muted); font-size: var(--fs-body);
  padding: var(--space-8) var(--space-4);
}

.footnote { font-size: var(--fs-meta); color: var(--muted); text-align: center; text-wrap: pretty; }
.footnote a { color: var(--brand-700); }

.codeblock {
  font-family: var(--font-mono); font-size: var(--fs-body); line-height: 1.9;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--space-3);
  overflow-x: auto; margin: 0;
}
.row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
/* In der scrollenden Tabelle: Knoepfe nebeneinander lassen, sonst wachsen die Zeilen. */
.row--nowrap { flex-wrap: nowrap; }
.spacer { flex: 1 1 auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
