:root {
    --bg: #f4efe6;
    --panel: rgba(255, 252, 247, 0.92);
    --line: #d4ccbd;
    --text: #1c1d1f;
    --muted: #5f625f;
    --accent: #b93817;
    --accent-deep: #8f2410;
    --accent-soft: #f3d8d0;
    --success: #1c7c54;
    --error: #a12e24;
    --shadow: 0 18px 42px rgba(41, 27, 10, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(185, 56, 23, 0.12), transparent 34%),
        radial-gradient(circle at top right, rgba(39, 111, 92, 0.12), transparent 28%),
        linear-gradient(180deg, #f8f4ec 0%, #efe7da 100%);
}

.page {
    padding: 24px 16px 48px;
}

.shell {
    width: min(1180px, 100%);
    margin: 0 auto 18px;
}

.hero {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 18px;
    align-items: stretch;
}

.hero-copy,
.hero-note,
.panel {
    background: var(--panel);
    border: 1px solid rgba(212, 204, 189, 0.85);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 24px;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 58px);
    line-height: 0.95;
    letter-spacing: -0.04em;
    max-width: 10ch;
}

.lede {
    max-width: 56ch;
    color: var(--muted);
    font-size: 16px;
}

.eyebrow {
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
}

.hero-note {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.hero-note span {
    color: var(--muted);
    font-size: 13px;
}

.hero-note strong {
    overflow-wrap: anywhere;
    font-size: 18px;
}

.grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 18px;
}

.panel {
    padding: 20px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-head h2 {
    margin: 0;
    font-size: 21px;
}

.bulk-input {
    width: 100%;
    min-height: 220px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    resize: vertical;
    font: 14px/1.5 "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    background: rgba(255, 255, 255, 0.75);
}

.action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.primary-button,
.ghost-button,
.secondary-button,
.secondary-link,
.modal-close {
    border: 0;
    border-radius: 999px;
    padding: 11px 16px;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.primary-button {
    background: linear-gradient(180deg, var(--accent), var(--accent-deep));
    color: #fff8f5;
}

.wide-button {
    width: 100%;
}

.ghost-button,
.secondary-button,
.secondary-link {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.primary-button:hover,
.ghost-button:hover,
.secondary-button:hover,
.secondary-link:hover,
.modal-close:hover {
    transform: translateY(-1px);
}

.status-text {
    color: var(--muted);
    font-size: 14px;
}

.status-text[data-mode="success"] {
    color: var(--success);
}

.status-text[data-mode="error"] {
    color: var(--error);
}

.badge {
    min-width: 40px;
    text-align: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: #ece3d0;
    font-weight: 700;
}

.cards,
.video-grid {
    display: grid;
    gap: 12px;
}

.card,
.video-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    padding: 14px;
}

.card-meta,
.video-info,
.empty-state,
.modal-loading,
.modal-fallback {
    color: var(--muted);
    font-size: 14px;
}

.card-url,
.video-name {
    margin: 8px 0 12px;
    font-weight: 600;
    word-break: break-all;
}

.card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.video-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.video-thumb {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: 14px;
    background: #000;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 18, 20, 0.64);
    backdrop-filter: blur(6px);
}

.modal-dialog {
    position: relative;
    width: min(920px, calc(100% - 24px));
    max-height: calc(100vh - 24px);
    margin: 12px auto;
    padding: 48px 18px 18px;
    border-radius: 28px;
    background: #fffaf2;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    overflow: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    background: #efe3d1;
    color: #2e1a0f;
    font-size: 24px;
    line-height: 1;
}

.modal-body {
    min-height: 160px;
}

.embed-shell {
    display: flex;
    justify-content: center;
}

.video-modal-player {
    width: 100%;
    max-height: 78vh;
    border-radius: 18px;
    background: #000;
}

.video-modal-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .hero,
    .grid {
        grid-template-columns: 1fr;
    }

    .hero-copy h1 {
        max-width: none;
    }

    .modal-dialog {
        width: calc(100% - 12px);
        margin: 6px auto;
        padding: 44px 12px 12px;
        border-radius: 22px;
    }
}
