/*
 * hofknecht.eu: shared design for all pages (start page, projects, legal pages).
 * Projects link /design/hofknecht.css and keep their own images and accents.
 * No external fonts or services (privacy), only system fonts.
 */
:root {
  --bg: #0c1322;
  --bg-2: #121b2f;
  --bg-3: #1a2540;
  --ink: #f4ecda;
  --ink-dim: #c9bfa8;
  --accent: #f2b544;
  --accent-2: #ff8f3a;
  --line: rgba(244, 236, 218, 0.12);
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --text: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Same width with and without scrollbar, so the header never shifts between pages */
html { scrollbar-gutter: stable; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(242, 181, 68, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(80, 120, 220, 0.12), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #1b1203; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }

/* Header */
.head { border-bottom: 1px solid var(--line); }
.head__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 800 20px/1 var(--display); letter-spacing: -0.01em; }
.lang { display: flex; gap: 4px; font: 700 14px/1 var(--display); }
.lang a { text-decoration: none; padding: 8px 10px; border-radius: 8px; color: var(--ink-dim); }
.lang a[aria-current="true"] { color: var(--ink); background: var(--bg-3); }
.lang a:hover { color: var(--ink); }

/* Typography */
.eyebrow { margin: 0 0 12px; font: 700 13px/1.2 var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.h1 { margin: 0 0 16px; font: 800 clamp(34px, 5.4vw, 62px)/1.05 var(--display); letter-spacing: -0.02em; max-width: 18ch; }
.lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-dim); max-width: 60ch; margin: 0; }

/* Start page */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(28px, 4vw, 44px); }
.tiles {
  display: grid; gap: 24px; padding-bottom: clamp(56px, 8vw, 96px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.tile {
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tile:hover, .tile:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(242, 181, 68, 0.45); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tile__pic { aspect-ratio: 16 / 9; background: var(--bg-3); overflow: hidden; }
.tile__pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tile:hover .tile__pic img { transform: scale(1.04); }
.tile__pic--icon { display: grid; place-items: center; background: linear-gradient(135deg, #1d3a5f, #2b2350); }
.tile__pic--icon svg { width: 34%; height: auto; color: var(--ink); opacity: .9; }
.tile__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile__title { margin: 0; font: 800 22px/1.2 var(--display); }
.tile__text { margin: 0; color: var(--ink-dim); font-size: 16px; }
.tile__tag { margin-top: auto; padding-top: 10px; font: 700 13px/1 var(--display); color: var(--accent); letter-spacing: .04em; }

/* App icons (start page) */
.head__right { display: flex; align-items: center; gap: 12px; }
.signin { font: 700 14px/1 var(--display); text-decoration: none; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-dim); }
.signin:hover, .signin:focus-visible { color: var(--ink); border-color: rgba(242, 181, 68, 0.45); }
.signin--in { color: var(--ink); background: var(--bg-3); }
/* App header: the current app's name where the start page shows the signed-in user */
.head__app { font: 700 14px/1 var(--display); padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); background: var(--bg-3); white-space: nowrap; }
.wrap.app-page { padding-top: clamp(20px, 3vw, 32px); }
.hero--small { padding-bottom: clamp(20px, 3vw, 32px); }
.group { padding-bottom: clamp(40px, 6vw, 64px); }
.group[hidden] { display: none; }
.group--top { padding-top: clamp(32px, 5vw, 56px); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.group__title { margin: 0 0 22px; font: 700 13px/1.2 var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim); }
.apps {
  display: grid; gap: 30px 14px; margin: 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
.app { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; text-decoration: none; border-radius: 14px; padding: 6px 2px; }
.app:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app__icon {
  width: 80px; height: 80px; border-radius: 22px; overflow: hidden;
  display: grid; place-items: center; background: var(--c, var(--bg-3));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform .18s ease, box-shadow .18s ease;
}
.app:hover .app__icon, .app:focus-visible .app__icon { transform: translateY(-3px) scale(1.04); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.app__icon img { width: 100%; height: 100%; object-fit: cover; }
.app__icon img.app__logo { width: 62%; height: 62%; object-fit: contain; }
.app__icon svg { width: 42px; height: 42px; color: #fff; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app__name { font: 700 14px/1.25 var(--display); }
.app__tag { margin-top: -6px; font-size: 12px; line-height: 1.3; color: var(--ink-dim); }
.app__label { display: contents; }

/* Start page as home screen (design/start.js): names on hover, menu on long press, folders, select mode */
.js .apps:not(.apps--labels) { gap: 26px 12px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.js .apps .app { position: relative; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.js .apps .app__label { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.js .apps .app__label .app__tag { margin-top: 0; }
.js .apps:not(.apps--labels) .app__label {
  position: absolute; top: calc(100% - 2px); left: 50%; z-index: 20; width: max-content; max-width: 220px;
  padding: 8px 12px; border-radius: 10px; background: rgba(18, 27, 47, 0.97); border: 1px solid var(--line); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translate(-50%, 6px); transition: opacity .12s ease, transform .12s ease;
}
.js .apps:not(.apps--labels) .app:hover .app__label,
.js .apps:not(.apps--labels) .app:focus-visible .app__label { opacity: 1; transform: translate(-50%, 0); transition-delay: .3s; }
@media (hover: none) { .js .apps:not(.apps--labels) .app__label { display: none; } }
.apps--edit .app:hover .app__label, .is-dragging-tile .app__label { opacity: 0 !important; }
.app__icon--folder { display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); gap: 6px; padding: 11px; place-items: stretch; background: rgba(244, 236, 218, 0.13); }
.mini { display: grid; place-items: center; overflow: hidden; border-radius: 7px; background: var(--c, var(--bg-3)); }
.mini img { width: 100%; height: 100%; object-fit: cover; }
.mini img.app__logo { width: 64%; height: 64%; object-fit: contain; }
.app__icon .mini svg, .js .apps .app__icon .mini svg { width: 64%; height: 64%; stroke-width: 2.2; }
.app__check { display: none; position: absolute; top: -2px; left: calc(50% + 26px); width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); background: rgba(12, 19, 34, 0.85); }
.apps--edit li:not([data-kind=fixed]) .app__check { display: block; }
.apps--edit li.is-selected .app__check { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1203' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 15px no-repeat; border-color: var(--accent); }
.apps--edit li.is-selected .app__icon { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent); }
.apps--edit li[data-kind=fixed] { opacity: 0.35; }
.apps--edit li:not([data-kind=fixed]) .app__icon { animation: jiggle .26s ease-in-out infinite alternate; }
.apps--edit li:nth-child(2n) .app__icon { animation-delay: -.13s; }
.apps--edit li:not([data-kind=fixed]) { touch-action: none; }
@keyframes jiggle { from { transform: rotate(-1.8deg); } to { transform: rotate(1.8deg); } }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; margin: 0; transform-origin: center; box-shadow: 0 26px 50px rgba(0, 0, 0, 0.55); opacity: 0.95; }
li.is-dragging > .app { opacity: 0.25; }
li.is-target .app__icon { transform: scale(1.14); box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent), 0 16px 32px rgba(0, 0, 0, 0.45); }
.is-dragging-tile, .is-dragging-tile * { cursor: grabbing !important; }
li.is-lifted { position: relative; z-index: 85; }
li.is-lifted .app__icon { transform: scale(1.08); }
li.is-lifted .app__label { opacity: 0 !important; }
.menu-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(6, 10, 20, 0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.tile-menu { position: fixed; z-index: 90; width: max-content; min-width: 240px; max-width: min(320px, calc(100vw - 24px)); padding: 6px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow); animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.tile-menu__head { display: flex; align-items: center; gap: 12px; padding: 8px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.tile-menu__head .app__icon { width: 46px; height: 46px; border-radius: 13px; flex: none; box-shadow: none; }
.tile-menu__head .app__icon svg { width: 26px; height: 26px; }
.tile-menu__head .app__icon--folder { gap: 3px; padding: 6px; }
.tile-menu__head .mini { border-radius: 4px; }
.tile-menu__head b { display: block; font: 700 16px/1.2 var(--display); }
.tile-menu__head small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--ink-dim); }
.tile-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 600 15px/1.2 var(--text); text-align: left; cursor: pointer; }
.tile-menu button:hover, .tile-menu button:focus-visible { background: var(--bg-3); outline: none; }
.tile-menu button svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--ink-dim); }
.tile-menu button.is-danger, .tile-menu button.is-danger svg { color: #ffb4a8; }
.sheet { width: min(560px, calc(100vw - 24px)); max-height: min(82vh, 720px); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--bg-2); color: var(--ink); box-shadow: var(--shadow); }
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(6, 10, 20, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet__head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 6px 22px; }
.sheet__head h2 { margin: 0; font: 800 22px/1.2 var(--display); }
.sheet__close { margin-left: auto; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: var(--bg-3); color: var(--ink); cursor: pointer; }
.sheet__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sheet__close:hover { background: var(--bg); }
.sheet__body { padding: 10px 22px 24px; overflow: auto; }
.sheet .apps { padding: 10px 0 4px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 24px 8px; }
.folder-name { flex: 1; min-width: 0; padding: 6px 10px; margin-left: -10px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--ink); font: 800 22px/1.2 var(--display); }
.folder-name:hover, .folder-name:focus { border-color: var(--line); background: var(--bg); outline: none; }
.hidden-list { margin: 0 0 18px; padding: 0; list-style: none; }
.hidden-list li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hidden-list .app__icon { width: 48px; height: 48px; border-radius: 13px; flex: none; box-shadow: none; }
.hidden-list .app__icon svg { width: 26px; height: 26px; }
.hidden-list div { flex: 1; min-width: 0; }
.hidden-list b { display: block; font: 700 16px/1.2 var(--display); }
.hidden-list small { color: var(--ink-dim); font-size: 13px; }
.btn--small { padding: 10px 14px; font-size: 14px; }
.btn[disabled] { opacity: 0.4; cursor: default; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 14px; background: var(--bg); font: 600 16px/1.3 var(--text); cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; position: relative; width: 50px; height: 30px; flex: none; margin: 0; border-radius: 99px; background: var(--bg-3); border: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(20px); background: #1b1203; }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.settings__row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 6px; }
.settings .note { margin: 12px 0 0; font-size: 14px; line-height: 1.5; }
.settings__links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 0; font-weight: 600; }
.settings__links a { color: var(--accent); }
.editbar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 70; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; width: max-content; max-width: calc(100vw - 24px); padding: 8px 8px 8px 16px; border-radius: 16px; background: rgba(18, 27, 47, 0.97); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .18s ease-out; }
.editbar__count { margin-right: 6px; color: var(--ink-dim); font-size: 15px; white-space: nowrap; }
.editbar__count b { color: var(--ink); }
.editbar .btn { padding: 10px 14px; font-size: 14px; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 110; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 12px; background: #3a1f24; color: #ffd2cb; box-shadow: var(--shadow); }
@media (max-width: 520px) {
  .js .apps:not(.apps--labels) { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 22px 6px; }
  .js .apps .app__icon { width: 64px; height: 64px; border-radius: 18px; }
  .js .apps .app__icon svg { width: 34px; height: 34px; }
  .js .apps .app__icon--folder { padding: 9px; gap: 5px; }
  .app__check { left: calc(50% + 18px); }
  .sheet .apps { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .apps--edit li .app__icon, .tile-menu, .editbar { animation: none !important; } }

/* Forms and buttons (sign-in) */
.narrow { max-width: 520px; padding: clamp(40px, 6vw, 72px) 0; }
.form { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
.form label { display: flex; flex-direction: column; gap: 6px; font: 700 14px/1.2 var(--display); color: var(--ink-dim); }
.form input { font: inherit; font-size: 17px; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form__row { display: flex; flex-wrap: wrap; gap: 12px; }
.form__error { margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 90, 90, 0.12); color: #ffb4a8; }
.btn { font: 800 16px/1 var(--display); color: #1b1203; background: var(--accent); border: 0; border-radius: 12px; padding: 14px 20px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { background: var(--accent-2); }
.btn--ghost { color: var(--ink); background: var(--bg-3); }
.btn--ghost:hover { background: var(--bg-2); }
.btn--danger { color: #ffb4a8; background: transparent; border: 1px solid rgba(255, 90, 90, 0.45); }
.btn--danger:hover { background: rgba(255, 90, 90, 0.12); }
.form select { font: inherit; font-size: 17px; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.form select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form__ok { margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(25, 158, 112, 0.14); color: #8fe3c2; }
.form--tight { margin-top: 0; gap: 14px; }
.form__inline { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.form__inline label { flex: 1 1 180px; }
.card .form input, .card .form select { background: var(--bg); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.checks legend { margin-bottom: 8px; padding: 0; font: 700 14px/1.2 var(--display); color: var(--ink-dim); }
.form .check { position: relative; flex-direction: row; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; border: 1px solid var(--line); border-radius: 99px; font: 600 14px/1.2 var(--text); color: var(--ink-dim); cursor: pointer; }
.form .check input { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; }
.check__dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--c); flex: none; }
.form .check:has(input:checked) { color: var(--ink); border-color: var(--c, var(--accent)); background: var(--bg-3); }
.check:has(input:checked) .check__dot { background: var(--c); }
.check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Accounts page (/konto/benutzer.php) */
.users { padding-bottom: clamp(48px, 7vw, 80px); }
.users__rules { margin: 0 0 24px; padding-left: 20px; color: var(--ink-dim); font-size: 15px; line-height: 1.6; max-width: 80ch; }
.users__rules b { color: var(--ink); }
.users > .form__ok, .users > .form__error { margin-bottom: 20px; }
.user { display: flex; flex-direction: column; gap: 16px; }
.user .card__meta { margin: -12px 0 0; }
.user__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.user__head .card__title { margin: 0 6px 0 0; }
.user__remove { margin-top: auto; }
.user--new { border-style: dashed; }
.tag--admin { border-color: rgba(242, 181, 68, 0.6); color: var(--accent); }
.tag--du { border-color: rgba(57, 135, 229, 0.6); color: #8db8f0; }

/* Usage page */
.usage { padding: clamp(32px, 5vw, 56px) 0 clamp(48px, 7vw, 80px); }
.usage__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.usage__head .h1 { margin: 0; }
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); margin-bottom: 36px; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card__title { margin: 0 0 4px; font: 800 20px/1.2 var(--display); display: flex; align-items: center; gap: 10px; }
.card__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.card__meta { margin: 0 0 18px; font-size: 14px; color: var(--ink-dim); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.stats div { background: var(--bg-3); border-radius: 12px; padding: 12px; }
.stats dt { font-size: 13px; color: var(--ink-dim); }
.stats dd { margin: 2px 0 0; font: 800 22px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stats small { display: block; font: 400 12px/1.3 var(--text); color: var(--ink-dim); }
.chart { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 0 0 28px; }
.chart h2 { margin: 0 0 4px; font: 800 18px/1.2 var(--display); }
.chart p { margin: 0 0 16px; font-size: 14px; color: var(--ink-dim); }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--ink-dim); font: 400 11px var(--text); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-dim); }
.legend li { display: flex; align-items: center; gap: 8px; }
details.chart summary { cursor: pointer; font: 800 16px/1.2 var(--display); }
.table { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); }
.table th:first-child { text-align: left; }
.table thead th { color: var(--ink-dim); font: 700 13px/1.2 var(--display); }
.note { font-size: 15px; color: var(--ink-dim); }
.note a { color: var(--accent); }
.section-title { margin: 0 0 16px; font: 700 13px/1.2 var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim); }
.hourglass { width: 112px; height: auto; overflow: visible; }
.hourglass__glass { fill: var(--bg-3); }
.hourglass__outline { fill: none; stroke: rgba(244, 236, 218, 0.35); stroke-width: 2; }
.hourglass__cap { fill: var(--ink-dim); }
.hourglass__sand { fill: var(--g); }
.hourglass__sand--used { fill: var(--g); opacity: 0.35; }
.hourglass__stream { stroke: var(--g); stroke-width: 2.5; stroke-dasharray: 3 4; animation: sand 0.8s linear infinite; }
@keyframes sand { to { stroke-dashoffset: -7; } }
.lim__graphic--flip svg { animation: flip 1.2s cubic-bezier(.45, 0, .2, 1) 0.3s both; }
@keyframes flip { from { transform: rotate(-180deg); } to { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .hourglass__stream, .lim__graphic--flip svg { animation: none; } }
.cards--lim { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 14px; margin-bottom: 10px; }
.lim { padding: 16px 18px; }
.lim--mid { border-color: rgba(201, 133, 0, 0.6); }
.lim--high { border-color: rgba(230, 103, 103, 0.75); }
.lim__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-bottom: 12px; }
.lim__head .card__meta { margin: 0; font-size: 13px; }
.lim__gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lim__gauge { margin: 0; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "g top" "g time"; align-items: center;
  gap: 2px 12px; background: var(--bg-3); border-radius: 14px; padding: 12px; min-width: 0; }
.lim__graphic { grid-area: g; height: 72px; display: grid; place-items: center; }
.lim__graphic svg { height: 100%; width: auto; display: block; overflow: visible; }
.lim__graphic .ring { height: 60px; }
.lim__top { grid-area: top; display: flex; flex-direction: column; align-self: end; }
.lim__top strong { font: 700 12px/1.2 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.lim__value { font: 800 30px/1.05 var(--display); color: var(--g); font-variant-numeric: tabular-nums; }
.lim__value small { font-size: 14px; font-weight: 700; }
.lim__time { grid-area: time; align-self: start; margin: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; color: var(--ink); }
.lim__time span + span { color: var(--ink-dim); }
.lim__time .lim__warn { color: #e66767; font-weight: 700; }
.lim__tokens { margin: 10px 0 0; font-size: 13px; color: var(--ink-dim); }
.lim__tokens b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.lim .hourglass__glass { fill: var(--bg-2); }
.lim-key { margin: 0 0 24px; font-size: 13px; }
.ring__track { fill: none; stroke: rgba(244, 236, 218, 0.14); stroke-width: 13; }
.ring__free { fill: none; stroke: var(--g); stroke-width: 13; stroke-linecap: round; }
@media (max-width: 520px) {
  .usage { padding-top: 20px; }
  .usage__head { flex-wrap: nowrap; align-items: center; margin-bottom: 16px; }
  .usage__head .h1 { font-size: 26px; }
  .usage__head .btn { padding: 10px 14px; font-size: 14px; white-space: nowrap; }
  .lim { padding: 14px; }
  .lim__gauges { gap: 8px; }
  .lim__gauge { grid-template-areas: "g top" "time time"; gap: 6px 8px; padding: 10px; }
  .lim__graphic { height: 52px; }
  .lim__graphic .ring { height: 44px; }
  .lim__value { font-size: 26px; }
  .lim__time { font-size: 12px; }
}
.multiples { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.multiples h3 { margin: 0 0 8px; font: 700 15px/1.3 var(--display); }
.machine { margin: 0 0 36px; }
.machine__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 14px; }
.machine__head h2 { margin: 0; font: 800 24px/1.2 var(--display); display: flex; align-items: center; gap: 10px; }
.machine__head p { margin: 0; color: var(--ink-dim); font-size: 14px; }
.now { margin: 16px 0 0; padding: 10px 12px; background: var(--bg-3); border-radius: 12px; font-size: 15px; overflow-wrap: anywhere; }
.now b { color: var(--accent); }
.feed { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.feed li { margin: 3px 0; overflow-wrap: anywhere; }
.card details { margin-top: 14px; }
.card summary { cursor: pointer; font: 700 14px/1.3 var(--display); }
.card pre { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; color: var(--ink-dim); }
.empty { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--ink-dim); }
.quota { margin: 0 0 12px; }
.quota__head { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 4px; font-size: 14px; }
.quota__head span { color: var(--ink-dim); }
.quota__bar { display: block; height: 10px; background: var(--bg-3); border-radius: 5px; overflow: hidden; }
.quota__bar span { display: block; height: 100%; border-radius: 5px; }
.quota small { font-size: 12px; color: var(--ink-dim); }
.start { margin-top: 16px; }
.start__picks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.pick { font-size: 15px; cursor: pointer; }
.start__warn { margin: 0 0 12px; font-size: 13px; color: #c98500; }
.card__dot--live, .pulse { animation: pulse 1.6s ease-in-out infinite; }
.pulse { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: #199e70; vertical-align: 0; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(25, 158, 112, 0.6); } 50% { box-shadow: 0 0 0 6px rgba(25, 158, 112, 0); } }
@media (prefers-reduced-motion: reduce) { .card__dot--live, .pulse { animation: none; } }
.ap { margin: 0 0 32px; padding: clamp(18px, 3vw, 28px); border-radius: var(--radius); border: 2px solid var(--line); background: var(--bg-2); }
.ap__hero { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(16px, 3vw, 32px); }
.ap__icon { flex: none; width: clamp(72px, 14vw, 128px); height: auto; fill: #6b7a8f; transform: rotate(45deg); }
.ap p { margin: 0; overflow-wrap: anywhere; }
.ap__label { font: 700 13px/1.2 var(--display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-dim); }
.ap__state { display: flex; flex-wrap: wrap; gap: 6px 0.7em; margin-top: 8px !important; font: 800 clamp(24px, 6.5vw, 60px)/1 ui-monospace, "SF Mono", Menlo, monospace; color: #6b7a8f; }
.flap { position: relative; display: grid; place-items: center; width: 0.82em; height: 1.25em; border-radius: 6px; background: #0b0f17;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.05); animation: flip 0.5s calc(var(--i) * 60ms) both; }
.flap::after { content: ""; position: absolute; inset: 50% 0 auto; height: 1px; background: rgba(0, 0, 0, 0.7); }
.flaps { display: flex; gap: 4px; }
@keyframes flip { 0% { transform: rotateX(90deg); opacity: 0; } 60% { transform: rotateX(-15deg); opacity: 1; } 100% { transform: none; } }
.pilot__status { float: right; padding: 2px 8px; border-radius: 4px; background: #2fd39a; color: #0b0f17; letter-spacing: 0.1em; }
.ap__sub { margin-top: 6px !important; font-size: 15px; color: var(--ink-dim); }
.ap--on { border-color: #199e70; background: linear-gradient(135deg, rgba(25, 158, 112, 0.22), rgba(25, 158, 112, 0.06)); }
.ap--on .ap__state, .ap--on .ap__icon { color: #2fd39a; fill: #2fd39a; }
.ap--on .ap__icon { animation: fly 3s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(47, 211, 154, 0.5)); }
.ap--idle { border-color: rgba(242, 181, 68, 0.7); }
.ap--idle .ap__state, .ap--idle .ap__icon { color: var(--accent); fill: var(--accent); }
@keyframes fly { 0%, 100% { transform: rotate(45deg) translate(0, 0); } 50% { transform: rotate(45deg) translate(4px, -6px); } }
.ap--landed { border-color: rgba(90, 169, 230, 0.6); background: linear-gradient(135deg, rgba(90, 169, 230, 0.14), rgba(90, 169, 230, 0.04)); }
.ap--landed .ap__state, .ap--landed .ap__icon { color: #7cbcec; fill: #7cbcec; }
.ap--landed .ap__icon { transform: rotate(90deg); }
.pilot--landed { border-color: rgba(90, 169, 230, 0.45); }
.pilot--landed .pilot__icon { fill: #7cbcec; }
.pilot--landed .pilot__project { margin-top: 14px !important; }
.pilot--landed .pilot__status { background: #5aa9e6; color: #0b0f17; }
.pilot__reason { margin-top: 8px !important; font: 700 17px/1.35 var(--display); }
.land { flex: 1 1 300px; max-width: 460px; margin-left: auto; }
.land p { margin: 0; }
.land__label { font: 700 13px/1.2 var(--display); letter-spacing: 0.22em; text-transform: uppercase; color: #ff6b6b; margin-bottom: 8px !important; }
.land__track { --x: 0px; --p: 0; position: relative; height: 72px; border-radius: 36px; border: 2px solid #e5484d; background: rgba(229, 72, 77, 0.1); overflow: hidden; user-select: none; }
.land__trail { position: absolute; inset: 0 auto 0 0; width: calc(var(--x) + 68px); opacity: calc(var(--p) * 1.5); background: linear-gradient(90deg, rgba(229, 72, 77, 0.25), #e5484d); }
.land__hint { position: absolute; inset: 0 74px 0 76px; display: flex; align-items: center; justify-content: center; font: 800 15px/1.2 var(--display); color: #ff8a8a; opacity: calc(1 - var(--p) * 1.6); text-align: center; }
.land__hint::after { content: " ›››"; animation: nudge 1.4s ease-in-out infinite; display: inline-block; white-space: pre; }
.land__strip { position: absolute; right: 10px; bottom: 12px; width: 54px; height: 4px; border-radius: 2px; background: repeating-linear-gradient(90deg, #fff 0 8px, transparent 8px 14px); opacity: 0.5; }
.land__knob { position: absolute; left: 4px; top: 4px; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; background: #e5484d; box-shadow: 0 4px 16px rgba(229, 72, 77, 0.5); cursor: grab; touch-action: none; transform: translateX(var(--x)); display: grid; place-items: center; }
.land__knob:active { cursor: grabbing; }
.land__knob:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.land__knob .ap__icon { width: 34px; fill: #fff; transform: rotate(calc(90deg + var(--p) * 25deg)); filter: none; animation: none; }
.land__track--back .land__knob, .land__track--back .land__trail { transition: transform .3s ease, width .3s ease; }
.land__track--done { background: #e5484d; }
.land__track--done .land__trail { opacity: 0; }
.land__track--done .land__knob { box-shadow: none; }
.land__track--done .land__hint { opacity: 1; inset: 0 74px 0 18px; color: #fff; }
.land__track--done .land__hint::after { content: none; }
.land__note { margin-top: 6px !important; font-size: 13px; color: var(--ink-dim); }
.land__btn { margin-top: 10px; background: #e5484d; color: #fff; }
.land--pending { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; border: 2px solid #e5484d; background: rgba(229, 72, 77, 0.15); }
.land__icon { flex: none; width: 48px; fill: #ff6b6b; }
.land--pending small { display: block; margin-top: 4px; color: var(--ink-dim); }
@keyframes nudge { 50% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .land__hint::after { animation: none; } }
.pilots { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-top: 22px; }
.pilot { padding: 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.pilot--work { border-color: rgba(47, 211, 154, 0.6); }
.pilot__who { display: flex; align-items: center; gap: 12px; }
.pilot__who b { display: block; font: 800 19px/1.2 var(--display); }
.pilot__who small { color: var(--ink-dim); font-size: 13px; }
.pilot__icon { flex: none; width: 36px; height: 36px; fill: var(--ink-dim); }
.pilot--work .pilot__icon { fill: #2fd39a; }
/* Boarding pass of a flying task: main part, perforation with notches, stub with airport code, flight and barcode. */
.ticket { --paper: #f4ecda; --ink-t: #10192b; --notch: var(--bg); display: flex; margin-top: 14px; border-radius: 14px; color: var(--ink-t);
  text-decoration: none; background: var(--paper); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); transition: transform 0.15s; }
.ticket:hover { transform: translateY(-2px) rotate(-0.3deg); }
.ticket:focus-visible { outline: 2px solid #2fd39a; outline-offset: 3px; }
.ticket__main { flex: 1 1 auto; min-width: 0; padding: 14px 18px 16px; border-left: 8px solid #2fd39a; border-radius: 14px 0 0 14px; }
.ticket__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font: 800 11px/1.3 var(--display);
  letter-spacing: 0.16em; text-transform: uppercase; color: #5b6478; }
.ticket__status { padding: 2px 8px; border-radius: 4px; background: #199e70; color: #fff; letter-spacing: 0.12em; }
.ap .ticket__title { margin-top: 8px; font: 800 clamp(17px, 2.2vw, 22px)/1.25 var(--display); overflow-wrap: anywhere; }
.ticket__title--pick { color: #5b6478; font-style: italic; }
.ticket__fields { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid rgba(16, 25, 43, 0.14); }
.ticket__fields dt { font: 700 10px/1.2 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: #5b6478; }
.ticket__fields dd { margin: 2px 0 0; font: 800 17px/1.2 ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; }
.ticket__stub { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: clamp(96px, 18%, 132px); padding: 14px 10px; border-left: 2px dashed rgba(16, 25, 43, 0.3); border-radius: 0 14px 14px 0; background: #e8dfc9; }
.ticket__stub::before, .ticket__stub::after { content: ""; position: absolute; left: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--notch); }
.ticket__stub::before { top: -10px; }
.ticket__stub::after { bottom: -10px; }
.ticket__code { font: 800 12px/1 var(--display); letter-spacing: 0.2em; color: #5b6478; }
.ticket__plane { width: 22px; height: 22px; fill: #199e70; transform: rotate(90deg); }
.ticket__id { font: 900 clamp(22px, 3vw, 30px)/1 var(--display); color: #10192b; font-variant-numeric: tabular-nums; }
.ticket__bars { width: 80%; height: 26px; margin-top: 4px;
  background: repeating-linear-gradient(90deg, #10192b 0 2px, transparent 2px 4px, #10192b 4px 5px, transparent 5px 8px, #10192b 8px 11px, transparent 11px 13px); }
@media (max-width: 520px) {
  .ticket { flex-direction: column; }
  .ticket__main { border-radius: 14px 14px 0 0; }
  .ticket__stub { flex-direction: row; width: auto; gap: 10px; padding: 10px 14px; border-left: 0; border-top: 2px dashed rgba(16, 25, 43, 0.3); border-radius: 0 0 14px 14px; }
  .ticket__stub::before, .ticket__stub::after { top: -11px; bottom: auto; left: auto; }
  .ticket__stub::before { left: -10px; }
  .ticket__stub::after { right: -10px; }
  .ticket__bars { width: 70px; margin: 0 0 0 auto; }
}
.pilot__step { margin-top: 10px !important; font-size: 14px; color: var(--ink-dim); }
.pilot__step small { color: var(--ink-dim); opacity: 0.8; }
.picked { margin: 0 0 24px; padding: 14px; border-radius: var(--radius); border: 2px solid #199e70; background: rgba(25, 158, 112, 0.08); }
.picked__head { margin: 0 0 10px; font: 800 13px/1.2 var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: #2fd39a; }
.picked ul { margin: 0; padding: 0; list-style: none; }
.picked .todo { margin: 0 0 8px; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35); font-size: 17px; animation: lift 0.7s cubic-bezier(.2, .8, .2, 1.2) both; }
.picked .todo__head { font-size: 17px; }
.picked .todo__id { font-size: 20px; color: #2fd39a; }
@keyframes lift { from { transform: translateY(40px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
.picked--seen .todo { animation: none; }
.todo.todo--gap { border: 1px dashed rgba(47, 211, 154, 0.6); background: transparent; color: var(--ink-dim); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .ap--on .ap__icon, .picked .todo, .flap { animation: none; } }
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 32px; }
.picker label { font: 700 13px/1.2 var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim); }
.picker select { min-width: min(100%, 320px); padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-2); color: var(--ink); font: 700 17px/1.2 var(--display); cursor: pointer; }
.picker select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.todo-sum { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 20px; padding: 0; list-style: none; font-size: 14px; color: var(--ink-dim); }
.todo-sum b { font: 800 20px/1 var(--display); color: var(--ink); margin-right: 4px; }
.todo-blocks { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; margin-bottom: 36px; }
.todo-block { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 12px; }
.todo-block h3 { margin: 0 0 12px; font: 800 17px/1.3 var(--display); }
.todo-block h3 small { margin-left: 6px; padding: 2px 8px; border-radius: 99px; background: var(--bg-3); font: 700 12px/1.4 var(--text); color: var(--ink-dim); }
.todo-block > ul { margin: 0; padding: 0; list-style: none; }
.todo { padding: 10px 12px; margin: 0 0 6px; border-radius: 12px; border: 1px solid transparent; background: var(--bg-3); }
.todo--busy { border-color: rgba(242, 181, 68, 0.5); }
.todo--live { border-color: #199e70; background: rgba(25, 158, 112, 0.14); }
.todo__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; font-size: 15px; }
.todo__id { font: 800 14px/1.3 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }
.todo__title { flex: 1 1 200px; overflow-wrap: anywhere; }
.todo__title a { color: var(--accent); }
.todo__state { margin: 8px 0 0; font-size: 13px; color: var(--ink-dim); overflow-wrap: anywhere; }
.todo__state b { color: var(--ink); }
.prio, .tag { padding: 1px 8px; border-radius: 99px; font: 700 11px/1.6 var(--text); white-space: nowrap; }
.prio { background: var(--bg-2); color: var(--ink-dim); }
.prio--1 { background: rgba(230, 103, 103, 0.2); color: #f0a0a0; }
.prio--2 { background: rgba(242, 181, 68, 0.18); color: var(--accent); }
.tag { border: 1px solid var(--line); color: var(--ink-dim); }
.tag--p { border-color: rgba(25, 158, 112, 0.6); color: #5fd0a6; }
.tag--wartet, .tag--pausiert { border-color: rgba(201, 133, 0, 0.6); color: #e0a944; }
.todo-block--questions .feed { font-size: 14px; }

/* Legal pages */
.legal { padding: clamp(40px, 6vw, 72px) 0; }
.legal .wrap { max-width: 760px; }
.legal h1 { font: 800 clamp(30px, 4vw, 44px)/1.1 var(--display); margin: 0 0 12px; }
.legal h2 { font: 800 20px/1.3 var(--display); margin: 32px 0 8px; }
.legal p { color: var(--ink-dim); margin: 0 0 12px; }
.legal a { color: var(--accent); }

/* Footer */
.foot { border-top: 1px solid var(--line); color: var(--ink-dim); font-size: 15px; }
.foot__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 0; }
.foot nav { display: flex; gap: 20px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
