/* Loaded after style.css: compact theme control and responsive reading scale. */
.site-header .header-actions {
    gap: 0.42rem !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* Tarot Liquid Glass alignment: quiet materials, unframed labels, neutral depth. */
.tarot-stage {
    --tarot-accent: var(--lg-accent) !important;
    --tarot-accent-strong: var(--lg-accent) !important;
    --tarot-accent-soft: var(--lg-accent-soft) !important;
    --tarot-ink: var(--lg-ink) !important;
    --tarot-muted: var(--lg-muted) !important;
    --tarot-line: var(--lg-content-line) !important;
}

.tarot-stage .tarot-hero-copy .hero-kicker,
.tarot-stage .tarot-table .section-kicker,
.tarot-stage .spread-slot .section-kicker,
.tarot-stage .tarot-card-kicker {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--lg-muted) !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.tarot-stage .tarot-hero-copy .hero-kicker {
    gap: 0.38rem !important;
    color: var(--lg-accent) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
}

.tarot-stage .tarot-hero-copy h1,
[data-theme="dark"] .tarot-stage .tarot-hero-copy h1 {
    color: var(--lg-ink) !important;
}

.tarot-stage .tarot-form {
    border: 1px solid transparent !important;
    background:
        radial-gradient(260px circle at 12% 0%, var(--lg-lens), transparent 70%) padding-box,
        linear-gradient(155deg, var(--lg-panel-top), var(--lg-panel-bottom)) padding-box,
        linear-gradient(145deg, var(--lg-edge-high), var(--lg-edge-mid) 48%, var(--lg-edge-low)) border-box !important;
    background-image:
        radial-gradient(260px circle at 12% 0%, var(--lg-lens), transparent 70%),
        linear-gradient(155deg, var(--lg-panel-top), var(--lg-panel-bottom)),
        linear-gradient(145deg, var(--lg-edge-high), var(--lg-edge-mid) 48%, var(--lg-edge-low)) !important;
    box-shadow: var(--lg-panel-shadow) !important;
    -webkit-backdrop-filter: blur(var(--lg-panel-blur)) saturate(var(--lg-saturation)) !important;
    backdrop-filter: blur(var(--lg-panel-blur)) saturate(var(--lg-saturation)) !important;
}

.tarot-stage .tarot-form label > span {
    color: var(--lg-muted) !important;
    font-size: 0.74rem !important;
    font-weight: 650 !important;
}

.tarot-stage .tarot-form textarea,
.tarot-stage .tarot-form select,
.tarot-stage .ai-chat-compose {
    border: 1px solid var(--lg-content-line) !important;
    color: var(--lg-ink) !important;
    background: color-mix(in srgb, var(--lg-content-strong) 72%, transparent) !important;
    box-shadow:
        inset 0 1px 0 var(--lg-edge-high),
        inset 0 -1px 0 rgba(79, 95, 121, 0.04) !important;
}

.tarot-stage .tarot-form textarea:focus,
.tarot-stage .tarot-form select:focus,
.tarot-stage .ai-chat-compose:focus-within {
    border-color: var(--lg-content-line-strong) !important;
    box-shadow: 0 0 0 4px var(--lg-accent-soft), inset 0 1px 0 var(--lg-edge-high) !important;
}

.tarot-stage .tarot-form .button.primary,
.tarot-stage .tarot-actions .button.primary,
.tarot-stage .ai-chat-send {
    border: 1px solid transparent !important;
    color: var(--lg-ink) !important;
    background:
        radial-gradient(130px circle at var(--lg-pointer-x, 50%) var(--lg-pointer-y, 8%), var(--lg-lens), var(--lg-lens-soft) 38%, transparent 74%) padding-box,
        linear-gradient(155deg, color-mix(in srgb, var(--lg-control-top) 88%, var(--lg-accent-soft)), color-mix(in srgb, var(--lg-control-bottom) 90%, var(--lg-accent-soft))) padding-box,
        linear-gradient(145deg, var(--lg-edge-high), var(--lg-edge-mid) 48%, var(--lg-edge-low)) border-box !important;
    background-image:
        radial-gradient(130px circle at var(--lg-pointer-x, 50%) var(--lg-pointer-y, 8%), var(--lg-lens), var(--lg-lens-soft) 38%, transparent 74%),
        linear-gradient(155deg, color-mix(in srgb, var(--lg-control-top) 88%, var(--lg-accent-soft)), color-mix(in srgb, var(--lg-control-bottom) 90%, var(--lg-accent-soft))),
        linear-gradient(145deg, var(--lg-edge-high), var(--lg-edge-mid) 48%, var(--lg-edge-low)) !important;
    box-shadow:
        inset 0 1px 0 var(--lg-edge-high),
        inset 0 -1px 0 rgba(50, 68, 96, 0.06),
        var(--lg-control-shadow) !important;
    -webkit-backdrop-filter: blur(var(--lg-control-blur)) saturate(var(--lg-saturation)) contrast(1.04) !important;
    backdrop-filter: blur(var(--lg-control-blur)) saturate(var(--lg-saturation)) contrast(1.04) !important;
    transition:
        transform 180ms var(--lg-spring),
        box-shadow 240ms var(--lg-ease),
        border-color 240ms var(--lg-ease),
        color 180ms var(--lg-ease) !important;
}

@media (hover: hover) and (pointer: fine) {
    .tarot-stage .tarot-form .button.primary:hover:not(:disabled),
    .tarot-stage .tarot-actions .button.primary:hover:not(:disabled),
    .tarot-stage .ai-chat-send:hover:not(:disabled) {
        transform: translate3d(0, -1px, 0) scale(1.012) !important;
        box-shadow:
            inset 0 1px 0 var(--lg-edge-high),
            inset 0 -1px 0 rgba(50, 68, 96, 0.07),
            0 2px 4px rgba(28, 39, 57, 0.08),
            0 16px 38px rgba(37, 51, 75, 0.14) !important;
    }
}

.tarot-stage .tarot-form .button.primary:active:not(:disabled),
.tarot-stage .tarot-actions .button.primary:active:not(:disabled),
.tarot-stage .ai-chat-send:active:not(:disabled) {
    transform: translate3d(0, 1px, 0) scale(0.972) !important;
    box-shadow:
        inset 0 2px 5px rgba(34, 47, 67, 0.12),
        inset 0 -1px 0 var(--lg-edge-high),
        0 5px 14px rgba(31, 45, 66, 0.1) !important;
    transition-duration: 90ms !important;
}

.tarot-stage .tarot-form .button.primary:disabled,
.tarot-stage .tarot-actions .button.primary:disabled,
.tarot-stage .ai-chat-send:disabled {
    cursor: progress !important;
    color: var(--lg-muted) !important;
    opacity: 1 !important;
    background:
        linear-gradient(155deg, color-mix(in srgb, var(--lg-control-top) 64%, transparent), color-mix(in srgb, var(--lg-control-bottom) 66%, transparent)) padding-box,
        linear-gradient(145deg, var(--lg-edge-mid), var(--lg-edge-low)) border-box !important;
    box-shadow: inset 0 1px 0 var(--lg-edge-mid), 0 8px 20px rgba(37, 51, 75, 0.08) !important;
    transform: none !important;
}

.tarot-stage .tarot-table,
[data-theme="light"] .tarot-stage .tarot-table,
[data-theme="dark"] .tarot-stage .tarot-table {
    position: relative !important;
    isolation: isolate !important;
    border: 1px solid transparent !important;
    color: var(--lg-ink) !important;
    background:
        radial-gradient(520px circle at 78% 4%, var(--lg-lens), transparent 68%) padding-box,
        linear-gradient(160deg, var(--lg-panel-top), var(--lg-panel-bottom)) padding-box,
        linear-gradient(145deg, var(--lg-edge-high), var(--lg-edge-mid) 46%, var(--lg-edge-low)) border-box !important;
    background-image:
        radial-gradient(520px circle at 78% 4%, var(--lg-lens), transparent 68%),
        linear-gradient(160deg, var(--lg-panel-top), var(--lg-panel-bottom)),
        linear-gradient(145deg, var(--lg-edge-high), var(--lg-edge-mid) 46%, var(--lg-edge-low)) !important;
    box-shadow: var(--lg-panel-shadow) !important;
    -webkit-backdrop-filter: blur(var(--lg-panel-blur)) saturate(var(--lg-saturation)) !important;
    backdrop-filter: blur(var(--lg-panel-blur)) saturate(var(--lg-saturation)) !important;
}

.tarot-stage .tarot-table::before {
    display: block !important;
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: -1 !important;
    border-radius: inherit !important;
    pointer-events: none !important;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.14), transparent 32%, transparent 72%, var(--lg-accent-soft)) !important;
    opacity: 0.72 !important;
}

.tarot-stage .tarot-table .section-kicker {
    color: var(--lg-ink) !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
}

.tarot-stage .tarot-selection-copy,
[data-theme="light"] .tarot-stage .tarot-selection-copy,
[data-theme="dark"] .tarot-stage .tarot-selection-copy {
    color: var(--lg-muted) !important;
    font-size: 0.76rem !important;
    font-weight: 600 !important;
}

.tarot-stage .spread-slot {
    border: 0 !important;
    border-radius: 12px !important;
    color: var(--lg-muted) !important;
    background: color-mix(in srgb, var(--lg-content-soft) 48%, transparent) !important;
    box-shadow: inset 0 1px 0 var(--lg-edge-mid) !important;
}

.tarot-stage .spread-slot strong {
    color: var(--lg-ink) !important;
    font-weight: 650 !important;
}

.tarot-stage .spread-slot > span:last-child {
    color: var(--lg-faint) !important;
}

.tarot-stage .tarot-deck-fan::before {
    display: block !important;
    border: 1px solid var(--lg-content-line) !important;
    background:
        radial-gradient(ellipse at 50% 18%, var(--lg-lens), transparent 62%),
        linear-gradient(180deg, color-mix(in srgb, var(--lg-content-soft) 40%, transparent), transparent) !important;
    box-shadow:
        inset 0 1px 0 var(--lg-edge-mid),
        0 28px 58px rgba(28, 39, 57, 0.08) !important;
    -webkit-backdrop-filter: blur(18px) saturate(130%) !important;
    backdrop-filter: blur(18px) saturate(130%) !important;
}

.tarot-stage .tarot-deck-fan::after {
    display: block !important;
    background: radial-gradient(ellipse, var(--lg-accent-soft), transparent 68%) !important;
    opacity: 0.6 !important;
    filter: blur(12px) !important;
}

.tarot-stage .deck-card {
    filter: drop-shadow(0 16px 24px rgba(20, 29, 42, 0.2)) !important;
}

.tarot-stage .deck-back,
.tarot-stage .tarot-back {
    border-color: var(--lg-content-line-strong) !important;
    color: var(--lg-accent) !important;
    background:
        radial-gradient(circle at 50% 24%, var(--lg-lens), transparent 36%),
        linear-gradient(155deg, color-mix(in srgb, var(--lg-content-strong) 76%, #334155 24%), color-mix(in srgb, var(--lg-content-soft) 72%, #1f2937 28%)) !important;
    box-shadow: inset 0 1px 0 var(--lg-edge-high) !important;
}

.tarot-stage .tarot-summary-box,
[data-theme="dark"] .tarot-stage .tarot-summary-box,
.tarot-stage .ai-chat-panel,
[data-theme="dark"] .tarot-stage .ai-chat-panel {
    border-color: var(--lg-content-line) !important;
    color: var(--lg-ink) !important;
    background: var(--lg-content-soft) !important;
    box-shadow: var(--lg-content-shadow) !important;
}

.tarot-stage .tarot-result-label {
    color: var(--lg-muted) !important;
}

.tarot-stage .tarot-actions .button.secondary,
[data-theme="dark"] .tarot-stage .tarot-actions .button.secondary,
.tarot-stage .tarot-front,
[data-theme="dark"] .tarot-stage .tarot-front {
    border-color: var(--lg-content-line) !important;
    color: var(--lg-ink) !important;
    background: var(--lg-content) !important;
}

.tarot-stage .ai-chat-bubble.is-assistant,
[data-theme="dark"] .tarot-stage .ai-chat-bubble.is-assistant {
    background: var(--lg-accent-soft) !important;
}

.tarot-stage .ai-chat-bubble.is-user,
[data-theme="dark"] .tarot-stage .ai-chat-bubble.is-user {
    background: var(--lg-content-soft) !important;
}

.tarot-stage .ai-chat-content,
.tarot-stage .ai-chat-content p,
[data-theme="dark"] .tarot-stage .ai-chat-content,
[data-theme="dark"] .tarot-stage .ai-chat-content p {
    color: var(--lg-ink) !important;
}

/* Tarot interaction: stable card geometry, one render pass, and a quieter chat flow. */
.tarot-table {
    overflow: hidden !important;
    background:
        radial-gradient(circle at 50% 86%, rgba(122, 142, 178, calc(0.12 - var(--theme-progress) * 0.05)), transparent 44%),
        var(--qa-surface) !important;
}

.tarot-stage .tarot-table {
    min-height: 25rem !important;
    padding: 1rem !important;
}

.tarot-spread-zone {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
    width: min(100%, 44rem) !important;
    min-height: 74px !important;
    margin: 0.8rem auto 0 !important;
}

.tarot-spread-zone:has(.spread-slot:only-child) {
    grid-template-columns: minmax(0, 13rem) !important;
    justify-content: center !important;
}

.spread-slot {
    min-width: 0 !important;
    min-height: 70px !important;
    padding: 0.7rem 0.8rem !important;
    border: 1px solid var(--qa-line) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, calc(0.46 - var(--theme-progress) * 0.39)) !important;
    box-shadow: none !important;
}

.spread-slot strong,
.spread-slot span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.spread-slot strong {
    font-size: 0.92rem !important;
    line-height: 1.3 !important;
}

.spread-slot > span:last-child {
    color: var(--qa-muted) !important;
    font-size: 0.76rem !important;
}

.tarot-deck-fan {
    position: relative !important;
    display: block !important;
    width: min(100%, 38rem) !important;
    height: clamp(280px, 34vw, 360px) !important;
    min-height: 280px !important;
    margin: 0.25rem auto 0 !important;
    overflow: visible !important;
    isolation: isolate !important;
    perspective: 1100px !important;
    contain: layout !important;
}

.tarot-deck-fan .deck-card {
    position: absolute !important;
    inset: auto auto 1.6rem 50% !important;
    width: clamp(92px, 8vw, 116px) !important;
    height: clamp(156px, 13.56vw, 197px) !important;
    aspect-ratio: 0.59 !important;
    margin: 0 !important;
    padding: 0 !important;
    contain: none !important;
    opacity: 1 !important;
    transform: translate3d(-50%, 52px, 0) rotate(0deg) !important;
    transform-origin: 50% 112% !important;
    transition:
        transform 620ms cubic-bezier(0.22, 0.78, 0.2, 1),
        opacity 260ms ease,
        filter 260ms ease !important;
    transition-delay: calc(var(--fan-index) * 14ms) !important;
    will-change: transform, opacity !important;
    touch-action: manipulation !important;
}

.tarot-deck-fan .deck-card:disabled {
    cursor: default !important;
    opacity: 1 !important;
}

.tarot-deck-fan.is-shuffling .deck-card,
.tarot-deck-fan.is-ready .deck-card,
.tarot-deck-fan.is-selected .deck-card {
    transform: translate3d(calc(-50% + var(--card-shift)), 0, 0) rotate(var(--card-rotate)) !important;
}

.tarot-deck-fan.is-ready .deck-card {
    cursor: pointer !important;
}

.tarot-deck-fan.is-ready .deck-card.is-selected,
.tarot-deck-fan.is-selected .deck-card.is-selected {
    z-index: calc(40 + var(--selected-order)) !important;
    filter: brightness(1.08) drop-shadow(0 18px 18px rgba(39, 49, 72, 0.23)) !important;
    transform: translate3d(calc(-50% + var(--card-shift)), -28px, 0) rotate(var(--card-rotate)) !important;
}

.tarot-deck-fan.is-drawing .deck-card:not(.is-selected) {
    opacity: 0.12 !important;
    filter: blur(1px) !important;
    transform: translate3d(calc(-50% + var(--card-shift)), 22px, 0) rotate(var(--card-rotate)) scale(0.96) !important;
}

.tarot-deck-fan.is-drawing .deck-card.is-selected {
    z-index: calc(40 + var(--selected-order)) !important;
    transform: translate3d(calc(-50% + var(--card-shift)), -42px, 0) rotate(var(--card-rotate)) scale(1.03) !important;
}

@media (hover: hover) and (pointer: fine) {
    .tarot-deck-fan.is-ready .deck-card:not(.is-selected):hover {
        z-index: 32 !important;
        transform: translate3d(calc(-50% + var(--card-shift)), -16px, 0) rotate(var(--card-rotate)) !important;
    }
}

.ai-chat-panel {
    width: min(100%, 52rem) !important;
    margin: 2.25rem auto 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid var(--qa-line) !important;
    border-radius: 20px !important;
    background: var(--qa-surface) !important;
    box-shadow: 0 18px 48px rgba(24, 34, 52, calc(0.08 + var(--theme-progress) * 0.08)) !important;
}

.ai-chat-head {
    display: grid !important;
    gap: 0.22rem !important;
    padding: 1.1rem 1.2rem 0.95rem !important;
    border-bottom: 1px solid var(--qa-line) !important;
}

.ai-chat-head strong {
    color: var(--qa-ink) !important;
    font-size: 1rem !important;
    line-height: 1.35 !important;
}

.ai-chat-head p,
.ai-chat-empty,
.ai-chat-remaining {
    margin: 0 !important;
    color: var(--qa-muted) !important;
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
}

.ai-chat-log {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.72rem !important;
    max-height: 26rem !important;
    padding: 1rem 1.2rem !important;
    overflow: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin !important;
}

.ai-chat-empty {
    padding: 1rem 1.2rem 0 !important;
}

.ai-chat-bubble {
    width: fit-content !important;
    max-width: min(86%, 38rem) !important;
    margin: 0 !important;
    padding: 0.72rem 0.9rem !important;
    border: 0 !important;
    border-radius: 16px !important;
    box-shadow: none !important;
}

.ai-chat-bubble.is-user {
    align-self: flex-end !important;
    border-bottom-right-radius: 6px !important;
    color: rgba(255, 255, 255, 0.96) !important;
    background: rgb(calc(57 - var(--theme-progress) * 24), calc(72 - var(--theme-progress) * 35), calc(98 - var(--theme-progress) * 46)) !important;
}

.ai-chat-bubble.is-assistant {
    align-self: flex-start !important;
    border: 1px solid var(--qa-line) !important;
    border-bottom-left-radius: 6px !important;
    color: var(--qa-ink) !important;
    background: rgba(255, 255, 255, calc(0.54 - var(--theme-progress) * 0.46)) !important;
}

.ai-chat-content,
.ai-chat-content p {
    margin: 0 !important;
    color: inherit !important;
    font-size: 0.94rem !important;
    line-height: 1.68 !important;
}

.ai-chat-compose {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: end !important;
    gap: 0.6rem !important;
    margin: 1rem 1.2rem 0 !important;
    padding: 0.45rem !important;
    border: 1px solid var(--qa-line) !important;
    border-radius: 17px !important;
    background: rgba(255, 255, 255, calc(0.62 - var(--theme-progress) * 0.54)) !important;
    box-shadow: inset 0 1px rgba(255, 255, 255, calc(0.7 - var(--theme-progress) * 0.56)) !important;
}

.ai-chat-compose textarea {
    width: 100% !important;
    min-height: 42px !important;
    max-height: 132px !important;
    padding: 0.62rem 0.68rem !important;
    resize: none !important;
    overflow-y: auto !important;
    border: 0 !important;
    border-radius: 12px !important;
    outline: 0 !important;
    color: var(--qa-ink) !important;
    background: transparent !important;
    box-shadow: none !important;
    font: inherit !important;
    font-size: 0.94rem !important;
    line-height: 1.5 !important;
}

.ai-chat-send {
    min-width: 4.5rem !important;
    min-height: 42px !important;
    padding: 0 0.9rem !important;
    border-radius: 13px !important;
    white-space: nowrap !important;
}

.ai-chat-remaining {
    padding: 0.6rem 1.2rem 1rem !important;
    text-align: right !important;
}

@media (max-width: 760px) {
    .tarot-table {
        min-height: 0 !important;
        padding: 0.9rem 0.7rem 0.25rem !important;
    }

    .tarot-table-head {
        gap: 0.55rem !important;
        padding: 0 0.18rem !important;
    }

    .tarot-table-head > div { min-width: 0 !important; }

    .tarot-selection-copy {
        max-width: 45% !important;
        text-align: right !important;
    }

    .tarot-spread-zone {
        gap: 0.4rem !important;
        min-height: 66px !important;
        margin-top: 0.65rem !important;
    }

    .spread-slot {
        min-height: 62px !important;
        padding: 0.55rem 0.48rem !important;
        border-radius: 12px !important;
    }

    .spread-slot .section-kicker { font-size: 0.65rem !important; }
    .spread-slot strong { font-size: 0.78rem !important; }
    .spread-slot > span:last-child { font-size: 0.68rem !important; }

    .tarot-deck-fan {
        width: 100% !important;
        height: 304px !important;
        min-height: 304px !important;
        margin-top: 0 !important;
        contain: layout !important;
    }

    .tarot-deck-fan .deck-card {
        inset: auto auto 1.2rem 50% !important;
        width: clamp(82px, 23.5vw, 92px) !important;
        height: clamp(139px, 39.8vw, 156px) !important;
        contain: none !important;
        transition-duration: 540ms, 220ms, 220ms !important;
        transition-delay: calc(var(--fan-index) * 11ms) !important;
    }

    .tarot-deck-fan.is-ready .deck-card.is-selected,
    .tarot-deck-fan.is-selected .deck-card.is-selected {
        transform: translate3d(calc(-50% + var(--card-shift)), -24px, 0) rotate(var(--card-rotate)) !important;
    }

    .tarot-deck-fan.is-drawing .deck-card.is-selected {
        transform: translate3d(calc(-50% + var(--card-shift)), -34px, 0) rotate(var(--card-rotate)) !important;
    }

    .ai-chat-panel {
        margin-top: 1.5rem !important;
        border-radius: 18px !important;
    }

    .ai-chat-head {
        padding: 0.95rem 1rem 0.8rem !important;
    }

    .ai-chat-log {
        max-height: 22rem !important;
        gap: 0.62rem !important;
        padding: 0.85rem 1rem !important;
    }

    .ai-chat-empty { padding: 0.85rem 1rem 0 !important; }

    .ai-chat-bubble {
        max-width: 90% !important;
        padding: 0.68rem 0.8rem !important;
        border-radius: 15px !important;
    }

    .ai-chat-compose {
        margin: 0.85rem 0.8rem 0 !important;
        gap: 0.35rem !important;
    }

    .ai-chat-send {
        min-width: 3.9rem !important;
        padding: 0 0.72rem !important;
        font-size: 0.82rem !important;
    }

    .ai-chat-remaining { padding: 0.52rem 0.95rem 0.85rem !important; }
}

@media (prefers-reduced-motion: reduce) {
    .tarot-deck-fan .deck-card {
        transition-duration: 1ms !important;
        transition-delay: 0ms !important;
    }
}

/* Home controls sit directly over changing film frames. Keep their glass
   shell unchanged, but let the label/icon ink invert against the frame so a
   dark city and a bright sky remain equally legible. */
@supports (mix-blend-mode: difference) {
    html[data-theme] body.home .site-header .brand,
    html[data-theme] body.home .site-header .lang-toggle > *,
    html[data-theme] body.home .home-scroll-cue > * {
        color: rgba(255, 255, 255, 0.96) !important;
        opacity: 1 !important;
        mix-blend-mode: difference !important;
        text-shadow: 0 1px 5px rgba(0, 0, 0, 0.42) !important;
    }

    html[data-theme] body.home .site-header .brand,
    html[data-theme] body.home .site-header .lang-toggle [data-lang-current] {
        -webkit-text-fill-color: rgba(255, 255, 255, 0.96) !important;
    }
}

/* Editorial provenance and the daily home-screen line. */
.home-daily-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.38rem 0.7rem;
    max-width: min(42rem, 88vw);
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    transform: translate3d(0, 7px, 0);
    transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1), transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.home-daily-line.is-ready {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.home-daily-line.is-changing {
    opacity: 0;
    transform: translate3d(0, 4px, 0);
}

.home-daily-line > span {
    font-size: clamp(0.9rem, 1.2vw, 1.02rem);
    line-height: 1.55;
    text-wrap: balance;
}

.home-daily-line > small {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
    line-height: 1.4;
    white-space: nowrap;
}

.content-origin-note {
    display: inline-flex;
    align-items: center;
    color: var(--qa-muted, var(--muted)) !important;
    font-size: 0.68rem;
    font-weight: 560;
    line-height: 1.35;
    opacity: 0.72;
    white-space: nowrap;
}

.home-story-meta {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 0.55rem 0.8rem !important;
}

.home-story-meta .content-origin-note {
    margin-left: auto;
}

.note-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
}

.article-sources {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    margin-top: clamp(2.4rem, 5vw, 4rem);
    padding-top: 0.25rem;
    color: var(--qa-muted, var(--muted));
    font-size: 0.78rem;
    line-height: 1.6;
}

.article-sources > span {
    font-weight: 650;
}

.article-sources a {
    color: inherit !important;
    text-decoration-color: color-mix(in srgb, currentColor 34%, transparent);
}

.article-sources a:hover {
    color: var(--qa-ink, var(--text)) !important;
}

@media (max-width: 760px) {
    .home-daily-line {
        display: grid;
        gap: 0.25rem;
        max-width: min(21rem, 86vw);
        margin-top: 0.85rem;
    }

    .home-daily-line > span {
        font-size: 0.86rem;
    }

    .home-daily-line > small {
        font-size: 0.68rem;
    }

    .content-origin-note {
        font-size: 0.64rem;
    }

    .article-sources {
        display: grid;
        gap: 0.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-daily-line,
    .home-daily-line.is-ready,
    .home-daily-line.is-changing {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Recent draws: a quiet archive list, not another stack of glass cards. */
.tarot-history {
    position: relative;
    display: grid;
    gap: 0;
    margin-top: clamp(2.4rem, 6vw, 4.5rem) !important;
    padding: clamp(1rem, 2.5vw, 1.45rem) 0 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-top: 1px solid var(--qa-line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    filter: none !important;
}

.tarot-history::before,
.tarot-history::after,
.tarot-history-item::before,
.tarot-history-item::after {
    display: none !important;
    content: none !important;
}

.tarot-history-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    padding: 0 0 clamp(0.75rem, 2vw, 1rem) !important;
}

.tarot-history-head h2 {
    margin: 0 !important;
    color: var(--qa-ink) !important;
    font-family: var(--font-display) !important;
    font-size: clamp(1.05rem, 2vw, 1.28rem) !important;
    font-weight: 720 !important;
    line-height: 1.2 !important;
}

.tarot-history-clear {
    appearance: none;
    min-height: 36px;
    padding: 0.35rem 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--qa-muted) !important;
    background: transparent !important;
    box-shadow: none !important;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 620;
    cursor: pointer;
    transition: color 140ms ease !important;
}

.tarot-history-clear:hover,
.tarot-history-clear:focus-visible {
    color: var(--qa-ink) !important;
}

.tarot-history-list,
.tarot-history-group,
.tarot-history-more,
.tarot-history-group-hidden {
    display: grid !important;
    gap: 0 !important;
}

.tarot-history-item {
    position: relative;
    display: block !important;
    min-width: 0;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-top: 1px solid var(--qa-line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    filter: none !important;
    transform: none !important;
    transition: background-color 140ms ease !important;
}

.tarot-history-group > .tarot-history-item:first-child {
    border-top-color: transparent !important;
}

.tarot-history-open {
    appearance: none;
    width: 100%;
    min-width: 0;
    min-height: 76px;
    display: grid;
    grid-template-columns: minmax(8.5rem, 0.52fr) minmax(0, 1.48fr) 22px;
    align-items: center;
    gap: clamp(0.9rem, 2.4vw, 1.6rem);
    padding: 0.9rem 0.15rem;
    border: 0;
    border-radius: 0;
    color: var(--qa-ink);
    background: transparent;
    box-shadow: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tarot-history-item:hover,
.tarot-history-item:focus-within {
    background: rgba(
        calc(113 - 42 * var(--theme-progress)),
        calc(132 - 45 * var(--theme-progress)),
        calc(164 - 51 * var(--theme-progress)),
        calc(0.055 + 0.025 * var(--theme-progress))
    ) !important;
    box-shadow: none !important;
    transform: none !important;
}

.tarot-history-time {
    color: var(--qa-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    white-space: nowrap;
}

.tarot-history-copy {
    min-width: 0;
    display: grid;
    gap: 0.22rem;
}

.tarot-history-copy strong {
    min-width: 0;
    overflow: hidden;
    color: var(--qa-ink) !important;
    font-size: 0.95rem !important;
    font-weight: 680 !important;
    line-height: 1.4 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tarot-history-copy > span {
    min-width: 0;
    overflow: hidden;
    color: var(--qa-muted) !important;
    font-size: 0.82rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tarot-history-arrow {
    width: 19px;
    height: 19px;
    color: var(--qa-muted);
    transform: translate3d(0, 0, 0);
    transition: color 140ms ease, transform 160ms ease !important;
}

.tarot-history-open:hover .tarot-history-arrow,
.tarot-history-open:focus-visible .tarot-history-arrow {
    color: var(--qa-ink);
    transform: translate3d(3px, 0, 0);
}

.tarot-history-more {
    border-top: 1px solid var(--qa-line);
}

.tarot-history-more:not([open]) .tarot-history-group-hidden {
    display: none !important;
}

.tarot-history-more-toggle {
    min-height: 44px !important;
    width: fit-content;
    display: inline-flex !important;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.1rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--qa-muted) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0.82rem !important;
    font-weight: 620 !important;
    list-style: none;
    cursor: pointer;
}

.tarot-history-more-toggle::before {
    width: 0.38rem !important;
    height: 0.38rem !important;
    transition: transform 160ms ease !important;
}

.tarot-history-more-count {
    min-width: 0 !important;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: inherit !important;
    background: transparent !important;
    font-size: inherit !important;
}

.tarot-result {
    scroll-margin-top: 6rem;
}

@media (max-width: 760px) {
    .tarot-history {
        margin-top: 2.5rem !important;
        padding: 0.9rem 0 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .tarot-history-head {
        display: flex !important;
        align-items: center !important;
        padding-bottom: 0.55rem !important;
    }

    .tarot-history-head h2 {
        font-size: 1rem !important;
    }

    .tarot-history-open {
        min-height: 72px;
        grid-template-columns: minmax(0, 1fr) 20px;
        gap: 0.65rem;
        padding: 0.78rem 0.1rem;
    }

    .tarot-history-time {
        grid-column: 1;
        grid-row: 2;
        font-size: 0.72rem;
    }

    .tarot-history-copy {
        grid-column: 1;
        grid-row: 1;
    }

    .tarot-history-arrow {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .tarot-history-copy strong {
        font-size: 0.9rem !important;
    }

    .tarot-history-copy > span {
        font-size: 0.78rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tarot-history-item,
    .tarot-history-clear,
    .tarot-history-arrow,
    .tarot-history-more-toggle::before {
        transition: none !important;
    }
}

/* Dark surfaces: restrained directional light, never floating white blooms. */
html[data-theme="dark"]::before,
html[data-theme="dark"]::after,
html[data-theme="dark"] body::before,
html[data-theme="dark"] body::after {
    display: none !important;
    opacity: 0 !important;
    background: none !important;
    filter: none !important;
}

html[data-theme="dark"] .page-hero::before,
html[data-theme="dark"] .hero-home-clean::before {
    inset: -4% -3% !important;
    background: linear-gradient(
        180deg,
        rgba(77, 92, 118, 0.08),
        rgba(31, 39, 53, 0.025) 48%,
        transparent 82%
    ) !important;
    filter: none !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .glass-card::before,
html[data-theme="dark"] .note-card::before,
html[data-theme="dark"] .article::before,
html[data-theme="dark"] .reading-box::before,
html[data-theme="dark"] .comment-card::before,
html[data-theme="dark"] .comment-form-wrap-v4::before,
html[data-theme="dark"] .comments-compose-panel::before,
html[data-theme="dark"] .tarot-table::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 32%) !important;
    opacity: 1 !important;
    filter: none !important;
}

html[data-theme="dark"] .glass-card::after,
html[data-theme="dark"] .note-card::after,
html[data-theme="dark"] .article::after,
html[data-theme="dark"] .reading-box::after,
html[data-theme="dark"] .comment-card::after,
html[data-theme="dark"] .comment-form-wrap-v4::after,
html[data-theme="dark"] .comments-compose-panel::after,
html[data-theme="dark"] .tarot-table::after {
    display: none !important;
}

.theme-toggle {
    --toggle-icon: 20px;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, calc(0.62 - var(--theme-progress) * 0.48)) !important;
    border-radius: 50% !important;
    background: rgba(calc(255 - var(--theme-progress) * 235), calc(255 - var(--theme-progress) * 232), calc(255 - var(--theme-progress) * 226), calc(0.74 + var(--theme-progress) * 0.04)) !important;
    box-shadow: inset 0 1px rgba(255,255,255,calc(0.82 - var(--theme-progress) * 0.68)), 0 10px 28px rgba(22,34,54,calc(0.1 + var(--theme-progress) * 0.12)) !important;
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    transition: background-color 260ms ease, border-color 260ms ease, box-shadow 260ms ease, transform 180ms var(--qa-ease) !important;
}

.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle:active { transform: scale(0.94); }

.theme-toggle-track {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: none !important;
}

.theme-toggle__around {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: var(--toggle-icon) !important;
    height: var(--toggle-icon) !important;
    color: rgb(calc(226 - var(--theme-progress) * 13), calc(160 + var(--theme-progress) * 56), calc(52 + var(--theme-progress) * 181)) !important;
    opacity: calc(1 - var(--theme-progress)) !important;
    filter: none !important;
    transform: translate3d(-50%, -50%, 0) rotate(calc(var(--theme-progress) * 150deg)) !important;
    transform-origin: center !important;
    transition: transform 260ms var(--qa-ease), color 260ms ease, opacity 180ms ease !important;
}

.theme-toggle-moon {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--toggle-icon);
    height: var(--toggle-icon);
    pointer-events: none;
    opacity: var(--theme-progress);
    transform: translate3d(-50%, -50%, 0) scale(calc(0.82 + var(--theme-progress) * 0.18)) rotate(calc(-16deg + var(--theme-progress) * 16deg));
    transform-origin: center;
    transition: transform 260ms var(--qa-ease), opacity 180ms ease;
}

.theme-toggle-moon svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.theme-toggle-moon-earthshine {
    fill: rgba(169, 183, 205, 0.24);
}

.theme-toggle-moon-lit {
    fill: rgb(241, 228, 187);
    filter: drop-shadow(0 0 3px rgba(241, 228, 187, 0.3));
}

.theme-toggle-moon-craters {
    fill: rgba(93, 104, 123, 0.34);
    opacity: calc(0.34 + var(--moon-illumination, 0.5) * 0.28);
}

.theme-toggle-moon-edge {
    fill: none;
    stroke: rgba(224, 232, 243, 0.58);
    stroke-width: 0.72;
}

.theme-toggle.is-clicking { animation: qa-theme-button-pop 260ms var(--qa-ease); }

@keyframes qa-theme-button-pop {
    0% { transform: scale(1); }
    45% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@media (min-width: 761px) and (max-width: 980px) {
    .page-hero h1,
    .tarot-hero-copy h1 {
        font-size: 3rem !important;
        line-height: 1.05 !important;
        letter-spacing: 0 !important;
    }

    .article > h1 {
        max-width: 14ch !important;
        font-size: 3.4rem !important;
        line-height: 1.04 !important;
        letter-spacing: 0 !important;
    }

    .home-story-copy h3 {
        font-size: 3.6rem !important;
        line-height: 1.02 !important;
    }
}

@media (max-width: 760px) {
    body {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    .site-header {
        min-height: 56px !important;
        padding: 0.55rem 0.72rem !important;
    }

    .site-header .brand { font-size: 0.8rem !important; }

    .site-header .header-actions {
        gap: 0.34rem !important;
        transform: none !important;
    }

    .theme-toggle {
        --toggle-icon: 18px;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
    }

    .lang-toggle {
        min-height: 38px !important;
        padding: 0 0.72rem !important;
        font-size: 0.8rem !important;
    }

    .page-shell {
        width: min(100% - 1.25rem, 42rem) !important;
        padding-top: 5.4rem !important;
    }

    body.home .page-shell {
        width: 100% !important;
        padding-top: 0 !important;
    }

    .home-film-copy {
        left: 1.25rem !important;
        right: 1.25rem !important;
        bottom: 6.3rem !important;
    }

    .home-film-kicker {
        margin-bottom: 0.75rem !important;
        font-size: 0.78rem !important;
    }

    .home-film-copy h1 {
        max-width: 8ch !important;
        font-size: 3.1rem !important;
        line-height: 0.98 !important;
        letter-spacing: 0 !important;
    }

    .home-film-copy p {
        max-width: 22rem !important;
        margin-top: 0.85rem !important;
        font-size: 0.96rem !important;
        line-height: 1.55 !important;
    }

    .home-scroll-cue,
    .home-video-toggle { min-height: 42px !important; }

    .home-story-stream {
        width: min(100% - 1.25rem, 42rem) !important;
        padding: 4.4rem 0 6rem !important;
    }

    .home-story-intro { margin-bottom: 2rem !important; }
    .home-story-intro > span { font-size: 0.76rem !important; }

    .home-story-intro h2 {
        margin-top: 0.45rem !important;
        font-size: 2.5rem !important;
        line-height: 1.02 !important;
        letter-spacing: 0 !important;
    }

    .home-story-intro p {
        margin-top: 0.75rem !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    .home-story {
        min-height: 26rem !important;
        border-radius: 24px !important;
    }

    .home-story-link { padding: 1.15rem !important; }

    .home-story-copy h3 {
        max-width: 12ch !important;
        font-size: 2.25rem !important;
        line-height: 1.04 !important;
        letter-spacing: 0 !important;
    }

    .home-story-copy p {
        margin-top: 0.8rem !important;
        font-size: 0.96rem !important;
        line-height: 1.62 !important;
    }

    .home-story-action {
        min-height: 44px !important;
        margin-top: 1rem !important;
        padding: 0 0.95rem !important;
    }

    .page-hero {
        min-height: 0 !important;
        padding: 1.1rem 0.5rem 1.55rem !important;
        background: transparent !important;
    }

    .page-hero .eyebrow,
    .tarot-hero-copy .hero-kicker { font-size: 0.78rem !important; }

    .page-hero h1,
    .tarot-hero-copy h1 {
        max-width: 100% !important;
        margin-top: 0.55rem !important;
        font-size: 2.4rem !important;
        line-height: 1.06 !important;
        letter-spacing: 0 !important;
        overflow-wrap: normal !important;
        word-break: keep-all !important;
    }

    .page-hero > p,
    .tarot-hero-copy > p {
        margin-top: 0.72rem !important;
        font-size: 0.96rem !important;
        line-height: 1.65 !important;
    }

    .notes-page-grid {
        gap: 0.72rem !important;
        padding-top: 0 !important;
    }

    .note-card {
        min-height: 0 !important;
        padding: 1rem !important;
        border-radius: 20px !important;
    }

    .note-card-date { font-size: 0.76rem !important; }

    .note-card h2,
    .note-card h3 {
        margin-top: 0.7rem !important;
        font-size: 1.14rem !important;
        line-height: 1.35 !important;
        letter-spacing: 0 !important;
    }

    .note-card p {
        margin-top: 0.5rem !important;
        font-size: 0.94rem !important;
        line-height: 1.6 !important;
    }

    .note-card-link {
        margin-top: 0.7rem !important;
        font-size: 0.86rem !important;
    }

    .article {
        width: 100% !important;
        padding: 0.7rem 0.85rem 1.5rem !important;
        border-radius: 22px !important;
    }

    .article-meta-row {
        align-items: center !important;
        margin-bottom: 0 !important;
    }

    .article-kicker,
    .article-back-link,
    .article-translate-toggle { font-size: 0.78rem !important; }

    .article > h1 {
        max-width: 12ch !important;
        margin-top: 1.45rem !important;
        font-size: 2.25rem !important;
        line-height: 1.08 !important;
        letter-spacing: 0 !important;
        overflow-wrap: normal !important;
        word-break: keep-all !important;
    }

    .article-content {
        gap: 0 !important;
        font-family: var(--font-ui) !important;
        font-size: 1rem !important;
        line-height: 1.82 !important;
    }

    .article-content p,
    .article-content li {
        color: var(--qa-ink) !important;
        font-size: 1rem !important;
        line-height: 1.82 !important;
    }

    .article-content > p:first-of-type {
        color: var(--qa-muted) !important;
        font-size: 1.03rem !important;
        line-height: 1.75 !important;
    }

    .article-content h2 {
        margin-top: 2.35rem !important;
        margin-bottom: 0.75rem !important;
        font-size: 1.55rem !important;
        line-height: 1.24 !important;
        letter-spacing: 0 !important;
    }

    .article-content h3 {
        margin-top: 2rem !important;
        font-size: 1.15rem !important;
        line-height: 1.35 !important;
    }

    .article-content blockquote {
        margin: 1.6rem 0 !important;
        padding-left: 1rem !important;
    }

    .article-content blockquote p {
        font-size: 1.05rem !important;
        line-height: 1.7 !important;
    }

    .article-source-list {
        gap: 0.55rem !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .article-source-list li,
    .article-source-list a {
        font-size: 0.9rem !important;
        line-height: 1.55 !important;
    }

    .comments-shell {
        width: 100% !important;
        margin-top: 2.5rem !important;
        padding: 0 !important;
    }

    .comments-topbar {
        align-items: flex-end !important;
        gap: 0.75rem !important;
        padding: 0 0.2rem 1rem !important;
        border: 0 !important;
    }

    .comments-topbar h2 {
        font-size: 1.38rem !important;
        line-height: 1.2 !important;
    }

    .comments-topbar > p {
        font-size: 0.85rem !important;
        line-height: 1.45 !important;
    }

    .comments-grid { display: block !important; }
    .comments-empty-inline { display: none !important; }

    .comments-compose-panel {
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .comment-form-wrap-v4 {
        padding: 1rem !important;
        border: 1px solid var(--qa-line) !important;
        border-radius: 20px !important;
        background: var(--qa-surface) !important;
        box-shadow: 0 16px 42px rgba(22,34,54,calc(0.08 + var(--theme-progress) * 0.1)) !important;
    }

    .comment-compose-head strong { font-size: 1.18rem !important; }
    .comment-compose-head p { font-size: 0.86rem !important; }
    .comment-reply-title { display: none !important; }

    .comment-form label {
        color: var(--qa-muted) !important;
        font-size: 0.86rem !important;
    }

    .comment-form textarea {
        width: 100% !important;
        height: 8.5rem !important;
        min-height: 8.5rem !important;
        padding: 0.9rem !important;
        border-radius: 16px !important;
        color: var(--qa-ink) !important;
        background: rgba(255,255,255,calc(0.7 - var(--theme-progress) * 0.58)) !important;
        font-family: var(--font-ui) !important;
        font-size: 1rem !important;
        line-height: 1.65 !important;
    }

    .comment-form input[type="submit"],
    .comment-form button[type="submit"] {
        width: 100% !important;
        min-height: 44px !important;
        border-radius: 999px !important;
        font-size: 0.9rem !important;
    }

    .tarot-stage {
        width: 100% !important;
        padding: 1rem 0 2rem !important;
    }

    .tarot-layout { gap: 0.8rem !important; }

    .tarot-form {
        padding: 1rem !important;
        border-radius: 20px !important;
    }

    .tarot-form label > span,
    .tarot-form-helper {
        font-size: 0.86rem !important;
        line-height: 1.5 !important;
    }

    .tarot-form textarea {
        min-height: 7.5rem !important;
        padding: 0.85rem !important;
        border-radius: 16px !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    .tarot-form select {
        min-height: 48px !important;
        padding: 0.75rem 0.9rem !important;
        border-radius: 16px !important;
        font-size: 0.98rem !important;
    }

    .tarot-form button {
        min-height: 44px !important;
        font-size: 0.9rem !important;
    }

    .tarot-table {
        min-height: 560px !important;
        padding: 0.9rem !important;
        border-radius: 20px !important;
    }

    .tarot-table-head p,
    .tarot-selection-copy,
    .tarot-table-hint {
        font-size: 0.84rem !important;
        line-height: 1.5 !important;
    }

    /* Keep this last: earlier legacy mobile rules used a fixed 560px table. */
    .tarot-table {
        min-height: 0 !important;
        padding: 0.9rem 0.7rem 0.25rem !important;
    }
}

/* Contrast and elevation lock: keep text readable through the full theme transition. */
:root {
    --qa-ink: rgb(
        calc(17 + 222 * var(--theme-progress)),
        calc(24 + 217 * var(--theme-progress)),
        calc(36 + 208 * var(--theme-progress))
    );
    --qa-muted: rgb(
        calc(76 + 106 * var(--theme-progress)),
        calc(89 + 98 * var(--theme-progress)),
        calc(111 + 94 * var(--theme-progress))
    );
    --qa-line: rgba(
        calc(72 + 123 * var(--theme-progress)),
        calc(88 + 110 * var(--theme-progress)),
        calc(116 + 91 * var(--theme-progress)),
        calc(0.18 + 0.02 * var(--theme-progress))
    );
    --qa-raised-surface: linear-gradient(
        145deg,
        rgba(
            calc(255 - 225 * var(--theme-progress)),
            calc(255 - 220 * var(--theme-progress)),
            calc(255 - 211 * var(--theme-progress)),
            calc(0.94 - 0.08 * var(--theme-progress))
        ),
        rgba(
            calc(247 - 229 * var(--theme-progress)),
            calc(250 - 226 * var(--theme-progress)),
            calc(255 - 220 * var(--theme-progress)),
            calc(0.84 - 0.05 * var(--theme-progress))
        )
    );
    --qa-raised-shadow:
        inset 0 1px 0 rgba(255, 255, 255, calc(0.96 - 0.83 * var(--theme-progress))),
        inset 0 -1px 0 rgba(54, 70, 98, calc(0.055 + 0.03 * var(--theme-progress))),
        0 22px 52px rgba(30, 43, 66, calc(0.105 + 0.12 * var(--theme-progress))),
        0 4px 12px rgba(30, 43, 66, calc(0.045 + 0.06 * var(--theme-progress)));
}

body,
input,
select,
textarea {
    color: var(--qa-ink) !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.glass-card,
.note-card,
.tarot-form,
.reading-box,
.comment-card,
.comment-form-wrap-v4,
.comments-compose-panel,
.tarot-history,
.tarot-history-item {
    border: 1px solid rgba(255, 255, 255, calc(0.92 - 0.8 * var(--theme-progress))) !important;
    background: var(--qa-raised-surface) !important;
    box-shadow: var(--qa-raised-shadow) !important;
}

.glass-card:hover,
.note-card:hover,
.comment-card:hover,
.tarot-history-item:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, calc(0.98 - 0.84 * var(--theme-progress))),
        0 28px 64px rgba(30, 43, 66, calc(0.14 + 0.13 * var(--theme-progress))),
        0 6px 16px rgba(30, 43, 66, calc(0.055 + 0.06 * var(--theme-progress))) !important;
}

.hero-kicker,
.section-kicker,
.eyebrow,
.article-kicker,
.note-card-date,
.article-date,
.post-date,
.tarot-form label > span,
.tarot-form-helper,
.tarot-table-hint,
.tarot-selection-copy,
.tarot-hero-note,
.tarot-page-closing,
.ai-chat-head p,
.ai-chat-empty,
.ai-chat-remaining,
.comment-compose-head p,
.comment-form label {
    color: var(--qa-muted) !important;
}

.tarot-form label > span,
.comment-form label,
.ai-chat-head strong,
.spread-slot strong {
    font-weight: 680 !important;
}

.tarot-form textarea,
.tarot-form select,
.comment-form textarea,
.ai-chat-compose {
    border: 1px solid rgba(
        calc(75 + 116 * var(--theme-progress)),
        calc(91 + 103 * var(--theme-progress)),
        calc(120 + 82 * var(--theme-progress)),
        calc(0.2 + 0.03 * var(--theme-progress))
    ) !important;
    color: var(--qa-ink) !important;
    background: rgba(
        calc(255 - 237 * var(--theme-progress)),
        calc(255 - 233 * var(--theme-progress)),
        calc(255 - 227 * var(--theme-progress)),
        calc(0.78 - 0.06 * var(--theme-progress))
    ) !important;
    box-shadow:
        inset 0 1px 2px rgba(25, 38, 58, calc(0.045 + 0.11 * var(--theme-progress))),
        0 1px 0 rgba(255, 255, 255, calc(0.88 - 0.76 * var(--theme-progress))) !important;
}

.tarot-form textarea::placeholder,
.comment-form textarea::placeholder,
.ai-chat-compose textarea::placeholder {
    color: rgba(
        calc(80 + 101 * var(--theme-progress)),
        calc(93 + 96 * var(--theme-progress)),
        calc(115 + 87 * var(--theme-progress)),
        0.82
    ) !important;
    opacity: 1 !important;
}

[data-theme="light"] .tarot-table {
    border: 1px solid rgba(255, 255, 255, 0.95) !important;
    color: #172033 !important;
    background:
        radial-gradient(circle at 78% 14%, rgba(146, 166, 201, 0.16), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(244, 248, 254, 0.88)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 0 rgba(70, 89, 122, 0.07),
        0 26px 64px rgba(33, 48, 74, 0.13),
        0 5px 14px rgba(33, 48, 74, 0.055) !important;
}

[data-theme="light"] .tarot-table .section-kicker,
[data-theme="light"] .tarot-table-hint,
[data-theme="light"] .tarot-selection-copy {
    color: #53617a !important;
}

[data-theme="light"] .tarot-table-head {
    color: #172033 !important;
}

[data-theme="light"] .spread-slot {
    border-color: rgba(78, 98, 132, 0.17) !important;
    color: #172033 !important;
    background: rgba(255, 255, 255, 0.74) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        0 8px 20px rgba(43, 61, 91, 0.07) !important;
}

[data-theme="light"] .spread-slot > span:last-child {
    color: #62708a !important;
}

[data-theme="dark"] .tarot-table {
    color: #e9eef6 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 28px 68px rgba(2, 7, 15, 0.34),
        0 5px 16px rgba(2, 7, 15, 0.2) !important;
}

[data-theme="dark"] .tarot-table .section-kicker,
[data-theme="dark"] .tarot-table-hint,
[data-theme="dark"] .tarot-selection-copy {
    color: #bdc8d8 !important;
}

[data-theme="dark"] .spread-slot > span:last-child {
    color: #aebbcf !important;
}

@media (max-width: 760px) {
    .glass-card,
    .note-card,
    .tarot-form,
    .reading-box,
    .comment-card,
    .comment-form-wrap-v4,
    .comments-compose-panel,
    .tarot-history,
    .tarot-history-item,
    .tarot-table {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, calc(0.94 - 0.8 * var(--theme-progress))),
            0 16px 38px rgba(30, 43, 66, calc(0.1 + 0.11 * var(--theme-progress))),
            0 3px 10px rgba(30, 43, 66, calc(0.04 + 0.05 * var(--theme-progress))) !important;
    }
}

/* Keep the archive treatment authoritative after the global surface rules above. */
.tarot-history {
    border: 0 !important;
    border-top: 1px solid var(--qa-line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    filter: none !important;
}

.tarot-history.motion-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

[data-theme="light"] .tarot-history,
[data-theme="dark"] .tarot-history {
    border: 0 !important;
    border-top: 1px solid var(--qa-line) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.tarot-history-item,
.tarot-history-item:hover,
.tarot-history-item:focus-within {
    border: 0 !important;
    border-top: 1px solid var(--qa-line) !important;
    border-radius: 0 !important;
    background-image: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    filter: none !important;
    transform: none !important;
}

[data-theme="light"] .tarot-history-item,
[data-theme="dark"] .tarot-history-item {
    border: 0 !important;
    border-top: 1px solid var(--qa-line) !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.tarot-history-group > .tarot-history-item:first-child {
    border-top-color: transparent !important;
}

.tarot-history-item:hover,
.tarot-history-item:focus-within {
    background-color: rgba(
        calc(113 - 42 * var(--theme-progress)),
        calc(132 - 45 * var(--theme-progress)),
        calc(164 - 51 * var(--theme-progress)),
        calc(0.055 + 0.025 * var(--theme-progress))
    ) !important;
}

.tarot-history-more-toggle [data-history-more-label],
.tarot-history-more-toggle .tarot-history-more-count {
    min-width: 0 !important;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: inherit !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: inherit !important;
}

@media (max-width: 760px) {
    .tarot-history,
    .tarot-history-item,
    .tarot-history-item:hover,
    .tarot-history-item:focus-within {
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}

/* Keep the result flow compact: one status, one reading, one conversation. */
.tarot-result {
    display: grid !important;
    gap: 1rem !important;
}

.tarot-result > .reading-box,
.tarot-result > .tarot-cards,
.tarot-result > .tarot-actions {
    width: min(100%, 56rem) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.tarot-result .tarot-summary-box {
    margin-top: 0 !important;
    padding: clamp(1rem, 2vw, 1.35rem) !important;
}

.tarot-result .tarot-cards,
.tarot-actions {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.tarot-result .ai-chat-panel {
    margin-top: 0 !important;
}

@media (max-width: 760px) {
    .tarot-result {
        gap: 0.75rem !important;
    }

    .tarot-result .tarot-summary-box {
        padding: 0.9rem !important;
    }

    .tarot-actions {
        flex-wrap: wrap !important;
    }

    .tarot-actions .button {
        min-height: 40px !important;
    }
}

/* Tarot 2026 refresh: one focused step, denser mobile rhythm, stronger color. */
.tarot-stage {
    --tarot-accent: #5b5ce2;
    --tarot-accent-strong: #4338ca;
    --tarot-accent-soft: #eef2ff;
    --tarot-ink: #111827;
    --tarot-muted: #667085;
    --tarot-line: rgba(67, 56, 202, 0.14);
    padding-top: clamp(1.2rem, 3vw, 2.25rem) !important;
    padding-bottom: 3rem !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.tarot-stage-shell,
.tarot-layout,
.tarot-result,
.tarot-history {
    width: min(100%, 58rem) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.tarot-stage-shell {
    display: block !important;
    margin-bottom: 0.9rem !important;
}

.tarot-hero-copy {
    max-width: none !important;
}

.tarot-hero-copy .hero-kicker {
    min-height: 1.8rem !important;
    padding: 0.32rem 0.65rem !important;
    border: 1px solid rgba(91, 92, 226, 0.18) !important;
    color: var(--tarot-accent-strong) !important;
    background: rgba(238, 242, 255, 0.92) !important;
    box-shadow: none !important;
    font-size: 0.75rem !important;
    font-weight: 750 !important;
}

.tarot-hero-copy h1 {
    max-width: none !important;
    margin: 0.55rem 0 0 !important;
    color: var(--tarot-ink) !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif !important;
    font-size: clamp(2.1rem, 6vw, 3.25rem) !important;
    font-weight: 800 !important;
    letter-spacing: -0.045em !important;
    line-height: 1.05 !important;
}

.tarot-layout {
    display: block !important;
}

.tarot-stage[data-tarot-step="picking"] .tarot-history,
.tarot-stage[data-tarot-step="result"] .tarot-stage-shell,
.tarot-stage[data-tarot-step="result"] .tarot-form {
    display: none !important;
}

.tarot-form {
    position: static !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 11rem 12rem !important;
    gap: 0.8rem !important;
    align-items: end !important;
    padding: 1rem !important;
    border: 1px solid var(--tarot-line) !important;
    border-radius: 22px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 16px 40px rgba(49, 46, 129, 0.1) !important;
    backdrop-filter: blur(18px) saturate(150%) !important;
}

.tarot-form label {
    min-width: 0 !important;
}

.tarot-form label > span {
    margin: 0 0 0.38rem !important;
    color: #344054 !important;
    font-size: 0.78rem !important;
    font-weight: 760 !important;
    line-height: 1.25 !important;
}

.tarot-form textarea,
.tarot-form select {
    min-height: 3.25rem !important;
    padding: 0.78rem 0.88rem !important;
    border: 1px solid rgba(98, 105, 129, 0.2) !important;
    border-radius: 14px !important;
    color: var(--tarot-ink) !important;
    background: #f8fafc !important;
    box-shadow: none !important;
    font-size: 1rem !important;
    line-height: 1.45 !important;
}

.tarot-form textarea {
    height: 3.25rem !important;
    min-height: 3.25rem !important;
    overflow: hidden !important;
    resize: none !important;
}

.tarot-form textarea:focus,
.tarot-form select:focus,
.ai-chat-compose:focus-within {
    border-color: rgba(91, 92, 226, 0.72) !important;
    box-shadow: 0 0 0 4px rgba(91, 92, 226, 0.12) !important;
}

.tarot-form .button.primary,
.tarot-actions .button.primary,
.ai-chat-send {
    border: 0 !important;
    color: #fff !important;
    background: linear-gradient(135deg, var(--tarot-accent), var(--tarot-accent-strong)) !important;
    box-shadow: 0 10px 24px rgba(67, 56, 202, 0.26) !important;
}

.tarot-form .button {
    min-height: 3.25rem !important;
    border-radius: 14px !important;
    font-size: 0.95rem !important;
    font-weight: 760 !important;
}

.tarot-table-wrap[hidden] {
    display: none !important;
}

.tarot-table-wrap {
    scroll-margin-top: 5.5rem !important;
}

.tarot-table {
    min-height: 25rem !important;
    margin-top: 1rem !important;
    padding: 1rem !important;
    border: 1px solid rgba(129, 140, 248, 0.26) !important;
    border-radius: 24px !important;
    color: #f8fafc !important;
    background:
        radial-gradient(circle at 78% 12%, rgba(124, 58, 237, 0.44), transparent 34%),
        radial-gradient(circle at 16% 88%, rgba(37, 99, 235, 0.34), transparent 38%),
        linear-gradient(150deg, #161a38 0%, #24205c 52%, #17152f 100%) !important;
    box-shadow: 0 22px 48px rgba(30, 27, 75, 0.3) !important;
}

[data-theme="light"] .tarot-table,
[data-theme="dark"] .tarot-table {
    color: #f8fafc !important;
    background:
        radial-gradient(circle at 78% 12%, rgba(124, 58, 237, 0.44), transparent 34%),
        radial-gradient(circle at 16% 88%, rgba(37, 99, 235, 0.34), transparent 38%),
        linear-gradient(150deg, #161a38 0%, #24205c 52%, #17152f 100%) !important;
}

.tarot-table-head {
    align-items: center !important;
    margin-bottom: 0.7rem !important;
}

.tarot-table .section-kicker,
[data-theme="light"] .tarot-table .section-kicker,
[data-theme="dark"] .tarot-table .section-kicker {
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.tarot-selection-copy,
[data-theme="light"] .tarot-selection-copy,
[data-theme="dark"] .tarot-selection-copy {
    color: #c7d2fe !important;
    font-size: 0.8rem !important;
    font-weight: 680 !important;
}

.tarot-spread-zone {
    min-height: 4.4rem !important;
    gap: 0.55rem !important;
    margin: 0 0 0.75rem !important;
}

.spread-slot {
    min-height: 4.2rem !important;
    gap: 0.18rem !important;
    padding: 0.62rem 0.7rem !important;
    border-color: rgba(199, 210, 254, 0.24) !important;
    border-radius: 14px !important;
    color: #c7d2fe !important;
    background: rgba(255, 255, 255, 0.07) !important;
    font-size: 0.78rem !important;
}

.spread-slot strong {
    overflow: hidden !important;
    color: #fff !important;
    font-size: 0.9rem !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.tarot-deck-fan {
    min-height: 17rem !important;
}

.tarot-stage .tarot-deck-fan {
    height: 17rem !important;
    min-height: 17rem !important;
}

.tarot-deck-fan::before {
    bottom: 0.5rem !important;
    height: 8rem !important;
    border-color: rgba(199, 210, 254, 0.2) !important;
}

.tarot-deck-fan::after {
    bottom: 0.75rem !important;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.3), transparent 70%) !important;
}

.deck-card {
    bottom: 0.5rem !important;
    width: clamp(92px, 10vw, 122px) !important;
    filter: drop-shadow(0 16px 24px rgba(7, 8, 25, 0.35)) !important;
}

.deck-back,
.tarot-back {
    border-color: rgba(165, 180, 252, 0.32) !important;
    color: #e0e7ff !important;
    background:
        radial-gradient(circle at 50% 28%, rgba(129, 140, 248, 0.22), transparent 30%),
        linear-gradient(155deg, #151a38, #2f2a68) !important;
}

.tarot-result {
    scroll-margin-top: 5.5rem !important;
    gap: 0.8rem !important;
    margin-top: 1rem !important;
}

.tarot-result > .reading-box,
.tarot-result > .tarot-cards,
.tarot-result > .tarot-actions {
    width: 100% !important;
}

.tarot-summary-box {
    padding: 1rem 1.1rem !important;
    border-color: rgba(91, 92, 226, 0.16) !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, #f5f3ff, #eef2ff) !important;
    box-shadow: 0 12px 30px rgba(67, 56, 202, 0.09) !important;
}

.tarot-result-label {
    display: block !important;
    margin-bottom: 0.32rem !important;
    color: var(--tarot-accent-strong) !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
}

.tarot-summary-box h2 {
    margin: 0 !important;
    color: var(--tarot-ink) !important;
    font-family: inherit !important;
    font-size: clamp(1.2rem, 3vw, 1.55rem) !important;
    font-weight: 780 !important;
    letter-spacing: -0.025em !important;
    line-height: 1.3 !important;
}

.tarot-summary-box p {
    margin: 0.38rem 0 0 !important;
    color: var(--tarot-muted) !important;
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
}

.tarot-cards {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 0.75rem !important;
}

.tarot-card,
.tarot-card-inner {
    min-height: 24rem !important;
}

.tarot-card-art {
    height: 13.5rem !important;
}

.tarot-front {
    border-color: rgba(91, 92, 226, 0.14) !important;
    background: rgba(255, 255, 255, 0.96) !important;
}

.tarot-card-copy {
    gap: 0.34rem !important;
}

.tarot-card-copy p {
    font-size: 0.88rem !important;
    line-height: 1.45 !important;
}

.tarot-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
}

.tarot-actions [data-ai-reflect] {
    grid-column: 1 / -1 !important;
}

.tarot-actions .button {
    min-height: 2.85rem !important;
    border-radius: 13px !important;
    font-size: 0.88rem !important;
    font-weight: 750 !important;
}

.tarot-actions .button.secondary {
    border: 1px solid rgba(91, 92, 226, 0.16) !important;
    color: #344054 !important;
    background: #fff !important;
    box-shadow: none !important;
}

.ai-chat-panel {
    gap: 0.72rem !important;
    padding: 1rem !important;
    border-color: rgba(91, 92, 226, 0.14) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.07) !important;
}

.ai-chat-head strong {
    color: var(--tarot-ink) !important;
    font-size: 1rem !important;
    font-weight: 780 !important;
}

.ai-chat-log {
    gap: 0.55rem !important;
    max-height: 22rem !important;
    padding: 0 !important;
}

.ai-chat-bubble,
.ai-chat-bubble.is-assistant,
.ai-chat-bubble.is-user {
    margin: 0 !important;
    padding: 0.75rem 0.85rem !important;
    border: 0 !important;
    border-radius: 14px !important;
    box-shadow: none !important;
}

.ai-chat-bubble.is-assistant {
    background: var(--tarot-accent-soft) !important;
}

.ai-chat-bubble.is-user {
    margin-left: 12% !important;
    background: #f2f4f7 !important;
}

.ai-chat-content,
.ai-chat-content p {
    color: #344054 !important;
    font-size: 0.92rem !important;
    line-height: 1.65 !important;
}

.ai-chat-empty {
    margin: 0 !important;
    color: var(--tarot-muted) !important;
    font-size: 0.82rem !important;
}

.ai-chat-compose {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 0.5rem !important;
    align-items: end !important;
    padding: 0.4rem !important;
    border: 1px solid rgba(98, 105, 129, 0.2) !important;
    border-radius: 15px !important;
    background: #f8fafc !important;
    box-shadow: none !important;
}

.ai-chat-compose textarea {
    width: 100% !important;
    min-height: 2.5rem !important;
    max-height: 8.25rem !important;
    padding: 0.62rem 0.7rem !important;
    border: 0 !important;
    color: var(--tarot-ink) !important;
    background: transparent !important;
    box-shadow: none !important;
    resize: none !important;
    font-size: 1rem !important;
    line-height: 1.35 !important;
}

.ai-chat-send {
    min-width: 4.5rem !important;
    min-height: 2.5rem !important;
    padding: 0.58rem 0.9rem !important;
    border-radius: 11px !important;
    font-size: 0.88rem !important;
}

.ai-chat-remaining {
    margin: 0 !important;
    font-size: 0.75rem !important;
}

[data-theme="dark"] .tarot-hero-copy h1,
[data-theme="dark"] .tarot-summary-box h2,
[data-theme="dark"] .ai-chat-head strong {
    color: #f8fafc !important;
}

[data-theme="dark"] .tarot-hero-copy .hero-kicker {
    border-color: rgba(165, 180, 252, 0.2) !important;
    color: #c7d2fe !important;
    background: rgba(67, 56, 202, 0.22) !important;
}

[data-theme="dark"] .tarot-form,
[data-theme="dark"] .ai-chat-panel {
    border-color: rgba(165, 180, 252, 0.14) !important;
    background: rgba(20, 24, 42, 0.94) !important;
}

[data-theme="dark"] .tarot-form label > span,
[data-theme="dark"] .ai-chat-content,
[data-theme="dark"] .ai-chat-content p {
    color: #d0d5dd !important;
}

[data-theme="dark"] .tarot-form textarea,
[data-theme="dark"] .tarot-form select,
[data-theme="dark"] .ai-chat-compose {
    border-color: rgba(165, 180, 252, 0.16) !important;
    color: #f8fafc !important;
    background: rgba(15, 18, 32, 0.88) !important;
}

[data-theme="dark"] .tarot-summary-box {
    border-color: rgba(165, 180, 252, 0.16) !important;
    background: linear-gradient(135deg, rgba(49, 46, 129, 0.45), rgba(30, 27, 75, 0.58)) !important;
}

[data-theme="dark"] .tarot-front,
[data-theme="dark"] .tarot-actions .button.secondary {
    border-color: rgba(165, 180, 252, 0.15) !important;
    color: #e4e7ec !important;
    background: #171a2e !important;
}

[data-theme="dark"] .ai-chat-bubble.is-assistant {
    background: rgba(67, 56, 202, 0.3) !important;
}

[data-theme="dark"] .ai-chat-bubble.is-user {
    background: rgba(52, 64, 84, 0.56) !important;
}

@media (max-width: 760px) {
    .tarot-stage {
        padding-top: 0.9rem !important;
        padding-bottom: 2rem !important;
    }

    .tarot-stage-shell {
        margin-bottom: 0.7rem !important;
    }

    .tarot-hero-copy h1 {
        margin-top: 0.42rem !important;
        font-size: clamp(1.9rem, 9vw, 2.35rem) !important;
        letter-spacing: -0.04em !important;
    }

    .tarot-form {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 0.65rem !important;
        padding: 0.78rem !important;
        border-radius: 18px !important;
    }

    .tarot-form label:first-child {
        grid-column: 1 / -1 !important;
    }

    .tarot-form textarea,
    .tarot-form select,
    .tarot-form .button {
        min-height: 3rem !important;
        height: 3rem !important;
        font-size: 1rem !important;
    }

    .tarot-table {
        min-height: 21.5rem !important;
        margin-top: 0.75rem !important;
        padding: 0.78rem !important;
        border-radius: 20px !important;
    }

    .tarot-stage .tarot-table {
        min-height: 0 !important;
        padding: 0.78rem !important;
    }

    .tarot-table-head {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }

    .tarot-spread-zone {
        min-height: 3.7rem !important;
        margin-bottom: 0.5rem !important;
    }

    .spread-slot {
        min-height: 3.6rem !important;
        padding: 0.48rem 0.52rem !important;
    }

    .spread-slot .section-kicker {
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        font-size: 0.68rem !important;
    }

    .tarot-deck-fan {
        min-height: 14rem !important;
    }

    .tarot-stage .tarot-deck-fan {
        height: 14rem !important;
        min-height: 14rem !important;
    }

    .deck-card {
        width: 84px !important;
    }

    .deck-face {
        padding: 0.55rem !important;
        border-radius: 14px !important;
    }

    .deck-back::before {
        inset: 7px !important;
        border-radius: 10px !important;
    }

    .tarot-result {
        gap: 0.65rem !important;
        margin-top: 0.75rem !important;
    }

    .tarot-summary-box {
        padding: 0.82rem 0.9rem !important;
        border-radius: 16px !important;
    }

    .tarot-summary-box h2 {
        font-size: 1.12rem !important;
    }

    .tarot-cards {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }

    .tarot-card,
    .tarot-card-inner {
        min-height: 0 !important;
    }

    .tarot-card.revealed .tarot-card-inner {
        transform: none !important;
    }

    .tarot-card .tarot-back {
        display: none !important;
    }

    .tarot-card .tarot-front {
        position: relative !important;
        inset: auto !important;
        display: grid !important;
        grid-template-columns: 6.6rem minmax(0, 1fr) !important;
        grid-template-rows: auto auto 1fr !important;
        gap: 0.25rem 0.75rem !important;
        align-items: start !important;
        min-height: 0 !important;
        padding: 0.72rem !important;
        border-radius: 16px !important;
        transform: none !important;
    }

    .tarot-card .tarot-front::before {
        display: none !important;
    }

    .tarot-card .tarot-card-kicker {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: start !important;
        margin: 0 !important;
        padding: 0.22rem 0.45rem !important;
        font-size: 0.68rem !important;
    }

    .tarot-card .tarot-card-art {
        grid-column: 1 !important;
        grid-row: 1 / span 3 !important;
        width: 6.6rem !important;
        height: 10.8rem !important;
        padding: 0.2rem !important;
        border-radius: 11px !important;
    }

    .tarot-card .tarot-front h3 {
        grid-column: 2 !important;
        grid-row: 2 !important;
        margin: 0 !important;
        color: var(--tarot-ink) !important;
        font-size: 1.28rem !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
    }

    .tarot-card .tarot-card-copy {
        grid-column: 2 !important;
        grid-row: 3 !important;
        align-content: start !important;
        gap: 0.22rem !important;
    }

    .tarot-card-copy p {
        font-size: 0.8rem !important;
        line-height: 1.38 !important;
    }

    .tarot-actions {
        gap: 0.55rem !important;
    }

    .tarot-actions .button {
        width: 100% !important;
        min-height: 2.75rem !important;
    }

    .ai-chat-panel {
        padding: 0.82rem !important;
        border-radius: 16px !important;
    }

    .ai-chat-compose textarea {
        font-size: 16px !important;
    }

    .tarot-history {
        margin-top: 1rem !important;
    }
}

/* Keep the final dark/mobile cascade on the same Liquid Glass material. */
[data-theme="dark"] .tarot-stage .tarot-form {
    border: 1px solid transparent !important;
    background:
        radial-gradient(260px circle at 12% 0%, var(--lg-lens), transparent 70%) padding-box,
        linear-gradient(155deg, var(--lg-panel-top), var(--lg-panel-bottom)) padding-box,
        linear-gradient(145deg, var(--lg-edge-high), var(--lg-edge-mid) 48%, var(--lg-edge-low)) border-box !important;
    box-shadow: var(--lg-panel-shadow) !important;
    -webkit-backdrop-filter: blur(var(--lg-panel-blur)) saturate(var(--lg-saturation)) !important;
    backdrop-filter: blur(var(--lg-panel-blur)) saturate(var(--lg-saturation)) !important;
}

[data-theme="dark"] .tarot-stage .tarot-form textarea,
[data-theme="dark"] .tarot-stage .tarot-form select,
[data-theme="dark"] .tarot-stage .ai-chat-compose {
    border-color: var(--lg-content-line) !important;
    color: var(--lg-ink) !important;
    background: color-mix(in srgb, var(--lg-content-strong) 72%, transparent) !important;
    box-shadow: inset 0 1px 0 var(--lg-edge-high) !important;
}

.tarot-stage .tarot-card .tarot-card-kicker {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--lg-muted) !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Three-viewport rhythm and calmer state transitions. */
.tarot-stage .tarot-form {
    position: static !important;
    top: auto !important;
}

.tarot-stage[data-tarot-step="picking"] .tarot-stage-shell,
.tarot-stage[data-tarot-step="picking"] .tarot-form {
    display: none !important;
}

.tarot-stage[data-tarot-step="picking"] .tarot-table-wrap,
.tarot-stage[data-tarot-step="result"] .tarot-result {
    animation: tarot-glass-arrive 420ms var(--lg-spring) both;
}

.tarot-stage .tarot-table .section-kicker,
[data-theme="light"] .tarot-stage .tarot-table .section-kicker,
[data-theme="dark"] .tarot-stage .tarot-table .section-kicker {
    padding: 0 !important;
    border: 0 !important;
    color: var(--lg-ink) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.tarot-stage .spread-slot,
[data-theme="light"] .tarot-stage .spread-slot {
    background: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .tarot-stage .spread-slot {
    background: rgba(255, 255, 255, 0.035) !important;
}

.tarot-stage .tarot-deck-fan::before {
    opacity: 0.72 !important;
}

@keyframes tarot-glass-arrive {
    from {
        opacity: 0;
        transform: translate3d(0, 12px, 0) scale(0.992);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@media (min-width: 1025px) {
    .tarot-stage-shell,
    .tarot-layout,
    .tarot-result,
    .tarot-history {
        width: min(100%, 56rem) !important;
    }

    .tarot-stage .tarot-form {
        grid-template-columns: minmax(0, 1fr) 10.5rem 11.5rem !important;
        gap: 0.72rem !important;
        padding: 0.86rem !important;
    }

    .tarot-stage .tarot-form textarea,
    .tarot-stage .tarot-form select,
    .tarot-stage .tarot-form .button {
        min-height: 3rem !important;
        height: 3rem !important;
    }

    .tarot-stage .tarot-table {
        min-height: 23rem !important;
        padding: 0.9rem !important;
    }

    .tarot-stage .tarot-deck-fan {
        height: 15.5rem !important;
        min-height: 15.5rem !important;
    }
}

@media (min-width: 761px) and (max-width: 1024px) {
    .tarot-stage-shell,
    .tarot-layout,
    .tarot-result,
    .tarot-history {
        width: min(calc(100% - 2rem), 50rem) !important;
    }

    .tarot-stage .tarot-form {
        grid-template-columns: minmax(0, 1fr) 9.75rem 10.5rem !important;
        gap: 0.65rem !important;
        padding: 0.78rem !important;
        border-radius: 20px !important;
    }

    .tarot-stage .tarot-form textarea,
    .tarot-stage .tarot-form select,
    .tarot-stage .tarot-form .button {
        min-height: 2.9rem !important;
        height: 2.9rem !important;
    }

    .tarot-stage .tarot-table {
        min-height: 21.5rem !important;
        padding: 0.78rem !important;
    }

    .tarot-stage .tarot-deck-fan {
        height: 14.25rem !important;
        min-height: 14.25rem !important;
    }

    .tarot-stage .deck-card {
        width: clamp(82px, 10vw, 98px) !important;
    }
}

@media (max-width: 760px) {
    .tarot-stage-shell,
    .tarot-layout,
    .tarot-result,
    .tarot-history {
        width: min(calc(100% - 1rem), 36rem) !important;
    }

    .tarot-stage .tarot-form {
        gap: 0.52rem !important;
        padding: 0.66rem !important;
        border-radius: 17px !important;
    }

    .tarot-stage .tarot-form label > span {
        margin-bottom: 0.28rem !important;
    }

    .tarot-stage .tarot-form textarea,
    .tarot-stage .tarot-form select,
    .tarot-stage .tarot-form .button {
        min-height: 2.8rem !important;
        height: 2.8rem !important;
        border-radius: 12px !important;
    }

    .tarot-stage .tarot-table {
        min-height: 18.75rem !important;
        margin-top: 0.4rem !important;
        padding: 0.66rem !important;
        border-radius: 18px !important;
    }

    .tarot-stage .tarot-table-head {
        margin-bottom: 0.48rem !important;
    }

    .tarot-stage .tarot-spread-zone {
        min-height: 3.25rem !important;
        gap: 0.34rem !important;
        margin-bottom: 0.3rem !important;
    }

    .tarot-stage .spread-slot {
        min-height: 3.2rem !important;
        padding: 0.38rem 0.42rem !important;
        border-radius: 10px !important;
    }

    .tarot-stage .tarot-deck-fan {
        height: 12.4rem !important;
        min-height: 12.4rem !important;
    }

    .tarot-stage .deck-card {
        width: 76px !important;
    }

    .tarot-stage .tarot-deck-fan::before {
        height: 6.2rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tarot-stage[data-tarot-step="picking"] .tarot-table-wrap,
    .tarot-stage[data-tarot-step="result"] .tarot-result {
        animation: none !important;
    }
}

/* Final Tarot-only composer layer: preserve contrast after shared form rules. */
.tarot-stage .ai-chat-compose {
    background: rgba(248, 250, 255, 0.94) !important;
    border: 1px solid rgba(63, 77, 99, 0.28) !important;
    box-shadow: inset 0 1px 0 var(--lg-edge-high), 0 8px 22px rgba(44, 53, 78, 0.08) !important;
}

.tarot-stage .ai-chat-compose:focus-within {
    border-color: color-mix(in srgb, var(--lg-accent) 72%, var(--lg-content-line-strong)) !important;
    box-shadow: 0 0 0 3px var(--lg-accent-soft), inset 0 1px 0 var(--lg-edge-high) !important;
}

.tarot-stage .ai-chat-compose textarea[data-ai-chat-input] {
    color: var(--lg-ink) !important;
    background: transparent !important;
}

.tarot-stage .ai-chat-compose textarea[data-ai-chat-input]::placeholder {
    color: color-mix(in srgb, var(--lg-ink) 56%, transparent) !important;
}

[data-theme="dark"] .tarot-stage .ai-chat-compose {
    background: rgba(22, 27, 42, 0.94) !important;
    border-color: rgba(185, 196, 228, 0.32) !important;
    box-shadow: inset 0 1px 0 var(--lg-edge-high), 0 8px 22px rgba(0, 0, 0, 0.18) !important;
}

/* Homepage film reel: quiet metadata and one compact playback control. */
.home-film-hero,
.home-film {
    background:
        linear-gradient(180deg, rgba(8, 14, 23, 0.08), rgba(8, 14, 23, 0.32)),
        #111722 center / cover no-repeat;
}

.home-film-info {
    position: absolute;
    z-index: 3;
    right: clamp(1rem, 2.2vw, 1.7rem);
    bottom: 10.45rem;
    display: grid;
    gap: 0.12rem;
    max-width: min(15rem, 36vw);
    color: rgba(255, 255, 255, 0.9);
    opacity: 0.84;
    text-align: right;
    text-shadow: 0 1px 14px rgba(5, 9, 16, 0.24);
    mix-blend-mode: difference;
    pointer-events: none;
}

.home-film-category {
    color: rgba(255, 255, 255, 0.72);
    opacity: 0.82;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.home-film-title {
    opacity: 0.96;
    font-size: clamp(0.84rem, 1.1vw, 0.98rem);
    font-weight: 650;
    line-height: 1.2;
}

.home-film-controls {
    position: absolute;
    z-index: 3;
    right: clamp(1rem, 2.2vw, 1.7rem);
    bottom: 7.25rem;
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: 0.18rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    color: #fff;
    background: rgba(11, 18, 29, 0.28);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 10px 26px rgba(5, 10, 18, 0.14);
}

.home-film-controls .home-video-toggle {
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    width: 2.45rem !important;
    min-width: 2.45rem !important;
    min-height: 2.45rem !important;
    height: 2.45rem !important;
    padding: 0 !important;
    justify-content: center;
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(11, 18, 29, 0.2);
}

.home-film-controls .home-video-toggle::before {
    width: 0.85rem;
    height: 0.85rem;
}

@media (max-width: 760px) {
    .home-film-copy {
        bottom: clamp(7.8rem, 10vh, 8.6rem) !important;
    }

    .home-film-info {
        top: auto;
        right: 1rem;
        bottom: clamp(4.5rem, 7vh, 5.1rem);
        max-width: min(12rem, 48vw);
        padding: 0.18rem 0 0.22rem 0.55rem;
        gap: 0.14rem;
    }

    .home-film-title {
        font-size: 0.84rem;
    }

    .home-film-controls {
        right: 1rem;
        top: auto;
        bottom: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-film-controls .home-video-toggle {
        transition: none !important;
    }
}

/* Homepage pause control: one quiet glass surface, without a wrapper ring or press zoom. */
.home-film-controls {
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.home-film-controls .home-video-toggle,
.home-film-controls .home-video-toggle:hover,
.home-film-controls .home-video-toggle:focus-visible,
.home-film-controls .home-video-toggle:active,
.home-film-controls .home-video-toggle.is-liquid-pressed {
    width: 2.9rem !important;
    min-width: 2.9rem !important;
    height: 2.9rem !important;
    min-height: 2.9rem !important;
    padding: 0 !important;
    transform: none !important;
    border: 0 !important;
    border-radius: 50% !important;
    isolation: isolate;
    overflow: hidden !important;
    background-clip: padding-box !important;
    color: rgba(255, 255, 255, 0.94) !important;
    background: linear-gradient(145deg, rgba(74, 94, 118, 0.34), rgba(28, 42, 58, 0.24) 48%, rgba(4, 12, 21, 0.38)) !important;
    -webkit-backdrop-filter: blur(20px) saturate(160%) brightness(0.94) !important;
    backdrop-filter: blur(20px) saturate(160%) brightness(0.94) !important;
    box-shadow:
        inset 0 1px 0 rgba(151, 176, 204, 0.18),
        inset 0 -9px 16px rgba(1, 6, 13, 0.2),
        0 8px 20px rgba(3, 8, 15, 0.2) !important;
    transition: background 220ms ease, box-shadow 220ms ease, color 220ms ease !important;
}

.home-film-controls .home-video-toggle::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 1.25px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(145deg, rgba(153, 181, 210, 0.08), transparent 52%, rgba(0, 0, 0, 0.14));
    box-shadow: none;
}

.home-film-controls .home-video-toggle .video-toggle-icon {
    z-index: 1;
}

.home-film-controls .home-video-toggle:hover {
    color: #fff !important;
    background: linear-gradient(145deg, rgba(92, 117, 146, 0.46), rgba(37, 55, 75, 0.3) 48%, rgba(4, 12, 21, 0.42)) !important;
    box-shadow:
        inset 0 1px 0 rgba(170, 193, 218, 0.22),
        inset 0 -9px 16px rgba(1, 6, 13, 0.18),
        0 10px 23px rgba(3, 8, 15, 0.23) !important;
}

.home-film-controls .home-video-toggle:active,
.home-film-controls .home-video-toggle.is-liquid-pressed {
    filter: brightness(0.96);
    box-shadow:
        inset 0 2px 6px rgba(4, 10, 18, 0.26),
        inset 0 6px 14px rgba(114, 143, 171, 0.08),
        0 7px 17px rgba(3, 8, 15, 0.19) !important;
}

.home-film-controls .home-video-toggle:focus-visible {
    outline: 0 !important;
    box-shadow:
        inset 0 0 0 1.25px rgba(159, 187, 217, 0.46),
        inset 0 1px 0 rgba(151, 176, 204, 0.18),
        0 9px 22px rgba(3, 8, 15, 0.22) !important;
}

/* Day mode: keep the pause control as a fully transparent liquid-glass
   button (frosted blur + faint edge, no fill). Night mode keeps the
   tinted glass surface defined above. */
html:not([data-theme="dark"]) .home-film-controls .home-video-toggle,
html:not([data-theme="dark"]) .home-film-controls .home-video-toggle:hover,
html:not([data-theme="dark"]) .home-film-controls .home-video-toggle:focus-visible,
html:not([data-theme="dark"]) .home-film-controls .home-video-toggle:active,
html:not([data-theme="dark"]) .home-film-controls .home-video-toggle.is-liquid-pressed {
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.96) !important;
    -webkit-backdrop-filter: blur(14px) saturate(135%) !important;
    backdrop-filter: blur(14px) saturate(135%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05),
        0 6px 18px rgba(3, 8, 15, 0.1) !important;
    filter: none !important;
}

html:not([data-theme="dark"]) .home-film-controls .home-video-toggle::after {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 52%, rgba(255, 255, 255, 0.02)) !important;
}

html:not([data-theme="dark"]) .home-film-controls .home-video-toggle .video-toggle-icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)) !important;
}

/* The reading card used content-box width on phones, so its padding could
   extend beyond the viewport. Keep the correction strictly inside articles. */
@media (max-width: 760px) {
    body.single .article {
        box-sizing: border-box !important;
        max-width: calc(100% - 1.25rem) !important;
    }

    body.single .article > h1 {
        max-width: 100% !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    body.single .article-content,
    body.single .article-content * {
        max-width: 100%;
        box-sizing: border-box;
    }

    body.single .article-content img,
    body.single .article-content video,
    body.single .article-content iframe,
    body.single .article-content table {
        width: auto;
        max-width: 100% !important;
    }

    body.single .article-content pre {
        overflow-x: auto;
    }

    body.single .article-content a {
        overflow-wrap: anywhere;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-film-controls .home-video-toggle,
    .home-film-controls .home-video-toggle .video-toggle-icon {
        transition: none !important;
    }
}

/* Music playback: progress + play control row (matches the liquid-glass language). */
.music-player-bar {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.25rem;
}

.music-player-bar[hidden] {
    display: none !important;
}

.music-progress {
    flex: 1 1 auto;
    min-width: 0;
    height: 8px;
    position: relative;
    border-radius: 999px;
    overflow: visible;
    background: color-mix(in srgb, var(--lg-accent) 18%, transparent);
    cursor: pointer;
    touch-action: none;
}

.music-progress-fill {
    display: block;
    position: relative;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--lg-accent), color-mix(in srgb, var(--lg-accent) 55%, #fff));
    box-shadow: 0 0 6px color-mix(in srgb, var(--lg-accent) 55%, transparent);
    transition: width 260ms linear;
}

.music-progress-fill::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 2px solid color-mix(in srgb, var(--lg-accent) 70%, #fff);
    box-shadow: 0 2px 6px rgba(3, 8, 15, 0.32);
}

/* Music panel text contrast on the glass surface: keep primary text dark/light
   enough to read, and lift faint secondary text to the readable muted token. */
.music-capsule-panel {
    color: var(--lg-ink) !important;
}

.music-capsule-panel .music-panel-head strong,
.music-capsule-panel .music-panel-head .ui-icon {
    color: var(--lg-ink) !important;
    opacity: 0.92 !important;
}

.music-capsule-panel .music-search input {
    color: var(--lg-ink) !important;
}

.music-capsule-panel .music-search input::placeholder {
    color: color-mix(in srgb, var(--lg-ink) 72%, var(--lg-muted)) !important;
    opacity: 1 !important;
}

.music-capsule-panel .music-search-button {
    color: #f7f9fc !important;
}

.music-capsule-panel .music-result-copy strong {
    color: var(--lg-ink) !important;
}

.music-capsule-panel .music-result-copy small {
    color: color-mix(in srgb, var(--lg-ink) 82%, var(--lg-muted)) !important;
}

.music-capsule-panel .music-note,
.music-capsule-panel .music-empty {
    color: color-mix(in srgb, var(--lg-ink) 82%, var(--lg-muted)) !important;
}

.music-capsule-panel .music-play-toggle {
    color: var(--lg-ink) !important;
}

/* Play/pause crossfade on the music control, mirroring the home hero button. */
.music-play-toggle {
    position: relative !important;
    overflow: hidden !important;
}

.music-play-toggle [data-music-play-icon],
.music-play-toggle [data-music-pause-icon] {
    position: absolute !important;
    inset: 0 !important;
    display: grid !important;
    place-items: center !important;
    transition: opacity 180ms ease, transform 240ms var(--lg-spring, linear) !important;
}

.music-play-toggle [data-music-play-icon] .music-play-icon,
.music-play-toggle [data-music-pause-icon] .music-play-icon {
    width: 1.08rem !important;
    height: 1.08rem !important;
}

.music-play-toggle [data-music-pause-icon] {
    opacity: 0 !important;
    transform: scale(0.72) rotate(-14deg) !important;
}

.music-capsule.is-playing .music-play-toggle [data-music-play-icon] {
    opacity: 0 !important;
    transform: scale(0.72) rotate(-14deg) !important;
}

.music-capsule.is-playing .music-play-toggle [data-music-pause-icon] {
    opacity: 1 !important;
    transform: scale(1) rotate(0deg) !important;
}

/* On phones: while the music panel (search/player) is expanded, hide the nav
   (dock) button; once it collapses it returns (left-center for the long strip,
   or the default bottom-left). */
@media (max-width: 760px) {
    body:has(.music-capsule.has-track) .site-dock {
        top: 50% !important;
        right: auto !important;
        bottom: auto !important;
        left: clamp(12px, 1.5vw, 20px) !important;
        transform: translateY(-50%) !important;
    }

    body:has(.music-capsule.is-open) .site-dock {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* Unified floating-control material (matches the home hero pause button),
   with a light and a dark variant so every surface reads on any backdrop. */
:root {
    --qa-mat-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(244, 248, 253, 0.075) 48%, rgba(205, 220, 235, 0.12));
    --qa-mat-panel-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(235, 243, 251, 0.15));
    --qa-mat-blur: blur(22px) saturate(145%) brightness(1.03);
    --qa-mat-panel-blur: blur(28px) saturate(140%) brightness(1.03);
    --qa-mat-border: rgba(255, 255, 255, 0.32);
    --qa-mat-panel-border: rgba(255, 255, 255, 0.38);
    --qa-mat-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -8px 14px rgba(54, 72, 96, 0.035), 0 6px 16px rgba(34, 48, 70, 0.055);
    --qa-mat-panel-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), inset 0 -1px 0 rgba(45, 59, 80, 0.045), 0 18px 48px rgba(34, 48, 70, 0.075);
    --qa-mat-ink: #162231;
    --qa-mat-muted: #384758;
    --qa-mat-faint: #526273;
}

html[data-theme="dark"] {
    --qa-mat-bg: linear-gradient(145deg, rgba(90, 110, 134, 0.28), rgba(40, 54, 72, 0.14) 48%, rgba(8, 16, 26, 0.26));
    --qa-mat-panel-bg: linear-gradient(145deg, rgba(52, 63, 79, 0.56), rgba(19, 26, 37, 0.5));
    --qa-mat-blur: blur(24px) saturate(160%) brightness(0.85);
    --qa-mat-panel-blur: blur(30px) saturate(150%);
    --qa-mat-border: rgba(151, 176, 204, 0.24);
    --qa-mat-panel-border: rgba(151, 176, 204, 0.2);
    --qa-mat-shadow: inset 0 1px 0 rgba(151, 176, 204, 0.16), inset 0 -9px 16px rgba(1, 6, 13, 0.12), 0 6px 16px rgba(3, 8, 15, 0.14);
    --qa-mat-panel-shadow: inset 0 1px 0 rgba(151, 176, 204, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 20px 54px rgba(0, 0, 0, 0.22);
    --qa-mat-ink: #eef2f8;
    --qa-mat-muted: #bcc6d4;
    --qa-mat-faint: #98a3b3;
}

html[data-theme] body :is(.header-actions .theme-toggle, .header-actions .lang-toggle, .music-capsule-toggle, .site-dock-toggle, .music-play-toggle, .home-scroll-cue, .article-translate-toggle, .tarot-history-clear, .tarot-history-more-toggle),
html[data-theme] body :is(.header-actions .theme-toggle, .header-actions .lang-toggle, .music-capsule-toggle, .site-dock-toggle, .music-play-toggle, .home-scroll-cue, .article-translate-toggle, .tarot-history-clear, .tarot-history-more-toggle):hover,
html[data-theme] body :is(.header-actions .theme-toggle, .header-actions .lang-toggle, .music-capsule-toggle, .site-dock-toggle, .music-play-toggle, .home-scroll-cue, .article-translate-toggle, .tarot-history-clear, .tarot-history-more-toggle):focus-visible {
    background-image: var(--qa-mat-bg) !important;
    background-color: transparent !important;
    border-color: var(--qa-mat-border) !important;
    box-shadow: var(--qa-mat-shadow) !important;
    -webkit-backdrop-filter: var(--qa-mat-blur) !important;
    backdrop-filter: var(--qa-mat-blur) !important;
    color: var(--qa-mat-ink) !important;
    transform: none !important;
}

html[data-theme] body :is(.lang-menu-list, .music-capsule-panel, .site-dock-menu, .article-translate-list) {
    background-image: var(--qa-mat-panel-bg) !important;
    background-color: transparent !important;
    border-color: var(--qa-mat-panel-border) !important;
    box-shadow: var(--qa-mat-panel-shadow) !important;
    -webkit-backdrop-filter: var(--qa-mat-panel-blur) !important;
    backdrop-filter: var(--qa-mat-panel-blur) !important;
    color: var(--qa-mat-ink) !important;
}

/* Drop the cursor-following glow (lens highlight) on these glass controls. */
html[data-theme] body :is(.header-actions .theme-toggle, .header-actions .lang-toggle, .music-capsule-toggle, .site-dock-toggle, .music-play-toggle, .home-scroll-cue, .article-translate-toggle, .tarot-history-clear, .tarot-history-more-toggle)::before,
html[data-theme] body :is(.header-actions .theme-toggle, .header-actions .lang-toggle, .music-capsule-toggle, .site-dock-toggle, .music-play-toggle, .home-scroll-cue, .article-translate-toggle, .tarot-history-clear, .tarot-history-more-toggle)::after,
html[data-theme] body :is(.lang-menu-list, .music-capsule-panel, .site-dock-menu, .article-translate-list)::before,
html[data-theme] body :is(.lang-menu-list, .music-capsule-panel, .site-dock-menu, .article-translate-list)::after {
    display: none !important;
    opacity: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

/* The capsule's right-side slot: a search icon by default, a play/pause
   control once a track is loaded (clicking it toggles playback, not the panel). */
html .music-capsule-action {
    position: relative !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    height: 40px !important;
}

.music-capsule-action .music-action-item {
    position: absolute !important;
    inset: 0 !important;
    display: grid !important;
    place-items: center !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* The parent capsule intentionally ignores its decorative children, but this
   one is a real playback hit target.  Let its own click handler receive the
   tap before the capsule's open/close handler can run. */
.music-capsule-toggle > .music-capsule-action,
.music-capsule-toggle > .music-capsule-action * {
    pointer-events: auto !important;
}

.music-capsule-action .music-action-item[hidden] {
    display: none !important;
}

.music-capsule-action .music-action-icon {
    width: 19px !important;
    height: 19px !important;
}

/* Make the collapsed pill's play/pause a proper round glass button. */
.music-capsule-action .music-action-item[data-music-action-control] {
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--lg-accent) 16%, transparent) !important;
    border: 1px solid color-mix(in srgb, var(--lg-accent) 26%, transparent) !important;
    color: var(--qa-mat-ink) !important;
    transition: background 180ms ease, transform 160ms ease !important;
}

.music-capsule-action .music-action-item[data-music-action-control]:active {
    transform: scale(0.94) !important;
}

/* Collapsed (panel closed) player pill: a compact, balanced bar instead of a
   full-width strip; it only stretches full width while the search panel is open. */
@media (max-width: 760px) {
    .music-capsule.has-track:not(.is-open) .music-capsule-toggle {
        width: min(320px, calc(100vw - 88px)) !important;
        max-width: calc(100vw - 88px) !important;
        min-width: min(320px, calc(100vw - 88px)) !important;
    }

    .music-capsule.is-open .music-capsule-toggle {
        width: 100% !important;
    }
}

/* Contrast: keep pill/menu/panel text readable on the glass surface. */
.music-capsule-toggle .music-capsule-copy strong,
.music-capsule-panel .music-panel-head strong,
.music-capsule-panel .music-result-copy strong,
.site-dock-link {
    color: var(--qa-mat-ink) !important;
}

.music-capsule-toggle .music-capsule-copy small,
.music-capsule-panel .music-result-copy small,
.music-capsule-panel .music-note,
.music-capsule-panel .music-empty,
.music-capsule-panel .music-search input::placeholder,
.site-dock-link small {
    color: var(--qa-mat-muted) !important;
    opacity: 1 !important;
}

.music-capsule-panel .music-search input {
    color: var(--qa-mat-ink) !important;
}

.site-dock-link .site-dock-icon {
    color: var(--lg-accent) !important;
}

/* Music capsule: keep the identity as a clear, lightweight icon inside the
   shared glass shell.  Album-art and its opaque "disc" are deliberately
   suppressed here so the compact player never turns into a separate panel. */
html[data-theme] body .music-capsule-art {
    position: relative !important;
    display: grid !important;
    place-items: center !important;
    flex: 0 0 32px !important;
    width: 32px !important;
    height: 32px !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: var(--qa-mat-ink) !important;
    animation: none !important;
}

html[data-theme] body .music-capsule-art::before,
html[data-theme] body .music-capsule-art::after {
    display: none !important;
    background: none !important;
    box-shadow: none !important;
}

/* No track: the note sits directly in the glass.  Once a track is loaded,
   restore its actual cover without reviving the old pale placeholder disc. */
html[data-theme] body .music-capsule-art:not(.has-artwork) {
    background-image: none !important;
}

html[data-theme] body .music-capsule-art.has-artwork {
    overflow: hidden !important;
    border-radius: 9px !important;
    background-color: transparent !important;
    background-position: center !important;
    background-size: cover !important;
}

html[data-theme] body .music-capsule-art .music-icon,
html[data-theme] body .music-capsule-art.has-artwork .music-icon {
    position: static !important;
    inset: auto !important;
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    opacity: 1 !important;
    color: currentColor !important;
    stroke-width: 1.9 !important;
    filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.42));
}

/* The note is optically centred on the text baseline, rather than centred as
   a square glyph, so the capsule reads as one calm control. */
html[data-theme] body .music-capsule-art .music-note-glyph {
    width: 23px !important;
    height: 23px !important;
    transform: translate(0.5px, -1px) !important;
}

html[data-theme] body .music-capsule-art.has-artwork .music-icon {
    display: none !important;
    opacity: 0 !important;
}

/* Global type finish: retain the existing system stacks, then give small text
   a steadier rhythm and give each reading layer a dependable theme-aware
   contrast step.  No font files are loaded and headline scale is untouched. */
:root {
    --qa-type-strong: color-mix(in srgb, var(--qa-ink) 97%, #243d5c);
    --qa-type-body: color-mix(in srgb, var(--qa-ink) 78%, var(--qa-page));
    --qa-type-meta: color-mix(in srgb, var(--qa-ink) 63%, var(--qa-page));
    --qa-type-faint: color-mix(in srgb, var(--qa-ink) 53%, var(--qa-page));
}

html[data-theme="dark"] {
    --qa-type-strong: color-mix(in srgb, var(--qa-ink) 98%, #dbeafe);
    --qa-type-body: color-mix(in srgb, var(--qa-ink) 82%, var(--qa-page));
    --qa-type-meta: color-mix(in srgb, var(--qa-ink) 68%, var(--qa-page));
    --qa-type-faint: color-mix(in srgb, var(--qa-ink) 57%, var(--qa-page));
}

html[data-theme] body {
    font-family: var(--font-ui) !important;
    font-weight: 455;
    letter-spacing: 0.003em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html[data-theme] body :is(button, input, select, textarea) {
    font-family: var(--font-ui) !important;
    letter-spacing: 0.003em;
}

html[data-theme] body :is(.home-story-copy h3, .note-card h2, .article > h1, .article-content h2, .tarot-stage h1, .tarot-stage h2, .comments-shell h2) {
    font-family: var(--font-display) !important;
    color: var(--qa-type-strong) !important;
    text-wrap: balance;
}

html[data-theme] body :is(.home-story-copy p, .note-card > p, .article-content > p, .comments-shell .comment-content, .tarot-selection-copy, .music-capsule-panel .music-note) {
    color: var(--qa-type-body) !important;
    font-weight: 455;
}

html[data-theme] body :is(.home-story-meta, .home-story-meta time, .home-story-meta span, .note-card-meta, .note-card-date, .article-meta-cluster, .article-kicker, .content-origin-note, .hero-kicker, .section-kicker, .tarot-card-kicker, .music-capsule-copy small, .site-footer, .article-content figcaption, .article-content .article-sources span) {
    color: var(--qa-type-meta) !important;
    font-weight: 650 !important;
    letter-spacing: 0.025em !important;
}

html[data-theme] body :is(.home-story-action, .note-card-link, .article-back-link, .article-translate-toggle, .music-capsule-copy strong, .site-dock-link) {
    font-weight: 680 !important;
    letter-spacing: 0.008em;
}

/* The film hero is its own contrast environment and deliberately retains the
   high-contrast white reading treatment over changing video frames. */
html[data-theme] body .home-film-copy :is(h1, p),
html[data-theme] body .home-daily-line,
html[data-theme] body .home-film-info {
    color: rgba(255, 255, 255, 0.92) !important;
}

html[data-theme] body .home-film-copy p,
html[data-theme] body .home-daily-line {
    font-weight: 470;
    letter-spacing: 0.012em;
    text-shadow: 0 2px 18px rgba(5, 9, 16, 0.36);
}

html[data-theme] body .home-film-info .home-film-category {
    color: rgba(255, 255, 255, 0.76) !important;
    opacity: 1 !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
}

/* Floating-panel typography: keep the existing glass substrate and only make
   its reading layers decisive enough for moving, detailed video backdrops. */
:root {
    --qa-overlay-ink: #0d1b2d;
    --qa-overlay-muted: #263c55;
    --qa-overlay-faint: #405770;
}

html[data-theme="dark"] {
    --qa-overlay-ink: #f1f5fa;
    --qa-overlay-muted: #d0dae6;
    --qa-overlay-faint: #b6c4d3;
}

html[data-theme] body .music-capsule-panel :is(.music-panel-head, .music-panel-head strong, .music-panel-head .ui-icon, .music-result-copy strong, .music-time, .music-note, .music-empty) {
    color: var(--qa-overlay-ink) !important;
    opacity: 1 !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.42);
}

html[data-theme] body .music-capsule-panel :is(.music-result-copy small, .music-search label > span, .music-note, .music-empty) {
    color: var(--qa-overlay-muted) !important;
    opacity: 1 !important;
    font-weight: 610 !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
}

html[data-theme] body .music-capsule-panel .music-search input::placeholder {
    color: var(--qa-overlay-faint) !important;
    opacity: 1 !important;
}

html[data-theme] body .music-capsule-panel .music-progress + .music-time {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em !important;
}

html[data-theme="dark"] body .music-capsule-panel :is(.music-panel-head, .music-panel-head strong, .music-panel-head .ui-icon, .music-result-copy strong, .music-time) {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.34);
}

/* On the dark theme, the secondary labels need the same quiet dark edge as
   the primary labels.  Otherwise their former light edge turns hazy over a
   bright video frame without changing the glass surface itself. */
html[data-theme="dark"] body .music-capsule-panel :is(.music-result-copy small, .music-search label > span, .music-note, .music-empty) {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}

/* The primary group above has a deliberately high selector weight for its
   icon treatment, so keep this explicit note rule beside the dark override. */
html[data-theme="dark"] body .music-capsule-panel .music-note {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.34) !important;
}

html[data-theme] body :is(.lang-menu-list button, .article-translate-list button, .site-dock-menu a) {
    color: var(--qa-overlay-ink) !important;
    opacity: 1 !important;
    font-weight: 680 !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.34);
}

html[data-theme] body :is(.site-dock-menu a small, .article-translate-list button small) {
    color: var(--qa-overlay-muted) !important;
    opacity: 1 !important;
    font-weight: 610 !important;
}

html[data-theme="dark"] body :is(.lang-menu-list button, .article-translate-list button, .site-dock-menu a) {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

html[data-theme] body .content-origin-note {
    opacity: 1 !important;
    font-weight: 680 !important;
}

html[data-theme] body :is(.home-daily-line, .home-film-info) {
    opacity: 1 !important;
}

html[data-theme] body .home-film-info .home-film-title {
    color: rgba(255, 255, 255, 0.94) !important;
    font-weight: 700 !important;
}

html[data-theme="dark"] body .music-capsule-art .music-icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.34));
}

/* The collapsed music control keeps its existing glass, geometry, and hit
   area.  On the film hero it needs a light reading layer; on ordinary light
   pages it must return to the page ink so the same control does not disappear
   against a pale background. */
html[data-theme] body .music-capsule-toggle .music-capsule-copy strong,
html[data-theme] body .music-capsule-toggle .music-capsule-copy small,
html[data-theme] body .music-capsule-toggle .music-capsule-art .music-icon,
html[data-theme] body .music-capsule-toggle .music-capsule-action .ui-icon {
    color: var(--qa-mat-ink) !important;
    opacity: 1 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.44);
}

html[data-theme] body.home .music-capsule-toggle .music-capsule-copy strong,
html[data-theme] body.home .music-capsule-toggle .music-capsule-copy small,
html[data-theme] body.home .music-capsule-toggle .music-capsule-art .music-icon,
html[data-theme] body.home .music-capsule-toggle .music-capsule-action .ui-icon {
    color: rgba(255, 255, 255, 0.94) !important;
    text-shadow: 0 1px 3px rgba(2, 8, 16, 0.72);
}

html[data-theme="dark"] body:not(.home) .music-capsule-toggle .music-capsule-copy strong,
html[data-theme="dark"] body:not(.home) .music-capsule-toggle .music-capsule-copy small,
html[data-theme="dark"] body:not(.home) .music-capsule-toggle .music-capsule-art .music-icon,
html[data-theme="dark"] body:not(.home) .music-capsule-toggle .music-capsule-action .ui-icon {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.34);
}

/* On phones the film ends above the fixed bottom dock.  The compact control
   therefore sits on the light dock rather than on the moving film. */
@media (max-width: 760px) {
    html[data-theme] body.home .music-capsule-toggle .music-capsule-copy strong,
    html[data-theme] body.home .music-capsule-toggle .music-capsule-copy small,
    html[data-theme] body.home .music-capsule-toggle .music-capsule-art .music-icon,
    html[data-theme] body.home .music-capsule-toggle .music-capsule-action .ui-icon {
        color: var(--qa-mat-ink) !important;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.44);
    }

    html[data-theme="dark"] body.home .music-capsule-toggle .music-capsule-copy strong,
    html[data-theme="dark"] body.home .music-capsule-toggle .music-capsule-copy small,
    html[data-theme="dark"] body.home .music-capsule-toggle .music-capsule-art .music-icon,
    html[data-theme="dark"] body.home .music-capsule-toggle .music-capsule-action .ui-icon {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.34);
    }
}

/* Keep first-party icons on stable semantic colors.  The old difference blend
   mode made the sun turn white on inner pages and changed icon contrast as a
   video frame moved underneath the header. */
@supports (mix-blend-mode: difference) {
    html[data-theme] body .ui-icon {
        mix-blend-mode: normal !important;
        filter: none !important;
    }

    html[data-theme] body .ui-icon:not(.video-toggle-icon):not(.music-icon) {
        opacity: 1 !important;
    }
}

/* Tarot finish: keep the reading surface translucent and still.  The page
   used to re-introduce pointer-positioned lens layers after the shared
   content reset, which made pale blocks and cursor-following hot spots return
   around the result and follow-up areas. */
html[data-theme] body.page-template-page-tarot {
    --tarot-static-surface: color-mix(in srgb, var(--lg-content) 58%, transparent);
    --tarot-static-surface-soft: color-mix(in srgb, var(--lg-content-soft) 42%, transparent);
    --tarot-static-field: color-mix(in srgb, var(--lg-content-strong) 48%, transparent);
    --tarot-static-line: color-mix(in srgb, var(--lg-ink) 18%, transparent);
    --tarot-static-shadow:
        inset 0 1px 0 color-mix(in srgb, #ffffff 26%, transparent),
        inset 0 -1px 0 color-mix(in srgb, var(--lg-ink) 5%, transparent),
        0 12px 30px color-mix(in srgb, var(--lg-ink) 9%, transparent);
}

html[data-theme] body.page-template-page-tarot :is(
    .tarot-stage .tarot-form,
    .tarot-stage .tarot-table,
    .tarot-stage .tarot-summary-box,
    .tarot-stage .ai-chat-panel
) {
    --lg-pointer-x: 50% !important;
    --lg-pointer-y: 8% !important;
    border: 1px solid var(--tarot-static-line) !important;
    background:
        linear-gradient(155deg, var(--tarot-static-surface), var(--tarot-static-surface-soft)) padding-box,
        linear-gradient(145deg, color-mix(in srgb, var(--lg-ink) 18%, transparent), color-mix(in srgb, var(--lg-ink) 7%, transparent)) border-box !important;
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    box-shadow: var(--tarot-static-shadow) !important;
    -webkit-backdrop-filter: blur(18px) saturate(118%) !important;
    backdrop-filter: blur(18px) saturate(118%) !important;
    filter: none !important;
}

html[data-theme] body.page-template-page-tarot :is(
    .tarot-stage .tarot-form,
    .tarot-stage .tarot-table,
    .tarot-stage .tarot-summary-box,
    .tarot-stage .ai-chat-panel,
    .tarot-stage .tarot-deck-fan
)::before,
html[data-theme] body.page-template-page-tarot :is(
    .tarot-stage .tarot-form,
    .tarot-stage .tarot-table,
    .tarot-stage .tarot-summary-box,
    .tarot-stage .ai-chat-panel,
    .tarot-stage .tarot-deck-fan
)::after {
    display: none !important;
    content: none !important;
    background: none !important;
    box-shadow: none !important;
    opacity: 0 !important;
}

/* Fields keep a visible edge without becoming white rectangles. */
html[data-theme] body.page-template-page-tarot :is(
    .tarot-stage .tarot-form textarea,
    .tarot-stage .tarot-form select,
    .tarot-stage .ai-chat-compose
) {
    --lg-pointer-x: 50% !important;
    --lg-pointer-y: 8% !important;
    border-color: color-mix(in srgb, var(--lg-ink) 23%, transparent) !important;
    background: var(--tarot-static-field) !important;
    background-image: none !important;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #ffffff 36%, transparent),
        inset 0 -1px 0 color-mix(in srgb, var(--lg-ink) 6%, transparent) !important;
}

html[data-theme] body.page-template-page-tarot :is(
    .tarot-stage .spread-slot,
    .tarot-stage .ai-chat-bubble.is-assistant
) {
    border-color: color-mix(in srgb, var(--lg-ink) 15%, transparent) !important;
    background: color-mix(in srgb, var(--lg-content-soft) 38%, transparent) !important;
    background-image: none !important;
    box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 24%, transparent) !important;
}

/* Card faces use the same quiet glass as the surrounding reading surface.
   The old opaque face was the remaining large pale slab on narrow screens. */
html[data-theme] body.page-template-page-tarot .tarot-stage .tarot-front {
    border: 1px solid color-mix(in srgb, var(--lg-ink) 14%, transparent) !important;
    color: var(--lg-ink) !important;
    background:
        linear-gradient(155deg, color-mix(in srgb, var(--lg-content) 42%, transparent), color-mix(in srgb, var(--lg-content-soft) 28%, transparent)) padding-box,
        linear-gradient(145deg, color-mix(in srgb, #ffffff 30%, transparent), color-mix(in srgb, var(--lg-ink) 9%, transparent)) border-box !important;
    background-repeat: no-repeat !important;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #ffffff 24%, transparent),
        0 12px 26px color-mix(in srgb, var(--lg-ink) 7%, transparent) !important;
    -webkit-backdrop-filter: blur(12px) saturate(112%) !important;
    backdrop-filter: blur(12px) saturate(112%) !important;
}

/* Primary and secondary actions share the same quiet material; no hover
   transform or radial lens remains on this page. */
html[data-theme] body.page-template-page-tarot :is(
    .tarot-stage .button.primary,
    .tarot-stage .ai-chat-send
) {
    --lg-pointer-x: 50% !important;
    --lg-pointer-y: 8% !important;
    border: 1px solid color-mix(in srgb, var(--lg-ink) 17%, transparent) !important;
    color: var(--lg-ink) !important;
    background:
        linear-gradient(155deg, color-mix(in srgb, var(--lg-accent) 26%, var(--lg-page)), color-mix(in srgb, var(--lg-accent) 12%, var(--lg-page))) padding-box,
        linear-gradient(145deg, color-mix(in srgb, #ffffff 36%, transparent), color-mix(in srgb, var(--lg-ink) 10%, transparent)) border-box !important;
    background-repeat: no-repeat !important;
    box-shadow: var(--tarot-static-shadow) !important;
    -webkit-backdrop-filter: blur(12px) saturate(120%) !important;
    backdrop-filter: blur(12px) saturate(120%) !important;
}

html[data-theme] body.page-template-page-tarot .tarot-stage .button.secondary {
    border-color: color-mix(in srgb, var(--lg-ink) 17%, transparent) !important;
    color: var(--lg-ink) !important;
    background: color-mix(in srgb, var(--lg-content-soft) 34%, transparent) !important;
    background-image: none !important;
    box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 26%, transparent) !important;
}

@media (hover: hover) and (pointer: fine) {
    html[data-theme] body.page-template-page-tarot :is(
        .tarot-stage .button.primary,
        .tarot-stage .button.secondary,
        .tarot-stage .ai-chat-send
    ):hover:not(:disabled) {
        transform: none !important;
        box-shadow: var(--tarot-static-shadow) !important;
    }
}

/* Close up the empty air between the question/result layers while leaving
   the card fan and its readable breathing room intact. */
html[data-theme] body.page-template-page-tarot .tarot-stage {
    row-gap: clamp(24px, 2.8vw, 32px) !important;
    padding-block: clamp(26px, 3vw, 34px) clamp(32px, 4vw, 44px) !important;
}

html[data-theme] body.page-template-page-tarot :is(.tarot-result, .tarot-history) {
    margin-top: clamp(12px, 2.2vw, 28px) !important;
}

html[data-theme] body.page-template-page-tarot .tarot-history {
    padding-top: 18px !important;
}

/* The shared material pass intentionally neutralized this transform. Bring
   back the small, useful open-state rotation for the navigation icon. */
html[data-theme] body .site-dock > .site-dock-toggle {
    transform: rotate(0deg) !important;
    transform-origin: center !important;
    transition: transform 260ms var(--qa-ease, var(--lg-spring, cubic-bezier(0.22, 1, 0.36, 1))) !important;
}

html[data-theme] body .site-dock.is-open > .site-dock-toggle {
    transform: rotate(90deg) !important;
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme] body .site-dock > .site-dock-toggle {
        transition-duration: 1ms !important;
    }
}

/* Public type/icon contract: use the platform's native sans stack and keep
   semantic colors stable while the theme state changes.  The previous pass
   used an Apple-only stack plus difference blending, which made the same sun
   icon and text edge change color with the route or video frame. */
:root {
    --font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", sans-serif;
    --font-display: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", sans-serif;
    --font-reading: ui-serif, "Noto Serif SC", "Source Han Serif SC", "STSong", Georgia, serif;
    --qa-ink: #1d2938;
    --qa-muted: #59697d;
    --qa-page: #f4f6f9;
    --qa-type-strong: #1d2938;
    --qa-type-body: #334155;
    --qa-type-meta: #59697d;
    --qa-type-faint: #788596;
    --icon-blue: #5877a5;
    --icon-ink: #52647f;
}

html[data-theme="dark"] {
    --qa-ink: #e7eef7;
    --qa-muted: #b2c0d0;
    --qa-page: #0c1118;
    --qa-type-strong: #e7eef7;
    --qa-type-body: #d0dbe8;
    --qa-type-meta: #b2c0d0;
    --qa-type-faint: #96a6b9;
    --icon-blue: #bad2ee;
    --icon-ink: #c4d7ec;
}

html[data-theme][data-theme] body {
    font-weight: 400 !important;
}

html[data-theme][data-theme] body,
html[data-theme][data-theme] body :is(button, input, select, textarea) {
    font-family: var(--font-ui) !important;
    font-synthesis: none !important;
    font-optical-sizing: auto;
}

html[data-theme][data-theme] body :is(p, li, dd, dt, figcaption, label, small, input, textarea, select) {
    font-weight: 400 !important;
}

html[data-theme][data-theme] body :is(button, .button, .nav a, .site-nav a, .theme-toggle, .lang-toggle, .hero-kicker, .section-kicker, .eyebrow, strong, b) {
    font-weight: 550 !important;
}

html[data-theme][data-theme] body :is(h1, h2, h3, h4, h5, h6) {
    font-family: var(--font-display) !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

html[data-theme][data-theme] body :is(
    .home-film-copy h1,
    .page-hero h1,
    .notes-hero h1,
    .tarot-hero-copy h1,
    .article h1,
    .note-card h2,
    .note-card h3,
    .home-story-copy h3,
    .article-content h2,
    .tarot-stage h1,
    .tarot-stage h2,
    .comments-shell h2,
    .home-film-title
) {
    font-weight: 600 !important;
}

html[data-theme][data-theme] body .music-capsule-panel :is(
    .music-panel-head,
    .music-panel-head strong,
    .music-result-copy strong,
    .music-result-copy small,
    .music-time,
    .music-empty,
    .music-search label > span
) {
    font-weight: 500 !important;
    text-shadow: none !important;
}

/* Icons follow their semantic parent; no frame-dependent color inversion. */
html[data-theme][data-theme] body .ui-icon {
    color: currentColor !important;
    mix-blend-mode: normal !important;
    filter: none !important;
}

/* The sun is an intentional accent and stays amber on every light route. */
html[data-theme][data-theme] body .theme-toggle__around {
    color: #f0b52e !important;
    fill: #f0b52e !important;
    stroke: #f0b52e !important;
    mix-blend-mode: normal !important;
    filter: drop-shadow(0 1px 1px rgba(75, 55, 12, 0.2)) !important;
}

html[data-theme="light"] body .theme-toggle__around {
    opacity: 1 !important;
}

html[data-theme="dark"] body .theme-toggle__around {
    opacity: 0 !important;
}

html[data-theme][data-theme] body .theme-toggle-moon svg {
    color: #c8d9ed !important;
    fill: currentColor !important;
    stroke: currentColor !important;
    mix-blend-mode: normal !important;
    filter: none !important;
}

html[data-theme="light"] body .theme-toggle-moon svg {
    opacity: 0 !important;
}

html[data-theme="dark"] body .theme-toggle-moon svg {
    opacity: 1 !important;
}

/* Stable text ink for ordinary pages; the film hero keeps its dedicated white
   reading layer below so moving video remains legible. */
html[data-theme][data-theme] body:not(.home) :is(
    .brand,
    .site-brand,
    .nav a,
    .site-nav a,
    .page-hero h1,
    .notes-hero h1,
    .tarot-hero-copy h1,
    .article h1,
    .note-card h2,
    .note-card h3,
    .home-story-copy h3
) {
    color: var(--qa-ink) !important;
    -webkit-text-fill-color: currentColor !important;
    mix-blend-mode: normal !important;
    text-shadow: none !important;
}

html[data-theme][data-theme] body.home :is(.home-film-copy h1, .home-film-copy p, .home-daily-line, .home-film-info) {
    mix-blend-mode: normal !important;
}

html[data-theme][data-theme] body.home .brand {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.22) !important;
}

html.has-scrolled[data-theme][data-theme] body.home .brand {
    color: var(--lg-ink) !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: none !important;
}
