/* Ausländerrechts-Assistent – Gestaltung
   Ruhige nachtblaue Fläche, eine Akzentfarbe, Ampelfarben nur für Bewertungen. */
:root, [data-theme="dark"] {
  --bg: #0b1018; --s1: #141b26; --s2: #1c2533; --ln: #2a3546; --tx: #eef3f8; --mu: #9aa8bc;
  --ac: #8ab4ff; --ai: #0b1018;
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171;
  --shadow: 0 -10px 30px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f3f5f8; --s1: #ffffff; --s2: #eaeef3; --ln: #d3dae4; --tx: #0e1621; --mu: #4f5d70;
  --ac: #2f5fd0; --ai: #ffffff;
  --ok: #0f8a5f; --warn: #a86b00; --bad: #c43c3c;
  --shadow: 0 -10px 30px -12px rgba(15,25,40,.25);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--tx);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; text-size-adjust: 100%;
}
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
:focus-visible { outline: 3px solid var(--ac); outline-offset: 2px; border-radius: 10px; }

.app { height: 100dvh; display: grid; grid-template-rows: auto auto 1fr auto; max-width: 560px; margin: 0 auto; position: relative; overflow: hidden; }

/* Kopfzeile */
.bar { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 6px;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left)); }
.bar-t { text-align: center; font-size: 13px; font-weight: 600; color: var(--mu); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-r { display: flex; gap: 2px; }
.ib { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--mu); }
.ib:active { background: var(--s2); }
.ib.sofort { color: var(--bad); }
.ib[hidden] { visibility: hidden; display: grid; }

.prog { display: flex; gap: 4px; padding: 0 20px; min-height: 4px; }
.prog b { flex: 1; height: 4px; border-radius: 2px; background: var(--ln); transition: background .3s; }
.prog b.on { background: var(--ac); }
.prog b.half { background: linear-gradient(90deg, var(--ac) 50%, var(--ln) 50%); }

/* Inhalt */
.view { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; outline: none;
  padding: 20px max(20px, env(safe-area-inset-right)) 24px max(20px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 14px; }
.view > * { flex-shrink: 0; }
.view.fwd { animation: inR .24s ease both; }
.view.bwd { animation: inL .24s ease both; }
@keyframes inR { from { opacity: 0; transform: translateX(22px); } }
@keyframes inL { from { opacity: 0; transform: translateX(-22px); } }
@media (prefers-reduced-motion: reduce) {
  .view.fwd, .view.bwd { animation: fade .2s ease both; }
  @keyframes fade { from { opacity: 0; } }
}

.step { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--mu); margin: 0; }
.q { font-size: 26px; font-weight: 750; line-height: 1.18; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
.sub { color: var(--mu); font-size: 15px; margin: -6px 0 0; }
.dots { display: flex; gap: 6px; }
.dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--ln); }
.dots i.on { background: var(--ac); width: 18px; }

/* Kacheln */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tiles.one { grid-template-columns: 1fr; }
.tiles.three { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: var(--s1); border: 1.5px solid var(--ln); border-radius: 18px; padding: 14px; min-height: 104px;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start; position: relative; transition: transform .12s ease, border-color .15s; }
.tile:active { transform: scale(.98); }
.tile.row { min-height: 68px; flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; }
.tile.mini { min-height: 72px; padding: 10px; gap: 6px; }
.tile .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--s2); display: grid; place-items: center; color: var(--tx); flex: none; }
.tile .code { font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.tile .lb { font-weight: 650; font-size: 16px; line-height: 1.2; }
.tile.mini .lb { font-size: 13.5px; }
.tile .ds { font-size: 13px; color: var(--mu); line-height: 1.3; }
.tile .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile[aria-pressed="true"] { border-color: var(--ac); background: color-mix(in srgb, var(--ac) 13%, var(--s1)); }
.tile[aria-pressed="true"] .ic { background: var(--ac); color: var(--ai); }
.tile[aria-pressed="true"]::after { content: ""; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 10px;
  background: var(--ac) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1018' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center/14px no-repeat; }
[data-theme="light"] .tile[aria-pressed="true"]::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E"); }
.tile:disabled { opacity: .45; }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; border-radius: 16px; width: 100%;
  font-weight: 650; font-size: 17px; background: var(--ac); color: var(--ai); text-align: center; padding: 0 16px; }
.btn.sec { background: var(--s1); color: var(--tx); border: 1px solid var(--ln); }
.btn:disabled { opacity: .45; }
.btn:active:not(:disabled) { filter: brightness(.92); }
.actions { position: sticky; bottom: -24px; margin: auto -20px -24px; padding: 12px 20px 16px; display: grid; gap: 10px;
  background: linear-gradient(transparent, var(--bg) 26%); }
.or { font-size: 12px; color: var(--mu); text-align: center; letter-spacing: .08em; text-transform: uppercase; }

.disc { font-size: 11.5px; color: var(--mu); text-align: center; padding: 6px 16px calc(env(safe-area-inset-bottom, 0px) + 8px); border-top: 1px solid var(--ln); background: var(--bg); }
.disc b { font-weight: 650; }

/* Karten und Hinweise */
.card { background: var(--s1); border: 1px solid var(--ln); border-radius: 18px; padding: 14px 16px; display: grid; gap: 8px; }
.card .h { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--mu); }
.card ol, .card ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15.5px; }
.note { font-size: 14px; color: var(--mu); }
.info { border-radius: 14px; padding: 12px 14px; font-size: 14.5px; display: grid; grid-template-columns: auto 1fr; gap: 10px;
  background: color-mix(in srgb, var(--warn) 14%, var(--s1)); }
.info svg { color: var(--warn); width: 20px; height: 20px; margin-top: 1px; }

/* Ampel */
.amp { --c: var(--warn); border-radius: 22px; padding: 16px 18px; display: grid; gap: 6px;
  background: color-mix(in srgb, var(--c) 14%, var(--s1)); border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent); }
.amp.ok { --c: var(--ok); } .amp.bad { --c: var(--bad); }
.amp .lights { display: flex; gap: 7px; }
.amp .lights i { width: 13px; height: 13px; border-radius: 7px; background: var(--ln); }
.amp .lights i.on { background: var(--c); box-shadow: 0 0 12px var(--c); }
.amp .st { font-size: 24px; font-weight: 780; color: var(--c); letter-spacing: -.01em; }
.amp ul { margin: 0; padding-left: 18px; font-size: 15px; display: grid; gap: 3px; }

.weiche { border-radius: 18px; padding: 14px 16px; display: grid; gap: 8px; background: color-mix(in srgb, var(--bad) 15%, var(--s1));
  border: 1.5px solid color-mix(in srgb, var(--bad) 60%, transparent); }
.weiche .wt { display: flex; gap: 10px; align-items: center; font-weight: 750; font-size: 17px; color: var(--bad); }
.weiche ul { margin: 0; padding-left: 20px; display: grid; gap: 5px; font-size: 15px; }

/* Aufklapper */
details.acc { background: var(--s1); border: 1px solid var(--ln); border-radius: 16px; }
details.acc > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; font-size: 15.5px; min-height: 52px; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary .r { color: var(--mu); font-weight: 500; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
details.acc > summary .chev { width: 18px; height: 18px; transition: transform .2s; color: var(--mu); }
details.acc[open] > summary .chev { transform: rotate(90deg); }
details.acc > div { padding: 0 16px 16px; display: grid; gap: 10px; font-size: 15px; }
.dot { width: 10px; height: 10px; border-radius: 5px; background: var(--c, var(--mu)); flex: none; }
.dot.ok { --c: var(--ok); } .dot.warn { --c: var(--warn); } .dot.bad { --c: var(--bad); }
.row-link { display: flex; justify-content: space-between; align-items: center; background: var(--s1); border: 1px solid var(--ln); border-radius: 16px; padding: 14px 16px; font-weight: 600; font-size: 15.5px; min-height: 54px; width: 100%; }
.row-link .r { color: var(--mu); font-weight: 500; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.pill { background: var(--s2); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; color: var(--tx); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; flex-direction: column; gap: 1px; background: var(--s2); border-radius: 12px; padding: 8px 12px; text-decoration: none; color: var(--tx); font-size: 14px; font-weight: 650; }
.chip small { font-weight: 450; color: var(--mu); font-size: 12px; }

/* Staatenliste */
.az { display: grid; gap: 2px; }
.az .letter { font-size: 13px; font-weight: 700; color: var(--mu); padding: 14px 4px 4px; position: sticky; top: -20px; background: var(--bg); }
.az button { display: flex; justify-content: space-between; align-items: center; min-height: 50px; padding: 0 14px; border-radius: 12px; background: var(--s1); font-size: 16px; }
.az button span { color: var(--mu); font-size: 12px; font-weight: 600; }
.azbar { display: flex; flex-wrap: wrap; gap: 4px; }
.azbar button { min-width: 34px; height: 34px; border-radius: 9px; background: var(--s1); font-size: 13px; font-weight: 650; text-align: center; }

/* Checkliste */
.chk { display: flex; gap: 14px; align-items: center; width: 100%; background: var(--s1); border: 1px solid var(--ln); border-radius: 16px; padding: 14px 16px; min-height: 60px; font-size: 16px; }
.chk .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--ln); display: grid; place-items: center; flex: none; color: transparent; }
.chk .box svg { width: 18px; height: 18px; stroke-width: 3; }
.chk[aria-checked="true"] .box { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.chk[aria-checked="true"] .t { color: var(--mu); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--mu) 60%, transparent); }
.count { display: flex; justify-content: space-between; font-size: 14px; color: var(--mu); }

/* Export */
.preview { background: var(--s1); border: 1px solid var(--ln); border-radius: 14px; padding: 12px 14px; font: 12.5px/1.5 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre-wrap; max-height: 42vh; overflow: auto; user-select: text; -webkit-user-select: text; }
.toast { text-align: center; font-size: 14px; color: var(--ok); min-height: 20px; }

/* Start */
.hero { display: grid; gap: 12px; padding-top: 12px; }
.mark { width: 64px; height: 64px; border-radius: 18px; background: var(--s2); display: grid; place-items: center; color: var(--ac); }
.mark svg { width: 34px; height: 34px; }
.hero h1 { font-size: 30px; line-height: 1.12; margin: 0; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--mu); font-size: 16px; }
.facts { display: grid; gap: 8px; font-size: 14.5px; }
.facts div { display: flex; gap: 10px; align-items: flex-start; }
.facts svg { color: var(--ac); width: 20px; height: 20px; margin-top: 1px; }
dl.kv { margin: 0; display: grid; gap: 8px; }
dl.kv dt { font-size: 12px; color: var(--mu); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
dl.kv dd { margin: 0; }

/* Blätter (Sofort-Weichen, Bestätigung) */
.scrim { position: absolute; inset: 0; background: rgba(5,8,14,.55); z-index: 20; animation: fade .2s ease both; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 88%; overflow-y: auto; background: var(--s1); border-radius: 26px 26px 0 0;
  padding: 10px max(20px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom, 0px) + 18px) max(20px, env(safe-area-inset-left));
  display: grid; gap: 14px; box-shadow: var(--shadow); animation: up .26s cubic-bezier(.2,.8,.2,1) both; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--ln); margin: 0 auto; }
.sheet h2 { margin: 0; font-size: 21px; }
.sheet .tile { background: var(--bg); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: fade .2s ease both; } }

@media (max-width: 360px) {
  .tiles.three { grid-template-columns: 1fr 1fr; }
  .q { font-size: 23px; }
}
.q:focus, h1:focus, h2:focus { outline: none; }
.actions.static { position: static; margin: 4px 0 0; padding: 0; background: none; }
