/* 1337 Design-System – Bausteine (Präfix x-). Braucht css/tokens.css. */

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--sans); color: var(--ink); background: var(--paper); }
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
:where(p, small, td, .x-foot) a:not(.x-btn) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
.x-sym { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Kopf, Navigation, Fuß ---------- */
.x-topbar {
  position: sticky; top: 0; z-index: 10; height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) 12px 0; display: flex; align-items: center; gap: 8px;
  background: var(--paper); border-bottom: 1px solid var(--ink);
}
/* Wortmarke: TLD grün, dahinter der blinkende Cursor */
.x-brand { font: 700 1.2rem var(--mono); letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
.x-brand:hover { text-decoration: none; }
.x-brand .tld { color: var(--accent-deep); }
.x-brand::after { content: ""; display: inline-block; width: .55em; height: .09em; margin-left: .12em; background: var(--accent); animation: x-blink 1.1s steps(1) infinite; }
@keyframes x-blink { 50% { opacity: 0; } }
.x-nav { display: none; flex: 1; gap: 4px; margin-left: 24px; }
.x-nav a { padding: 6px 10px; border-radius: var(--radius); color: var(--ink); font-weight: 600; font-size: .9rem; }
.x-nav a:hover { background: var(--accent-tint); text-decoration: none; }
.x-nav a[aria-current="page"] { color: var(--accent-deep); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.x-topbar .actions { margin-left: auto; display: flex; gap: 6px; }
/* Handy: Navigation unten wie in einer App */
.x-tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 0 4px var(--safe-bottom); background: var(--paper); border-top: 1px solid var(--ink);
}
.x-tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; color: var(--muted); font-size: .68rem; font-weight: 600; }
.x-tabbar a:hover { text-decoration: none; }
.x-tabbar .x-sym { width: 22px; height: 22px; }
.x-tabbar a[aria-current="page"] { color: var(--accent-deep); }
@media (min-width: 900px) { .x-nav { display: flex; } .x-tabbar { display: none; } }
.x-page { max-width: 760px; margin: 0 auto; padding: 18px 16px calc(80px + var(--safe-bottom)); }
@media (min-width: 900px) { .x-page { max-width: 1180px; padding: 24px 24px 32px; } }
.x-foot { margin-top: var(--space-5); font-size: .75rem; color: var(--muted); }

/* ---------- Startseite: Gruß, Kurzinfos, Suche ---------- */
.x-hero h1 { font: 700 var(--text-hero)/1.1 var(--mono); letter-spacing: -0.03em; margin: 4px 0 12px; }
.x-hero h1 em { font-style: normal; color: var(--accent-deep); }
.x-hero .claim { display: block; font-size: .62em; letter-spacing: -0.02em; margin-top: 4px; }
.x-hero p { margin: -4px 0 14px; color: var(--muted); max-width: 62ch; font-size: .95rem; }
@media (min-width: 900px) { .x-hero h1 { font-size: 2.8rem; } }
/* Kurzinfo-Kacheln: Etikett und Wert, mobil seitlich scrollbar, ab 900px Raster */
.x-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; list-style: none; margin: 0; padding-left: 0; }
.x-strip::-webkit-scrollbar { display: none; }
.x-info { flex: 0 0 auto; display: flex; flex-direction: column; gap: 1px; min-width: 104px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
a.x-info:hover { text-decoration: none; border-color: var(--accent); }
.x-info small { font-size: .7rem; color: var(--muted); }
.x-info b { font: 700 .85rem var(--mono); white-space: nowrap; }
.x-info .ok { color: var(--accent-deep); } .x-info .busy { color: var(--warn); } .x-info .bad { color: var(--danger); }
@media (min-width: 900px) { .x-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); overflow: visible; } }
.x-search { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; padding: 0 12px; max-width: 640px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--paper); }
.x-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 16px; padding: 11px 0; outline: none; }
.x-search .x-sym { color: var(--muted); }
.x-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Kacheln ---------- */
/* Schnellzugriff: Symbol über Text, 3 Spalten, ab 700px 6 */
.x-quick { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.x-quick a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; min-height: 76px; padding: 10px 6px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: clamp(.7rem, 3vw, .82rem); font-weight: 600; line-height: 1.2; text-align: center; hyphens: auto; }
.x-quick a:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-tint); }
.x-quick .x-sym { width: 24px; height: 24px; color: var(--accent-deep); }
@media (min-width: 700px) { .x-quick { grid-template-columns: repeat(6, 1fr); } }
/* Dachzeile über Abschnitten */
.x-eyebrow { display: flex; align-items: center; gap: 8px; margin: 24px 0 8px; font: 400 .8rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-deep); }
/* Themen: Zeilen-Kacheln mit Symbol, Text und Pfeil; ab 700px zweispaltig */
.x-topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 700px) { .x-topics { grid-template-columns: repeat(2, 1fr); } }
.x-topic { display: flex; align-items: center; gap: 12px; height: 100%; padding: 14px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.x-topic:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-tint); }
.x-topic .icon, .x-tile .icon { flex: 0 0 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); color: var(--accent-deep); }
.x-topic .text, .x-tile .text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.x-topic .text b { font-size: 1.02rem; }
.x-topic small, .x-tile small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.x-topic > .x-sym:last-child, .x-tile > .x-sym:last-child { width: 16px; height: 16px; color: var(--muted); }
/* Liste in einer Kachel: Zeilen mit Trennlinie */
.x-tiles { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.x-tiles li + li { border-top: 1px solid var(--line); }
.x-tile { display: flex; align-items: center; gap: 12px; padding: 11px 12px; color: var(--ink); }
.x-tile:hover { text-decoration: none; background: var(--accent-tint); }
.x-tile .text b { font-weight: 600; }
/* Info-Kachel mit Kopf, großem Wert, Unterzeile und Quelle */
.x-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.x-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.x-card.wide { grid-column: 1 / -1; }
.x-card.alert { border-left: 4px solid var(--tone, var(--danger)); }
.x-card.alert.busy { --tone: var(--warn); }
.x-card .head { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 var(--text-eyebrow) var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.x-card .head .x-sym { width: 18px; height: 18px; color: var(--accent-deep); }
.x-card.alert .head .x-sym { color: var(--tone, var(--danger)); }
.x-card .value { font: 700 var(--text-value)/1.15 var(--mono); letter-spacing: -0.03em; margin: 0; overflow-wrap: anywhere; }
.x-card .value .unit { font-size: .95rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.x-card .sub { margin: 0; font-size: .85rem; color: var(--muted); }
.x-card .foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); font-size: .7rem; color: var(--muted); }
.x-status { display: inline-flex; align-items: center; gap: 6px; font: 700 .78rem var(--mono); white-space: nowrap; }
.x-status i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.x-status.ok i { background: var(--ok-dot); } .x-status.busy i { background: var(--warn); } .x-status.bad i { background: var(--danger); }
/* Der eine Hinweis pro Seite: Rand in Tinte, harter grüner Versatzschatten */
.x-callout { margin-top: 16px; padding: 16px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-offset); }
.x-callout h2 { margin: 0 0 4px; font: 700 1.1rem var(--mono); }
.x-callout p { margin: 0 0 12px; color: var(--muted); }
.x-callout .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }

/* ---------- Seitenkopf ---------- */
.x-page-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.x-page-head h1 { font: 700 var(--text-title) var(--mono); letter-spacing: -0.02em; margin: 0; }
.x-page-head p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.x-back { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: var(--radius); color: var(--ink); margin-top: 2px; }

/* ---------- Bedienung ---------- */
.x-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--paper); color: var(--ink); font: 600 .85rem var(--mono); white-space: nowrap; }
.x-btn:hover { background: var(--accent-tint); text-decoration: none; }
.x-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.x-btn.primary:hover { filter: brightness(1.06); }
.x-btn.icon { width: 34px; padding: 0; justify-content: center; }
.x-btn .x-sym { width: 18px; height: 18px; }
.x-link { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; }
.x-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.x-pill { font: .78rem var(--mono); padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); }
.x-pill:hover { border-color: var(--ink); }
.x-pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.x-seg { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; margin: 0 0 12px; }
.x-seg a { padding: 6px 12px; font: .85rem var(--mono); color: var(--ink); }
.x-seg a:hover { text-decoration: none; background: var(--accent-tint); }
.x-seg a[aria-current="true"] { background: var(--accent); color: var(--on-accent); }
.x-tag { font: .7rem var(--mono); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }
.x-table { border-collapse: collapse; font-size: .82rem; min-width: 100%; }
.x-table th, .x-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.x-table th:first-child, .x-table td:first-child { text-align: left; }
.x-table th { font: 600 .75rem var(--mono); color: var(--muted); }
.x-table td { font-variant-numeric: tabular-nums; }
