:root {
    color-scheme: light;
    --navy-950: #0f172a;
    --navy-800: #1e293b;
    --blue-800: #1e40af;
    --blue-600: #2563eb;
    --blue-100: #dbeafe;
    --blue-50: #eff6ff;
    --amber-500: #f59e0b;
    --amber-100: #fef3c7;
    --red-600: #dc2626;
    --red-100: #fee2e2;
    --green-600: #15803d;
    --green-100: #dcfce7;
    --slate-700: #334155;
    --slate-500: #64748b;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --white: #ffffff;
    --border: 2px solid var(--navy-950);
    --shadow: 4px 4px 0 var(--navy-950);
    --radius-sm: 0.35rem;
    --radius-md: 0.65rem;
    --radius-lg: 0.9rem;
    --shell: 76rem;
}

/* Interactive ML Lab */
.lab-page {
    padding-bottom: 5rem;
}

.lab-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 1.25rem;
}

.lab-control-panel,
.ticket-panel,
.backtest-panel {
    padding: 1.5rem;
}

.field {
    display: grid;
    gap: 0.45rem;
    color: var(--slate-500);
    font-size: 0.85rem;
    font-weight: 700;
}

.field-label-row {
    display: flex;
    min-height: 1.5rem;
    align-items: center;
    gap: 0.4rem;
}

.field-label-row label {
    cursor: pointer;
}

.parameter-help {
    position: relative;
    display: inline-flex;
}

.parameter-help-button {
    display: inline-grid;
    width: 1.3rem;
    height: 1.3rem;
    padding: 0;
    place-items: center;
    border: 1px solid var(--slate-300);
    border-radius: 50%;
    background: var(--white);
    color: var(--blue-800);
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 850;
    line-height: 1;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.parameter-help-button:hover,
.parameter-help-button:focus-visible,
.parameter-help.open .parameter-help-button {
    border-color: var(--blue-800);
    background: var(--blue-50);
}

.parameter-help-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.2);
    outline-offset: 2px;
}

.parameter-tooltip {
    position: absolute;
    z-index: 30;
    bottom: calc(100% + 0.55rem);
    left: 0;
    width: min(18rem, calc(100vw - 3rem));
    padding: 0.7rem 0.8rem;
    visibility: hidden;
    border-radius: var(--radius-sm);
    background: var(--navy-950);
    box-shadow: 3px 3px 0 var(--slate-300);
    color: var(--white);
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.25rem);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.parameter-help:hover .parameter-tooltip,
.parameter-help:focus-within .parameter-tooltip,
.parameter-help.open .parameter-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.field select,
.field input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.65rem 0.75rem;
    border: var(--border);
    border-radius: 0.65rem;
    background: var(--white);
    color: var(--navy-950);
    font: inherit;
}

.field select:focus,
.field input:focus {
    outline: 3px solid rgba(37, 99, 235, 0.15);
    border-color: var(--blue-800);
}

.strategy-description {
    min-height: 3rem;
    margin: 1rem 0;
    color: var(--slate-500);
    line-height: 1.65;
}

.parameter-grid,
.backtest-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.2rem;
}

.primary-button,
.secondary-button,
.text-button {
    min-height: 2.75rem;
    padding: 0.7rem 1rem;
    border-radius: 0.65rem;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.primary-button {
    border: var(--border);
    background: var(--blue-800);
    color: #fff;
}

.secondary-button {
    width: 100%;
    border: 2px solid var(--blue-800);
    background: transparent;
    color: var(--blue-800);
}

.text-button {
    border: var(--border);
    background: var(--white);
    color: var(--blue-800);
}

.primary-button:disabled,
.secondary-button:disabled,
.text-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.loading::after {
    content: " …";
}

.lab-ticket-balls {
    display: flex;
    min-height: 5.5rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1.2rem 0;
}

.ticket-meta {
    display: grid;
    gap: 0.7rem;
    margin: 1rem 0 1.25rem;
}

.ticket-meta div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--slate-200);
}

.ticket-meta dt {
    color: var(--slate-500);
}

.ticket-meta dd {
    margin: 0;
    font-weight: 750;
    text-align: right;
}

.backtest-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    margin: 0;
}

.job-progress {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--slate-200);
}

.job-progress > div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.job-progress progress {
    width: 100%;
    height: 0.75rem;
    accent-color: var(--blue-800);
}

.lab-message {
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    background: #eff6ff;
    color: #1e3a8a;
}

.lab-message[data-kind="success"] {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.lab-message[data-kind="error"] {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

@media (max-width: 860px) {
    .lab-grid,
    .backtest-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .parameter-grid {
        grid-template-columns: 1fr;
    }

    .lab-control-panel,
    .ticket-panel,
    .backtest-panel {
        padding: 1rem;
    }

    .lab-ticket-balls .lottery-ball {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 0.95rem;
    }

    .table-pagination {
        justify-content: space-between;
    }

    .pagination-button {
        padding-inline: 0.7rem;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
}

body {
    margin: 0;
    background: var(--slate-50);
    color: var(--navy-950);
    font-family: "Fira Sans", "Segoe UI", Arial, sans-serif;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}

button,
select {
    color: inherit;
    font: inherit;
}

a {
    color: var(--blue-800);
}

svg {
    display: block;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1000;
    padding: 0.65rem 0.9rem;
    background: var(--white);
    border: var(--border);
    color: var(--navy-950);
    font-weight: 700;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid var(--amber-500);
    outline-offset: 3px;
}

.shell {
    width: min(calc(100% - 2rem), var(--shell));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgb(248 250 252 / 94%);
    border-bottom: 2px solid var(--navy-950);
    backdrop-filter: blur(10px);
}

.nav-shell {
    min-height: 4.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--navy-950);
    font-size: 1.03rem;
    text-decoration: none;
    white-space: nowrap;
}

.brand strong {
    color: var(--blue-800);
}

.brand-mark {
    width: 2rem;
    height: 2rem;
    fill: var(--blue-800);
    stroke: var(--white);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    margin-left: auto;
}

.primary-nav a {
    padding: 0.62rem 0.72rem;
    color: var(--slate-700);
    font-size: 0.88rem;
    font-weight: 650;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.primary-nav a:hover,
.primary-nav a.active {
    background: var(--blue-50);
    color: var(--blue-800);
    border-bottom-color: var(--blue-800);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.language-switch {
    display: flex;
    padding: 0.15rem;
    background: var(--slate-200);
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-sm);
}

.lang-button {
    min-width: 2.25rem;
    padding: 0.28rem 0.4rem;
    background: transparent;
    border: 0;
    border-radius: 0.2rem;
    color: var(--slate-700);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
}

.lang-button.active {
    background: var(--white);
    color: var(--blue-800);
    box-shadow: 0 1px 2px rgb(15 23 42 / 15%);
}

.menu-button {
    display: none;
    width: 2.65rem;
    height: 2.65rem;
    align-items: center;
    justify-content: center;
    padding: 0.55rem;
    background: var(--white);
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.menu-button svg {
    width: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

main {
    min-height: 70vh;
}

.intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18rem;
    gap: 2rem;
    align-items: end;
    padding: 3.2rem 0 2rem;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--blue-800);
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.15;
}

h1 {
    max-width: 18ch;
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 5vw, 3.65rem);
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.32rem, 2vw, 1.75rem);
    letter-spacing: -0.02em;
}

h3 {
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.intro-copy,
.section-heading p,
.chart-note,
.method-card p,
.next-step p {
    color: var(--slate-500);
}

.intro-copy {
    max-width: 68ch;
    margin-bottom: 0;
    font-size: 1.05rem;
}

.product-control {
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem;
    background: var(--white);
    border: 1px solid var(--slate-300);
    border-left: 4px solid var(--blue-800);
    border-radius: var(--radius-md);
}

.product-control > span {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.product-control select {
    width: 100%;
    padding: 0.58rem 2.2rem 0.58rem 0.65rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.product-control small {
    color: var(--slate-500);
    font-size: 0.72rem;
}

.notice {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--blue-50);
    border: 1px solid var(--blue-600);
    border-radius: var(--radius-md);
}

.notice svg,
.warning-callout svg {
    flex: 0 0 auto;
    width: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notice p,
.warning-callout p {
    margin: 0;
}

.section-block {
    margin-bottom: 3.2rem;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading p {
    max-width: 67ch;
    margin-bottom: 0;
}

.section-heading-wrap {
    align-items: end;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    background: var(--green-100);
    border: 1px solid #86efac;
    border-radius: 999px;
    color: #166534;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-dot {
    width: 0.45rem;
    height: 0.45rem;
    background: var(--green-600);
    border-radius: 50%;
}

.latest-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(25rem, 1fr);
    gap: 1rem;
}

.panel {
    background: var(--white);
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px rgb(15 23 42 / 5%);
}

.draw-card {
    position: relative;
    display: flex;
    min-height: 17rem;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.4rem;
    overflow: hidden;
    background: linear-gradient(145deg, var(--navy-950), #172554);
    border: 2px solid var(--navy-950);
    color: var(--white);
    box-shadow: var(--shadow);
}

.draw-card::after {
    position: absolute;
    right: -4rem;
    bottom: -6rem;
    width: 17rem;
    height: 17rem;
    content: "";
    background: rgb(37 99 235 / 26%);
    border-radius: 50%;
}

.draw-meta {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.draw-meta div {
    display: grid;
    gap: 0.1rem;
}

.draw-meta span,
.draw-meta time,
.result-legend {
    color: #bfdbfe;
    font-size: 0.78rem;
}

.draw-meta strong {
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 1.45rem;
}

.lottery-result {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-block: 1.3rem;
}

.main-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lottery-ball {
    display: inline-grid;
    width: clamp(2.55rem, 4.5vw, 3.2rem);
    aspect-ratio: 1;
    place-items: center;
    background: var(--white);
    border: 2px solid var(--navy-950);
    border-radius: 50%;
    box-shadow: 2px 2px 0 #60a5fa;
    color: var(--navy-950);
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 800;
}

.lottery-ball-special {
    background: var(--amber-500);
    box-shadow: 2px 2px 0 #fef3c7;
}

.result-plus {
    color: #93c5fd;
    font-size: 1.2rem;
    font-weight: 800;
}

.result-legend {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 1.4rem;
}

.result-legend span:last-child::before {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.35rem;
    content: "";
    background: var(--amber-500);
    border-radius: 50%;
}

.kpi-grid,
.ml-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.kpi-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
    background: var(--white);
    border: 1px solid var(--slate-300);
    border-top: 4px solid var(--blue-600);
    border-radius: var(--radius-md);
}

.kpi-card > span {
    color: var(--slate-500);
    font-size: 0.74rem;
    font-weight: 750;
    text-transform: uppercase;
}

.kpi-card strong {
    margin: 0.3rem 0 0.2rem;
    overflow-wrap: anywhere;
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: clamp(0.92rem, 2vw, 1.15rem);
    line-height: 1.25;
}

.kpi-card small {
    color: var(--slate-500);
    font-size: 0.7rem;
}

.kpi-primary {
    background: var(--blue-50);
    border-top-color: var(--blue-800);
}

.period-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.22rem;
    background: var(--slate-200);
    border-radius: var(--radius-sm);
}

.period-tabs button {
    padding: 0.45rem 0.65rem;
    background: transparent;
    border: 0;
    border-radius: 0.25rem;
    color: var(--slate-700);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 800;
}

.period-tabs button.active {
    background: var(--navy-950);
    color: var(--white);
}

.chart-panel {
    padding: 1rem;
}

.frequency-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem 0.85rem;
}

.frequency-cell {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
    min-width: 0;
}

.frequency-number,
.frequency-count,
.frequency-deviation,
.heat-cell,
.mini-ball,
.chart-label,
.chart-value {
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
}

.frequency-number {
    font-size: 0.78rem;
    font-weight: 800;
}

.frequency-track,
.strategy-track {
    height: 0.5rem;
    overflow: hidden;
    background: var(--slate-200);
    border-radius: 999px;
}

.frequency-fill,
.strategy-track span {
    display: block;
    width: var(--bar-size);
    height: 100%;
    background: var(--blue-600);
    border-radius: inherit;
}

.frequency-count {
    color: var(--slate-700);
    font-size: 0.65rem;
}

.frequency-deviation {
    grid-column: 2 / -1;
    margin-top: -0.35rem;
    font-size: 0.59rem;
}

.positive {
    color: var(--blue-800);
}

.negative {
    color: var(--red-600);
}

.chart-note {
    margin: 0.75rem 0 0;
    font-size: 0.76rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.heatmap-panel,
.jackpot-panel,
.strategy-panel,
.methodology-panel {
    min-width: 0;
    padding: 1.15rem;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.heatmap {
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 0.32rem;
}

.heat-cell {
    display: grid;
    min-width: 0;
    aspect-ratio: 1;
    place-content: center;
    padding: 0.1rem;
    border: 1px solid rgb(15 23 42 / 18%);
    border-radius: 0.28rem;
    text-align: center;
}

.heat-cell strong {
    font-size: clamp(0.64rem, 1.5vw, 0.78rem);
}

.heat-cell span {
    font-size: 0.54rem;
    opacity: 0.7;
}

.heat-low {
    background: #dbeafe;
}

.heat-mid {
    background: #bfdbfe;
}

.heat-high {
    background: #fef3c7;
}

.heat-very-high {
    background: #fed7aa;
}

.heat-unknown {
    background: var(--slate-200);
}

.heat-legend,
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.8rem;
    color: var(--slate-500);
    font-size: 0.67rem;
}

.heat-legend span,
.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.heat-legend i,
.chart-legend i {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
}

.chart-legend {
    margin-top: 0.2rem;
}

.legend-one {
    background: var(--blue-600);
}

.legend-two {
    background: var(--amber-500);
}

.jackpot-chart {
    width: 100%;
    height: auto;
    overflow: visible;
}

.chart-grid {
    stroke: var(--slate-200);
    stroke-width: 1;
}

.chart-line {
    fill: none;
    stroke: var(--blue-600);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
}

.chart-line-two {
    stroke: var(--amber-500);
}

.chart-label {
    fill: var(--slate-500);
    font-size: 11px;
}

.chart-value {
    fill: var(--blue-800);
    font-size: 11px;
    font-weight: 800;
}

.chart-value-two {
    fill: #b45309;
}

.chart-empty {
    display: grid;
    min-height: 12rem;
    place-items: center;
    padding: 1rem;
    background: var(--slate-100);
    border: 1px dashed var(--slate-300);
    border-radius: var(--radius-md);
    color: var(--slate-500);
    text-align: center;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.table-pagination span {
    min-width: 6.5rem;
    color: var(--slate-500);
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
}

.pagination-button {
    min-height: 2.35rem;
    padding: 0.45rem 0.85rem;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.pagination-button:not(:disabled):hover {
    border-color: var(--blue-600);
    background: var(--blue-50);
}

.delete-button {
    min-height: 2.2rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--red-600);
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.delete-button:hover,
.delete-button:focus-visible {
    border-color: var(--red-600);
    background: var(--red-100);
}

.delete-button:focus-visible,
.pagination-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.2);
    outline-offset: 2px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    white-space: nowrap;
}

th,
td {
    padding: 0.72rem 0.8rem;
    border-bottom: 1px solid var(--slate-200);
    text-align: left;
    vertical-align: middle;
}

th {
    background: var(--slate-100);
    color: var(--slate-500);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: var(--blue-50);
}

.mini-balls {
    display: flex;
    gap: 0.28rem;
}

.mini-ball {
    display: inline-grid;
    width: 1.7rem;
    aspect-ratio: 1;
    place-items: center;
    background: var(--white);
    border: 1px solid var(--slate-300);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
}

.mini-ball-special {
    background: var(--amber-100);
    border-color: var(--amber-500);
}

.method-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.method-card {
    display: flex;
    gap: 0.8rem;
    min-width: 0;
    padding: 1rem;
    background: var(--white);
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-md);
}

.method-card svg {
    flex: 0 0 auto;
    width: 1.4rem;
    height: 1.4rem;
    fill: none;
    stroke: var(--blue-800);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.method-card p {
    margin-bottom: 0;
    font-size: 0.78rem;
}

.method-link {
    color: inherit;
    text-decoration: none;
}

.method-link:hover {
    border-color: var(--blue-600);
    box-shadow: 3px 3px 0 var(--blue-100);
}

.site-footer {
    margin-top: 3rem;
    padding: 1.6rem 0;
    background: var(--navy-950);
    color: var(--white);
}

.site-footer .shell {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.site-footer p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.76rem;
}

.site-footer p:first-child {
    color: var(--white);
    font-weight: 750;
}

/* Machine learning page */
.ml-intro {
    grid-template-columns: minmax(0, 1fr) 14rem;
}

.report-meta {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--navy-950);
    border: 2px solid var(--navy-950);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    color: var(--white);
}

.report-meta span,
.report-meta small {
    color: #bfdbfe;
    font-size: 0.72rem;
}

.report-meta strong {
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 1.15rem;
}

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

.warning-callout {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--amber-100);
    border: 1px solid var(--amber-500);
    border-left: 5px solid var(--amber-500);
    border-radius: var(--radius-md);
    color: #78350f;
}

.strategy-panel {
    display: grid;
    gap: 0.7rem;
}

.strategy-bar-label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
    font-size: 0.72rem;
}

.strategy-bar-label span {
    color: var(--slate-500);
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    white-space: nowrap;
}

.strategy-track {
    height: 0.65rem;
}

.strategy-track span {
    background: linear-gradient(90deg, var(--blue-800), var(--blue-600));
}

.method-list {
    display: grid;
    gap: 0.85rem;
    margin: 0;
    padding: 0;
    counter-reset: method;
    list-style: none;
}

.method-list li {
    position: relative;
    display: grid;
    gap: 0.15rem;
    padding-left: 2.35rem;
    counter-increment: method;
}

.method-list li::before {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    width: 1.65rem;
    height: 1.65rem;
    place-items: center;
    content: counter(method);
    background: var(--blue-100);
    border: 1px solid #93c5fd;
    border-radius: 50%;
    color: var(--blue-800);
    font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.68rem;
    font-weight: 800;
}

.method-list span {
    color: var(--slate-500);
    font-size: 0.78rem;
}

.next-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.4rem;
    background: var(--blue-50);
    border: 1px solid #93c5fd;
    border-radius: var(--radius-lg);
}

.next-step p {
    margin-bottom: 0;
}

.button-link {
    flex: 0 0 auto;
    padding: 0.68rem 0.9rem;
    background: var(--blue-800);
    border: 2px solid var(--navy-950);
    border-radius: var(--radius-sm);
    box-shadow: 3px 3px 0 var(--navy-950);
    color: var(--white);
    font-weight: 750;
    text-decoration: none;
}

.button-link:hover {
    background: var(--blue-600);
}

@media (max-width: 64rem) {
    .primary-nav a {
        padding-inline: 0.45rem;
    }

    .latest-layout {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 48rem) {
    .nav-shell {
        position: relative;
        min-height: 3.8rem;
    }

    .menu-button {
        display: inline-flex;
        margin-left: auto;
    }

    .primary-nav {
        position: absolute;
        top: calc(100% + 2px);
        right: 0;
        left: 0;
        display: none;
        align-items: stretch;
        flex-direction: column;
        padding: 0.55rem;
        background: var(--white);
        border: 1px solid var(--slate-300);
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        box-shadow: 0 8px 18px rgb(15 23 42 / 12%);
    }

    .primary-nav.open {
        display: flex;
    }

    .primary-nav a {
        padding: 0.7rem;
        border-bottom: 0;
        border-left: 3px solid transparent;
    }

    .primary-nav a.active {
        background: var(--blue-50);
        border-left-color: var(--blue-800);
    }

    .intro,
    .ml-intro {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding-top: 2.3rem;
    }

    .product-control {
        max-width: none;
    }

    .section-block {
        margin-bottom: 2.5rem;
    }

    .analysis-grid,
    .method-grid {
        grid-template-columns: 1fr;
    }

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

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

    .heatmap {
        grid-template-columns: repeat(11, minmax(2rem, 1fr));
        min-width: 25rem;
    }

    .heatmap-panel {
        overflow-x: auto;
    }

    .site-footer .shell,
    .next-step {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 32rem) {
    .shell {
        width: min(calc(100% - 1.25rem), var(--shell));
    }

    .brand span {
        font-size: 0.9rem;
    }

    .language-switch {
        order: 2;
    }

    .intro {
        padding-top: 1.8rem;
    }

    .section-heading,
    .section-heading-wrap {
        align-items: flex-start;
        flex-direction: column;
    }

    .draw-card {
        min-height: 19rem;
        padding: 1rem;
    }

    .lottery-result {
        align-items: flex-start;
    }

    .main-balls {
        max-width: 13rem;
    }

    .lottery-ball {
        width: 2.65rem;
    }

    .kpi-grid,
    .ml-kpi-grid {
        grid-template-columns: 1fr;
    }

    .frequency-grid {
        grid-template-columns: 1fr;
    }

    .chart-panel {
        padding: 0.85rem;
    }

    .site-footer .shell {
        gap: 0.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
