/* Dock — Bausteine. Liest die Tokens aus tokens.css (--tile, --ink, --a-time, --radius-tile …). */

.dock-root {
  font-family: var(--font-sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* ---------- Flaeche: Verlauf + Filmkorn ---------- */
.dock-wall {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--wall-base);
  background-image:
    radial-gradient(110% 80% at 88% -5%, var(--wall-c) 0%, transparent 55%),
    radial-gradient(90% 80% at -5% 105%, var(--wall-b) 0%, transparent 60%),
    linear-gradient(160deg, var(--wall-a) 0%, var(--wall-base) 100%);
  color: var(--ink);
}
.dock-wall::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain, 0.32);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
[data-theme="papier"] .dock-wall::after {
  opacity: var(--grain-light, 0.16);
}

/* ---------- Raster ---------- */
.dock-grid {
  display: grid;
  grid-template-columns: repeat(var(--dock-cols, 4), minmax(0, 1fr));
  grid-auto-rows: var(--module);
  grid-auto-flow: row dense;
  gap: var(--tile-gap);
}

/* ---------- Kachel ---------- */
.dock-tile {
  position: relative;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  padding: var(--tile-pad);
  border-radius: var(--radius-tile);
  background: var(--tile);
  color: var(--ink);
  grid-column: span var(--span, 1);
  grid-row: span var(--rows, 1);
  transition: transform 0.2s ease-out;
}
.dock-tile[data-interactive="true"] {
  cursor: pointer;
}
.dock-tile[data-interactive="true"]:hover {
  transform: scale(1.015);
}
.dock-tile[data-interactive="true"]:active {
  transform: scale(0.985);
}
.dock-tile[data-tone="cream"] { background: var(--tone-cream); }
.dock-tile[data-tone="lilac"] { background: var(--tone-lilac); }
.dock-tile[data-tone="mint"] { background: var(--tone-mint); }
.dock-tile[data-tone] {
  --ink: var(--tone-ink);
  --ink-2: rgba(34, 24, 14, 0.6);
  --ink-3: rgba(34, 24, 14, 0.34);
  --track: rgba(34, 24, 14, 0.12);
  --control: rgba(34, 24, 14, 0.08);
  --row: rgba(34, 24, 14, 0.05);
  --a-time: #0a6fa3;
  --a-plus: #19803b;
  --a-minus: #c62d24;
  --a-leave: #b56500;
  --a-week: #7d2fb0;
}

/* ---------- Glas ---------- */
.dock-glass {
  background-color: var(--dock);
  -webkit-backdrop-filter: var(--backdrop-glass);
  backdrop-filter: var(--backdrop-glass);
  box-shadow: var(--shadow-glass);
}
.dock-glass-soft {
  background-color: rgba(15, 15, 20, 0.42);
  -webkit-backdrop-filter: var(--backdrop-soft);
  backdrop-filter: var(--backdrop-soft);
  box-shadow: var(--shadow-soft-edge);
}
[data-theme="papier"] .dock-glass-soft { background-color: rgba(255, 255, 255, 0.42); }

/* ---------- Text ---------- */
.dock-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}
.dock-header__label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dock-header__label > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-header__value { flex-shrink: 0; font-weight: 700; }
.dock-value {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dock-value--display-xl { font-size: 76px; letter-spacing: -0.045em; }
.dock-value--display { font-size: 44px; letter-spacing: -0.035em; }
.dock-value--value { font-size: 30px; letter-spacing: -0.03em; }
.dock-muted { color: var(--ink-2); }
.dock-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- Icons (Material Symbols Rounded) ---------- */
.dock-icon {
  font-family: var(--font-icons);
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  display: inline-block;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 450;
  user-select: none;
}
.dock-icon[data-filled="true"] { font-variation-settings: "FILL" 1, "wght" 500; }

/* ---------- Akzente ---------- */
[data-accent="time"] { color: var(--a-time); }
[data-accent="plus"] { color: var(--a-plus); }
[data-accent="minus"] { color: var(--a-minus); }
[data-accent="leave"] { color: var(--a-leave); }
[data-accent="week"] { color: var(--a-week); }
[data-accent="plan"] { color: var(--a-plan); }
[data-accent="warn"] { color: var(--a-warn); }
[data-accent="cal"] { color: var(--a-cal); }
[data-accent="ink-2"] { color: var(--ink-2); }

/* ---------- Knoepfe ---------- */
.dock-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control);
  height: var(--control);
  flex-shrink: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--control);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
.dock-round:hover { filter: brightness(1.25); }
.dock-round:active { transform: scale(0.94); }
.dock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
.dock-pill:active { transform: scale(0.97); }
.dock-pill--primary { background: var(--ink); color: var(--tile); }
.dock-pill--control { background: var(--control); color: var(--ink); }
.dock-pill--accent { background: var(--a-time); color: var(--on-accent); }
.dock-pill--glass { color: var(--ink); }
.dock-pill--glass:hover, .dock-pill--control:hover { filter: brightness(1.2); }
.dock-round:focus-visible, .dock-pill:focus-visible, .dock-app:focus-visible, .dock-seg button:focus-visible {
  outline: 2px solid var(--a-time);
  outline-offset: 2px;
}

/* ---------- Segmente ---------- */
.dock-seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
}
.dock-seg button {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.dock-seg button[aria-pressed="true"] { background: var(--ink); color: var(--tile); }

/* ---------- Dock ---------- */
.dock-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-dock);
}
.dock-app {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--dock-app);
  height: var(--dock-app);
  border: 0;
  border-radius: 19px;
  background: var(--tile);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s ease-out;
}
.dock-app:hover { transform: translateY(-4px) scale(1.06); }
.dock-app[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  width: 14px;
  height: 3px;
  margin-left: -7px;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0.8;
}
.dock-app--wide { width: auto; padding: 0 16px; flex-direction: column; align-items: flex-start; gap: 4px; }
.dock-app--round { border-radius: var(--radius-pill); }
.dock-sep { width: 1px; height: 36px; background: var(--edge-strong); }

/* ---------- Ring, Linie, Fuellstand ---------- */
.dock-ring { position: relative; aspect-ratio: 1; height: 100%; max-height: 100%; }
.dock-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.dock-ring__arc { transition: stroke-dasharray 1s ease-out; }
.dock-ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1;
  text-align: center;
}
.dock-level { display: flex; gap: 2px; height: 6px; overflow: hidden; border-radius: var(--radius-pill); background: var(--track); }
.dock-level > span { display: block; height: 100%; border-radius: var(--radius-pill); background: currentColor; transition: width 0.7s ease-out; }
.dock-spark { display: block; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  .dock-tile, .dock-app, .dock-round, .dock-pill, .dock-ring__arc, .dock-level > span { transition: none !important; }
}
