* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f5f5f0;
    color: #333;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* ── Header ── */

.page-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.header-icon {
    height: 1.3em;
    border: 1px solid #ccc;
    border-radius: 2px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.header-jp {
    font-size: 0.95rem;
    color: #999;
    margin-bottom: 0.8rem;
}

.header-desc {
    font-size: 0.9rem;
    color: #666;
    max-width: 860px;
    margin: 0 auto;
    line-height: 1.6;
}

.lang-switcher {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.lang-switcher a {
    color: #005f6b;
    text-decoration: none;
}

.lang-active {
    color: #999;
}

/* ── Section common ── */

section {
    margin-bottom: 3rem;
}

h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 0.2rem;
}

.section-subtitle {
    text-align: center;
    color: #777;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* ── Radio toggle ── */

.toggle-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.toggle-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.4rem 0;
}

.toggle-option input {
    margin-top: 0.2rem;
    accent-color: #005f6b;
}

.toggle-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.toggle-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
}

.toggle-desc {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.3;
}

/* ── Study hours chart ── */

.chart-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 2rem 2.5rem 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.bar-chart {
    position: relative;
    margin: 0 auto;
}

.chart-inner {
    position: relative;
    background: #e8ecee;
    border-radius: 6px;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
    transition: height 0.4s ease;
}

.grid-line {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    z-index: 0;
}

.bar-area {
    position: absolute;
    left: 0;
    right: 0;
    background: #c5d0d5;
    border-radius: 4px;
    overflow: hidden;
    z-index: 2;
}

.bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 4px 0 0 4px;
    transition: width 0.6s ease, left 0.6s ease, background 0.6s ease;
}

#bell-svg path {
    transition: d 0.6s ease;
}

.vline {
    position: absolute;
    width: 1px;
    background: #000 !important;
    transform: translateX(-50%);
    z-index: 3;
    transition: left 0.6s ease;
}

.label-above {
    position: absolute;
    text-align: center;
    transform: translateX(-50%);
    z-index: 4;
    transition: left 0.6s ease, color 0.6s ease;
}

.label-above .level-name {
    font-size: 1.3rem;
    font-weight: 800;
}

.label-below {
    position: absolute;
    text-align: center;
    transform: translateX(-50%);
    z-index: 4;
    transition: left 0.6s ease, color 0.6s ease;
}

.label-below .hours {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.label-last {
    text-align: left;
    transform: translateX(-100%);
}

.nowrap {
    white-space: nowrap;
}

.label-below .level-info {
    font-size: 0.65rem;
    color: #888;
    line-height: 1.3;
}

.cefr-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    background: rgba(0,0,0,0.08);
    color: #555;
    padding: 1px 5px;
    border-radius: 3px;
    margin-top: 2px;
}

.axis-label {
    font-size: 0.72rem;
    color: #aaa;
    font-style: italic;
    margin-top: 0;
    margin-left: -5px;
}

.axis {
    position: relative;
    height: 20px;
    margin-top: 4px;
}

.axis-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 0.72rem;
    color: #aaa;
}

.use-cases {
    margin-top: 1.8rem;
}

.milestones {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.milestone {
    flex: 1;
    text-align: center;
    padding: 0.6rem 0.4rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.milestone-level {
    font-size: 1rem;
    font-weight: 800;
    color: #005f6b;
    margin-bottom: 0.15rem;
}

.milestone-text {
    font-size: 0.72rem;
    color: #777;
    line-height: 1.35;
}

.milestone-arrow {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    color: #ccc;
    padding: 0 0.15rem;
    font-weight: 300;
}

/* ── Click marker ── */

.click-marker {
    position: absolute;
    width: 2px;
    background: #d32f2f;
    transform: translateX(-50%);
    z-index: 5;
    pointer-events: none;
}

.click-marker::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #d32f2f;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Calculator ── */

.calculator {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.calc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.calc-current {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.calc-label {
    font-size: 0.8rem;
    color: #999;
}

.calc-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #d32f2f;
    cursor: pointer;
    padding: 0 0.3rem;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: border-color 0.15s;
}

.calc-value:hover {
    border-color: #ccc;
}

.calc-value-input {
    display: none;
    font-size: 1.3rem;
    font-weight: 800;
    color: #d32f2f;
    width: 6rem;
    padding: 0 0.3rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    background: #fff;
    font-family: inherit;
}

.calc-value-input:focus {
    border-color: #999;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.calc-level {
    font-size: 0.85rem;
    font-weight: 600;
    color: #005f6b;
}

.calc-remaining {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.15rem;
}

.calc-remaining strong {
    color: #005f6b;
    font-weight: 800;
}

.calc-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #bbb;
    cursor: pointer;
    padding: 0 0.3rem;
    line-height: 1;
}

.calc-close:hover {
    color: #666;
}

.calc-body {
    margin-top: 0.8rem;
}

.calc-slider-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.calc-slider-label {
    font-size: 0.82rem;
    color: #666;
    white-space: nowrap;
}

.calc-slider-row input[type="range"] {
    flex: 1;
    max-width: 300px;
    accent-color: #005f6b;
}

.calc-slider-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #005f6b;
    white-space: nowrap;
    min-width: 75px;
}

.calc-effort {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.effort-serious {
    color: #e67e22;
}

.effort-fulltime {
    color: #c0392b;
}

.calc-exam-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.calc-exam-row select {
    padding: 0.3rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    color: #333;
    background: #fff;
    accent-color: #005f6b;
}

.zoom-toggle {
    position: absolute;
    top: 0.7rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #005f6b;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    z-index: 10;
}

.zoom-toggle:hover {
    text-decoration: underline;
}

.edge-label {
    position: absolute;
    font-size: 2.55rem;
    font-weight: 700;
    color: rgba(0, 95, 107, 0.35);
    z-index: 6;
    pointer-events: none;
}

.calc-exam-info {
    font-size: 0.8rem;
    color: #888;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-left: 0.5rem;
}
.exam-info-table {
    border-collapse: collapse;
}
.exam-level-col {
    text-align: right;
    padding-right: 0.4rem;
    white-space: nowrap;
}
.exam-chance-col {
    text-align: right;
    white-space: nowrap;
}

.calc-exam-info strong {
    font-weight: 800;
}

.exam-certain strong,
.exam-certain .exam-prob {
    color: #1a7a3a;
}

.exam-reachable strong,
.exam-reachable .exam-prob {
    color: #27ae60;
}

.exam-not-reachable strong,
.exam-not-reachable .exam-prob {
    color: #c0392b;
}

.exam-maybe strong,
.exam-maybe .exam-prob {
    color: #e67e22;
}

.exam-prob {
    font-weight: 800;
}

.calc-result {
    margin-top: 0.8rem;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.calc-next-label {
    font-size: 0.85rem;
    color: #666;
}

.calc-next-hours {
    font-size: 0.82rem;
    color: #999;
}

.calc-next-time {
    font-size: 1.2rem;
    font-weight: 800;
    color: #005f6b;
}

.calc-congrats {
    font-size: 0.9rem;
    font-weight: 600;
    color: #005f6b;
}

.chart-hint-wrap {
    text-align: center;
    margin-top: 1rem;
}
.chart-hint {
    font-size: 0.82rem;
    color: #bbb;
    font-style: italic;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    display: inline-block;
}
.chart-hint.pulse {
    animation: hintPulse 2s ease-in-out 2;
    animation-delay: 1.5s;
}
@keyframes hintPulse {
    0%, 100% { background: transparent; }
    50% { background: rgba(211, 47, 47, 0.12); }
}

.range-note {
    text-align: center;
    font-size: 0.78rem;
    color: #999;
    margin-top: 0.8rem;
    line-height: 1.5;
}

.range-note strong {
    color: #777;
    font-weight: 700;
}

/* ── Level details table ── */

.level-cards {
    overflow-x: auto;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-size: 0.85rem;
}

.details-table thead th {
    padding: 0.8rem 0.6rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: #005f6b;
    text-align: center;
    border-bottom: 2px solid #eee;
}

.details-table thead th:first-child {
    text-align: left;
    color: #999;
    font-size: 0.75rem;
    font-weight: 600;
}

.details-table td {
    padding: 0.5rem 0.6rem;
    text-align: center;
    border-bottom: 1px solid #f2f2f2;
    vertical-align: middle;
    color: #444;
}

.details-table .row-label {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    padding-right: 1rem;
}

.details-table .num {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #333;
}

.details-table .desc-cell {
    font-size: 0.78rem;
    color: #666;
    font-style: italic;
    line-height: 1.4;
    text-align: left;
}

.cefr-pill-sm {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #005f6b;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
}

.section-cell {
    text-align: left;
}

.sec-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #444;
}

.sec-detail {
    font-size: 0.7rem;
    color: #999;
}

.mini-bar-wrap {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2px;
}

.mini-bar {
    height: 100%;
    background: #005f6b;
    border-radius: 3px;
}

.mini-pct {
    font-size: 0.78rem;
    font-weight: 700;
    color: #005f6b;
}

.use-cell {
    font-size: 0.78rem;
    color: #b08a20;
    font-weight: 600;
    text-align: left;
}

/* ── CEFR ── */

.cefr-table {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.cefr-table th {
    text-align: left;
    font-weight: 600;
    color: #999;
    padding: 0.5rem 0.8rem;
    border-bottom: 2px solid #eee;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cefr-table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #f0f0f0;
}

.cefr-jlpt {
    font-weight: 800;
    color: #005f6b;
    font-size: 1rem;
}

.cefr-score {
    font-size: 0.8rem;
    color: #666;
}

.cefr-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}

.cefr-note {
    text-align: center;
    font-size: 0.78rem;
    color: #999;
    margin-top: 0.8rem;
}

/* ── Stats ── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
    max-width: 800px;
    margin: 0 auto;
}

.stat-card {
    text-align: center;
    background: #fff;
    padding: 1.2rem 0.8rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: #005f6b;
}

.stat-label {
    font-size: 0.78rem;
    color: #888;
    margin-top: 0.2rem;
}

/* ── Recognition ── */

.recognition-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.recog-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.2rem 1.4rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.recog-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.recog-icon {
    font-size: 1.3rem;
}

.recog-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a1a;
}

.recog-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recog-item {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.recog-level {
    font-size: 0.78rem;
    font-weight: 800;
    color: #005f6b;
    min-width: 2.5rem;
    white-space: nowrap;
}

.recog-text {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.4;
}

/* ── Growth chart ── */

.growth-chart-wrap {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem 2rem 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    max-width: 1000px;
    margin: 0 auto;
}

.growth-bars {
    display: flex;
    align-items: flex-end;
    gap: 0;
    height: 200px;
}

.growth-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.growth-count {
    font-size: 0.62rem;
    color: #999;
    font-weight: 600;
    margin-bottom: 3px;
    white-space: nowrap;
}

.growth-record {
    color: #005f6b;
    font-weight: 800;
}

.growth-bar-track {
    flex: 1;
    width: 60%;
    max-width: 36px;
    display: flex;
    align-items: flex-end;
}

.growth-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, #008a99, #005f6b);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
}

.growth-covid {
    background: linear-gradient(180deg, #ccc, #aaa);
}

.growth-year {
    font-size: 0.68rem;
    color: #999;
    margin-top: 4px;
    font-weight: 600;
}

.growth-notes {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.growth-note {
    font-size: 0.72rem;
    color: #999;
}

.growth-covid-note {
    color: #aaa;
}

/* ── Footer ── */

.page-footer {
    text-align: center;
    font-size: 0.75rem;
    color: #bbb;
    padding-top: 1rem;
    border-top: 1px solid #e5e5e5;
}

.footer-link {
    color: #bbb;
    text-decoration: none;
    display: inline-block;
    margin-top: 0.5rem;
}

.footer-link:hover {
    color: #888;
}

.header-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Imprint ── */

.imprint-section {
    max-width: 600px;
    margin: 0 auto;
    margin-bottom: 42px;
}

.imprint-content {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 1rem;
}

.imprint-content h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #555;
    margin-top: 1.2rem;
    margin-bottom: 0.3rem;
}

.imprint-content h3:first-child {
    margin-top: 0;
}

.imprint-content p {
    font-size: 0.88rem;
    color: #666;
    line-height: 1.6;
}

.imprint-content a {
    color: #005f6b;
    text-decoration: none;
}

.imprint-content a:hover {
    text-decoration: underline;
}

/* ── Preparation ── */

.prep-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.prep-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.4rem 1.6rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.prep-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.prep-card-text {
    flex: 1;
    min-width: 0;
}

.prep-icon {
    width: 128px;
    height: 128px;
    flex-shrink: 0;
}

.prep-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #1a1a1a;
}

.prep-card p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    margin: 0 0 0.75rem;
}

.prep-link {
    font-size: 0.95rem;
    color: #005f6b;
    font-weight: 600;
}

/* ── Responsive ── */

@media (max-width: 600px) {
    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.2rem; }
    .chart-container { padding: 1.2rem 1rem; }
    .zoom-toggle { position: relative; top: auto; left: auto; transform: none; display: block; text-align: center; margin-bottom: 1rem; }
    .toggle-container { flex-direction: column; align-items: center; }
    .label-above .level-name { font-size: 1rem; }
    .label-below .hours { font-size: 0.75rem; }
    .details-table { font-size: 0.75rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .recognition-content { grid-template-columns: 1fr; }
    .prep-cards { grid-template-columns: 1fr; }
    .growth-chart-wrap { padding: 1rem; }
    .growth-count { font-size: 0.55rem; }
    .growth-bars { height: 150px; }
}
