:root {
    color-scheme: light;
    --bg: #f3f1eb;
    --panel: #fffdf8;
    --panel-strong: #ffffff;
    --border: #d8cfbe;
    --text: #241f16;
    --muted: #6b6255;
    --accent: #8a2f1d;
    --accent-strong: #672012;
    --accent-soft: #f4ddd5;
    --shadow: 0 14px 40px rgba(70, 49, 24, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(138, 47, 29, 0.12), transparent 28%),
        linear-gradient(180deg, #f8f4ec 0%, var(--bg) 100%);
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto 48px;
}

.hero {
    margin-bottom: 18px;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(1.9rem, 2.4vw, 2.6rem);
}

.hero p {
    margin: 0;
    color: var(--muted);
}

.tabs {
    display: inline-flex;
    gap: 8px;
    margin: 22px 0 18px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(216, 207, 190, 0.75);
    border-radius: 999px;
    backdrop-filter: blur(8px);
}

.tab-button,
button {
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    cursor: pointer;
    transition: 0.18s ease;
}

.tab-button {
    padding: 10px 16px;
    background: transparent;
    color: var(--muted);
}

.tab-button.active {
    background: var(--panel-strong);
    color: var(--text);
    box-shadow: var(--shadow);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.card {
    background: rgba(255, 253, 248, 0.96);
    border: 1px solid rgba(216, 207, 190, 0.8);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

label,
.section-title-row h2 {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.inline-row,
.section-title-row,
.actions,
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inline-row {
    flex-wrap: wrap;
}

.section-title-row {
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title-row h2 {
    margin: 0;
}

input[type="url"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--panel-strong);
    font: inherit;
    color: var(--text);
}

input[type="url"] {
    flex: 1 1 560px;
}

textarea {
    resize: vertical;
    line-height: 1.55;
}

button {
    background: var(--accent);
    color: #fff8f5;
    padding: 11px 16px;
}

button:hover {
    background: var(--accent-strong);
}

button:disabled {
    opacity: 0.62;
    cursor: wait;
}

.hint,
.meta {
    color: var(--muted);
    font-size: 0.95rem;
}

.status {
    min-height: 24px;
    color: var(--text);
}

.status.error {
    color: #9d2517;
}

.status.success {
    color: #1d5a29;
}

.track-list {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.track-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(247,242,233,0.9));
}

.track-item strong {
    display: block;
    margin-bottom: 6px;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.88rem;
}

.selection-panel {
    display: grid;
    gap: 12px;
}

.checkbox-row {
    width: fit-content;
    margin: 4px 0;
}

.checkbox-row input {
    width: auto;
}

.notice {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #e6c2b8;
    border-radius: 12px;
    background: #fff1ed;
    color: #803020;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(216, 207, 190, 0.75);
    text-align: left;
    vertical-align: top;
}

tbody tr[data-url] {
    cursor: pointer;
}

tbody tr[data-url]:hover {
    background: rgba(138, 47, 29, 0.06);
}

.empty-cell {
    color: var(--muted);
    text-align: center;
}

.hidden {
    display: none;
}

@media (max-width: 720px) {
    .page {
        width: min(100% - 20px, 100%);
        margin: 18px auto 30px;
    }

    .section-title-row,
    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .tabs {
        display: flex;
    }
}
