/* Page-specific CSS for mode-atlas-test-page.css. Shared repeated rules moved to mode-atlas-page-shared.css. */

:root {
  --ma-font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ma-font-display: Sora, Inter, ui-sans-serif, system-ui, sans-serif;
  --ma-font-jp: "Noto Sans JP", Inter, ui-sans-serif, system-ui, sans-serif;
}

:root {
        --bg-1: #0b0b0b;
        --bg-2: #141414;
        --panel: rgba(24,24,24,0.94);
        --panel-strong: rgba(18,18,18,0.98);
        --border: rgba(255,255,255,0.08);
        --text: #f3f3f3;
        --muted: #9a9a9a;
        --gold: #cba34a;
        --gold-soft: rgba(203,163,74,0.15);
        --green: #67d78b;
        --green-soft: rgba(103,215,139,0.16);
        --blue: #66a8ff;
        --blue-soft: rgba(102,168,255,0.16);
        --red: #ff7b7b;
        --red-soft: rgba(255,123,123,0.16);
        --shadow: 0 20px 60px rgba(0,0,0,0.42);
        --radius-xl: 26px;
        --radius-lg: 20px;
        --radius-md: 14px;
    }

body {
        margin: 0;
        min-height: 100vh;
        font-family: Arial, sans-serif;
        color: var(--text);
        background:
            radial-gradient(circle at top left, rgba(102,168,255,0.08), transparent 24%),
            radial-gradient(circle at top right, rgba(103,215,139,0.08), transparent 24%),
            radial-gradient(circle at bottom center, rgba(203,163,74,0.06), transparent 28%),
            linear-gradient(180deg, #161616 0%, #0a0a0a 100%);
        padding: 22px;
    }

.shell {
        width: min(1320px, 100%);
        margin: 0 auto;
    }

.glass {
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        background: linear-gradient(180deg, rgba(28,28,28,0.94), rgba(15,15,15,0.96));
        border: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

.hero {
        border-radius: var(--radius-xl);
        padding: 28px;
        margin-bottom: 20px;
        overflow: hidden;
        position: relative;
        background:
            radial-gradient(circle at top left, rgba(203,163,74,0.12), transparent 28%),
            linear-gradient(180deg, rgba(29,29,29,0.97), rgba(14,14,14,0.98));
    }

.hero::before,
    .hero::after {
        content: "";
        position: absolute;
        border-radius: 999px;
        pointer-events: none;
        filter: blur(8px);
        opacity: 0.8;
    }

.hero::before {
        width: 200px;
        height: 200px;
        top: -70px;
        right: -50px;
        background: radial-gradient(circle, rgba(203,163,74,0.20), transparent 68%);
    }

.hero::after {
        width: 180px;
        height: 180px;
        bottom: -70px;
        left: -40px;
        background: radial-gradient(circle, rgba(255,255,255,0.07), transparent 70%);
    }

.hero-grid {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: 1.15fr 0.85fr;
        gap: 20px;
        align-items: stretch;
    }

.hero-kicker {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 7px 12px;
        border-radius: 999px;
        background: var(--gold-soft);
        border: 1px solid rgba(203,163,74,0.30);
        color: #ffe2a6;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        margin-bottom: 14px;
    }

h1 {
        margin: 0 0 10px;
        font-size: 44px;
        line-height: 0.98;
        letter-spacing: -0.03em;
    }

.hero-copy {
        color: #d7d7d7;
        font-size: 16px;
        line-height: 1.65;
        max-width: 760px;
        margin-bottom: 18px;
    }

.hero-outline {
        display: grid;
        gap: 10px;
        color: var(--muted);
        font-size: 14px;
        line-height: 1.55;
    }

.hero-side {
        display: grid;
        gap: 14px;
    }

.mini-panel {
        border-radius: var(--radius-lg);
        padding: 18px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
    }

.mini-label {
        color: var(--muted);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        margin-bottom: 10px;
    }

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

.duo-chip {
        padding: 12px;
        border-radius: 14px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.07);
    }

.duo-chip .name {
        color: var(--muted);
        font-size: 12px;
        margin-bottom: 7px;
    }

.duo-chip .value {
        font-size: 24px;
        font-weight: 800;
    }

.back-link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-top: 14px;
        color: #d9d9d9;
        text-decoration: none;
        font-size: 14px;
        font-weight: 700;
    }

.back-link:hover { color: white; }

.stage {
        display: grid;
        gap: 18px;
    }

.card {
        border-radius: var(--radius-lg);
        padding: 20px;
        min-width: 0;
    }

.card-head {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: flex-start;
        margin-bottom: 16px;
    }

.card-title {
        margin: 0 0 6px;
        font-size: 24px;
    }

.card-sub {
        color: var(--muted);
        font-size: 14px;
        line-height: 1.5;
    }

.accent {
        width: 12px;
        height: 12px;
        border-radius: 999px;
        margin-top: 8px;
        flex: 0 0 auto;
        background: var(--gold);
        box-shadow: 0 0 16px rgba(203,163,74,0.45);
    }

.summary-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 18px;
        align-items: start;
    }

.summary-left {
        display: grid;
        gap: 14px;
    }

.mega-score {
        border-radius: 22px;
        padding: 18px;
        background:
            radial-gradient(circle at top right, rgba(203,163,74,0.18), transparent 42%),
            linear-gradient(180deg, rgba(42,33,13,0.96), rgba(18,18,18,0.96));
        border: 1px solid rgba(203,163,74,0.25);
    }

.mega-kicker {
        color: #f1d18a;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        font-size: 12px;
        font-weight: 800;
        margin-bottom: 8px;
    }

.mega-value {
        font-size: 70px;
        font-weight: 900;
        line-height: 0.92;
        letter-spacing: -0.04em;
    }

.mega-sub {
        color: #e4d7b7;
        font-size: 14px;
        line-height: 1.55;
        max-width: 42ch;
    }

.meta-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
        margin-top: 16px;
    }

.metric {
        padding: 12px;
        border-radius: 14px;
        background: rgba(255,255,255,0.045);
        border: 1px solid rgba(255,255,255,0.08);
    }

.metric .label {
        color: var(--muted);
        font-size: 12px;
        margin-bottom: 7px;
    }

.metric .value {
        font-size: 24px;
        font-weight: 800;
        line-height: 1;
    }

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

.summary-row {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: center;
        padding: 14px 15px;
        border-radius: 16px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.075);
    }

.summary-main {
        min-width: 0;
    }

.summary-label {
        font-size: 15px;
        font-weight: 700;
        margin-bottom: 4px;
    }

.summary-extra {
        color: var(--muted);
        font-size: 12px;
        line-height: 1.4;
    }

.summary-value {
        white-space: nowrap;
        font-size: 18px;
        font-weight: 800;
    }

.results-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 18px;
        align-items: start;
    }

.tests-grid {
        display: grid;
        gap: 12px;
    }

.test-tile {
        width: 100%;
        text-align: left;
        padding: 16px;
        border-radius: 18px;
        color: var(--text);
        cursor: pointer;
        transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
    }

.test-tile:hover {
        transform: translateY(-1px);
        box-shadow: 0 12px 26px rgba(0,0,0,0.22);
    }

.test-tile.reading {
        background: linear-gradient(180deg, rgba(20,35,24,0.96), rgba(16,18,16,0.96));
        border: 1px solid rgba(103,215,139,0.18);
    }

.test-tile.writing {
        background: linear-gradient(180deg, rgba(19,28,43,0.96), rgba(16,18,22,0.96));
        border: 1px solid rgba(102,168,255,0.18);
    }

.test-tile.average {
        background: linear-gradient(180deg, rgba(49,38,16,0.96), rgba(19,18,16,0.96));
        border: 1px solid rgba(203,163,74,0.22);
    }

.test-tile.active.reading {
        border-color: rgba(103,215,139,0.42);
        box-shadow: inset 0 0 0 1px rgba(103,215,139,0.16);
    }

.test-tile.active.writing {
        border-color: rgba(102,168,255,0.42);
        box-shadow: inset 0 0 0 1px rgba(102,168,255,0.16);
    }

.test-tile.active.average {
        border-color: rgba(203,163,74,0.40);
        box-shadow: inset 0 0 0 1px rgba(203,163,74,0.14);
    }

.test-tile-top {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: flex-start;
        margin-bottom: 12px;
    }

.test-title {
        font-size: 18px;
        font-weight: 800;
        margin-bottom: 5px;
    }

.test-sub {
        color: var(--muted);
        font-size: 13px;
        line-height: 1.45;
    }

.test-score {
        font-size: 28px;
        font-weight: 900;
        line-height: 1;
        color: #fff;
    }

.tag-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

.tag {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.08);
    }

.tag.reading { background: var(--green-soft); color: #bdf3cf; }

.tag.writing { background: var(--blue-soft); color: #d8e8ff; }

.tag.gold { background: var(--gold-soft); color: #ffe2a6; }

.detail-panel {
        border-radius: 20px;
        padding: 18px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        min-height: 100%;
    }

.detail-head {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: flex-start;
        margin-bottom: 16px;
    }

.detail-title {
        font-size: 24px;
        font-weight: 800;
        margin-bottom: 6px;
    }

.detail-sub {
        color: var(--muted);
        font-size: 14px;
        line-height: 1.55;
    }

.detail-controls {
        display:flex;
        justify-content:flex-end;
        gap:10px;
        margin-bottom:12px;
    }

.inline-toggle-btn {
        appearance:none;
        border:1px solid rgba(255,255,255,0.10);
        background:rgba(255,255,255,0.04);
        color:var(--text);
        border-radius:12px;
        padding:10px 12px;
        cursor:pointer;
        font-size:13px;
        font-weight:700;
        transition:all 0.15s ease;
    }

.inline-toggle-btn:hover {
        border-color: rgba(203,163,74,0.35);
        box-shadow: 0 0 0 1px rgba(203,163,74,0.12);
    }

.inline-toggle-btn.active {
        background: rgba(203,163,74,0.15);
        border-color: rgba(203,163,74,0.35);
        color: #ffe2a6;
    }

.detail-metrics {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 16px;
    }

.heatmap-wrap {
        display: grid;
        gap: 12px;
    }

.heatmap-title {
        font-size: 14px;
        font-weight: 700;
        color: #dfdfdf;
    }

.heatmap {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
    }

.cell {
        min-height: 82px;
        border-radius: 12px;
        display: grid;
        grid-template-rows: 1fr auto;
        justify-items: center;
        align-items: center;
        padding: 8px 6px;
        font-weight: 700;
        border: 1px solid rgba(255,255,255,0.08);
        cursor: pointer;
        user-select: none;
        position: relative;
        transition: transform 0.14s ease, border-color 0.14s ease;
    }

.cell:hover,
    .cell.active {
        transform: translateY(-1px);
        border-color: rgba(203,163,74,0.42);
        box-shadow: 0 0 0 1px rgba(203,163,74,0.14);
    }

.cell-char {
        font-size: 25px;
        line-height: 1;
    }

.cell-time {
        font-size: 11px;
        color: rgba(255,255,255,0.82);
        line-height: 1;
    }

.legend {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 14px;
        color: var(--muted);
        font-size: 12px;
        margin-top: 6px;
    }

.legend-chip {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

.legend-box {
        width: 12px;
        height: 12px;
        border-radius: 4px;
        border: 1px solid rgba(255,255,255,0.08);
    }

.kana-detail {
        margin-top: 14px;
        border-radius: 16px;
        padding: 14px;
        background: rgba(255,255,255,0.035);
        border: 1px solid rgba(255,255,255,0.07);
    }

.kana-detail.empty {
        color: var(--muted);
        text-align: center;
        min-height: 96px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

.kana-grid {
        display: grid;
        grid-template-columns: 96px 1fr;
        gap: 14px;
        align-items: start;
    }

.kana-big {
        border-radius: 16px;
        padding: 14px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        text-align: center;
    }

.kana-big .char {
        font-size: 44px;
        line-height: 1;
        margin-bottom: 8px;
    }

.kana-big .romaji {
        color: var(--muted);
        font-size: 13px;
        font-weight: 700;
    }

.kana-time-only {
        padding: 12px;
        border-radius: 14px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.07);
        display: grid;
        gap: 6px;
    }

.kana-time-only .label {
        color: var(--muted);
        font-size: 12px;
    }

.kana-time-only .value {
        font-size: 24px;
        font-weight: 800;
    }

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

@media (max-width: 760px) {
        body { padding: 12px; }
        .hero, .card { padding: 18px; }
        h1 { font-size: 36px; }
        .meta-grid,
        .detail-metrics,
        .duo-grid,
        .mega-inline-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .kana-grid { grid-template-columns: 1fr; }
        .kana-big { max-width: 110px; }
        .detail-controls { justify-content: stretch; }
        .inline-toggle-btn { width: 100%; }
    }

.mega-score.reading {
        background:
            radial-gradient(circle at top right, rgba(103,215,139,0.18), transparent 42%),
            linear-gradient(180deg, rgba(20,35,24,0.96), rgba(18,18,18,0.96));
        border-color: rgba(103,215,139,0.25);
    }

.mega-score.writing {
        background:
            radial-gradient(circle at top right, rgba(102,168,255,0.20), transparent 42%),
            linear-gradient(180deg, rgba(18,28,42,0.96), rgba(18,18,18,0.96));
        border-color: rgba(102,168,255,0.25);
    }

.mega-score.average {
        background:
            radial-gradient(circle at top right, rgba(203,163,74,0.18), transparent 42%),
            linear-gradient(180deg, rgba(42,33,13,0.96), rgba(18,18,18,0.96));
        border-color: rgba(203,163,74,0.25);
    }

.modal-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.66);
        display: none;
        justify-content: center;
        align-items: center;
        padding: 20px;
        z-index: 100;
    }

.modal-backdrop.open {
        display: flex;
    }

.modal {
        width: min(460px, 100%);
        border-radius: 20px;
        padding: 20px;
        background: linear-gradient(180deg, rgba(30,30,30,0.98), rgba(16,16,16,0.98));
        border: 1px solid rgba(255,255,255,0.10);
        box-shadow: 0 20px 60px rgba(0,0,0,0.45);
        position: relative;
    }

.modal-close {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
        border-radius: 10px;
        border: 1px solid rgba(255,255,255,0.10);
        background: rgba(255,255,255,0.04);
        color: var(--text);
        cursor: pointer;
        font-size: 18px;
        font-weight: 700;
    }

.modal-close:hover {
        background: rgba(255,255,255,0.08);
    }

.modal-title {
        font-size: 24px;
        font-weight: 800;
        margin: 0 0 6px;
    }

.modal-sub {
        color: var(--muted);
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 16px;
    }

.modal-grid {
        display: grid;
        grid-template-columns: 96px 1fr;
        gap: 14px;
        align-items: start;
    }

.modal-kana {
        border-radius: 16px;
        padding: 14px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        text-align: center;
    }

.modal-kana .char {
        font-size: 44px;
        line-height: 1;
        margin-bottom: 8px;
    }

.modal-kana .romaji {
        color: var(--muted);
        font-size: 13px;
        font-weight: 700;
    }

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

.modal-stat {
        padding: 12px;
        border-radius: 14px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.07);
    }

.modal-stat .label {
        color: var(--muted);
        font-size: 12px;
        margin-bottom: 6px;
    }

.modal-stat .value {
        font-size: 22px;
        font-weight: 800;
    }

.row-performance {
        display: grid;
        gap: 14px;
    }

.row-performance-section {
        display: grid;
        gap: 8px;
    }

.row-performance-toolbar {
        display:flex;
        justify-content:space-between;
        align-items:center;
        gap:12px;
        margin-bottom:8px;
        flex-wrap:wrap;
    }

.row-view-toggle {
        display:inline-flex;
        align-items:center;
        gap:0;
        padding:3px;
        border-radius:999px;
        background:rgba(255,255,255,0.04);
        border:1px solid rgba(255,255,255,0.08);
    }

.row-view-btn {
        appearance:none;
        border:none;
        background:transparent;
        color:var(--muted);
        font-size:12px;
        font-weight:800;
        padding:8px 12px;
        border-radius:999px;
        cursor:pointer;
    }

.row-view-btn.active {
        background:rgba(203,163,74,0.16);
        color:#ffe2a6;
    }

.row-performance-head {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: center;
        font-size: 14px;
        font-weight: 700;
        color: #e7e7e7;
    }

.row-doughnut-strip {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 10px;
        padding: 4px 2px 6px;
    }

.row-doughnut-card {
        min-width: 0;
        text-align: center;
        padding: 8px 6px;
        border-radius: 16px;
        background: rgba(255,255,255,0.035);
        border: 1px solid rgba(255,255,255,0.07);
        cursor: pointer;
        transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
        position: relative;
    }

.row-doughnut-card:hover,
    .row-doughnut-card.active {
        transform: translateY(-1px);
        border-color: rgba(203,163,74,0.34);
        box-shadow: 0 0 0 1px rgba(203,163,74,0.12);
    }

.row-doughnut-card.best {
        border-color: rgba(103,215,139,0.75);
        box-shadow: inset 0 0 0 2px rgba(103,215,139,0.22), 0 0 18px rgba(103,215,139,0.18);
        background: linear-gradient(180deg, rgba(103,215,139,0.08), rgba(255,255,255,0.035));
    }

.row-doughnut-card.worst {
        border-color: rgba(255,123,123,0.75);
        box-shadow: inset 0 0 0 2px rgba(255,123,123,0.22), 0 0 18px rgba(255,123,123,0.18);
        background: linear-gradient(180deg, rgba(255,123,123,0.08), rgba(255,255,255,0.035));
    }

.row-doughnut-label {
        font-size: 12px;
        margin-top: 8px;
        color: #ddd;
        line-height: 1.25;
        min-height: 12px;
        white-space: normal;
    }

.row-doughnut-value {
        font-size: 12px;
        color: #aaa;
        font-weight: 700;
    }

.row-tooltip {
        margin-top: 6px;
        padding: 10px 12px;
        border-radius: 14px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        color: #ddd;
        font-size: 12px;
        line-height: 1.45;
        min-height: 56px;
    }

.row-grid {
        display: grid;
        gap: 10px;
    }

.row-bar {
        display: grid;
        grid-template-columns: 58px 1fr 52px;
        gap: 10px;
        align-items: center;
    }

.row-name {
        font-size: 13px;
        font-weight: 800;
        color: #f1f1f1;
        letter-spacing: 0.04em;
    }

.row-track {
        height: 12px;
        border-radius: 999px;
        background: rgba(255,255,255,0.07);
        overflow: hidden;
        position: relative;
    }

.row-fill {
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, rgba(255,255,255,0.18), var(--gold));
        min-width: 6px;
    }

.row-value {
        font-size: 12px;
        color: var(--muted);
        text-align: right;
        font-weight: 700;
    }

.mega-inline-summary {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 10px;
        margin-top: 16px;
    }

.mega-inline-card {
        padding: 12px;
        border-radius: 14px;
        background: rgba(255,255,255,0.045);
        border: 1px solid rgba(255,255,255,0.08);
    }

.mega-inline-card .label {
        color: var(--muted);
        font-size: 12px;
        margin-bottom: 7px;
    }

.mega-inline-card .value {
        font-size: 20px;
        font-weight: 800;
        line-height: 1.1;
    }

.row-performance {
        display: grid;
        gap: 14px;
        position: relative;
    }

.row-doughnut-strip {
        display: grid;
        grid-template-columns: repeat(10, minmax(0, 1fr));
        gap: 10px;
        padding: 4px 2px 6px;
    }

.row-doughnut-card {
        min-width: 0;
        text-align: center;
        padding: 7px 5px;
        border-radius: 16px;
        background: rgba(255,255,255,0.035);
        border: 1px solid rgba(255,255,255,0.07);
        cursor: pointer;
        transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
        position: relative;
    }

.row-doughnut-label {
        font-size: 18px;
        margin-top: 6px;
        color: #f3f3f3;
        line-height: 1.1;
        min-height: 22px;
        white-space: normal;
        font-weight: 800;
    }

.row-doughnut-value {
        display: none;
    }

.row-tooltip-overlay {
        position: absolute;
        inset: 36px 0 0 0;
        display: none;
        align-items: center;
        justify-content: center;
        pointer-events: none;
        z-index: 5;
    }

.row-tooltip-overlay.show {
        display: flex;
    }

.row-tooltip-card {
        min-width: 220px;
        max-width: 300px;
        padding: 14px 16px;
        border-radius: 16px;
        background: rgba(18,18,18,0.96);
        border: 1px solid rgba(255,255,255,0.10);
        box-shadow: 0 18px 40px rgba(0,0,0,0.38);
        text-align: center;
    }

.row-tooltip-card .title {
        font-size: 18px;
        font-weight: 800;
        margin-bottom: 6px;
    }

.row-tooltip-card .sub {
        color: var(--muted);
        font-size: 12px;
        line-height: 1.45;
    }

.row-flag {
        position: absolute;
        top: 6px;
        right: 6px;
        padding: 2px 6px;
        border-radius: 999px;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        line-height: 1.2;
    }

.row-flag.best {
        background: rgba(103,215,139,0.18);
        color: #bdf3cf;
        border: 1px solid rgba(103,215,139,0.34);
    }

.row-flag.worst {
        background: rgba(255,123,123,0.18);
        color: #ffb3b3;
        border: 1px solid rgba(255,123,123,0.34);
    }

.hero-title-block {
        display: grid;
        gap: 12px;
        align-content: start;
    }

.hero-short-copy {
        color: #d7d7d7;
        font-size: 15px;
        line-height: 1.55;
        max-width: 720px;
        margin: 0;
    }

.hero-grid.compact-title {
        grid-template-columns: 1.45fr 0.55fr;
        gap: 18px;
        align-items: start;
    }

.hero-side.compact {
        display: block;
    }

.mini-panel.quick-preview {
        padding: 18px;
    }

@media (max-width: 1080px) {
        .hero-grid.compact-title {
            grid-template-columns: 1fr;
        }
    }

.hero-title {
        font-size: 42px;
        font-weight: 900;
        letter-spacing: -0.02em;
        line-height: 1.1;
        color: #f5f5f5;
        margin: 0;
        text-shadow: 0 2px 18px rgba(203,163,74,0.15);
    }

.hero-title-block {
        gap: 10px;
    }

.heatmap {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

.heatmap-row-group {
        display: grid;
        gap: 8px;
    }

.heatmap-row-label {
        font-size: 13px;
        font-weight: 800;
        color: #e5e5e5;
        letter-spacing: 0.04em;
    }

.heatmap-row-cells {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
    }

.cell.empty-slot {
        visibility: hidden;
        pointer-events: none;
    }

.cell.reference {
        background: rgba(255,255,255,0.08) !important;
        border-color: rgba(255,255,255,0.10);
        cursor: default;
        box-shadow: none;
    }

.cell.reference:hover,
    .cell.reference.active {
        transform: none;
        border-color: rgba(255,255,255,0.10);
        box-shadow: none;
    }

.cell.reference .cell-char {
        color: rgba(255,255,255,0.72);
    }

.cell.reference .cell-time {
        color: rgba(255,255,255,0.46);
    }

.cell-badge {
        position: absolute;
        top: 6px;
        right: 6px;
        padding: 2px 6px;
        border-radius: 999px;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        line-height: 1.2;
    }

.cell-badge.fastest {
        background: rgba(103,215,139,0.18);
        color: #bdf3cf;
        border: 1px solid rgba(103,215,139,0.34);
    }

.cell-badge.slowest {
        background: rgba(255,123,123,0.18);
        color: #ffb3b3;
        border: 1px solid rgba(255,123,123,0.34);
    }

.row-doughnut-card.slowest {
        border-color: rgba(203,163,74,0.72);
        box-shadow: inset 0 0 0 2px rgba(203,163,74,0.18), 0 0 18px rgba(203,163,74,0.16);
        background: linear-gradient(180deg, rgba(203,163,74,0.08), rgba(255,255,255,0.035));
    }

.row-flag.slowest {
        background: rgba(203,163,74,0.18);
        color: #ffe2a6;
        border: 1px solid rgba(203,163,74,0.34);
    }

.branch-nav {
        width: min(1320px, 100%);
        margin: 0 auto 18px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        padding: 14px;
        border-radius: 24px;
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        background: linear-gradient(180deg, rgba(24,27,35,0.82), rgba(12,14,19,0.74));
        border: 1px solid rgba(255,255,255,0.10);
        box-shadow: 0 18px 45px rgba(0,0,0,0.26), inset 0 1px 0 rgba(255,255,255,0.035);
        position: sticky;
        top: 14px;
        z-index: 60;
    }

.branch-brand { display: inline-flex; align-items: center; gap: 13px; min-width: 0; color: inherit; text-decoration: none; }

.branch-mark { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; font-weight: 900; font-size: 20px; background: radial-gradient(circle at 28% 24%, rgba(255,255,255,0.20), transparent 30%), linear-gradient(135deg, rgba(203,163,74,0.95), rgba(102,168,255,0.88)); box-shadow: 0 14px 30px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.18); }

.branch-meta { min-width: 0; }

.branch-kicker { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 800; margin-bottom: 3px; }

.branch-name { font-size: 18px; font-weight: 900; letter-spacing: -0.03em; white-space: nowrap; }

.branch-links { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }

.branch-link, .profile-trigger, .drawer-close { appearance: none; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); color: var(--text); border-radius: 999px; padding: 10px 13px; font: inherit; font-size: 13px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease; white-space: nowrap; }

.branch-link:hover, .profile-trigger:hover, .drawer-close:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.07); }

.branch-link.active { background: rgba(203,163,74,0.16); border-color: rgba(203,163,74,0.32); color: #ffe2a6; }

.branch-link.atlas:hover { border-color: rgba(182,148,255,0.42); background: rgba(182,148,255,0.14); color: #eadfff; }

.branch-link.overview:hover { border-color: rgba(203,163,74,0.46); background: rgba(203,163,74,0.16); color: #ffe2a6; }

.branch-link.reading:hover { border-color: rgba(103,215,139,0.42); background: rgba(103,215,139,0.14); color: #c9f7d8; }

.branch-link.writing:hover { border-color: rgba(102,168,255,0.44); background: rgba(102,168,255,0.14); color: #d8e8ff; }

.profile-trigger:hover { border-color: rgba(255,159,202,0.42); background: rgba(255,159,202,0.12); color: #ffd8e9; }

.profile-trigger { display: inline-flex; align-items: center; gap: 9px; padding: 8px 9px 8px 12px; background: rgba(255,255,255,0.055); }

.profile-dot { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 900; background: linear-gradient(135deg, rgba(203,163,74,0.92), rgba(102,168,255,0.94)); color: #071018; overflow:hidden; }

.profile-dot img { width:100%; height:100%; object-fit:cover; display:block; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 80; display: none; background: rgba(0,0,0,0.52); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.drawer-backdrop.open { display: block; }

.profile-drawer { position: fixed; top: 18px; right: 18px; z-index: 90; width: min(390px, calc(100vw - 36px)); max-height: calc(100vh - 36px); overflow-y: auto; padding: 18px; border-radius: 28px; background: radial-gradient(circle at top right, rgba(203,163,74,0.18), transparent 34%), linear-gradient(180deg, rgba(22,25,34,0.98), rgba(9,11,16,0.98)); border: 1px solid rgba(255,255,255,0.10); box-shadow: 0 32px 90px rgba(0,0,0,0.55); transform: translateX(calc(100% + 40px)); transition: transform 0.24s ease; }

.profile-drawer.open { transform: translateX(0); }

.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; }

.drawer-title { font-size: 20px; font-weight: 900; letter-spacing: -0.03em; }

.drawer-close { padding: 8px 11px; border-radius: 12px; }

.drawer-user { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 20px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); margin-bottom: 14px; }

.drawer-avatar { width: 56px; height: 56px; border-radius: 18px; object-fit: cover; display: none; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); }

.drawer-name { font-size: 17px; font-weight: 900; margin-bottom: 4px; }

.drawer-email, .drawer-status { color: var(--muted); font-size: 13px; line-height: 1.45; }

.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

.drawer-action { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.05); color: var(--text); text-decoration: none; font-weight: 800; font-size: 13px; cursor: pointer; }

.drawer-action.primary { background: rgba(203,163,74,0.16); border-color: rgba(203,163,74,0.30); }

@media (max-width: 760px) {
        .branch-nav { align-items: flex-start; flex-direction: column; position: static; }
        .branch-links { justify-content: flex-start; }
        .profile-trigger { width: 100%; justify-content: space-between; }
        .drawer-actions { grid-template-columns: 1fr; }
    }

@media (max-width: 900px) {
  .results-layout, .hero-grid, .hero-grid.compact-title { grid-template-columns: 1fr !important; }
  .hero-title { font-size: clamp(2.3rem, 10vw, 4rem) !important; }
  .row-doughnut-strip {
    display: flex !important;
    overflow-x: auto !important;
    gap: 10px !important;
    padding: 8px 2px 12px !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin;
  }
  .row-doughnut-card {
    flex: 0 0 72px !important;
    width: 72px !important;
    min-width: 72px !important;
    padding: 7px 5px !important;
  }
  .row-doughnut-card canvas {
    width: 48px !important;
    height: 48px !important;
  }
  .row-doughnut-label {
    font-size: 20px !important;
    min-height: 22px !important;
  }
  .row-flag {
    top: 4px !important;
    right: 4px !important;
    font-size: 8px !important;
    padding: 2px 5px !important;
  }
  .row-performance-head {
    display: grid !important;
    gap: 4px !important;
    align-items: start !important;
  }
  .mega-inline-summary, .meta-grid, .detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .mega-inline-card .value, .metric .value { font-size: 20px !important; overflow-wrap: anywhere !important; }
  .mega-value { font-size: clamp(3rem, 16vw, 5rem) !important; }
  .heatmap-row-cells { grid-template-columns: repeat(5, minmax(42px, 1fr)) !important; }
  .cell { min-height: 64px !important; }
  .cell-char { font-size: 22px !important; }
  .cell-time { font-size: 10px !important; }
}

@media (max-width: 560px) {
  .mega-inline-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .summary-row { align-items: flex-start !important; flex-direction: column !important; }
  .summary-value { white-space: normal !important; }
  .test-tile-top { gap: 8px !important; }
  .test-title { font-size: 16px !important; }
  .test-score { font-size: 24px !important; }
}

.cell,
button.cell,
.cell .cell-char,
.cell .cell-time,
.heatmap .cell,
.heatmap .cell-char,
.heatmap .cell-time,
.row-doughnut-card,
.row-doughnut-label,
.modal-kana .char,
.kana-big .char {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
}

.cell.reference,
.cell.reference .cell-char,
.cell.reference .cell-time {
  color: rgba(255,255,255,0.72) !important;
  -webkit-text-fill-color: rgba(255,255,255,0.72) !important;
}

.cell-badge.fastest,
.row-flag.best {
  color: #bdf3cf !important;
  -webkit-text-fill-color: #bdf3cf !important;
}

.cell-badge.slowest,
.row-flag.slowest {
  color: #ffe2a6 !important;
  -webkit-text-fill-color: #ffe2a6 !important;
}

.row-flag.worst {
  color: #ffb3b3 !important;
  -webkit-text-fill-color: #ffb3b3 !important;
}

.branch-links .profile-trigger { order: 99 !important; }

@media (max-width: 760px) {
  body { padding-top: 10px !important; background-color: #05060b !important; }
  .branch-nav {
    position: relative !important;
    top: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 14px !important;
    margin: 0 0 12px !important;
    border-radius: 26px !important;
  }
  .branch-brand { width: 100% !important; min-width: 0 !important; }
  .branch-mark { width: 56px !important; height: 56px !important; border-radius: 18px !important; flex: 0 0 auto !important; }
  .branch-kicker { display: none !important; }
  .branch-name { font-size: 1.28rem !important; }
  .branch-links {
    width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding-bottom: 2px !important;
    -webkit-overflow-scrolling: touch;
  }
  .branch-links::-webkit-scrollbar { display: none !important; }
  .branch-link,
  .profile-trigger {
    flex: 0 0 auto !important;
    width: auto !important;
    padding: 10px 13px !important;
    font-size: 0.95rem !important;
    border-radius: 999px !important;
  }
  .branch-links .profile-trigger {
    order: 99 !important;
    padding: 8px !important;
  }
  .branch-links .profile-trigger > span:not(.profile-dot) { display: none !important; }
  .profile-dot { width: 36px !important; height: 36px !important; }
  .shell { width: 100% !important; }
  .hero { padding: 20px !important; border-radius: 26px !important; }
  .hero-title { font-size: clamp(2.7rem, 13vw, 4.5rem) !important; }
  .hero-short-copy { font-size: 1.05rem !important; line-height: 1.45 !important; }
  .card { border-radius: 24px !important; padding: 18px !important; }
}
