:root {
    color-scheme: light;
    --bg: #eef1f6;
    --bg-soft: #f7f8fb;
    --panel: rgba(255, 255, 255, .78);
    --panel-strong: rgba(255, 255, 255, .94);
    --line: rgba(148, 163, 184, .28);
    --line-strong: rgba(148, 163, 184, .42);
    --text: #101828;
    --muted: #667085;
    --muted-2: #98a2b3;
    --amber: #d97706;
    --amber-soft: #fff7ed;
    --blue: #2563eb;
    --green: #059669;
    --red: #dc2626;
    --shadow: 0 24px 70px rgba(15, 23, 42, .12);
    --shadow-soft: 0 14px 36px rgba(15, 23, 42, .08);
    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 12px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.theme-dark,
.theme-dark {
    color-scheme: dark;
    --bg: #0b111c;
    --bg-soft: #111827;
    --panel: rgba(17, 24, 39, .78);
    --panel-strong: rgba(15, 23, 42, .94);
    --line: rgba(255, 255, 255, .12);
    --line-strong: rgba(255, 255, 255, .18);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --muted-2: #94a3b8;
    --amber-soft: rgba(217, 119, 6, .14);
    --shadow: 0 28px 90px rgba(0, 0, 0, .34);
    --shadow-soft: 0 18px 48px rgba(0, 0, 0, .24);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

html.modal-open,
body.modal-open {
    overflow: hidden;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .60), rgba(255, 255, 255, 0) 360px),
        var(--bg);
    color: var(--text);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: .55;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a {
    color: inherit;
    cursor: pointer;
}

[role="button"],
[data-open-post],
[data-calendar-date],
[data-channel-url],
[data-copy],
[data-nav],
[data-posts-mode],
[data-toggle-schedule-editor],
[data-month-shift],
[data-open-image-modal],
[data-open-day-image-modal],
[data-open-image-gallery],
[data-image-gallery-jump],
[data-gallery-generate],
[data-remove-channel],
[data-open-create-post],
.post-card,
.calendar-day,
.channel-link,
.mini-action,
.image-choice,
.publish-network-row,
.network-check,
.tab-button,
.view-toggle button,
.nav-button {
    cursor: pointer;
}

.app-loading,
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.loading-card,
.login-panel {
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px) saturate(1.2);
}

.loading-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    color: var(--muted);
    font-weight: 700;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #4e00b9;
    flex: 0 0 auto;
    overflow: hidden;
}

.theme-dark .brand-mark {
    background: #4e00b9;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.login-shell {
    width: min(100%, 460px);
}

.login-panel {
    padding: 22px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.login-brand p {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.login-brand span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form h1 {
    margin: 0 0 6px;
    font-size: 28px;
    letter-spacing: 0;
}

.login-form p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.login-form label,
.field-label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.login-form input,
.field-input,
.field-select,
.field-area {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .78);
    color: var(--text);
    outline: none;
    padding: 12px 13px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.theme-dark .login-form input,
.theme-dark .field-input,
.theme-dark .field-select,
.theme-dark .field-area {
    background: rgba(15, 23, 42, .72);
}

.login-form input:focus,
.field-input:focus,
.field-select:focus,
.field-area:focus {
    border-color: rgba(217, 119, 6, .72);
    box-shadow: 0 0 0 4px rgba(217, 119, 6, .12);
}

.field-area {
    resize: vertical;
    line-height: 1.55;
}

.compact-area {
    min-height: 96px;
    margin: 0;
}

.check-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px !important;
}

.check-row input {
    width: auto;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .62);
    padding: 12px;
    color: var(--text);
}

.theme-dark .toggle-row {
    background: rgba(15, 23, 42, .54);
}

.toggle-row input {
    width: 42px;
    height: 22px;
    flex: 0 0 auto;
    accent-color: var(--amber);
}

.toggle-row strong,
.toggle-row small {
    display: block;
}

.toggle-row small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    margin-top: 2px;
}

.login-form button,
.primary-button {
    border: 0;
    border-radius: 14px;
    background: #111827;
    color: white;
    min-height: 44px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    box-shadow: 0 14px 30px rgba(17, 24, 39, .18);
}

.theme-dark .login-form button,
.theme-dark .primary-button {
    background: white;
    color: #111827;
}

.form-alert {
    border: 1px solid rgba(220, 38, 38, .20);
    border-radius: 14px;
    background: rgba(254, 242, 242, .88);
    color: #991b1b;
    padding: 12px;
    font-size: 13px;
    font-weight: 700;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, .54);
    backdrop-filter: blur(22px) saturate(1.2);
    padding: 18px;
}

.theme-dark .sidebar {
    background: rgba(15, 23, 42, .72);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 6px 20px;
}

.brand strong {
    display: block;
    font-size: 17px;
}

.brand span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

.nav {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    padding: 0 12px;
    font-weight: 800;
    text-align: left;
}

.nav-button:hover,
.nav-button.is-active {
    background: var(--panel-strong);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.nav-button i,
.icon {
    width: 18px;
    height: 18px;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 10px;
}

.user-chip {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    padding: 12px;
}

.user-chip strong,
.user-chip span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chip span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.ghost-button,
.danger-button,
.soft-button,
.icon-button {
    border: 1px solid var(--line);
    background: var(--panel-strong);
    color: var(--text);
    border-radius: 13px;
    min-height: 40px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.soft-button {
    background: var(--amber-soft);
    border-color: rgba(217, 119, 6, .18);
    color: #92400e;
}

.theme-dark .soft-button {
    color: #fbbf24;
}

.danger-button {
    background: rgba(220, 38, 38, .10);
    border-color: rgba(220, 38, 38, .20);
    color: var(--red);
}

.icon-button {
    width: 40px;
    padding: 0;
}

.compact-button {
    min-height: 36px;
    padding-inline: 11px;
}

.compact-icon {
    width: 34px;
    min-height: 34px;
}

.danger-icon {
    color: var(--red);
    border-color: rgba(220, 38, 38, .22);
    background: rgba(220, 38, 38, .08);
}

.main {
    min-width: 0;
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.page-title h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1;
    letter-spacing: 0;
}

.page-title p {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 650;
}

.glass-panel {
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px) saturate(1.18);
}

.theme-dark .glass-panel {
    border-color: var(--line);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 16px;
}

.stat-card-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.stat-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.stat-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.compact-button {
    min-height: 36px;
    padding: 0 11px;
}

.dashboard-days {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.day-column {
    padding: 16px;
}

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

.section-header > div {
    min-width: 0;
}

.section-header h2,
.section-header h3 {
    margin: 0;
    font-size: 18px;
}

.section-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.day-image-action {
    flex: 0 0 auto;
}

.day-image-action:disabled {
    opacity: .56;
    cursor: not-allowed;
    box-shadow: none;
}

.count-pill,
.status-pill,
.time-pill,
.type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    min-height: 28px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.count-pill,
.time-pill {
    background: #111827;
    color: white;
    gap: 6px;
}

.time-pill svg {
    width: 13px;
    height: 13px;
}

.theme-dark .count-pill,
.theme-dark .time-pill {
    background: white;
    color: #111827;
}

.status-pendiente {
    background: rgba(217, 119, 6, .12);
    color: #92400e;
}

.status-aprobado {
    background: rgba(5, 150, 105, .12);
    color: #047857;
}

.status-publicado {
    background: rgba(37, 99, 235, .12);
    color: #1d4ed8;
}

.status-parcial {
    background: rgba(124, 58, 237, .12);
    color: #6d28d9;
}

.status-generando {
    background: rgba(124, 58, 237, .14);
    color: #6d28d9;
}

.post-stack {
    display: grid;
    gap: 12px;
}

.post-card {
    overflow: hidden;
    position: relative;
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    min-height: 154px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.card-progress-bar {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 2;
    width: 4px;
    background: linear-gradient(180deg, var(--amber), #fbbf24, var(--amber));
    background-size: 100% 220%;
    animation: progressStripe 1.1s linear infinite;
}

.theme-dark .post-card {
    background: rgba(30, 41, 59, .72);
}

.post-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .13);
}

.post-card-placeholder {
    cursor: default;
    border-color: rgba(124, 58, 237, .34);
    background: linear-gradient(135deg, rgba(255, 255, 255, .88), rgba(245, 243, 255, .76));
}

.post-card-placeholder:hover {
    transform: none;
}

.post-card-media {
    min-height: 154px;
    background: var(--bg-soft);
    display: grid;
    place-items: center;
    color: var(--muted-2);
    position: relative;
}

.post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-archive-badge {
    position: absolute;
    right: 7px;
    bottom: 7px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .86);
    color: white;
    padding: 5px 7px;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
}

.media-archive-badge svg {
    width: 11px;
    height: 11px;
}

.placeholder-work-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #7c3aed;
    background: rgba(124, 58, 237, .12);
    box-shadow: 0 0 0 8px rgba(124, 58, 237, .08);
}

.placeholder-work-icon svg {
    width: 20px;
    height: 20px;
    animation: spin .8s linear infinite;
}

.post-card-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.mini-action {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-strong);
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(15, 23, 42, .06);
}

.mini-action svg {
    width: 13px;
    height: 13px;
}

.mini-action.is-busy {
    color: var(--amber);
}

.mini-action.is-banana {
    color: #4e00b9;
    border-color: rgba(78, 0, 185, .24);
    background: rgba(78, 0, 185, .08);
}

.mini-action.is-banana.is-busy {
    color: var(--amber);
    border-color: rgba(217, 119, 6, .24);
    background: var(--amber-soft);
}

.mini-action.is-busy svg,
.icon-button.is-busy svg,
.channel-state-icon.is-working svg,
.publish-network-status.is-working svg,
.inline-work-status svg,
.media-work-badge svg {
    animation: spin .8s linear infinite;
}

.media-work-badge {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--amber);
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(217, 119, 6, .24);
    box-shadow: 0 10px 20px rgba(15, 23, 42, .12);
}

.theme-dark .media-work-badge {
    background: rgba(15, 23, 42, .86);
}

.channel-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.channel-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .62);
    color: var(--text);
    min-height: 26px;
    padding: 0 9px;
    font-size: 10px;
    font-weight: 850;
}

.theme-dark .channel-pill {
    background: rgba(255, 255, 255, .08);
}

.channel-pill small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.channel-state-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, .08);
}

.channel-state-icon svg {
    width: 12px;
    height: 12px;
}

.theme-dark .channel-state-icon {
    background: rgba(255, 255, 255, .10);
}

.channel-status-publicado small {
    color: #1d4ed8;
}

.channel-status-error small {
    color: #b91c1c;
}

.channel-link {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--text);
    background: rgba(255, 255, 255, .72);
    border: 1px solid var(--line);
    cursor: pointer;
}

.channel-link svg {
    width: 13px;
    height: 13px;
}

.theme-dark .channel-link {
    background: rgba(255, 255, 255, .10);
}

.post-card h3 {
    margin: 0;
    font-size: 15px;
}

.post-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.toolbar {
    display: grid;
    gap: 12px;
    padding: 14px;
    margin-bottom: 14px;
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.toolbar-filters .month-input {
    flex: 0 0 150px;
}

.toolbar-filters .search-input {
    flex: 1 1 260px;
}

.toolbar-filters .compact-select {
    flex: 0 0 145px;
}

.toolbar-filters .type-select {
    flex: 0 0 180px;
}

.toolbar-actions {
    justify-content: flex-end;
}

.toolbar-button {
    min-height: 44px;
}

.toolbar-button.is-busy svg {
    animation: spin .8s linear infinite;
}

.inline-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-strong);
    padding: 0 10px;
    color: var(--text);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.inline-switch input {
    width: 16px;
    height: 16px;
    accent-color: var(--amber);
}

.image-tier-toggle {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-soft);
    padding: 4px;
}

.image-tier-toggle button {
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    padding: 0 10px;
    font-size: 12px;
    font-weight: 850;
}

.image-tier-toggle button.is-active {
    background: white;
    color: var(--text);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.view-toggle {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-soft);
    padding: 5px;
}

.view-toggle button {
    border: 0;
    min-height: 38px;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 850;
}

.view-toggle button.is-active {
    background: white;
    color: var(--text);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.theme-dark .view-toggle button.is-active {
    background: rgba(255, 255, 255, .13);
}

.list-panel {
    padding: 14px;
}

.date-group {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.date-heading {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.calendar-layout {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: 18px;
}

.calendar-card {
    padding: 16px;
    align-self: start;
}

.calendar-nav-head {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.calendar-nav-head > div {
    min-width: 0;
    text-align: center;
}

.calendar-nav-head h2 {
    margin: 0;
    font-size: 18px;
}

.calendar-nav-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekday {
    min-height: 20px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.calendar-empty {
    min-height: 72px;
}

.calendar-day {
    position: relative;
    overflow: hidden;
    min-height: 72px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .66);
    color: var(--text);
    padding: 9px;
    display: grid;
    justify-items: start;
    align-content: space-between;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.calendar-day.is-populating {
    border-color: rgba(124, 58, 237, .62);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .12), 0 16px 34px rgba(76, 29, 149, .18);
    animation: calendarPulse 1.4s ease-in-out infinite;
}

.calendar-day.is-populating strong {
    background: linear-gradient(135deg, #111827, #7c3aed, #2563eb);
    color: #fff;
}

.calendar-day-work {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #7c3aed;
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 8px 20px rgba(124, 58, 237, .24);
}

.theme-dark .calendar-day-work {
    background: rgba(17, 24, 39, .88);
    color: #c4b5fd;
}

.calendar-day-work svg {
    width: 12px;
    height: 12px;
    animation: spin .8s linear infinite;
}

.theme-dark .calendar-day {
    background: rgba(15, 23, 42, .50);
}

.calendar-day:hover,
.calendar-day.is-active {
    transform: translateY(-1px);
    border-color: rgba(217, 119, 6, .42);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .12);
}

.calendar-day.is-today {
    border-color: rgba(234, 179, 8, .72);
    background: rgba(254, 249, 195, .86);
}

.calendar-day.is-active {
    background: rgba(254, 240, 138, .92);
    box-shadow: 0 14px 30px rgba(217, 119, 6, .16);
}

.theme-dark .calendar-day.is-today,
.theme-dark .calendar-day.is-active {
    background: rgba(113, 63, 18, .58);
    border-color: rgba(250, 204, 21, .66);
}

.calendar-day > span:not(.calendar-day-work) {
    font-size: 18px;
    font-weight: 900;
}

.calendar-day strong {
    justify-self: end;
    border-radius: 999px;
    background: #111827;
    color: white;
    min-width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    font-size: 11px;
}

.theme-dark .calendar-day strong {
    background: white;
    color: #111827;
}

.calendar-day small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: capitalize;
}

.resource-grid {
    display: grid;
    grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
    gap: 18px;
}

.resource-form,
.resource-list,
.settings-card {
    padding: 16px;
}

.form-grid {
    display: grid;
    gap: 12px;
}

.two-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.three-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.section-subhead {
    display: grid;
    gap: 3px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 4px;
}

.section-subhead strong {
    font-size: 13px;
}

.section-subhead span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.data-list {
    display: grid;
    gap: 10px;
}

.interest-chip-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.interest-chip-cloud span {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    padding: 8px 11px;
}

.theme-dark .interest-chip-cloud span {
    background: rgba(15, 23, 42, .58);
}

.data-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .66);
    padding: 12px;
}

.theme-dark .data-row {
    background: rgba(15, 23, 42, .48);
}

.data-row strong,
.data-row span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-row span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.compact-row {
    border-radius: 14px;
    padding: 10px;
}

.row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.podcast-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.podcast-summary div,
.sync-note {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .58);
    padding: 12px;
}

.theme-dark .podcast-summary div,
.theme-dark .sync-note {
    background: rgba(15, 23, 42, .48);
}

.podcast-summary strong {
    display: block;
    font-size: 20px;
}

.podcast-summary span,
.sync-note span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.sync-note {
    margin-bottom: 12px;
}

.sync-note strong {
    display: block;
    font-size: 13px;
}

.podcast-main {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.podcast-thumb {
    width: 58px;
    height: 58px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(15, 23, 42, .08);
}

.podcast-thumb-empty {
    display: grid;
    place-items: center;
    color: var(--muted);
}

.podcast-main small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
    gap: 18px;
}

.invite-card {
    display: grid;
    gap: 10px;
}

.compact-list {
    gap: 8px;
}

.invite-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 9px 10px;
}

.invite-row-main {
    min-width: 0;
}

.invite-row-main code {
    display: block;
    max-width: 100%;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 11px;
}

.user-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.user-row small {
    display: inline-flex;
    margin-left: 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    vertical-align: middle;
}

.compact-password-form {
    gap: 10px;
}

.compact-submit {
    justify-self: start;
    min-height: 40px;
}

.copy-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    padding: 8px;
}

.copy-line code {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
}

.storage-usage-card {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .58);
    padding: 14px;
}

.theme-dark .storage-usage-card {
    background: rgba(15, 23, 42, .46);
}

.storage-usage-card > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.storage-usage-card > div:first-child > svg {
    width: 20px;
    height: 20px;
    color: var(--amber);
}

.storage-usage-card span {
    display: grid;
    gap: 2px;
}

.storage-usage-card strong {
    font-size: 16px;
}

.storage-usage-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.storage-usage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.storage-usage-grid span {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-strong);
    padding: 7px 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.storage-usage-grid svg {
    width: 13px;
    height: 13px;
}

.storage-cleanup-history {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.media-cleanup-backdrop {
    z-index: 80;
}

.media-cleanup-modal {
    width: min(620px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 24px;
    background: var(--panel-strong);
    box-shadow: 0 36px 130px rgba(0, 0, 0, .36);
}

.media-cleanup-body {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.cleanup-explanation {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
}

.cleanup-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.cleanup-summary-grid span {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-soft);
    padding: 12px;
    text-align: center;
}

.cleanup-summary-grid small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.cleanup-summary-grid strong {
    font-size: 18px;
}

.cleanup-toggle {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
}

.cleanup-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid rgba(217, 119, 6, .28);
    border-radius: 14px;
    background: rgba(217, 119, 6, .08);
    color: #92400e;
    padding: 12px;
    font-size: 12px;
    line-height: 1.45;
}

.theme-dark .cleanup-warning {
    color: #fbbf24;
}

.cleanup-warning svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .62);
    backdrop-filter: blur(18px) saturate(.95);
    overscroll-behavior: contain;
}

.post-modal {
    width: min(980px, calc(100vw - 28px));
    height: min(1080px, calc(100vh - 28px));
    max-height: min(1080px, calc(100vh - 28px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 28px;
    background: var(--panel-strong);
    box-shadow: 0 36px 130px rgba(0, 0, 0, .36);
    backdrop-filter: blur(28px) saturate(1.2);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding: 13px 16px;
}

.modal-head p {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.modal-head h2 {
    margin: 0;
    font-size: 18px;
}

.modal-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-time-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: var(--muted);
    padding: 0 10px;
    font-size: 12px;
    font-weight: 900;
}

.theme-dark .modal-time-chip {
    background: rgba(255, 255, 255, .08);
}

.modal-time-chip svg {
    width: 14px;
    height: 14px;
}

.modal-body {
    min-height: 0;
    overflow: auto;
    padding: 14px;
    overscroll-behavior: contain;
}

.modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 14px;
    align-items: start;
}

.preview-panel,
.action-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, .72);
    box-shadow: var(--shadow-soft);
}

.theme-dark .preview-panel,
.theme-dark .action-panel {
    background: rgba(15, 23, 42, .42);
}

.preview-panel {
    overflow: hidden;
}

.preview-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
}

.tabs {
    display: inline-flex;
    border-radius: 14px;
    background: var(--bg-soft);
    padding: 4px;
}

.tab-button {
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 850;
}

.tab-button.is-active {
    background: white;
    color: var(--text);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .09);
}

.theme-dark .tab-button.is-active {
    background: rgba(255, 255, 255, .13);
}

.preview-tools {
    display: flex;
    gap: 8px;
}

.fb-card {
    overflow: hidden;
    margin: 0 12px 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: white;
}

.theme-dark .fb-card {
    background: rgba(2, 6, 23, .64);
}

.fb-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px 6px;
}

.fb-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #4e00b9;
    overflow: hidden;
}

.theme-dark .fb-avatar {
    background: #4e00b9;
}

.fb-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.fb-header strong,
.fb-header span {
    display: block;
}

.fb-header span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.fb-copy {
    margin: 0;
    padding: 6px 14px 14px;
    white-space: pre-wrap;
    color: var(--text);
    font-size: 14px;
    line-height: 1.48;
    overflow-wrap: anywhere;
}

.edit-area {
    display: block;
    width: calc(100% - 32px);
    margin: 6px 16px 16px;
    min-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
}

.preview-count {
    margin: -8px 16px 14px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-align: right;
}

.fb-image-shell {
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
}

.fb-image-shell.has-image {
    display: grid;
    place-items: center;
}

.fb-image-shell.is-dragging {
    outline: 2px solid rgba(78, 0, 185, .45);
    outline-offset: -2px;
}

.fb-image-button {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    display: block;
    cursor: zoom-in;
}

.fb-image {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    display: block;
}

.image-drop-hint {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(78, 0, 185, .82);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    font-size: 13px;
    font-weight: 900;
    transition: opacity .14s ease;
}

.image-drop-hint svg {
    width: 22px;
    height: 22px;
}

.fb-image-shell.is-dragging .image-drop-hint {
    opacity: 1;
}

.inline-work-status {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 8px 14px;
    border-top: 1px solid var(--line);
    color: var(--amber);
    background: var(--amber-soft);
    font-size: 12px;
    font-weight: 850;
}

.inline-work-status svg {
    width: 15px;
    height: 15px;
}

.post-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, 82px);
    justify-content: start;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .44);
}

.theme-dark .post-image-gallery {
    background: rgba(15, 23, 42, .36);
}

.post-image-thumb-wrap {
    position: relative;
    width: 82px;
    min-height: 114px;
    cursor: grab;
}

.post-image-thumb-wrap:active {
    cursor: grabbing;
}

.post-image-thumb-wrap.is-dragging {
    opacity: .48;
}

.post-image-thumb-wrap.is-drag-over .post-image-thumb {
    border-color: rgba(217, 119, 6, .72);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, .16);
}

.post-image-thumb {
    min-width: 0;
    width: 82px;
    min-height: 114px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    padding: 4px;
    color: var(--muted);
    cursor: pointer;
    display: grid;
    gap: 4px;
}

.post-image-thumb.is-primary {
    border-color: rgba(37, 99, 235, .46);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.post-image-thumb img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: contain;
    border-radius: 5px;
    background: var(--bg-soft);
}

.post-image-thumb span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 850;
}

.post-image-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 2;
    width: 22px;
    height: 22px;
    border: 2px solid var(--panel-strong);
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 18px rgba(239, 68, 68, .28);
}

.post-image-delete:hover {
    background: #dc2626;
}

.post-image-delete svg {
    width: 13px;
    height: 13px;
    stroke-width: 3;
}

.post-image-add {
    width: 82px;
    min-height: 114px;
    place-items: center;
    border-style: dashed;
    color: #4e00b9;
    background: rgba(78, 0, 185, .08);
}

.post-image-add svg {
    width: 34px;
    height: 34px;
    stroke-width: 2.3;
}

.post-image-add.is-busy {
    color: var(--amber);
    background: var(--amber-soft);
    border-style: solid;
}

.post-image-add.is-busy svg {
    animation: spin .8s linear infinite;
}

.post-image-work-tile {
    place-items: center;
    color: var(--amber);
    background: var(--amber-soft);
    cursor: default;
}

.post-image-work-tile svg {
    width: 28px;
    height: 28px;
    animation: spin .8s linear infinite;
}

.post-image-work-tile span {
    white-space: normal;
    text-align: center;
    line-height: 1.15;
}

.image-gallery-backdrop {
    z-index: 70;
}

.image-gallery-modal {
    width: min(980px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 24px;
    background: var(--panel-strong);
    box-shadow: 0 36px 130px rgba(0, 0, 0, .36);
}

.image-gallery-body {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 10px;
    padding: 12px;
}

.image-gallery-stage {
    min-height: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--bg-soft);
    padding: 10px;
}

.image-gallery-stage img {
    width: 100%;
    height: min(72vh, 760px);
    object-fit: contain;
    display: block;
}

.image-gallery-nav {
    align-self: center;
}

.image-gallery-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.image-gallery-current,
.image-gallery-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.image-gallery-meta strong {
    color: var(--text);
}

.image-gallery-meta span {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(37, 99, 235, .10);
    color: var(--blue);
    padding: 0 9px;
}

.image-gallery-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 66px;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.image-gallery-strip button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    padding: 3px;
    cursor: pointer;
}

.image-gallery-strip button.is-active {
    border-color: rgba(37, 99, 235, .58);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.image-gallery-strip img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: contain;
    display: block;
    border-radius: 5px;
    background: var(--bg-soft);
}

.empty-image {
    height: 300px;
    display: grid;
    place-items: center;
    gap: 10px;
    background: var(--bg-soft);
    color: var(--muted);
    font-weight: 800;
}

.empty-image small {
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 800;
}

.action-panel {
    padding: 12px;
    position: sticky;
    top: 0;
}

.action-panel h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.publish-progress {
    position: relative;
    overflow: hidden;
    display: inline-grid;
    grid-template-columns: repeat(2, 20px);
    gap: 8px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(217, 119, 6, .25);
    border-radius: 16px;
    background: var(--amber-soft);
    padding: 10px 12px 10px 16px;
    margin-bottom: 11px;
    min-height: 42px;
}

.publish-progress-bar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--amber), #fbbf24, var(--amber));
    background-size: 100% 220%;
    animation: progressStripe 1.1s linear infinite;
}

.publish-progress svg {
    color: var(--amber);
    width: 18px;
    height: 18px;
}

.publish-progress svg:first-of-type {
    animation: spin .8s linear infinite;
}

.action-block {
    display: grid;
    gap: 9px;
    padding-bottom: 11px;
    margin-bottom: 11px;
    border-bottom: 1px solid var(--line);
}

.action-block:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.side-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.schedule-summary {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .68);
    color: var(--text);
    padding: 11px 12px;
    text-align: left;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

.schedule-summary:hover {
    border-color: rgba(217, 119, 6, .42);
    box-shadow: 0 10px 22px rgba(217, 119, 6, .10);
    transform: translateY(-1px);
}

.schedule-summary div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.schedule-summary span,
.schedule-editor-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.schedule-summary strong,
.schedule-editor-head strong {
    color: var(--text);
    font-size: 15px;
    line-height: 1.15;
}

.schedule-summary small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.schedule-summary.is-disabled {
    cursor: default;
    opacity: .72;
    box-shadow: none;
}

.schedule-summary.is-disabled:hover {
    border-color: var(--line);
    box-shadow: none;
    transform: none;
}

.schedule-change-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 30px;
    border-radius: 999px;
    background: rgba(217, 119, 6, .10);
    color: var(--amber);
    padding: 0 10px;
    white-space: nowrap;
}

.schedule-change-chip svg {
    width: 14px;
    height: 14px;
}

.schedule-editor {
    display: grid;
    gap: 10px;
    border: 1px solid rgba(217, 119, 6, .22);
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    padding: 11px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.theme-dark .schedule-summary,
.theme-dark .schedule-editor {
    background: rgba(15, 23, 42, .54);
}

.schedule-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.schedule-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.schedule-date-field {
    grid-column: 1 / -1;
}

.schedule-editor-grid label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.schedule-editor-grid label:hover .field-select:not(:disabled) {
    border-color: rgba(78, 0, 185, .42);
    box-shadow: 0 0 0 3px rgba(78, 0, 185, .08);
}

.schedule-editor-grid .field-select {
    min-height: 40px;
    padding: 9px 11px;
    cursor: pointer;
}

.schedule-editor-grid .field-select:disabled {
    cursor: not-allowed;
}

.schedule-editor-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.schedule-editor-actions .primary-button {
    justify-content: center;
}

.info-chip {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .64);
    color: var(--text);
    padding: 0 12px;
    font-size: 13px;
    font-weight: 850;
}

.theme-dark .info-chip {
    background: rgba(15, 23, 42, .54);
}

.modal-channel-list {
    display: grid;
    gap: 6px;
}

.modal-channel-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .60);
    padding: 8px 10px;
}

.modal-channel-row.has-link {
    border-color: rgba(37, 99, 235, .26);
}

.theme-dark .modal-channel-row {
    background: rgba(15, 23, 42, .54);
}

.modal-channel-row strong,
.modal-channel-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.modal-channel-row span {
    color: var(--muted);
    font-weight: 800;
}

.modal-channel-status {
    color: var(--muted);
}

.modal-channel-remove,
.modal-channel-locked {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: grid;
    place-items: center;
}

.modal-channel-remove {
    border: 1px solid rgba(220, 38, 38, .18);
    background: rgba(254, 226, 226, .72);
    color: #dc2626;
    cursor: pointer;
}

.modal-channel-remove:hover {
    border-color: rgba(220, 38, 38, .42);
    background: rgba(254, 226, 226, .95);
}

.modal-channel-locked {
    color: var(--muted-2);
    background: rgba(148, 163, 184, .12);
}

.modal-channel-remove svg,
.modal-channel-locked svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.6;
}

.modal-channel-row small {
    grid-column: 1 / -1;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.35;
}

.channel-link-placeholder {
    width: 22px;
    height: 22px;
}

.status-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-soft);
    padding: 5px;
}

.status-switch button {
    border: 0;
    min-height: 38px;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.status-switch button.is-active {
    background: white;
    color: var(--text);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.theme-dark .status-switch button.is-active {
    background: rgba(255, 255, 255, .13);
}

.button-stack {
    display: grid;
    gap: 9px;
}

.wide-button {
    width: 100%;
    min-height: 40px;
}

.create-post-modal {
    width: min(620px, calc(100vw - 28px));
}

.image-generation-modal {
    width: min(560px, calc(100vw - 28px));
}

.publish-modal {
    width: min(560px, calc(100vw - 28px));
}

.create-post-grid {
    display: grid;
    gap: 16px;
}

.create-post-context-panel {
    display: grid;
    gap: 12px;
}

.create-post-context-summary,
.create-post-progress {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .62);
    padding: 11px 12px;
}

.theme-dark .create-post-context-summary,
.theme-dark .create-post-progress {
    background: rgba(15, 23, 42, .54);
}

.create-post-context-summary span,
.create-post-progress strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.35;
}

.create-post-context-question {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .62);
    padding: 12px;
}

.theme-dark .create-post-context-question {
    background: rgba(15, 23, 42, .54);
}

.create-post-context-question > span {
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.35;
}

.image-generation-grid {
    display: grid;
    gap: 16px;
}

.image-upload-panel,
.image-generate-panel {
    display: grid;
    gap: 8px;
}

.image-upload-panel > strong,
.image-generate-panel > strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.image-upload-drop {
    position: relative;
    min-height: 116px;
    border: 1px dashed rgba(78, 0, 185, .34);
    border-radius: 14px;
    background: rgba(78, 0, 185, .07);
    color: #4e00b9;
    display: grid;
    place-items: center;
    gap: 7px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .14s ease, background .14s ease, transform .14s ease;
}

.theme-dark .image-upload-drop {
    background: rgba(78, 0, 185, .16);
}

.image-upload-drop.is-dragging {
    border-color: rgba(78, 0, 185, .72);
    background: rgba(78, 0, 185, .14);
    transform: translateY(-1px);
}

.image-upload-drop svg {
    width: 30px;
    height: 30px;
    stroke-width: 2.2;
}

.image-upload-drop span {
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
}

.image-upload-drop small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
    font-weight: 750;
}

.generation-summary {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .62);
    padding: 14px;
}

.theme-dark .generation-summary {
    background: rgba(15, 23, 42, .54);
}

.generation-summary strong {
    font-size: 15px;
}

.generation-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.image-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.image-choice {
    display: grid;
    gap: 5px;
    min-height: 88px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-strong);
    color: var(--text);
    padding: 14px;
    text-align: left;
    cursor: pointer;
}

.image-choice.is-active {
    border-color: rgba(217, 119, 6, .46);
    background: var(--amber-soft);
    box-shadow: 0 14px 28px rgba(217, 119, 6, .12);
}

.image-choice strong {
    font-size: 15px;
}

.image-choice span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.network-checks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.network-check {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .62);
    color: var(--text);
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 850;
}

.theme-dark .network-check {
    background: rgba(15, 23, 42, .54);
}

.publish-selection-grid {
    display: grid;
    gap: 16px;
}

.publish-network-list {
    display: grid;
    gap: 9px;
}

.publish-network-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .62);
    color: var(--text);
    padding: 11px 12px;
}

.theme-dark .publish-network-row {
    background: rgba(15, 23, 42, .54);
}

.publish-network-row.is-published {
    opacity: .72;
}

.publish-network-row.has-error {
    border-color: rgba(220, 38, 38, .32);
}

.publish-network-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--amber);
}

.publish-network-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.publish-network-main strong,
.publish-network-main small,
.publish-network-status {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.publish-network-main strong {
    font-size: 13px;
}

.publish-network-main small,
.publish-network-status {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.publish-network-status {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, .08);
}

.theme-dark .publish-network-status {
    background: rgba(255, 255, 255, .10);
}

.publish-network-status svg {
    width: 14px;
    height: 14px;
}

.publish-network-row em {
    grid-column: 2 / -1;
    color: #b91c1c;
    font-size: 11px;
    font-style: normal;
    font-weight: 750;
    line-height: 1.35;
}

.create-post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.action-overlay {
    position: fixed;
    inset: 0;
    z-index: 75;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(10px);
}

.action-overlay-card {
    width: min(420px, calc(100vw - 36px));
    display: grid;
    justify-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    padding: 28px;
    text-align: center;
}

.action-overlay-card strong {
    font-size: 18px;
}

.action-overlay-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 36px));
}

.toast {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-strong);
    box-shadow: var(--shadow-soft);
    padding: 12px 14px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.toast.is-error {
    border-color: rgba(220, 38, 38, .28);
    color: var(--red);
}

.empty-state {
    border: 1px dashed var(--line-strong);
    border-radius: 18px;
    color: var(--muted);
    padding: 28px;
    text-align: center;
    font-weight: 800;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.big-spinner {
    width: 42px;
    height: 42px;
    border-width: 4px;
    color: var(--amber);
}

.lucide-loader-circle {
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes calendarPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(124, 58, 237, .10), 0 16px 34px rgba(76, 29, 149, .16);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(124, 58, 237, .20), 0 18px 38px rgba(37, 99, 235, .22);
    }
}

@keyframes progressStripe {
    to {
        background-position: 0 220%;
    }
}

@media (max-width: 1120px) {
    .app-shell {
        grid-template-columns: 86px minmax(0, 1fr);
    }

    .sidebar {
        padding: 14px 10px;
    }

    .brand div,
    .nav-button span,
    .user-chip,
    .sidebar-footer .ghost-button span {
        display: none;
    }

    .nav-button,
    .brand,
    .sidebar-footer .ghost-button {
        justify-content: center;
    }

    .modal-grid,
    .calendar-layout,
    .settings-grid,
    .resource-grid {
        grid-template-columns: 1fr;
    }

    .action-panel {
        position: static;
    }
}

@media (max-width: 820px) {
    .main {
        padding: 18px;
    }

    .dashboard-days,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .toolbar,
    .two-grid,
    .three-grid,
    .image-choice-grid,
    .network-checks {
        grid-template-columns: 1fr;
    }

    .toolbar-row {
        align-items: stretch;
    }

    .toolbar-row > * {
        flex: 1 1 100%;
    }

    .toolbar-actions {
        justify-content: stretch;
    }

    .invite-row,
    .user-row {
        grid-template-columns: 1fr;
    }

    .user-row .row-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .stat-card-action {
        grid-template-columns: 1fr;
    }

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

    .post-card {
        grid-template-columns: 94px minmax(0, 1fr);
    }

    .modal-backdrop {
        align-items: stretch;
        padding: 10px;
    }

    .post-modal {
        width: 100%;
        max-height: calc(100vh - 20px);
        border-radius: 22px;
    }

    .modal-body {
        padding: 12px;
    }
}

@media (max-width: 580px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .brand div,
    .nav-button span {
        display: block;
    }

    .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-button,
    .brand {
        justify-content: flex-start;
    }

    .post-card {
        grid-template-columns: 1fr;
    }

    .post-card-media {
        min-height: 170px;
    }

    .topbar {
        flex-direction: column;
    }
}
