/* DistroFinder design system — dark, glass surfaces over a live 3D backdrop */
:root {
  --bg: #07090a;
  --surface: rgba(18, 22, 21, 0.72);
  --surface-solid: #121615;
  --surface-2: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef2ef;
  --text-2: #b4bdb8;
  --muted: #7c8781;
  --accent: #1ed760;
  --accent-ink: #03140a;
  --accent-soft: rgba(30, 215, 96, 0.14);
  --violet: #8b5cf6;
  --warn: #f5b83d;
  --warn-soft: rgba(245, 184, 61, 0.14);
  --danger: #f0616a;
  --danger-soft: rgba(240, 97, 106, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 700px at 80% -10%, rgba(139, 92, 246, 0.16), transparent 60%),
              radial-gradient(900px 600px at -10% 110%, rgba(30, 215, 96, 0.12), transparent 60%),
              var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }

/* 3D canvas sits behind everything */
#bg3d { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
#bg3d.ready { opacity: 1; }
.shell { position: relative; z-index: 1; }

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px max(16px, calc((100vw - 1120px) / 2));
  background: rgba(7, 9, 10, 0.6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); font-weight: 700; }
.logo {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--accent) 0 18%, #0b0d0c 19% 30%, #1b1f1d 31% 33%, #0b0d0c 34% 52%, #1b1f1d 53% 55%, #0b0d0c 56%);
  box-shadow: 0 0 0 1px var(--line-strong), 0 0 24px rgba(30, 215, 96, 0.35);
  animation: spin 6s linear infinite;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a { color: var(--text-2); padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.nav-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--violet)); color: #fff; font-weight: 700; font-size: 13px; text-transform: uppercase;
}
.nav-user .name { font-size: 14px; color: var(--text-2); }
.nav-me { display: flex; align-items: center; gap: 10px; padding: 3px 4px 3px 10px; border-radius: 99px; color: inherit; }
.nav-me:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- Layout ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 40px 16px 96px; }
.page-head { margin-bottom: 28px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.page-head h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.03em; margin: 8px 0 10px; }
.page-head p { color: var(--text-2); margin: 0; max-width: 620px; }
.grad { background: linear-gradient(90deg, var(--accent), #7cf5a8 40%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  min-width: 0;
}
.card-pad { padding: 22px 24px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 16px; display: flex; align-items: baseline; gap: 8px; }
.card-title small { color: var(--muted); font-weight: 400; font-size: 13px; }

/* 3D tilt (driven by app.js) */
.tilt { transform-style: preserve-3d; transition: transform 0.25s ease, box-shadow 0.25s ease; will-change: transform; }
.tilt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.06), transparent 40%);
  opacity: 0; transition: opacity 0.3s;
}
.tilt:hover::after { opacity: 1; }
.tilt:hover { box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--line-strong); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.input {
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.35); color: var(--text);
  font: inherit; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: rgba(0, 0, 0, 0.5); }
textarea.input { resize: vertical; min-height: 110px; font-family: var(--mono); font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-sm); border: 0; cursor: pointer;
  font: 600 15px var(--font); color: var(--accent-ink); background: var(--accent); white-space: nowrap;
  box-shadow: 0 8px 30px -8px rgba(30, 215, 96, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 12px 36px -8px rgba(30, 215, 96, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: wait; transform: none; }
.btn-ghost { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--line-strong); background: rgba(255, 255, 255, 0.08); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }

/* ---------- Pills, chips, alerts ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.high { background: var(--accent-soft); color: var(--accent); }
.pill.mid { background: var(--warn-soft); color: var(--warn); }
.pill.low { background: var(--danger-soft); color: var(--danger); }
.chip { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; margin: 2px 4px 2px 0; white-space: nowrap; color: var(--text); }
.chip.muted { color: var(--muted); }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.alert.error { background: var(--danger-soft); color: #ffb3b8; border: 1px solid rgba(240, 97, 106, 0.3); }
.alert.warn { background: var(--warn-soft); color: #ffd98a; border: 1px solid rgba(245, 184, 61, 0.25); }
.alert.ok { background: var(--accent-soft); color: #9ff0bf; border: 1px solid rgba(30, 215, 96, 0.3); }
.muted { color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--surface-2); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Entrance animations ---------- */
.reveal { opacity: 0; transform: translateY(18px) scale(0.985); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0ms); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,0.04) 0, rgba(255,255,255,0.09) 40%, rgba(255,255,255,0.04) 80%); background-size: 800px 100%; animation: shimmer 1.4s infinite linear; }

/* ---------- shared mini player (public/player.js), docked bottom-right ---------- */
.play { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--accent); cursor: pointer; font-size: 12px; display: grid; place-items: center; transition: transform .15s, background .2s; flex-shrink: 0; }
.play:hover { transform: scale(1.08); background: var(--accent-soft); }
.play.on { background: var(--accent); color: var(--accent-ink); }
.plat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.plat i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
#player { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: min(400px, calc(100vw - 32px)); display: flex; gap: 10px; align-items: center; padding: 12px 14px; flex-wrap: wrap; box-shadow: 0 24px 60px -16px rgba(0,0,0,.85), 0 0 0 1px var(--line-strong); }
#player audio { height: 36px; width: 100%; }
#player iframe { border: 0; border-radius: 12px; width: 100%; }
.item-title { font-weight: 500; }
.item-sub { color: var(--muted); font-size: 12px; }

/* ---------- role tag + announcements ---------- */
.role-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 2px 7px; border-radius: 6px; margin-left: 6px; vertical-align: middle;
  background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; box-shadow: 0 0 12px rgba(239, 68, 68, .35); }
.ann-wrap { position: relative; z-index: 15; display: grid; gap: 6px; padding: 10px max(16px, calc((100vw - 1120px) / 2)) 0; }
.ann { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; font-size: 14px; background: rgba(59, 130, 246, .14); border: 1px solid rgba(59, 130, 246, .35); color: #bfdbfe; }
.ann.warn { background: var(--warn-soft); border-color: rgba(245, 184, 61, .35); color: #ffd98a; }
.ann.success { background: var(--accent-soft); border-color: rgba(30, 215, 96, .35); color: #a6f2c4; }
.ann > span:first-child { flex: 1; }
.ann-by { font-size: 12px; opacity: .7; }
.ann button { border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .7; }

/* ---------- TR/EN switch ---------- */
.langsw { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.langsw button { border: 0; background: none; color: var(--text-2); font: 700 12px var(--font); padding: 5px 9px; border-radius: 7px; cursor: pointer; }
.langsw button.on { background: var(--accent); color: var(--accent-ink); }
.langsw-float { position: fixed; top: 16px; right: 16px; z-index: 30; }

/* ---------- Cookie banner + footer ---------- */
#cookie-banner { position: fixed; left: 16px; bottom: 16px; z-index: 60; width: min(440px, calc(100vw - 32px)); padding: 16px 18px; box-shadow: 0 24px 60px -16px rgba(0,0,0,.85), 0 0 0 1px var(--line-strong); }
#cookie-banner .cb-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }
#cookie-banner .cb-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
#site-foot { position: relative; z-index: 1; text-align: center; font-size: 12px; color: var(--muted); padding: 0 16px 28px; }
#site-foot a { color: var(--muted); }
#site-foot a:hover { color: var(--text-2); }

/* ---------- Toast ---------- */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; z-index: 50; transition: all 0.3s; pointer-events: none; padding: 12px 18px; border-radius: 12px; background: var(--surface-solid); box-shadow: var(--shadow); font-size: 14px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  /* two rows: logo + account on top, the page links as a swipeable strip below */
  .nav { gap: 10px 12px; padding: 10px 16px 8px; flex-wrap: wrap; }
  .nav-user { gap: 6px; }
  .nav-user .name { display: none; }
  .nav-user .role-tag { display: none; }
  .brand span { display: none; }
  .nav-links { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; flex-shrink: 0; padding: 7px 11px; }
  .page { padding-top: 28px; }
  .card-pad { padding: 18px; }
  .table-wrap { overflow-x: auto; }
}
body { overflow-x: hidden; }
/* the team wants the motion even with Windows "reduce animations" on, so no global switch-off */

/* ---------- chat messages (chat page + docked window) ---------- */
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg .avatar { flex-shrink: 0; }
.msg .body { min-width: 0; flex: 1; }
.msg .meta { display: flex; gap: 8px; align-items: baseline; font-size: 13px; flex-wrap: wrap; }
.msg .meta b { font-size: 14px; }
.msg .meta time { color: var(--muted); font-size: 12px; }
.msg .text { white-space: pre-wrap; word-break: break-word; color: var(--text); font-size: 14.5px; margin-top: 2px; }
.msg.deleted .text { color: var(--muted); font-style: italic; }
.msg .del { opacity: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.msg:hover .del { opacity: 1; }
.msg .del:hover { color: var(--danger); background: var(--danger-soft); }
.msg.mine .meta b { color: var(--accent); }
.msg-in { animation: msgIn .55s cubic-bezier(.2, .9, .25, 1.2) both; }
.msg-in .text { animation: msgGlow 1.6s ease-out; border-radius: 8px; }
.msg.mine.msg-in { animation-name: msgInMine; }
@keyframes msgIn { from { opacity: 0; transform: translate(-18px, 14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes msgInMine { from { opacity: 0; transform: translate(18px, 14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes msgGlow { 0% { background: var(--accent-soft); box-shadow: 0 0 0 6px var(--accent-soft); } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }
.live-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }
.dock-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: livePulse 1.8s infinite; flex-shrink: 0; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(30, 215, 96, .55); } 70% { box-shadow: 0 0 0 8px rgba(30, 215, 96, 0); } 100% { box-shadow: 0 0 0 0 rgba(30, 215, 96, 0); } }
.nav-links a { position: relative; }
.unread { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; animation: popIn .35s cubic-bezier(.2, .9, .25, 1.4); }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

/* docked mini chat, top-right */
#chat-dock { position: fixed; top: 78px; right: 16px; z-index: 60; width: 340px; max-width: calc(100vw - 16px); height: 430px; max-height: calc(100vh - 16px);
  display: flex; flex-direction: column; padding: 0; overflow: hidden; background: rgba(14, 17, 16, 0.94); backdrop-filter: blur(16px);
  animation: dockIn .45s cubic-bezier(.2, .9, .25, 1.15); transform-origin: top right; }
#chat-dock[hidden] { display: none; }
#chat-dock[style*="left"] { right: auto; }
#chat-dock.dock-min { height: 46px !important; }
#chat-dock.dragging { user-select: none; transition: none; box-shadow: var(--shadow), 0 0 0 1px var(--accent), 0 24px 60px -20px rgba(0, 0, 0, .8); }
#chat-dock.dragging iframe { pointer-events: none; }
.dock-head { cursor: grab; touch-action: none; }
#chat-dock.dragging .dock-head { cursor: grabbing; }
.dock-grip { position: absolute; left: 0; bottom: 0; width: 18px; height: 18px; cursor: nesw-resize; touch-action: none; z-index: 2;
  background: linear-gradient(45deg, transparent 0 45%, var(--line-strong) 45% 52%, transparent 52% 64%, var(--line-strong) 64% 71%, transparent 71%); }
.dock-grip:hover { background: linear-gradient(45deg, transparent 0 45%, var(--accent) 45% 52%, transparent 52% 64%, var(--accent) 64% 71%, transparent 71%); }
#chat-dock.dock-min .dock-grip { display: none; }
#chat-dock.dock-big .dock-msgs .msg .text { font-size: 14.5px; }
#chat-dock.dock-min .dock-msgs, #chat-dock.dock-min .dock-form { display: none; }
@keyframes dockIn { from { opacity: 0; transform: translateY(-12px) scale(.9); } to { opacity: 1; transform: none; } }
.dock-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.dock-head b { flex: 1; }
.dock-head button, .dock-head a { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; font-size: 16px; text-decoration: none; }
.dock-head button:hover, .dock-head a:hover { background: var(--line); color: var(--text); }
.dock-head [data-d="x"]:hover { background: var(--danger-soft); color: var(--danger); }
.dock-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.dock-msgs .msg { gap: 9px; }
.dock-msgs .msg .text { font-size: 13.5px; }
.dock-msgs .msg .meta b { font-size: 13px; }
.dock-msgs .empty { margin: auto; color: var(--muted); font-size: 13px; }
.dock-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.dock-form .input { flex: 1; padding: 9px 12px; font-size: 14px; }

/* new-message notifications */
#chat-notes { position: fixed; top: 78px; right: 16px; z-index: 61; display: flex; flex-direction: column; gap: 10px; width: 330px; max-width: calc(100vw - 32px); pointer-events: none; }
.chat-note { pointer-events: auto; position: relative; display: flex; gap: 11px; padding: 12px 34px 12px 12px; border-radius: 14px; background: rgba(18, 22, 21, 0.96); backdrop-filter: blur(14px);
  box-shadow: var(--shadow), 0 0 0 1px var(--accent-soft); cursor: pointer; animation: noteIn .5s cubic-bezier(.2, .9, .25, 1.2) both; }
.chat-note::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); }
.chat-note.out { animation: noteOut .25s ease-in forwards; }
@keyframes noteIn { from { opacity: 0; transform: translateX(60px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes noteOut { to { opacity: 0; transform: translateX(60px); } }
.cn-body { min-width: 0; flex: 1; }
.cn-head { font-size: 13px; display: flex; align-items: baseline; gap: 6px; }
.cn-head span:last-child { color: var(--muted); font-size: 11.5px; margin-left: auto; }
.cn-text { font-size: 13.5px; color: var(--text); margin-top: 3px; word-break: break-word; }
.cn-actions { display: flex; gap: 6px; margin-top: 8px; }
.cn-actions button { border: 0; border-radius: 7px; padding: 4px 9px; font-size: 12px; cursor: pointer; background: var(--line); color: var(--text); }
.cn-actions button[data-a="open"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.cn-x { position: absolute; top: 6px; right: 6px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; width: 24px; height: 24px; border-radius: 6px; }
.cn-x:hover { background: var(--line); color: var(--text); }

/* ---------- round cursor follower ---------- */
.cur-dot, .cur-ring { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; border-radius: 50%; }
.cur-dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.cur-ring { width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 1.5px solid var(--accent); opacity: .6;
  transition: width .2s, height .2s, margin .2s, background .2s, opacity .2s, border-radius .2s; }
.cur-ring.hot { width: 56px; height: 56px; margin: -28px 0 0 -28px; background: var(--accent-soft); opacity: .9; }
.cur-ring.text { width: 4px; height: 26px; margin: -13px 0 0 -2px; border-radius: 2px; background: var(--accent); }
.cur-ring.down { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
html.has-cursor, html.has-cursor * { cursor: none !important; }
html.has-cursor iframe { cursor: auto !important; }

@media (max-width: 640px) {
  #chat-dock { top: 68px; height: 60vh; }
  #chat-notes { top: 68px; }
}

/* smooth cross-fade between pages (browsers without support just navigate) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .22s ease-in both; }
::view-transition-new(root) { animation: vtIn .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(8px); } }
#bg3d { view-transition-name: backdrop; }
::view-transition-group(backdrop) { animation: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--text); }
html { scrollbar-color: rgba(255, 255, 255, .14) transparent; scrollbar-width: thin; }
html.df-dragging, html.df-dragging * { user-select: none !important; }

/* ---------- sleep mode (10 min idle) ---------- */
#sleep-screen { position: fixed; inset: 0; z-index: 10000; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px;
  background: radial-gradient(circle at 50% 45%, rgba(10, 14, 12, .32), rgba(0, 0, 0, .55)); backdrop-filter: blur(1.5px) saturate(80%);
  opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility 0s linear .8s; }
#sleep-screen.on { opacity: 1; visibility: visible; transition: opacity 1.2s ease; }
.sleep-cat { position: relative; font-size: 96px; line-height: 1; animation: catBreath 4s ease-in-out infinite; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .6)); }
@keyframes catBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06) translateY(-3px); } }
.sleep-cat .z { position: absolute; top: -6px; left: 78%; font-weight: 800; color: var(--accent); opacity: 0; animation: zFloat 3.6s ease-in infinite; text-shadow: 0 0 14px rgba(30, 215, 96, .5); }
.sleep-cat .z1 { font-size: 20px; } .sleep-cat .z2 { font-size: 28px; animation-delay: 1.2s; } .sleep-cat .z3 { font-size: 18px; animation-delay: 2.4s; }
@keyframes zFloat { 0% { opacity: 0; transform: translate(0, 10px) rotate(-10deg); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(34px, -60px) rotate(12deg); } }
.sleep-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.sleep-sub { max-width: 420px; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
html.df-sleeping .cur-dot, html.df-sleeping .cur-ring { opacity: 0 !important; }
html.df-sleeping .logo, html.df-sleeping .dock-dot, html.df-sleeping .maker, html.df-sleeping .maker-av::before { animation-play-state: paused !important; }
