@font-face {
    font-family: 'Noto Sans Thai';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/static/fonts/noto-sans-thai/noto-sans-thai-var-thai.woff2') format('woff2');
    unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
    font-family: 'Noto Sans Thai';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/static/fonts/noto-sans-thai/noto-sans-thai-var-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Noto Sans Thai';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/static/fonts/noto-sans-thai/noto-sans-thai-var-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
    --bg: #fdfaf7;
    --surface: color-mix(in srgb, var(--surface-strong) 88%, transparent);
    --surface-strong: #ffffff;
    --surface-muted: #f5f5f4;
    --ink: #1c1917;
    --muted: #78716c;
    --accent: #e11d48;
    --accent-bright: #f43f5e;
    --accent-deep: #be123c;
    --accent-2: #fb923c;
    --accent-2-deep: #c2410c;
    --grad-accent: linear-gradient(90deg, #f43f5e, #fb923c);
    --line: rgba(28, 25, 23, 0.12);
    --line-strong: #d6d3d1;
    --shadow: 0 8px 24px rgba(28, 25, 23, 0.07);
    --ok: #047857;
    --ok-bright: #10b981;
    --ok-deep: #065f46;
    --info: #0369a1;
    --info-bright: #38bdf8;
    --warn: #b45309;
    --warn-bright: #f59e0b;
    --warn-deep: #92400e;
    --danger: #b91c1c;
    --danger-bright: #ef4444;
}

html.dark {
    --bg: #0c0a09;
    --surface: rgba(28, 25, 23, 0.88);
    --surface-strong: #1c1917;
    --surface-muted: #292524;
    --ink: #f5f5f4;
    --muted: #a8a29e;
    --accent: #f43f5e;
    --accent-bright: #fb7185;
    --accent-deep: #fda4af;
    --accent-2: #fdba74;
    --accent-2-deep: #fb923c;
    --line: rgba(245, 245, 244, 0.14);
    --line-strong: #44403c;
    --shadow: 0 8px 24px rgb(0 0 0 / 45%);
    --ok: #34d399;
    --ok-bright: #10b981;
    --ok-deep: #6ee7b7;
    --info: #38bdf8;
    --info-bright: #7dd3fc;
    --warn: #fbbf24;
    --warn-bright: #f59e0b;
    --warn-deep: #fcd34d;
    --danger: #f87171;
    --danger-bright: #ef4444;
    color-scheme: dark;
}

html {
    scrollbar-gutter: stable;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow-y: scroll;
    font-family: "Noto Sans Thai", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
}

body.sync-busy {
    overflow: hidden;
}

a {
    color: var(--accent-deep);
}

.page-shell {
    max-width: 1160px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.site-disclaimer {
    margin-top: 36px;
    padding: 18px 22px 0;
    border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
    color: var(--muted);
    text-align: center;
}

.site-disclaimer p {
    max-width: 76ch;
    margin: 0 auto;
    font-size: 0.92rem;
    line-height: 1.65;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.site-header-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.site-header h1,
.site-header .site-brand {
    margin: 0;
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1;
    white-space: nowrap;
}
.draw-pager {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.site-header h1 a,
.site-header .site-brand a {
    color: transparent;
    background: linear-gradient(90deg, #e11d48, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    text-decoration: none;
}

.site-header nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
}
.site-header nav a {
    display: inline-flex;
    align-items: center;
    color: var(--accent-deep);
    text-decoration: none;
    padding: 7px 11px;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: background 0.15s ease;
}
.site-header nav a:hover {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.site-header nav a.active {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    font-weight: 700;
}
.footer-admin-link {
    margin-top: 10px;
    font-size: 0.85rem;
}
.footer-admin-link a {
    color: var(--muted);
}

.admin-nav-card {
    padding: 14px 18px;
    margin-bottom: 24px;
    background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
}

.admin-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 12px;
}

.admin-nav-header h3 {
    margin: 0;
    font-size: 1.12rem;
}

.admin-nav-current {
    margin: 0;
    color: var(--muted);
    text-align: right;
    font-size: 0.88rem;
}

.admin-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px 20px;
}

.admin-nav-group {
    display: grid;
    gap: 8px;
}

.admin-nav-group .eyebrow {
    margin-bottom: 0;
}

.admin-nav-links {
    display: grid;
    gap: 8px;
}

.admin-nav-link {
    display: grid;
    gap: 2px;
    align-content: center;
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 62%, transparent);
    color: var(--accent-deep);
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.admin-nav-link-title {
    font-size: 0.95rem;
    line-height: 1.15;
}

.admin-nav-link-meta {
    color: var(--muted);
    font-size: 0.79rem;
    line-height: 1.25;
    font-weight: 500;
}

.admin-nav-link:hover {
    transform: translateY(-1px);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface-strong));
    border-color: color-mix(in srgb, var(--accent) 24%, transparent);
}

.admin-nav-link.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--accent-deep) 16%, transparent);
}

.admin-nav-link.is-active .admin-nav-link-meta {
    color: color-mix(in srgb, var(--surface-strong) 86%, transparent);
}

.nav-inline-form {
    margin: 0;
}

.button-link,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--grad-accent);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 28%, transparent);
    transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.button-link:hover,
button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.secondary-link,
.secondary-link:hover {
    background: var(--surface-muted);
    color: var(--accent-deep);
    box-shadow: none;
    filter: none;
}

.secondary-link:hover {
    background: var(--line-strong);
    transform: translateY(-1px);
}

.theme-toggle,
.theme-toggle:hover {
    background: var(--surface-strong);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 6px 9px;
    font-size: 1rem;
    line-height: 1;
    box-shadow: none;
    filter: none;
}

.theme-toggle:hover {
    transform: translateY(-1px) scale(1.06);
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.flash-message {
    border-radius: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
}

.flash-success {
    border-color: color-mix(in srgb, var(--ok) 28%, transparent);
    background: color-mix(in srgb, var(--ok-bright) 14%, var(--surface-strong));
}

.flash-error {
    border-color: color-mix(in srgb, var(--danger) 22%, transparent);
    background: color-mix(in srgb, var(--danger) 10%, var(--surface-strong));
}

.flash-info {
    border-color: color-mix(in srgb, var(--info) 22%, transparent);
    background: color-mix(in srgb, var(--info-bright) 14%, var(--surface-strong));
}

.hero,
.card {
    border: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    border-radius: 18px;
}

.hero {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 28px;
    padding: 30px;
    margin-bottom: 28px;
}

.hero h1,
.hero h2 {
    margin: 0;
    font-size: clamp(2rem, 3.6vw, 4rem);
    line-height: 0.95;
}

.hero-copy {
    max-width: 58ch;
    margin-top: 14px;
    color: var(--muted);
    font-size: 1.05rem;
}

.hero-panel {
    display: grid;
    gap: 0;
    align-self: start;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 4px 18px;
}
.hero-panel .stat-chip {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    background: none;
    border: none;
    border-radius: 0;
    padding: 13px 0;
}
.hero-panel .stat-chip + .stat-chip {
    border-top: 1px solid var(--line);
}
.hero-panel .stat-chip .label {
    margin: 0;
    white-space: nowrap;
}
.hero-panel .stat-chip strong {
    font-size: 1.05rem;
    text-align: right;
    white-space: nowrap;
}

.stat-chip {
    border-radius: 20px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    padding: 18px;
}

.stat-chip .label {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.stat-chip strong {
    font-size: 1.5rem;
}

.card {
    padding: 24px;
    margin-bottom: 24px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 18px;
}

.section-heading h1,
.section-heading h2,
.section-heading h3 {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 2.2rem);
}

.section-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.section-actions form {
    margin: 0;
}

.section-actions .button-link,
.section-actions button {
    white-space: nowrap;
}

.table-wrap {
    overflow-x: auto;
}

.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.pagination-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.pagination-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.award-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.random-hero {
    align-items: start;
}

.random-hero h1,
.random-hero h2 {
    font-size: clamp(1.45rem, 2.2vw, 2.4rem);
    line-height: 1;
    max-width: none;
    white-space: nowrap;
}

.random-hero .stat-chip .label {
    font-size: 0.88rem;
}

.random-generator-form {
    display: flex;
    align-items: end;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.random-generator-control {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.random-generator-control select {
    min-width: 150px;
    margin-left: 0;
}

.random-generator-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.random-results-note {
    margin-top: 14px;
}

.random-inline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.random-inline-meta-compact {
    justify-content: flex-end;
    margin-top: 0;
}

.random-inline-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
    color: var(--ink);
    font-size: 0.92rem;
}

.random-inline-link {
    color: var(--accent-deep);
    text-decoration: none;
}

.random-inline-link:hover {
    border-color: color-mix(in srgb, var(--accent) 28%, transparent);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.random-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 18px;
    align-items: start;
}

.random-result-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    background: var(--surface-strong);
    display: grid;
    gap: 14px;
}

.random-result-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.random-card-eyebrow {
    margin-bottom: 8px;
}

.random-result-number {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    line-height: 0.92;
    letter-spacing: 0.08em;
    color: var(--accent-deep);
}

.random-score-badge {
    display: grid;
    gap: 2px;
    text-align: right;
}

.random-score-badge .label {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.random-score-badge strong {
    font-size: 1rem;
    color: var(--accent-deep);
}

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

.random-result-stat,
.random-signal-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
    padding: 12px 14px;
    display: grid;
    gap: 6px;
}

.random-result-stat .label,
.random-signal-card .label {
    color: var(--muted);
    font-size: 0.84rem;
}

.random-result-stat strong,
.random-signal-card strong {
    font-size: 1rem;
}

.random-result-stat-wide {
    grid-column: span 2;
}

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

.random-reason-block {
    display: grid;
    gap: 10px;
}

.random-reason-heading {
    margin: 0;
    font-weight: 700;
}

.random-reason-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.random-reason-list li {
    border-radius: 14px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    padding: 10px 12px;
    color: var(--ink);
}

.random-signal-chip {
    display: flex;
    align-items: center;
}

.random-signal-overview {
    margin-top: 18px;
}

.random-signal-chip strong {
    font-size: 1.05rem;
}

.random-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.random-scoring-panel {
    display: grid;
}

.random-scoring-summary {
    cursor: pointer;
    list-style: none;
    align-items: center;
    margin-bottom: 0;
}

.random-scoring-summary::-webkit-details-marker {
    display: none;
}

.random-scoring-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--ink) 4%, transparent);
    color: var(--muted);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.random-scoring-toggle::before {
    content: "+";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -54%);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.random-scoring-panel[open] .random-scoring-toggle::before {
    content: "−";
}

.random-scoring-summary:hover .random-scoring-toggle,
.random-scoring-panel[open] .random-scoring-toggle {
    background: color-mix(in srgb, var(--accent) 9%, transparent);
    border-color: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent-deep);
}

.random-scoring-panel[open] .random-scoring-summary {
    margin-bottom: 18px;
}

.random-scoring-body {
    display: grid;
}

.random-backtest-summary-grid {
    margin-bottom: 18px;
}

.random-weight-subheading {
    margin-top: 10px;
}

.random-weight-grid {
    margin-bottom: 18px;
}

.random-weight-chip {
    align-content: start;
    display: grid;
    gap: 10px;
}

.random-weight-chip-inactive {
    opacity: 0.86;
    background: color-mix(in srgb, var(--surface-strong) 55%, transparent);
}

.random-weight-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.random-weight-title {
    display: block;
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--ink);
}

.random-weight-key {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    word-break: break-word;
}

.random-weight-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--ink) 5%, transparent);
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 700;
}

.random-weight-badge-positive {
    border-color: color-mix(in srgb, var(--ok-bright) 25%, transparent);
    background: color-mix(in srgb, var(--ok-bright) 14%, var(--surface-strong));
    color: var(--ok);
}

.random-weight-badge-negative {
    border-color: color-mix(in srgb, var(--accent-bright) 25%, transparent);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface-strong));
    color: var(--accent-deep);
}

.random-weight-badge-inactive {
    color: var(--muted);
}

.random-weight-description {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.random-weight-meta {
    margin: 0;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    align-items: baseline;
    color: var(--muted);
    font-size: 0.9rem;
}

.random-backtest-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.random-subheading {
    margin-top: 8px;
}

.random-score-band-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.random-score-band-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
    padding: 14px;
    display: grid;
    gap: 10px;
}

.random-score-band-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}

.random-score-band-head strong {
    font-size: 1rem;
    color: var(--ink);
}

.random-score-band-head span {
    color: var(--muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.random-score-band-bar {
    height: 10px;
}

.random-score-band-fill {
    background: linear-gradient(90deg, var(--accent-bright), var(--accent-deep));
}

.random-band-driver-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.random-band-driver-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
    padding: 16px;
    display: grid;
    gap: 12px;
}

.random-band-driver-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.random-band-driver-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    padding: 10px 12px;
}

.random-band-driver-item-muted {
    background: color-mix(in srgb, var(--ink) 5%, transparent);
    color: var(--muted);
}

.random-band-driver-label {
    color: var(--ink);
}

.random-band-driver-item-muted .random-band-driver-label,
.random-band-driver-item-muted .random-band-driver-share {
    color: var(--muted);
}

.random-band-driver-share {
    color: var(--accent-deep);
    white-space: nowrap;
}

.random-markov-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.random-markov-card {
    align-content: start;
}

.random-markov-list {
    gap: 10px;
}

.random-backtest-table-wrap {
    margin-top: 4px;
}

.random-backtest-table {
    min-width: 920px;
}

.random-backtest-table th,
.random-backtest-table td {
    white-space: nowrap;
}

.random-backtest-table-number {
    font-weight: 700;
    color: var(--accent-deep);
    letter-spacing: 0.08em;
}

.random-backtest-table-number a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed color-mix(in srgb, var(--ink) 28%, transparent);
}

.random-backtest-table-number a:hover {
    border-bottom-color: color-mix(in srgb, var(--ink) 62%, transparent);
}

.random-backtest-reason {
    white-space: normal;
    min-width: 300px;
}

.random-pattern-compare-table {
    min-width: 760px;
}

.random-pattern-label {
    font-weight: 700;
    color: var(--ink);
}

.random-delta-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--muted);
    background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.random-delta-badge-positive {
    border-color: color-mix(in srgb, var(--ok-bright) 25%, transparent);
    background: color-mix(in srgb, var(--ok-bright) 14%, var(--surface-strong));
    color: var(--ok);
}

.random-delta-badge-negative {
    border-color: color-mix(in srgb, var(--accent-bright) 25%, transparent);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface-strong));
    color: var(--accent-deep);
}

.random-delta-badge-neutral {
    color: var(--muted);
}

.random-delta-badge-high {
    border-color: color-mix(in srgb, var(--accent-bright) 32%, transparent);
    background: color-mix(in srgb, var(--accent-bright) 12%, var(--surface-strong));
    color: var(--accent-deep);
}

.random-delta-badge-medium {
    border-color: color-mix(in srgb, var(--warn) 28%, transparent);
    background: color-mix(in srgb, var(--warn-bright) 14%, var(--surface-strong));
    color: var(--warn-deep);
}

.random-top-pool-row-high {
    background: color-mix(in srgb, var(--accent-bright) 4.5%, transparent);
}

.random-top-pool-row-medium {
    background: color-mix(in srgb, var(--warn) 5%, transparent);
}

.random-backtest-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.84rem;
    color: var(--muted);
    background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.random-backtest-badge-hit {
    border-color: color-mix(in srgb, var(--ok-bright) 25%, transparent);
    background: color-mix(in srgb, var(--ok-bright) 14%, var(--surface-strong));
    color: var(--ok);
}

.random-summary-chip {
    height: 100%;
}

.random-note {
    margin: 0;
    color: var(--muted);
}

.award-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
    background: var(--surface-strong);
}

.draw-award-layout {
    display: grid;
    gap: 22px;
}

.draw-award-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 18px;
}

.draw-award-stack {
    display: grid;
    gap: 18px;
    align-content: start;
}

.draw-award-bottom-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.award-card-featured {
    padding: 22px;
}

.award-card h3 {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 1.1rem;
}

.award-number-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.award-number-list li {
    border-radius: 16px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    padding: 12px 14px;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent-deep);
}

.filter-panel {
    display: grid;
    gap: 18px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.checkbox-card {
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    border-radius: 18px;
    padding: 14px 16px;
}

.actions-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.stats-search-row {
    display: flex;
    align-items: end;
    gap: 14px;
    flex-wrap: wrap;
}

.stats-search-label {
    display: grid;
    gap: 8px;
    min-width: min(100%, 320px);
    font-weight: 700;
}

.stats-search-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

input[type="date"],
input[type="number"],
input[type="search"],
input[type="text"],
input[type="password"],
select {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    background: var(--surface-strong);
    margin-left: 8px;
}

.check-prize-form {
    display: grid;
    gap: 14px;
}

.check-prize-form label {
    font-weight: 700;
}

.check-prize-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.check-prize-controls select {
    min-width: min(100%, 320px);
    margin-left: 0;
}

.check-prize-results-layout {
    display: grid;
    gap: 26px;
}

.check-prize-highlight-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.check-prize-secondary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.check-prize-secondary-stack {
    display: grid;
    gap: 22px;
}

.compact-award-card {
    display: grid;
    gap: 18px;
    align-content: start;
    min-height: 100%;
    min-width: 0;
}

.compact-award-card h3 {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-award-card-featured h3 {
    font-size: 1.05rem;
}

.compact-award-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 22px 10px;
    align-items: center;
}

.compact-award-list-featured {
    display: grid;
    grid-template-columns: max-content;
    justify-content: start;
    justify-items: start;
}

.compact-award-item {
    padding: 0;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent-deep);
    line-height: 1;
}

.compact-award-item-featured {
    display: inline-block;
    min-width: 0;
    text-align: left;
    font-size: clamp(2.3rem, 4.5vw, 3.2rem);
    letter-spacing: 0.1em;
}

.line-award-card {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.line-award-card h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .compact-award-card h3,
    .compact-award-card-featured h3,
    .line-award-card h3 {
        font-size: 0.82rem;
    }
}

.line-award-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 22px 14px;
    justify-content: flex-start;
}

.line-award-list li {
    min-width: 0;
    text-align: left;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent-deep);
    line-height: 1;
}

.stats-search-input {
    min-width: min(100%, 320px);
    width: 100%;
    margin-left: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    background: var(--surface-strong);
    color: var(--ink);
    font: inherit;
    line-height: 1.35;
    box-shadow: inset 0 1px 2px color-mix(in srgb, var(--ink) 4%, transparent);
}

.stats-search-input::placeholder {
    color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.stats-search-input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--accent) 42%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.three-digit-stats-table th {
    padding: 14px 10px;
    text-align: left;
    vertical-align: bottom;
    border-bottom: 1px solid var(--line);
}

.three-digit-stats-table .stats-col-rank,
.three-digit-stats-table .stats-col-number,
.three-digit-stats-table .stats-col-total {
    text-align: center;
}

.three-digit-stats-table .stats-col-rank {
    width: 88px;
    white-space: nowrap;
}

.three-digit-stats-table .stats-col-number {
    min-width: 132px;
}

.three-digit-stats-table .stats-col-total {
    width: 140px;
    white-space: nowrap;
}

.three-digit-stats-table .stats-col-breakdown {
    min-width: 240px;
}

.three-digit-stats-root {
    display: grid;
    gap: 0;
}

.three-digit-stats-root.stats-loading {
    opacity: 0.72;
    transition: opacity 0.18s ease;
}

.form-card {
    max-width: 680px;
}

.date-form {
    display: grid;
    gap: 14px;
}

.date-form label {
    font-weight: 700;
}

.status-pill {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid var(--line);
}

.status-pending {
    background: color-mix(in srgb, var(--warn-bright) 22%, transparent);
    color: var(--warn-deep);
}

.status-completed {
    background: color-mix(in srgb, var(--ok-bright) 18%, transparent);
    color: var(--ok);
}

.status-failed {
    background: color-mix(in srgb, var(--danger) 16%, transparent);
    color: var(--danger);
}

.status-completed_with_errors {
    background: color-mix(in srgb, var(--warn) 18%, transparent);
    color: var(--warn-deep);
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.table-actions form {
    margin: 0;
}

.table-actions a,
.table-actions button {
    font-size: 0.86rem;
    padding: 8px 12px;
}

.table-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
    color: var(--accent-deep);
}

.danger-button {
    background: var(--danger);
}

.message-cell {
    max-width: 280px;
    color: var(--muted);
}

.results-note {
    color: var(--muted);
    font-size: 0.95rem;
}

.results-summary {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.breakdown-list {
    display: grid;
    gap: 8px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.breakdown-label {
    color: var(--ink);
}

.breakdown-count {
    color: var(--accent-deep);
    font-weight: 700;
    white-space: nowrap;
}

.stats-number-main,
.number-cell {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.permutation-members {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.three-digit-stats-table .permutation-members {
    justify-content: center;
}

.permutation-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    background: color-mix(in srgb, var(--ink) 6%, transparent);
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
}

.permutation-chip-button {
    border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
    cursor: pointer;
}

.permutation-chip-button:hover {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.permutation-chip-disabled {
    border: 1px dashed color-mix(in srgb, var(--ink) 14%, transparent);
    background: color-mix(in srgb, var(--ink) 3%, transparent);
    color: color-mix(in srgb, var(--muted) 62%, transparent);
    cursor: not-allowed;
    opacity: 0.78;
}

.hidden {
    display: none !important;
}

.support-dock {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9980;
}




.support-dock-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
    background: color-mix(in srgb, var(--surface-strong) 97%, transparent);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 12%, transparent);
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.86rem;
    white-space: nowrap;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.support-dock-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px color-mix(in srgb, var(--ink) 12%, transparent);
    background: var(--surface-strong);
}

.support-dock-link svg {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}
.support-qr-modal {
    width: min(480px, 100%);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
}
.support-qr-body {
    display: grid;
    justify-items: center;
    margin-top: 16px;
}
.support-qr-image {
    display: block;
    width: auto;
    max-width: min(100%, 380px);
    max-height: min(56dvh, 520px);
    height: auto;
    border-radius: 24px;
    box-shadow: 0 20px 42px color-mix(in srgb, var(--ink) 14%, transparent);
    background: var(--surface-strong);
}
.support-qr-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 160px));
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}
.support-qr-dismiss,
.support-qr-save {
    width: 100%;
}

.scroll-top-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9990;
    width: 48px;
    height: 48px;
    border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-strong) 96%, transparent);
    color: var(--ink);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--ink) 12%, transparent);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.scroll-top-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px color-mix(in srgb, var(--ink) 16%, transparent);
    background: var(--surface-strong);
}

.scroll-top-button:active {
    transform: translateY(0);
}

.stats-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: color-mix(in srgb, var(--ink) 45%, transparent);
}

.stats-detail-modal {
    width: min(560px, 100%);
    border-radius: 28px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 98%, transparent);
    box-shadow: 0 28px 80px color-mix(in srgb, var(--ink) 18%, transparent);
    padding: 24px;
}

.stats-detail-close {
    border: none;
}

.search-highlight {
    background: color-mix(in srgb, var(--warn-bright) 80%, var(--surface-strong));
    color: var(--ink);
    padding: 0 2px;
    border-radius: 4px;
}

.first-prize-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.subtab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subtab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 16px;
    background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
    color: var(--accent-deep);
    text-decoration: none;
    font-size: 0.95rem;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.subtab-link:hover {
    background: var(--surface-muted);
    transform: translateY(-1px);
}

.subtab-link-active {
    border-color: color-mix(in srgb, var(--accent-deep) 28%, transparent);
    background: var(--accent);
    color: #fff;
}

.first-prize-position-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.first-prize-position-card {
    margin-bottom: 0;
}
.first-prize-markov-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}
.first-prize-markov-filter {
    display: grid;
    gap: 6px;
    font-weight: 700;
    color: var(--ink);
}
.first-prize-markov-filter span {
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}
.first-prize-markov-filter select {
    min-width: min(100%, 320px);
    margin-left: 0;
}
.first-prize-markov-card {
    display: grid;
    gap: 14px;
    align-content: start;
}
.first-prize-markov-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}
.first-prize-markov-head h4 {
    margin: 4px 0 0;
    font-size: 1.05rem;
}
.first-prize-markov-source {
    display: grid;
    gap: 4px;
    justify-items: end;
    text-align: right;
}
.first-prize-markov-source-label {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}
.first-prize-markov-source strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    max-width: 100%;
    min-height: 42px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--accent-deep);
    font-size: 1rem;
    line-height: 1.1;
    padding: 0 10px;
    white-space: nowrap;
    box-sizing: border-box;
}
.first-prize-position-card .first-prize-markov-source strong {
    min-width: auto;
    font-size: 1rem;
}
.first-prize-position-card .markov-collapse {
    margin-top: 10px;
}
.first-prize-markov-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}
.first-prize-markov-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    padding: 10px 12px;
}
.first-prize-markov-item-hit {
    border-color: color-mix(in srgb, var(--accent-deep) 28%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-bright) 18%, transparent), color-mix(in srgb, var(--accent-2) 24%, transparent));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface-strong) 36%, transparent);
}
.first-prize-markov-digit {
    color: var(--ink);
}
.first-prize-markov-source strong {
    gap: 0.3em;
}
.markov-from {
    opacity: 0.45;
    font-weight: 400;
}
.markov-to {
    font-weight: 700;
}
.first-prize-markov-meta {
    color: var(--accent-deep);
    white-space: nowrap;
    font-size: 0.95rem;
}
.markov-collapse {
    margin-top: -2px;
}
.markov-collapse summary {
    cursor: pointer;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--accent-deep);
    font-weight: 700;
    padding: 8px 12px;
}
.markov-collapse summary::-webkit-details-marker {
    display: none;
}
.markov-collapse[open] summary {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}
.markov-collapse-list {
    margin-top: 8px;
}

.next-draw-summary-grid {
    margin-bottom: 20px;
}

.next-draw-history-table {
    min-width: 960px;
}

.next-draw-col-rank {
    width: 72px;
}

.next-draw-history-table td {
    white-space: nowrap;
}

.next-draw-history-date {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    color: var(--ink);
    font-weight: 600;
}

.next-draw-history-date-stack {
    display: grid;
    gap: 6px;
}

.next-draw-history-date-strong {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-color: color-mix(in srgb, var(--accent-deep) 22%, transparent);
    color: var(--accent-deep);
}

.next-draw-history-shift-note {
    color: var(--muted);
    font-size: 0.85rem;
}

.next-draw-history-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 140px;
}

.next-draw-history-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
    color: var(--accent-deep);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.next-draw-history-chip-featured {
    border-color: color-mix(in srgb, var(--accent-deep) 28%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-bright) 18%, transparent), color-mix(in srgb, var(--accent-2) 24%, transparent));
}

.next-draw-history-empty {
    color: var(--muted);
}

.public-top50-summary-grid {
    margin-bottom: 20px;
}

.public-top50-table {
    min-width: 900px;
}

.public-top50-number {
    font-weight: 700;
    color: var(--accent-deep);
    letter-spacing: 0.05em;
}

.public-top50-note {
    margin-top: 14px;
}

.digit-frequency-list {
    display: grid;
    gap: 10px;
}

.digit-frequency-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
}

.digit-frequency-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    font-weight: 700;
    color: var(--accent-deep);
}

.digit-frequency-bar {
    position: relative;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.digit-frequency-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-bright), var(--accent-deep));
}

.digit-frequency-count,
.digit-frequency-percent {
    white-space: nowrap;
    font-size: 0.95rem;
}

.digit-frequency-count {
    font-weight: 700;
    color: var(--accent-deep);
}

.digit-frequency-percent {
    color: var(--muted);
}

.parity-breakdown {
    display: grid;
    gap: 14px;
}

.frequency-summary-card {
    display: grid;
    gap: 10px;
}

.frequency-summary-card .label {
    font-weight: 700;
    color: var(--ink);
}

.frequency-summary-card > strong {
    display: block;
    width: 100%;
    text-align: center;
}

.frequency-summary-card .random-note {
    text-align: center;
}

.drought-summary-card {
    display: grid;
    gap: 10px;
}

.drought-summary-card .label {
    font-weight: 700;
    color: var(--ink);
}

.drought-summary-card > strong {
    display: block;
    width: 100%;
    text-align: center;
}

.drought-summary-card .random-note {
    text-align: center;
}

.parity-summary-card {
    display: grid;
    gap: 10px;
}

.parity-summary-card .label {
    font-weight: 700;
    color: var(--ink);
}

.parity-summary-card > strong {
    display: block;
    width: 100%;
    text-align: center;
}

.parity-compact-breakdown {
    display: grid;
    gap: 10px;
}

.parity-compact-item {
    display: grid;
    gap: 6px;
}

.parity-compact-bar-track {
    position: relative;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.parity-compact-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
}

.parity-item {
    display: grid;
    gap: 8px;
}

.parity-item-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.parity-label {
    font-weight: 700;
    color: var(--ink);
}

.parity-text-even {
    color: var(--accent-deep);
}

.parity-text-odd {
    color: var(--ok-deep);
}

.parity-text-neutral {
    color: var(--muted);
}

.level-text-zero {
    color: var(--info);
}

.level-text-low {
    color: var(--warn);
}

.level-text-mid {
    color: var(--ok);
}

.level-text-high {
    color: var(--danger);
}

.parity-meta {
    color: var(--muted);
    font-size: 0.95rem;
    white-space: nowrap;
}

.parity-fill-even {
    background: linear-gradient(90deg, var(--accent-bright), var(--accent-deep));
}

.parity-fill-odd {
    background: linear-gradient(90deg, var(--ok-bright), var(--ok-deep));
}

.level-fill-zero {
    background: linear-gradient(90deg, var(--info-bright), var(--info));
}

.level-fill-low {
    background: linear-gradient(90deg, var(--accent-2), var(--warn));
}

.level-fill-mid {
    background: linear-gradient(90deg, var(--ok-bright), var(--ok));
}

.level-fill-high {
    background: linear-gradient(90deg, var(--danger-bright), var(--danger));
}

.level-fill-pattern {
    background: linear-gradient(90deg, var(--info-bright), var(--danger));
}

.recent-pattern-cell {
    min-width: 280px;
}

.parity-pattern-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.parity-pattern-token {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    font-weight: 700;
}

.parity-pattern-separator {
    color: var(--muted);
}

.parity-tail-pattern-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.level-tail-pattern-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.parity-tail-pattern-card {
    display: grid;
    gap: 12px;
}

.drought-list {
    display: grid;
    gap: 14px;
}

.drought-item {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface-strong) 42%, transparent);
}

.drought-item-hit {
    border-color: color-mix(in srgb, var(--accent-deep) 28%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-bright) 18%, transparent), color-mix(in srgb, var(--accent-2) 24%, transparent));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface-strong) 36%, transparent);
}

.drought-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    min-width: 38px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    font-weight: 700;
    color: var(--accent-deep);
    font-size: 1rem;
    justify-self: start;
}

.drought-item-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.drought-meta {
    display: grid;
    gap: 8px;
}

.drought-gap {
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    font-size: 0.94rem;
}

.drought-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.drought-average-side {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.9rem;
    white-space: nowrap;
    text-align: right;
}

.drought-last-seen {
    display: inline-block;
    margin-left: auto;
    color: var(--muted);
    font-size: 0.92rem;
    white-space: nowrap;
    text-align: right;
}

.drought-average-label {
    display: inline-block;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    font-size: 0.94rem;
    line-height: 1.2;
}

.drought-single-bar {
    position: relative;
    overflow: visible;
}

.drought-average-marker {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    transform: translateX(-50%);
    background: var(--accent-deep);
    border-radius: 999px;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface-strong) 65%, transparent);
}

.drought-fill {
    background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright));
}

.drought-average-bar {
    margin-top: 0;
    height: 12px;
}

.drought-average-fill {
    background: linear-gradient(90deg, var(--warn-bright), var(--warn-bright));
}

.drought-average-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.drought-history-panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-strong) 58%, transparent);
    padding: 10px 12px;
}

.drought-history-panel summary {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-deep);
    list-style: none;
}

.drought-history-panel summary::-webkit-details-marker {
    display: none;
}

.drought-history-panel[open] summary {
    margin-bottom: 10px;
}

.drought-history-list {
    display: grid;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.drought-history-item {
    display: grid;
    grid-template-columns: 114px minmax(0, 1fr) minmax(54px, auto);
    gap: 10px;
    align-items: center;
}

.drought-history-date {
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.drought-history-bar {
    height: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 8%, transparent);
    overflow: hidden;
}

.drought-history-fill {
    height: 100%;
    min-width: 10px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright));
}

.drought-history-count {
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
}

.empty-state {
    color: var(--muted);
}

@media (max-width: 800px) {
    .site-header-inner,
    .section-heading,
    .hero {
        grid-template-columns: 1fr;
        display: grid;
    }

    .site-header {
        position: static;
    }

    .site-header-inner {
        align-items: start;
        gap: 8px;
    }

    .draw-award-top-grid,
    .draw-award-bottom-grid,
    .check-prize-highlight-grid,
    .check-prize-secondary-grid,
    .parity-tail-pattern-grid,
    .random-result-meta-grid,
    .random-signal-grid,
    .random-summary-strip,
    .random-backtest-strip {
        grid-template-columns: 1fr;
    }

    .random-generator-form,
    .random-generator-actions,
    .random-result-head {
        grid-template-columns: 1fr;
        display: grid;
    }

    .random-score-badge {
        text-align: left;
    }

    .random-result-stat-wide {
        grid-column: auto;
    }

    .random-inline-meta-compact {
        justify-content: flex-start;
    }

    .digit-frequency-item {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .first-prize-markov-head,
    .first-prize-markov-item {
        display: grid;
        gap: 8px;
    }

    .first-prize-markov-filter,
    .first-prize-markov-filter select {
        width: 100%;
    }

    .next-draw-history-table {
        min-width: 860px;
    }

    .next-draw-history-cell {
        min-width: 124px;
    }

    .public-top50-table {
        min-width: 760px;
    }

    .first-prize-markov-source {
        justify-items: start;
        text-align: left;
    }

    .drought-item-head,
    .drought-history-item {
        grid-template-columns: 1fr;
        display: grid;
    }

    .drought-last-seen {
        text-align: left;
    }

    .drought-history-item {
        gap: 6px;
    }

    .scroll-top-button {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }


    .support-dock {
        left: 14px;
        bottom: 14px;
    }
    .random-hero h1,
.random-hero h2 {
        white-space: normal;
    }


    .support-qr-modal {
        max-height: calc(100dvh - 20px);
        padding: 16px;
    }

    .support-qr-body {
        margin-top: 12px;
    }

    .support-qr-image {
        max-width: min(100%, 300px);
        max-height: min(48dvh, 360px);
        border-radius: 18px;
    }

    .support-qr-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 14px;
    }

    .site-disclaimer {
        margin-top: 28px;
        padding: 16px 4px 0;
    }

    .site-disclaimer p {
        font-size: 0.88rem;
        line-height: 1.6;
    }
}

/* --- UX polish pass (2026-07-10) --- */
tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--ink) 2.5%, transparent);
}
tbody tr:hover {
    background: color-mix(in srgb, var(--accent) 5.5%, transparent);
}
.random-result-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.random-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--ink) 9%, transparent);
}
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
    outline-offset: 2px;
}
body {
    font-variant-numeric: tabular-nums;
}
select {
    font: inherit;
    color: var(--ink);
    cursor: pointer;
}
.draw-pager .secondary-link {
    padding: 9px 16px;
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

/* collapsed per-number details on the random results (2026-07-10) */
.random-result-details {
    border-top: 1px solid var(--line);
    margin: 2px -18px -16px;
    padding: 0 18px;
}
.random-result-details-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}
.random-result-details-summary::-webkit-details-marker {
    display: none;
}
.random-result-details-summary .random-scoring-toggle {
    width: 30px;
    height: 30px;
}
.random-result-details[open] .random-result-details-summary .random-scoring-toggle {
    background: color-mix(in srgb, var(--accent) 9%, transparent);
    border-color: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent-deep);
}
.random-result-details[open] .random-scoring-toggle::before {
    content: "\2212";
}
.random-result-details[open] .random-result-details-summary {
    color: var(--accent-deep);
}
.random-result-details-body {
    display: grid;
    gap: 14px;
    padding-bottom: 16px;
}

/* highlight-grid prize numbers all sized like the 1st prize (2026-07-10) */
.check-prize-highlight-grid .compact-award-item {
    font-size: clamp(2.3rem, 4.5vw, 3.2rem);
    letter-spacing: 0.1em;
}
