/* ============================================================
ZEITRECHNER — Vanilla CSS
============================================================ */

/* ---------- Fontshare ---------- */
@import url('https://api.fontshare.com/v2/css?f[]=zodiak@400,700&f[]=general-sans@400,500,600,700&display=swap');

/* ---------- Design Tokens — Light Mode ---------- */
:root,
[data-theme="light"] {
  /* Surfaces */
  --color-bg:              oklch(0.97  0.008 80);
  --color-surface:         oklch(0.975 0.007 80);
  --color-surface-2:       oklch(0.982 0.005 80);
  --color-surface-offset:  oklch(0.94  0.010 75);
  --color-border:          oklch(0.83  0.012 78);
  --color-divider:         oklch(0.87  0.010 80);

  /* Text */
  --color-text:            oklch(0.20  0.018 60);
  --color-text-muted:      oklch(0.48  0.010 70);
  --color-text-faint:      oklch(0.72  0.008 75);

  /* Primary — Deep Forest Green */
  --color-primary:          oklch(0.36  0.10  155);
  --color-primary-hover:    oklch(0.29  0.09  155);
  --color-primary-active:   oklch(0.22  0.07  155);
  --color-primary-light:    oklch(0.90  0.04  155);
  --color-primary-foreground: oklch(0.97 0.005 80);

  /* Semantic */
  --color-destructive:      oklch(0.54  0.18  25);

  /* Fonts */
  --font-display: 'Zodiak', 'Georgia', serif;
  --font-body:    'General Sans', 'Helvetica Neue', sans-serif;

  /* Type scale — fluid */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  /* Border radius tokens */
  --radius-sm:   0.25rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-full: 9999px;

  /* Shadow tokens (warm-tinted) */
  --shadow-sm: 0 1px 3px oklch(0.2 0.02 70 / 0.07);
  --shadow-md: 0 4px 14px oklch(0.2 0.02 70 / 0.10);
  --shadow-lg: 0 12px 32px oklch(0.2 0.02 70 / 0.14);

  /* Transition */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Design Tokens — Dark Mode ---------- */
[data-theme="dark"] {
  --color-bg:              oklch(0.13  0.010 70);
  --color-surface:         oklch(0.16  0.009 70);
  --color-surface-2:       oklch(0.18  0.008 70);
  --color-surface-offset:  oklch(0.15  0.009 70);
  --color-border:          oklch(0.28  0.009 70);
  --color-divider:         oklch(0.22  0.008 70);

  --color-text:            oklch(0.84  0.010 75);
  --color-text-muted:      oklch(0.53  0.008 72);
  --color-text-faint:      oklch(0.40  0.007 72);

  --color-primary:          oklch(0.65  0.12  155);
  --color-primary-hover:    oklch(0.55  0.11  155);
  --color-primary-active:   oklch(0.45  0.10  155);
  --color-primary-light:    oklch(0.22  0.05  155);
  --color-primary-foreground: oklch(0.97 0.005 80);

  --color-destructive:      oklch(0.65  0.18  25);

  --shadow-sm: 0 1px 3px  oklch(0 0 0 / 0.22);
  --shadow-md: 0 4px 14px oklch(0 0 0 / 0.32);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.42);
}

/* System dark preference fallback (when no [data-theme] is set) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:              oklch(0.13  0.010 70);
    --color-surface:         oklch(0.16  0.009 70);
    --color-surface-2:       oklch(0.18  0.008 70);
    --color-surface-offset:  oklch(0.15  0.009 70);
    --color-border:          oklch(0.28  0.009 70);
    --color-divider:         oklch(0.22  0.008 70);
    --color-text:            oklch(0.84  0.010 75);
    --color-text-muted:      oklch(0.53  0.008 72);
    --color-text-faint:      oklch(0.40  0.007 72);
    --color-primary:          oklch(0.65  0.12  155);
    --color-primary-hover:    oklch(0.55  0.11  155);
    --color-primary-active:   oklch(0.45  0.10  155);
    --color-primary-light:    oklch(0.22  0.05  155);
    --color-primary-foreground: oklch(0.97 0.005 80);
    --color-destructive:      oklch(0.65  0.18  25);
    --shadow-sm: 0 1px 3px  oklch(0 0 0 / 0.22);
    --shadow-md: 0 4px 14px oklch(0 0 0 / 0.32);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.42);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid var(--color-border); }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main { flex: 1 1 auto; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

/* ---------- Fluid type utilities ---------- */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }

/* ---------- Layout utilities ---------- */
.container        { width: 100%; max-width: 960px; margin-inline: auto; padding-inline: 1rem; }
.flex             { display: flex; }
.inline-flex      { display: inline-flex; }
.grid             { display: grid; }
.hidden           { display: none !important; }
.block            { display: block; }
.items-center     { align-items: center; }
.items-start      { align-items: flex-start; }
.items-end        { align-items: flex-end; }
.justify-between  { justify-content: space-between; }
.justify-center   { justify-content: center; }
.flex-col         { flex-direction: column; }
.flex-wrap        { flex-wrap: wrap; }
.flex-1           { flex: 1 1 0%; }
.flex-shrink-0    { flex-shrink: 0; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-6  { gap: 1.5rem; }
.gap-8  { gap: 2rem; }
.gap-10 { gap: 2.5rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-x-1 > * + * { margin-left: 0.25rem; }
.w-full    { width: 100%; }
.w-fit     { width: fit-content; }
.w-12      { width: 3rem; }
.h-12      { height: 3rem; }
.w-5       { width: 1.25rem; }
.h-5       { height: 1.25rem; }
.w-4       { width: 1rem; }
.h-4       { height: 1rem; }
.min-h-screen { min-height: 100vh; }
.max-w-prose  { max-width: 72ch; }
.overflow-x-auto  { overflow-x: auto; }
.overflow-y-auto  { overflow-y: auto; }
.overflow-hidden  { overflow: hidden; }
.relative  { position: relative; }
.absolute  { position: absolute; }
.fixed     { position: fixed; }
.sticky    { position: sticky; }
.inset-0   { inset: 0; }
.top-0     { top: 0; }
.top-full  { top: 100%; }
.top-20    { top: 5rem; }
.bottom-6  { bottom: 1.5rem; }
.bottom-20 { bottom: 5rem; }
.right-6   { right: 1.5rem; }
.left-0    { left: 0; }
.left-4    { left: 1rem; }
.z-40      { z-index: 40; }
.z-50      { z-index: 50; }
.min-w-0   { min-width: 0; }

/* ---------- Spacing utilities ---------- */
.p-1  { padding: 0.25rem; }
.p-2  { padding: 0.5rem; }
.p-3  { padding: 0.75rem; }
.p-4  { padding: 1rem; }
.p-5  { padding: 1.25rem; }
.px-2 { padding-inline: 0.5rem; }
.px-3 { padding-inline: 0.75rem; }
.px-4 { padding-inline: 1rem; }
.px-5 { padding-inline: 1.25rem; }
.py-1 { padding-block: 0.25rem; }
.py-2 { padding-block: 0.5rem; }
.py-3 { padding-block: 0.75rem; }
.py-4 { padding-block: 1rem; }
.py-8 { padding-block: 2rem; }
.py-12 { padding-block: 3rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-0 { padding-bottom: 0; }
.pt-2 { padding-top: 0.5rem; }
.pt-6 { padding-top: 1.5rem; }
.mb-1  { margin-bottom: 0.25rem; }
.mb-2  { margin-bottom: 0.5rem; }
.mb-3  { margin-bottom: 0.75rem; }
.mb-4  { margin-bottom: 1rem; }
.mb-6  { margin-bottom: 1.5rem; }
.mb-8  { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-3  { margin-top: 0.75rem; }
.mt-4  { margin-top: 1rem; }
.mt-6  { margin-top: 1.5rem; }
.mt-8  { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-16 { margin-top: 4rem; }
.ml-2  { margin-left: 0.5rem; }
.mx-auto { margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- Typography utilities ---------- */
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-normal   { font-weight: 400; }
.font-mono     { font-family: ui-monospace, monospace; }
.font-display  { font-family: var(--font-display); }
.font-body     { font-family: var(--font-body); }
.text-left     { text-align: left; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.tracking-tight  { letter-spacing: -0.025em; }
.tracking-wider  { letter-spacing: 0.05em; }
.uppercase       { text-transform: uppercase; }
.leading-snug    { line-height: 1.375; }
.leading-relaxed { line-height: 1.625; }
.underline       { text-decoration: underline; }
.whitespace-nowrap { white-space: nowrap; }
.line-clamp-2  { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Color utilities ---------- */
.text-primary     { color: var(--color-primary); }
.text-muted       { color: var(--color-text-muted); }
.text-faint       { color: var(--color-text-faint); }
.text-destructive { color: var(--color-destructive); }
.text-primary-fg  { color: var(--color-primary-foreground); }
.bg-bg            { background-color: var(--color-bg); }
.bg-surface       { background-color: var(--color-surface); }
.bg-surface-2     { background-color: var(--color-surface-2); }
.bg-surface-offset { background-color: var(--color-surface-offset); }
.bg-card          { background-color: var(--color-surface); }
.bg-primary       { background-color: var(--color-primary); }
.bg-primary-light { background-color: var(--color-primary-light); }
.bg-muted         { background-color: var(--color-surface-offset); }
.border-border    { border-color: var(--color-border); }
.border-divider   { border-color: var(--color-divider); }

/* ---------- Border radius utilities ---------- */
.rounded      { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-md); }
.rounded-xl   { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* ---------- Border utilities ---------- */
.border     { border-width: 1px; border-style: solid; }
.border-t   { border-top-width: 1px; border-top-style: solid; }
.border-b   { border-bottom-width: 1px; border-bottom-style: solid; }
.border-l   { border-left-width: 1px; border-left-style: solid; }
.border-b-2 { border-bottom-width: 2px; border-bottom-style: solid; }

/* ---------- Shadow utilities ---------- */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ---------- Opacity ---------- */
.opacity-0   { opacity: 0; }
.opacity-100 { opacity: 1; }
.pointer-events-none { pointer-events: none; }

/* ---------- Transition ---------- */
.transition-all       { transition: all var(--transition-interactive); }
.transition-colors    { transition: color var(--transition-interactive), background-color var(--transition-interactive), border-color var(--transition-interactive); }
.transition-opacity   { transition: opacity 300ms ease; }
.transition-transform { transition: transform var(--transition-interactive); }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

/* ---------- Transform utilities ---------- */
.rotate-180    { transform: rotate(180deg); }
.translate-y-0 { transform: translateY(0); }

/* ---------- Input styles ---------- */
.input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  padding: 0.625rem 0.75rem;
  font-size: var(--text-sm);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}
.input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 18%, transparent);
}

/* ---------- Button styles ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-interactive), color var(--transition-interactive), border-color var(--transition-interactive), box-shadow var(--transition-interactive);
  border: 1px solid transparent;
}
.btn-primary             { background-color: var(--color-primary); color: var(--color-primary-foreground); }
.btn-primary:hover       { background-color: var(--color-primary-hover); }
.btn-primary:active      { background-color: var(--color-primary-active); }
.btn-outline             { background-color: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }
.btn-outline:hover       { background-color: var(--color-primary-light); border-color: var(--color-primary); }
.btn-ghost               { background-color: transparent; color: var(--color-text); }
.btn-ghost:hover         { background-color: var(--color-primary-light); }

/* ---------- Card styles ---------- */
.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  padding: 1.25rem;
}
.card-hover { transition: transform var(--transition-interactive), box-shadow var(--transition-interactive); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- Result stat box ---------- */
.stat-box {
  background-color: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
}
.stat-box .stat-label { font-size: var(--text-xs); color: var(--color-text-muted); }
.stat-box .stat-value { font-weight: 600; font-size: var(--text-sm); margin-top: 0.125rem; }

/* ---------- Result panel ---------- */
.result-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  padding: 1.25rem;
}

/* ---------- Grid system (limited) ---------- */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- Responsive breakpoints ---------- */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:flex-row   { flex-direction: row; }
  .sm\:p-6        { padding: 1.5rem; }
  .sm\:w-auto     { width: auto; }
  .sm\:inline     { display: inline; }
  .sm\:hidden     { display: none !important; }
}
@media (min-width: 768px) {
  .md\:flex           { display: flex; }
  .md\:hidden         { display: none !important; }
  .md\:grid-cols-3    { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:block              { display: block; }
  .lg\:hidden             { display: none !important; }
  .lg\:grid-cols-3        { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-article  { grid-template-columns: 1fr 200px; }
}

/* ---------- Scrollbar hide ---------- */
.scrollbar-hide                  { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ---------- Prose / Article styles ---------- */
.prose-article { line-height: 1.75; }
.prose-article p + p   { margin-top: 1.25em; }
.prose-article h2      { margin-top: 2em; margin-bottom: 0.75em; }
.prose-article h3      { margin-top: 1.5em; margin-bottom: 0.5em; }
.prose-article ul,
.prose-article ol      { margin-top: 0.75em; margin-bottom: 0.75em; padding-left: 1.5em; }
.prose-article li      { margin-top: 0.25em; }
.prose-article ul li   { list-style-type: disc; }
.prose-article ol li   { list-style-type: decimal; }
.prose-article a       { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
.prose-article a:hover { color: var(--color-primary-hover); }
.prose-article blockquote {
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
  padding-left: 1em;
  margin: 1em 0;
  color: var(--color-text-muted);
}
.prose-article table  { width: 100%; border-collapse: collapse; margin: 1em 0; }
.prose-article th,
.prose-article td     { border: 1px solid var(--color-border); padding: 0.5em 0.75em; text-align: left; }
.prose-article th     { background: var(--color-surface-offset); font-weight: 600; }

/* ---------- Table (global) ---------- */
.table-auto                    { width: 100%; border-collapse: collapse; }
.table-auto th, .table-auto td { padding: 0.5em 0.75em; text-align: left; border-bottom: 1px solid var(--color-border); }
.table-auto th                 { background: var(--color-surface-offset); font-weight: 600; }
.table-auto tr:last-child td   { border-bottom: none; }

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up { animation: fadeInUp 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.animate-fade-in { animation: fadeIn 150ms ease forwards; }

/* ---------- Focus styles ---------- */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}
.skip-link:focus { top: 1rem; }

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

/* ---------- Content visibility ---------- */
.content-auto { content-visibility: auto; contain-intrinsic-size: auto 500px; }

/* ============================================================
COMPONENT STYLES
============================================================ */

/* --- Header --- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background-color: color-mix(in oklch, var(--color-bg) 70%, transparent);
  transition: border-bottom var(--transition-interactive), background-color var(--transition-interactive);
}
#site-header.scrolled {
  border-bottom: 1px solid var(--color-border);
  background-color: color-mix(in oklch, var(--color-bg) 90%, transparent);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
  letter-spacing: -0.025em;
}
.logo svg        { color: var(--color-primary); }
.logo:hover      { color: var(--color-primary); }

/* Desktop nav */
.desktop-nav { display: none; }
@media (min-width: 768px) { .desktop-nav { display: flex; align-items: center; gap: 0.25rem; } }
.nav-link {
  padding: 0.5rem 0.75rem;
  font-size: var(--text-sm);
  color: var(--color-text);
  border-radius: var(--radius-md);
  transition: color var(--transition-interactive);
}
.nav-link:hover  { color: var(--color-primary); }
.nav-link.active { color: var(--color-primary); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: color var(--transition-interactive);
}
.dropdown-toggle:hover                       { color: var(--color-primary); }
.dropdown-toggle .chevron                    { width: 1rem; height: 1rem; transition: transform var(--transition-interactive); }
.dropdown-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 14rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  display: none;
  z-index: 50;
}
.dropdown-menu.open          { display: block; animation: fadeIn 120ms cubic-bezier(0.16, 1, 0.3, 1); }
.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
  color: var(--color-text);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-interactive);
}
.dropdown-menu a:hover       { background-color: var(--color-primary-light); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-interactive);
}
.icon-btn:hover  { background-color: var(--color-primary-light); }
.hamburger       { display: flex; }
@media (min-width: 768px) { .hamburger { display: none; } }

/* Mobile nav */
#mobile-nav {
  display: none;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  padding: 1rem;
}
#mobile-nav.open { display: block; }
.mobile-nav-section-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0 0.25rem;
}
.mobile-nav a {
  display: block;
  padding: 0.75rem 0.5rem;
  font-size: var(--text-sm);
  color: var(--color-text);
  border-radius: var(--radius-md);
}
.mobile-nav a:hover  { color: var(--color-primary); }
.mobile-nav a.active { color: var(--color-primary); }

/* --- Tab Navigation --- */
.tab-list {
  display: flex;
  overflow-x: auto;
  gap: 0.25rem;
  border-bottom: 1px solid var(--color-border);
  margin-inline: -1rem;
  padding-inline: 1rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tab-list::-webkit-scrollbar { display: none; }
.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 1rem;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  transition: color var(--transition-interactive), border-color var(--transition-interactive);
  margin-bottom: -1px;
}
.tab-btn:hover                   { color: var(--color-text); }
.tab-btn[aria-selected="true"]   { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-btn .tab-label              { display: none; }
@media (min-width: 640px) { .tab-btn .tab-label { display: inline; } }
.tab-panel        { display: none; }
.tab-panel.active { display: block; }

/* --- Mode toggle (add/subtract) --- */
.mode-toggle { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.mode-btn {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  transition: background-color var(--transition-interactive), color var(--transition-interactive);
}
.mode-btn.active { background: var(--color-primary); color: var(--color-primary-foreground); border-color: var(--color-primary); }

/* Sub-mode toggle (pill) */
.pill-toggle { display: flex; gap: 0.25rem; padding: 0.25rem; background: var(--color-surface-offset); border-radius: var(--radius-md); width: fit-content; }
.pill-btn {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--color-text-muted);
  transition: background-color var(--transition-interactive), color var(--transition-interactive);
}
.pill-btn.active { background: var(--color-surface); box-shadow: var(--shadow-sm); color: var(--color-text); }

/* --- FAQ Accordion --- */
.faq-list { display: flex; flex-direction: column; gap: 0.5rem; }
.faq-item { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.faq-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 500;
  font-size: var(--text-sm);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  transition: background-color var(--transition-interactive);
  gap: 0.5rem;
}
.faq-btn:hover                          { background-color: var(--color-primary-light); }
.faq-chevron                            { width: 1rem; height: 1rem; flex-shrink: 0; transition: transform var(--transition-interactive); }
.faq-btn[aria-expanded="true"] .faq-chevron { transform: rotate(180deg); }
.faq-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-interactive);
}
.faq-body.open { max-height: 500px; }
.faq-body p    { padding: 0 1.25rem 1rem; font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.625; }

/* --- Back to top --- */
#back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease, background-color var(--transition-interactive);
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover   { background: var(--color-primary-hover); }

/* --- ToolCard / ArticleCard --- */
.tool-card {
  display: block;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: transform var(--transition-interactive), box-shadow var(--transition-interactive);
  color: var(--color-text);
}
.tool-card:hover            { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tool-card .tool-icon       { width: 1.5rem; height: 1.5rem; color: var(--color-primary); margin-bottom: 0.75rem; }
.tool-card .tool-title      { font-weight: 600; font-size: var(--text-sm); margin-bottom: 0.25rem; font-family: var(--font-body); }
.tool-card .tool-desc       { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: 0.75rem; }
.tool-card .tool-link       { display: inline-flex; align-items: center; gap: 0.25rem; font-size: var(--text-xs); color: var(--color-primary); font-weight: 500; transition: gap var(--transition-interactive); }
.tool-card:hover .tool-link { gap: 0.5rem; }

/* --- Breadcrumb --- */
.breadcrumb         { display: flex; align-items: center; gap: 0.5rem; font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: 1.5rem; flex-wrap: wrap; }
.breadcrumb a       { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb .sep    { opacity: 0.4; }
.breadcrumb .current { color: var(--color-text); }

/* --- Footer --- */
#site-footer { border-top: 1px solid var(--color-border); background: var(--color-surface); margin-top: 4rem; }
.footer-inner { padding-block: 3rem; }
.footer-grid  { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-links li    { margin-top: 0.5rem; }
.footer-links a     { font-size: var(--text-sm); color: var(--color-text-muted); transition: color var(--transition-interactive); }
.footer-links a:hover { color: var(--color-primary); }
.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-divider);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
@media (min-width: 640px) { .footer-bottom { flex-direction: row; } }

/* --- Inline badge / tag --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  background: var(--color-primary-light);
  color: var(--color-text);
}

/* --- Info/error inline message --- */
.msg-error { display: flex; align-items: center; gap: 0.5rem; color: var(--color-destructive); font-size: var(--text-sm); }
.msg-info  { display: flex; align-items: center; gap: 0.5rem; color: var(--color-text-muted); font-size: var(--text-sm); }

/* --- Copy button state --- */
.copy-btn                     { transition: all var(--transition-interactive); }
.copy-btn.copied svg.icon-copy   { display: none; }
.copy-btn:not(.copied) svg.icon-check { display: none; }

/* --- Zeiten-addieren rows --- */
.time-row { display: flex; align-items: center; gap: 0.5rem; }
.time-row .remove-row-btn {
  padding: 0.5rem;
  color: var(--color-destructive);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.1em;
  line-height: 1;
  transition: background-color var(--transition-interactive);
}
.time-row .remove-row-btn:hover { background: color-mix(in oklch, var(--color-destructive) 10%, transparent); }
.add-row-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 500;
  transition: text-decoration var(--transition-interactive);
}
.add-row-btn:hover { text-decoration: underline; }

/* --- Impressum highlight box --- */
.info-box {
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: var(--text-sm);
}
.warn-box {
  background: color-mix(in oklch, var(--color-primary-light) 50%, transparent);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: var(--text-sm);
  margin-top: 2rem;
}

/* --- 404 page --- */
.not-found-wrap { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: var(--color-surface-offset); }
.not-found-box  { text-align: center; padding: 2rem; }
.not-found-box h1 { font-size: 4rem; margin-bottom: 1rem; }
.not-found-box p  { font-size: var(--text-xl); color: var(--color-text-muted); margin-bottom: 1rem; }

/* --- Misc helpers --- */
.hint       { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 0.75rem; }
.text-link  { color: var(--color-primary); }
.text-link:hover { text-decoration: underline; }
.pl-3 { padding-left: 0.75rem; }
.pl-4 { padding-left: 1rem; }

/* --- Table of Contents (inline dropdown) --- */
.toc-inline {
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  font-size: var(--text-sm);
  transition: all var(--transition-interactive);
}
.toc-inline .toc-title {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
  list-style: none;
}
.toc-inline .toc-title::-webkit-details-marker { display: none; }
.toc-inline .toc-title .chevron               { transition: transform var(--transition-interactive); }
.toc-inline[open] .toc-title .chevron         { transform: rotate(180deg); }
.toc-inline ol {
  list-style: decimal;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.toc-inline ol li            { list-style-type: decimal; margin-top: 0; }
.toc-inline ol li a          { color: var(--color-primary); text-decoration: none; transition: text-decoration var(--transition-interactive); }
.toc-inline ol li a:hover    { text-decoration: underline; }

/* --- Callout / Highlight box --- */
.callout {
  display: flex;
  gap: 0.75rem;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.25em 0;
  font-size: var(--text-sm);
  line-height: 1.65;
}
.callout-icon { flex-shrink: 0; font-size: 1.1rem; margin-top: 0.1rem; }
.callout-tip {
  background: color-mix(in oklch, var(--color-primary) 8%, transparent);
  border: 1px solid color-mix(in oklch, var(--color-primary) 22%, transparent);
  color: var(--color-text);
}
.callout-warn {
  background: oklch(0.93 0.06 80 / 0.35);
  border: 1px solid oklch(0.75 0.10 75 / 0.35);
  color: var(--color-text);
}
.callout-body strong { font-weight: 600; display: block; margin-bottom: 0.25rem; }

/* --- Article styled blockquote --- */
.prose-article blockquote.article-quote {
  position: relative;
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.5em 0;
  color: var(--color-text-muted);
  font-style: italic;
  font-size: var(--text-sm);
  line-height: 1.75;
}
.prose-article blockquote.article-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--color-primary);
}

/* --- Sources / Quellen list --- */
.sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  counter-reset: source-counter;
}
.sources-list li {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-top: 0;
}
.sources-list li::before {
  content: counter(source-counter);
  counter-increment: source-counter;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}
.sources-list a       { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
.sources-list a:hover { color: var(--color-primary-hover); }
