/* ==========================================================================
   sqMyLight — SQLite-Verwaltung
   Designsprache: skandinavische Zurückhaltung, warmes Schwarz, viel Weißraum,
   Pillen-Buttons, unterstrichene Links, eine kräftige blaue Fläche.
   ========================================================================== */

/* ---------- Schriften (lokal, DSGVO-freundlich) ---------- */
@font-face { font-family: "Lexend Deca"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/lexend-deca-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend Deca"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/lexend-deca-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend Deca"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/lexend-deca-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/newsreader-latin-400-italic.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --font: "Lexend Deca", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-accent: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-code: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.165, .84, .44, 1);
  --dur: 400ms;
  --dur-fast: 200ms;

  --header-h: 64px;
  --sidebar-w: 288px;
  --gutter: clamp(16px, 3.2vw, 48px);
  --radius-s: 4px;
  --radius-m: 6px;
  --pill: 999px;

  --blue: #070DAB;          /* Fußzeilenblau */
  --blue-ink: #ffffff;
  --cream: #FCFAEE;          /* Jubiläumsfläche */
  --danger: #B3261E;
  --ok: #2E6B3A;

  /* Hell */
  --bg: #FFFFFF;
  --surface: #FAFAFA;
  --surface-2: #F3F3F2;
  --ink: #191817;
  --ink-2: #555555;
  --muted: #737373;
  --hair: #E5E5E5;
  --hair-strong: #CCCCCC;
  --accent: #070DAB;
  --accent-soft: rgba(7, 13, 171, .08);
  --hover: rgba(25, 24, 23, .035);
  --sel: rgba(7, 13, 171, .06);
  --overlay: rgba(25, 24, 23, .44);
  --shadow: 0 1px 0 rgba(25,24,23,.04), 0 18px 48px -18px rgba(25,24,23,.28);
  --code-kw: #070DAB;
  --code-str: #7A4B2E;
  --code-num: #2E6B3A;
  --code-com: #8C8C8C;
  --code-id: #191817;
  --fabric: rgba(25,24,23,.10);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #191817;
  --surface: #201F1D;
  --surface-2: #2A2926;
  --ink: #F4F2EE;
  --ink-2: #C9C6C0;
  --muted: #9A968F;
  --hair: #34322F;
  --hair-strong: #4A4743;
  --accent: #C1C4FF;
  --accent-soft: rgba(193, 196, 255, .10);
  --hover: rgba(244, 242, 238, .04);
  --sel: rgba(193, 196, 255, .08);
  --overlay: rgba(0, 0, 0, .6);
  --shadow: 0 1px 0 rgba(0,0,0,.2), 0 24px 60px -20px rgba(0,0,0,.7);
  --danger: #FF8A80;
  --ok: #8FD19E;
  --cream: #24231F;
  --code-kw: #C1C4FF;
  --code-str: #E3B58F;
  --code-num: #9FD8AA;
  --code-com: #7D7A74;
  --code-id: #F4F2EE;
  --fabric: rgba(244,242,238,.08);
  color-scheme: dark;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font: 300 15px/1.6 var(--font);
  letter-spacing: .1px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
:root { padding-bottom: env(safe-area-inset-bottom, 0px); }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: var(--pill); text-decoration: none; }
.skip-link:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i--s { width: 16px; height: 16px; }
.i--l { width: 24px; height: 24px; }

/* ---------- Typografie ---------- */
.kicker {
  font-size: 12px; font-weight: 400; letter-spacing: 2px; text-transform: uppercase;
  color: var(--ink-2); margin: 0 0 10px;
}
.display { font-weight: 400; font-size: clamp(34px, 5.4vw, 60px); line-height: 1.06; letter-spacing: -.02em; margin: 0; }
.title { font-weight: 400; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.15; letter-spacing: -.015em; margin: 0; overflow-wrap: anywhere; }
.h3 { font-weight: 400; font-size: 20px; line-height: 1.3; letter-spacing: -.005em; margin: 0; }
.lede { font-size: 16px; line-height: 1.65; color: var(--ink-2); max-width: 62ch; margin: 0; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.accent-italic { font-family: var(--font-accent); font-style: italic; color: var(--accent); font-size: 1.08em; letter-spacing: 0; }
code, .code { font-family: var(--font-code); font-size: 13px; }

.link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none; font-weight: 400;
  padding-bottom: 5px; border-bottom: 1px solid currentColor;
  transition: opacity var(--dur-fast) var(--ease);
}
.link:hover { opacity: .64; }
.link--muted { color: var(--ink-2); border-color: var(--hair-strong); }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 26px;
  border: 1.5px solid var(--b); border-radius: var(--pill);
  background: transparent; color: var(--ink);
  font-weight: 400; font-size: 15px; white-space: nowrap; text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn:active { transform: scale(.98); }
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: transparent; color: var(--ink); }
.btn--ghost { border-color: transparent; padding: 0 14px; }
.btn--ghost:hover { background: var(--hover); color: var(--ink); }
.btn--danger { --b: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: var(--bg); }
.btn--sm { min-height: 36px; padding: 0 18px; font-size: 14px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn--on-blue { --b: #fff; color: #fff; }
.btn--on-blue:hover { background: #fff; color: var(--blue); }

.icon-btn {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%; color: var(--ink);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--hover); }
.icon-btn--danger:hover { color: var(--danger); }
.icon-btn--s { width: 32px; height: 32px; }

/* ---------- Kopfzeile ---------- */
.masthead {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--hair);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.masthead__start { justify-self: start; }
.masthead__end { justify-self: end; display: flex; gap: 4px; align-items: center; }
.wordmark {
  font-weight: 500; font-size: 17px; letter-spacing: 1.6px; text-decoration: none; white-space: nowrap;
}
.menu-trigger { display: inline-flex; align-items: center; gap: 14px; height: 40px; padding-right: 6px; font-size: 14px; font-weight: 400; }
.menu-trigger__lines { width: 26px; height: 10px; position: relative; }
.menu-trigger__lines i { position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform var(--dur) var(--ease), top var(--dur) var(--ease); }
.menu-trigger__lines i:first-child { top: 0; }
.menu-trigger__lines i:last-child { top: 8.5px; }
.menu-trigger.is-open .menu-trigger__lines i:first-child { top: 4.25px; transform: rotate(45deg); }
.menu-trigger.is-open .menu-trigger__lines i:last-child { top: 4.25px; transform: rotate(-45deg); }

#themeToggle .i-moon { display: none; }
[data-theme="dark"] #themeToggle .i-sun { display: none; }
[data-theme="dark"] #themeToggle .i-moon { display: block; }

.save-btn__dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 1.5px solid var(--bg); transform: scale(0); transition: transform var(--dur) var(--ease); }
.is-dirty .save-btn__dot { transform: scale(1); }

/* ---------- Grundlayout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.shell.no-db { grid-template-columns: minmax(0, 1fr); }
.shell.no-db .sidebar {
  position: fixed; z-index: 35; left: 0; bottom: 0; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); height: auto;
  width: min(380px, 100%); transform: translateX(-100%); visibility: hidden; box-shadow: var(--shadow);
  transition: transform 520ms var(--ease), visibility 0s linear 520ms, background-color var(--dur) var(--ease);
}
.shell.no-db .sidebar.is-open { transform: none; visibility: visible; transition: transform 520ms var(--ease), visibility 0s, background-color var(--dur) var(--ease); }
.scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 34; background: var(--overlay); animation: fadeIn var(--dur) var(--ease); }
.is-dragging .drop { transform: scale(1.02); box-shadow: inset 0 0 0 1.5px var(--ink), 0 40px 80px -48px rgba(25,24,23,.45); }
@media (hover: none) { .hide-touch { display: none; } }
.shell.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.shell.sidebar-collapsed .sidebar { visibility: hidden; }
.main { min-width: 0; outline: none; }


/* ---------- Seitenleiste ---------- */
.sidebar {
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  height: calc(100vh - var(--header-h) - env(safe-area-inset-top, 0px));
  border-right: 1px solid var(--hair); background: var(--bg);
  overflow: hidden; transition: background-color var(--dur) var(--ease);
}
.sidebar__inner { height: 100%; overflow-y: auto; padding: 28px 0 32px; display: flex; flex-direction: column; overscroll-behavior: contain; }
.sb-db { padding: 0 24px 22px; border-bottom: 1px solid var(--hair); }
.sb-db__name { font-size: 18px; font-weight: 400; margin: 2px 0 4px; overflow-wrap: anywhere; line-height: 1.3; }
.sb-db__meta { font-size: 13px; color: var(--muted); }
.sb-db__actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.sb-filter { position: relative; margin: 18px 24px 8px; }
.sb-filter .i { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--muted); }
.sb-filter input { width: 100%; border: 0; border-bottom: 1px solid var(--hair-strong); background: transparent; padding: 10px 0 10px 28px; outline: none; font-size: 14px; transition: border-color var(--dur-fast) var(--ease); }
.sb-filter input:focus { border-color: var(--ink); }
.sb-filter input::placeholder { color: var(--muted); }
.sb-group { padding: 14px 0 4px; }
.sb-group__head { display: flex; align-items: center; justify-content: space-between; padding: 0 24px 6px; }
.sb-group__head .kicker { margin: 0; font-size: 11px; color: var(--muted); }
.sb-list { list-style: none; margin: 0; padding: 0; }
.sb-item a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 24px; text-decoration: none; font-size: 14px; color: var(--ink-2);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.sb-item a:hover { color: var(--ink); background: var(--hover); }
.sb-item a .i { color: var(--muted); }
.sb-item a span.n { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-item a span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sb-item a[aria-current="page"] { color: var(--ink); font-weight: 400; }
.sb-item a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--ink); }
.sb-empty { padding: 6px 24px; font-size: 13px; color: var(--muted); }
.sb-foot { margin-top: auto; padding: 24px 24px 0; }
.sb-theme { display: flex; border: 1px solid var(--hair-strong); border-radius: var(--pill); padding: 3px; }
.sb-theme button { flex: 1; height: 32px; border-radius: var(--pill); font-size: 13px; color: var(--ink-2); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.sb-theme button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- Kopfbereich einer Ansicht ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.crumbs .sep { opacity: .6; }
.page { padding: 40px var(--gutter) 96px; max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head__meta { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 12px; }
.page-head__meta b { font-weight: 400; color: var(--ink); }

/* Kategorie-Navigation (Reiter) */
.tabs {
  display: flex; gap: 34px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  margin: 0 calc(var(--gutter) * -1) 36px; padding: 0 var(--gutter);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); z-index: 20; background: var(--bg);
  transition: background-color var(--dur) var(--ease);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none; display: flex; align-items: center; height: 54px;
  font-size: 12.5px; letter-spacing: 2px; text-transform: uppercase; font-weight: 400;
  color: var(--muted); text-decoration: none; transition: color var(--dur-fast) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); animation: tabIn var(--dur) var(--ease); }
@keyframes tabIn { from { transform: scaleX(.2); opacity: 0; } }

/* ---------- Toolbar & Formularelemente ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.toolbar__spacer { flex: 1; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label, .label { font-size: 12px; color: var(--ink-2); letter-spacing: .2px; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 16px;
  border: 1px solid var(--hair-strong); border-radius: var(--radius-s);
  background: var(--bg); color: var(--ink); font-size: 15px; font-weight: 300;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur) var(--ease);
  outline: none;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input--s, .select--s { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.textarea.code { font-family: var(--font-code); font-size: 13.5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px 24px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid var(--hair-strong); border-radius: 3px; display: grid; place-items: center; background: var(--bg); cursor: pointer; transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); flex: none; }
.check input:hover { border-color: var(--ink); }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 1.6px solid var(--bg); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.check input:indeterminate { background: var(--ink); border-color: var(--ink); }
.check input:indeterminate::after { content: ""; width: 8px; height: 1.6px; background: var(--bg); }

.segmented { display: inline-flex; border: 1px solid var(--hair-strong); border-radius: var(--pill); padding: 3px; gap: 2px; }
.segmented button { height: 34px; padding: 0 16px; border-radius: var(--pill); font-size: 13.5px; color: var(--ink-2); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- Datentabellen ---------- */
.grid-wrap { position: relative; border-top: 1px solid var(--ink); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.grid-wrap--framed { border: 1px solid var(--hair); border-top: 1px solid var(--ink); }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.grid th, .grid td { text-align: left; padding: 0 16px; height: 52px; border-bottom: 1px solid var(--hair); white-space: nowrap; vertical-align: middle; }
.grid thead th { height: 46px; font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: .3px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.grid tbody tr { transition: background-color var(--dur-fast) var(--ease); }
.grid tbody tr:hover { background: var(--hover); }
.grid tbody tr.is-selected { background: var(--sel); }
.grid tfoot td { height: 54px; font-weight: 400; border-bottom: 0; color: var(--ink); }
.grid .r { text-align: right; }
.grid .c-check { width: 44px; padding-right: 0; }
.grid .c-name a { text-decoration: none; font-weight: 400; color: var(--ink); }
.grid .c-name a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.grid .c-mono { font-family: var(--font-code); font-size: 13px; }
.th-sort { display: inline-flex; align-items: center; gap: 6px; color: inherit; font-size: inherit; letter-spacing: inherit; }
.th-sort:hover { color: var(--ink); }
.th-sort .i { width: 14px; height: 14px; opacity: 0; transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.th-sort:hover .i { opacity: .5; }
.th-sort[data-dir] { color: var(--ink); }
.th-sort[data-dir] .i { opacity: 1; }
.th-sort[data-dir="desc"] .i { transform: rotate(180deg); }
.th-type { display: block; font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); opacity: .8; margin-top: -2px; font-weight: 300; }

.actions { display: flex; gap: 2px; align-items: center; }
.act {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: var(--pill);
  font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.act:hover { background: var(--hover); color: var(--ink); }
.act--danger:hover { color: var(--danger); }
.act .i { width: 16px; height: 16px; }

/* Zellen im Datenbrowser */
.cell { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.cell--num { text-align: right; font-variant-numeric: tabular-nums; }
.cell--edit { cursor: text; }
.v-null { font-family: var(--font-accent); font-style: italic; color: var(--muted); font-size: 15px; }
.v-blob { font-size: 12px; color: var(--muted); border: 1px solid var(--hair-strong); border-radius: var(--pill); padding: 2px 9px; }
.v-pk { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
.cell-editor { width: 100%; min-width: 160px; height: 36px; border: 1px solid var(--ink); border-radius: 3px; padding: 0 10px; background: var(--bg); outline: none; font-size: 14px; }
.grid--data td.sticky, .grid--data th.sticky { position: sticky; left: 0; z-index: 1; background: var(--bg); box-shadow: 1px 0 0 var(--hair); }
.grid--data thead th.sticky { z-index: 3; }
.grid--data tbody tr:hover td.sticky { background: color-mix(in srgb, var(--ink) 3.5%, var(--bg)); }
.grid--data tbody tr.is-selected td.sticky { background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
.row-tools { display: flex; align-items: center; gap: 2px; }

.grid-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 18px 0 0; }
.pager { display: flex; align-items: center; gap: 6px; }
.pager__info { font-size: 13px; color: var(--muted); padding: 0 8px; font-variant-numeric: tabular-nums; }

.grid--list th, .grid--list td { padding: 0 12px; }
.grid--list .act { padding: 0 8px; }
@media (min-width: 761px) and (max-width: 1480px) {
  .grid--list .act span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .grid--list .act { width: 34px; justify-content: center; padding: 0; }
  .grid--list .act .i { width: 18px; height: 18px; }
}

/* ---------- Leere Zustände, Hinweise ---------- */
.empty { padding: 72px 24px; text-align: center; border-top: 1px solid var(--hair); }
.empty .h3 { margin-bottom: 10px; }
.empty p { margin: 0 auto 26px; max-width: 46ch; color: var(--ink-2); }
.note { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; background: var(--surface); border-left: 2px solid var(--ink); font-size: 14px; color: var(--ink-2); margin-bottom: 24px; }
.note--danger { border-color: var(--danger); }
.note--ok { border-color: var(--ok); }
.note b { color: var(--ink); font-weight: 400; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--pill); font-size: 11.5px; letter-spacing: .3px; border: 1px solid var(--hair-strong); color: var(--ink-2); white-space: nowrap; }
.badge--ink { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.badge--accent { color: var(--accent); border-color: currentColor; }

/* ---------- Abschnitte / Karten ---------- */
.section { margin-top: 56px; }
.section:first-child { margin-top: 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.panel { background: var(--surface); padding: clamp(20px, 3vw, 36px); border-radius: var(--radius-s); transition: background-color var(--dur) var(--ease); }
.panel + .panel { margin-top: 16px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.option-card { display: flex; flex-direction: column; gap: 14px; background: var(--surface); padding: 28px; border-radius: var(--radius-s); }
.option-card p { margin: 0; color: var(--ink-2); font-size: 14px; flex: 1; }
.code-block { position: relative; background: var(--surface); border-radius: var(--radius-s); padding: 22px 24px; font-family: var(--font-code); font-size: 13px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; overflow-x: auto; margin: 0; }
.code-block .copy { position: absolute; top: 10px; right: 10px; }

/* ---------- SQL-Editor ---------- */
.editor { position: relative; border: 1px solid var(--hair-strong); border-radius: var(--radius-s); background: var(--bg); transition: border-color var(--dur-fast) var(--ease); }
.editor:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.editor__area { position: relative; min-height: 220px; }
.editor__hl, .editor__ta {
  margin: 0; padding: 18px 20px; border: 0; width: 100%; min-height: 220px;
  font-family: var(--font-code); font-size: 14px; line-height: 1.7; letter-spacing: 0; tab-size: 2;
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word;
}
.editor__hl { position: absolute; inset: 0; pointer-events: none; color: var(--code-id); overflow: hidden; }
.editor__ta { position: relative; display: block; resize: vertical; background: transparent; color: transparent; caret-color: var(--ink); outline: none; }
.editor__ta::placeholder { color: var(--muted); }
.editor__ta::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); color: transparent; }
.tk-kw { color: var(--code-kw); }
.tk-str { color: var(--code-str); }
.tk-num { color: var(--code-num); }
.tk-com { color: var(--code-com); font-style: italic; }
.tk-fn { color: var(--code-id); }
.editor__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--hair); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 30px; padding: 0 13px; border-radius: var(--pill); border: 1px solid var(--hair-strong); font-size: 12.5px; color: var(--ink-2); transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); white-space: nowrap; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip--code { font-family: var(--font-code); font-size: 12px; }
.sql-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; }
.sql-side { position: sticky; top: calc(var(--header-h) + 80px); max-height: calc(100vh - var(--header-h) - 120px); overflow: auto; }
.sql-side .kicker { font-size: 11px; color: var(--muted); }
.col-list { list-style: none; margin: 0 0 24px; padding: 0; }
.col-list button { width: 100%; text-align: left; display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--hair); font-size: 13px; color: var(--ink-2); }
.col-list button:hover { color: var(--ink); }
.col-list button span:last-child { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.result { margin-top: 36px; }
.result__head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.result__head code { color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.history { list-style: none; margin: 0; padding: 0; }
.history li button { width: 100%; text-align: left; padding: 10px 0; border-bottom: 1px solid var(--hair); font-family: var(--font-code); font-size: 12px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.history li button:hover { color: var(--ink); }

/* ---------- Startseite ---------- */
.landing { display: flex; flex-direction: column; min-height: calc(100vh - var(--header-h)); }
.hero { text-align: center; padding: clamp(48px, 9vh, 104px) var(--gutter) 40px; }
.hero .kicker { margin-bottom: 18px; }
.hero .lede { margin: 22px auto 0; text-align: center; max-width: 52ch; }
.drop {
  --size: min(440px, 78vw);
  position: relative; width: var(--size); height: var(--size); margin: clamp(40px, 7vh, 72px) auto 0;
  border-radius: 50%; display: grid; place-items: center; text-align: center; cursor: pointer;
  background-color: var(--surface);
  background-image: radial-gradient(var(--fabric) 0.9px, transparent 1.15px);
  background-size: 5px 5px;
  box-shadow: inset 0 0 0 1px var(--hair), 0 40px 80px -48px rgba(25,24,23,.45);
  transition: transform 600ms var(--ease), box-shadow 600ms var(--ease), background-color var(--dur) var(--ease);
  outline: none;
}
.drop::before { content: ""; position: absolute; inset: 9%; border-radius: 50%; border: 1px solid var(--hair-strong); opacity: .7; transition: inset 600ms var(--ease), border-color 600ms var(--ease); }
.drop:hover, .drop:focus-visible { transform: scale(1.015); }
.drop:hover::before, .drop:focus-visible::before { inset: 7%; border-color: var(--ink); }
.drop.is-over { transform: scale(1.04); box-shadow: inset 0 0 0 2px var(--ink), 0 50px 90px -40px rgba(25,24,23,.5); }
.drop.is-over::before { inset: 4%; border-color: var(--ink); }
.drop__inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 16%; }
.drop__inner .h3 { font-size: clamp(18px, 2.2vw, 22px); }
.drop__inner p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.drop__icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); margin-bottom: 4px; transition: transform 600ms var(--ease); }
.drop.is-over .drop__icon { transform: translateY(6px); }
.drop.is-loading .drop__icon { animation: pulse 1.2s var(--ease) infinite; }
@keyframes pulse { 50% { transform: scale(.88); } }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }

.recent { padding: 72px var(--gutter) 24px; max-width: 1480px; margin: 0 auto; width: 100%; }
.recent__head { text-align: center; margin-bottom: 32px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 26px 24px 22px;
  background: var(--surface); border-radius: 2px; text-align: left; min-height: 172px; text-decoration: none;
  transition: background-color var(--dur) var(--ease);
}
.card:hover { background: var(--surface-2); }
.card__glyph { width: 44px; height: 44px; border-radius: 50%; margin-bottom: auto; background-image: radial-gradient(var(--fabric) .9px, transparent 1.15px); background-size: 4px 4px; box-shadow: inset 0 0 0 1px var(--hair-strong); }
.card__name { font-size: 15px; font-weight: 400; margin-top: 18px; overflow-wrap: anywhere; }
.card__meta { font-size: 13px; color: var(--muted); }
.card__remove { position: absolute; top: 10px; right: 10px; }

.band { background: var(--cream); padding: clamp(48px, 8vw, 88px) var(--gutter); text-align: center; margin-top: 72px; transition: background-color var(--dur) var(--ease); }
.band__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; max-width: 1040px; margin: 40px auto 0; text-align: left; }
.band__grid h3 { font-size: 16px; font-weight: 400; margin: 14px 0 8px; }
.band__grid p { margin: 0; font-size: 14px; color: var(--ink-2); }
.band__grid .i { width: 26px; height: 26px; stroke-width: 1.2; }

.footer { background: var(--blue); color: var(--blue-ink); padding: 56px var(--gutter) 0; margin-top: auto; overflow: hidden; }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid rgba(255,255,255,.28); font-size: 14px; }
.footer__row a { color: #fff; text-decoration: none; }
.footer__row a:hover { text-decoration: underline; text-underline-offset: 5px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.footer__mark {
  display: block; width: 100%; padding: 20px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  user-select: none;
}
.footer__mark svg { width: 100%; height: auto; overflow: visible; }
.footer__mark text { font-family: var(--font); font-weight: 500; font-size: 128px; letter-spacing: 2px; }

/* Page-Load-Moment */
.landing .hero > * { animation: rise 900ms var(--ease) both; }
.landing .hero > *:nth-child(2) { animation-delay: 80ms; }
.landing .hero > *:nth-child(3) { animation-delay: 160ms; }
.landing .drop { animation: bloom 1100ms var(--ease) 180ms both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes bloom { from { opacity: 0; transform: scale(.94); } }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-radius: var(--pill); background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: var(--shadow); animation: toastIn var(--dur) var(--ease); max-width: 100%; }
.toast--danger { background: var(--danger); color: #fff; }
.toast.is-out { animation: toastOut 300ms var(--ease) forwards; }
.toast button { color: inherit; text-decoration: underline; text-underline-offset: 4px; font-weight: 400; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ---------- Dialoge ---------- */
.modal-root:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: var(--overlay); display: grid; place-items: center; padding: 24px; animation: fadeIn var(--dur) var(--ease); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--bg); border-radius: var(--radius-m); box-shadow: var(--shadow); animation: modalIn 500ms var(--ease); }
.modal--wide { width: min(940px, 100%); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 28px 30px 6px; }
.modal__head .h3 { font-size: 22px; padding-top: 4px; }
.modal__body { padding: 16px 30px 8px; overflow-y: auto; }
.modal__body > p { margin: 0 0 16px; color: var(--ink-2); }
.modal__foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 20px 30px 28px; }
.is-closing .modal-backdrop, .modal-backdrop.is-closing { animation: fadeOut 250ms var(--ease) forwards; }
.modal-backdrop.is-closing .modal { animation: modalOut 250ms var(--ease) forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px); } }

/* Spalten-Editor (Tabelle anlegen) */
.coldef { display: grid; grid-template-columns: minmax(130px, 1.4fr) minmax(120px, 1fr) minmax(110px, 1fr) auto auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.coldef__flags { display: flex; gap: 14px; flex-wrap: wrap; }
.coldef__flags .check { font-size: 12.5px; gap: 6px; }
.coldef-head { display: grid; grid-template-columns: minmax(130px, 1.4fr) minmax(120px, 1fr) minmax(110px, 1fr) auto auto; gap: 10px; font-size: 12px; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--ink); }

/* Ladeanzeige */
.boot { min-height: 60vh; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 14px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--hair-strong); border-top-color: var(--ink); animation: spin 900ms linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .sql-layout { grid-template-columns: minmax(0, 1fr); }
  .sql-side { position: static; max-height: none; }
}

@media (max-width: 960px) {
  :root { --header-h: 60px; }
  .shell, .shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
  .shell.sidebar-collapsed .sidebar { visibility: visible; }
  .sidebar {
    position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    height: auto; border-right: 0; transform: translateX(-100%); visibility: hidden;
    transition: transform 520ms var(--ease), visibility 0s linear 520ms, background-color var(--dur) var(--ease);
  }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform 520ms var(--ease), visibility 0s, background-color var(--dur) var(--ease); }
  .shell.no-db .sidebar { width: 100%; box-shadow: none; }
  .scrim:not([hidden]) { display: none; }
  .sidebar__inner { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
  .sb-item a { padding-top: 13px; padding-bottom: 13px; font-size: 16px; }
  .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .band__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .wordmark { font-size: 15px; letter-spacing: 1.3px; }
  .menu-trigger { gap: 12px; }
  .masthead__end .icon-btn { width: 38px; height: 38px; }
  .page { padding-top: 28px; padding-bottom: 72px; }
  .tabs { gap: 26px; margin-bottom: 28px; }
  .page-head { margin-bottom: 20px; }

  /* Tabellenübersicht → Karten */
  table.grid--list, .grid--list tbody, .grid--list tr, .grid--list td { display: block; }
  .grid--list thead { display: none; }
  .grid--list { font-size: 15px; }
  .grid--list tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "chk name rows" "act act act"; align-items: center; gap: 4px 12px; padding: 16px 0 12px; border-bottom: 1px solid var(--hair); }
  .grid--list td { height: auto; padding: 0; border: 0; }
  .grid--list td.c-check { grid-area: chk; width: auto; }
  .grid--list td.c-name { grid-area: name; white-space: normal; overflow-wrap: anywhere; }
  .grid--list td.c-rows { grid-area: rows; text-align: right; color: var(--muted); font-size: 13px; }
  .grid--list td.c-rows::after { content: attr(data-unit); }
  .grid--list td.c-actions { grid-area: act; margin-left: 30px; }
  .grid--list td.c-actions .actions { flex-wrap: wrap; row-gap: 2px; }
  .grid--list td.c-type, .grid--list td.c-cols, .grid--list td.c-extra { display: none; }
  .grid--list .act { padding: 0 6px 0 0; margin-right: 8px; background: none !important; height: 30px; }
  .grid--list .act span { font-size: 13px; }
  .grid--list tfoot { display: block; }
  .grid--list tfoot tr { display: flex; justify-content: space-between; padding: 16px 0; border: 0; }
  .grid--list tfoot td { display: block; height: auto; padding: 0; }
  .grid--list tfoot td.c-type, .grid--list tfoot td.c-cols, .grid--list tfoot td.c-extra, .grid--list tfoot td.c-check, .grid--list tfoot td.c-actions { display: none; }

  .grid th, .grid td { padding: 0 12px; }
  .grid--data td.sticky, .grid--data th.sticky { padding-left: 4px; padding-right: 6px; }
  .cell { max-width: 220px; }

  /* Dialoge als Bottom-Sheet */
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal, .modal--wide { width: 100%; max-height: calc(100vh - 40px - env(safe-area-inset-top, 0px)); border-radius: 14px 14px 0 0; animation: sheetIn 520ms var(--ease); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .modal::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: var(--hair-strong); margin: 10px auto 0; flex: none; }
  .modal-backdrop.is-closing .modal { animation: sheetOut 260ms var(--ease) forwards; }
  .modal__head { padding: 16px 22px 4px; }
  .modal__body { padding: 12px 22px 4px; }
  .modal__foot { padding: 16px 22px 22px; }
  .modal__foot .btn { flex: 1; }
  .coldef, .coldef-head { grid-template-columns: 1fr 1fr; }
  .coldef-head span:nth-child(n+3) { display: none; }
  .coldef__flags { grid-column: 1 / -1; grid-row: 3; }
  .coldef > .icon-btn { grid-column: 2; grid-row: 2; justify-self: end; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .btn { flex: 1 1 100%; max-width: 360px; }
  .toast-region { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }

@media (hover: none) {
  .drop:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

@media print {
  .masthead, .sidebar, .tabs, .toolbar, .grid-foot, .c-check, .sticky { display: none !important; }
  .shell { display: block; }
}

/* ==========================================================================
   sqMyLight — Konto, Menü, Anmeldung, Einrichtung, Dateibereich
   ========================================================================== */
.avatar-btn { margin-left: 2px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 500; letter-spacing: .4px; text-transform: uppercase; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.is-login .menu-trigger, .is-login #saveBtn { display: none; }

/* Kontextmenü */
.menu-backdrop { position: fixed; inset: 0; z-index: 70; }
.menu { position: fixed; z-index: 71; min-width: 240px; max-width: calc(100vw - 16px); max-height: calc(100vh - 24px); overflow-y: auto; background: var(--bg); border: 1px solid var(--hair); border-radius: var(--radius-m); box-shadow: var(--shadow); padding: 6px; animation: menuIn 220ms var(--ease); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
.menu__head { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 12px; border-bottom: 1px solid var(--hair); margin-bottom: 6px; }
.menu__head b { font-weight: 400; font-size: 15px; }
.menu__head span { font-size: 12.5px; color: var(--muted); }
.menu__item { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 4px; font-size: 14.5px; text-align: left; text-decoration: none; color: var(--ink); transition: background-color var(--dur-fast) var(--ease); }
.menu__item:hover, .menu__item:focus-visible { background: var(--hover); outline: none; }
.menu__item:focus-visible { box-shadow: inset 0 0 0 1.5px var(--ink); }
.menu__item .i { color: var(--muted); }
.menu__item.is-danger, .menu__item.is-danger .i { color: var(--danger); }
.menu__sep { height: 1px; background: var(--hair); margin: 6px 4px; }

/* Akkordeon */
.acc { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--hair); margin-top: 24px; }
.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; font-size: 20px; font-weight: 400; letter-spacing: -.005em; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:focus-visible { outline-offset: 2px; }
.acc > summary .i { transition: transform var(--dur) var(--ease); }
.acc[open] > summary .i { transform: rotate(180deg); }
.acc__body { padding: 0 0 36px; }
.acc__body > p { margin: 0 0 28px; max-width: 60ch; }

/* Anmeldung */
.auth { max-width: 480px; margin: 0 auto; padding: clamp(48px, 12vh, 120px) var(--gutter) 96px; }
.auth .lede { margin: 16px 0 34px; }
.auth__form { display: flex; flex-direction: column; gap: 20px; }
.display--s { font-size: clamp(30px, 4.4vw, 46px); }

/* Einrichtung (setup.php) */
.setup { max-width: 840px; margin: 0 auto; padding: clamp(32px, 7vh, 80px) var(--gutter) 96px; }
.setup__hero { margin-bottom: 36px; }
.setup__hero .lede { margin-top: 18px; }
.setup code, .lede code, .note code { font-family: var(--font-code); font-size: .9em; background: var(--surface-2); padding: 1px 6px; border-radius: 3px; }
.setup__checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px 32px; padding: 18px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); margin-bottom: 32px; font-size: 14px; }
.setup__check { display: flex; align-items: center; gap: 10px; }
.setup__check .muted { margin-left: auto; text-align: right; }
.setup__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.setup__dot.ok { background: var(--ok); } .setup__dot.warn { background: #C98A00; } .setup__dot.bad { background: var(--danger); }
.setup__block { margin-bottom: 8px; }
.setup__block h2 { margin-bottom: 8px; }
.setup__block > p { margin: 0 0 24px; font-size: 14px; }
.setup__set { border: 0; padding: 0; margin: 0 0 36px; min-width: 0; }
.setup__set legend { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-2); padding: 0; margin-bottom: 18px; }
.setup__errors { margin: 8px 0 0; padding-left: 18px; }
.setup input[type=file].input { padding: 10px 12px; }

/* Dateibereich */
.fm-name { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 400; min-width: 0; }
.fm-name:hover .fm-name__t { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.fm-name .i { color: var(--ink-2); }
.fm-name__t { overflow: hidden; text-overflow: ellipsis; }
.fm-lock { display: inline-flex; color: var(--muted); }
.fm-lock.is-locked { color: var(--accent); }
.fm-meta { display: none; font-size: 12.5px; color: var(--muted); margin: 2px 0 0 32px; }
.grid--files td { height: 58px; }
.grid--files td.c-name { max-width: 520px; overflow: hidden; }
.fm-bar { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 8px); z-index: 18; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 16px; margin: 0 0 16px; background: var(--ink); color: var(--bg); border-radius: var(--pill); box-shadow: var(--shadow); animation: toastIn var(--dur) var(--ease); }
.fm-bar .chip { border-color: color-mix(in srgb, var(--bg) 45%, transparent); color: var(--bg); background: transparent; }
.fm-bar .chip:hover { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.fm-bar .chip--danger:hover { color: var(--danger); }
.fm-bar__n { font-size: 14px; padding-left: 6px; }
.page.is-over .grid-wrap { outline: 1.5px dashed var(--ink); outline-offset: 8px; }
.chip--danger:hover { border-color: var(--danger); color: var(--danger); }
.pw .segmented { display: flex; width: 100%; }
.pw .segmented button { flex: 1; }
.pw .chips { align-items: center; }

@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .grid--files .fm-meta { display: block; }
  .grid--files td.c-name { white-space: normal; max-width: none; }
  .grid--files td { height: auto; padding-top: 12px; padding-bottom: 12px; }
  .fm-bar { border-radius: 14px; padding: 12px 14px; }
  .menu.menu--sheet { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0; width: 100%; max-width: none; max-height: 72vh; border: 0; border-radius: 14px 14px 0 0; padding: 12px 8px calc(12px + env(safe-area-inset-bottom, 0px)); animation: sheetIn 420ms var(--ease); }
  .menu-backdrop { background: var(--overlay); animation: fadeIn var(--dur) var(--ease); }
  .menu.menu--sheet .menu__item { padding: 14px 16px; font-size: 16px; }
  .setup__check .muted { display: none; }
}
