@font-face {
    font-family: 'XIROD';
    src: url('../../../../assets/fonts/XIROD.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Sui Generis';
    src: url('../../../../assets/fonts/sui generis rg.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* VEXML Logo Component (Reusable) */
.vexml-logo-animated {
    position: relative;
    width: 60px;
    /* Default small */
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
}

.vexml-logo-animated .logo-base {
    width: 100%;
    height: auto;
    display: block;
    z-index: 2;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(253, 114, 76, 0.15) 0%, rgba(253, 114, 76, 0) 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 1;
}

.vexml-logo-animated:hover .logo-glow {
    opacity: 1;
}

.logo-trace-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

/* Footer specific logo size */
.main-footer .vexml-logo-animated {
    width: 130px;
    margin: 0 auto 20px;
    display: flex;
}

/* Manual Specific Overrides */
body {
    background-color: #111111;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.manual-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 40px 100px;
    /* Top padding accounts for sticky header */
    box-sizing: border-box;
    min-height: 80vh;
}

.manual-wrapper h1 {
    font-family: 'XIROD', sans-serif;
    font-size: 2.5rem;
    color: #ffffff;
    border-bottom: 2px solid #EF405C;
    /* VEXML Pink */
    padding-bottom: 20px;
    margin-bottom: 30px;
    line-height: 1.2;
    text-align: center;
}

.manual-intro {
    margin-bottom: 40px;
    text-align: center;
    font-size: 1.1rem;
    color: #ccc;
}

/* Accordion Styling */
.accordion-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.accordion-item {
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.accordion-item.active {
    border-color: #EF405C;
    box-shadow: 0 0 15px rgba(239, 64, 92, 0.2);
}

.accordion-header {
    width: 100%;
    background: #222;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease;
    user-select: none;
}

.accordion-header:hover {
    background: #2a2a2a;
}

.accordion-item.active .accordion-header {
    background: linear-gradient(90deg, #FD724C 0%, #EF405C 100%);
}

.accordion-title {
    font-family: 'Sui Generis', serif;
    font-size: 1.2rem;
    color: #ffffff;
    margin: 0;
    pointer-events: none;
    /* Let click pass to header */
}

.accordion-icon {
    width: 24px;
    height: 24px;
    fill: #ffffff;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
    background-color: #0d0d0d;
}

.accordion-item.active .accordion-content {
    /* max-height is set via JS for smooth animation to auto height */
    opacity: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Only show revert button when the definition is the target */
strong:target+.revert-btn,
strong.active-term+.revert-btn {
    opacity: 1;

    pointer-events: auto;
}

/* Revert Button Style */
.revert-btn {
    text-decoration: none;
    color: #FD724C;
    /* Orange */
    font-size: 0.9rem;
    /* Smaller */
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, color 0.2s ease;
    text-align: center;
    display: inline-block;
    /* Ensure transforms work */
    margin-left: 8px;
    transform: translateY(2px);
    /* Down a few pixels */
    outline: none;
}

.content-inner {
    padding: 30px;
}

/* Inner Typography */
.manual-wrapper h3 {
    font-family: 'Sui Generis', serif;
    font-size: 1.4rem;
    color: #EF405C;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.manual-wrapper h3:first-child {
    margin-top: 0;
}

.manual-wrapper h4 {
    font-family: 'Sui Generis', serif;
    font-size: 1.1rem;
    color: #cccccc;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.manual-wrapper p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #dddddd;
    margin-bottom: 1rem;
}

.manual-wrapper li {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #dddddd;
}

.manual-wrapper a {
    color: #EF405C;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.manual-wrapper a:hover {
    color: #FD724C;
    text-decoration: underline;
}

.manual-wrapper ul,
.manual-wrapper ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.manual-wrapper li {
    margin-bottom: 0.5rem;
}

/* Nested List Spacing */
.manual-wrapper li>ul,
.manual-wrapper li>ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Callouts */
.callout {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid #FD724C;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 6px 6px 0;
}

.callout strong {
    display: block;
    margin-bottom: 8px;
    font-family: 'Sui Generis', serif;
    color: #FD724C;
    font-size: 1.1em;
}

.callout.warning {
    border-left-color: #EF405C;
    background: rgba(239, 64, 92, 0.05);
}

.callout.warning strong {
    color: #EF405C;
}

.callout.note {
    border-left-color: #FD724C;
    /* VEXML Orange */
    background: rgba(253, 114, 76, 0.05);
}

.callout.note strong {
    color: #FD724C;
}

.manual-wrapper hr {
    border: none;
    border-top: 1px solid #333;
    margin: 40px 0;
}

.small {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Standalone Section Styles */
.breakout {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 0 40px;
    box-sizing: border-box;
}

.standalone-manual-section {
    background: none;
    border: none;
    border-radius: 0;
    margin-top: 20px;
    margin-bottom: 20px;
}

.ui-standalone-section {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin-bottom: 40px;
}

.ui-standalone-section p {
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: #ccc;
    font-size: 1.1rem;
    line-height: 1.6;
}

.standalone-section-title {
    background: none;
    padding: 15px 0;
    margin: 0 0 -5px 0;
    font-family: 'Sui Generis', serif;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: #FD724C;
    border-bottom: none;
    text-align: center;
}

.standalone-manual-section h3 {
    color: #FD724C;
}

.manual-wrapper h2 {
    text-transform: uppercase;
}

/* Full-width Breakout */
.full-bleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    padding: 40px 0;
    margin-top: 40px;
    margin-bottom: 40px;
}

.full-bleed-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.full-bleed .standalone-section-title {
    background: none;
    border: none;
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 15px;
    padding: 0;
}

.full-bleed-content .content-inner {
    padding-top: 0;
}

/* UI section specific adjustments */
.ui-standalone-section {
    border: none;
    border-radius: 0;
    background: transparent;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .manual-wrapper {
        padding: 20px 10px 80px;
    }

    .manual-wrapper h1 {
        font-size: 1.8rem;
    }

    .accordion-header {
        padding: 15px 20px;
    }

    .accordion-title {
        font-size: 1rem;
    }

    .content-inner {
        padding: 20px;
    }
}



/* UI Overview Section */
.ui-overview-container {
    margin-top: 0;
    margin-bottom: 15px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.loading-state {
    text-align: center;
    padding: 60px;
    color: #FD724C;
    font-family: 'Sui Generis', serif;
    font-size: 1.2rem;
}

.breakout .content-inner {
    padding-left: 0;
    padding-right: 0;
}

.ui-overview-outer {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    margin-bottom: 30px;
}

.image-wrapper {
    width: 100%;
    position: relative;
    display: grid;
    grid-template-areas: "overlap";
    overflow: hidden;
    border-radius: 8px;
    background: #000;
    z-index: 1;
}


.focus-box {
    position: absolute;
    /* Position and size set via inline styles from JS */
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 0 rgba(20, 20, 20, 0);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
    z-index: 10;
    border-radius: 4px;
}

.focus-box.active {
    box-shadow: 0 0 0 200vmax rgba(20, 20, 20, 0.85);
    /* Darkening */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Blur Panels */
.blur-panel {
    position: absolute;
    background: transparent;
    /* or transparent, blur handles it */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 5;
    /* Below focus box (10), above image */
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0;
}

.blur-panel.active {
    opacity: 1;
}

/* Blur panels extend OUTSIDE the 16:9 box to cover the overflow area */
/* Top and Bottom span full width */
.blur-t {
    top: -50%;
    left: -50%;
    right: -50%;
    height: calc(50% + var(--edge-t, 0%));
}

.blur-b {
    bottom: -50%;
    left: -50%;
    right: -50%;
    height: calc(50% + (100% - var(--edge-b, 100%)));
}

/* Left and Right span the middle gap (vertically strict to focus-h) */
.blur-l {
    left: -50%;
    top: var(--edge-t, 0%);
    height: var(--focus-h, 100%);
    width: calc(50% + var(--edge-l, 0%));
}

.blur-r {
    right: -50%;
    top: var(--edge-t, 0%);
    height: var(--focus-h, 100%);
    left: var(--edge-r, 100%);
}

.ui-overview-image {
    grid-area: overlap;
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease;
    transform-origin: center center;
    z-index: 1;
}

.overlay-image {
    grid-area: overlap;
}

.ui-text-box {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.5s ease;

    /* Visuals */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left !important;

    padding: 10px;
    /* Add some padding so text doesn't hit edge */

    /* Typography */
    font-family: 'Sui Generis', serif;
    font-size: 0.9rem;
    color: #EF405C;
    /* VEXML Pink */
    /* No shadow for clean look, or subtle */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);

    overflow-y: auto;
    /* Ensure it stays within box */
    scrollbar-width: thin;
    scrollbar-color: #FD724C rgba(255, 255, 255, 0.05);
}

.ui-text-box h3 {
    margin: 0 0 8px 0;
    font-size: clamp(0.9rem, 0.8rem + 1vw, 1.4rem) !important;
    /* Smooth scaling */
    transition: font-size 0.2s ease;
    color: #EF405C;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(239, 64, 92, 0.3);
    padding-bottom: 5px;
    width: 100%;
    text-align: left !important;
}

.ui-text-box ul {
    margin: 0;
    padding-left: 15px;
    list-style-type: square;
    text-align: left !important;
}

.ui-text-box li,
.ui-text-box p {
    font-size: clamp(0.75rem, 0.7rem + 0.6vw, 1.1rem) !important;
    /* Smooth scaling */
    transition: font-size 0.2s ease;
    color: #ddd;
    margin-bottom: 4px;
    line-height: 1.3;
    font-family: sans-serif;
    /* Readable font for details */
    pointer-events: auto;
    /* Allow scrolling */
    text-align: left !important;
}

/* Mobile Responsive UI Text Box */
@media (max-width: 768px) {
    .ui-text-box {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px;
        /* Ensure it doesn't bleed */
        max-width: 90vw !important;
        /* Force constraint if bbox is huge */
        max-height: 40vh !important;
        /* Limit height to allow seeing other context */

        border-radius: 4px;
        scrollbar-width: thin;
        scrollbar-color: #FD724C rgba(255, 255, 255, 0.05);
        pointer-events: auto !important;
        /* Critical for scrolling */
    }

    /* Font sizes handled by clamp() now */
}

.ui-text-box.active {
    opacity: 1;
}

.ui-sections-container {
    display: flex;
    gap: 15px;
    width: 100%;
    max-height: 450px;
}

.ui-col {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.ui-col-center {
    /* Center column is wider */
    flex: 2.4;
}

/* Assign Areas - No longer needed, cleaner HTML structure handles this */





.ui-section-item {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 10px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    width: 100%;
    flex: 1;
    height: auto;
    min-height: 60px;
}

/* Specific Minimum Heights for better scaling and matching */
.ui-section-item[data-section="toolbar"],
.ui-section-item[data-section="composition"],
.ui-section-item[data-section="vexport"],
.ui-section-item[data-section="review"],
.ui-section-item[data-section="simplify"] {
    flex: none;
    min-height: 60px;
}

.ui-section-item[data-section="viewport"] {
    min-height: 150px;
}

.ui-section-item[data-section="outputs"],
.ui-section-item[data-section="screens"] {
    min-height: 90px;
    flex: 1;
}

.ui-section-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ui-section-item:hover,
.ui-section-item.active {
    /* background: #222; Removed to keep consistent dark grey */
    border-color: #EF405C;
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.ui-section-item:hover::before,
.ui-section-item.active::before {
    opacity: 1;
}

.ui-section-item.active {
    box-shadow: 0 0 0 1px #EF405C, 0 6px 20px rgba(239, 64, 92, 0.2);
}

.ui-section-item.active .ui-section-name {
    color: #EF405C;
}

.ui-section-name {
    font-family: 'Sui Generis', serif;
    color: #fff;
    font-size: clamp(0.75rem, 1.25vw, 1.4rem);
    margin-bottom: 6px;
    transition: color 0.2s ease;
    z-index: 1;
    white-space: normal;
    line-height: 1.1;
    width: 95%;
}

.ui-section-desc {
    font-size: clamp(0.65rem, 0.95vw, 1.1rem);
    color: #888;
    line-height: 1.2;
    z-index: 1;
    width: 95%;
}

@media (max-width: 1200px) {

    .ui-sections-container,
    .ui-col {
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .ui-section-desc {
        display: none !important;
    }

    .ui-section-name {
        margin-bottom: 0;
    }
}

@media (max-width: 600px) {
    .ui-sections-container {
        /* Do NOT restack - just scale everything down */
        gap: 8px;
    }

    .ui-col {
        gap: 8px;
    }

    .ui-section-item {
        padding: 6px;
    }

    .ui-section-item[data-section="toolbar"],
    .ui-section-item[data-section="composition"],
    .ui-section-item[data-section="vexport"],
    .ui-section-item[data-section="review"],
    .ui-section-item[data-section="simplify"] {
        min-height: 50px;
        height: auto;
    }

    .ui-section-name {
        font-size: 0.65rem;
    }

    .ui-section-desc {
        display: none !important;
    }
}

/* System Requirements Compact Style */
.sys-reqs h4 {
    margin-top: 1rem;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.sys-reqs ul {
    margin-bottom: 0.8rem;
}

.sys-reqs li {
    margin-bottom: 0.2rem;
    line-height: 1.5;
}

.sys-reqs li>ul {
    margin-bottom: 0.2rem;
    margin-top: 0.1rem;
}

/* Definition Toggle Styles */
.def-content {
    display: inline;
}

.def-short {
    display: inline;
}

.def-full {
    display: none;
}

.def-full.active {
    display: inline;
}



.def-toggle {
    background: none;
    border: none;
    color: #EF405C;
    cursor: pointer;
    font-size: 0.9em;
    padding: 0;
    margin-left: 5px;
    text-decoration: underline;
    font-family: inherit;
}

.def-toggle:hover {
    color: #FD724C;
}

/* Standalone UI Section Overrides Removed - Managed by .ui-standalone-section above */

@media (max-width: 600px) {
    .ui-standalone-section {
        padding: 15px;
        margin-bottom: 30px;
    }

    .ui-standalone-section h2 {
        font-size: 1.1rem !important;
        margin-bottom: 12px !important;
    }

    .ui-standalone-section p {
        font-size: 0.85rem;
        margin-bottom: 20px !important;
    }

    .ui-overview-container {
        margin-top: 30px;
    }
}

/* Danger Category Grid & Cards */
.danger-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.danger-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.danger-card:hover {
    border-color: #EF405C;
    box-shadow: 0 4px 15px rgba(239, 64, 92, 0.1);
    transform: translateY(-2px);
}

.danger-card h4 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    font-family: 'Sui Generis', serif;
}

.danger-card .meaning {
    font-size: 0.95rem;
    color: #ccc;
    line-height: 1.5;
}

.danger-card .tooltip-ref {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

@media (max-width: 768px) {
    .danger-grid {
        grid-template-columns: 1fr;
    }
}

/* Interactive Link Styling (Global for Content) */
.content-inner a,
.smart-nav-link,
.ref-link {
    color: #ffffff;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
    cursor: pointer;
}

.content-inner a:hover,
.smart-nav-link:hover,
.ref-link:hover {
    color: #EF405C;
    text-decoration: none;
    /* Override global a:hover underline */
}

/* Animated Red Underline */
.content-inner a::after,
.smart-nav-link::after,
.ref-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    /* Place just under text */
    width: 0%;
    height: 2px;
    /* Stroke width 2 */
    background-color: #EF405C;
    box-shadow: 0 0 10px rgba(239, 64, 92, 0.8);
    /* Glowing line */
    transition: width 0.3s ease;
}

.content-inner a:hover::after,
.smart-nav-link:hover::after,
.ref-link:hover::after {
    width: 100%;
}

/* Superscript References */
sup {
    color: #EF405C !important;
    font-weight: bold;
}

/* Superscript EXT for external links, limited to manual content */
/* Manual specific Sup Adjustment for Global Ext Links */
.manual-wrapper a[href^="http"] sup,
.manual-wrapper a[href^="https"] sup {
    vertical-align: super;
    font-size: 0.6em;
    margin-left: 1px;
    text-decoration: none !important;
    /* Ensure no underline on the ext itself if parent has it? */
    display: inline-block;
    /* Helpful for vertical align sometimes? No, standard sup is inline. */
}

/* Navigation Flash Animation */
@keyframes flash-highlight {
    0% {
        background-color: transparent;
    }

    25% {
        background-color: rgba(239, 64, 92, 0.4);
    }

    /* Brand Red tint */
    50% {
        background-color: transparent;
    }

    75% {
        background-color: rgba(239, 64, 92, 0.4);
    }

    100% {
        background-color: transparent;
    }
}

.flash-target {
    animation: flash-highlight 1.5s ease-out;
    border-radius: 4px;
    /* Optional softness */
}