:root {
    color-scheme: dark;
    --font-display: "Bebas Neue", Oswald, system-ui, sans-serif;
    --font-sans: Inter, system-ui, sans-serif;
    --bg: #050505;
    --panel: #111114;
    --panel-strong: #19191f;
    --text: #f6f6f6;
    --muted: #9d9da5;
    --line: #303038;
    --accent: #ffffff;
    --danger: #ff6b6b;
    --ok: #84f0b1;
    --gold: #d8a54c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.16), transparent 18rem),
        radial-gradient(circle at 96% 8%, rgba(217, 255, 99, 0.12), transparent 22rem),
        linear-gradient(135deg, #030304 0%, #0b0b0f 54%, #030304 100%);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--accent);
}

button,
.ghost-link {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #232329;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    min-height: 2.45rem;
    padding: 0.65rem 1rem;
    text-decoration: none;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

button:hover,
.ghost-link:hover {
    border-color: #f2f2f2;
    transform: translateY(-1px);
}

button:disabled {
    cursor: progress;
    opacity: 0.6;
    transform: none;
}

.primary {
    background: var(--accent);
    color: #08080a;
}

.danger-button {
    background: rgba(255, 107, 107, 0.12);
    border-color: rgba(255, 107, 107, 0.45);
    color: #ffd4d4;
}

.publish-row button.media-delivered {
    background: #19c37d;
    border-color: rgba(132, 240, 177, 0.9);
    color: #03150c;
}

.publish-row button.media-delivered:hover {
    border-color: #c6ffd9;
}

.topbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1240px;
    padding: 2.35rem 1rem 1.2rem;
}

.topbar h1,
.login-card h1 {
    font-family: var(--font-display);
    font-size: clamp(2.7rem, 7.5vw, 6.6rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 0.84;
    margin: 0;
    text-transform: uppercase;
}

.eyebrow,
.source {
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    margin: 0 0 0.4rem;
    text-transform: uppercase;
}

.eyebrow {
    color: var(--gold);
}

.brand-accent {
    color: var(--gold);
}

.tagline {
    color: var(--muted);
    font-size: clamp(0.95rem, 1.8vw, 1.25rem);
    font-weight: 600;
    margin: 0.9rem 0 0;
    max-width: 680px;
}

.top-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.user-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
    padding: 0.65rem 1rem;
}

.dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
    margin: 0 auto;
    max-width: 1240px;
    padding: 1rem;
}

.scoreboard {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.score-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        var(--panel);
    border: 1px solid var(--line);
    border-radius: 1.65rem;
    min-height: 8.5rem;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.score-card::after {
    color: rgba(255, 255, 255, 0.06);
    content: "10";
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    position: absolute;
    right: 0.8rem;
    top: 0.6rem;
}

.score-card span {
    color: var(--muted);
    display: block;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.score-card strong {
    bottom: 0.75rem;
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 0.85;
    position: absolute;
}

.draft-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
        rgba(17, 17, 20, 0.92);
    border: 1px solid var(--line);
    border-radius: 1.45rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    overflow: hidden;
    transition: opacity 180ms ease, transform 180ms ease;
}

.draft-card.card-removing {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
}

.media {
    background: #08080a;
    align-self: start;
    display: grid;
    gap: 0.75rem;
    padding: 0.9rem;
}

.media img,
.no-photo {
    aspect-ratio: 1 / 1;
    display: block;
    height: auto;
    min-height: 0;
    object-fit: cover;
    border-radius: 1rem;
    width: 100%;
}

.photo-updated {
    animation: photoPulse 850ms ease;
}

@keyframes photoPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(217, 255, 99, 0.8);
    }

    100% {
        box-shadow: 0 0 0 12px rgba(217, 255, 99, 0);
    }
}

.no-photo {
    align-items: center;
    color: var(--muted);
    display: flex;
    justify-content: center;
}

.content {
    display: grid;
    gap: 0.8rem;
    padding: 1rem 1rem 1rem 0;
}

.card-head {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.card-head h2 {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.2vw, 2.25rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 0.9;
    margin: 0;
    text-transform: uppercase;
}

.status {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--gold);
    flex: 0 0 auto;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    padding: 0.45rem 0.7rem;
}

.meta-row {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1.1rem;
    font-size: 0.92rem;
}

.caption {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    color: var(--text);
    font: inherit;
    line-height: 1.45;
    min-height: 9.5rem;
    padding: 0.85rem;
    resize: vertical;
    width: 100%;
}

.whatsapp-helper {
    background: rgba(25, 195, 125, 0.08);
    border: 1px solid rgba(132, 240, 177, 0.35);
    border-radius: 1rem;
    display: grid;
    gap: 0.8rem;
    padding: 0.9rem;
}

.whatsapp-helper p {
    color: var(--ok);
    font-weight: 700;
    margin: 0;
}

.whatsapp-helper-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.instagram-helper {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 1rem;
    display: grid;
    gap: 0.8rem;
    padding: 0.9rem;
}

.instagram-copy-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.instagram-copy-row code {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 0.5rem;
    padding: 0.3rem 0.6rem;
    flex: 1 1 auto;
    word-break: break-word;
}

.instagram-preview-image {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 0 auto;
    border-radius: 0.9rem;
}

.instagram-helper-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.action-groups {
    display: grid;
    gap: 0.55rem;
}

.side-actions {
    align-self: start;
}

.mobile-actions {
    display: none;
}

.side-actions .button-grid,
.side-actions .publish-row {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
}

.side-actions button {
    justify-content: flex-start;
    width: 100%;
}

.preview-group {
    margin-top: 0.15rem;
}

.action-section {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 0.7rem;
}

.action-section summary {
    align-items: center;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 400;
    justify-content: space-between;
    letter-spacing: 0.22em;
    list-style: none;
    text-transform: uppercase;
}

.action-section summary::-webkit-details-marker {
    display: none;
}

.action-section summary::after {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    content: "+";
    display: inline-flex;
    font-family: Arial, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    height: 1.6rem;
    justify-content: center;
    letter-spacing: 0;
    line-height: 1;
    margin-left: 1rem;
    width: 1.6rem;
}

.action-section[open] summary {
    color: var(--text);
    margin-bottom: 0.7rem;
}

.action-section[open] summary::after {
    content: "-";
}

.button-grid,
.publish-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.preview-tabs {
    display: grid;
    gap: 0.9rem;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
}

.scheduled-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 0.5rem;
    display: block;
}

.chip-sent,
.chip-pending {
    display: inline-block;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
    margin: 0.1rem;
}

.chip-sent {
    background: rgba(132, 240, 177, 0.18);
    color: var(--ok);
}

.chip-pending {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.preview-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.8rem;
}

.preview-tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preview-tab-buttons button {
    min-height: 2.1rem;
    padding: 0.45rem 0.8rem;
}

.preview-tab-buttons button.active {
    background: var(--accent);
    color: #08080a;
}

.preview-panel {
    display: none;
}

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

.preview-image img,
.insta-photo img,
.x-photo img {
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: cover;
    width: 100%;
}

.preview-no-photo {
    align-items: center;
    background: #070709;
    color: var(--muted);
    display: flex;
    justify-content: center;
    min-height: 180px;
}

.telegram-preview,
.instagram-preview,
.x-preview,
.whatsapp-preview {
    border: 1px solid var(--line);
    border-radius: 1.35rem;
    overflow: hidden;
}

.telegram-preview {
    background: #17212b;
    margin: 0 auto;
    max-width: 420px;
    padding: 0.9rem;
}

.preview-channel,
.whatsapp-group {
    color: #9fd4ff;
    font-weight: 900;
    margin-bottom: 0.7rem;
}

.telegram-preview .preview-image img {
    border-radius: 1rem;
}

.telegram-preview p,
.whatsapp-bubble p,
.x-preview p,
.instagram-preview p {
    line-height: 1.42;
    margin: 0.8rem 0 0;
    white-space: pre-wrap;
}

.instagram-preview {
    background: #050506;
    margin: 0 auto;
    max-width: 380px;
}

.insta-head,
.x-head {
    align-items: center;
    display: flex;
    gap: 0.7rem;
    padding: 0.8rem;
}

.avatar {
    align-items: center;
    background: #f6f6f6;
    border-radius: 999px;
    color: #070709;
    display: inline-flex;
    font-weight: 1000;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.insta-actions {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0.8rem 0.8rem 0;
}

.instagram-preview p {
    padding: 0 0.8rem 0.9rem;
}

.x-preview {
    background: #050506;
    margin: 0 auto;
    max-width: 420px;
    padding: 0.2rem 0.9rem 0.9rem;
}

.x-photo {
    border: 1px solid var(--line);
    border-radius: 1rem;
    margin-top: 0.8rem;
    overflow: hidden;
}

.x-head {
    padding-left: 0;
}

.x-head span {
    color: var(--muted);
    display: block;
}

.x-preview a {
    border: 1px solid var(--line);
    border-radius: 1rem;
    color: var(--muted);
    display: block;
    margin-top: 0.8rem;
    padding: 0.8rem;
    text-decoration: none;
}

.whatsapp-preview {
    background: #071511;
    margin: 0 auto;
    max-width: 420px;
    padding: 0.9rem;
}

.whatsapp-group {
    color: #d8ffe7;
}

.whatsapp-bubble {
    background: #1f3d31;
    border-radius: 1rem 1rem 0.25rem 1rem;
    margin-left: auto;
    max-width: 88%;
    padding: 0.8rem;
}

.whatsapp-bubble strong {
    color: #a9ffc8;
}

.preview-image.small img {
    border-radius: 0.8rem;
    margin-top: 0.6rem;
}

.photo-actions button {
    background: #111116;
}

.error {
    color: var(--danger);
    font-weight: 700;
    margin: 0;
}

.success {
    color: var(--ok);
    font-weight: 700;
    margin: 0;
}

.muted {
    color: var(--muted);
}

.empty {
    background: rgba(21, 21, 25, 0.8);
    border: 1px dashed var(--line);
    border-radius: 2rem;
    color: var(--muted);
    padding: 3rem;
    text-align: center;
}

.notice-block {
    background: rgba(255, 212, 0, 0.08);
    border: 1px solid rgba(255, 212, 0, 0.35);
    border-radius: 1.25rem;
    color: #ffe680;
    font-weight: 700;
    padding: 1rem;
}

.notice-block a {
    color: #ffffff;
    text-decoration: underline;
}

.new-news-banner {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.new-news-banner button {
    background: var(--accent);
    border: none;
    border-radius: 999px;
    color: #08080a;
    cursor: pointer;
    flex: 0 0 auto;
    font-weight: 800;
    padding: 0.5rem 1.1rem;
}

.toast {
    background: var(--accent);
    border-radius: 999px;
    color: #08080a;
    font-weight: 800;
    left: 50%;
    padding: 0.8rem 1.2rem;
    position: fixed;
    top: 1rem;
    transform: translateX(-50%);
    z-index: 10;
}

.login-page {
    align-items: center;
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: rgba(21, 21, 25, 0.9);
    border: 1px solid var(--line);
    border-radius: 2rem;
    max-width: 430px;
    padding: 2rem;
    width: 100%;
}

.login-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.login-form input {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-sizing: border-box;
    color: var(--text);
    font: inherit;
    padding: 0.9rem 1rem;
    width: 100%;
}

.login-form input[type="file"] {
    border-radius: 0.8rem;
    padding: 0.6rem;
}

.login-form input[type="checkbox"],
.login-form input[type="radio"] {
    -webkit-appearance: auto;
    appearance: auto;
    background: none;
    border: none;
    box-sizing: content-box;
    padding: 0;
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
}

.login-form input[type="date"],
.login-form input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    box-sizing: border-box;
    color: var(--text);
    font: inherit;
    max-width: 100%;
    padding: 0.6rem 0.7rem;
    width: 100%;
}

.status-filter-form {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.status-filter-form label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-filter-form input,
.status-filter-form select {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font: inherit;
    min-height: 2.45rem;
    max-width: 12rem;
    padding: 0.65rem 1rem;
}

.status-filter-form select {
    color-scheme: dark;
}

.compact-form {
    margin-top: 1rem;
}

.panel-block {
    background: rgba(21, 21, 25, 0.86);
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    padding: 1.25rem;
}

.panel-block h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    margin: 0 0 1rem;
}

.settings-feedback {
    grid-column: 1 / -1;
}

.diagnostic-box {
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--line);
    border-radius: 1rem;
    color: var(--text);
    overflow-x: auto;
    padding: 1rem;
    white-space: pre-wrap;
}

.two-columns {
    grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
}

.stats-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    background: rgba(21, 21, 25, 0.86);
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    display: grid;
    gap: 0.35rem;
    padding: 1.2rem;
}

.stat-card strong {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1;
}

.stat-card span {
    color: var(--muted);
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 0.8rem 0.55rem;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

@media (max-width: 820px) {
    .topbar,
    .card-head {
        align-items: stretch;
        flex-direction: column;
    }

    .top-actions {
        justify-content: flex-start;
    }

    .user-pill {
        width: 100%;
    }

    .draft-card {
        grid-template-columns: 1fr;
        border-radius: 1.35rem;
    }

    .content {
        padding: 1rem;
    }

    .desktop-actions,
    .desktop-preview {
        display: none;
    }

    .mobile-actions {
        display: grid;
    }

    .side-actions .button-grid,
    .side-actions .publish-row {
        display: flex;
    }

    .side-actions button {
        justify-content: center;
        width: auto;
    }

    .media img,
    .no-photo {
        min-height: 0;
    }

    .two-columns,
    .stats-grid,
    .scoreboard {
        grid-template-columns: 1fr;
    }

    .score-card {
        min-height: 6.5rem;
    }

    .score-card strong {
        font-size: 3rem;
    }
}

@media (min-width: 821px) and (max-width: 1100px) {
    .draft-card {
        grid-template-columns: 260px minmax(0, 1fr);
    }
}
