:root {
  --bg: #0a0a0b;
  --side: #0d0d0f;
  --panel: #131315;
  --panel-solid: #151517;
  --raise: rgba(255, 255, 255, 0.035);
  --raise-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #ededef;
  --muted: #878991;
  --accent: #2f9bff;
  --accent-2: #6cc4ff;
  --accent-soft: rgba(47, 155, 255, 0.14);
  --danger: #f2566d;
  --grad: linear-gradient(180deg, #3ea6ff 0%, #1f86f2 100%);
  --radius: 12px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.3, 1.25, 0.6, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --titlebar: 0px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Inter", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

body.desktop { --titlebar: 44px; }
body.desktop .drag { -webkit-app-region: drag; }
body.desktop .drag button, body.desktop .drag input, body.desktop .drag label { -webkit-app-region: no-drag; }
/* Title-bar strip on the login and start screens. Besides moving the window it gives the page its own
   drag region, which replaces a stale window-wide one left over from the desktop splash screen. */
.window-drag { display: none; }
body.desktop .window-drag { display: block; position: absolute; top: 0; left: 0; right: 150px; height: 44px; -webkit-app-region: drag; }

/* ---------- background ---------- */

.backdrop {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(90vmax 55vmax at 78% -22%, rgba(47, 155, 255, 0.085), transparent 60%),
    radial-gradient(70vmax 50vmax at -10% 110%, rgba(47, 155, 255, 0.045), transparent 60%);
  animation: breathe 14s ease-in-out infinite alternate;
}
@keyframes breathe { from { opacity: 0.65; } to { opacity: 1; } }

/* user-chosen background: fill layers cross-fade, the dim layer keeps text readable */
.bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.bg-fill { position: absolute; inset: -2%; opacity: 0; transform: scale(1.05); transition: opacity 0.8s var(--ease), transform 1.4s var(--ease); }
.bg-fill.in { opacity: 1; transform: none; }
.bg-dim { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity 0.5s var(--ease); }
.backdrop { transition: opacity 0.6s; }
body.custom-bg .backdrop { opacity: 0 !important; animation: none; }

/* glass surfaces on top of a custom background */
body.custom-bg { --muted: #b3b6be; --line: rgba(255, 255, 255, 0.1); }
body.custom-bg .sidebar { background: rgba(10, 10, 12, 0.6); backdrop-filter: blur(26px) saturate(1.3); -webkit-backdrop-filter: blur(26px) saturate(1.3); }
body.custom-bg .topbar { background: rgba(10, 10, 12, 0.34); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
body.custom-bg .card, body.custom-bg .folder, body.custom-bg .storage, body.custom-bg .account,
body.custom-bg .empty .bubble, body.custom-bg .btn.ghost, body.custom-bg .search { background: rgba(16, 16, 19, 0.74); border-color: rgba(255, 255, 255, 0.1); }
body.custom-bg .card:hover, body.custom-bg .folder:hover, body.custom-bg .account:hover, body.custom-bg .btn.ghost:hover { background: rgba(28, 28, 33, 0.84); }
body.custom-bg .thumb { background: rgba(0, 0, 0, 0.45); }
body.custom-bg .crumbs, body.custom-bg .count, body.custom-bg .section-label, body.custom-bg .empty b, body.custom-bg .empty span {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 0, 0, 0.5);
}
body.custom-bg .banner { background: linear-gradient(90deg, rgba(20, 40, 70, 0.85), rgba(16, 16, 19, 0.8)); }

/* background editor */
.modal-back.see-through { background: rgba(0, 0, 0, 0.18); backdrop-filter: none; -webkit-backdrop-filter: none; }
.modal.bg-editor { width: min(560px, 100%); max-height: 88vh; }
.bg-scroll { display: grid; gap: 12px; overflow-y: auto; margin: 0 -6px; padding: 0 6px 4px; scrollbar-width: thin; }
.bg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bg-swatch { position: relative; aspect-ratio: 1.5; border-radius: 12px; overflow: hidden; display: flex; align-items: flex-end; padding: 6px 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); transition: transform 0.2s var(--spring), box-shadow 0.2s; animation: item-in 0.4s var(--ease) both; animation-delay: calc(var(--i) * 22ms); }
.bg-swatch span { font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }
.bg-swatch:hover { transform: translateY(-2px) scale(1.03); }
.bg-swatch.picked, .bg-dot.picked { box-shadow: 0 0 0 2px var(--panel-solid), 0 0 0 4px var(--accent); }
.bg-colors, .bg-own { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bg-dot { position: relative; width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); transition: transform 0.2s var(--spring), box-shadow 0.2s; animation: item-in 0.4s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
.bg-dot:hover { transform: scale(1.12); }
.bg-pick { display: grid; place-items: center; background: var(--raise-2); color: var(--muted); cursor: pointer; overflow: hidden; }
.bg-pick svg { width: 15px; height: 15px; pointer-events: none; }
.bg-pick input[type=color] { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); border: 0; padding: 0; background: none; cursor: pointer; }
.bg-pick:has(svg) input[type=color] { opacity: 0; }
.bg-angle { display: flex; align-items: center; gap: 8px; color: var(--muted); flex: 1; min-width: 160px; }
.bg-angle svg { width: 16px; height: 16px; }
.bg-angle input, .bg-dim-row input { flex: 1; accent-color: var(--accent); }
.bg-angle b, .bg-dim-row b { font-size: 12px; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.bg-dim-row { display: flex; align-items: center; gap: 10px; }
.bg-dim-row input:disabled { opacity: 0.4; }
.bg-note { margin: -4px 0 0; font-size: 12px; color: var(--muted); }
.bg-hint { margin: -4px 0 0; font-size: 12.5px; color: #3ecf8e; min-height: 18px; }
.bg-hint.warn { color: #f5b25b; }
.actions .spacer { flex: 1; }

/* ---------- shared controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 13px; white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.18s, box-shadow 0.18s, opacity 0.18s;
}
.btn:active { transform: scale(0.96); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 18px -10px rgba(47, 155, 255, 0.9); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 24px -10px rgba(47, 155, 255, 1); }
.btn.ghost { background: var(--raise); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--raise-2); }
.btn.danger { background: rgba(242, 86, 109, 0.14); color: #ff8795; border: 1px solid rgba(242, 86, 109, 0.3); }
.btn.danger:hover { background: rgba(242, 86, 109, 0.24); }
.btn.wide { width: 100%; height: 42px; font-size: 14px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--muted);
  transition: background 0.15s, color 0.15s, transform 0.15s var(--ease);
}
.icon-btn:hover { background: var(--raise-2); color: var(--text); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn.on { color: #ffd166; }
.icon-btn.on svg { fill: currentColor; }

.field { display: grid; gap: 6px; text-align: left; }
.field span { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .input {
  height: 42px; width: 100%; padding: 0 13px; border-radius: 9px; background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line); outline: none; user-select: text; -webkit-user-select: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 155, 255, 0.2); }
.form-error { min-height: 18px; margin: 0; color: #ff8795; font-size: 13px; }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--raise-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.logo { width: 34px; height: auto; flex: none; -webkit-user-drag: none; filter: drop-shadow(0 4px 12px rgba(47, 155, 255, 0.35)); }
.logo.big { width: 92px; margin: 0 auto 2px; filter: drop-shadow(0 12px 30px rgba(47, 155, 255, 0.4)); animation: logo-in 0.9s var(--ease) both; }
@keyframes logo-in { from { opacity: 0; transform: translateY(10px) scale(0.9); } }
@keyframes float { 50% { transform: translateY(-6px); } }

/* ---------- boot + auth ---------- */

/* boot: logo with a drawing ring, wordmark and an indeterminate bar */
.boot { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; z-index: 5; }
.boot-mark { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.boot-glow { position: absolute; inset: 10px; border-radius: 50%; background: radial-gradient(circle, rgba(47, 155, 255, 0.35), transparent 70%); animation: boot-breathe 2.4s ease-in-out infinite; }
.boot-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.boot-ring circle { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 352; stroke-dashoffset: 352; opacity: 0.85; animation: boot-ring 1.6s var(--ease) 0.15s forwards, boot-spin 1.8s linear 1.7s infinite; transform-origin: 60px 60px; }
.boot-logo { position: relative; width: 84px; filter: drop-shadow(0 12px 30px rgba(47, 155, 255, 0.45)); animation: boot-logo 0.9s var(--spring) both; }
.boot-word { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; animation: boot-up 0.8s var(--ease) 0.25s both; }
.boot-word span { font-weight: 400; color: var(--accent-2); }
.boot-bar { width: 150px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; animation: boot-up 0.8s var(--ease) 0.4s both; }
.boot-bar i { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--accent); animation: boot-slide 1.2s ease-in-out infinite; }
.boot-status { font-size: 13px; color: var(--muted); min-height: 18px; animation: boot-up 0.8s var(--ease) 0.5s both; }
.boot.offline .boot-bar i { background: var(--danger); animation-duration: 2.4s; }
@keyframes boot-logo { from { opacity: 0; transform: scale(0.6) rotate(-12deg); } }
@keyframes boot-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes boot-ring { to { stroke-dashoffset: 90; } }
@keyframes boot-spin { to { transform: rotate(360deg); } }
@keyframes boot-breathe { 50% { transform: scale(1.12); opacity: 0.6; } }
@keyframes boot-slide { from { transform: translateX(-110%); } to { transform: translateX(260%); } }

/* screen transitions */
.boot.leaving { animation: screen-out-zoom 0.42s var(--ease) forwards; }
.auth.leaving, .app.leaving { animation: screen-out 0.4s var(--ease) forwards; pointer-events: none; }
.auth.entering { animation: screen-in 0.6s var(--ease) both; }
.app.entering { animation: app-in 0.7s var(--ease) both; }
@keyframes screen-out-zoom { to { opacity: 0; transform: scale(1.12); filter: blur(8px); } }
@keyframes screen-out { to { opacity: 0; transform: scale(0.97); filter: blur(6px); } }
@keyframes screen-in { from { opacity: 0; transform: scale(1.03); filter: blur(6px); } }
@keyframes app-in { from { opacity: 0; transform: scale(0.985); filter: blur(4px); } }

.auth { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; padding: 24px; overflow-y: auto; }
.auth-card {
  width: min(380px, 100%); display: grid; gap: 14px; text-align: center; padding: 36px 30px 30px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 40px 90px -30px #000;
  animation: rise 0.7s var(--ease) both;
}
.auth-card h1 { margin: 6px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.auth-card h1 span { font-weight: 400; color: var(--accent-2); }
.auth-foot { margin: 18px 0 0; font-size: 12px; color: #5d5f66; text-align: center; animation: fade 1s 0.3s both; }
.auth-card p { margin: 0; }
.auth-card.shake, .modal.shake { animation: shake 0.42s; }
.auth-hint { min-height: 40px; font-size: 13px; }
.auth-form { display: grid; gap: 12px; }

/* segmented control with a sliding pill */
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); margin-top: 4px; }
.seg button { position: relative; z-index: 1; height: 32px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); transition: color 0.25s; }
.seg button.on { color: var(--text); }
.seg-pill { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 7px; background: var(--raise-2); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 4px 14px -6px #000; transition: transform 0.38s var(--spring); }
.seg[data-mode="register"] .seg-pill { transform: translateX(100%); }

/* animated show/hide of form parts */
.reveal { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows 0.38s var(--ease), opacity 0.3s, margin 0.38s var(--ease); }
.reveal > div { overflow: hidden; min-height: 0; display: grid; gap: 12px; }
.reveal.off { grid-template-rows: 0fr; opacity: 0; margin: -6px 0; pointer-events: none; }

.pw-meter { display: flex; align-items: center; gap: 10px; height: 16px; }
.pw-meter i { display: block; height: 3px; width: 0; border-radius: 3px; transition: width 0.35s var(--ease), background 0.35s; }
.pw-meter::before { content: ""; position: absolute; }
.pw-meter span { margin-left: auto; font-size: 11px; color: var(--muted); }
.auth-links { display: flex; justify-content: center; min-height: 20px; }
.link { color: var(--accent-2); font-size: 13px; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* button busy state */
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(0.97); } }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }

/* ---------- layout ---------- */

.app { position: fixed; inset: 0; display: grid; grid-template-columns: 248px 1fr; }
@keyframes fade { from { opacity: 0; } }

.sidebar {
  display: flex; flex-direction: column; gap: 6px; padding: 0 12px 14px; min-height: 0;
  background: var(--side); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 10px; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.brand i { font-style: normal; font-weight: 400; color: var(--accent-2); }
.brand em { margin-left: 2px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); font-style: normal; font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nav-wrap { position: relative; }
.nav { position: relative; display: grid; gap: 2px; }
.nav-pill { position: absolute; left: 0; right: 0; top: 0; height: 36px; border-radius: 8px; background: var(--raise-2); opacity: 0; transition: transform 0.42s var(--spring), height 0.3s, opacity 0.2s; pointer-events: none; }
.nav-pill::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; height: 36px; padding: 0 10px;
  border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 13.5px; text-align: left;
  transition: background 0.18s, color 0.18s, transform 0.18s var(--ease);
}
.nav-item:hover { background: var(--raise); color: var(--text); }
.nav-item:active { transform: scale(0.98); }
.nav-item svg { width: 18px; height: 18px; }
.nav-item.active, .nav-item.active:hover { background: transparent; color: var(--text); font-weight: 600; }
.nav-item.active svg { color: var(--accent-2); }
@keyframes pop { from { transform: scaleY(0); } }

.sidebar-foot { margin-top: auto; display: grid; gap: 2px; }

/* sidebar folder tree */
.side-folders { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 16px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.icon-btn.tiny { width: 24px; height: 24px; border-radius: 6px; }
.icon-btn.tiny svg { width: 15px; height: 15px; }
.side-tree { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent; }
.tree-row { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 calc(4px + var(--d) * 14px); border-radius: 8px; color: var(--muted); font-size: 13px; cursor: pointer; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.side-tree.animate .tree-row { animation: tree-in 0.35s var(--ease) both; animation-delay: calc(min(var(--i), 16) * 25ms); }
@keyframes tree-in { from { opacity: 0; transform: translateX(-8px); } }
.tree-row:hover { background: var(--raise); color: var(--text); }
.tree-row.active { background: var(--raise-2); color: var(--text); font-weight: 600; }
.tree-row > .ficon { --fs: 18px; }
.tree-row.active > .ficon svg { fill: color-mix(in srgb, var(--fc) 35%, transparent); }
.tree-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row.drop-target { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.tree-toggle { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 5px; color: var(--muted); transition: transform 0.25s var(--ease), background 0.15s; }
.tree-toggle:hover { background: var(--raise-2); color: var(--text); }
.tree-toggle svg { width: 13px; height: 13px; }
.tree-toggle.open { transform: rotate(90deg); }
.tree-toggle.leaf { visibility: hidden; }
.tree-kids { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.3s var(--ease), opacity 0.25s; }
.tree-kids > div { overflow: hidden; min-height: 0; }
.tree-kids.off { grid-template-rows: 0fr; opacity: 0; }
.tree-empty { padding: 4px 10px; font-size: 12.5px; color: #5d5f66; text-align: left; }
.tree-empty u { color: var(--accent-2); text-decoration: none; }
.tree-empty:hover u { text-decoration: underline; }
.storage { padding: 12px; margin-bottom: 8px; border-radius: var(--radius); background: var(--raise); border: 1px solid var(--line); display: grid; gap: 8px; }
.storage-head { display: flex; justify-content: space-between; align-items: baseline; }
.storage-head span { color: var(--muted); font-size: 12px; font-weight: 600; }
.storage-bar { height: 4px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.07); }
.storage-fill { display: flex; gap: 2px; height: 100%; min-width: 0; transition: width 0.9s var(--ease); }
.storage-bar i { height: 100%; transition: flex-grow 0.8s var(--ease); }
.storage-head b { font-size: 12px; }

/* account chip */
.account { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; margin-top: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); text-align: left; transition: background 0.18s, border-color 0.18s; }
.account:hover { background: var(--raise-2); border-color: var(--line-2); }
.avatar { --hue: 210; width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, hsl(var(--hue) 80% 55%), hsl(calc(var(--hue) + 40) 75% 42%)); box-shadow: 0 6px 16px -8px hsl(var(--hue) 80% 50%); }
.avatar.preset { background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 6px 16px -8px var(--a); color: #fff; }
.avatar.preset svg { width: 58%; height: 58%; stroke-width: 2; }
.avatar.image { padding: 0; overflow: hidden; background: #151517; }
.avatar.image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 88px; height: 88px; border-radius: 26px; font-size: 36px; }
.avatar.pop { animation: avatar-pop 0.45s var(--spring); }
@keyframes avatar-pop { 0% { transform: scale(0.82); } 100% { transform: none; } }

/* profile picture dialog */
.pfp-head { display: flex; align-items: center; gap: 16px; }
.pfp-head > div { display: grid; gap: 2px; }
.pfp-head span { color: var(--muted); font-size: 13px; }
.modal .section-label { margin: 4px 0 -6px; }
.pfp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.pfp-grid .avatar { width: 100%; height: auto; aspect-ratio: 1; border-radius: 16px; transition: transform 0.2s var(--spring), box-shadow 0.2s; animation: item-in 0.4s var(--ease) both; animation-delay: calc(var(--i) * 25ms); }
.pfp-grid .avatar:hover { transform: translateY(-2px) scale(1.05); }
.pfp-grid .avatar.picked { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.pfp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn[disabled] svg { opacity: 0.5; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 50vh; overflow-y: auto; }
.pick-grid button { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--raise); transition: transform 0.2s var(--ease), box-shadow 0.2s; animation: item-in 0.4s var(--ease) both; animation-delay: calc(min(var(--i), 20) * 20ms); }
.pick-grid button:hover { transform: scale(1.04); box-shadow: 0 0 0 2px var(--accent); }
.pick-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* avatar cropper */
.crop { position: relative; width: 260px; height: 260px; margin: 4px auto; }
.crop-stage { position: absolute; inset: 0; overflow: hidden; border-radius: 18px; background: #000; cursor: grab; touch-action: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 18px; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7); background: radial-gradient(circle, transparent 69.5%, rgba(0, 0, 0, 0.45) 70%); }
.crop-zoom { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.crop-zoom input { flex: 1; accent-color: var(--accent); }

.acc-text { flex: 1; min-width: 0; display: grid; }
.acc-text b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #f5b25b; flex: none; }
.live[data-state="on"] i { background: #3ecf8e; box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.6); animation: live-ping 2.4s infinite; }
.live[data-state="off"] i { background: var(--danger); }
@keyframes live-ping { 0% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(62, 207, 142, 0); } }
.acc-chev { color: var(--muted); display: grid; }
.acc-chev svg { width: 16px; height: 16px; }

/* legacy / info banner */
.banner { display: flex; align-items: center; gap: 14px; margin: 18px 26px 0; padding: 14px 14px 14px 16px; border-radius: 14px; border: 1px solid rgba(47, 155, 255, 0.35); background: linear-gradient(90deg, rgba(47, 155, 255, 0.14), rgba(47, 155, 255, 0.04)); animation: rise 0.5s var(--ease) both; }
.banner-icon { color: var(--accent-2); display: grid; }
.banner-icon svg { width: 24px; height: 24px; }
.banner-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.banner-text span { font-size: 12.5px; color: var(--muted); }
.banner-text .bar { margin-top: 6px; }

/* update toast */
.update { position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%); z-index: 110; display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 16px; border-radius: 14px; background: #1a1a1d; border: 1px solid var(--line-2); box-shadow: 0 24px 60px -18px #000; animation: bulk-in 0.45s var(--spring) both; max-width: calc(100vw - 24px); }
.update span:nth-child(2) { display: grid; }
.update small { color: var(--muted); font-size: 12px; }
.update-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; animation: live-ping-blue 2s infinite; }
@keyframes live-ping-blue { 0% { box-shadow: 0 0 0 0 rgba(47, 155, 255, 0.6); } 70%, 100% { box-shadow: 0 0 0 9px rgba(47, 155, 255, 0); } }

/* recovery code dialog */
.modal.wide { width: min(500px, 100%); }
.modal-icon.danger { color: #ff8795; background: rgba(242, 86, 109, 0.14); border-color: rgba(242, 86, 109, 0.35); }
.modal-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--accent-2); background: var(--accent-soft); border: 1px solid rgba(47, 155, 255, 0.3); }
.modal-icon svg { width: 24px; height: 24px; }
.modal p b { color: var(--text); }
.code-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.4); border: 1px dashed var(--line-2); user-select: all; -webkit-user-select: all; }
.code-box span { text-align: center; font: 600 17px/1.6 "Cascadia Code", Consolas, ui-monospace, monospace; letter-spacing: 0.12em; color: var(--accent-2); animation: rise 0.5s var(--ease) both; }
.code-box span:nth-child(2) { animation-delay: 60ms; } .code-box span:nth-child(3) { animation-delay: 120ms; }
.code-box span:nth-child(4) { animation-delay: 180ms; } .code-box span:nth-child(5) { animation-delay: 240ms; } .code-box span:nth-child(6) { animation-delay: 300ms; }
.code-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-stack { display: grid; gap: 12px; }

/* items that arrive through live sync */
.item.fresh .card, .item.fresh .folder { animation: fresh-in 1.8s var(--ease) both; }
@keyframes fresh-in {
  0% { opacity: 0; transform: scale(0.85); box-shadow: 0 0 0 0 rgba(47, 155, 255, 0); }
  25% { opacity: 1; transform: scale(1.02); box-shadow: 0 0 0 3px rgba(47, 155, 255, 0.6), 0 0 40px rgba(47, 155, 255, 0.35); }
  100% { transform: none; box-shadow: 0 0 0 0 rgba(47, 155, 255, 0); }
}
.content.quiet .item.fresh { animation: none; }
.crumbs .here { animation: crumb-in 0.4s var(--ease) both; }
@keyframes crumb-in { from { opacity: 0; transform: translateX(-8px); } }

.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 24px; flex: none; border-bottom: 1px solid var(--line); }
body.desktop .topbar { padding-right: 150px; }
.search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 9px;
  background: var(--raise); border: 1px solid var(--line); color: var(--muted);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 155, 255, 0.18); background: rgba(0, 0, 0, 0.25); }
.search span { display: grid; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); user-select: text; -webkit-user-select: text; }
.search input::-webkit-search-cancel-button { filter: invert(0.7); cursor: pointer; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 22px 26px 14px; flex: none; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.025em; }
.crumbs button { padding: 2px 8px; margin-left: -8px; border-radius: 9px; color: var(--muted); font-weight: 700; transition: background 0.15s, color 0.15s; }
.crumbs button:hover { background: var(--raise-2); color: var(--text); }
.crumbs button.drop-target { background: rgba(47, 155, 255, 0.3); color: #fff; }
.crumbs .sep { color: var(--muted); opacity: 0.5; margin: 0 6px 0 2px; display: grid; }
.crumbs .sep svg { width: 16px; height: 16px; }
.crumbs .here { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

.scroller { flex: 1; overflow-y: auto; padding: 4px 26px calc(110px + var(--safe-bottom)); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent; }
.scroller::-webkit-scrollbar { width: 10px; }
.scroller::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
.sentinel { height: 1px; }

/* ---------- items ---------- */

.section-label { margin: 22px 2px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.section-label:first-child { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; align-items: start; }
.grid.folders { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid.gallery { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 6px; }

.item { position: relative; animation: item-in 0.5s var(--ease) both; animation-delay: calc(min(var(--i, 0), 24) * 22ms); }
@keyframes item-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.content.quiet .item { animation: none; }
.item.leaving, .content.quiet .item.leaving { animation: item-out 0.28s var(--ease) forwards; }
@keyframes item-out { to { opacity: 0; transform: scale(0.86); } }

.folder {
  display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 6px 0 14px; border-radius: var(--radius);
  background: var(--raise); border: 1px solid var(--line); cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.folder:hover { background: var(--raise-2); border-color: var(--line-2); transform: translateY(-2px); box-shadow: 0 14px 28px -20px #000; }
.folder:active, .card:active { transform: scale(0.975); transition-duration: 0.1s; }
.folder:hover .glyph .ficon.tile { box-shadow: 0 6px 16px -6px var(--a); }
.folder .glyph { color: var(--accent-2); display: grid; transition: transform 0.25s var(--spring); }
.folder:hover .glyph { transform: scale(1.08); }
.folder .glyph .ficon { --fs: 26px; }
.folder .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder.drop-target, .item.selected .folder { border-color: var(--accent); background: rgba(47, 155, 255, 0.2); }

.card {
  display: block; border-radius: var(--radius); background: var(--raise); border: 1px solid var(--line); overflow: hidden; cursor: pointer;
  transition: transform 0.22s var(--ease), box-shadow 0.22s, border-color 0.2s, background 0.2s;
}
.card:hover { transform: translateY(-2px); background: var(--raise-2); border-color: var(--line-2); box-shadow: 0 16px 30px -20px #000; }
.thumb { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: rgba(0, 0, 0, 0.32); overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s, transform 0.5s var(--ease); -webkit-user-drag: none; }
.thumb img.loaded { opacity: 1; }
.card:hover .thumb img { transform: scale(1.04); }
.thumb .kind { width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; color: var(--tint, #9a9ca5); background: color-mix(in srgb, var(--tint, #9a9ca5) 13%, transparent); border: 1px solid color-mix(in srgb, var(--tint, #9a9ca5) 22%, transparent); transition: transform 0.3s var(--ease); }
.card:hover .kind { transform: scale(1.06); }
.thumb .kind svg { width: 24px; height: 24px; }
.thumb .ext { position: absolute; left: 10px; bottom: 10px; padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.07); color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.thumb .play { position: absolute; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; }
.thumb .play svg { width: 18px; height: 18px; fill: currentColor; margin-left: 2px; }
.card .info { display: flex; align-items: center; gap: 4px; padding: 10px 4px 10px 12px; }
.card .text { flex: 1; min-width: 0; }
.card .name { font-weight: 550; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.selected .card { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(47, 155, 255, 0.25); }

.more { width: 32px; height: 32px; border-radius: 10px; opacity: 0.55; }
.item:hover .more { opacity: 1; }

.check {
  position: absolute; z-index: 2; left: 10px; top: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.45); border: 1.5px solid rgba(255, 255, 255, 0.55); color: transparent; opacity: 0;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: opacity 0.15s, transform 0.2s var(--spring), background 0.15s;
}
.check svg { width: 14px; height: 14px; stroke-width: 3; }
.item:hover .check, body.selecting .check { opacity: 1; }
.item.selected .check { opacity: 1; background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.1); }
.badge-fav { position: absolute; z-index: 2; right: 10px; top: 10px; color: #ffd166; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7)); display: grid; animation: pop-in 0.4s var(--spring) both; }
.badge-fav svg { width: 18px; height: 18px; fill: currentColor; }
@keyframes pop-in { from { transform: scale(0); } }

.grid.gallery .card { border-radius: 10px; border: 0; }
.grid.gallery .thumb { aspect-ratio: 1; }
.grid.gallery .info { display: none; }
.grid.gallery .card:hover { transform: scale(1.03); z-index: 1; }

.list { display: grid; gap: 4px; }
.list .card { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 8px; }
.list .card:hover { transform: none; }
.list .thumb { width: 46px; height: 46px; aspect-ratio: auto; border-radius: 10px; flex: none; }
.list .thumb .kind { width: 100%; height: 100%; border-radius: 10px; }
.list .thumb .kind svg { width: 20px; height: 20px; }
.list .thumb .ext, .list .thumb .play { display: none; }
.list .info { flex: 1; min-width: 0; padding: 0; }
.list .check { left: 19px; top: 17px; }
.list .badge-fav { position: static; order: 2; }

.empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 12vh 20px; color: var(--muted); animation: rise 0.6s var(--ease) both; }
.empty .bubble { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 6px; display: grid; place-items: center; background: var(--raise); border: 1px solid var(--line); color: var(--accent-2); }
.empty .bubble svg { width: 30px; height: 30px; }
.empty b { font-size: 16px; font-weight: 600; color: var(--text); }
.empty span { max-width: 340px; }
.empty .btn { margin-top: 10px; }

.skeleton { border-radius: var(--radius); aspect-ratio: 4 / 3.6; background: linear-gradient(100deg, var(--raise) 30%, var(--raise-2) 50%, var(--raise) 70%); background-size: 300% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -150% 0; } }

/* ---------- floating things ---------- */

.bulk {
  position: absolute; left: 50%; bottom: calc(22px + var(--safe-bottom)); transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 8px; padding: 7px 7px 7px 16px; border-radius: 12px;
  background: #1a1a1d; border: 1px solid var(--line-2); box-shadow: 0 24px 50px -16px #000;
  animation: bulk-in 0.35s var(--spring) both; white-space: nowrap;
}
@keyframes bulk-in { from { opacity: 0; transform: translate(-50%, 30px); } }

.uploads {
  position: fixed; right: 22px; bottom: calc(22px + var(--safe-bottom)); z-index: 30; width: min(360px, calc(100vw - 28px));
  background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.95); animation: slide-up 0.4s var(--ease) both;
}
@keyframes slide-up { from { opacity: 0; transform: translateY(30px); } }
.uploads header { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; }
.uploads header b { flex: 1; }
.uploads ul { list-style: none; margin: 0; padding: 0 8px 8px; max-height: 250px; overflow-y: auto; display: grid; gap: 2px; }
.uploads.collapsed ul { display: none; }
.uploads.collapsed #uploads-toggle svg { transform: rotate(180deg); }
.uploads li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px; border-radius: 12px; animation: item-in 0.3s var(--ease) both; }
.uploads li .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.uploads li .s { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.uploads li.err .s { color: #ff8795; }
.uploads li.done .s { color: #5ee0a0; }
.bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--raise-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--grad); transition: width 0.3s var(--ease); }
.uploads li.done .bar i { background: #5ee0a0; }
.uploads li.err .bar i { background: var(--danger); }
.ring { --p: 0; width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(var(--accent-2) calc(var(--p) * 1%), var(--raise-2) 0); -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%); mask: radial-gradient(circle, transparent 54%, #000 56%); transition: --p 0.3s; }

.drop { position: fixed; inset: 0; z-index: 80; padding: 14px; background: rgba(5, 5, 6, 0.42); pointer-events: none; animation: fade 0.2s both; transition: background 0.2s; }
.drop.aimed { background: rgba(5, 5, 6, 0.12); }
.drop-inner { height: 100%; display: grid; align-content: end; justify-items: center; gap: 12px; padding-bottom: 34px; border-radius: 18px; border: 1.5px dashed rgba(47, 155, 255, 0.8); font-size: 16px; animation: pulse 1.6s ease-in-out infinite; pointer-events: none; }
.drop-inner b { padding: 10px 18px; border-radius: 12px; background: rgba(16, 16, 19, 0.92); border: 1px solid var(--line-2); box-shadow: 0 18px 40px -16px #000; }
.drop-inner svg { width: 40px; height: 40px; color: var(--accent-2); animation: float 1.6s ease-in-out infinite; }
.drop-inner svg { width: 56px; height: 56px; color: var(--accent-2); animation: float 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { border-color: rgba(108, 196, 255, 0.9); background: rgba(47, 155, 255, 0.06); } }

.menu {
  position: fixed; z-index: 115; min-width: 210px; padding: 5px; border-radius: 11px; background: rgba(22, 22, 24, 0.97);
  border: 1px solid var(--line-2); box-shadow: 0 26px 60px -16px #000;
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); transform-origin: var(--ox, 0) var(--oy, 0); animation: menu-in 0.2s var(--spring) both;
}
@keyframes menu-in { from { opacity: 0; transform: scale(0.88); } }
.menu button { display: flex; align-items: center; gap: 11px; width: 100%; height: 34px; padding: 0 10px; border-radius: 7px; font-weight: 500; font-size: 13.5px; text-align: left; transition: background 0.12s; }
.menu button:hover { background: var(--raise-2); }
.menu button svg { width: 16px; height: 16px; color: var(--muted); }
.menu button.danger, .menu button.danger svg { color: #ff8795; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

.modal-back { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade 0.2s both; }
.modal { width: min(420px, 100%); max-height: 86vh; display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: 16px; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: 0 40px 90px -24px #000; animation: modal-in 0.34s var(--spring) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(0.94); } }
.modal-back.closing { animation: fade 0.18s reverse both; }
.modal-back.closing .modal { animation: modal-out 0.18s var(--ease) forwards; }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(0.96); } }
.modal h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.015em; }
.modal p { margin: 0; color: var(--muted); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; }
.tree { display: grid; gap: 2px; overflow-y: auto; margin: 0 -8px; padding: 0 8px; min-height: 80px; }
.tree button { display: flex; align-items: center; gap: 10px; height: 36px; padding-right: 12px; border-radius: 8px; font-weight: 500; text-align: left; }
.tree button:hover { background: var(--raise); }
.tree button.picked { background: var(--accent-soft); color: #fff; }
.tree button .ficon { --fs: 18px; }
.tree button > svg { color: var(--accent-2); }
.qr { display: grid; justify-items: center; gap: 12px; }
.qr .code { width: 208px; height: 208px; padding: 10px; border-radius: 18px; background: #fff; }
.qr .code svg { width: 100%; height: 100%; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; }
.qr .url { padding: 8px 14px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); font-weight: 600; user-select: all; -webkit-user-select: all; }
.steps { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }
.steps b { color: var(--text); }

.toasts { position: fixed; left: 50%; top: calc(18px + var(--safe-top) + var(--titlebar)); transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 9px 14px; border-radius: 10px; font-size: 13px; background: #1b1b1e; border: 1px solid var(--line); box-shadow: 0 18px 40px -14px #000; font-weight: 600; animation: toast-in 0.35s var(--spring) both; max-width: 86vw; }
.toast.error { border-color: rgba(242, 86, 109, 0.45); color: #ffb3c1; }
.toast.out { animation: toast-out 0.25s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(0.92); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* ---------- viewer ---------- */

.viewer { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: rgba(4, 4, 5, 0.95); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); animation: fade 0.22s both; }
.viewer.closing { animation: fade 0.18s reverse both; }
.viewer header { display: flex; align-items: center; gap: 4px; padding: calc(10px + var(--safe-top)) 14px 10px 22px; flex: none; z-index: 2; }
body.desktop .viewer header { padding-right: 150px; }
.viewer-title { flex: 1; min-width: 0; display: grid; }
.viewer-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.viewer-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 16px calc(22px + var(--safe-bottom)); touch-action: pan-y; }
.viewer-stage > * { max-width: 100%; max-height: 100%; min-height: 0; animation: zoom-in 0.36s var(--ease) both; }
.viewer-stage.to-left > * { animation-name: from-right; }
.viewer-stage.to-right > * { animation-name: from-left; }
@keyframes zoom-in { from { opacity: 0; transform: scale(0.92); } }
@keyframes from-right { from { opacity: 0; transform: translateX(60px); } }
@keyframes from-left { from { opacity: 0; transform: translateX(-60px); } }
.viewer-stage img, .viewer-stage video { object-fit: contain; border-radius: 12px; box-shadow: 0 40px 100px -30px #000; -webkit-user-drag: none; }
.viewer-stage video { width: min(1280px, 100%); background: #000; }
.viewer-stage iframe { width: min(1000px, 100%); height: 100%; border: 0; border-radius: 12px; background: #fff; }
.viewer-stage pre { width: min(900px, 100%); height: 100%; margin: 0; padding: 20px; overflow: auto; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line); font: 13px/1.55 "Cascadia Code", Consolas, ui-monospace, monospace; white-space: pre-wrap; word-break: break-word; user-select: text; -webkit-user-select: text; }
.viewer-stage .plain { display: grid; justify-items: center; gap: 16px; text-align: center; }
.viewer-stage .plain .kind { width: 96px; height: 96px; border-radius: 24px; display: grid; place-items: center; color: var(--tint, #9a9ca5); background: color-mix(in srgb, var(--tint, #9a9ca5) 13%, transparent); border: 1px solid color-mix(in srgb, var(--tint, #9a9ca5) 22%, transparent); }
.viewer-stage .plain .kind svg { width: 50px; height: 50px; }
.viewer-stage .plain audio { width: min(440px, 86vw); }
.viewer-arrow { position: absolute; top: 50%; z-index: 2; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background 0.15s, transform 0.2s var(--ease), opacity 0.2s; }
.viewer-arrow:hover { background: rgba(255, 255, 255, 0.18); transform: scale(1.08); }
.viewer-arrow.left { left: 16px; }
.viewer-arrow.right { right: 16px; }
.viewer-arrow[disabled] { opacity: 0; pointer-events: none; }

/* ---------- mobile ---------- */

.only-mobile { display: none; }
.scrim { display: none; }

.fab-stack { position: absolute; right: 18px; bottom: calc(20px + var(--safe-bottom)); z-index: 15; flex-direction: column; align-items: center; gap: 12px; }
.fab { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 16px 34px -10px rgba(47, 155, 255, 0.95); transition: transform 0.2s var(--spring); }
.fab svg { width: 26px; height: 26px; }
.fab.small { width: 44px; height: 44px; border-radius: 13px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: 0 12px 26px -12px #000; }
.fab.small svg { width: 20px; height: 20px; }
.fab:active { transform: scale(0.88); }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .only-mobile { display: inline-grid; }
  .fab-stack.only-mobile { display: flex; }
  .hide-mobile { display: none; }
  .sidebar {
    position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(290px, 84vw); padding-top: var(--safe-top); padding-bottom: calc(14px + var(--safe-bottom));
    background: var(--side); transform: translateX(-104%); transition: transform 0.38s var(--ease);
  }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
  body.drawer .sidebar { transform: none; box-shadow: 30px 0 80px #000; }
  body.drawer .scrim { opacity: 1; pointer-events: auto; }
  .topbar { height: calc(58px + var(--safe-top)); padding: var(--safe-top) 12px 0; gap: 6px; }
  .topbar-actions { gap: 0; }
  .heading { padding: 16px 16px 12px; }
  .crumbs { font-size: 20px; }
  .scroller { padding: 2px 14px calc(170px + var(--safe-bottom)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.folders { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .grid.gallery .card { border-radius: 4px; }
  .check { opacity: 0; }
  .more { opacity: 1; }
  .card:hover, .folder:hover { transform: none; }
  .uploads { right: 14px; bottom: calc(96px + var(--safe-bottom)); }
  .bulk { bottom: calc(96px + var(--safe-bottom)); }
  .banner { margin: 12px 14px 0; flex-wrap: wrap; }
  .update { bottom: calc(96px + var(--safe-bottom)); }
  .code-box { grid-template-columns: repeat(2, 1fr); }
  .pfp-grid { grid-template-columns: repeat(4, 1fr); }
  .bg-grid { grid-template-columns: repeat(3, 1fr); }
  body.custom-bg .sidebar { background: rgba(10, 10, 12, 0.86); }
  .viewer-arrow { display: none; }
  .viewer-stage { padding: 0 0 var(--safe-bottom); }
  .viewer-stage img, .viewer-stage video { border-radius: 0; }
  .modal-back { align-items: end; padding: 10px 10px calc(10px + var(--safe-bottom)); }
  .modal { animation-name: sheet-in; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(60px); } }
  .field input, .input, .search input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
}


/* ---------- drag & drop marks ---------- */
.tree-row { position: relative; }
.tree-row.drop-before::before, .tree-row.drop-after::after {
  content: ""; position: absolute; left: calc(8px + var(--d) * 14px); right: 6px; height: 3px; border-radius: 3px; background: var(--accent);
  box-shadow: 0 0 10px rgba(47, 155, 255, 0.8); pointer-events: none;
}
.tree-row.drop-before::before { top: -2px; }
.tree-row.drop-after::after { bottom: -2px; }
.nav-item.drop-target, .side-head.drop-target { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); border-radius: 8px; }
.card.drop-target, .item .folder.drop-target { transform: scale(1.03); }
body.dragging-items .tree-row:not(.drop-target):not(.drop-before):not(.drop-after) { transition: background 0.15s; }

/* ---------- sidebar support entry ---------- */
.nav-item .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); animation: pop-in 0.35s var(--spring); }
.nav-item .badge.staff { background: #f59e0b; }

/* ---------- settings ---------- */
.modal.settings { width: min(520px, 100%); overflow-y: auto; }
.settings-head { display: flex; align-items: center; gap: 16px; }
.settings-head h2 { margin: 0 0 2px; }
.set-group { display: grid; gap: 6px; }
.set-group .section-label { margin: 2px 2px 2px; }
.set-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.2s var(--ease); animation: item-in 0.35s var(--ease) both; }
.set-row:hover { background: var(--raise-2); border-color: var(--line-2); transform: translateX(2px); }
.set-row > svg:last-child { width: 16px; height: 16px; color: var(--muted); }
.set-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.set-text small { color: var(--muted); font-size: 12px; }
.set-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--raise-2); color: var(--accent-2); flex: none; }
.set-icon svg { width: 18px; height: 18px; }
.set-swatch { width: 36px; height: 36px; border-radius: 10px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); background-size: cover; background-position: center; }
.set-row .avatar { width: 36px; height: 36px; }
.set-row.danger .set-icon { color: #ff8795; background: rgba(242, 86, 109, 0.12); }
.set-row.danger b { color: #ff8795; }
.set-row.danger:hover { border-color: rgba(242, 86, 109, 0.4); }

/* ---------- support ---------- */
.modal.support-modal { width: min(1040px, 100%); height: min(720px, 88vh); max-height: none; padding: 0; gap: 0; overflow: hidden; }
.sup-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(47, 155, 255, 0.07), transparent); }
.sup-logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid rgba(47, 155, 255, 0.3); flex: none; }
.sup-logo img { width: 26px; }
.sup-title { flex: 1; min-width: 0; display: grid; }
.sup-title h2 { margin: 0; }
.sup-scope { margin: 0; width: 280px; }
.sup-scope button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sup-scope button svg { width: 14px; height: 14px; }
.sup-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 330px 1fr; }
.sup-list { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-right: 1px solid var(--line); min-height: 0; background: rgba(0, 0, 0, 0.12); }
.sup-new { width: 100%; }
.sup-filters { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.sup-filters button { flex: 1; height: 28px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: background 0.15s, color 0.15s; }
.sup-filters button:hover { color: var(--text); }
.sup-filters button.on { background: var(--raise-2); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset; }
.sup-items { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 4px; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.sup-item { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 12px; text-align: left; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s; animation: item-in 0.3s var(--ease) both; animation-delay: calc(min(var(--i), 12) * 20ms); }
.sup-item:hover { background: var(--raise); }
.sup-item.active { background: var(--raise-2); border-color: var(--line-2); }
.sup-item .avatar.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
.sup-cat-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.sup-cat-ico svg { width: 17px; height: 17px; }
.sup-cat-ico.lg { width: 40px; height: 40px; border-radius: 12px; }
.sup-item-text { flex: 1; min-width: 0; display: grid; gap: 5px; }
.sup-item-top { display: flex; align-items: baseline; gap: 8px; }
.sup-item-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.sup-item.unread .sup-item-top b::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); vertical-align: middle; }
.sup-time { font-size: 11.5px; color: var(--muted); flex: none; }
.sup-item-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.sup-item-meta > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-who { color: var(--text); font-weight: 500; }
.pill { --c: #878991; display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 2px 8px 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 32%, transparent); }
.pill i, .status-btn i, .menu-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; box-shadow: 0 0 8px color-mix(in srgb, var(--c) 70%, transparent); }
.status-btn { --c: #878991; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 8px 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); transition: background 0.15s, transform 0.15s var(--spring); }
.status-btn:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
.status-btn:active { transform: scale(0.96); }
.status-btn svg { width: 14px; height: 14px; }
.menu .menu-dot { margin: 0 4px; }
.menu button.active { color: var(--text); }
.menu button.active > svg:last-child { margin-left: auto; color: var(--accent-2); }
.sup-empty-list { display: grid; justify-items: center; gap: 8px; padding: 26px 8px; font-size: 13px; color: var(--muted); text-align: center; }
.sup-empty-list svg { width: 22px; height: 22px; opacity: 0.6; }
.sup-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.sup-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; color: var(--muted); padding: 30px; max-width: 420px; margin: 0 auto; animation: rise 0.5s var(--ease) both; }
.sup-empty .bubble { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid rgba(47, 155, 255, 0.3); margin-bottom: 4px; box-shadow: 0 18px 40px -20px var(--accent); }
.sup-empty .bubble img { width: 40px; }
.sup-empty b { color: var(--text); font-size: 16px; }
.sup-empty .btn { margin-top: 8px; }
.sup-form { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 20px; animation: rise 0.4s var(--ease) both; }
.sup-form h3 { margin: 0 0 2px; font-size: 17px; }
.sup-form .field > span { display: flex; justify-content: space-between; }
.sup-count { font-style: normal; font-weight: 400; color: var(--muted); }
.sup-form .grow { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sup-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sup-cat { display: grid; justify-items: start; gap: 3px; padding: 12px; border-radius: 12px; text-align: left; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); color: var(--muted); transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.2s var(--spring); animation: item-in 0.35s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.sup-cat svg { width: 20px; height: 20px; margin-bottom: 4px; }
.sup-cat b { font-size: 13px; color: var(--text); }
.sup-cat small { font-size: 11.5px; line-height: 1.3; }
.sup-cat:hover { border-color: var(--line-2); transform: translateY(-1px); }
.sup-cat.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); box-shadow: 0 0 0 3px rgba(47, 155, 255, 0.14); }
.sup-form textarea, .sup-compose textarea, .msg-edit { width: 100%; resize: none; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); color: var(--text); outline: none; font: inherit; line-height: 1.45; transition: border-color 0.15s, box-shadow 0.15s; }
.sup-form textarea { flex: 1; min-height: 140px; }
.sup-form textarea:focus, .sup-compose textarea:focus, .msg-edit:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 155, 255, 0.18); }
.sup-form .btn svg, .sup-locked .btn svg, .sup-empty .btn svg { width: 16px; height: 16px; }
.sup-back, .sup-back-btn { display: none; }
.sup-thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sup-thread-head .avatar.md { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; }
.sup-thread-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sup-thread-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.sup-thread-title .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 20px 18px; scrollbar-width: thin; }
.msg { max-width: 80%; display: flex; align-items: flex-start; gap: 10px; align-self: flex-start; animation: item-in 0.35s var(--ease) both; animation-delay: calc(min(var(--i), 10) * 30ms); }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-av { width: 34px; height: 34px; border-radius: 11px; font-size: 14px; margin-top: 2px; }
.msg-av.support-av { background: var(--accent-soft); border: 1px solid rgba(47, 155, 255, 0.35); }
.msg-av.support-av img { width: 22px; }
.msg-col { min-width: 0; display: grid; gap: 5px; justify-items: start; }
.msg.mine .msg-col { justify-items: end; }
.msg-who { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 12px; color: var(--muted); }
.msg.mine .msg-who { flex-direction: row-reverse; }
.msg-who b { color: var(--text); font-weight: 600; }
.msg.staff .msg-who b { color: var(--accent-2); }
.msg-who time { font-size: 11.5px; }
.msg-edited { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-style: italic; }
.msg-edited svg { width: 11px; height: 11px; }
.msg-edit-btn { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s; }
.msg-edit-btn svg { width: 13px; height: 13px; }
.msg:hover .msg-edit-btn, .msg-edit-btn:focus-visible { opacity: 1; }
.msg-edit-btn:hover { background: var(--raise-2); color: var(--text); }
@media (hover: none) { .msg-edit-btn { opacity: 0.8; } }
.msg-body { padding: 10px 14px; border-radius: 6px 16px 16px 16px; background: var(--raise-2); border: 1px solid var(--line); line-height: 1.5; user-select: text; -webkit-user-select: text; overflow-wrap: anywhere; }
.msg.mine .msg-body { border-radius: 16px 6px 16px 16px; background: linear-gradient(180deg, rgba(62, 166, 255, 0.28), rgba(31, 134, 242, 0.22)); border-color: rgba(47, 155, 255, 0.4); }
.msg.staff:not(.mine) .msg-body { border-color: rgba(47, 155, 255, 0.35); }
.msg.editing { max-width: 100%; width: 80%; }
.msg.editing .msg-col, .msg.editing .msg-body { width: 100%; }
.msg.editing .msg-body { padding: 8px; background: var(--raise); }
.msg-edit { min-height: 70px; }
.msg-edit-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.msg-edit-actions .btn { height: 32px; padding: 0 12px; font-size: 13px; }
.msg-hist-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: #f5b25b; padding: 3px 8px; border-radius: 999px; background: rgba(245, 178, 91, 0.1); border: 1px solid rgba(245, 178, 91, 0.25); }
.msg-hist-toggle svg { width: 12px; height: 12px; }
.msg-hist-toggle.on { background: rgba(245, 178, 91, 0.2); }
.msg-hist { display: grid; gap: 6px; width: 100%; animation: rise 0.3s var(--ease) both; }
.msg-hist-item { padding: 8px 12px; border-radius: 10px; border: 1px dashed rgba(245, 178, 91, 0.35); background: rgba(245, 178, 91, 0.05); color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.msg-hist-item time { display: block; font-size: 11px; font-weight: 600; color: #f5b25b; margin-bottom: 3px; }
.sup-compose { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px 6px; border-top: 1px solid var(--line); }
.sup-compose textarea { max-height: 140px; }
.sup-compose .btn { height: 42px; width: 46px; padding: 0; flex: none; border-radius: 12px; }
.sup-compose .btn svg { width: 18px; height: 18px; }
.sup-compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px 10px; font-size: 12.5px; }
.sup-locked { display: flex; align-items: center; gap: 12px; margin: 0 14px 14px; padding: 12px 14px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line-2); animation: rise 0.35s var(--ease) both; }
.sup-locked > svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.sup-locked > div { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 13px; }
.sup-locked > div span { color: var(--muted); }
.sup-locked .btn { flex: none; }

/* ---------- password reveal ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-right: 42px; }
.pw-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); transition: color 0.15s, background 0.15s; }
.pw-eye:hover { color: var(--text); background: var(--raise-2); }
.pw-eye.on { color: var(--accent-2); }
.pw-eye svg { width: 17px; height: 17px; }

@media (max-width: 760px) {
  .modal.support-modal { height: 92vh; border-radius: 18px; }
  .sup-head { padding: 12px; flex-wrap: wrap; }
  .sup-scope { order: 3; width: 100%; }
  .sup-body { grid-template-columns: 1fr; }
  .sup-list { border-right: 0; }
  .sup-main { display: none; }
  .support-modal.thread-open .sup-list { display: none; }
  .support-modal.thread-open .sup-main { display: flex; }
  .sup-back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; }
  .sup-back svg { width: 16px; height: 16px; }
  .sup-back-btn { display: inline-grid; }
  .msg { max-width: 92%; }
  .msg.editing { width: 100%; }
  .sup-cats { grid-template-columns: 1fr 1fr; }
  .sup-locked { flex-wrap: wrap; }
  .sup-locked .btn { width: 100%; }
  .sup-compose-foot .muted { display: none; }
}
.field .pw-wrap { font-size: inherit; color: inherit; font-weight: inherit; }
.modal-icon.primary { color: var(--accent-2); }

/* ---------- folder icons ---------- */
.ficon { --fs: 22px; --fc: var(--accent-2); width: var(--fs); height: var(--fs); flex: none; display: inline-grid; place-items: center; color: var(--fc); }
.ficon svg { width: 100%; height: 100%; fill: color-mix(in srgb, var(--fc) 20%, transparent); }
.ficon.tile { border-radius: 28%; overflow: hidden; color: #fff; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 4px 12px -6px var(--a); }
.ficon.tile svg { width: 62%; height: 62%; fill: none; stroke-width: 2.2; }
.ficon.tile.image { background: #151517; box-shadow: 0 0 0 1px var(--line); }
.ficon.tile.image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ficon-preview { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 26px; background: var(--raise); border: 1px solid var(--line); flex: none; }
.ficon-preview .ficon { --fs: 56px; }
.ficon-preview.pop { animation: avatar-pop 0.45s var(--spring); }
.ficon-colors { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; }
.ficon-colors button { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; background: var(--raise); border: 1px solid var(--line); color: var(--fc); transition: transform 0.2s var(--spring), border-color 0.15s, box-shadow 0.15s; animation: item-in 0.35s var(--ease) both; animation-delay: calc(var(--i) * 20ms); }
.ficon-colors button svg { width: 60%; height: 60%; fill: color-mix(in srgb, var(--fc) 25%, transparent); }
.ficon-colors button:hover { transform: translateY(-2px) scale(1.05); border-color: var(--line-2); }
.ficon-colors button.picked { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fc); }
.ficon-motifs { grid-template-columns: repeat(8, 1fr); }
.ficon-motifs .avatar { border-radius: 28%; }
.crop.square .crop-ring { background: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7); }
@media (max-width: 640px) {
  .ficon-colors { grid-template-columns: repeat(5, 1fr); }
  .ficon-motifs { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- motion ---------- */
.content[data-dir="fwd"] .item { animation-name: item-in-fwd; }
.content[data-dir="back"] .item { animation-name: item-in-back; }
.content.quiet[data-dir] .item { animation: none; }
@keyframes item-in-fwd { from { opacity: 0; transform: translateX(36px) scale(0.98); } }
@keyframes item-in-back { from { opacity: 0; transform: translateX(-36px) scale(0.98); } }

.motion-ghost { position: fixed !important; z-index: 85; margin: 0 !important; pointer-events: none; animation: none !important; }
.motion-ghost * { animation: none !important; }

.ripple-box { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 0; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; transform: scale(0); opacity: 0; }
.btn.primary .ripple { background: #fff; }

/* dragging */
.item, .tree-row { transition: opacity 0.25s var(--ease), filter 0.25s; }
.item.drag-src { opacity: 0.35; filter: saturate(0.4); }
.item.drag-src .card, .item.drag-src .folder { transform: scale(0.95); }
.tree-row.drag-src { opacity: 0.4; }
body.dragging-items .item:not(.drag-src) .folder { border-style: dashed; border-color: var(--line-2); }
body.dragging-items .item .folder.drop-target { border-style: solid; border-color: var(--accent); transform: scale(1.04); box-shadow: 0 0 0 4px rgba(47, 155, 255, 0.18), 0 20px 40px -20px var(--accent); }
.folder .glyph { transition: transform 0.35s var(--spring); }
.folder.drop-target .glyph { transform: scale(1.22) rotate(-8deg); }
.tree-row.drop-target { transform: translateX(4px); transition: transform 0.25s var(--spring), background 0.15s; }
.tree-row.drop-target > .ficon { transform: scale(1.2); transition: transform 0.3s var(--spring); }
.drag-chip { position: fixed; left: -1000px; top: -1000px; display: flex; align-items: center; gap: 10px; max-width: 260px; height: 44px; padding: 0 14px 0 8px; border-radius: 12px; background: rgba(28, 28, 32, 0.96); border: 1px solid var(--line-2); color: var(--text); font-weight: 600; font-size: 13px; box-shadow: 0 18px 40px -12px #000; }
.drag-chip .ficon { --fs: 28px; }
.drag-chip .ficon.kind svg { width: 70%; height: 70%; fill: none; }
.drag-chip span:not(.ficon) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drag-chip b { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 12px; }

/* folder dialog */
.fd-head { display: flex; align-items: center; gap: 16px; }
.fd-head .ficon-preview { width: 76px; height: 76px; border-radius: 22px; }
.fd-head .ficon-preview .ficon { --fs: 48px; }
.fd-name { flex: 1; }
.fd-text { display: grid; gap: 2px; }
.fd-text span { color: var(--muted); font-size: 13px; }
.ficon-colors { grid-template-columns: repeat(11, 1fr); }
.ficon-colors [data-default] { --fc: var(--accent-2); position: relative; }
.ficon-colors [data-default] small { position: absolute; left: 0; right: 0; bottom: -15px; font-size: 9.5px; font-weight: 600; color: var(--muted); text-align: center; }
.folder-dialog .ficon-colors { margin-bottom: 10px; }
.ficon-motifs .avatar.preset.picked { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--b); transform: scale(1.06); }
@media (max-width: 640px) {
  .ficon-colors { grid-template-columns: repeat(6, 1fr); row-gap: 20px; }
}

/* ---------- version notice ---------- */
.updated {
  position: fixed; left: 50%; top: calc(16px + var(--safe-top) + var(--titlebar)); z-index: 125; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 24px); padding: 12px 8px 12px 14px; border-radius: 16px;
  background: rgba(24, 24, 28, 0.96); border: 1px solid rgba(62, 207, 142, 0.35); box-shadow: 0 24px 60px -18px #000, 0 0 0 4px rgba(62, 207, 142, 0.08);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); animation: updated-in 0.55s var(--spring) both;
}
.updated.leaving { animation: updated-out 0.35s var(--ease) forwards; }
@keyframes updated-in { from { opacity: 0; transform: translate(-50%, -24px) scale(0.9); } }
@keyframes updated-out { to { opacity: 0; transform: translate(-50%, -16px) scale(0.96); } }
.updated-ico { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #3ecf8e; background: rgba(62, 207, 142, 0.14); animation: pop-in 0.5s 0.25s var(--spring) both; }
.updated-ico svg { width: 20px; height: 20px; stroke-width: 2.4; }
.updated-text { display: grid; gap: 2px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.updated-text b { color: var(--text); font-size: 13.5px; }
.updated-text span { display: flex; align-items: center; gap: 5px; }
.updated-text s { opacity: 0.7; }
.updated-text em { font-style: normal; font-weight: 700; color: #3ecf8e; }
.updated-text svg { width: 12px; height: 12px; }

/* ---------- phones ---------- */
.tabbar { display: none; }
body.ios-app, body.ios-app .app, body.ios-app .auth, body.ios-app .boot, body.ios-app .viewer, body.ios-app .bg, body.ios-app .backdrop { bottom: auto; height: var(--app-h, 100%); }
html:has(body.ios-app) { height: var(--app-h, 100%); }

@media (max-width: 760px) {
  #btn-menu { display: none; }
  .topbar { height: calc(56px + var(--safe-top)); padding: var(--safe-top) 12px 0 14px; }
  .search { height: 40px; border-radius: 12px; }
  .topbar-actions .icon-btn { width: 40px; height: 40px; }
  .scroller { padding: 2px 14px calc(108px + var(--safe-bottom)); }

  .tabbar {
    position: absolute; left: 10px; right: 10px; bottom: max(10px, var(--safe-bottom)); z-index: 18;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: 64px; padding: 0 4px; border-radius: 22px;
    background: rgba(20, 20, 23, 0.86); border: 1px solid var(--line-2); box-shadow: 0 18px 44px -14px #000;
    backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); animation: slide-up 0.5s var(--ease) both;
  }
  .tab { position: relative; height: 100%; display: grid; align-content: center; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); border-radius: 16px; transition: color 0.2s; }
  .tab svg { width: 22px; height: 22px; transition: transform 0.3s var(--spring), color 0.2s; }
  .tab.active { color: var(--text); }
  .tab.active svg { color: var(--accent-2); transform: translateY(-1px) scale(1.06); }
  .tab.active::after { content: ""; position: absolute; bottom: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px var(--accent); }
  .tab:active svg { transform: scale(0.85); }
  .tab-plus { justify-self: center; width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 12px 26px -10px rgba(47, 155, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.25); transition: transform 0.2s var(--spring); }
  .tab-plus svg { width: 26px; height: 26px; stroke-width: 2.2; }
  .tab-plus:active { transform: scale(0.9); }
  body.custom-bg .tabbar { background: rgba(14, 14, 17, 0.8); }

  .uploads, .bulk, .update { bottom: calc(86px + max(10px, var(--safe-bottom))); }
  .bulk { max-width: calc(100vw - 20px); }

  /* folders: two lines for longer names instead of "Urlaub …" */
  .folder { height: auto; min-height: 56px; padding: 8px 2px 8px 12px; gap: 10px; }
  .folder .name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; font-size: 13.5px; overflow-wrap: anywhere; }
  .folder .more { width: 32px; height: 32px; }

  .auth { padding: calc(20px + var(--safe-top)) 18px calc(20px + var(--safe-bottom)); place-content: safe center; }
  .modal { max-height: calc(var(--app-h, 100vh) - var(--safe-top) - 24px); overflow-y: auto; }
  .modal.support-modal { height: calc(var(--app-h, 100vh) - var(--safe-top) - 20px); max-height: none; }
  .menu button { height: 42px; font-size: 14.5px; }
  .toasts { max-width: calc(100vw - 24px); }
}
@media (max-width: 360px) {
  .grid.folders { grid-template-columns: 1fr; }
  .tab span { font-size: 9.5px; }
}

/* short screens: the whole sidebar scrolls instead of squeezing the folder list to nothing */
.side-folders { min-height: 110px; }
@media (max-height: 680px) {
  .sidebar { overflow-y: auto; }
  .side-folders { flex: none; min-height: 0; }
  .side-tree { overflow: visible; }
  .sidebar-foot { margin-top: 12px; }
}
@media (max-width: 420px) {
  .sup-title .small { display: none; }
  .sup-cats { gap: 6px; }
  .sup-cat { display: flex; align-items: center; gap: 8px; padding: 10px; }
  .sup-cat svg { width: 18px; height: 18px; margin: 0; flex: none; }
  .sup-cat b { font-size: 12.5px; line-height: 1.2; }
  .sup-cat small { display: none; }
  .sup-form { padding: 14px; }
}

/* Wavey – support assistant */
.msg-av.wavey-av { background: radial-gradient(circle at 30% 20%, #5ad1ff, #1f6fe0 60%, #10307a); border: 1px solid rgba(120, 200, 255, 0.5); box-shadow: 0 0 0 3px rgba(47, 155, 255, 0.15), 0 8px 20px -8px #2f9bff; }
.msg-av.wavey-av img { width: 24px; filter: brightness(1.6) saturate(0.4) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.msg.bot .msg-who b { background: linear-gradient(90deg, #6cc4ff, #a5b4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.msg.bot .msg-body { background: linear-gradient(160deg, rgba(47, 155, 255, 0.12), rgba(120, 90, 255, 0.08)); border-color: rgba(108, 196, 255, 0.3); }
.ai-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; color: #a5d8ff; background: rgba(47, 155, 255, 0.14); border: 1px solid rgba(108, 196, 255, 0.3); }

/* ======================= 1.9 ======================= */

/* toast with action */
.toast.with-action { display: flex; align-items: center; gap: 14px; pointer-events: auto; padding: 7px 7px 7px 14px; }
.toast.with-action button { height: 30px; padding: 0 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: 12.5px; }
.toast.with-action button:hover { background: rgba(47, 155, 255, 0.25); }

/* shared bits */
.tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; margin-left: 4px; border-radius: 999px; font-size: 10.5px; font-weight: 700; font-style: normal; color: var(--muted); background: var(--raise-2); vertical-align: middle; }
.tag.blue { color: #8fd0ff; background: rgba(47, 155, 255, 0.16); }
.tag.red { color: #ff98a8; background: rgba(242, 86, 109, 0.16); }
.tag.green { color: #6fe0ae; background: rgba(62, 207, 142, 0.16); }
.on-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #3ecf8e; box-shadow: 0 0 8px #3ecf8e; vertical-align: middle; }
.small-btn { height: 34px; padding: 0 12px; font-size: 12.5px; gap: 6px; flex: none; }
.small-btn svg { width: 15px; height: 15px; }
.danger-text { color: #ff8795; }
.loading-row { display: grid; place-items: center; padding: 30px; }
.spacer { flex: 1; }
.special-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 2px 0 14px; animation: rise 0.4s var(--ease) both; }
.special-head .muted { display: inline-flex; align-items: center; gap: 6px; }
.special-head .muted svg { width: 14px; height: 14px; }
.special-note { margin: 0 2px 6px; }
.head-actions { display: flex; align-items: center; gap: 4px; }

/* row lists (trash, links, devices, versions, admin) */
.rows { display: grid; gap: 6px; }
.row-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line);
  animation: item-in 0.4s var(--ease) both; animation-delay: calc(min(var(--i, 0), 16) * 30ms); transition: background 0.15s, border-color 0.15s, opacity 0.25s, transform 0.25s var(--ease);
}
.row-item:hover { background: var(--raise-2); }
.row-item.current { border-color: rgba(62, 207, 142, 0.35); }
.row-item.blocked { opacity: 0.65; }
.row-item.leaving { opacity: 0; transform: translateX(30px) scale(0.97); }
.rows.compact .row-item { padding: 6px 10px; }
.row-ico { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--raise-2); color: var(--accent-2); overflow: hidden; }
.row-ico svg { width: 20px; height: 20px; }
.row-ico .ficon { --fs: 26px; }
.row-ico.thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-ico.kind { color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, transparent); }
.row-ico.link-ico { color: #8fd0ff; background: rgba(47, 155, 255, 0.14); }
.row-ico.link-ico.upload { color: #6fe0ae; background: rgba(62, 207, 142, 0.14); }
.row-item .avatar { width: 40px; height: 40px; border-radius: 12px; }
.row-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-text b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text > span, .row-text small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quota-bar { height: 4px; border-radius: 4px; background: var(--raise-2); overflow: hidden; margin-top: 4px; max-width: 260px; }
.quota-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }

/* shared folders */
.folder .name small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.share-chip { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #8fd0ff; background: rgba(47, 155, 255, 0.12); border: 1px solid rgba(47, 155, 255, 0.25); letter-spacing: 0; }
.share-chip svg { width: 13px; height: 13px; }
body.readonly #btn-upload, body.readonly #btn-folder, body.readonly .tab-plus { opacity: 0.35; pointer-events: none; }
body.in-share .own-only { display: none; }

/* search hits and version badge */
.snippet { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 11.5px; color: var(--accent-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.snippet svg { width: 12px; height: 12px; flex: none; }
.ver-badge { color: var(--accent-2); font-weight: 600; }

/* timeline */
.month-label { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin: 14px 2px 2px; font-size: 13px; font-weight: 700; letter-spacing: -0.01em; animation: rise 0.45s var(--ease) both; }
.month-label:first-child { margin-top: 0; }
.month-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }

/* memories banner */
.memories {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; margin-bottom: 16px; padding: 16px 18px; border-radius: 18px; text-align: left; overflow: hidden;
  background: linear-gradient(120deg, rgba(232, 121, 166, 0.22), rgba(47, 155, 255, 0.18) 60%, rgba(62, 207, 142, 0.14)); border: 1px solid var(--line-2);
  animation: rise 0.5s var(--ease) both; transition: transform 0.25s var(--spring), box-shadow 0.25s;
}
.memories:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -24px #000; }
.mem-text { display: grid; gap: 3px; }
.mem-text small { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #ffc2da; }
.mem-text small svg { width: 13px; height: 13px; }
.mem-text b { font-size: 18px; letter-spacing: -0.02em; }
.mem-text > span { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.mem-text > span svg { width: 13px; height: 13px; }
.mem-stack { display: flex; flex: none; padding-right: 6px; }
.mem-stack img { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; border: 2px solid var(--panel-solid); margin-left: -22px; box-shadow: 0 10px 22px -10px #000; transform: rotate(calc((var(--i) - 1.5) * 5deg)); transition: transform 0.35s var(--spring); }
.memories:hover .mem-stack img { transform: rotate(calc((var(--i) - 1.5) * 9deg)) translateY(-3px); }

/* albums */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.album-card { display: grid; gap: 4px; text-align: left; animation: item-in 0.45s var(--ease) both; animation-delay: calc(min(var(--i), 20) * 35ms); }
.album-cover { aspect-ratio: 1; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: var(--raise); border: 1px solid var(--line); color: var(--muted); margin-bottom: 6px; transition: transform 0.3s var(--spring), box-shadow 0.3s, border-color 0.2s; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover svg { width: 34px; height: 34px; }
.album-card:hover .album-cover { transform: translateY(-3px) scale(1.02); box-shadow: 0 18px 36px -20px #000; border-color: var(--line-2); }
.album-card b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-card small { color: var(--muted); font-size: 12px; }
.album-card.new .album-cover { border-style: dashed; color: var(--accent-2); background: var(--accent-soft); }
.pick-list { display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; }
.pick-list button { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; text-align: left; font-weight: 600; transition: background 0.15s; }
.pick-list button:hover { background: var(--raise-2); }
.pick-list button > svg { width: 18px; height: 18px; margin: 0 9px; color: var(--accent-2); }
.pick-list small { margin-left: 8px; color: var(--muted); font-weight: 500; }
.pick-cover { width: 36px; height: 36px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: var(--raise-2); color: var(--muted); flex: none; }
.pick-cover img { width: 100%; height: 100%; object-fit: cover; }
.pick-cover svg { width: 18px; height: 18px; }

/* share dialog */
.share-head { display: flex; align-items: center; gap: 14px; }
.share-head h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.share-head > div { min-width: 0; }
.share-ico { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.share-ico .ficon { --fs: 30px; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); }
.tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background 0.2s, color 0.2s; }
.tabs button svg { width: 16px; height: 16px; }
.tabs button.on { background: var(--raise-2); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset; }
.share-body { display: grid; gap: 14px; animation: rise 0.3s var(--ease) both; min-height: 120px; overflow-y: auto; }
.link-list { display: grid; gap: 8px; }
.link-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 4px; align-items: center; padding: 8px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); animation: item-in 0.35s var(--ease) both; }
.link-row .input { height: 36px; font-size: 12.5px; font-family: "Cascadia Code", Consolas, ui-monospace, monospace; }
.link-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px 0; }
.link-meta span { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.link-meta svg { width: 12px; height: 12px; }
.link-new { display: grid; gap: 12px; padding-top: 4px; }
.link-new .btn { justify-self: start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--raise); border: 1px solid var(--line); transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.2s var(--spring); }
.chips button:hover { color: var(--text); }
.chips button.on { color: var(--accent-2); background: var(--accent-soft); border-color: rgba(47, 155, 255, 0.45); }
.chips button:active { transform: scale(0.95); }
.member-new { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.member-new .input { flex: 1; min-width: 160px; }
.perm-btn { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--raise-2); flex: none; }
.perm-btn.write { color: #6fe0ae; background: rgba(62, 207, 142, 0.14); }
.perm-btn svg { width: 13px; height: 13px; }

/* viewer slideshow */
.viewer-stage { position: relative; }
.viewer.playing .viewer-stage::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; background: var(--grad); animation: slide-progress 4.5s linear infinite; }
.viewer-stage.fade > * { animation: zoom-in 0.8s var(--ease) both; }
@keyframes slide-progress { from { width: 0; } to { width: 100%; } }
.viewer.playing header .icon-btn[data-view="slideshow"] { color: var(--accent-2); }

/* two-factor */
.totp-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.totp-box .qr { width: 170px; flex: none; padding: 8px; border-radius: 14px; background: #fff; }
.totp-box .qr svg { width: 100%; height: auto; display: block; }
.totp-side { flex: 1; min-width: 180px; display: grid; gap: 8px; justify-items: start; }
.totp-side code { font: 600 14px/1.5 "Cascadia Code", Consolas, ui-monospace, monospace; letter-spacing: 0.06em; color: var(--accent-2); word-break: break-all; user-select: all; -webkit-user-select: all; }
.code-input { text-align: center; font: 700 22px/1 "Cascadia Code", Consolas, ui-monospace, monospace !important; letter-spacing: 0.3em; height: 52px !important; }

/* changelog */
.modal.changelog-modal, .modal.admin-modal { width: min(760px, 100%); max-height: 88vh; }
.cl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cl-head h2 { margin: 0; }
.cl-list { display: grid; gap: 16px; overflow-y: auto; margin: 0 -6px; padding: 0 6px 6px; }
.cl-entry { border-radius: 16px; overflow: hidden; background: var(--raise); border: 1px solid var(--line); animation: item-in 0.5s var(--ease) both; animation-delay: calc(min(var(--i), 8) * 60ms); }
.cl-banner { aspect-ratio: 3 / 1; overflow: hidden; background: #0d1626; }
.cl-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cl-art { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(120% 140% at 0% 0%, #1f6fe0 0%, #102a55 45%, #0a0f1d 100%); position: relative; overflow: hidden; }
.cl-art::before { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent, rgba(108, 196, 255, 0.25), transparent 30%); animation: spin 14s linear infinite; }
.cl-art img { width: 64px; position: relative; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5)); }
.cl-art span { position: relative; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; color: #fff; text-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); }
.cl-text { padding: 16px 18px 18px; display: grid; gap: 6px; }
.cl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.cl-ver { padding: 2px 8px; border-radius: 999px; font-weight: 700; color: var(--accent-2); background: var(--accent-soft); }
.cl-text h3 { margin: 2px 0 0; font-size: 17px; letter-spacing: -0.02em; }
.cl-body { font-size: 13.5px; line-height: 1.55; color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.cl-body p { margin: 8px 0 4px; }
.cl-body ul { margin: 4px 0; padding-left: 20px; }
.cl-body li { margin: 3px 0; }
.cl-body li::marker { color: var(--accent-2); }
.cl-thumb { width: 64px; height: 40px; flex: none; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(120% 140% at 0% 0%, #1f6fe0, #0a0f1d); }
.cl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cl-thumb img[src$="logo.png"] { width: 26px; height: auto; object-fit: contain; }
.cl-banner-edit { aspect-ratio: 3 / 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.cl-banner-edit img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cl-row { display: flex; gap: 10px; }
.cl-row .field:first-child { width: 120px; flex: none; }
.cl-row .grow { flex: 1; }
.cl-form textarea.input { height: auto; padding: 10px 13px; resize: vertical; font: inherit; line-height: 1.5; }

/* admin */
.admin-body { display: grid; gap: 14px; overflow-y: auto; margin: 0 -6px; padding: 0 6px 6px; animation: rise 0.3s var(--ease) both; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.stat-tile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line); animation: item-in 0.4s var(--ease) both; }
.stat-tile > div { display: grid; min-width: 0; }
.stat-tile b { font-size: 20px; letter-spacing: -0.02em; }
.stat-tile span { font-size: 12px; color: var(--muted); }
.stat-tile small { font-size: 11px; color: var(--muted); opacity: 0.8; }

/* Wavey typing */
.msg.typing .msg-body { padding: 12px 16px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); animation: dot-bounce 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* update notice link */
.updated-text .link { justify-self: start; font-size: 12.5px; margin-top: 2px; }

@media (max-width: 760px) {
  .row-item { gap: 10px; padding: 8px; }
  .row-item .small-btn span { display: none; }
  .row-item .small-btn { width: 36px; padding: 0; justify-content: center; }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mem-stack img { width: 48px; height: 48px; margin-left: -18px; }
  .mem-text b { font-size: 16px; }
  .share-chip { margin: 6px 0 0; }
  .link-row { grid-template-columns: 1fr auto auto; }
  .link-row [data-native] { display: none; }
  .cl-row { flex-direction: column; }
  .cl-row .field:first-child { width: auto; }
  .tabs button { font-size: 12px; gap: 5px; }
}

/* ---------- public share page ---------- */
html:has(body.share-page), body.share-page { height: auto; min-height: 100%; overflow: auto; }
body.share-page { user-select: text; -webkit-user-select: text; }
.sp-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(16px + var(--safe-top)) 22px 16px; }
.sp-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.sp-brand img { width: 34px; }
.sp-brand i { font-style: normal; font-weight: 400; color: var(--accent-2); }
.sp-badge { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line); }
.sp-badge:empty { display: none; }
.sp-main { position: relative; display: grid; justify-items: center; padding: 10px 16px calc(40px + var(--safe-bottom)); }
.sp-card { width: min(980px, 100%); padding: 24px; border-radius: 20px; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: 0 40px 90px -40px #000; animation: rise 0.5s var(--ease) both; }
.sp-center { width: min(440px, 100%); display: grid; justify-items: center; gap: 10px; text-align: center; }
.sp-center .bubble, .sp-upload .bubble { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.sp-center .bubble svg, .sp-upload .bubble svg { width: 28px; height: 28px; }
.sp-card h1 { margin: 4px 0 0; font-size: 20px; letter-spacing: -0.02em; }
.sp-card p { margin: 0; }
.sp-pw .input, .sp-pw .btn { width: 100%; }
.sp-file { width: min(760px, 100%); display: grid; gap: 18px; }
.sp-preview { display: grid; place-items: center; border-radius: 14px; overflow: hidden; background: rgba(0, 0, 0, 0.35); min-height: 200px; }
.sp-media { max-width: 100%; max-height: 70vh; display: block; }
.sp-kind { width: 96px; height: 96px; margin: 40px; border-radius: 24px; display: grid; place-items: center; color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, transparent); }
.sp-kind svg { width: 44px; height: 44px; }
.sp-kind.small { width: 100%; height: 100%; margin: 0; border-radius: 0; }
.sp-kind.small svg { width: 32px; height: 32px; }
.sp-file-info { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sp-file-info h1 { overflow-wrap: anywhere; }
.sp-folder { display: grid; gap: 16px; }
.sp-folder-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sp-folder-head .crumbs { font-size: 18px; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sp-item { display: grid; gap: 6px; text-align: left; animation: item-in 0.4s var(--ease) both; }
.sp-thumb { aspect-ratio: 1; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: var(--raise); border: 1px solid var(--line); color: var(--accent-2); transition: transform 0.25s var(--spring), border-color 0.2s; }
.sp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sp-item.folder .sp-thumb svg { width: 44px; height: 44px; fill: rgba(47, 155, 255, 0.2); }
.sp-item:hover .sp-thumb { transform: translateY(-2px); border-color: var(--line-2); }
.sp-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-name small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.sp-viewer { width: min(900px, 100%); }
.sp-viewer-head { display: flex; align-items: center; gap: 10px; }
.sp-viewer-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-upload { width: min(560px, 100%); display: grid; justify-items: center; gap: 12px; text-align: center; }
.sp-drop { width: 100%; display: grid; gap: 4px; padding: 34px 20px; border-radius: 16px; border: 2px dashed var(--line-2); background: var(--raise); cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.2s var(--spring); }
.sp-drop:hover, .sp-drop.over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.sp-drop b { font-size: 15px; color: var(--accent-2); }
.sp-drop span { font-size: 12.5px; color: var(--muted); }
.sp-ups { width: 100%; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.sp-up { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); font-size: 13px; animation: item-in 0.3s var(--ease) both; }
.sp-up .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sp-up .s { color: var(--muted); font-size: 12px; }
.sp-up .bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--raise-2); overflow: hidden; }
.sp-up .bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.3s var(--ease); }
.sp-up.done .s { color: #3ecf8e; }
.sp-up.done .bar i { background: #3ecf8e; }
.sp-up.err .s { color: #ff8795; }
.sp-up.err .bar i { background: #f2566d; }

/* ---------- light design ---------- */
html.theme-light {
  --bg: #f3f5f9; --side: #ffffff; --panel: #ffffff; --panel-solid: #ffffff;
  --raise: rgba(15, 23, 42, 0.035); --raise-2: rgba(15, 23, 42, 0.075);
  --line: rgba(15, 23, 42, 0.09); --line-2: rgba(15, 23, 42, 0.15);
  --text: #141821; --muted: #667085; --accent-2: #1b78dd; --accent-soft: rgba(47, 155, 255, 0.12);
  color-scheme: light;
}
html.theme-light .backdrop { background: radial-gradient(90vmax 55vmax at 78% -22%, rgba(47, 155, 255, 0.12), transparent 60%), radial-gradient(70vmax 50vmax at -10% 110%, rgba(62, 207, 142, 0.08), transparent 60%); }
html.theme-light .field input, html.theme-light .input, html.theme-light .search, html.theme-light .seg, html.theme-light .sup-filters,
html.theme-light .sup-cat, html.theme-light .sup-form textarea, html.theme-light .sup-compose textarea, html.theme-light .msg-edit, html.theme-light .code-box,
html.theme-light .qr .url, html.theme-light .sp-preview { background: #fff; }
html.theme-light .search:focus-within { background: #fff; }
html.theme-light .sup-list { background: rgba(15, 23, 42, 0.025); }
html.theme-light .menu { background: rgba(255, 255, 255, 0.98); box-shadow: 0 26px 60px -20px rgba(15, 23, 42, 0.35); }
html.theme-light .menu button.danger, html.theme-light .menu button.danger svg, html.theme-light .danger-text { color: #d6334b; }
html.theme-light .toast, html.theme-light .bulk, html.theme-light .update, html.theme-light .uploads, html.theme-light .drag-chip, html.theme-light .updated { background: #fff; box-shadow: 0 20px 44px -18px rgba(15, 23, 42, 0.35); }
html.theme-light .toast.error { color: #c22740; }
html.theme-light .modal, html.theme-light .sp-card { box-shadow: 0 40px 90px -30px rgba(15, 23, 42, 0.45); }
html.theme-light .modal-back { background: rgba(15, 23, 42, 0.35); }
html.theme-light .card:hover, html.theme-light .folder:hover { box-shadow: 0 14px 28px -20px rgba(15, 23, 42, 0.45); }
html.theme-light .thumb { background: rgba(15, 23, 42, 0.05); }
html.theme-light .tabbar { background: rgba(255, 255, 255, 0.9); box-shadow: 0 18px 44px -18px rgba(15, 23, 42, 0.4); }
html.theme-light .sidebar { background: #fff; border-right: 1px solid var(--line); }
html.theme-light .msg.mine .msg-body { background: linear-gradient(180deg, rgba(62, 166, 255, 0.18), rgba(31, 134, 242, 0.12)); }
html.theme-light .avatar.image, html.theme-light .ficon.tile.image { background: #e8ecf2; }
html.theme-light .tag.blue, html.theme-light .share-chip, html.theme-light .row-ico.link-ico { color: #1b6fc9; }
html.theme-light .tag.green, html.theme-light .perm-btn.write, html.theme-light .row-ico.link-ico.upload { color: #13895a; }
html.theme-light .tag.red { color: #c22740; }
html.theme-light .mem-text small { color: #c2337a; }
html.theme-light .memories { background: linear-gradient(120deg, rgba(232, 121, 166, 0.18), rgba(47, 155, 255, 0.14) 60%, rgba(62, 207, 142, 0.12)); }
html.theme-light .tabs button.on, html.theme-light .sup-filters button.on, html.theme-light .seg-pill { background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15); }
html.theme-light .seg button.on { color: var(--text); }

a.btn { text-decoration: none; }
a.btn.ghost { color: var(--text); }
a.btn.primary { color: #fff; }

.cl-list { display: flex; flex-direction: column; min-height: 0; }
.cl-entry { flex: none; }
.cl-art img { width: 64px; height: auto; object-fit: contain; }
.admin-body, .share-body { min-height: 0; }
.admin-body > *, .share-body > * { flex: none; }

/* Wavey hat an das Team übergeben */
.sup-handoff { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px auto 2px; padding: 6px 12px; width: fit-content; max-width: 100%; border-radius: 999px; font-size: 12px; color: var(--muted); background: rgba(127, 127, 127, 0.1); animation: boot-up 0.4s ease both; }
.sup-handoff svg { width: 14px; height: 14px; flex: none; }

/* ---------- 2.0: verified badge, calmer tags, moderation ---------- */

.vbadge { display: inline-block; width: 1.05em; height: 1.05em; min-width: 14px; min-height: 14px; margin-left: 0.3em; vertical-align: -0.16em; flex: none; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.acc-text b { display: flex; align-items: center; min-width: 0; }
.acc-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-users .row-text b { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 0; }
.admin-users .uname { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sup-who { display: inline-flex; align-items: center; min-width: 0; }

/* Tags and status: flat and quiet – a small dot carries the colour, no glows or tinted borders. */
.tag { height: 18px; padding: 0 6px; margin-left: 6px; border-radius: 5px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; color: var(--muted); background: var(--raise-2); border: 0; }
.tag.blue, .tag.red, .tag.green { background: var(--raise-2); }
.tag.blue { color: #8ec5f5; }
.tag.red { color: #f2909c; }
.tag.green { color: #7fd3ac; }
.pill { gap: 6px; padding: 2px 8px; border-radius: 6px; font-weight: 500; color: var(--muted); background: var(--raise-2); border: 0; }
.pill i, .status-btn i, .menu-dot { width: 6px; height: 6px; box-shadow: none; }
.status-btn { height: 30px; border-radius: 8px; font-weight: 500; color: var(--text); background: var(--raise-2); border: 1px solid var(--line); }
.status-btn:hover { background: var(--raise-3, rgba(255, 255, 255, 0.1)); }
.sup-item.unread .sup-item-top b::before { width: 7px; height: 7px; box-shadow: none; }
.ai-badge { height: 17px; padding: 0 6px; border-radius: 5px; font-size: 10px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); background: var(--raise-2); border: 0; }
.ai-badge.staff { color: #8ec5f5; }
.msg-who { align-items: center; }
.msg-who b { display: inline-flex; align-items: center; }

.icon-btn.danger-hover:hover { color: #ff8795; background: rgba(242, 86, 109, 0.12); }
.sup-thread-head .icon-btn[data-del-ticket] { flex: none; }

.ban-note { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: #f2909c; }
.ban-note svg { width: 13px; height: 13px; flex: none; }
.ban-durations { display: flex; flex-wrap: wrap; gap: 6px; }
.ban-durations .chip { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text); background: var(--raise-2); border: 1px solid var(--line); transition: background 0.15s, border-color 0.15s, transform 0.15s var(--spring); }
.ban-durations .chip:hover { background: var(--raise-3, rgba(255, 255, 255, 0.1)); }
.ban-durations .chip:active { transform: scale(0.96); }
.ban-durations .chip.on { color: #fff; background: rgba(242, 86, 109, 0.22); border-color: rgba(242, 86, 109, 0.55); }

html.theme-light .tag.blue, html.theme-light .ai-badge.staff { color: #1b6fc9; }
html.theme-light .tag.green { color: #13895a; }
html.theme-light .tag.red, html.theme-light .ban-note { color: #c22740; }
html.theme-light .ban-durations .chip.on { color: #a3152c; background: rgba(242, 86, 109, 0.12); }

/* ---------- 2.1: friends, chats and attachments ---------- */

.fr-logo { color: var(--accent-2); }
.fr-logo svg { width: 22px; height: 22px; }
.fr-bubble { color: var(--accent-2); }
.fr-bubble svg { width: 34px; height: 34px; }
.fr-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); color: var(--muted); }
.fr-search svg { width: 15px; height: 15px; flex: none; }
.fr-search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 13px; }
.fr-search:focus-within { border-color: var(--accent); }
.fr-sec { padding: 10px 6px 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.fr-req { cursor: default; }
.fr-req .icon-btn { width: 32px; height: 32px; flex: none; }
.fr-req .fr-yes { color: #3ecf8e; }
.fr-req .fr-yes:hover { background: rgba(62, 207, 142, 0.14); color: #3ecf8e; }
.fr-unread { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); flex: none; }
.sup-item-meta i { font-style: normal; opacity: 0.8; }

.avatar.online { position: relative; overflow: visible; }
.avatar.online::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: #3ecf8e; border: 2px solid var(--panel-solid); }
.avatar.image.online img { border-radius: inherit; }
.avatar.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 26px; }
.fr-online { color: #3ecf8e; }
.fr-typing { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-2); }
.fr-typing .dots i { width: 5px; height: 5px; }

.fr-add-row { display: flex; gap: 8px; }
.fr-add-row .input { flex: 1; min-width: 0; }
.fr-add-row .btn svg, .fr-card .btn svg { width: 16px; height: 16px; }
.fr-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line-2); animation: rise 0.35s var(--ease) both; }
.fr-card > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fr-card b { display: inline-flex; align-items: center; font-size: 15px; }
.fr-card .avatar.md { width: 44px; height: 44px; border-radius: 13px; font-size: 17px; }

.fr-msgs { gap: 3px; }
.fr-msgs .msg { max-width: 76%; margin-top: 10px; }
.fr-msgs .msg.cont { margin-top: 0; }
.msg-av-gap { width: 34px; flex: none; }
.msg.chat .msg-col { gap: 4px; }
.msg.chat .msg-body { border-radius: 16px; }
.msg.chat:not(.mine):not(.cont) .msg-body { border-top-left-radius: 6px; }
.msg.chat.mine:not(.cont) .msg-body { border-top-right-radius: 6px; }
.msg-meta { display: flex; align-items: center; gap: 6px; min-height: 18px; font-size: 11px; color: var(--muted); }
.msg.mine .msg-meta { flex-direction: row-reverse; }
.msg.chat.cont .msg-meta time { opacity: 0; transition: opacity 0.15s; }
.msg.chat:hover .msg-meta time { opacity: 1; }
.msg-meta .msg-edit-btn { width: 22px; height: 22px; }
.msg-meta .msg-edit-btn:hover { color: #ff8795; }
.fr-seen { display: inline-flex; align-items: center; gap: 3px; color: var(--accent-2); font-weight: 600; }
.fr-seen svg { width: 12px; height: 12px; stroke-width: 2.6; }
.chat-day { display: flex; justify-content: center; margin: 14px 0 4px; }
.chat-day span { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--raise-2); }
.fr-older { align-self: center; margin-bottom: 4px; }
.fr-hello { margin: auto; display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--muted); max-width: 320px; animation: rise 0.45s var(--ease) both; }
.fr-hello b { color: var(--text); font-size: 15px; }

.fr-folder { display: flex; align-items: center; gap: 11px; min-width: 240px; max-width: 100%; padding: 10px 12px; border-radius: 14px; text-align: left; background: var(--raise-2); border: 1px solid var(--line-2); transition: background 0.15s, transform 0.2s var(--spring); }
.fr-folder:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.fr-folder > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fr-folder b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.fr-folder small { color: var(--muted); font-size: 11.5px; }
.fr-folder > svg { width: 16px; height: 16px; color: var(--muted); flex: none; }

.fr-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fr-mode { display: grid; justify-items: start; align-content: start; gap: 5px; padding: 14px; border-radius: 14px; text-align: left; background: var(--raise); border: 1px solid var(--line); transition: border-color 0.15s, background 0.15s, transform 0.2s var(--spring); }
.fr-mode:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.fr-mode > span { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); margin-bottom: 3px; }
.fr-mode > span svg { width: 19px; height: 19px; }
.fr-mode b { font-size: 14px; }
.fr-mode small { font-size: 12px; line-height: 1.4; color: var(--muted); }

/* composer: paperclip and the tray of pending attachments */
.att-btn { width: 42px; height: 42px; flex: none; border-radius: 12px; }
.att-btn svg { width: 19px; height: 19px; }
.att-tray { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px 0; scrollbar-width: thin; }
.sup-form .att-tray { padding: 0; flex-wrap: wrap; }
.att-chip { position: relative; display: flex; align-items: center; gap: 9px; flex: none; width: 210px; padding: 7px 30px 7px 7px; border-radius: 12px; background: var(--raise-2); border: 1px solid var(--line); overflow: hidden; animation: pop-in 0.3s var(--spring) both; }
.att-chip.bundle { width: 260px; }
.att-chip.err { border-color: rgba(242, 86, 109, 0.5); }
.att-chip.err small { color: #ff8795; }
.att-chip-img, .att-chip-ico { width: 36px; height: 36px; flex: none; border-radius: 9px; object-fit: cover; }
.att-chip-ico { display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--accent)) 18%, transparent); color: var(--c, var(--accent-2)); }
.att-chip-ico svg { width: 18px; height: 18px; }
.att-chip-text { min-width: 0; display: grid; gap: 1px; }
.att-chip-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.att-chip-text small { font-size: 11px; color: var(--muted); }
.att-chip-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); transition: width 0.2s; }
.att-chip-x { position: absolute; right: 5px; top: 50%; translate: 0 -50%; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.att-chip-x:hover { background: var(--raise-2); color: var(--text); }
.att-chip-x svg { width: 13px; height: 13px; }
.sup-new-actions { align-items: center; }
.sup-new-actions .btn svg { width: 16px; height: 16px; }
.sup-main.drop-hover { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }

/* attachments inside messages */
.att-block, .att-bundle { display: grid; gap: 6px; width: min(340px, 100%); }
.att-media { display: grid; gap: 3px; border-radius: 14px; overflow: hidden; }
.att-media.n2, .att-media.n4 { grid-template-columns: 1fr 1fr; }
.att-media.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.att-media.n3 .att-thumb:first-child { grid-row: span 2; aspect-ratio: auto; }
.att-thumb { position: relative; display: block; min-height: 90px; aspect-ratio: 1; background: var(--raise-2); overflow: hidden; }
.att-media.n1 .att-thumb { aspect-ratio: auto; max-height: 320px; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s var(--ease); }
.att-media.n1 .att-thumb img { height: auto; max-height: 320px; }
.att-thumb:hover img { transform: scale(1.03); }
.att-play { position: absolute; inset: 0; display: grid; place-items: center; }
.att-play svg { width: 40px; height: 40px; padding: 11px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; fill: #fff; backdrop-filter: blur(6px); }
.att-more { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.5); }
.att-file { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; border-radius: 12px; background: var(--raise-2); border: 1px solid var(--line); }
.att-file-ico { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.att-file-ico svg { width: 17px; height: 17px; }
.att-file-text { flex: 1; min-width: 0; display: grid; gap: 1px; text-align: left; }
.att-file-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.att-file-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--muted); }
.att-file-text:hover b { text-decoration: underline; }
.att-file .icon-btn { width: 30px; height: 30px; flex: none; }
.att-file .icon-btn svg { width: 15px; height: 15px; }
.att-all, .att-bundle-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.msg.mine .att-all { justify-content: flex-end; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text); background: var(--raise-2); border: 1px solid var(--line); transition: background 0.15s, border-color 0.15s; }
.chip-btn:hover, .chip-btn.on { background: rgba(255, 255, 255, 0.1); border-color: var(--line-2); }
.chip-btn svg { width: 14px; height: 14px; }
.att-bundle { padding: 10px; border-radius: 14px; background: var(--raise-2); border: 1px solid var(--line-2); }
.att-bundle-head { display: flex; align-items: center; gap: 10px; }
.att-bundle-head > span:last-child { min-width: 0; display: grid; gap: 1px; }
.att-bundle-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.att-bundle-head small { font-size: 11.5px; color: var(--muted); }
.att-bundle-ico { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.att-bundle-ico svg { width: 19px; height: 19px; }
.att-bundle-list { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
.att-bundle-list .att-file { background: var(--raise); }

/* attachment viewer */
.modal.att-viewer { width: min(1100px, 100%); height: min(860px, 92vh); max-height: none; padding: 0; gap: 0; overflow: hidden; background: #0b0b0d; outline: none; }
.att-viewer-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.att-viewer-head > div { flex: 1; min-width: 0; display: grid; }
.att-viewer-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-viewer-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px; overflow: hidden; }
.att-viewer-stage img, .att-viewer-stage video { width: 100%; height: 100%; object-fit: contain; animation: rise 0.3s var(--ease) both; }
.att-viewer-stage iframe { width: 100%; height: 100%; border: 0; border-radius: 10px; background: #fff; }
.att-viewer-stage audio { width: min(460px, 100%); }
.att-viewer-file { display: grid; justify-items: center; gap: 10px; max-width: 340px; text-align: center; }
.att-viewer-file > span:first-child { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.att-viewer-file > span:first-child svg { width: 34px; height: 34px; }
.att-nav { position: absolute; top: 50%; translate: 0 -50%; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.12); backdrop-filter: blur(8px); transition: background 0.15s; }
.att-nav:hover { background: rgba(0, 0, 0, 0.75); }
.att-nav svg { width: 20px; height: 20px; }
.att-nav.prev { left: 14px; }
.att-nav.next { right: 14px; }

/* picking files from the own cloud */
.modal.cloud-pick { width: min(620px, 100%); height: min(640px, 86vh); }
.cloud-pick-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 13px; }
.cloud-pick-crumbs svg { width: 13px; height: 13px; color: var(--muted); }
.cloud-pick-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 3px; margin: 0 -8px; padding: 0 8px; scrollbar-width: thin; }
.cloud-pick-row { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 10px; text-align: left; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s; }
.cloud-pick-row:hover { background: var(--raise); }
.cloud-pick-row.on { background: var(--accent-soft); border-color: rgba(47, 155, 255, 0.4); }
.cloud-pick-row img, .cloud-pick-ico { width: 36px; height: 36px; flex: none; border-radius: 8px; object-fit: cover; }
.cloud-pick-ico { display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.cloud-pick-ico svg { width: 18px; height: 18px; }
.cloud-pick-row.folder .ficon { --fs: 26px; width: 36px; display: grid; place-items: center; }
.cloud-pick-row.folder > svg { width: 16px; height: 16px; color: var(--muted); }
.cloud-pick-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.cloud-pick-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 500; }
.cloud-pick-text small { font-size: 11.5px; color: var(--muted); }
.cloud-pick-check { width: 20px; height: 20px; flex: none; border-radius: 6px; display: grid; place-items: center; border: 1.5px solid var(--line-2); color: transparent; transition: background 0.15s, border-color 0.15s; }
.cloud-pick-check svg { width: 13px; height: 13px; stroke-width: 3; }
.cloud-pick-row.on .cloud-pick-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.cloud-pick-more { justify-self: center; margin-top: 6px; }
.cloud-pick-empty { padding: 30px 0; text-align: center; }
.cloud-pick .actions .btn svg { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .fr-msgs .msg { max-width: 88%; }
  .fr-modes { grid-template-columns: 1fr; }
  .att-block, .att-bundle { width: min(300px, 100%); }
  .att-nav { width: 36px; height: 36px; }
  .modal.att-viewer { height: 92vh; }
}

html.theme-light .fr-search, html.theme-light .att-chip, html.theme-light .att-file, html.theme-light .fr-card { background: #fff; }
html.theme-light .modal.att-viewer { background: #fff; }
html.theme-light .chip-btn:hover, html.theme-light .chip-btn.on, html.theme-light .fr-folder:hover { background: rgba(15, 23, 42, 0.08); }
.msg.still, .msg.still .att-chip { animation: none; }
