/* needsto.be-Hub — „Schriftmuster“: neutraler Grund, jede App als großer Schriftzug in ihrer eigenen Schrift. Keine externen Quellen (CSP). */
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('/fonts/bricolage-grotesque-latin.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url('/fonts/barlow-semi-condensed-600-latin.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Doto'; src: url('/fonts/Doto.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f1f0ec; --field: #fff; --line: #d8d7d0; --ink: #161616; --dim: #6f6f69; --faint: #a3a29b; --neg: #c8321e;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  font: 16px/1.4 'Instrument Sans', ui-sans-serif, -apple-system, sans-serif;
  color: var(--ink); background: var(--bg); color-scheme: light; font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent; scrollbar-gutter: stable;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--bg); }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
h1, p { margin: 0; }

.top { max-width: 640px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 20px 0; display: flex; align-items: center; justify-content: space-between; min-height: calc(60px + env(safe-area-inset-top)); view-transition-name: top; }
.brand { font-size: 18px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 8px); gap: 2px; transform: rotate(-12deg); }
.brand-mark i { width: 8px; height: 8px; background: #f15b2a; }
.brand-mark i:nth-child(2) { background: #efaa4b; }
.brand-mark i:nth-child(3) { background: #f58c3b; }
.brand-mark i:nth-child(4) { background: #d94727; }
.tools { display: flex; align-items: center; margin-right: -10px; }
.tool { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--dim); transition: color .15s ease; }
.tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
@media (hover: hover) and (pointer: fine) { .tool:hover { color: var(--ink); } }
.logout { margin: 0; }
.logout button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--dim); transition: color .15s ease; }
.logout svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .logout button:hover { color: var(--ink); } }

main { max-width: 640px; margin: 0 auto; padding: 12px 20px calc(40px + env(safe-area-inset-bottom)); }

/* Suche: nur ein Unterstrich */
.find { display: flex; align-items: center; gap: 10px; height: 50px; margin: 0 0 18px; border-bottom: 1.5px solid var(--ink); color: var(--dim); }
.find input { flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: none; font-size: 17px; caret-color: var(--ink); }
.find input::placeholder { color: var(--dim); }
.find input::-webkit-search-cancel-button { -webkit-appearance: none; }
.find svg, .quick svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dot { display: inline-block; width: 8px; height: 8px; flex: none; }
.hits { display: grid; gap: 18px; margin: 0 0 26px; }
.hits h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.hits ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.hits li { border-bottom: 1px solid var(--line); }
.hits a { display: grid; gap: 2px; padding: 12px 0; transition: transform .14s var(--ease-out); }
.hits a:active { transform: translateX(4px); }
.hits strong { font-weight: 500; overflow-wrap: anywhere; }
.hits small { color: var(--dim); font-size: 14px; }
.none { margin: 0 0 24px; color: var(--dim); font-size: 16px; }

/* Apps: jede Zeile ein Schriftmuster ihrer App, randlos über die volle Breite */
.apps { display: grid; margin: 0 -20px; border-top: 1px solid var(--line); }
.app { --tint: #e6e5df; position: relative; isolation: isolate; display: flex; align-items: center; height: 118px; padding: 0 20px; overflow: hidden;
  border-bottom: 1px solid var(--line); font: 600 64px/1 'Instrument Sans', sans-serif; letter-spacing: -.02em; }
.app::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--tint); transform: scaleX(0); transform-origin: left; transition: transform .32s var(--ease-out); }
.app > span { display: inline-block; animation: set .42s var(--ease-out) backwards; transition: transform .45s var(--ease-out); }
.app:nth-child(2) > span { animation-delay: .04s; } .app:nth-child(3) > span { animation-delay: .08s; } .app:nth-child(4) > span { animation-delay: .12s; } .app:nth-child(5) > span { animation-delay: .16s; }
.app i { font-style: normal; }
.app:active::before, .app.go::before { transform: scaleX(1); transition-duration: .28s; }
@media (hover: hover) and (pointer: fine) { .app:hover::before { transform: scaleX(1); } .app:hover > span { transform: translateX(10px); } }
/* Satz aufbauen: der Schriftzug wird von links aufgedeckt */
@keyframes set { from { clip-path: inset(-40% 100% -40% -20%); transform: translateX(-6px); } to { clip-path: inset(-40% -20% -40% -20%); } }

.app-zivi { --tint: #23232a; background: #111113; border-bottom-color: #111113; color: #fff; font-family: 'Doto', ui-monospace, monospace; font-weight: 900; font-size: 72px; letter-spacing: 0; }
.app-zivi i { display: inline-block; width: .2em; height: .2em; margin-left: .08em; border-radius: 50%; background: #f5c518; color: transparent; overflow: hidden; }
.app-payment { --tint: #dfe2ff; color: #2b3bff; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600; letter-spacing: -.04em; }
.app-payment i, .app-notes i { display: none; }
.app-wg { --tint: #e8e8e4; font-family: 'Barlow Semi Condensed', sans-serif; font-size: 72px; letter-spacing: -.01em; }
.app-wg > span { display: inline-flex; align-items: baseline; gap: 10px; }
.app-wg i { width: 26px; height: 26px; border-radius: 50%; border: 6px solid #e3000f; background: #fff; color: transparent; overflow: hidden; }
.app-notes { --tint: #f2cf2a; background: #ffde3b; color: #141310; letter-spacing: -.05em; }

/* Neu anlegen: Aktionen aller Apps */
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.quick a { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 14px 0 10px; border: 1px solid #c9c8c0; border-radius: 999px; font-size: 15px; font-weight: 500; transition: transform .14s var(--ease-out), border-color .15s ease, background-color .15s ease; }
.quick a:active { transform: scale(.96); background: var(--field); }
.quick svg { width: 16px; height: 16px; color: var(--dim); }
@media (hover: hover) and (pointer: fine) { .quick a:hover { border-color: var(--ink); } }

/* Aktionsformular */
.act { display: grid; gap: 18px; }
.act h1 { display: flex; align-items: center; gap: 12px; font-size: clamp(40px, 11vw, 56px); font-weight: 600; line-height: 1; letter-spacing: -.035em; view-transition-name: act-title; }
.act h1 .dot { width: 12px; height: 12px; }
.back { justify-self: start; color: var(--dim); font-size: 16px; padding: 6px 0; }
.back::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-1px) rotate(45deg); }
.opt { font-weight: 400; color: var(--faint); }

/* Sucheinstellungen: je App eine Gruppe, je Typ ein Schalter */
.kinds { margin: 0; padding: 0; border: 0; border-top: 1px solid var(--line); }
.kinds legend + * { clear: left; }
.kinds legend { float: left; width: 100%; display: flex; align-items: center; gap: 8px; padding: 18px 0 4px; font-size: 14px; font-weight: 600; }
.form .switch { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 52px; font-size: 17px; font-weight: 400; color: var(--ink); }
.form .switch input { position: absolute; left: 0; top: 50%; width: 1px; min-height: 0; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; }
.switch { cursor: pointer; }
.switch i { position: relative; width: 46px; height: 28px; flex: none; border-radius: 999px; background: #d3d2cb; transition: background-color .2s ease; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .18); transition: transform .26s var(--ease-out); }
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Login / Passwort / Fehler */
.gate { padding-top: 8vh; display: grid; gap: 28px; }
.gate h1 { font-size: clamp(46px, 13vw, 72px); font-weight: 600; line-height: .95; letter-spacing: -.045em; }
.gate h1 em { font-style: normal; color: var(--dim); }
.gate form { margin: 0; }
.eyebrow { color: var(--dim); font-size: 14px; font-weight: 600; }
.pw-row { display: flex; align-items: center; min-height: 56px; border-bottom: 1.5px solid var(--ink); padding: 0 0 0 2px; }
.pw-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 18px; caret-color: var(--ink); }
.pw-row input::placeholder { color: var(--faint); }
.pw-row button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; transition: transform .14s var(--ease-out); }
.pw-row button:active { transform: scale(.92); }
.pw-row svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--dim); }
.form input, .form select, .form textarea { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); padding: 0 14px; font-size: 17px; color: var(--ink); caret-color: var(--ink); transition: border-color .15s ease; }
.form textarea { padding: 12px 14px; resize: vertical; line-height: 1.45; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 0; border-color: var(--ink); }
.primary { min-height: 52px; border: 0; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 17px; transition: transform .12s var(--ease-out); }
.primary:active { transform: scale(.98); }
.error { color: var(--neg); font-size: 15px; margin-top: 10px; }

/* Desktop: dieselbe Liste, größerer Satz */
@media (min-width: 960px) {
  .top:has(+ main .apps), main:has(.apps) { max-width: 1080px; padding-left: 40px; padding-right: 40px; }
  main:has(.apps) { padding-top: 24px; }
  .find { max-width: 520px; }
  .apps { margin: 0 -24px; }
  .app { height: 150px; padding: 0 24px; font-size: 92px; }
  .app-zivi, .app-wg { font-size: 104px; }
  .app-wg i { width: 36px; height: 36px; border-width: 8px; }
}

/* Einstieg (motion.js setzt .arrive; .hold = Android-Übergang läuft noch) */
.hold *, .hold *::before, .hold *::after { animation-play-state: paused !important; }
.arrive .brand-mark i { animation: tile .5s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(sibling-index() * 60ms); }
.arrive .brand > span:last-child { animation: set .5s var(--ease-out) .2s both; }
/* Zeilen: erst läuft das Band ein, dann wird der Schriftzug gesetzt */
.arrive .app { animation: band .56s var(--ease-in-out) backwards; animation-delay: calc(sibling-index() * 70ms); }
.arrive .app > span { animation-duration: .5s; animation-delay: calc(sibling-index() * 70ms + .22s); }
.arrive .find { animation: rule .6s var(--ease-in-out) .1s both; }
@keyframes tile { from { opacity: 0; transform: scale(.3) rotate(90deg); } }
@keyframes band { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes rule { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Interne Seitenwechsel: Formular schiebt sich von rechts herein (push), zurück nach rechts hinaus (pop) */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .36s; animation-timing-function: var(--ease-in-out); }
::view-transition-old(root) { animation: .14s ease both vt-out; }
::view-transition-new(root) { animation: .3s var(--ease-out) both vt-in; }
html:active-view-transition-type(push)::view-transition-old(root) { animation: .36s var(--ease-in-out) both push-out; }
html:active-view-transition-type(push)::view-transition-new(root) { animation: .36s var(--ease-in-out) both push-in; }
html:active-view-transition-type(pop)::view-transition-old(root) { animation: .36s var(--ease-in-out) both push-in reverse; }
html:active-view-transition-type(pop)::view-transition-new(root) { animation: .36s var(--ease-in-out) both push-out reverse; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: scale(.985); } }
@keyframes push-out { to { opacity: 0; transform: translateX(-18%); } }
@keyframes push-in { from { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .app > span, .arrive .app, .arrive .brand-mark i, .arrive .brand > span:last-child, .arrive .find { animation: fade .2s ease both; transition: none; }
  .app:hover > span { transform: none; }
  .app::before { transition: opacity .2s ease; transform: none; opacity: 0; }
  .app:active::before, .app:hover::before { opacity: 1; }
  .quick a:active, .primary:active, .pw-row button:active, .hits a:active { transform: none; }
  ::view-transition-group(*) { animation: none; }
  ::view-transition-old(root), html:active-view-transition-type(push, pop)::view-transition-old(root) { animation: .15s ease both vt-out; }
  ::view-transition-new(root), html:active-view-transition-type(push, pop)::view-transition-new(root) { animation: .2s ease both fade; }
  @keyframes fade { from { opacity: 0; } }
}

/* needstobe: Teilen-Hinweise (Hub) */
.shares { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.shares li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
.shares li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.shares form { margin: 0; }
.shares .link { border: 0; background: none; padding: 6px 4px; font: inherit; color: var(--ink); cursor: pointer; }
.shares .link.dim { color: var(--dim); }

/* needstobe: Konto */
.i, .ghost svg, .row-link svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.signin { display: grid; gap: 22px; }
.passkey { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.passkey[hidden], .copy[hidden], .push[hidden] { display: none; }
.lines { display: grid; }
.line { min-height: 56px; border: 0; border-bottom: 1px solid var(--line); outline: 0; background: transparent; padding: 0 2px; font-size: 18px; caret-color: var(--ink); transition: border-color .15s ease; }
.line:focus { border-bottom-color: var(--ink); }
.line::placeholder { color: var(--faint); }
.aside { justify-self: start; color: var(--dim); font-size: 15px; padding: 6px 0; }
.wide { width: 100%; }
a.button { display: flex; align-items: center; justify-content: center; }
.ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border: 1px solid #c9c8c0; border-radius: 12px; background: none; font-weight: 500; transition: transform .12s var(--ease-out), border-color .15s ease; }
.ghost:active { transform: scale(.98); }
.form > .ghost, .konto .ghost { justify-self: start; }
@media (hover: hover) and (pointer: fine) { .ghost:hover { border-color: var(--ink); } }
button:disabled { opacity: .5; cursor: default; }

/* Apps wählen: jede Kachel ein kleines Schriftmuster ihrer App; aus = nur Umriss, ohne App-Farben */
.tiles { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tiles .tile { position: relative; display: flex; align-items: center; min-height: 72px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  font: 600 27px/1 'Instrument Sans', sans-serif; letter-spacing: -.02em; cursor: pointer; transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .12s var(--ease-out); }
.tiles .tile { color: var(--ink); }
.tiles .app-zivi { color: #fff; } .tiles .app-payment { color: #2b3bff; } .tiles .app-notes { color: #141310; }
.tiles .tile:not(:has(input:checked)) { background: transparent; color: var(--faint); border-style: dashed; border-color: #c9c8c0; }
.tiles .tile:not(:has(input:checked)) i { filter: grayscale(1); opacity: .5; }
.tiles .tile.app-zivi, .tiles .tile.app-wg { font-size: 30px; }
.tiles .tile.app-wg i { width: 13px; height: 13px; border-width: 3px; }
.tiles .tile.app-wg > span { gap: 5px; }
.tiles .tile input { position: absolute; opacity: 0; pointer-events: none; }
.tiles .tile:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.tiles .tile:active { transform: scale(.97); }
.tiles .tile i { font-style: normal; }

/* Notfallcodes */
.codes { margin: 0; padding: 16px 18px; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--field);
  font: 500 17px/1.3 ui-monospace, 'SF Mono', Menlo, monospace; counter-reset: c; }
.codes li { counter-increment: c; white-space: nowrap; }
.codes li::before { content: counter(c); display: inline-block; width: 1.6em; color: var(--faint); font-size: 13px; }
.copy { justify-self: start; }

/* Konto */
.konto { gap: 0; padding-top: 16px; }
.konto > h1 { margin-bottom: 18px; overflow-wrap: anywhere; }
.konto > section { display: grid; gap: 12px; padding: 22px 0; border-top: 1px solid var(--line); }
.konto h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--dim); }
.status { color: var(--dim); font-size: 15px; }
.konto > .status, .konto > .error { margin: 0 0 14px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows:empty { display: none; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line); }
.rows li:first-child { border-top: 1px solid var(--line); }
.rows li > span { display: grid; gap: 2px; min-width: 0; }
.rows strong { display: flex; align-items: center; gap: 8px; font-weight: 500; overflow-wrap: anywhere; }
.rows small { color: var(--dim); font-size: 14px; }
.rows form, .row-form { margin: 0; }
.link { border: 0; background: none; padding: 10px 0 10px 8px; color: var(--dim); font-size: 15px; }
@media (hover: hover) and (pointer: fine) { .link:hover { color: var(--ink); } }
.row-link { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; border: 0; background: none; padding: 0; text-align: left; font-size: 17px; }
.row-link.danger, .primary.danger { color: var(--neg); }
.primary.danger { background: var(--neg); color: #fff; }
.warn { color: var(--neg); font-size: 14px; }
.on { color: var(--dim); font-weight: 400; }
.more { border: 0; }
.more summary { display: flex; align-items: center; min-height: 48px; cursor: pointer; list-style: none; font-size: 17px; gap: 8px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ''; width: 7px; height: 7px; margin-left: auto; border-right: 1.5px solid var(--dim); border-bottom: 1.5px solid var(--dim); transform: rotate(45deg); transition: transform .2s var(--ease-out); }
.more[open] summary::after { transform: rotate(-135deg); }
.more .form { padding: 4px 0 14px; }
.secret { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); font: 500 19px/1.4 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .04em; overflow-wrap: anywhere; }
.copyline input { font: 15px ui-monospace, 'SF Mono', Menlo, monospace; }
.facts { margin: 0; display: grid; }
.facts dt { padding-top: 18px; font-size: 14px; font-weight: 600; color: var(--dim); }
.facts dd { margin: 4px 0 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .ghost:active, .tiles .tile:active { transform: none; } .more summary::after { transition: none; } }
