/* Hub-Design: ruhig, dunkel, mit einer Akzentfarbe (kühles Türkis). Unabhängig vom Marken-Handbuch. */
:root, :root[data-theme="dark"] {
  --bg: #070b10; --surface: #0d131a; --surface-2: #121b25;
  --line: #1a2632; --line-strong: #283847;
  --text: #e6edf3; --muted: #7c8c9d;
  --accent: #4fd1dd; --accent-soft: rgba(79, 209, 221, .11); --on-accent: #041418;
  --ok: #46d39a; --warn: #ff6b6b; --amber: #f0b35a;
  --glow: radial-gradient(1100px 380px at 12% -8%, rgba(79, 209, 221, .07), transparent 60%);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f1ea; --surface: #fffdf9; --surface-2: #f8f5ee;
  --line: #e5dfd2; --line-strong: #d6cfbe;
  --text: #1c1a16; --muted: #7f796b;
  --accent: #0e8f9c; --accent-soft: rgba(14, 143, 156, .09); --on-accent: #ffffff;
  --ok: #1f9d6b; --warn: #d64545; --amber: #b7791f;
  --glow: none;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #f4f1ea; --surface: #fffdf9; --surface-2: #f8f5ee;
    --line: #e5dfd2; --line-strong: #d6cfbe;
    --text: #1c1a16; --muted: #7f796b;
    --accent: #0e8f9c; --accent-soft: rgba(14, 143, 156, .09); --on-accent: #ffffff;
    --ok: #1f9d6b; --warn: #d64545; --amber: #b7791f;
    --glow: none;
    color-scheme: light;
  }
}
:root {
  /* Kurznamen, die app.js in Inline-Stilen nutzt */
  --brand-primary: var(--accent); --brand-accent: var(--amber);
  --brand-warning: var(--warn); --brand-success: var(--ok);
  --brand-bg: var(--bg); --brand-surface: var(--surface); --brand-text: var(--text);
  --font-heading: ui-sans-serif, system-ui, -apple-system, "SF Pro Display", "Segoe UI", sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px; --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--text); font-family: var(--font-body); line-height: 1.5; font-size: 15px;
  background: var(--glow), var(--bg); background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-heading); margin: 0 0 .5rem; font-weight: 500; letter-spacing: .005em; }
h1 { font-size: 1.55rem; }
h2 { font-size: .78rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
h3 { font-size: 1rem; }
::selection { background: var(--accent-soft); }

#app { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
#nav {
  padding: 1.25rem .75rem; display: flex; flex-direction: column; gap: .15rem;
  border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, transparent);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
#nav .logo { font-family: var(--font-heading); font-weight: 500; letter-spacing: .16em; text-transform: uppercase; font-size: .78rem; padding: .35rem .75rem 1.25rem; color: var(--text); }
#nav .logo::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: .6rem; vertical-align: 1px; }
#nav button {
  all: unset; cursor: pointer; padding: .55rem .75rem; border-radius: 10px; display: flex; gap: .7rem; align-items: center;
  color: var(--muted); font-size: .92rem; position: relative; transition: color .2s, background .2s;
}
#nav button .ico { width: 1.1rem; text-align: center; opacity: .8; }
#nav button:hover { color: var(--text); background: var(--accent-soft); }
#nav button:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
#nav button[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
#nav button[aria-current="page"]::before { content: ""; position: absolute; left: -.75rem; top: 20%; bottom: 20%; width: 2px; border-radius: 2px; background: var(--accent); }
#nav button[aria-current="page"] .ico { color: var(--accent); opacity: 1; }
#view { padding: 1.75rem 2rem 6rem; max-width: 1120px; width: 100%; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem 1.15rem; transition: border-color .25s; }
.card:hover { border-color: var(--line-strong); }
.card.wide { grid-column: 1 / -1; }
.muted { color: var(--muted); font-size: .88rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .7rem; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .85rem; background: var(--surface-2); }
.kpi b { display: block; font-size: 1.5rem; font-weight: 400; font-family: var(--font-mono); font-variant-numeric: tabular-nums; margin-top: .1rem; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.between { justify-content: space-between; }
ul.list { list-style: none; margin: .5rem 0 0; padding: 0; }
ul.list li { display: flex; gap: .6rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--line); }
ul.list li:first-child { border-top: 0; }
.done { text-decoration: line-through; opacity: .45; }

input, select, textarea {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: .5rem .65rem; font: inherit; min-width: 0; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input[type="color"] { padding: 2px; width: 44px; height: 36px; cursor: pointer; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
input[type="date"], input[type="time"], input[type="month"] { font-variant-numeric: tabular-nums; }
.btn {
  background: var(--accent); color: var(--on-accent); border: 1px solid transparent; border-radius: 10px;
  padding: .5rem .95rem; font: inherit; font-weight: 500; cursor: pointer; transition: filter .2s, transform .1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--text); font-weight: 400; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: .2rem .35rem; border-radius: 8px; transition: color .2s; }
.icon-btn:hover { color: var(--text); }
.badge { font-size: .72rem; padding: .12rem .55rem; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); }

.swatches { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.swatch { width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--line-strong); }
.field { display: grid; gap: .25rem; margin-bottom: .75rem; }
.field label { font-size: .82rem; color: var(--muted); }
.colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.colors .row { justify-content: space-between; }
.color-row { display: grid; grid-template-columns: 1fr 44px 110px; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.color-row input:not([type]), .color-row input[type="text"] { font-family: var(--font-mono); }
.preview { border-radius: var(--radius); padding: 1.25rem; border: 1px solid var(--line); }
.soon { opacity: .85; }
pre { background: var(--surface-2); padding: .8rem; border-radius: 10px; overflow: auto; font-size: .8rem; border: 1px solid var(--line); font-family: var(--font-mono); }
details > summary { cursor: pointer; }

/* Kopfzeile (HUD) */
.hud { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.25rem 2rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.hud-left { min-width: 0; flex: 1 1 320px; }
.hud-eyebrow { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: .45rem; }
.hud-greeting { font-size: clamp(1.25rem, 2.4vw, 1.75rem); font-weight: 400; line-height: 1.25; margin: 0; max-width: 32ch; text-wrap: balance; }
.hud-right { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.hud-clock { position: relative; font-family: var(--font-mono); font-size: 1.05rem; font-variant-numeric: tabular-nums; padding: .28rem .7rem .4rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.hud-sec { position: absolute; left: .7rem; right: .7rem; bottom: .2rem; height: 1px; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform 1s linear; opacity: .8; }
.hud-chip { display: flex; align-items: center; gap: .4rem; font-size: .88rem; padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); min-height: 2rem; }
.hud-chip:empty { display: none; }
.hud-chip svg { color: var(--accent); }
.hud-ring { position: relative; width: 34px; height: 34px; display: grid; place-items: center; cursor: default; }
.hud-ring svg { position: absolute; inset: 0; }
.hud-ring span { font-size: .6rem; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ring-bg { fill: none; stroke: var(--line-strong); stroke-width: 2.4; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease); }
.hud-dots { display: flex; gap: .4rem; padding: 0 .3rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.dot.ok { background: var(--ok); animation: breathe 3.2s ease-in-out infinite; }
.dot.off { background: var(--warn); opacity: .8; }
.hud-theme { color: var(--muted); }

/* Mikrofon */
.mic {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 20; width: 58px; height: 58px; border-radius: 50%;
  border: 1px solid var(--accent); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--accent);
  font-size: 1.35rem; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: mic-breathe 4s ease-in-out infinite; transition: transform .15s;
}
.mic:hover { transform: scale(1.05); }
.mic[data-state="rec"] { background: var(--warn); border-color: var(--warn); color: #fff; animation: mic-rec 1.2s infinite; }
.mic[data-state="rec"]::after { content: attr(data-time); position: absolute; top: -1.5rem; left: 50%; transform: translateX(-50%); font-size: .72rem; font-family: var(--font-mono); color: var(--text); white-space: nowrap; }
.mic[data-state="busy"] { opacity: .7; cursor: wait; animation: none; }
#toast {
  position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%) translateY(16px); z-index: 30; max-width: min(92vw, 520px);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: .75rem 1rem; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); font-size: .9rem;
}
#toast.show { opacity: 1; transform: translateX(-50%); }

/* Bewegung: nur beim Seitenwechsel, dezent */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 0%, transparent); } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); } }
@keyframes mic-breathe { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 9px var(--accent-soft); } }
@keyframes mic-rec { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 45%, transparent); } 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--warn) 0%, transparent); } }
#view.enter .hud, #view.enter > h1, #view.enter > p, #view.enter > section, #view.enter .grid > .card, #view.enter .grid > section { animation: rise .5s var(--ease) both; }
#view.enter .grid > :nth-child(2) { animation-delay: .05s; }
#view.enter .grid > :nth-child(3) { animation-delay: .1s; }
#view.enter .grid > :nth-child(4) { animation-delay: .15s; }
#view.enter .grid > :nth-child(5) { animation-delay: .2s; }
#view.enter .grid > :nth-child(n+6) { animation-delay: .25s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 720px) {
  body { background-attachment: scroll; }
  #app { grid-template-columns: 1fr; padding-bottom: 72px; }
  #nav {
    position: fixed; top: auto; height: auto; bottom: 0; left: 0; right: 0; z-index: 10; flex-direction: row; overflow-x: auto; overflow-y: hidden;
    justify-content: flex-start; border-right: 0; border-top: 1px solid var(--line); gap: 0;
    padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  #nav .logo { display: none; }
  #nav button { flex: 0 0 auto; min-width: 4.3rem; flex-direction: column; gap: .1rem; font-size: .66rem; padding: .35rem .4rem; text-align: center; }
  #nav button .ico { font-size: 1.15rem; }
  #nav button[aria-current="page"]::before { left: 25%; right: 25%; top: 0; bottom: auto; width: auto; height: 2px; }
  #view { padding: 1rem 1rem 2rem; padding-top: calc(1rem + env(safe-area-inset-top)); }
  .mic { bottom: 5.3rem; right: 1rem; }
  #toast { bottom: 9.3rem; }
  .hud { margin-bottom: 1.2rem; }
  .hud-right { width: 100%; }
}

/* Marken-Handbuch */
.hb-head { margin-bottom: 1.4rem; }
.hb-head h1 { margin: 0 0 .35rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.hb-colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.hb-color { all: unset; cursor: pointer; display: grid; gap: .25rem; padding: .6rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); transition: border-color .2s, transform .15s; }
.hb-color:hover { border-color: var(--accent); }
.hb-color:active { transform: scale(.98); }
.hb-color:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hb-color code { font-family: var(--font-mono); font-size: .8rem; color: var(--accent); }
.hb-color .muted { font-size: .78rem; line-height: 1.35; }
.hb-swatch { display: block; height: 64px; border-radius: 8px; border: 1px solid var(--line-strong); }
.hb-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; }
.hb-tile { border-radius: 10px; padding: .7rem .8rem; display: grid; gap: .1rem; border: 1px solid var(--line-strong); }
.hb-tile b { font-size: 1.5rem; line-height: 1.1; font-weight: 400; }
.hb-tile span { font-size: .85rem; }
.hb-fonts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.hb-logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.hb-logos figure { margin: 0; display: grid; gap: .5rem; }
.hb-logo { border-radius: 14px; border: 1px solid var(--line-strong); aspect-ratio: 1; display: grid; place-items: center; padding: 8%; }
.hb-logo img { width: 100%; height: 100%; object-fit: contain; }
.hb-logos figcaption { display: grid; gap: .1rem; font-size: .85rem; }
.hb-list { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; }
.hb-list li::marker { color: var(--accent); }
.hb-warn { color: var(--amber); }
.hb-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { all: unset; cursor: pointer; font-size: .85rem; padding: .28rem .7rem; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--text); transition: border-color .2s, color .2s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
a.btn { text-decoration: none; display: inline-block; }
