/* ==========================================================
   Stories - public strip, add-story modal, viewer, cards
   ========================================================== */

:root {
    --story-ring: linear-gradient(45deg, #f9ce34 0%, #ee2a7b 45%, #6228d7 75%, #0ea5e9 100%);
    /* site theme (matches .btn-default / New Ad button in base.html) */
    --story-gradient: linear-gradient(135deg, #ff8e00 0%, #ffb300 100%);
    --story-orange: #ff8e00;
    --story-orange-dark: #e07b00;
    --story-orange-soft: #ffc266;
    --story-orange-tint: #fff4e6;
    --story-orange-line: #ffc98a;
    --story-ink: #1a1a2e;
    --story-text: #1f2937;
    --story-muted: #6b7280;
    --story-danger: #e74c3c;
}

html.story-no-scroll,
html.story-no-scroll body {
    overflow: hidden !important;
}

.story-modal [hidden],
.story-viewer [hidden],
.story-strip [hidden] {
    display: none !important;
}

/* ── Public strip ─────────────────────────────────────────── */

.story-strip__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.story-strip__all {
    font-size: 14px;
    color: var(--story-muted);
    text-decoration: none;
}

.story-strip__all:hover {
    color: #ee2a7b;
}

.story-strip__row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.story-strip__empty {
    margin-top: 10px;
    font-size: 14px;
    color: var(--story-muted);
}

.story-circle {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 82px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.story-circle__ring {
    display: block;
    width: 78px;
    height: 78px;
    padding: 3px;
    border-radius: 50%;
    background: var(--story-ring);
    transition: transform .15s ease;
}

.story-circle:hover .story-circle__ring {
    transform: scale(1.05);
}

.story-circle__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #111;
}

.story-circle__inner img,
.story-circle__inner video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-circle__name {
    max-width: 100%;
    overflow: hidden;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.story-circle--add .story-circle__ring {
    padding: 0;
    border: 2px dashed #b5bcc8;
    background: #eef0f3;
}

.story-circle--add .story-circle__inner {
    border: 0;
    background: transparent;
    color: #8a93a6;
    font-size: 24px;
}

.story-circle--add .story-circle__name {
    color: var(--story-muted);
    font-size: 13px;
}

/* ── Filter pills ─────────────────────────────────────────── */

.story-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0 16px;
}

.story-pill {
    padding: 8px 18px;
    border: 1.5px solid #e5e7eb;
    border-radius: 99px;
    background: #fff;
    color: var(--story-text) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.story-pill:hover {
    border-color: var(--story-orange);
    color: var(--story-orange-dark) !important;
}

/* Active pill - declared after .story-pill so it wins over the white background */
.story-pill.btn-default {
    border-color: transparent;
    background: var(--story-gradient);
    box-shadow: 0 6px 16px rgba(255, 142, 0, .3);
    color: #fff !important;
}

[data-theme=dark] .story-pill:not(.btn-default) {
    border-color: #3a3d4a;
    background: var(--mdb-gray-800, #2b2d38);
    color: #e5e7eb !important;
}

/* ── Cards (dashboard + /stories/) ───────────────────────── */

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
}

.story-card {
    position: relative;
    aspect-ratio: 3 / 5;
    overflow: hidden;
    border-radius: 18px;
    background: var(--story-ink);
    box-shadow: 0 6px 18px rgba(26, 26, 46, .12);
    isolation: isolate;
    transition: transform .25s cubic-bezier(.4, 0, .2, 1), box-shadow .25s ease;
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(255, 142, 0, .25);
}

/* Orange ring that lights up on hover */
.story-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    border: 2px solid transparent;
    border-radius: inherit;
    pointer-events: none;
    transition: border-color .25s ease;
}

.story-card:hover::after {
    border-color: var(--story-orange);
}

.story-card__media {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: var(--story-ink);
    cursor: pointer;
}

/* Blurred copy behind the image so wide images (plates) are never cropped */
.story-card__bg {
    position: absolute;
    inset: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    object-fit: cover;
    opacity: .55;
    filter: blur(18px) saturate(1.2);
}

.story-card__fg {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}

.story-card__fg--cover {
    object-fit: cover;
}

.story-card:hover .story-card__fg {
    transform: scale(1.05);
}

.story-card__shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .45) 0%, transparent 24%),
        linear-gradient(0deg, rgba(20, 20, 36, .92) 0%, rgba(20, 20, 36, .55) 32%, transparent 58%);
}

.story-card__play {
    position: absolute;
    top: 44%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding-left: 3px;
    border-radius: 50%;
    background: var(--story-gradient);
    box-shadow: 0 8px 20px rgba(255, 142, 0, .45);
    color: #fff;
    font-size: 18px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.7);
    transition: opacity .25s ease, transform .25s ease;
}

.story-card:hover .story-card__play,
.story-card__media:focus-visible .story-card__play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.story-card__top {
    position: absolute;
    top: 10px;
    right: 10px;
    left: 10px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.story-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 4px 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 99px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.story-chip i {
    color: var(--story-orange-soft);
}

.story-chip--icon {
    flex-shrink: 0;
    padding: 4px 8px;
}

.story-card__delete {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background .2s ease, transform .2s ease;
}

.story-card__delete:hover {
    background: var(--story-danger);
    border-color: var(--story-danger);
    transform: scale(1.08);
}

.story-card__info {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 12px 12px;
    color: #fff;
    pointer-events: none;
}

.story-card__user {
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    font-size: 13px;
    font-weight: 700;
}

.story-card__user img {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 2px;
    border-radius: 50%;
    background: var(--story-gradient);
    object-fit: cover;
}

.story-card__user span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.story-card__caption {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, .92);
    font-size: 12px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.story-card__meta {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, .7);
    font-size: 11px;
}

.story-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.story-status--approved { background: #16a34a; }
.story-status--pending { background: var(--story-gradient); }
.story-status--rejected { background: var(--story-danger); }

.story-card__life {
    width: 100%;
    margin-top: 2px;
}

.story-card__life-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, .85);
    font-size: 11px;
    font-weight: 600;
}

.story-card__dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 3px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
    animation: story-pulse 1.8s infinite;
}

@keyframes story-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.story-card__life-track {
    height: 4px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255, 255, 255, .22);
}

.story-card__life-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--story-gradient);
}

.story-card__expired {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 99px;
    background: rgba(0, 0, 0, .4);
    color: #fca5a5;
    font-size: 11px;
    font-weight: 600;
}

/* Expired stories fade slightly to set them apart */
.story-card--expired .story-card__fg,
.story-card--expired .story-card__bg {
    filter: grayscale(.65);
}

.story-card--expired .story-card__bg {
    filter: blur(18px) grayscale(.65);
}

/* "Add new story" tile on the dashboard */
.story-add-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    aspect-ratio: 3 / 5;
    padding: 16px;
    border: 2px dashed var(--story-orange-line);
    border-radius: 18px;
    background: var(--story-orange-tint);
    color: var(--story-text);
    cursor: pointer;
    transition: border-color .25s ease, background .25s ease, transform .25s ease;
}

.story-add-card:hover {
    border-color: var(--story-orange);
    background: #ffecd2;
    transform: translateY(-4px);
}

.story-add-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: var(--story-gradient);
    box-shadow: 0 8px 20px rgba(255, 142, 0, .38);
    color: #fff;
    font-size: 22px;
    transition: transform .25s ease;
}

.story-add-card:hover .story-add-card__icon {
    transform: rotate(90deg);
}

.story-add-card__title {
    font-size: 15px;
    font-weight: 700;
}

.story-add-card__hint {
    color: var(--story-muted);
    font-size: 12px;
}

/* ── Add-story modal ─────────────────────────────────────── */

.story-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.story-modal.is-open {
    display: flex;
}

.story-modal__dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .18);
    animation: story-pop .22s cubic-bezier(.4, 0, .2, 1);
}

.story-modal__dialog form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

@keyframes story-pop {
    from { opacity: 0; transform: translateY(24px) scale(.97); }
    to { opacity: 1; transform: none; }
}

.story-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px;
    background: var(--story-gradient);
}

.story-modal__heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.story-modal__badge {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .25);
    color: #fff;
    font-size: 18px;
}

.story-modal__title {
    margin: 0;
    color: #fff;
    font-size: 19px;
    font-weight: 700;
}

.story-modal__subtitle {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
}

.story-modal__x {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

.story-modal__x:hover {
    background: rgba(255, 255, 255, .38);
    transform: rotate(90deg);
}

.story-modal__body {
    padding: 22px 26px 26px;
    overflow-y: auto;
}

.story-modal__label {
    display: block;
    margin: 18px 0 8px;
    color: var(--story-text);
    font-size: 14px;
    font-weight: 600;
}

.story-modal__label:first-of-type {
    margin-top: 0;
}

.story-modal__label small {
    color: var(--story-muted);
    font-weight: 400;
}

.story-modal__req {
    color: var(--story-danger);
}

.story-modal__input,
.story-modal__input.form-control {
    height: 44px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.story-modal__input:focus {
    border-color: var(--story-orange);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 142, 0, .15);
    outline: 0;
}

.story-modal__input.is-invalid {
    border-color: var(--story-danger);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, .12);
}

.story-dropzone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 190px;
    padding: 18px;
    border: 2px dashed var(--story-orange-line);
    border-radius: 16px;
    background: var(--story-orange-tint);
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.story-dropzone:hover,
.story-dropzone.is-dragover {
    border-color: var(--story-orange);
    background: #ffecd2;
}

.story-dropzone.is-invalid {
    border-color: var(--story-danger);
    background: #fef2f2;
}

.story-dropzone__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--story-muted);
    font-size: 12px;
}

.story-dropzone__empty i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: var(--story-gradient);
    box-shadow: 0 8px 20px rgba(255, 142, 0, .35);
    color: #fff;
    font-size: 24px;
    transition: transform .2s ease;
}

.story-dropzone:hover .story-dropzone__empty i {
    transform: translateY(-3px);
}

.story-dropzone__title {
    color: var(--story-text);
    font-size: 15px;
    font-weight: 600;
}

.story-dropzone__preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.story-dropzone__preview img,
.story-dropzone__preview video {
    max-width: 100%;
    max-height: 240px;
    border-radius: 12px;
    background: var(--story-ink);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
    object-fit: contain;
}

.story-dropzone__filename {
    max-width: 100%;
    overflow: hidden;
    color: var(--story-orange-dark);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.story-modal__help {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    color: var(--story-muted);
    font-size: 12px;
}

.story-modal__error {
    margin-top: 6px;
    color: var(--story-danger);
    font-size: 13px;
}

.story-modal__error:empty {
    display: none;
}

.story-modal__alert {
    margin-bottom: 16px;
    padding: 10px 14px;
    border-left: 4px solid var(--story-danger);
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
}

.story-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.story-modal__close-btn {
    height: 42px;
    padding: 0 20px;
    border: 1.5px solid #e5e7eb;
    border-radius: 99px;
    background: #fff;
    color: var(--story-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}

.story-modal__close-btn:hover {
    border-color: #d1d5db;
    color: var(--story-text);
}

.story-modal__submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 22px;
    border: 0;
    border-radius: 99px;
    background: var(--story-gradient);
    box-shadow: 0 6px 20px rgba(255, 142, 0, .38);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.story-modal__submit:hover {
    box-shadow: 0 10px 26px rgba(255, 142, 0, .5);
    transform: translateY(-2px);
}

.story-modal__submit:disabled {
    opacity: .75;
    transform: none;
    cursor: wait;
}

/* ── Viewer ──────────────────────────────────────────────── */

.story-viewer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: rgba(10, 10, 12, .96);
    user-select: none;
    -webkit-user-select: none;
}

.story-viewer.is-open {
    display: flex;
}

.story-viewer__frame {
    position: relative;
    width: min(420px, 100vw);
    height: min(calc(100vh - 40px), 746px);
    overflow: hidden;
    border-radius: 10px;
    background: #000;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

.story-viewer__bars {
    position: absolute;
    top: 10px;
    right: 10px;
    left: 10px;
    z-index: 3;
    display: flex;
    gap: 4px;
}

.story-viewer__bar {
    flex: 1;
    height: 3px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, .35);
}

.story-viewer__fill {
    display: block;
    width: 0;
    height: 100%;
    background: #fff;
}

.story-viewer__head {
    position: absolute;
    top: 20px;
    right: 8px;
    left: 12px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.story-viewer__head::before {
    content: "";
    position: absolute;
    top: -30px;
    right: -8px;
    left: -12px;
    z-index: -1;
    height: 110px;
    background: linear-gradient(rgba(0, 0, 0, .55), transparent);
    pointer-events: none;
}

.story-viewer__avatar {
    width: 34px;
    height: 34px;
    border: 2px solid #fff;
    border-radius: 50%;
    object-fit: cover;
}

.story-viewer__who {
    display: flex;
    flex: 1;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.story-viewer__user {
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.story-viewer__time {
    flex-shrink: 0;
    opacity: .8;
    font-size: 12px;
}

.story-viewer__btn {
    width: 36px;
    height: 36px;
    border: 0;
    background: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.story-viewer__media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-viewer__media img,
.story-viewer__media video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.story-viewer__media .story-viewer__error {
    color: #aaa;
    font-size: 14px;
}

.story-viewer__paused {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 24px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.story-viewer.is-paused .story-viewer__paused {
    display: flex;
}

.story-viewer.is-holding .story-viewer__paused {
    display: none;
}

.story-viewer__caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    padding: 40px 18px 26px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .75));
    color: #fff;
    font-size: 16px;
    text-align: center;
    word-wrap: break-word;
    pointer-events: none;
}

.story-viewer__nav {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.story-viewer__nav:hover {
    background: rgba(255, 255, 255, .3);
}

@media (max-width: 575.98px) {
    .story-viewer__frame {
        width: 100vw;
        height: 100%;
        border-radius: 0;
    }

    .story-viewer__nav {
        display: none;
    }

    .story-modal__body {
        padding: 18px 18px 24px;
    }

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

/* ── Toast (fallback when SweetAlert is not available) ───── */

.story-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 3200;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border-radius: 8px;
    background: #198754;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .2);
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transform: translate(-50%, 10px);
    transition: opacity .25s ease, transform .25s ease;
}

.story-toast--error {
    background: #dc3545;
}

.story-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ── Dark theme (site toggle sets [data-theme=dark]) ─────── */

[data-theme=dark] .story-modal__dialog {
    background: var(--color-dp16, #1f2029);
}

[data-theme=dark] .story-modal__footer {
    border-color: #3a3d4a;
    background: var(--mdb-gray-800, #2b2d38);
}

[data-theme=dark] .story-modal__label,
[data-theme=dark] .story-dropzone__title {
    color: #e5e7eb !important;
}

[data-theme=dark] .story-modal__input,
[data-theme=dark] .story-modal__close-btn {
    border-color: #3a3d4a;
    background: var(--mdb-gray-800, #2b2d38);
    color: #e5e7eb;
}

[data-theme=dark] .story-dropzone,
[data-theme=dark] .story-add-card,
[data-theme=dark] .story-circle--add .story-circle__ring {
    border-color: rgba(255, 142, 0, .45);
    background: rgba(255, 142, 0, .08);
}

[data-theme=dark] .story-dropzone:hover,
[data-theme=dark] .story-add-card:hover {
    background: rgba(255, 142, 0, .15);
}

[data-theme=dark] .story-add-card {
    color: #e5e7eb;
}

[data-theme=dark] .story-circle__inner {
    border-color: var(--mdb-gray-800, #2b2d38);
}
