
/* USATOTO V12 — scoped progressive enhancement, original layout preserved */
:root {
    --v12-text-scale: 1;
    --v12-red: #ff4658;
}
.v12-toolbar {
    position: relative;
    z-index: 30;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px max(18px, calc((100vw - 1200px) / 2));
    background: #140b10;
    border-bottom: 1px solid rgba(255, 70, 88, .16);
}
.v12-tool,
.v12-save,
.v12-history-head button {
    cursor: pointer;
    border: 1px solid rgba(255, 90, 110, .3);
    background: #211218;
    color: #ffe8ed;
    border-radius: 10px;
    padding: 10px 14px;
    font: 600 13px system-ui, sans-serif;
}
.v12-tool:hover,
.v12-save:hover,
.v12-history-head button:hover {
    border-color: #ff4658;
    background: #38121d;
}
.v12-tool kbd {
    margin-left: 7px;
    color: #e8a4af;
    font-size: 11px;
}
.v12-overlay[hidden] {
    display: none !important;
}
.v12-overlay {
    position: fixed;
    z-index: 99999;
    inset: 0;
    display: grid;
    place-items: start center;
    padding: min(12vh, 90px) 16px 16px;
    background: rgba(0, 0, 0, .8);
    backdrop-filter: blur(12px);
}
.v12-modal {
    width: min(640px, 100%);
    max-height: 82vh;
    overflow-y: auto;
    border: 1px solid #a62b43;
    border-radius: 18px;
    background: #170d12;
    box-shadow: 0 30px 90px #000a;
    color: #fff3f5;
}
.v12-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #54202c;
}
.v12-modal-head h2 {
    margin: 0;
    font-size: 22px;
}
.v12-close {
    background: transparent;
    color: white;
    border: 0;
    font-size: 24px;
    cursor: pointer;
}
.v12-modal-body {
    padding: 20px;
}
.v12-search-input {
    width: 100%;
    padding: 15px;
    border: 1px solid #92334a;
    border-radius: 10px;
    background: #260e17;
    color: #fff;
    font: inherit;
}
.v12-results {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}
.v12-result {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid #51202e;
    border-radius: 10px;
    background: #251017;
    color: #fff1f3;
    text-decoration: none;
}
.v12-result:hover {
    border-color: #ff4658;
}
.v12-result small {
    color: #c99fa8;
}
.v12-preferences {
    display: grid;
    gap: 22px;
}
.v12-preferences label {
    display: grid;
    gap: 9px;
    font-weight: 600;
}
.v12-preferences input,
.v12-preferences select {
    accent-color: #ff4658;
}
.v12-preferences select {
    padding: 10px;
    border-radius: 8px;
    background: #2a101a;
    color: #fff;
}
.v12-preferences .v12-check {
    display: flex;
    align-items: center;
}
.v12-modal-open {
    overflow: hidden;
}
.v12-article-tools {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0 24px;
}
.v12-toc {
    display: grid;
    gap: 9px;
    padding: 20px;
    margin: 24px 0;
    border-left: 3px solid #ff4658;
    background: #201017;
}
.v12-toc a {
    color: #f4ccd3;
}
.v12-related {
    margin-top: 50px;
}
.v12-related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.v12-lab-history {
    margin-top: 20px;
    padding: 24px;
    border: 1px solid #662334;
    border-radius: 14px;
    background: #1a0b10;
    color: #ffe9ed;
}
.v12-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.v12-history-head h3 {
    margin: 0;
}
.v12-history-item {
    padding: 12px 0;
    border-bottom: 1px solid #50202a;
    font-family: monospace;
}
.v12-lab-history p {
    color: #cba2aa;
}
.v12-story {
    margin-top: 30px;
    padding: clamp(24px, 6vw, 70px);
    border: 1px solid #5e1a2a;
    border-radius: 20px;
    background: radial-gradient(circle at 85% 20%, #581121 0, transparent 42%), #150b10;
    color: #fff1f3;
}
.v12-story h2 {
    max-width: 780px;
    margin: 12px 0;
    font-size: clamp(26px, 4vw, 52px);
    line-height: 1.1;
}
.v12-story p {
    max-width: 660px;
    margin-bottom: 35px;
    color: #d9afb8;
    line-height: 1.8;
}
.v12-eyebrow {
    color: #ff7184;
    font: 700 12px monospace;
    letter-spacing: .13em;
}
.v12-story-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0 50px;
}
.v12-story-strip span {
    padding: 14px 20px;
    border: 1px solid #97344b;
    border-radius: 10px;
    background: #280e19;
    font: 700 clamp(20px, 3vw, 35px) monospace;
}
.v12-progress {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #ff4658;
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
}
.article p,
.article li,
.v12-story p {
    font-size: calc(1em * var(--v12-text-scale));
}
[data-v12contrast="high"] .v12-toolbar,
[data-v12contrast="high"] .v12-lab-history {
    border-color: #fff;
}
[data-v12motion="minimal"] .v12-story-strip *,
[data-v12motion="off"] .v12-story-strip * {
    animation: none !important;
    transition: none !important;
}
[data-v12motion="off"] *,
[data-v12motion="off"] *::before,
[data-v12motion="off"] *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
}
:focus-visible {
    outline: 2px solid #ff758a;
    outline-offset: 3px;
}
@media (max-width: 720px) {
    .v12-toolbar {
        justify-content: center;
        padding: 8px 12px;
    }
    .v12-tool {
        flex: 1;
        padding: 10px 8px;
    }
    .v12-tool kbd {
        display: none;
    }
    .v12-related-grid {
        grid-template-columns: 1fr;
    }
    .v12-history-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .v12-story {
        padding: 24px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .v12-story *,
    .v12-toolbar * {
        animation: none !important;
        transition: none !important;
    }
}

/* Mobile drawer refinement — original menu toggle remains the only controller */
@media (max-width: 760px) {
    .mobile-nav.v12-mobile-nav.open {
        max-height: min(72vh, 560px);
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 1px solid #672333;
        border-radius: 0 0 16px 16px;
        background: #170b12;
        box-shadow: 0 20px 35px rgba(0, 0, 0, .4);
    }
    .mobile-nav.v12-mobile-nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
        border-bottom: 1px solid rgba(255, 70, 88, .12);
    }
}
