/* ============================================================
   app2dat.com — Handbuch-Stylesheet (doc/)
   Nutzt die Design-Tokens der Website (css/site.css) —
   eigenständige Datei, damit der doc/-Ordner unabhängig bleibt.
   ============================================================ */

/* ---- Schrift: Manrope (lokal, SIL OFL — siehe ../fonts/OFL-Manrope.txt) ---- */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Design-Tokens (identisch zur Website) ---- */
:root {
  --navy-950: #020F2B;
  --navy-800: #0D2452;
  --navy-700: #14284B;
  --navy-600: #1B3A66;
  --primary: #1D5BBF;
  --primary-soft: rgba(29, 91, 191, 0.09);
  --primary-pale: #9DC1F8;
  --orange: #F57B27;
  --orange-dark: #D96410;
  --orange-soft: rgba(245, 123, 39, 0.11);
  --canvas: #F4F6FA;
  --surface: #FFFFFF;
  --ink: #16233B;
  --ink-muted: #51607A;
  --border: #D9E2EF;
  --border-soft: #E7EDF5;
  --ok: #1A7F53;
  --shell-text: #E8EDF6;
  --shell-text-2: #B9C6DE;

  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(3, 23, 61, 0.06), 0 2px 8px rgba(3, 23, 61, 0.06);
  --shadow-md: 0 2px 6px rgba(3, 23, 61, 0.07), 0 10px 28px rgba(3, 23, 61, 0.10);
  --container: 1240px;
  --header-h: 64px;
}

/* ---- Basis ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 24px); }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 0.5em; color: var(--navy-700); font-weight: 800; letter-spacing: -0.015em; }
p { margin: 0.8em 0; }
ul, ol { margin: 0.8em 0; padding-left: 1.4em; }
li { margin: 0.25em 0; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(29, 91, 191, 0.18); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); }

.ico { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--orange); color: #fff; padding: 0.6em 1.2em; border-radius: 0 0 10px 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ============================================================
   Kopfzeile
   ============================================================ */
.doc-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: linear-gradient(90deg, var(--navy-600), var(--navy-800));
  color: var(--shell-text);
  box-shadow: var(--shadow-sm);
}
.doc-header-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
}
.doc-header .brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.doc-header .brand-img { height: 30px; width: auto; }
.doc-badge {
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.02em;
  background: var(--orange); color: #fff;
  padding: 0.25em 0.75em; border-radius: 999px; white-space: nowrap;
}
.doc-header-spacer { flex: 1; }
.doc-header a { color: var(--shell-text); }
.doc-header-links { display: flex; align-items: center; gap: 16px; font-weight: 600; font-size: 0.95rem; }
.doc-header-links a { display: inline-flex; align-items: center; gap: 0.4em; white-space: nowrap; opacity: 0.92; }
.doc-header-links a:hover { opacity: 1; text-decoration: none; color: #fff; }
.doc-header-links .ico { width: 19px; height: 19px; }
/* ---- Sprachumschalter (identisch zur Website, site.css) ---- */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 0.4em;
  background: rgba(255, 255, 255, 0.07); color: var(--shell-text);
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 10px;
  padding: 0.45em 0.75em; font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.lang-btn:hover { background: rgba(255, 255, 255, 0.14); }
.lang-btn .ico { width: 17px; height: 17px; }
.lang-btn .chev { width: 13px; height: 13px; transition: transform 0.15s; }
.lang-switch.open .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 6px; z-index: 250;
  display: none;
}
.lang-switch.open .lang-menu { display: block; }
.lang-menu button {
  display: flex; align-items: center; gap: 0.5em; width: 100%;
  background: none; border: none; border-radius: 8px;
  padding: 0.55em 0.8em; font: inherit; font-weight: 600; font-size: 0.95rem;
  color: var(--ink); cursor: pointer; text-align: left;
}
.lang-menu button:hover { background: var(--canvas); }
.lang-menu button.active { background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.lang-menu button.active::after { content: "✓"; margin-left: auto; }
.no-js .lang-switch { display: none !important; }
.btn-app {
  display: inline-flex; align-items: center; gap: 0.5em;
  background: var(--orange); color: #fff !important; font-weight: 700; font-size: 0.92rem;
  border-radius: 9px; padding: 0.5em 1.1em; white-space: nowrap;
}
.btn-app:hover { background: var(--orange-dark); text-decoration: none; }
.nav-toggle {
  display: none;
  background: transparent; border: 1px solid rgba(255,255,255,0.4); color: var(--shell-text);
  border-radius: 8px; padding: 6px 8px; cursor: pointer;
}

/* ============================================================
   Grundgerüst: Sidebar + Inhalt
   ============================================================ */
.doc-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  padding-top: calc(var(--header-h) + 28px);
  padding-bottom: 80px;
  align-items: start;
}

/* ---- Sidebar / Inhaltsverzeichnis ---- */
.doc-nav {
  position: sticky; top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 14px;
}
.doc-nav-title {
  font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-muted); margin: 4px 10px 10px;
}
.doc-nav ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.doc-nav li { margin: 0; }
.doc-nav a {
  counter-increment: toc;
  display: flex; align-items: baseline; gap: 0.6em;
  color: var(--ink-muted); font-weight: 600; font-size: 0.92rem; line-height: 1.35;
  padding: 0.42em 10px; border-radius: 8px; border-left: 3px solid transparent;
}
.doc-nav a::before {
  content: counter(toc);
  font-size: 0.75rem; font-weight: 800; color: var(--primary-pale);
  min-width: 1.3em; text-align: right;
}
.doc-nav a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.doc-nav a.active {
  background: var(--orange-soft); color: var(--navy-700);
  border-left-color: var(--orange);
}
.doc-nav a.active::before { color: var(--orange); }
.doc-nav-foot { margin: 14px 10px 4px; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 0.88rem; }
.doc-nav-foot a { display: inline-flex; align-items: center; gap: 0.45em; font-weight: 700; padding: 0; border: 0; counter-increment: none; }
.doc-nav-foot a::before { content: none; }
.doc-nav-foot .ico { width: 17px; height: 17px; }

/* ---- Inhalt ---- */
.doc-main { max-width: 820px; min-width: 0; }

.doc-hero { margin-bottom: 36px; }
.doc-hero .doc-kicker {
  display: inline-flex; align-items: center; gap: 0.5em;
  color: var(--orange-dark); font-weight: 800; font-size: 0.9rem;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.doc-hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 0.35em; }
.doc-hero .doc-sub { font-size: 1.12rem; color: var(--ink-muted); max-width: 46em; margin-top: 0; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.doc-meta span {
  display: inline-flex; align-items: center; gap: 0.45em;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: 999px;
  padding: 0.32em 0.9em; font-size: 0.86rem; font-weight: 600; color: var(--ink-muted);
  box-shadow: var(--shadow-sm);
}
.doc-meta .ico { width: 16px; height: 16px; color: var(--primary); }

/* ---- Kapitel ---- */
.doc-main { counter-reset: chapter; }
.doc-main section { margin-bottom: 46px; }
.doc-main section > h2 {
  counter-increment: chapter;
  display: flex; align-items: baseline; gap: 0.55em;
  font-size: 1.55rem;
  padding-top: 10px; margin-top: 0; margin-bottom: 0.6em;
  border-top: 3px solid var(--border-soft);
}
.doc-main section > h2::before {
  content: counter(chapter);
  flex-shrink: 0;
  font-size: 0.95rem; font-weight: 800; color: #fff;
  background: var(--navy-600);
  width: 1.9em; height: 1.9em; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transform: translateY(-2px);
}
.doc-main h3 { font-size: 1.14rem; margin-top: 1.6em; }
.doc-main h4 { font-size: 1rem; margin-top: 1.3em; color: var(--navy-600); }

/* ---- UI-Begriffe (Buttons, Tabs, Menüpunkte) ---- */
.ui {
  display: inline-flex; align-items: center; gap: 0.32em;
  vertical-align: -0.2em;
  background: var(--primary-soft); color: var(--navy-700);
  border: 1px solid rgba(29, 91, 191, 0.18);
  border-radius: 7px; padding: 0.02em 0.5em;
  font-weight: 700; font-size: 0.92em; white-space: nowrap;
}

/* ---- App-Icons (Material Design aus MudBlazor + App-eigene) — fill-basiert ---- */
.mico { width: 18px; height: 18px; fill: currentColor; stroke: none; flex-shrink: 0; vertical-align: -0.22em; }
.ui .mico { width: 15px; height: 15px; color: var(--primary); }
ul.icon-list .mico { width: 20px; height: 20px; color: var(--primary); margin-top: 3px; }

/* ---- Schritt-für-Schritt-Listen ---- */
ol.steps { list-style: none; margin: 1em 0; padding: 0; counter-reset: step; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.1em 46px;
  margin: 0;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--orange); color: #fff;
  font-weight: 800; font-size: 0.92rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(245, 123, 39, 0.35);
}
ol.steps > li:not(:last-child)::after {
  content: "";
  position: absolute; left: 14.5px; top: 34px; bottom: 2px;
  width: 2px; background: var(--border);
}

/* ---- Hinweis-Boxen ---- */
.note, .tip {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px;
  border-radius: var(--radius);
  padding: 14px 18px; margin: 1.2em 0;
  font-size: 0.96rem;
}
.note { background: var(--primary-soft); border: 1px solid rgba(29, 91, 191, 0.22); }
.tip { background: var(--orange-soft); border: 1px solid rgba(245, 123, 39, 0.30); }
.note .ico { color: var(--primary); margin-top: 2px; }
.tip .ico { color: var(--orange-dark); margin-top: 2px; }
.note > div > p:first-child, .tip > div > p:first-child { margin-top: 0; }
.note > div > p:last-child, .tip > div > p:last-child { margin-bottom: 0; }
.note strong:first-child, .tip strong:first-child { color: var(--navy-700); }

/* ---- Tabellen ---- */
.tbl-wrap { overflow-x: auto; margin: 1.2em 0; border-radius: var(--radius); border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); }
.doc-main table { border-collapse: collapse; width: 100%; background: var(--surface); font-size: 0.95rem; }
.doc-main th, .doc-main td { text-align: left; padding: 0.6em 0.95em; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.doc-main thead th { background: var(--navy-600); color: #fff; font-size: 0.86rem; letter-spacing: 0.03em; white-space: nowrap; }
.doc-main tbody tr:last-child td { border-bottom: none; }
.doc-main tbody tr:nth-child(even) { background: #FAFCFE; }
.doc-main td strong { color: var(--navy-700); }

/* ---- Screenshots ---- */
.media-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 268px;
  gap: clamp(18px, 3vw, 34px); align-items: start;
  margin: 1.2em 0;
}
.media-row > div > p:first-child { margin-top: 0; }
figure.shot { margin: 0; }
figure.shot .shot-frame {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--shadow-md);
}
figure.shot img { border-radius: 12px; }
figure.shot figcaption {
  text-align: center; font-size: 0.85rem; color: var(--ink-muted); font-weight: 600;
  margin-top: 8px;
}

/* ---- Icon-Aufzählungen ---- */
ul.icon-list { list-style: none; padding: 0; }
ul.icon-list > li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 0.3em 0; }
ul.icon-list .ico { width: 20px; height: 20px; color: var(--primary); margin-top: 3px; }

/* ---- Karten-Raster (z.B. Schnellstart) ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 1.2em 0; }
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}
.card h4 { display: flex; align-items: center; gap: 0.5em; margin: 0 0 0.4em; font-size: 0.98rem; }
.card h4 .ico { width: 19px; height: 19px; color: var(--orange-dark); }
.card p { margin: 0; font-size: 0.92rem; color: var(--ink-muted); }

/* ---- Fußbereich ---- */
.doc-footer {
  margin-top: 60px; padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem; color: var(--ink-muted);
  display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center;
}
.doc-footer a { font-weight: 600; }

/* ---- Nach-oben-Button ---- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--navy-600); color: #fff; border: none; cursor: pointer;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, background 0.15s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--navy-800); }
.to-top .ico { transform: rotate(90deg); }

/* ============================================================
   Responsiv
   ============================================================ */
@media (max-width: 980px) {
  .doc-shell { grid-template-columns: 1fr; }
  .doc-nav {
    position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 95;
    width: min(320px, 86vw); max-height: none;
    border-radius: 0; border-right: 1px solid var(--border);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
  }
  .doc-nav.open { transform: none; box-shadow: var(--shadow-md); }
  .nav-toggle { display: inline-flex; }
  .doc-header-links .hide-m { display: none; }
  .media-row { grid-template-columns: 1fr; }
  .media-row figure.shot { max-width: 300px; margin: 0 auto; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .doc-badge { display: none; }
  .btn-app span { display: none; }
}

/* ---- Druck ---- */
@media print {
  .doc-header, .doc-nav, .to-top, .skip-link { display: none !important; }
  .doc-shell { display: block; padding-top: 0; }
  .doc-main { max-width: none; }
  body { background: #fff; font-size: 11pt; }
  figure.shot .shot-frame { box-shadow: none; }
  .doc-main section { break-inside: avoid-page; }
}
