/* FaLe One – "Tinte & Lesezeichen" (network/BRAND.md). Tokens: css/fale-tokens.css (synced copy).
   Phone first (360–430 px), desktop from 900 px with a sidebar. No inline styles anywhere (CSP style-src 'self'). */
@font-face { font-family: "Bricolage Grotesque"; src: url("../vendor/fonts/BricolageGrotesque-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }

:root { --one-sky: #2F6BE0; --one-deep: #1A2A86; --bar-h: 56px; --bnav-h: 64px; --side-w: 252px; --safe-b: env(safe-area-inset-bottom, 0px); }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.viewer-open { overflow: hidden; }
img { max-width: 100%; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 10px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.pad { padding: 16px; }
.lead { margin: 4px 0 16px; max-width: var(--measure); }
.mono { font-family: var(--font-mono); }
h1, h2, h3 { margin: 0; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-filled { fill: currentColor; }
.ic.big { width: 48px; height: 48px; stroke-width: 1.4; }

/* ---------------------------------------------------------------- splash / fatal */
.splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; }
.splash-name, .brand-name { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-size: 22px; margin: 0; white-space: nowrap; }
.brand-name b { color: var(--primary); }
.fatal { padding: 40px 20px; text-align: center; }

/* ---------------------------------------------------------------- buttons, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 6px 18px; border-radius: var(--radius-pill); border: 1px solid transparent; font-weight: 600; line-height: 1.25; text-align: center; text-decoration: none; background: var(--surface-2); color: var(--text); transition: transform var(--dur-1) var(--ease-spring), background var(--dur-2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-strong); }
.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.danger-solid { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn.danger-solid { color: #1a0a10; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger-solid { color: #1a0a10; } }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn .ic { width: 18px; height: 18px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--text); text-decoration: none; flex: none; position: relative; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.danger { color: var(--danger); }
.icon-btn:disabled { opacity: 0.4; }
.link-btn { border: 0; background: none; color: var(--primary); padding: 4px 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.field { display: grid; gap: 6px; margin: 12px 0; }
.field-label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
textarea.input { min-height: 88px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input.code { font-size: 24px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 52px; }
.pw-eye { position: absolute; right: 6px; top: 6px; }
.pw-meter { min-height: 1.2em; margin: -4px 0 0; font-size: 13px; color: var(--text-2); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--surface-2); }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: var(--radius-pill); font-weight: 600; min-height: 36px; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.form-error { color: var(--danger); font-weight: 600; margin: 8px 0; }
.hint { color: var(--text-2); font-size: 14px; margin: 8px 0; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; max-width: 100%; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .ic { width: 16px; height: 16px; }
.status-chip[data-kind="ok"] .ic { color: var(--accent); }
.status-chip[data-kind="warn"] .ic, .status-chip[data-kind="off"] .ic { color: var(--warn); }
.status-chip[data-kind="busy"] .ic { color: var(--primary); }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface-2); margin: 12px 0; }
.callout p { margin: 0; }
.callout.warn { background: var(--warn-soft); color: var(--text); }
.callout.warn .ic { color: var(--warn); }

/* ---------------------------------------------------------------- shell */
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 10px 14px; background: var(--surface); border-radius: 10px; }
.skip:focus { left: 8px; }
.app { min-height: 100vh; }
.side { display: none; }
.col { min-width: 0; padding-bottom: calc(var(--bnav-h) + var(--safe-b)); }
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; height: var(--bar-h); padding: 0 6px 0 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.bar-brand .brand-name { font-size: 19px; }
.bar-title { display: none; font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-spacer { flex: 1; }
.status-chip { display: none; }
.badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 14px; }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; flex: none; }
.main { padding: 0 16px 96px; outline: none; max-width: 1400px; }
.bnav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; height: calc(var(--bnav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--surface); border-top: 1px solid var(--border); }
.bnav-item { flex: 1; display: grid; place-items: center; align-content: center; gap: 2px; color: var(--text-2); text-decoration: none; font-size: 12px; font-weight: 600; position: relative; }
.bnav-item.on { color: var(--primary); }
.bnav-item.on::before { content: ""; position: absolute; top: 0; width: 22px; height: 12px; background: var(--ribbon); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 70%, 0 100%); }
.bnav-item .ic { width: 24px; height: 24px; }
.app[data-section="einstellungen"] .bnav-item.on::before, .app[data-section="suche"] .bnav-item::before { display: none; }

@media (min-width: 900px) { .status-chip { display: inline-flex; } }
.status-chip.show { display: inline-flex; }
@media (min-width: 900px) {
  body { background: var(--frame); }
  .app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; height: 100vh; padding: 18px 14px; overflow-y: auto; }
  .side .brand { padding: 4px 8px 12px; }
  .side-nav { display: grid; gap: 2px; }
  .nav-link, .sub-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--text-2); text-decoration: none; font-weight: 600; }
  .nav-link:hover, .sub-link:hover { background: var(--surface-2); color: var(--text); }
  .nav-link.on, .sub-link.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
  .nav-link.on::before, .sub-link.on::before { content: ""; position: absolute; left: -14px; top: 10px; width: 10px; height: 24px; background: var(--ribbon); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); transform: rotate(-90deg) translateY(-2px); }
  .side-sub { display: grid; gap: 2px; margin: 0 0 8px 18px; }
  .sub-link { min-height: 38px; font-size: 14px; }
  .side-quota { margin-top: auto; padding: 12px; border-radius: var(--radius-md); background: var(--surface); }
  .side-foot { display: flex; gap: 8px; font-size: 12px; color: var(--text-3); margin: 0; padding: 0 8px; }
  .side-foot .ic { width: 16px; height: 16px; }
  .col { padding: 12px 12px 12px 0; }
  .col > .bar, .col > .main, .col > .notices { background: var(--surface); }
  .col { display: flex; flex-direction: column; }
  .bar { border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 0 12px 0 24px; height: 64px; }
  .bar-brand { display: none; }
  .bar-title { display: block; }
  .main { flex: 1; padding: 8px 28px 40px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); max-width: none; min-height: calc(100vh - 100px); }
  .notices { padding: 0 28px; }
  .bnav { display: none; }
  .col { padding-bottom: 12px; }
}

/* ---------------------------------------------------------------- notices, status, quota */
.notices:empty { display: none; }
.notices { padding: 0 16px; display: grid; gap: 8px; }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; border-radius: var(--radius-md); background: var(--surface-2); font-size: 14px; }
.notice p { margin: 0; flex: 1; }
.notice.warn { background: var(--warn-soft); }
.notice.warn > .ic { color: var(--warn); }
.notice.info > .ic { color: var(--primary); }
.notice.off { background: var(--surface-3); }
.quota { display: grid; gap: 6px; }
.quota-text { font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.qbar { display: block; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.qbar-fill { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--primary); transition: width var(--dur-3) var(--ease-out); }
.qbar.warn .qbar-fill { background: var(--warn); }
.qbar.full .qbar-fill { background: var(--danger); }
.status-card { position: relative; overflow: hidden; margin: 8px 0 12px; padding: 16px; border-radius: var(--radius-lg); background: var(--ink-grad); color: var(--ink-text); box-shadow: var(--shadow-md); }
.sc-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sc-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, 0.12); flex: none; }
.sc-ic.ok { color: var(--ribbon); }
.sc-ic.warn, .sc-ic.off { color: #F5C04A; }
.sc-text { display: grid; flex: 1; min-width: 180px; }
.sc-text strong { font-family: var(--font-display); font-size: 18px; letter-spacing: -0.02em; }
.status-card .muted { color: var(--ink-text-2); font-size: 13px; }
.sc-btn { background: #fff; color: var(--one-deep); }
.sc-btn:hover { background: #EDEBFF; }
.sc-quota { margin-top: 12px; }
.status-card .quota-text { color: var(--ink-text-2); }
.status-card .qbar { background: rgba(255, 255, 255, 0.18); }
.status-card .qbar-fill { background: var(--ribbon); }
.status-card .qbar.warn .qbar-fill { background: #F5C04A; }
.status-card .qbar.full .qbar-fill { background: #FF8397; }

/* ---------------------------------------------------------------- view head, subnav, lists */
.view { padding-top: 8px; min-width: 0; }
.view-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; min-height: 44px; }
.view-title { font-family: var(--font-display); font-size: 24px; letter-spacing: -0.025em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 419px) { .view-tools [data-count] { display: none; } .view-tools .icon-btn { width: 40px; } }
.view-tools { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.view-tools .muted { font-size: 13px; padding-left: 8px; white-space: nowrap; }
.subnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 4px -16px 8px; padding: 2px 16px; }
.subnav::-webkit-scrollbar { display: none; }
.subnav-item { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.subnav-item.on { background: var(--primary); color: var(--on-primary); }
@media (min-width: 900px) { .subnav { display: none; } .drive-top .subnav { display: none; } }
.drive-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.home-status { display: flex; align-items: center; gap: 12px; padding: 10px 0 2px; }
.home-status .chip { flex: 0 1 auto; min-width: 0; }
.home-status .quota { flex: 1 1 120px; min-width: 110px; }
@media (min-width: 900px) { .home-status { display: none; } }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; flex: 1 1 auto; font-weight: 600; }
.drive .view-tools, .trash .view-tools { flex: 0 0 auto; }
.crumb { color: var(--text-2); text-decoration: none; padding: 6px 6px; border-radius: 8px; border: 0; background: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb:last-child, .crumb[aria-current="page"] { color: var(--text); }
.crumb:hover { background: var(--surface-2); }
.crumbs .sep { width: 14px; height: 14px; color: var(--text-3); }
.drive .crumbs { font-size: 17px; }
.items.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.row { display: flex; align-items: center; gap: 4px; min-height: 60px; padding: 0 4px 0 0; border-radius: var(--radius-md); position: relative; text-decoration: none; color: inherit; }
.row:hover { background: var(--surface-2); }
.row.sel, .tile.sel { background: var(--primary-soft); }
.row-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 8px; border: 0; background: none; text-align: left; border-radius: var(--radius-md); color: inherit; }
.row-text { display: grid; min-width: 0; flex: 1; }
.row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-badges { display: inline-flex; gap: 4px; color: var(--accent); }
.badge-ic .ic { width: 16px; height: 16px; }
.row-check { display: none; }
.row.sel .row-check, .tile.sel .row-check { display: grid; place-items: center; width: 24px; height: 24px; margin-left: 6px; border-radius: 50%; background: var(--primary); color: var(--on-primary); flex: none; }
.row-check .ic { width: 14px; height: 14px; stroke-width: 3; }
.thumb { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); flex: none; overflow: hidden; }
.thumb img, .tile-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.k-folder { color: var(--primary); background: var(--primary-soft); }
.k-pdf { color: var(--danger); }
.k-image, .k-video { color: var(--accent); }
.items.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; display: grid; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.tile .row-open { flex-direction: column; align-items: stretch; padding: 0; gap: 0; }
.tile-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--surface-2); color: var(--text-2); overflow: hidden; }
.tile-thumb .ic { width: 40px; height: 40px; stroke-width: 1.4; }
.tile .row-text { padding: 8px 10px 10px; }
.tile .row-more { position: absolute; top: 4px; right: 4px; background: color-mix(in srgb, var(--surface) 85%, transparent); }
.tile .row-badges { position: absolute; left: 8px; top: 8px; }
.tile .row-check { position: absolute; z-index: 1; }
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 48px 16px; color: var(--text-2); }
.empty h3 { color: var(--text); font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em; }
.empty p { margin: 0; max-width: 46ch; }
.empty-ic { width: 56px; height: 56px; stroke-width: 1.3; color: var(--primary); }
.section-title { font-size: 15px; margin: 16px 0 6px; color: var(--text-2); }

/* selection bar + FAB */
.selbar { position: fixed; z-index: 35; left: 8px; right: 8px; bottom: calc(var(--bnav-h) + var(--safe-b) + 8px); display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.sel-count { font-weight: 700; padding: 0 6px; white-space: nowrap; }
.selbar .btn span { display: none; }
@media (min-width: 560px) { .selbar .btn span { display: inline; } }
@media (min-width: 900px) { .selbar { left: calc(var(--side-w) + 40px); right: 40px; bottom: 24px; } }
.fab { position: fixed; z-index: 25; right: 16px; bottom: calc(var(--bnav-h) + var(--safe-b) + 16px); display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 20px; background: var(--ink-grad); color: #fff; font-weight: 700; box-shadow: var(--shadow-lg); transition: transform var(--dur-1) var(--ease-spring); }
.fab:active { transform: scale(0.96); }
.fab .ic { width: 22px; height: 22px; }
body.has-selbar .fab { display: none; }
@media (min-width: 900px) { .fab { display: none; } }
.new-btn { display: none; }
@media (min-width: 900px) { .new-btn { display: inline-flex; } }
.dropzone { position: fixed; z-index: 60; inset: 12px; display: grid; place-content: center; justify-items: center; gap: 8px; border: 3px dashed var(--primary); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--primary-soft) 85%, transparent); color: var(--primary); font-weight: 700; font-size: 18px; pointer-events: none; }
.dropzone .ic { width: 48px; height: 48px; }

/* ---------------------------------------------------------------- justified photo grid */
.jgrid { position: relative; width: 100%; contain: layout; margin-bottom: 40px; }
.jg-tile, .jg-head { position: absolute; left: 0; top: 0; will-change: transform; }
.jg-head { width: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 2px 8px; }
.jg-month { font-family: var(--font-display); font-size: 22px; letter-spacing: -0.025em; }
.jg-day { font-size: 14px; font-weight: 600; color: var(--text-2); }
.jg-head.month .jg-day { margin-top: 4px; }
.jg-tile { padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--surface-2); color: var(--text-3); }
.jg-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jg-ph { position: absolute; inset: 0; display: grid; place-items: center; }
.jg-tile.loaded .jg-ph { display: none; }
.jg-badge { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px 2px 4px; border-radius: 10px; background: rgba(10, 8, 30, 0.6); color: #fff; font-size: 11px; font-weight: 700; }
.jg-badge .ic { width: 12px; height: 12px; fill: #fff; stroke: none; }
.jg-fav { position: absolute; left: 6px; bottom: 6px; color: var(--marker); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.jg-fav .ic { width: 16px; height: 16px; }
.jg-check { position: absolute; top: 6px; left: 6px; display: none; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(10, 8, 30, 0.25); color: transparent; }
.jg-check .ic { width: 14px; height: 14px; stroke-width: 3; }
.jgrid.selecting .jg-check { display: grid; }
.jg-tile.sel { outline: 3px solid var(--primary); outline-offset: -3px; }
.jg-tile.sel img { transform: scale(0.9); border-radius: 6px; }
.jg-tile.sel .jg-check { background: var(--primary); border-color: var(--primary); color: #fff; }
@media (hover: hover) { .jg-tile:hover .jg-check { display: grid; } }
.pick-photos { max-height: 60vh; overflow-y: auto; margin-top: 8px; }

/* albums, duplicates */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.album-card { display: grid; gap: 4px; text-decoration: none; color: inherit; }
.album-cover { display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); color: var(--text-3); box-shadow: var(--paper-shadow); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-card .muted { font-size: 13px; }
.dup-sum { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface-2); margin-bottom: 12px; font-weight: 600; }
.dup-group { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; justify-items: start; }
.dup-items { display: grid; gap: 6px; width: 100%; }
.dup-item { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; border: 0; background: none; text-align: left; padding: 4px; border-radius: 12px; }
.dup-item:hover { background: var(--surface-2); }
.dup-thumb { grid-row: span 2; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.dup-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dup-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup-item .muted { font-size: 13px; }

/* search */
.search-box { position: relative; display: flex; align-items: center; }
.search-box > .ic { position: absolute; left: 14px; color: var(--text-3); }
.search-input { padding-left: 44px; border-radius: var(--radius-pill); font-size: 16px; }
.search .muted.small { display: flex; align-items: center; gap: 6px; margin: 8px 4px; }
.search .muted.small .ic { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- dialogs & sheets */
.dlg { border: 0; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; }
.dlg:not([open]) { display: none; }
.dlg::backdrop { background: rgba(9, 8, 26, 0.5); }
.dlg.wide { width: min(900px, calc(100vw - 24px)); }
.dlg-head { display: flex; align-items: center; gap: 8px; padding: 16px 12px 4px 22px; }
.dlg-title { flex: 1; font-family: var(--font-display); font-size: 21px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.dlg-body { padding: 4px 22px 8px; overflow-y: auto; }
.dlg-text { margin: 8px 0; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 22px 20px; }
.dlg.sheet { margin: auto auto 0; width: 100%; max-width: 560px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: var(--safe-b); animation: sheet-in var(--dur-3) var(--ease-out); }
@media (min-width: 640px) { .dlg.sheet { margin: auto; border-radius: var(--radius-lg); } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-sub { margin: 0 0 8px; color: var(--text-2); font-size: 14px; }
.menu { display: grid; padding-bottom: 8px; }
.menu-item { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 10px; border: 0; background: none; border-radius: 14px; text-align: left; font-weight: 600; }
.menu-item:hover { background: var(--surface-2); }
.menu-item span:not(.menu-hint) { flex: 1; }
.menu-item.danger { color: var(--danger); }
.menu-hint { color: var(--text-3); font-size: 13px; font-weight: 500; }
.dlg.actions .dlg-actions { display: none; }
.picker-list { display: grid; gap: 2px; max-height: 46vh; overflow-y: auto; margin: 8px 0; }
.picker-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border: 0; background: none; border-radius: 12px; text-align: left; font-weight: 600; }
.picker-item:hover { background: var(--surface-2); }
.picker-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .ic:first-child { color: var(--primary); }
.picker-item .go { color: var(--text-3); }
.picker-crumbs { font-size: 14px; }
.versions { display: grid; gap: 6px; }
.version { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-2); }
.version.head { background: var(--accent-soft); }
.version-info { display: grid; flex: 1; min-width: 160px; }
.version-info .muted { font-size: 13px; }
.version-acts { display: flex; gap: 4px; align-items: center; }
.share-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.share-list li { display: flex; gap: 8px; align-items: center; }
.share-list li span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* uploads */
.jobs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; max-height: 56vh; overflow-y: auto; }
.jobs-sum { margin: 4px 0 10px; font-weight: 600; }
.job { display: flex; align-items: center; gap: 10px; padding: 8px 4px 8px 8px; border-radius: 14px; }
.job:hover { background: var(--surface-2); }
.job-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--primary); flex: none; }
.job[data-state="done"] .job-ic, .job[data-state="skipped"] .job-ic { color: var(--accent); }
.job[data-state="error"] .job-ic { color: var(--warn); }
.job-main { display: grid; gap: 4px; flex: 1; min-width: 0; }
.job-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.job-btns { display: flex; align-items: center; }
.job-ok { color: var(--accent); display: grid; place-items: center; width: 36px; }
.pbar { display: block; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.pbar-fill { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 3px; transition: width var(--dur-2) linear; }
.job[data-state="done"] .pbar-fill, .job[data-state="skipped"] .pbar-fill { background: var(--accent); }

/* toasts */
.toasts { position: fixed; z-index: 1000; left: 12px; right: 12px; bottom: calc(var(--bnav-h) + var(--safe-b) + 12px); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
@media (min-width: 900px) { .toasts { left: auto; right: 24px; bottom: 24px; justify-items: end; width: 420px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 8px; max-width: 520px; width: 100%; padding: 10px 8px 10px 16px; border-radius: var(--radius-md); background: #1B1A3A; color: #F3F2FF; box-shadow: var(--shadow-lg); animation: toast-in var(--dur-3) var(--ease-spring); font-size: 14px; }
.toast.error { background: #5A1426; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all var(--dur-2); }
.toast-msg { flex: 1; min-width: 0; }
.toast-act { border: 0; background: none; color: var(--ribbon); font-weight: 700; padding: 8px 10px; border-radius: 10px; white-space: nowrap; }
.toast-x { border: 0; background: none; color: inherit; opacity: 0.7; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.toast-prog { display: grid; gap: 6px; }
.toast .pbar { background: rgba(255, 255, 255, 0.2); }
.toast .pbar-fill { background: var(--ribbon); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- viewer */
.viewer { position: fixed; z-index: 200; inset: 0; display: flex; flex-direction: column; background: #07061A; color: #F3F2FF; outline: none; }
.vw-bar { display: flex; align-items: center; gap: 2px; min-height: 56px; padding: 0 6px; padding-top: env(safe-area-inset-top, 0px); background: linear-gradient(#07061A, rgba(7, 6, 26, 0.6)); z-index: 2; }
.vw-bar .icon-btn { color: #F3F2FF; }
.vw-bar .icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.vw-head { flex: 1; min-width: 0; display: grid; }
.vw-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-count { font-size: 12px; color: #B3B1D4; }
.vw-fav[aria-pressed="true"] { color: var(--marker); }
.vw-body { position: relative; flex: 1; min-height: 0; display: flex; }
.vw-stage { position: relative; flex: 1; min-width: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; user-select: none; }
.vw-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; transition: filter var(--dur-3); touch-action: none; }
.vw-img.blur { filter: blur(8px); }
.vw-video { max-width: 100%; max-height: 100%; background: #000; }
.vw-audio-box { display: grid; justify-items: center; gap: 12px; }
.vw-text { align-self: stretch; justify-self: stretch; margin: 0; padding: 16px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.55 var(--font-mono); background: #F7F7FB; color: #13122E; touch-action: pan-x pan-y; }
.vw-pdf { align-self: stretch; justify-self: stretch; overflow: auto; padding: 8px; display: grid; justify-items: center; align-content: start; gap: 8px; background: #2A2950; touch-action: pan-x pan-y pinch-zoom; }
.pdf-page { width: 100%; max-width: 1100px; display: grid; justify-items: center; }
.pdf-page canvas { background: #fff; box-shadow: var(--paper-shadow); max-width: 100%; }
.vw-loading { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(280px, 70vw); display: grid; gap: 6px; text-align: center; font-size: 13px; color: #CBC8F4; }
.vw-loading .pbar { background: rgba(255, 255, 255, 0.15); }
.vw-loading .pbar-fill { background: var(--ribbon); }
.vw-none { display: grid; justify-items: center; gap: 10px; padding: 24px; text-align: center; max-width: 440px; }
.vw-none .muted { color: #B3B1D4; }
.vw-none-name { font-weight: 700; overflow-wrap: anywhere; }
.vw-none .btn.ghost { color: #F3F2FF; border-color: rgba(255, 255, 255, 0.3); }
.vw-orig { position: absolute; right: 12px; bottom: 12px; background: rgba(7, 6, 26, 0.7); color: #F3F2FF; border-color: rgba(255, 255, 255, 0.3); }
.vw-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: none; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.1); color: #fff; }
.vw-nav.prev { left: 12px; } .vw-nav.next { right: 12px; }
@media (hover: hover) and (min-width: 700px) { .vw-nav { display: grid; } .vw-nav[hidden] { display: none; } }
.vw-info { width: min(360px, 100%); flex: none; overflow-y: auto; padding: 16px 20px; background: var(--surface); color: var(--text); }
@media (max-width: 699px) { .vw-info { position: absolute; left: 0; right: 0; bottom: 0; max-height: 62%; width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; z-index: 3; box-shadow: var(--shadow-lg); } }
.vw-info h3 { font-family: var(--font-display); font-size: 19px; margin-bottom: 8px; }
.kvs { margin: 0 0 12px; display: grid; gap: 8px; }
.kv { display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: 10px; }
.kv dt { color: var(--text-2); font-size: 13px; }
.kv dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; }
.kvs.compact { margin-top: 12px; }
.vw-info .muted.small { display: flex; gap: 6px; align-items: flex-start; }
.vw-info .muted.small .ic { width: 14px; height: 14px; margin-top: 3px; }

/* ---------------------------------------------------------------- onboarding gate */
.gate { min-height: 100vh; display: grid; align-content: center; justify-items: center; gap: 18px; padding: 32px 16px calc(32px + var(--safe-b)); background: var(--bg); }
.gate-brand { display: flex; align-items: center; gap: 12px; }
.gate-brand .brand-name { font-size: 28px; }
.gate-card { width: min(460px, 100%); padding: 24px 22px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.gate-title { font-family: var(--font-display); font-size: 26px; letter-spacing: -0.03em; line-height: 1.12; margin-bottom: 10px; }
.gate-lead { color: var(--text-2); margin: 0 0 16px; }
.gate-points { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.gate-points li { display: flex; gap: 10px; align-items: flex-start; }
.gate-points li .ic { color: var(--accent); margin-top: 2px; }
.gate-points.small { font-size: 14px; color: var(--text-2); }
.gate-points.small li::before { content: "•"; color: var(--accent); }
.gate-card .btn.block + .btn.block, .gate-card .btn.block + .hint { margin-top: 10px; }
.gate-form { display: grid; }
.gate-form .btn { margin-top: 8px; }
.gate-foot { font-size: 13px; color: var(--text-3); }
.gate-foot a { color: var(--text-2); }
.rk { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0; padding: 14px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px dashed var(--border-strong); font: 600 15px/1.4 var(--font-mono); letter-spacing: 0.06em; text-align: center; user-select: all; }
@media (max-width: 380px) { .rk { grid-template-columns: repeat(3, 1fr); font-size: 14px; } }

/* ---------------------------------------------------------------- settings */
.settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 760px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.set-sec { padding: 18px 18px 14px; }
.set-title { font-family: var(--font-display); font-size: 19px; letter-spacing: -0.02em; margin-bottom: 10px; }
.set-sub { font-size: 15px; margin: 14px 0 4px; }
.set-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.kv-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.kv-row > div { display: grid; min-width: 0; }
.kv-row strong { overflow-wrap: anywhere; }
.dev-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.dev-row .ic { color: var(--accent); }
.dev-row.stale .ic { color: var(--warn); }
.dev-text { flex: 1; display: grid; min-width: 0; }
.dev-text .muted { font-size: 13px; }
.plain { margin: 4px 0 8px; padding-left: 20px; }
.plain li { margin: 3px 0; }
@media (min-width: 900px) { .settings .card { box-shadow: none; } }

/* ---------------------------------------------------------------- Notfallzugang */
.notfall { max-width: 760px; }
.em-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.em-card { display: flex; align-items: center; gap: 12px; margin: 8px 0 10px; padding: 12px 10px 12px 12px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; min-height: 56px; }
.em-card:hover { background: var(--surface-2); }
.em-card.todo { border-color: var(--warn); }
.em-card-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); flex: none; }
.em-card.todo .em-card-ic { background: var(--warn-soft); color: var(--warn); }
.em-card-text { display: grid; flex: 1; min-width: 0; }
.em-card-text span { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-card > .ic:last-child { color: var(--text-3); }
.em-others { margin: 0; }
.notice.urgent { background: var(--danger-soft); flex-wrap: wrap; }
.notice.urgent > .ic { color: var(--danger); }
.notice-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.em-hero { padding: 22px 20px; display: grid; justify-items: start; gap: 6px; }
.em-hero-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.em-hero-ic .ic { width: 28px; height: 28px; }
.em-hero-ic.sm { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.em-hero-ic.sm .ic { width: 22px; height: 22px; }
.em-hero-title { font-family: var(--font-display); font-size: 24px; letter-spacing: -0.025em; margin: 6px 0 0; }
.em-hero p { margin: 0 0 6px; max-width: var(--measure); }
.em-hero .gate-points { margin: 6px 0 14px; }
.em-status { padding: 16px 18px; }
.em-status.todo .em-hero-ic { background: var(--warn-soft); color: var(--warn); }
.em-status-head { display: flex; gap: 12px; align-items: center; }
.em-status-head > div { min-width: 0; }
.em-status-title { font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em; margin: 0; overflow-wrap: anywhere; }
.em-status-head p { margin: 2px 0 0; }
.em-req { padding: 16px 18px; border-width: 2px; }
.em-req.urgent { border-color: var(--danger); background: var(--danger-soft); }
.em-req.warn { border-color: var(--warn); }
.em-req .set-title { display: flex; align-items: center; gap: 8px; }
.em-req .set-title .ic { color: var(--danger); }
.em-req.warn .set-title .ic { color: var(--warn); }
.em-list { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 6px; }
.em-list li { display: flex; gap: 8px; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.em-list .ic { color: var(--text-2); flex: none; }
.em-note { margin: 10px 0 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.em-contact { flex-wrap: wrap; }
.em-contact .dev-text strong { overflow-wrap: anywhere; }
.em-row-btns { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.em-contact[data-status="accepted"] > .ic { color: var(--primary); }
@media (max-width: 559px) { .em-contact .em-row-btns { width: 100%; padding-left: 36px; } }
.em-contact[data-status="invited"] > .ic { color: var(--text-3); }
.small { font-size: 13px; }
.em-log { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 2px; }
.em-log-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 14px; }
.em-log-item .ic { width: 18px; height: 18px; color: var(--text-3); grid-row: span 2; margin-top: 2px; }
.em-log-item.hl .ic { color: var(--warn); }
.em-log-item span { overflow-wrap: anywhere; }
.em-log-item time { font-size: 12px; }
.sas { margin: 12px 0; padding: 14px 10px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px dashed var(--border-strong); }
.sas-emoji { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 6px; text-align: center; }
@media (min-width: 520px) { .sas-emoji { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.sas-item { display: grid; justify-items: center; gap: 2px; min-width: 0; }
.sas-glyph { font-size: 34px; line-height: 1.15; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.sas-name { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.sas-digits { margin: 12px 0 0; text-align: center; font-size: 15px; }
.sas-digits strong { font-size: 20px; letter-spacing: 0.06em; white-space: nowrap; }
.em-msg { padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-2); user-select: all; overflow-wrap: anywhere; }
.em-choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 8px 0; border: 1px solid var(--border-strong); border-radius: var(--radius-md); cursor: pointer; }
.em-choice.on { border-color: var(--primary); background: var(--primary-soft); }
.em-choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.em-choice > span, .check > span { display: grid; gap: 2px; min-width: 0; }
.em-choice .muted, .check .muted { font-size: 13px; }
.em-sub { padding: 0 0 4px 14px; border-left: 2px solid var(--border); margin: 0 0 8px 10px; }
.em-checklist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; margin: -4px 0 4px 30px; }
@media (min-width: 560px) { .em-checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.check.sm { margin: 8px 0; }
.em-pick { border: 0; padding: 0; margin: 10px 0 0; min-width: 0; }
.em-pick legend { font-size: 14px; font-weight: 600; color: var(--text-2); padding: 0; }
.wiz-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 12px; counter-reset: s; }
.wiz-steps li { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; }
.wiz-steps li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz-steps li.on { background: var(--primary); color: var(--on-primary); }
.wiz-steps li.done { color: var(--accent); }
.wiz-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, currentColor 18%, transparent); flex: none; font-size: 12px; }
.wiz-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.wiz-nav .btn { min-width: 120px; }
.em-sum { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 8px; }
.em-sum li { display: flex; gap: 10px; align-items: flex-start; overflow-wrap: anywhere; }
.em-sum .ic { color: var(--accent); flex: none; margin-top: 2px; }
.em-waits button { min-width: 64px; }
.em-wait { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-md); background: var(--primary-soft); }
.em-wait p { margin: 0; }
.em-wait .ic { color: var(--primary); flex: none; margin-top: 2px; }
.em-other .link-btn { margin-top: 8px; color: var(--text-2); }
.ro-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 700; }
.ro-badge .ic { width: 14px; height: 14px; }
.em-browse .view-head .view-title { flex: 1; }
.em-letter { padding: 16px 18px; }
.em-letter .set-title { display: flex; gap: 8px; align-items: center; }
.em-img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: var(--radius-sm); }
.em-browse .row-open { text-decoration: none; color: inherit; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .jg-tile.sel { outline: 3px solid Highlight; } }
