/* Base tokens and primitives shared by the site, the app and the share player. */
:root {
  --bg: #0f1217;
  --bg-2: #151920;
  --bg-3: #1c2129;
  --bg-4: #242a34;
  --line: #262d38;
  --line-2: #323a47;
  --text: #e9ecf1;
  --text-2: #b4bcc8;
  --muted: #8e97a6;
  --accent: #f2a93b;
  --accent-2: #ffc46a;
  --accent-ink: #1b1204;
  --rec: #ff4f4f;
  --ok: #4cd18a;
  --warn: #f2a93b;
  --err: #ff6b6b;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-s: 6px; --r-m: 10px; --r-l: 16px; --r-xl: 22px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 50px -20px rgba(0,0,0,.7);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --wrap: 1120px;
  --gutter: 16px;
  color-scheme: dark;
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
img, video, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p a, li a, .link { color: var(--accent-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(34px, 6vw, 60px); letter-spacing: -0.03em; }
h2 { font-size: clamp(26px, 3.6vw, 38px); }
h3 { font-size: 20px; letter-spacing: -0.01em; }
h4 { font-size: 16px; }
p { margin: 0 0 1em; }
.lede { font-size: 18px; color: var(--text-2); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 13px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r-s); z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-s); }
::selection { background: rgba(242,169,59,.35); }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
code { font-family: var(--mono); font-size: .92em; background: var(--bg-3); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; overflow: auto; font-size: 13px; }
.ic { flex: none; vertical-align: -3px; display: inline-block; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--bg-3); color: var(--text); font: 500 15px/1 var(--body); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; text-decoration: none; }
.btn:hover { background: var(--bg-4); border-color: #3e4756; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-3); color: var(--text); border-color: transparent; }
.btn-danger { color: var(--err); border-color: rgba(255,107,107,.35); }
.btn-danger:hover { background: rgba(255,107,107,.12); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 16px; }
.btn-icon { padding: 0; width: 38px; min-height: 38px; }
.btn-rec { background: var(--rec); border-color: var(--rec); color: #fff; font-weight: 600; }
.btn-rec:hover { background: #ff6565; border-color: #ff6565; }
.btn-block { width: 100%; }

/* Forms */
label, .label { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="search"], input[type="datetime-local"], input[type="date"], select, textarea { width: 100%; min-height: 42px; padding: 9px 12px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-m); font: 15px/1.4 var(--body); transition: border-color .15s; }
textarea { min-height: 110px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238e97a6' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242,169,59,.18); }
input::placeholder, textarea::placeholder { color: #6b7483; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 17px; height: 17px; margin: 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); margin-bottom: 0; cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Surfaces */
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px; }
.card-soft { background: var(--bg-2); border-radius: var(--r-l); padding: 20px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; background: var(--bg-3); color: var(--text-2); border: 1px solid var(--line); }
.pill-accent { background: rgba(242,169,59,.14); color: var(--accent-2); border-color: rgba(242,169,59,.3); }
.pill-ok { background: rgba(76,209,138,.12); color: var(--ok); border-color: rgba(76,209,138,.3); }
.pill-err { background: rgba(255,107,107,.12); color: var(--err); border-color: rgba(255,107,107,.3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 3px rgba(255,79,79,.25); display: inline-block; }
@keyframes pulse { 50% { opacity: .35; } }
.rec-dot.live { animation: pulse 1.2s ease-in-out infinite; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; width: min(92vw, 460px); pointer-events: none; }
.toast { pointer-events: auto; background: var(--bg-4); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-m); padding: 12px 14px; font-size: 14px; box-shadow: 0 16px 40px -10px rgba(0,0,0,.7); display: flex; gap: 10px; align-items: flex-start; animation: toast-in .2s ease-out; }
.toast-error, .toast.err { border-color: rgba(255,107,107,.5); }
.toast-ok, .toast.ok { border-color: rgba(76,209,138,.5); }
.toast-info { border-color: rgba(242,169,59,.5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Skeletons and empties */
.skel { background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 37%, var(--bg-3) 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: var(--r-s); min-height: 14px; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line-2); border-radius: var(--r-l); color: var(--muted); }
.empty h3 { color: var(--text); }
.empty .btn { margin-top: 8px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; font-size: 13px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Misc */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.progress { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
kbd { font-family: var(--mono); font-size: 12px; background: var(--bg-3); border: 1px solid var(--line-2); border-bottom-width: 2px; padding: 1px 6px; border-radius: 5px; }
