:root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --text: #1d1d1f;
    --muted: #6e6e73;
    --line: #d2d2d7;
    --accent: #e50914;
    --accent-text: #ffffff;
    --danger: #c4161c;
    --error-bg: #fdecec;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0b0d;
        --card: #18181b;
        --text: #f5f5f7;
        --muted: #a1a1a6;
        --line: #2c2c31;
        --error-bg: #3a1214;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: .04em;
}

.mark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    position: relative;
}

.mark::after {
    content: "";
    position: absolute;
    left: 11px;
    top: 8px;
    border-left: 9px solid #fff;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

main {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px 32px;
}

footer {
    padding: 16px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    margin-top: 16px;
}

.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }

h1 { font-size: 24px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 12px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; overflow-wrap: anywhere; }

.error {
    background: var(--error-bg);
    color: var(--danger);
    border-radius: 10px;
    padding: 10px 12px;
}

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 14px; color: var(--muted); }

input[type=text], input[type=url], input[type=password] {
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    width: 100%;
}

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

fieldset {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px 2px;
    margin: 0 0 4px;
}

legend { padding: 0 6px; font-weight: 600; }

.or { text-align: center; color: var(--muted); margin: 6px 0; }

.check { display: flex; align-items: center; gap: 6px; margin: 12px 0; }

button, .button {
    font: inherit;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.danger { color: var(--danger); }

form.inline { display: inline; }

.row { display: flex; gap: 8px; }

.device { display: flex; flex-wrap: wrap; gap: 24px; }
.device > div { display: flex; flex-direction: column; }
.label { font-size: 13px; color: var(--muted); }

.playlists { list-style: none; margin: 0; padding: 0; }

.playlists li {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.playlists li:first-child { border-top: none; }
.playlists p { margin: 2px 0 0; }
.info { min-width: 0; flex: 1 1 260px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
    margin-left: 8px;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-text);
}
