/* Desktop verwendet dieselben Komponenten wie mobil. Layout und gezielte
   Desktop-Anpassungen hier; gemeinsame Farben und Buttons kommen aus app.css. */
html.desktop { --top: 0px; --bottom: 0px; --app-h: 100dvh; }
html.desktop, html.desktop body { height: 100%; overflow: hidden; }
html.desktop #device { position: fixed; inset: 0; }
html.desktop #app { max-width: none; height: 100%; min-height: 0; }

/* Einstieg: klare Erklärung links und vier illustrative Gesprächspartner rechts. */
html.desktop .screen.welcome {
  flex: none; width: 100%; max-width: 1368px; height: 100dvh; min-height: 0; margin: 0 auto; padding: 28px 44px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); column-gap: clamp(40px, 5vw, 80px);
  align-content: center; grid-template-rows: auto minmax(24px, 1fr) auto auto auto auto minmax(16px, 1fr);
  grid-template-areas: "top top" ". ." "text faces" "steps faces" "buttons faces" "legal faces" ". .";
  overflow-y: auto;
}
html.desktop .welcome .spacer { display: none; }
html.desktop .welcome-desktop { display: block; }
html.desktop .welcome-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
html.desktop .welcome-top-note { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
html.desktop .welcome-top-note .i { font-size: 17px; }
html.desktop .welcome-visual { grid-area: faces; display: block; align-self: center; justify-self: end; width: 100%; max-width: min(100%, calc(100dvh - 160px)); min-width: 0; }
html.desktop .welcome .face-grid { margin: 0; width: 100%; animation: none; }
html.desktop .welcome-person::after { content: ""; position: absolute; inset: 60% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.45)); pointer-events: none; }
html.desktop .welcome-person .tile-label { z-index: 1; }
html.desktop .welcome-photo-note { margin: 14px 0 0; text-align: center; font-size: 12px; color: var(--text-2); }
html.desktop .welcome-text { grid-area: text; margin: 0; text-align: left; }
html.desktop .welcome-eyebrow { margin: 0 0 16px; font-size: 11px; font-weight: 600; letter-spacing: 1.2px; color: var(--text-2); }
html.desktop .welcome-text h1 { font-size: clamp(38px, 4vw, 56px); line-height: 1.06; letter-spacing: -1.6px; text-wrap: balance; }
html.desktop .welcome-text .sub { max-width: 400px; margin-top: 18px; font-size: 17px; line-height: 1.5; }
html.desktop .welcome-how { grid-area: steps; display: flex; flex-direction: column; gap: 14px; list-style: none; margin: 28px 0; padding: 0; }
html.desktop .welcome-how li { display: flex; align-items: center; gap: 12px; }
html.desktop .welcome-step-number { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; }
html.desktop .welcome-how .headline { font-size: 15px; }
html.desktop .welcome-how .caption { margin: 3px 0 0; }
html.desktop .welcome .stack { grid-area: buttons; max-width: 440px; }
html.desktop .welcome-auth-note { margin: 2px 0 0; text-align: center; font-size: 12px; color: var(--text-2); }
html.desktop .welcome .legal { grid-area: legal; max-width: 440px; margin: 16px 0 0; text-align: left; }
html.desktop .welcome :focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
@media (max-height: 760px) {
  html.desktop .screen.welcome { padding-top: 16px; padding-bottom: 16px; grid-template-rows: auto 20px auto auto auto auto 12px; }
  html.desktop .welcome-text h1 { font-size: 38px; }
  html.desktop .welcome-eyebrow { margin-bottom: 10px; }
  html.desktop .welcome-text .sub { margin-top: 12px; font-size: 15px; }
  html.desktop .welcome-how { gap: 8px; margin: 18px 0; }
  html.desktop .welcome-how .caption { display: none; }
  html.desktop .welcome .legal { margin-top: 12px; }
}
@media (max-height: 660px) {
  html.desktop .welcome-text h1 { font-size: 34px; }
  html.desktop .welcome-eyebrow { display: none; }
  html.desktop .welcome-how { flex-direction: row; gap: 12px; }
  html.desktop .welcome-how li { flex: 1; align-items: flex-start; gap: 8px; }
  html.desktop .welcome-how .headline { font-size: 13px; }
  html.desktop .welcome-step-number { width: 24px; height: 24px; }
}
/* Registrierung: drei Phasen, eine Frage im Fokus, gemeinsame mobile Controls. */
html.desktop .onboarding {
  width: 100%; height: 100dvh; min-height: 0; overflow-y: auto;
  padding: 28px 44px; display: flex; flex-direction: column;
}
html.desktop .onboarding-header {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex: none; width: 100%; max-width: 1200px; margin: 0 auto;
}
html.desktop .onboarding-phases { display: flex; align-items: center; gap: 32px; list-style: none; margin: 0; padding: 0; }
html.desktop .onboarding-phases li { display: flex; align-items: center; gap: 9px; color: var(--text-2); font-size: 13px; }
html.desktop .onboarding-phase-number { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; font-size: 11px; }
html.desktop .onboarding-phase-number .i { font-size: 12px; }
html.desktop .onboarding-phases .current { color: var(--text); font-weight: 600; }
html.desktop .onboarding-phases .current .onboarding-phase-number { background: var(--text); color: var(--bg); border-color: var(--text); }
html.desktop .onboarding-phases .done .onboarding-phase-number { border-color: transparent; color: var(--text); }
html.desktop .onboarding-content {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(64px, 8vw, 140px);
  width: 100%; max-width: 1080px; margin: auto; padding: 48px 0; align-items: center; flex: none;
}
html.desktop .onboarding-story { width: 100%; max-width: 450px; justify-self: end; }
html.desktop .onboarding-portraits { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; width: 100%; aspect-ratio: 1.18; border-radius: 24px; overflow: hidden; }
html.desktop .onboarding-portraits > div { min-height: 0; overflow: hidden; }
html.desktop .onboarding-portraits img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 38%; }
html.desktop .onboarding-chat-mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--bg); font-size: 25px; }
html.desktop .onboarding-image-note { margin: 10px 0 24px; font-size: 10px; color: var(--text-2); }
html.desktop .onboarding-story h2 { margin: 0; font-size: clamp(27px, 2.4vw, 34px); line-height: 1.14; letter-spacing: -.8px; text-wrap: balance; }
html.desktop .onboarding-story > .sub { max-width: 360px; margin: 14px 0 0; font-size: 15px; line-height: 1.5; }
html.desktop .onboarding-panel { min-width: 0; }
html.desktop .screen.step { flex: none; width: 100%; max-width: 440px; min-height: 0; margin: 0 auto 0 0; padding: 0; }
html.desktop .step .nav { flex-shrink: 0; margin-bottom: 28px; }
html.desktop .onboarding-step-count { color: var(--text-2); font-size: 13px; }
html.desktop .step .step-icon { display: none; }
html.desktop .step-head { padding: 0 0 30px; gap: 14px; }
html.desktop .step-head h1 { font-size: 38px; line-height: 1.12; letter-spacing: -1px; text-wrap: balance; }
html.desktop .step-head .sub { line-height: 1.55; font-size: 16px; }
html.desktop .step > .spacer { flex: none; height: 28px; }
html.desktop .step > .btn { flex-shrink: 0; }
html.desktop .step .step-footer { line-height: 1.4; font-size: 12px; color: var(--text-2); }
html.desktop .step .preview-card { margin-top: 16px; }
html.desktop .step :is(.big-field, .name-field) { width: 100%; height: 60px; padding: 0 18px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); font-size: 18px; font-weight: 500; }
html.desktop .step :is(.big-field, .name-field)::placeholder { color: var(--text-2); }
html.desktop .onboarding :focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
html.desktop .step :is(.big-field, .name-field):focus-visible { outline: none; border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
html.desktop .step .code-boxes:focus-within { outline: 2px solid var(--text); outline-offset: 6px; border-radius: 12px; }
html.desktop .onboarding-photo-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
html.desktop .photo-pick-big:has(.onboarding-photo-input:focus-visible) { outline: 2px solid var(--text); outline-offset: 5px; }
html.desktop .onboarding-photo-caption { position: absolute; top: calc(100% + 14px); white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--text); }
html.desktop .step[data-step="photo"] .guidelines { margin-top: 56px; }
html.desktop .step .rules { gap: 18px; }
html.desktop .step .rule .sub { font-size: 14px; line-height: 1.45; }
@media (max-height: 760px) {
  html.desktop .onboarding { padding-top: 20px; padding-bottom: 20px; }
  html.desktop .onboarding-content { padding: 32px 0; }
  html.desktop .onboarding-portraits { max-width: 340px; aspect-ratio: 1.35; }
  html.desktop .onboarding-image-note { margin-bottom: 18px; }
  html.desktop .onboarding-story h2 { font-size: 28px; }
  html.desktop .step .nav { margin-bottom: 20px; }
  html.desktop .step-head { padding-bottom: 24px; }
  html.desktop .step-head h1 { font-size: 32px; }
  html.desktop .step-head .sub { font-size: 15px; }
  html.desktop .step > .spacer { height: 24px; }
}
/* Einheitliche Auswahlflächen: klare Konturen, echte Fokus- und Auswahlzustände. */
html.desktop .onboarding .btn { transition: background .16s ease, transform .16s ease, box-shadow .16s ease; }
html.desktop .onboarding .btn:not(:disabled):active { transform: scale(.99); }
html.desktop .onboarding .btn-primary:not(:disabled):hover { background: #ededed; box-shadow: 0 3px 18px rgba(255,255,255,.08); }
html.desktop .onboarding .btn:disabled { opacity: 1; background: var(--surface-raised); color: var(--text-2); }
html.desktop .onboarding-later { margin-top: 10px; height: 46px; }
html.desktop .onboarding :is(.nav-back, .choice, .date-trigger, .check-row, .terms-toggle) { transition: background .16s ease, border-color .16s ease; }
html.desktop .onboarding .nav-back { width: 40px; height: 40px; background: var(--surface); border: 1px solid var(--line); }
html.desktop .onboarding .nav-back .i { width: 17px; height: 17px; }
html.desktop .onboarding .nav-back:hover { background: var(--surface-raised); }
html.desktop .birthday-fields { display: grid; grid-template-columns: 1fr 1.55fr 1.15fr; gap: 10px; }
html.desktop .date-field { position: relative; min-width: 0; }
html.desktop .date-label { display: block; margin: 0 0 8px 2px; font-size: 13px; font-weight: 500; color: var(--text-2); }
html.desktop .date-trigger { width: 100%; min-height: 58px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text-2); font-size: 16px; text-align: left; }
html.desktop .date-trigger.has-value { color: var(--text); font-weight: 500; }
html.desktop .date-trigger > .i { width: 12px; height: 12px; color: var(--text-2); }
html.desktop .date-trigger:is(:hover, [aria-expanded="true"]) { background: var(--surface-raised); border-color: rgba(255,255,255,.3); }
html.desktop .date-menu { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 8px); padding: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-radius: 16px; border: 1px solid rgba(255,255,255,.17); background: rgba(36,36,38,.97); backdrop-filter: blur(24px); box-shadow: 0 12px 40px rgba(0,0,0,.6); }
html.desktop .date-menu.above { top: auto; bottom: calc(100% + 8px); }
html.desktop .date-menu[hidden] { display: none; }
html.desktop .date-menu [role="option"] { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; min-height: 38px; padding: 8px 10px; font-size: 14px; text-align: left; border-radius: 9px; }
html.desktop .date-menu [role="option"]:is(:hover, :focus-visible, [aria-selected="true"]) { background: rgba(255,255,255,.12); outline: none; }
html.desktop .date-menu [role="option"]:focus-visible { box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
html.desktop .date-menu [role="option"] .i { width: 14px; height: 14px; }
html.desktop .birthday-summary { display: flex; align-items: center; gap: 12px; margin-top: 18px; min-height: 56px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
html.desktop .birthday-summary > .i { width: 22px; height: 22px; flex: none; }
html.desktop .birthday-summary strong { color: var(--text); font-weight: 600; }
html.desktop .birthday-summary.danger, html.desktop .birthday-summary.danger strong { color: var(--danger); }
html.desktop .step .hint-line { margin-top: 12px; justify-content: flex-start; color: var(--text-2); font-size: 12px; }
html.desktop .step .hint-line.danger { color: var(--danger); }
html.desktop .gender-options { gap: 0; padding: 4px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
html.desktop .gender-options .choice { min-height: 76px; border: 1px solid transparent; border-radius: 17px; background: transparent; gap: 14px; padding: 12px 14px; }
html.desktop .gender-options .choice:hover { background: rgba(255,255,255,.04); }
html.desktop .gender-options .choice.on { background: var(--surface-raised); border-color: rgba(255,255,255,.35); }
html.desktop .gender-options .choice-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-raised); color: var(--text-2); font-size: 23px; }
html.desktop .gender-options .choice.on .choice-icon { background: var(--text); color: var(--bg); }
html.desktop .gender-options .headline { font-size: 16px; font-weight: 500; }
html.desktop .gender-options .choice:focus-visible { outline-offset: -2px; }
html.desktop .step[data-step="permissions"] .group { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
html.desktop .step .perm-row { padding: 20px; gap: 16px; }
html.desktop .step .perm-row + .perm-row::before { left: 80px; right: 20px; }
html.desktop .step .perm-icon, html.desktop .step .rule-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-raised); font-size: 22px; }
html.desktop .step .perm-row .headline { font-size: 16px; }
html.desktop .step .perm-row .caption { margin-top: 4px; line-height: 1.4; }
html.desktop .step .rules { gap: 0; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
html.desktop .step .rule { gap: 14px; padding: 16px 0; align-items: center; }
html.desktop .step .rule + .rule { border-top: 1px solid var(--line); }
html.desktop .step .rule .headline { font-size: 15px; font-weight: 600; }
html.desktop .step .rule .sub { font-size: 13px; line-height: 1.4; margin-top: 4px; }
html.desktop .step .check-row { font-size: 14px; min-height: 44px; margin-top: 16px; line-height: 1.45; border-radius: 10px; }
html.desktop .step .check-row.terms-row { margin-top: 2px; }
html.desktop .step .terms-toggle { min-height: 44px; font-size: 14px; border-radius: 10px; }
html.desktop .step .checkbox { width: 24px; height: 24px; border-radius: 8px; }
html.desktop .step .rules-legal { font-size: 12px; margin-top: 10px; line-height: 1.5; }
html.desktop .step .check-row:hover .checkbox, html.desktop .step .terms-toggle:hover .checkbox { border-color: var(--text); }
html.desktop .home .pick-link { flex-direction: row; align-items: center; width: auto; min-width: 250px; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); text-align: left; }
html.desktop .home .pick-link .pick-circle { flex: none; width: 44px; height: 44px; border-radius: 13px; font-size: 22px; }
html.desktop .home .pick-copy { display: flex; flex: 1; flex-direction: column; gap: 4px; }
html.desktop .home .pick-link .pick-name { max-width: none; font-size: 14px; font-weight: 600; }
html.desktop .home .pick-link .pick-note { margin-top: 0; font-size: 12px; color: var(--text-2); }
html.desktop .home .pick-link > .i { width: 12px; height: 12px; color: var(--text-2); }
html.desktop .home .pick-link:hover { background: var(--surface-raised); }
html.desktop .home .pick:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  html.desktop .onboarding *, html.desktop .home .pick { transition: none !important; }
}

/* Dieselbe schwebende Tab-Leiste bleibt unten. Der Inhalt hat eine eigene Scrollfläche. */
html.desktop .screen.main.desk { height: 100dvh; padding: 28px 24px 96px; }
html.desktop .desk-content { position: relative; flex: 1; width: 100%; max-width: 1180px; min-width: 0; min-height: 0; margin: 0 auto; }
html.desktop .desk-page { position: absolute; inset: 0; }
html.desktop .desk-layout-switch { position: fixed; right: 24px; bottom: 22px; z-index: 31; }
html.desktop .desk-page > .tab-page,
html.desktop .desk-page > .page { padding: 0 max(20px, calc(50% - 320px)) 24px; }

/* Start wie mobil: breite Kacheln oben, Freunde und Einladen darunter. */
html.desktop .desk-content:has(> .desk-page > .home) { max-width: none; }
html.desktop .home {
  inset: 0; width: 100%; margin: 0 auto; padding: 0 20px;
  display: flex; flex-direction: column; gap: 16px; overflow-y: auto;
}
html.desktop .home > :not(.home-header) { width: 100%; max-width: 1140px; margin-inline: auto; }
html.desktop .home > .hero { flex: 1 0 240px; min-height: 240px; }
html.desktop .home .pick-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
html.desktop .home .pick { flex-shrink: 0; }

/* Nachrichten: ein zusammenhängender Bereich. Ohne Chats gibt es nur einen Leerzustand. */
html.desktop .desk-split {
  position: absolute; inset: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr);
  max-width: 1120px; max-height: 760px; margin: auto;
  border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden;
}
html.desktop .desk-split.solo { max-width: 720px; grid-template-columns: minmax(0, 1fr); }
html.desktop .desk-list,
html.desktop .desk-detail { position: relative; min-width: 0; min-height: 0; }
html.desktop .desk-split:not(.solo) > .desk-list { border-right: 1px solid var(--line); }
html.desktop .desk-list > .tab-page { display: flex; flex-direction: column; padding: 16px 0 24px; }
html.desktop .desk-list > .tab-page > * { flex-shrink: 0; }
html.desktop .desk-list .empty { flex: 1; justify-content: center; min-height: 220px; }
html.desktop .desk-list .empty .sub { max-width: 320px; }
html.desktop .desk-list .empty .btn { margin-top: 16px; }
html.desktop .desk-list .conv-row.active { background: var(--surface); }
html.desktop .desk-detail .chat-page { min-width: 0; min-height: 0; }
html.desktop .desk-detail .chat-nav { padding-top: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
html.desktop .desk-detail .chat-input { padding-top: 12px; padding-bottom: 16px; border-top: 1px solid var(--line); }
html.desktop .desk-empty { position: absolute; inset: 0; justify-content: center; }
html.desktop .desk-empty .sub { max-width: 300px; }
html.desktop .desk-empty .btn { margin-top: 12px; }

/* Lobby: unveränderte Kacheln, Einladung und Einstellungen in zwei Spalten. */
html.desktop .screen.lobby { width: 100%; max-width: 1120px; margin: 0 auto; height: 100dvh; padding: 28px 24px 32px; }
html.desktop .lobby-top { padding: 0; margin-bottom: 24px; }
html.desktop .lobby-scroll { position: relative; padding: 0 0 16px calc(56% + 32px); }
html.desktop .lobby-tiles,
html.desktop .lobby-tiles.ready { position: absolute; left: 0; top: 0; width: 56%; height: min(100%, 560px); }
html.desktop .lobby-bottom { padding: 12px 0 0 calc(56% + 32px); }

/* Call: dieselben vier Kacheln, Overlays, Chat und Steuerelemente wie am Handy. */
html.desktop .call { max-width: 1180px; }
html.desktop .call .composer { max-width: 560px; margin: 0 auto; background: transparent; }
html.desktop .call .chat-overlay { max-width: 536px; }
html.desktop .call .call-hint { max-width: 520px; margin: 0 auto; }

/* Auch Einblendungen behalten ihre mobilen Komponenten. Nur die Lage ändert sich. */
html.desktop .sheet-backdrop { align-items: center; padding: 24px; }
html.desktop .sheet { max-height: min(86dvh, 820px); }
html.desktop .sheet.large { height: min(86dvh, 820px); }
html.desktop .sheet-backdrop.full { padding: 0; }
html.desktop .sheet-backdrop.action { align-items: center; }
html.desktop .action-sheet { width: 380px; }
html.desktop .invite-banner { left: auto; right: 24px; top: 24px; width: 380px; }
html.desktop .offline-banner { top: 16px; }

/* Einladen: Hintergrund beruhigen; Titel wie „Partner einladen“ auf der Kachel. */
html.desktop .sheet-backdrop[data-sheet-kind="invite"] {
  background: rgba(0, 0, 0, .64);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
html.desktop .sheet-backdrop[data-sheet-kind="invite"] .sheet { font-family: var(--font); }
html.desktop .sheet-backdrop[data-sheet-kind="invite"] :is(.headline, .group-header) {
  font-size: 16px; font-weight: 600; line-height: 1.3;
}
html.desktop .sheet-backdrop[data-sheet-kind="invite"] .caption {
  font-size: 14px; font-weight: 500; line-height: 1.4;
}
html.desktop .sheet-backdrop[data-sheet-kind="invite"] .list-row.muted {
  font-size: 16px; font-weight: 500; line-height: 1.4;
}

@media (max-height: 680px) {
  html.desktop .screen.main.desk { padding-top: 16px; padding-bottom: 82px; }
  html.desktop .home { gap: 12px; }
  html.desktop .home > .hero { flex-basis: 200px; min-height: 200px; }
  html.desktop .screen.lobby { padding-top: 16px; padding-bottom: 16px; }
  html.desktop .lobby-top { margin-bottom: 16px; }
}

/* Bestehender Umschalter im iPhone-Rahmen. */
.layout-pill { display: none; }
@media (min-width: 960px) and (min-height: 560px) {
  html.framed .layout-pill {
    position: fixed; top: 20px; right: 20px; z-index: 400; height: 40px; padding: 0 16px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 8px; background: #1c1c1e; color: #fff; font: 600 14px var(--font);
    box-shadow: inset 0 0 0 .5px rgba(255,255,255,.12);
  }
  html.framed .layout-pill:hover { background: #2a2a2c; }
  html.framed .layout-pill .i { font-size: 17px; }
}
