:root {
    --bg: #08111f;
    --bg-soft: #101c2f;
    --panel: rgba(16, 28, 47, 0.82);
    --panel-strong: rgba(20, 36, 60, 0.94);
    --line: rgba(165, 190, 235, 0.18);
    --text: #eef5ff;
    --muted: #99a8bd;
    --blue: #2f7cff;
    --cyan: #18d4d2;
    --orange: #ffae3d;
    --danger: #ff6b6b;
    --radius: 30px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    --app-height: 100dvh;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    -webkit-text-size-adjust: 100%;
    text-rendering: geometricPrecision;
}

button,
input,
select {
    font: inherit;
}

button,
select,
input {
    -webkit-tap-highlight-color: transparent;
}

.app-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 12%, rgba(24, 212, 210, 0.16), transparent 28%),
        radial-gradient(circle at 80% 0%, rgba(47, 124, 255, 0.20), transparent 32%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 100%),
        linear-gradient(145deg, #07101d 0%, #0a1424 48%, #07101d 100%);
    background-size: auto, auto, 64px 64px, auto;
}

.app-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.07) 42%, transparent 44%),
        linear-gradient(290deg, transparent 0%, rgba(47,124,255,0.10) 62%, transparent 64%);
    opacity: 0.72;
}

.app-shell {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100vw - 32px));
    min-height: 100vh;
    min-height: 100svh;
    min-height: var(--app-height);
    margin: 0 auto;
    padding: max(28px, var(--safe-top)) 0 max(32px, var(--safe-bottom));
}

.screen {
    min-height: calc(100vh - 60px);
    min-height: calc(100svh - 60px);
    min-height: calc(var(--app-height) - 60px);
}

.is-hidden {
    display: none !important;
}

.screen-welcome {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    align-items: center;
    gap: 42px;
}

.brand-block {
    padding: 34px 0;
}

.eyebrow,
.phase-label {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 14px;
    border: 1px solid rgba(24, 212, 210, 0.28);
    border-radius: 999px;
    color: #9be9ff;
    background: rgba(14, 38, 63, 0.58);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 18px;
    font-size: clamp(3.3rem, 9vw, 7rem);
    line-height: 0.9;
    letter-spacing: 0;
    background: linear-gradient(90deg, #eef5ff, #19d7d0, #2f7cff);
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 24px 60px rgba(47, 124, 255, 0.25);
}

.brand-block p {
    width: min(650px, 100%);
    color: #c5d3e8;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.6;
}

.start-card,
.question-card,
.result-panel,
.result-hero {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(20, 36, 60, 0.94), rgba(9, 18, 32, 0.88));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(22px);
}

.start-card {
    display: grid;
    gap: 16px;
    padding: 28px;
}

label {
    display: grid;
    gap: 9px;
    color: #cfd9ea;
    font-weight: 800;
}

input,
select {
    width: 100%;
    min-height: 54px;
    padding: 0 16px;
    border: 1px solid rgba(165, 190, 235, 0.18);
    border-radius: 16px;
    color: var(--text);
    background: rgba(6, 13, 24, 0.72);
    outline: none;
    font-size: 16px;
    line-height: 1.2;
    -webkit-appearance: none;
}

select {
    padding-right: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, #9be9ff 50%),
        linear-gradient(135deg, #9be9ff 50%, transparent 50%);
    background-position:
        calc(100% - 22px) 52%,
        calc(100% - 15px) 52%;
    background-size: 7px 7px, 7px 7px;
    background-repeat: no-repeat;
}

input:focus,
select:focus {
    border-color: rgba(47, 124, 255, 0.7);
    box-shadow: 0 0 0 4px rgba(47, 124, 255, 0.18);
}

.split-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
    min-height: 54px;
    border: 0;
    border-radius: 18px;
    padding: 0 22px;
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    transform: none;
}

.primary-btn {
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 18px 36px rgba(47, 124, 255, 0.26), inset 0 1px rgba(255, 255, 255, 0.2);
}

.secondary-btn,
.ghost-btn {
    border: 1px solid rgba(165, 190, 235, 0.22);
    background: rgba(255, 255, 255, 0.06);
}

.ghost-btn {
    min-height: 44px;
    border-radius: 14px;
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active {
    transform: translateY(1px) scale(0.99);
}

.privacy-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.privacy-note.is-error {
    color: #ffc4c4;
    font-weight: 800;
}

.privacy-note.is-error a {
    color: #9be9ff;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.screen-question {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 18px;
    padding: 18px 0;
    min-height: calc(100vh - max(28px, var(--safe-top)) - max(32px, var(--safe-bottom)));
    min-height: calc(100svh - max(28px, var(--safe-top)) - max(32px, var(--safe-bottom)));
    min-height: calc(var(--app-height) - max(28px, var(--safe-top)) - max(32px, var(--safe-bottom)));
    height: calc(var(--app-height) - max(28px, var(--safe-top)) - max(32px, var(--safe-bottom)));
    max-height: calc(var(--app-height) - max(28px, var(--safe-top)) - max(32px, var(--safe-bottom)));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.topbar h2 {
    margin: 12px 0 0;
    font-size: clamp(1.6rem, 4vw, 3rem);
}

.progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    transition: width 0.28s ease;
}

.question-card {
    display: grid;
    align-content: center;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    padding: clamp(24px, 5vw, 56px);
    gap: 12px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.phase-intro {
    max-width: 760px;
    color: #94a6bf;
    line-height: 1.6;
}

.question-card h3 {
    max-width: min(1120px, 100%);
    margin: 0 0 10px;
    font-size: clamp(2rem, 3.85vw, 3.85rem);
    line-height: 1.06;
    letter-spacing: 0;
    text-wrap: balance;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.question-helper {
    margin: 0;
    color: #9facbe;
    line-height: 1.45;
}

.question-example {
    margin: 0;
    color: #9be9ff;
    font-weight: 800;
    line-height: 1.45;
}

.answer-zone {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.setup-alert {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid rgba(255, 174, 61, 0.35);
    border-radius: 18px;
    color: #ffd89d;
    background: rgba(255, 174, 61, 0.08);
    line-height: 1.5;
}

.setup-alert span {
    color: #f2d8b5;
}

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

.answer-btn {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid rgba(165, 190, 235, 0.18);
    border-radius: 20px;
    color: var(--text);
    background: rgba(7, 16, 30, 0.76);
    cursor: pointer;
    font-size: clamp(0.88rem, 1.15vw, 1rem);
    font-weight: 900;
    line-height: 1.15;
    overflow-wrap: anywhere;
    touch-action: manipulation;
}

.answer-btn span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.answer-btn.is-selected {
    border-color: rgba(47, 124, 255, 0.9);
    background: linear-gradient(145deg, rgba(47, 124, 255, 0.92), rgba(24, 212, 210, 0.52));
    box-shadow: 0 18px 36px rgba(47, 124, 255, 0.25);
}

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

.save-state {
    min-height: 22px;
    margin: 14px 0 0;
    color: #8edcff;
    font-weight: 800;
}

.question-nav {
    display: grid;
    grid-template-columns: minmax(120px, 220px) 1fr;
    gap: 14px;
}

.screen-result {
    display: grid;
    align-content: start;
    gap: 18px;
    width: min(960px, 100%);
    margin: 0 auto;
    padding-bottom: 18px;
}

.screen-result > * {
    min-width: 0;
}

.screen-result:not(.is-hidden) {
    min-height: auto;
}

.result-hero {
    margin: 22px 0 0;
    padding: clamp(26px, 4vw, 46px);
}

.result-hero h2 {
    margin: 14px 0;
    font-size: clamp(2rem, 6vw, 4.2rem);
}

.result-hero p {
    max-width: 900px;
    color: #c5d3e8;
    font-size: 1.08rem;
    line-height: 1.7;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.student-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    padding: 22px;
    border: 1px solid rgba(165, 190, 235, 0.16);
    border-radius: 24px;
    background: rgba(16, 28, 47, 0.76);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.16);
}

.summary-main,
.summary-path-card,
.summary-ranking-card,
.summary-comparison-card {
    grid-column: 1 / -1;
}

.summary-card > span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-bottom: 12px;
    padding: 0 11px;
    border: 1px solid rgba(24, 212, 210, 0.24);
    border-radius: 999px;
    color: #9be9ff;
    background: rgba(24, 212, 210, 0.08);
    font-size: 0.74rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-card h3,
.detail-head h3 {
    margin: 0;
    color: #f4f8ff;
}

.summary-card p {
    margin: 8px 0 0;
    color: #c5d3e8;
    line-height: 1.55;
}

.summary-job-list {
    display: grid;
    gap: 10px;
}

.summary-job-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 13px;
    border: 1px solid rgba(165, 190, 235, 0.13);
    border-radius: 18px;
    background: rgba(6, 13, 24, 0.38);
}

.summary-job-card > span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    font-weight: 950;
}

.summary-job-card h4 {
    margin: 0;
    color: #f4f8ff;
}

.summary-job-card p {
    margin-top: 4px;
    color: #aebbd0;
    font-size: 0.94rem;
    line-height: 1.45;
}

.summary-job-alert {
    color: #ffd48f !important;
    font-weight: 850;
}

.summary-choice-card small {
    display: inline-flex;
    margin-top: 8px;
    color: #75e8ff;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.summary-path-flow {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.summary-path-flow li {
    position: relative;
    min-height: 44px;
    padding: 12px 14px 12px 42px;
    border: 1px solid rgba(165, 190, 235, 0.13);
    border-radius: 16px;
    color: #eef5ff;
    background: rgba(255, 255, 255, 0.045);
    font-weight: 850;
}

.summary-path-flow li::before {
    content: "";
    position: absolute;
    left: 17px;
    top: 17px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 0 0 5px rgba(47, 124, 255, 0.12);
}

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

.summary-open-grid > div {
    padding: 14px;
    border: 1px solid rgba(165, 190, 235, 0.13);
    border-radius: 18px;
    background: rgba(6, 13, 24, 0.34);
}

.summary-open-grid h4 {
    margin: 0 0 8px;
    color: #f4f8ff;
    font-size: 0.95rem;
}

.summary-open-grid ul {
    display: grid;
    gap: 7px;
    margin: 0;
    padding-left: 18px;
    color: #c5d3e8;
    line-height: 1.45;
}

.summary-action-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding-left: 22px;
    color: #d5dfef;
    line-height: 1.5;
}

.summary-ranking-list {
    display: grid;
    gap: 10px;
}

.summary-ranking-item {
    padding: 14px 16px;
    border: 1px solid rgba(165, 190, 235, 0.13);
    border-radius: 18px;
    background: rgba(6, 13, 24, 0.34);
}

.summary-ranking-item strong {
    display: block;
    margin-bottom: 5px;
    color: #f4f8ff;
    font-size: 1rem;
}

.summary-ranking-item p {
    margin: 0;
}

.summary-comparison-table {
    display: grid;
    gap: 8px;
}

.summary-comparison-row {
    display: grid;
    grid-template-columns: 0.78fr 1.18fr 1.18fr 1.18fr;
    gap: 12px;
    align-items: start;
    padding: 13px 14px;
    border: 1px solid rgba(165, 190, 235, 0.13);
    border-radius: 18px;
    background: rgba(6, 13, 24, 0.34);
}

.summary-comparison-head {
    min-height: 42px;
    padding-top: 10px;
    padding-bottom: 10px;
    color: #9be9ff;
    background: rgba(24, 212, 210, 0.08);
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.summary-comparison-row > strong {
    color: #f4f8ff;
    line-height: 1.25;
}

.summary-comparison-row ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 18px;
    color: #c5d3e8;
    line-height: 1.42;
}

.summary-comparison-empty {
    color: #8f9db2;
    font-style: italic;
}

.detail-section {
    display: grid;
    gap: 16px;
    margin-top: 10px;
}

.detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border: 1px solid rgba(165, 190, 235, 0.16);
    border-radius: 24px;
    background: rgba(16, 28, 47, 0.72);
}

.result-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.result-panel {
    padding: 24px;
    height: auto;
    min-height: 0;
}

.result-panel h3 {
    margin-bottom: 16px;
    font-size: 1.2rem;
}

.result-panel ul {
    margin: 0;
    padding-left: 20px;
    color: #d5dfef;
    line-height: 1.6;
}

.warning-panel {
    border-color: rgba(255, 174, 61, 0.25);
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.family-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    font-weight: 900;
}

.job-list {
    display: grid;
    gap: 12px;
    align-items: start;
}

.job-card {
    padding: 16px;
    border: 1px solid rgba(165, 190, 235, 0.14);
    border-radius: 18px;
    background: rgba(6, 13, 24, 0.42);
}

.job-card h4 {
    margin: 0 0 8px;
}

.job-domain {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-bottom: 10px;
    padding: 0 10px;
    border: 1px solid rgba(24, 212, 210, 0.22);
    border-radius: 999px;
    color: #9be9ff;
    background: rgba(24, 212, 210, 0.08);
    font-size: 0.78rem;
    font-weight: 900;
}

.job-card p {
    margin: 0 0 10px;
    color: #bac8dc;
    line-height: 1.5;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #9facbe;
    font-size: 0.88rem;
}

.job-score-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.job-score-strip span {
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #dbe8ff;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.78rem;
    font-weight: 900;
}

.job-study-path {
    margin-top: 12px;
    color: #d5e5ff;
    font-weight: 800;
}

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

.job-report-block {
    padding: 12px 13px;
    border: 1px solid rgba(165, 190, 235, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
}

.job-report-block h5 {
    margin: 0 0 7px;
    color: #9be9ff;
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.job-report-block p {
    margin: 0;
    color: #c8d5e8;
}

.job-report-block ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 18px;
    color: #c8d5e8;
    line-height: 1.42;
}

.job-risk-list {
    display: grid;
    gap: 6px;
    margin: 12px 0 0;
    padding-left: 18px;
    color: #ffd7a8;
    line-height: 1.35;
    font-size: 0.88rem;
}

.job-warning-list,
.job-blocking-list {
    display: grid;
    gap: 6px;
    margin: 12px 0 0;
    padding: 11px 12px 11px 30px;
    border-radius: 14px;
    line-height: 1.35;
    font-size: 0.88rem;
    font-weight: 800;
}

.job-warning-list {
    border: 1px solid rgba(255, 190, 96, 0.25);
    color: #ffe0a8;
    background: rgba(255, 170, 61, 0.08);
}

.job-blocking-list {
    border: 1px solid rgba(255, 100, 100, 0.25);
    color: #ffb6b6;
    background: rgba(255, 95, 95, 0.08);
}

.school-path-panel {
    grid-column: 1 / -1;
}

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

.school-path-card,
.job-card .school-path-head {
    padding: 16px;
    border: 1px solid rgba(24, 212, 210, 0.16);
    border-radius: 18px;
    background: rgba(7, 16, 30, 0.48);
}

.job-card .school-path-head {
    margin-top: 12px;
    padding: 12px;
}

.school-path-head {
    display: grid;
    gap: 8px;
}

.school-path-head span {
    width: fit-content;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #9be9ff;
    background: rgba(24, 212, 210, 0.11);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.school-path-head h4 {
    margin: 0;
    color: #eef5ff;
}

.school-path-head p {
    margin: 0;
    color: #bac8dc;
    line-height: 1.5;
}

.school-path-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.school-path-step {
    position: relative;
    display: grid;
    align-content: start;
    gap: 6px;
    min-height: 0;
    padding: 13px 14px 13px 44px;
    border: 1px solid rgba(165, 190, 235, 0.14);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
}

.school-path-step::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    box-shadow: 0 0 0 5px rgba(47, 124, 255, 0.12);
}

.school-path-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 22px;
    top: 34px;
    bottom: -22px;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(to bottom, rgba(142, 220, 255, 0.8), rgba(142, 220, 255, 0));
}

.path-step-type {
    color: #8edcff;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.school-path-step strong {
    color: #f4f8ff;
    line-height: 1.2;
}

.school-path-step em {
    color: #ffcf69;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 900;
}

.school-path-step p {
    margin: 0;
    color: #aebbd0;
    font-size: 0.86rem;
    line-height: 1.4;
}

.path-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.path-subjects span {
    padding: 8px 10px;
    border: 1px solid rgba(165, 190, 235, 0.13);
    border-radius: 999px;
    color: #ccd8ea;
    background: rgba(255, 255, 255, 0.045);
    font-size: 0.84rem;
}

.path-fallback {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.job-card-ambitious {
    border-color: rgba(47, 124, 255, 0.26);
}

.job-card-discouraged {
    border-color: rgba(255, 107, 107, 0.24);
}

.ambitious-panel {
    border-color: rgba(47, 124, 255, 0.25);
}

.empty-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.debug-panel {
    grid-column: 1 / -1;
    border-color: rgba(155, 233, 255, 0.28);
}

.debug-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.debug-block {
    padding: 14px;
    border: 1px solid rgba(165, 190, 235, 0.14);
    border-radius: 16px;
    background: rgba(6, 13, 24, 0.42);
}

.debug-block h4 {
    margin: 0 0 10px;
    color: #9be9ff;
}

.debug-block ul {
    padding-left: 18px;
    font-size: 0.88rem;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 4;
    max-width: min(520px, calc(100vw - 28px));
    padding: 14px 18px;
    border: 1px solid rgba(165, 190, 235, 0.18);
    border-radius: 16px;
    color: var(--text);
    background: rgba(8, 17, 31, 0.94);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, calc(100% + 28px));
    transition: transform 0.22s ease, opacity 0.22s ease, visibility 0s linear 0.22s;
}

.toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: transform 0.22s ease, opacity 0.22s ease;
}

@media (max-width: 780px) {
    .app-shell {
        width: min(100vw - 24px, 620px);
        padding-top: max(18px, var(--safe-top));
        padding-bottom: max(18px, var(--safe-bottom));
    }

    .screen-welcome {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        align-content: start;
        gap: 18px;
        min-height: auto;
    }

    .brand-block {
        position: relative;
        z-index: 1;
        padding: 12px 0 0;
    }

    h1 {
        margin-bottom: 12px;
        font-size: clamp(3.4rem, 17vw, 5.4rem);
        line-height: 0.88;
    }

    .brand-block p {
        font-size: 1rem;
        line-height: 1.48;
    }

    .start-card {
        position: relative;
        z-index: 2;
        width: 100%;
        max-width: 560px;
        margin: 0 auto;
        padding: 22px;
        gap: 14px;
    }

    .start-card,
    .question-card,
    .result-panel,
    .result-hero {
        border-radius: 24px;
    }

    .split-fields,
    .student-summary-grid,
    .result-grid,
    .choice-grid,
    .debug-list {
        grid-template-columns: 1fr;
    }

    .school-path-flow {
        grid-template-columns: 1fr;
    }

    .summary-open-grid {
        grid-template-columns: 1fr;
    }

    .summary-comparison-head {
        display: none;
    }

    .summary-comparison-row {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .summary-comparison-row > strong {
        padding-bottom: 3px;
        border-bottom: 1px solid rgba(165, 190, 235, 0.12);
    }

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

    .answer-btn {
        min-height: 58px;
    }

    .topbar {
        align-items: flex-start;
    }

    .question-nav {
        grid-template-columns: 1fr 1.3fr;
    }
}

@media (max-width: 560px) {
    .app-shell {
        width: 100%;
        padding-right: 14px;
        padding-left: 14px;
    }

    .screen-welcome {
        gap: 14px;
        padding-top: 8px;
    }

    .screen {
        min-height: calc(100vh - 28px);
        min-height: calc(100svh - 28px);
        min-height: calc(var(--app-height) - 28px);
    }

    .eyebrow {
        max-width: 100%;
        min-height: 28px;
        padding: 6px 12px;
        line-height: 1.15;
        white-space: normal;
    }

    h1 {
        margin-bottom: 10px;
        font-size: clamp(2.85rem, 15.8vw, 4.2rem);
        line-height: 0.92;
    }

    .brand-block p {
        margin-bottom: 0;
        font-size: 0.95rem;
        line-height: 1.44;
    }

    .start-card {
        gap: 12px;
        padding: 18px;
        border-radius: 22px;
    }

    label {
        gap: 7px;
        font-size: 0.96rem;
    }

    input,
    select {
        min-height: 50px;
        border-radius: 16px;
        padding-left: 14px;
    }

    .primary-btn {
        min-height: 52px;
    }

    .privacy-note {
        font-size: 0.88rem;
        line-height: 1.45;
    }

    .screen-question {
        grid-template-rows: auto auto minmax(0, 1fr) auto;
        gap: 12px;
        padding: 0;
        height: calc(var(--app-height) - max(18px, var(--safe-top)) - max(18px, var(--safe-bottom)));
        min-height: calc(var(--app-height) - max(18px, var(--safe-top)) - max(18px, var(--safe-bottom)));
        max-height: calc(var(--app-height) - max(18px, var(--safe-top)) - max(18px, var(--safe-bottom)));
    }

    .topbar {
        gap: 10px;
    }

    .phase-label {
        min-height: 26px;
        padding: 0 11px;
        font-size: 0.68rem;
    }

    .topbar h2 {
        margin-top: 8px;
        font-size: 1.45rem;
    }

    .ghost-btn {
        min-height: 40px;
        padding: 0 14px;
        border-radius: 13px;
        font-size: 0.88rem;
    }

    .progress-track {
        height: 8px;
    }

    .question-card {
        align-content: start;
        min-height: 0;
        max-height: 100%;
        padding: 22px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .phase-intro {
        margin-bottom: 14px;
        font-size: 0.94rem;
        line-height: 1.45;
    }

    .question-card h3 {
        font-size: clamp(1.55rem, 7vw, 2.2rem);
        line-height: 1.12;
    }

    .question-helper {
        margin-bottom: 0;
        font-size: 0.94rem;
        line-height: 1.45;
    }

    .question-example {
        font-size: 0.9rem;
    }

    .answer-zone {
        margin-top: 14px;
        gap: 10px;
    }

    .answer-btn {
        min-height: 54px;
        border-radius: 17px;
    }

    .save-state {
        min-height: 18px;
        margin-top: 10px;
        font-size: 0.85rem;
    }

    .question-nav {
        position: sticky;
        bottom: max(10px, var(--safe-bottom));
        z-index: 2;
        grid-template-columns: 0.85fr 1.45fr;
        gap: 10px;
        padding-top: 8px;
        background: linear-gradient(to top, rgba(8, 17, 31, 0.98), rgba(8, 17, 31, 0));
    }

    .primary-btn,
    .secondary-btn {
        min-height: 54px;
        border-radius: 17px;
        padding: 0 14px;
    }

    .result-hero {
        margin-top: 0;
    }

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

    .student-summary-grid {
        gap: 12px;
    }

    .summary-card,
    .detail-head {
        padding: 18px;
        border-radius: 22px;
    }

    .detail-head {
        display: grid;
    }

    .summary-job-card {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 10px;
    }

    .summary-job-card > span {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .result-panel {
        padding: 20px;
    }

    .toast {
        bottom: max(12px, var(--safe-bottom));
    }
}

@media (min-width: 781px) and (max-width: 1180px) {
    .app-shell {
        width: min(100vw - 44px, 980px);
    }

    .screen-welcome {
        grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
        gap: 34px;
    }

    h1 {
        font-size: clamp(4.6rem, 10vw, 6.6rem);
    }

    .question-card {
        min-height: 0;
    }

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

@media (min-width: 781px) and (max-width: 1024px) and (orientation: portrait) {
    .screen-welcome {
        grid-template-columns: 1fr;
        align-content: center;
        max-width: 680px;
        margin: 0 auto;
    }

    .brand-block {
        padding-bottom: 0;
    }

    .start-card {
        width: 100%;
    }

    .question-card {
        min-height: 0;
    }

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

@media (max-height: 760px) {
    .screen-question {
        gap: 10px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .topbar h2 {
        margin-top: 4px;
        font-size: clamp(1.28rem, 3.6vh, 2.2rem);
    }

    .progress-track {
        height: 7px;
    }

    .question-card {
        padding: clamp(16px, 3.6vw, 34px);
        gap: 9px;
    }

    .phase-intro,
    .question-helper,
    .question-example {
        font-size: 0.92rem;
        line-height: 1.35;
    }

    .question-card h3 {
        margin-bottom: 4px;
        font-size: clamp(1.5rem, 6.4vh, 3rem);
        line-height: 1.08;
    }

    .answer-zone {
        margin-top: 10px;
        gap: 9px;
    }

    .answer-btn {
        min-height: 50px;
        padding: 8px 10px;
        border-radius: 16px;
        font-size: clamp(0.78rem, 2.25vh, 0.95rem);
    }

    .answer-btn span {
        margin-top: 2px;
        font-size: 0.68rem;
    }

    .question-nav {
        gap: 9px;
    }

    .primary-btn,
    .secondary-btn {
        min-height: 48px;
    }
}

@media (min-width: 1025px) and (orientation: landscape) {
    .screen-question {
        max-width: 1040px;
        margin: 0 auto;
    }
}
