:root {
    --app-ink: #152235;
    --app-muted: #6d7784;
    --app-bg: #f3f0e8;
    --app-panel: #ffffff;
    --app-accent: #0d6c66;
    --app-accent-dark: #094d49;
    --app-highlight: #f0b54a;
    --app-border: #d9d4c7;
}

body {
    background:
        radial-gradient(circle at top right, rgba(240, 181, 74, 0.18), transparent 28%),
        radial-gradient(circle at top left, rgba(13, 108, 102, 0.12), transparent 24%),
        var(--app-bg);
    color: var(--app-ink);
    min-height: 100vh;
}

.app-navbar {
    background: rgba(243, 240, 232, 0.94);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(21, 34, 53, 0.08);
}

.brand-mark {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    margin-right: 0.55rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--app-accent), var(--app-highlight));
    color: white;
}

.navbar .nav-link {
    border-radius: 999px;
    padding-inline: 1rem;
}

.navbar .nav-link.active {
    background: rgba(13, 108, 102, 0.1);
    color: var(--app-accent-dark);
}

.app-nav-dropdown {
    min-width: 12rem;
    border-radius: 1rem;
    border: 1px solid rgba(21, 34, 53, 0.08);
    box-shadow: 0 14px 30px rgba(21, 34, 53, 0.08);
}

.app-nav-dropdown .dropdown-item {
    border-radius: 0.75rem;
    margin: 0.2rem 0.4rem;
    width: auto;
}

.app-nav-dropdown .dropdown-item.active,
.app-nav-dropdown .dropdown-item:active {
    background: rgba(13, 108, 102, 0.1);
    color: var(--app-accent-dark);
}

.app-shell {
    max-width: 1500px;
}

.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 2rem;
    border-radius: 1.75rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 233, 0.96));
    border: 1px solid rgba(21, 34, 53, 0.06);
    box-shadow: 0 18px 40px rgba(21, 34, 53, 0.08);
}

.page-hero h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 0.35rem;
}

.eyebrow {
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    color: var(--app-accent);
}

.template-card,
.story-wizard-card,
.content-card {
    padding: 1.5rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(21, 34, 53, 0.08);
    background: var(--app-panel);
    box-shadow: 0 10px 24px rgba(21, 34, 53, 0.05);
}

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    border: 1px solid rgba(21, 34, 53, 0.08);
    background: rgba(255, 255, 255, 0.75);
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    color: inherit;
}

.wizard-step:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(21, 34, 53, 0.15);
    box-shadow: 0 8px 20px rgba(21, 34, 53, 0.04);
}

.wizard-step:not(a) {
    cursor: default;
}

.wizard-step:not(a):hover {
    box-shadow: none;
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(21, 34, 53, 0.08);
}

.wizard-step.is-active {
    border-color: rgba(13, 108, 102, 0.4);
    background: rgba(13, 108, 102, 0.08);
}

.wizard-step-index {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--app-ink);
    color: white;
}

.wizard-step.is-active .wizard-step-index {
    background: var(--app-accent);
}

.media-preview {
    max-width: 100%;
    min-height: 120px;
    border-radius: 1rem;
    border: 1px dashed rgba(21, 34, 53, 0.2);
    padding: 0.75rem;
    background: #f8fafb;
    object-fit: cover;
}

.upload-dropzone {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px dashed rgba(13, 108, 102, 0.24);
    border-radius: 1rem;
    background: rgba(248, 250, 251, 0.9);
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.upload-dropzone.is-dragover {
    border-color: rgba(13, 108, 102, 0.65);
    background: rgba(13, 108, 102, 0.08);
    box-shadow: 0 0 0 0.2rem rgba(13, 108, 102, 0.12);
}

.upload-dropzone-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--app-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.upload-dropzone-label i {
    color: var(--app-accent);
}

.js-phase-image-preview-trigger:not(.d-none) {
    cursor: zoom-in;
}

.table > :not(caption) > * > * {
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

.app-toast {
    min-width: 320px;
}

.social-tabs .nav-link {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(21, 34, 53, 0.08);
}

.social-tabs .nav-link.active {
    background: var(--app-accent);
    border-color: var(--app-accent);
}

.social-status-badge.status-approved,
.social-status-badge.status-published,
.social-status-badge.status-scheduled {
    background: rgba(13, 108, 102, 0.12);
    color: var(--app-accent-dark);
}

.social-status-badge.status-failed,
.social-status-badge.status-cancelled {
    background: rgba(220, 53, 69, 0.12);
    color: #a5202f;
}

.social-status-badge.status-draft,
.social-status-badge.status-needs_review {
    background: rgba(240, 181, 74, 0.18);
    color: #8f5b00;
}

.social-phone-preview {
    border: 1px solid rgba(21, 34, 53, 0.12);
    border-radius: 1.25rem;
    padding: 1rem;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.social-preview-media {
    display: grid;
    min-height: 220px;
    place-items: center;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(13, 108, 102, 0.12), rgba(240, 181, 74, 0.18));
    color: var(--app-muted);
    font-weight: 700;
}

.social-comment-text {
    max-width: 34rem;
    white-space: pre-wrap;
}

.social-reply-box {
    min-width: 24rem;
}

.social-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.social-bar-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.8fr) minmax(120px, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.social-bar {
    height: 0.7rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(13, 108, 102, 0.1);
}

.social-bar span {
    display: block;
    height: 100%;
    min-width: 0.35rem;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--app-accent), var(--app-highlight));
}

.loading-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(21, 34, 53, 0.2);
    z-index: 2000;
}

.loading-overlay.is-visible {
    display: flex;
}

.json-preview {
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-status-tooltip .tooltip-inner {
    max-width: 420px;
    text-align: left;
    white-space: pre-line;
}

.phase-row textarea {
    min-height: 120px;
}

.phase-management-table .phase-order-col {
    width: 5rem;
}

.phase-management-table .phase-original-col {
    width: 16%;
}

.phase-management-table .phase-edit-col {
    width: 32%;
}

.phase-management-table .phase-image-col,
.phase-management-table .phase-audio-col,
.phase-management-table .phase-playback-col {
    width: 15.5%;
}

.phase-original-text-cell,
.phase-edit-text-cell {
    min-width: 0;
}

.phase-original-text {
    white-space: pre-wrap;
    line-height: 1.6;
}

.phase-management-table .phase-edit-text-cell textarea {
    min-height: 21rem;
}

.phase-translation-editor textarea {
    padding-bottom: 3.25rem;
}

.phase-translate-button {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(21, 34, 53, 0.12);
}

.phase-audio-task-card,
.phase-playback-card {
    padding: 0.75rem;
    border: 1px solid rgba(21, 34, 53, 0.08);
    border-radius: 1rem;
    background: rgba(248, 250, 251, 0.9);
}

@media (max-width: 992px) {
    .wizard-steps {
        grid-template-columns: 1fr;
    }
}
