:root {
    --dex-ink: #182b33;
    --dex-muted: #60747b;
    --dex-paper: #fffdf7;
    --dex-cream: #f6f1e6;
    --dex-line: #d8d2c4;
    --dex-coral: #ec5f53;
    --dex-coral-dark: #ba3e35;
    --dex-yellow: #f5c84c;
    --dex-mint: #97c9b8;
    --dex-navy: #173d4d;
    --dex-shadow: 0 24px 60px rgba(24, 43, 51, 0.12);
    --dex-shadow-soft: 0 12px 30px rgba(24, 43, 51, 0.08);
    --dex-radius-xl: 30px;
    --dex-radius-lg: 22px;
    --dex-radius: 15px;
}

body.dex-page {
    background: #f4efe3;
    color: var(--dex-ink);
}

body.dex-page .page-bg {
    background:
        linear-gradient(rgba(23, 61, 77, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 61, 77, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 11% 7%, rgba(245, 200, 76, 0.32), transparent 25%),
        radial-gradient(circle at 86% 18%, rgba(151, 201, 184, 0.32), transparent 27%),
        linear-gradient(135deg, #f7f1e3 0%, #fffdf7 46%, #f4eee1 100%);
    background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

body.dex-page .page-bg::after {
    background: none;
}

body.dex-page .site-header-unified .site-header-inner {
    max-width: 1320px;
    border-color: rgba(23, 61, 77, 0.14);
    background: rgba(255, 253, 247, 0.88);
    box-shadow: 0 16px 40px rgba(23, 61, 77, 0.09);
    backdrop-filter: blur(18px);
}

body.dex-page .site-header-unified .site-logo {
    color: var(--dex-ink);
}

body.dex-page .site-header-unified .site-logo span:not(.dex-logo-mark) {
    color: var(--dex-coral);
}

.dex-logo-mark {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--dex-coral) 0 47%, var(--dex-ink) 47% 54%, var(--dex-paper) 54% 100%);
    border: 2px solid var(--dex-ink);
    box-shadow: 0 7px 16px rgba(236, 95, 83, 0.24);
}

.dex-logo-mark::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    border: 3px solid var(--dex-ink);
    border-radius: 50%;
    background: var(--dex-paper);
    transform: translate(-50%, -50%);
}

body.dex-page .route-pills a {
    border-color: rgba(23, 61, 77, 0.14);
    color: var(--dex-navy);
    box-shadow: none;
}

body.dex-page .route-pills a:hover {
    color: var(--dex-coral-dark);
    background: #fff4e9;
}

.dex-main {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
    padding: 0 0 90px;
}

.dex-breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 2px 16px;
    color: var(--dex-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.dex-breadcrumb a {
    color: var(--dex-navy);
}

.dex-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
    gap: 34px;
    align-items: end;
    padding: 40px;
    border: 1px solid rgba(23, 61, 77, 0.16);
    border-radius: var(--dex-radius-xl);
    background:
        linear-gradient(125deg, rgba(255, 253, 247, 0.98), rgba(246, 241, 230, 0.92)),
        var(--dex-paper);
    box-shadow: var(--dex-shadow);
    overflow: hidden;
    position: relative;
}

.dex-hero::before {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    border: 46px solid rgba(236, 95, 83, 0.09);
    border-radius: 50%;
    top: -150px;
    right: 17%;
}

.dex-hero::after {
    content: "";
    position: absolute;
    inset: auto -35px -70px auto;
    width: 180px;
    height: 180px;
    background: repeating-linear-gradient(135deg, rgba(23, 61, 77, 0.08) 0 5px, transparent 5px 15px);
    border-radius: 50%;
}

.dex-hero-copy,
.dex-hero-ledger {
    position: relative;
    z-index: 1;
}

.dex-eyebrow,
.dex-kicker {
    margin: 0 0 8px;
    color: var(--dex-coral-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.73rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    line-height: 1.4;
}

body.dex-page .dex-hero h1 {
    max-width: 820px;
    margin: 0 0 16px;
    background: none;
    color: var(--dex-ink);
    -webkit-text-fill-color: currentColor;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.45rem, 5vw, 5rem);
    letter-spacing: -0.055em;
    line-height: 0.95;
}

body.dex-page .dex-hero .lead {
    max-width: 760px;
    margin: 0;
    color: var(--dex-muted);
    font-size: clamp(1rem, 1.8vw, 1.18rem);
    line-height: 1.72;
}

.dex-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.dex-hero-tags span,
.dex-badges span {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 5px 11px;
    border: 1px solid rgba(23, 61, 77, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--dex-navy);
    font-size: 0.78rem;
    font-weight: 800;
}

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

.dex-hero-ledger div {
    min-height: 112px;
    padding: 20px;
    border: 1px solid rgba(23, 61, 77, 0.14);
    border-radius: 18px;
    background: rgba(255, 253, 247, 0.78);
    box-shadow: var(--dex-shadow-soft);
}

.dex-hero-ledger div:nth-child(1) { border-top: 5px solid var(--dex-coral); }
.dex-hero-ledger div:nth-child(2) { border-top: 5px solid var(--dex-mint); }
.dex-hero-ledger div:nth-child(3) { border-top: 5px solid var(--dex-yellow); }
.dex-hero-ledger div:nth-child(4) { border-top: 5px solid var(--dex-navy); }

.dex-hero-ledger strong {
    display: block;
    color: var(--dex-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.15rem;
    line-height: 1;
}

.dex-hero-ledger span {
    display: block;
    margin-top: 10px;
    color: var(--dex-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.dex-system-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 18px 0;
    padding: 20px 24px;
    border: 1px solid rgba(23, 61, 77, 0.16);
    border-radius: var(--dex-radius-lg);
    background: var(--dex-paper);
    box-shadow: var(--dex-shadow-soft);
}

.dex-system-card > div {
    display: grid;
}

.dex-system-card span {
    color: var(--dex-muted);
}

.dex-loader {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(23, 61, 77, 0.16);
    border-top-color: var(--dex-coral);
    border-radius: 50%;
    animation: dex-spin 0.8s linear infinite;
}

.dex-error {
    justify-content: space-between;
    border-color: rgba(186, 62, 53, 0.35);
    background: #fff6f2;
}

.dex-app {
    display: grid;
    gap: 18px;
    margin-top: 18px;
    transition: opacity 180ms ease;
}

.dex-app[aria-busy="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.dex-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: 18px;
}

.dex-panel {
    border: 1px solid rgba(23, 61, 77, 0.15);
    border-radius: var(--dex-radius-lg);
    background: rgba(255, 253, 247, 0.96);
    box-shadow: var(--dex-shadow-soft);
}

.dex-quick-panel,
.dex-today-card,
.dex-filter-panel,
.dex-results-panel,
.dex-detail-panel {
    padding: 24px;
}

.dex-panel-heading,
.dex-results-heading,
.dex-detail-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.dex-panel h2,
.dex-guide h2,
.dex-explainer h2,
.dex-examples h2,
.dex-faq h2 {
    margin: 0;
    color: var(--dex-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.45rem, 2.6vw, 2.35rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.dex-panel h3,
.dex-guide h3,
.dex-example-grid h3 {
    color: var(--dex-ink);
}

.dex-panel p {
    color: var(--dex-muted);
}

.dex-step {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--dex-navy);
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.76rem;
    font-weight: 900;
}

.dex-quick-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 20px;
}

.dex-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.dex-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.dex-field label,
.dex-field legend {
    color: var(--dex-ink);
    font-size: 0.79rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.dex-field small,
.dex-filter-actions > span {
    color: var(--dex-muted);
    font-size: 0.75rem;
}

body.dex-page .dex-field input,
body.dex-page .dex-field select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid rgba(23, 61, 77, 0.24);
    border-radius: 11px;
    background: #fff;
    color: var(--dex-ink);
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(24, 43, 51, 0.02);
}

body.dex-page .dex-field input[aria-invalid="true"] {
    border-color: var(--dex-coral-dark);
    box-shadow: 0 0 0 3px rgba(236, 95, 83, 0.14);
}

body.dex-page .dex-field input:focus,
body.dex-page .dex-field select:focus,
.dex-button:focus-visible,
.dex-result-card button:focus-visible,
.dex-text-button:focus-visible,
.dex-icon-button:focus-visible,
.dex-view-toggle button:focus-visible,
.dex-recent button:focus-visible {
    outline: 3px solid rgba(236, 95, 83, 0.28);
    outline-offset: 2px;
    border-color: var(--dex-coral);
}

.dex-button,
.dex-icon-button,
.dex-result-card button,
.dex-text-button,
.dex-recent button,
.dex-view-toggle button {
    min-height: 44px;
    border: 0;
    border-radius: 11px;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.dex-button:hover,
.dex-icon-button:hover,
.dex-result-card button:hover,
.dex-text-button:hover,
.dex-recent button:hover {
    transform: translateY(-1px);
}

.dex-button:disabled,
.dex-icon-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.dex-button {
    padding: 11px 16px;
}

.dex-button-primary {
    background: var(--dex-coral);
    color: #fff;
    box-shadow: 0 10px 20px rgba(236, 95, 83, 0.24);
}

.dex-button-primary:hover {
    background: var(--dex-coral-dark);
}

.dex-button-secondary {
    border: 1px solid rgba(23, 61, 77, 0.2);
    background: #fff;
    color: var(--dex-navy);
}

.dex-button-quiet {
    background: var(--dex-navy);
    color: #fff;
}

.dex-inline-status {
    min-height: 24px;
    margin: 10px 0 0;
    color: var(--dex-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.dex-inline-status[data-state="success"] { color: #26735f; }
.dex-inline-status[data-state="error"] { color: var(--dex-coral-dark); }

.dex-recent {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.dex-recent > span {
    margin-right: 2px;
    color: var(--dex-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dex-recent button {
    min-height: 34px;
    padding: 5px 10px;
    border: 1px solid rgba(23, 61, 77, 0.14);
    background: var(--dex-cream);
    color: var(--dex-navy);
    font-size: 0.77rem;
}

.dex-today-card {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(23, 61, 77, 0.98), rgba(34, 79, 92, 0.96));
    color: #fff;
}

.dex-today-card::after {
    content: "";
    position: absolute;
    right: -55px;
    bottom: -55px;
    width: 170px;
    height: 170px;
    border: 24px solid rgba(245, 200, 76, 0.13);
    border-radius: 50%;
}

.dex-today-card .dex-kicker,
.dex-today-card h2,
.dex-today-card h3,
.dex-today-card p,
.dex-today-card .dex-mono {
    color: #fff;
}

.dex-today-card p {
    opacity: 0.76;
}

.dex-date-chip {
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.7rem;
    font-weight: 900;
}

.dex-today-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    margin-top: 12px;
}

.dex-today-body h3 {
    margin: 4px 0 9px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.85rem;
}

.dex-text-button {
    min-height: 36px;
    padding: 0;
    background: transparent;
    color: #fff;
    text-align: left;
}

.dex-art-frame,
.dex-card-art {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.dex-art-frame {
    aspect-ratio: 1;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(245, 200, 76, 0.28), rgba(255, 255, 255, 0.74)),
        #fff;
    border: 1px solid rgba(23, 61, 77, 0.12);
}

.dex-art-frame-small {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.dex-art-frame img,
.dex-card-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dex-art-fallback {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    border: 2px solid currentColor;
    border-radius: 50%;
    color: var(--dex-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 900;
}

.dex-today-card .dex-art-fallback {
    color: #fff;
}

.dex-types,
.dex-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dex-type {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--type, #74838a);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

.dex-filter-panel {
    padding: 0;
}

.dex-filter-panel details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 21px 24px;
    cursor: pointer;
    list-style: none;
}

.dex-filter-panel summary::-webkit-details-marker { display: none; }

.dex-filter-panel summary strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
    line-height: 1.1;
}

.dex-summary-hint {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 5px 12px;
    border: 1px solid rgba(23, 61, 77, 0.18);
    border-radius: 999px;
    color: var(--dex-navy);
    font-size: 0.78rem;
    font-weight: 900;
}

.dex-summary-hint::after {
    content: "+";
    margin-left: 8px;
    font-size: 1.1rem;
}

.dex-filter-panel details[open] .dex-summary-hint::after { content: "−"; }

.dex-filter-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid rgba(23, 61, 77, 0.12);
}

.dex-filter-section {
    padding: 22px 24px;
    border-bottom: 1px solid rgba(23, 61, 77, 0.1);
}

.dex-filter-section:nth-child(odd) {
    border-right: 1px solid rgba(23, 61, 77, 0.1);
}

.dex-filter-section-wide {
    grid-column: 1 / -1;
    border-right: 0 !important;
}

.dex-filter-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.dex-filter-section-title span {
    color: var(--dex-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    font-weight: 800;
}

.dex-filter-section-title small {
    color: var(--dex-muted);
    font-size: 0.72rem;
}

.dex-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.dex-field-span-2 { grid-column: span 2; }

.dex-segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 0;
    border: 0;
}

.dex-segmented legend {
    grid-column: 1 / -1;
}

.dex-segmented label {
    position: relative;
}

.dex-segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dex-segmented span {
    display: grid;
    place-items: center;
    min-height: 42px;
    padding: 7px;
    border: 1px solid rgba(23, 61, 77, 0.18);
    border-radius: 10px;
    background: #fff;
    color: var(--dex-muted);
    font-size: 0.78rem;
    cursor: pointer;
}

.dex-segmented input:checked + span {
    border-color: var(--dex-navy);
    background: var(--dex-navy);
    color: #fff;
}

.dex-segmented input:focus-visible + span {
    outline: 3px solid rgba(236, 95, 83, 0.28);
    outline-offset: 2px;
}

.dex-filter-error {
    grid-column: 1 / -1;
    margin: 0;
    padding: 12px 24px;
    background: #fff0eb;
    color: var(--dex-coral-dark);
    font-weight: 800;
}

.dex-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 24px 22px;
}

.dex-filter-actions > span {
    margin-left: auto;
}

.dex-results-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.48fr) minmax(360px, 0.72fr);
    gap: 18px;
    align-items: start;
}

.dex-results-heading {
    align-items: center;
    margin-bottom: 17px;
}

.dex-results-heading h2 {
    font-size: 1.75rem;
}

.dex-active-summary {
    margin: 5px 0 0;
    font-size: 0.82rem;
}

.dex-result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.dex-result-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(23, 61, 77, 0.14);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(23, 61, 77, 0.055);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.dex-result-card:hover {
    transform: translateY(-3px);
    border-color: rgba(236, 95, 83, 0.35);
    box-shadow: 0 14px 28px rgba(23, 61, 77, 0.1);
}

.dex-result-card[data-selected="true"] {
    border-color: var(--dex-coral);
    box-shadow: 0 0 0 3px rgba(236, 95, 83, 0.14);
}

.dex-card-art {
    aspect-ratio: 1.35;
    background:
        linear-gradient(150deg, rgba(151, 201, 184, 0.19), rgba(245, 200, 76, 0.13)),
        var(--dex-cream);
}

.dex-card-art img {
    max-width: 150px;
    max-height: 150px;
    padding: 9px;
}

.dex-card-copy {
    padding: 13px;
}

.dex-card-copy h3 {
    margin: 3px 0 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
}

.dex-card-copy p {
    min-height: 38px;
    margin: 8px 0;
    font-size: 0.74rem;
    line-height: 1.45;
}

.dex-card-copy button {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    background: var(--dex-cream);
    color: var(--dex-navy);
    font-size: 0.76rem;
}

.dex-mono {
    margin: 0;
    color: var(--dex-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.035em;
}

.dex-empty {
    display: grid;
    place-items: center;
    min-height: 360px;
    padding: 40px 20px;
    text-align: center;
}

.dex-empty > span {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border: 3px dashed rgba(23, 61, 77, 0.28);
    border-radius: 50%;
    color: var(--dex-coral);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    font-weight: 900;
}

.dex-empty h3 { margin: 16px 0 4px; }
.dex-empty p { max-width: 520px; }

.dex-load-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
    color: var(--dex-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.dex-detail-panel {
    min-width: 0;
    max-width: 100%;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.dex-detail-toolbar {
    align-items: center;
    margin-bottom: 14px;
}

.dex-view-toggle {
    display: inline-flex;
    padding: 3px;
    border-radius: 11px;
    background: var(--dex-cream);
}

.dex-view-toggle button {
    min-height: 34px;
    padding: 5px 10px;
    background: transparent;
    color: var(--dex-muted);
    font-size: 0.73rem;
}

.dex-view-toggle button[aria-pressed="true"] {
    background: var(--dex-navy);
    color: #fff;
}

.dex-detail-actions {
    display: flex;
    gap: 7px;
}

.dex-icon-button {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid rgba(23, 61, 77, 0.16);
    background: #fff;
    color: var(--dex-navy);
    font-size: 0.72rem;
}

.dex-detail-identity {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.dex-detail-identity h2 {
    margin: 3px 0;
    font-size: 2rem;
}

.dex-detail-category {
    margin: 0 0 9px;
    font-size: 0.82rem;
}

.dex-detail-tabs {
    display: flex;
    max-width: 100%;
    gap: 6px;
    margin-top: 16px;
    overflow-x: auto;
    padding: 3px 2px 7px;
    scrollbar-width: thin;
}

.dex-detail-tabs button,
.dex-move-methods button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid rgba(23, 61, 77, 0.14);
    border-radius: 10px;
    background: #fff;
    color: var(--dex-muted);
    font-size: 0.72rem;
    font-weight: 900;
}

.dex-detail-tabs button[aria-selected="true"],
.dex-move-methods button[aria-selected="true"] {
    border-color: var(--dex-navy);
    background: var(--dex-navy);
    color: #fff;
}

.dex-detail-tab-panel {
    min-width: 0;
}

.dex-tab-note {
    margin: 10px 0 0;
    color: var(--dex-muted);
    font-size: 0.72rem;
    line-height: 1.55;
}

.dex-moves-panel {
    padding-top: 14px;
}

.dex-move-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.dex-move-field {
    display: grid;
    min-width: 0;
    gap: 5px;
    color: var(--dex-muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dex-move-field select,
.dex-move-field input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid rgba(23, 61, 77, 0.18);
    border-radius: 10px;
    background: #fff;
    color: var(--dex-ink);
    font: inherit;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: normal;
}

.dex-move-methods {
    display: flex;
    max-width: 100%;
    gap: 6px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.dex-moves-state {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(23, 61, 77, 0.13);
    border-radius: 12px;
    background: var(--dex-cream);
}

.dex-moves-state div {
    display: grid;
    gap: 2px;
}

.dex-moves-state strong,
.dex-moves-state span {
    font-size: 0.74rem;
}

.dex-moves-state span { color: var(--dex-muted); }

.dex-moves-error {
    justify-content: space-between;
    border-color: rgba(183, 70, 57, 0.28);
    background: #fff3ef;
}

.dex-spinner {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    border: 3px solid rgba(23, 61, 77, 0.16);
    border-top-color: var(--dex-coral);
    border-radius: 50%;
    animation: dex-spin 0.8s linear infinite;
}

.dex-moves-list {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

.dex-move-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px 11px;
    border: 1px solid rgba(23, 61, 77, 0.1);
    border-radius: 10px;
    background: #fff;
}

.dex-move-row strong {
    color: var(--dex-ink);
    font-size: 0.8rem;
}

.dex-move-row span {
    color: var(--dex-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.67rem;
    font-weight: 800;
}

.dex-moves-empty {
    padding: 18px 12px;
    border: 1px dashed rgba(23, 61, 77, 0.22);
    border-radius: 12px;
    color: var(--dex-muted);
    font-size: 0.76rem;
    line-height: 1.55;
    text-align: center;
}

.dex-description {
    margin: 15px 0;
    padding: 13px 14px;
    border-left: 4px solid var(--dex-coral);
    background: var(--dex-cream);
    color: var(--dex-ink) !important;
    font-size: 0.86rem;
    line-height: 1.65;
}

.dex-stats {
    display: grid;
    gap: 8px;
    padding: 14px 0;
    border-top: 1px solid rgba(23, 61, 77, 0.11);
    border-bottom: 1px solid rgba(23, 61, 77, 0.11);
}

.dex-stat-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 34px;
    gap: 9px;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 900;
}

.dex-stat-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7e1d5;
}

.dex-stat-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--dex-mint), var(--dex-navy));
}

.dex-stat-row:last-child .dex-stat-fill {
    background: linear-gradient(90deg, var(--dex-yellow), var(--dex-coral));
}

.dex-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.dex-fact {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(23, 61, 77, 0.1);
    border-radius: 11px;
    background: #fff;
}

.dex-fact span {
    display: block;
    color: var(--dex-muted);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dex-fact strong {
    display: block;
    margin-top: 3px;
    overflow-wrap: anywhere;
    color: var(--dex-ink);
    font-size: 0.78rem;
    line-height: 1.35;
}

.dex-detail-footer-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 7px;
    margin-top: 14px;
}

.dex-tool-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 12px;
}

body.dex-page .dex-tool-links a {
    display: grid;
    place-items: center;
    min-height: 38px;
    padding: 7px;
    border: 1px solid rgba(23, 61, 77, 0.14);
    border-radius: 10px;
    background: var(--dex-cream);
    color: var(--dex-navy);
    font-size: 0.72rem;
    font-weight: 900;
    text-decoration: none;
}

.dex-guide,
.dex-explainer,
.dex-examples,
.dex-faq {
    margin-top: 22px;
    padding: 34px;
    border: 1px solid rgba(23, 61, 77, 0.14);
    border-radius: var(--dex-radius-xl);
    background: rgba(255, 253, 247, 0.92);
    box-shadow: var(--dex-shadow-soft);
}

.dex-guide-heading {
    max-width: 820px;
}

.dex-guide-heading > p:last-child,
.dex-explainer > p,
.dex-explainer > div > p,
.dex-guide article p,
.dex-example-grid p,
.dex-faq p {
    color: var(--dex-muted);
    line-height: 1.78;
}

.dex-guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.dex-guide article,
.dex-example-grid article {
    padding: 22px;
    border: 1px solid rgba(23, 61, 77, 0.12);
    border-radius: 18px;
    background: #fff;
}

.dex-guide article > span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--dex-coral);
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 900;
}

.dex-guide article h3,
.dex-example-grid h3 {
    margin: 16px 0 7px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
}

.dex-two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.5fr);
    gap: 30px;
    align-items: center;
}

.dex-callout {
    padding: 24px;
    border-radius: 18px;
    background: #fff2df;
    border: 1px solid rgba(245, 200, 76, 0.45);
}

.dex-callout-dark {
    background: var(--dex-navy);
    border-color: var(--dex-navy);
    color: #fff;
}

.dex-callout strong {
    display: block;
    margin-bottom: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2rem;
}

.dex-callout-dark p { color: rgba(255,255,255,0.76) !important; }

.dex-callout code {
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(23, 61, 77, 0.08);
    color: var(--dex-navy);
}

.dex-example-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.dex-example-grid article:nth-child(1) { border-top: 5px solid var(--dex-yellow); }
.dex-example-grid article:nth-child(2) { border-top: 5px solid var(--dex-coral); }
.dex-example-grid article:nth-child(3) { border-top: 5px solid var(--dex-mint); }
.dex-example-grid article:nth-child(4) { border-top: 5px solid var(--dex-navy); }

.dex-faq-list {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.dex-faq details {
    border: 1px solid rgba(23, 61, 77, 0.12);
    border-radius: 14px;
    background: #fff;
}

.dex-faq summary {
    padding: 16px 18px;
    color: var(--dex-ink);
    font-weight: 900;
    cursor: pointer;
}

.dex-faq p {
    margin: 0;
    padding: 0 18px 18px;
}

.dex-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1320px;
    margin: 0 auto;
    padding: 30px 20px 42px;
    color: var(--dex-muted);
}

.dex-footer > div {
    display: grid;
}

.dex-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

body.dex-page .dex-footer a {
    color: var(--dex-navy);
    font-weight: 800;
}

[hidden] { display: none !important; }

@keyframes dex-spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
    .dex-hero,
    .dex-top-grid,
    .dex-results-layout {
        grid-template-columns: 1fr;
    }

    .dex-hero-ledger {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dex-hero-ledger div { min-height: 95px; }

    .dex-results-layout {
        align-items: stretch;
    }

    .dex-detail-panel {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .dex-result-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

    .dex-example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .dex-main { width: min(100% - 24px, 1320px); }

    .dex-hero {
        padding: 28px;
    }

    .dex-hero-ledger {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dex-filter-form {
        grid-template-columns: 1fr;
    }

    .dex-filter-section,
    .dex-filter-section-wide {
        grid-column: 1;
        border-right: 0 !important;
    }

    .dex-result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .dex-guide-grid,
    .dex-two-column {
        grid-template-columns: 1fr;
    }

    .dex-guide,
    .dex-explainer,
    .dex-examples,
    .dex-faq { padding: 26px; }
}

@media (max-width: 620px) {
    body.dex-page .site-header-unified {
        padding-top: 8px;
    }

    body.dex-page .site-header-unified .site-header-inner {
        margin: 0 10px;
        padding: 10px 12px;
        border-radius: 18px;
    }

    body.dex-page .site-header-unified .site-logo {
        font-size: 1.05rem;
    }

    .dex-logo-mark { width: 31px; height: 31px; }

    body.dex-page .route-pills {
        flex-wrap: nowrap;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    body.dex-page .route-pills a {
        flex: 0 0 auto;
        min-height: 44px;
    }

    .dex-breadcrumb { font-size: 0.76rem; }

    .dex-hero {
        padding: 23px 20px;
        border-radius: 22px;
    }

    body.dex-page .dex-hero h1 {
        font-size: clamp(2.15rem, 12vw, 3.35rem);
    }

    .dex-hero-tags span { font-size: 0.69rem; }

    .dex-hero-ledger div {
        min-height: 82px;
        padding: 14px;
    }

    .dex-hero-ledger strong { font-size: 1.65rem; }

    .dex-system-card {
        align-items: flex-start;
        justify-content: flex-start;
        padding: 16px;
    }

    .dex-error {
        display: grid;
    }

    .dex-quick-panel,
    .dex-today-card,
    .dex-results-panel,
    .dex-detail-panel { padding: 18px; }

    .dex-quick-form {
        grid-template-columns: 1fr;
    }

    .dex-quick-actions {
        grid-template-columns: 1fr 1fr;
    }

    .dex-today-body {
        grid-template-columns: 105px minmax(0, 1fr);
        gap: 13px;
    }

    .dex-today-body h3 { font-size: 1.45rem; }
    .dex-today-body p { font-size: 0.76rem; }

    .dex-filter-panel details:not([open]) .dex-filter-form { display: none; }

    .dex-filter-panel details > summary {
        padding: 18px;
    }

    .dex-filter-panel summary strong { font-size: 1.25rem; }

    .dex-summary-hint {
        padding: 5px 8px;
        font-size: 0;
    }

    .dex-summary-hint::before {
        content: "Filters";
        font-size: 0.72rem;
    }

    .dex-filter-section { padding: 18px; }

    .dex-filter-grid,
    .dex-stat-filter-grid {
        grid-template-columns: 1fr;
    }

    .dex-field-span-2 { grid-column: 1; }

    .dex-segmented {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dex-filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 16px 18px 20px;
    }

    .dex-filter-actions > span {
        grid-column: 1 / -1;
        margin: 0;
    }

    .dex-results-heading {
        align-items: flex-start;
    }

    .dex-results-heading .dex-button {
        padding: 9px 10px;
        font-size: 0.72rem;
    }

    .dex-result-grid { grid-template-columns: 1fr; }

    .dex-result-card button,
    .dex-text-button,
    .dex-recent button,
    .dex-view-toggle button,
    .dex-detail-tabs button,
    .dex-move-methods button,
    .dex-icon-button {
        min-height: 44px;
    }

    .dex-result-card {
        display: grid;
        grid-template-columns: 118px minmax(0, 1fr);
    }

    .dex-card-art {
        aspect-ratio: auto;
        min-height: 154px;
    }

    .dex-card-art img {
        max-width: 112px;
        max-height: 112px;
    }

    .dex-card-copy h3 { white-space: normal; }

    .dex-load-row {
        flex-direction: column;
    }

    .dex-detail-identity {
        grid-template-columns: 120px minmax(0, 1fr);
    }

    .dex-detail-identity h2 { font-size: 1.55rem; }

    .dex-facts { grid-template-columns: 1fr; }

    .dex-move-controls {
        grid-template-columns: 1fr;
    }

    .dex-moves-error {
        align-items: stretch;
        flex-direction: column;
    }

    .dex-detail-footer-actions {
        grid-template-columns: 1fr 1fr;
    }

    .dex-detail-footer-actions #dexCry {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .dex-guide,
    .dex-explainer,
    .dex-examples,
    .dex-faq {
        padding: 22px 18px;
        border-radius: 22px;
    }

    .dex-example-grid { grid-template-columns: 1fr; }

    .dex-footer {
        align-items: flex-start;
        flex-direction: column;
        padding-inline: 18px;
    }
}

@media (max-width: 390px) {
    .dex-main { width: calc(100% - 16px); }

    .dex-hero { padding-inline: 16px; }

    .dex-quick-actions,
    .dex-filter-actions,
    .dex-tool-links {
        grid-template-columns: 1fr;
    }

    .dex-filter-actions > span { grid-column: 1; }

    .dex-today-body {
        grid-template-columns: 90px minmax(0, 1fr);
    }

    .dex-detail-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .dex-detail-actions,
    .dex-view-toggle { width: 100%; }

    .dex-detail-actions > *,
    .dex-view-toggle > * { flex: 1; }

    .dex-detail-identity {
        grid-template-columns: 1fr;
    }

    .dex-art-frame {
        width: min(230px, 100%);
        margin: 0 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
