:root {
  --bg: #0a0a0d;
  --bg2: #121218;
  --card: #16161d;
  --line: #262631;
  --text: #f3f3f6;
  --muted: #9a9aab;
  --accent: #ef3b2d;
  --accent2: #ff7a45;
  --ok: #2fbf71;
  --err: #ff5d5d;
  --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(239, 59, 45, .18), transparent 60%),
              radial-gradient(900px 500px at -10% 10%, rgba(255, 122, 69, .08), transparent 60%), var(--bg);
  color: var(--text);
  font: 16px/1.5 Lato, "Segoe UI", Roboto, system-ui, -apple-system, Arial, sans-serif;
  min-height: 100vh;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.top { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; max-width: 880px; margin: 0 auto; }
.logo { height: 34px; width: auto; }
.lang button { background: none; border: 1px solid var(--line); color: var(--muted); padding: 6px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; }
.lang button + button { margin-left: 6px; }
.lang button.active { color: var(--text); border-color: var(--accent); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 24px 40px; }
.hero h1 { font-size: clamp(28px, 4vw, 40px); margin: 18px 0 8px; letter-spacing: -.02em; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 0 24px; }
.card { background: linear-gradient(180deg, rgba(255,255,255,.02), transparent), var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 18px; }
.step-head { display: flex; align-items: center; margin-bottom: 16px; }
.step-head h2 { font-size: 20px; margin: 0; }
.step-no { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--accent2), var(--accent)); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; margin-right: 12px; flex: none; }
.code-row { display: flex; flex-wrap: wrap; }
.code-row > * { margin: 0 12px 12px 0; }
input { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(239, 59, 45, .25); }
.code-input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 28px; letter-spacing: .18em; text-transform: uppercase; max-width: 300px; text-align: center; font-weight: 700; }
.pin-input { max-width: 200px; letter-spacing: .3em; text-align: center; font-size: 22px; }
.btn { font: inherit; font-weight: 700; border-radius: 12px; padding: 12px 20px; border: 1px solid transparent; cursor: pointer; color: var(--text); background: #23232d; transition: transform .1s, filter .15s, background .15s; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--accent2), var(--accent)); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: transparent; border-color: rgba(255, 93, 93, .4); color: var(--err); }
.btn.small { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.hint, small { color: var(--muted); font-size: 13px; }
.hint { margin: 0; }
.device { display: flex; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 4px; }
.device > div:nth-child(2) { flex: 1; min-width: 0; }
.device-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(239, 59, 45, .12); display: flex; align-items: center; justify-content: center; margin-right: 14px; flex: none; }
.device-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent2); stroke-width: 1.8; stroke-linecap: round; }
.device-title { font-weight: 800; }
.device-meta { color: var(--muted); font-size: 14px; }
.pin-box { margin-top: 16px; }
.pin-box p { color: var(--muted); margin: 0 0 12px; }
.playlist-list:empty { display: none; }
.playlist-list { margin-bottom: 20px; }
.pl-item { display: flex; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); margin-bottom: 10px; }
.pl-item .pl-main { flex: 1; min-width: 0; }
.pl-item .pl-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-item .pl-meta { color: var(--muted); font-size: 13px; }
.pl-item .btn + .btn { margin-left: 8px; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, .07); margin-right: 6px; color: var(--text); }
.form-title { font-weight: 800; font-size: 17px; margin-bottom: 12px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.field small { display: block; margin-top: 6px; }
.check { display: flex !important; align-items: center; color: var(--text) !important; cursor: pointer; }
.check input { width: auto; margin: 0 10px 0 0; accent-color: var(--accent); }
.pin-field input[type=password] { margin-top: 8px; max-width: 220px; }
.advanced { border-top: 1px solid var(--line); padding-top: 12px; margin: 6px 0 14px; }
.advanced summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.actions { display: flex; justify-content: flex-end; flex-wrap: wrap; }
.actions .btn { margin-left: 10px; margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d1d26; border: 1px solid var(--line); border-left: 4px solid var(--ok); padding: 14px 18px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); max-width: calc(100% - 32px); z-index: 10; }
.toast.error { border-left-color: var(--err); }
.privacy { display: flex; align-items: flex-start; color: var(--muted); font-size: 14px; padding: 6px 4px; }
.privacy svg { width: 22px; height: 22px; flex: none; margin: 2px 12px 0 0; fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.privacy p { margin: 0; }
.foot { text-align: center; color: #555566; font-size: 13px; padding: 20px; }
input.invalid { border-color: var(--err); }
@media (max-width: 560px) {
  .card { padding: 18px; }
  .code-input { max-width: none; }
  .code-row > .btn { width: 100%; margin-right: 0; }
}
