:root {
  --navy: #07172d;
  --navy-2: #0c213d;
  --navy-3: #142c4d;
  --canvas: #eef3f8;
  --paper: #ffffff;
  --ink: #10213a;
  --muted: #5d6d82;
  --muted-dark: #a8b8ce;
  --line: #d9e2ec;
  --line-dark: rgba(194, 211, 232, .17);
  --action: #2f72e8;
  --action-hover: #225fc9;
  --action-soft: #eaf2ff;
  --success: #27945b;
  --warning: #c67a17;
  --danger: #c74455;
  --locked: #7b8798;
  --shadow: 0 18px 42px rgba(25, 48, 78, .13);
  --shadow-dark: 0 18px 42px rgba(2, 12, 27, .32);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { color-scheme: light; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(70, 137, 246, .48); outline-offset: 2px; }
.app { min-height: 100vh; }
.workspace { min-height: calc(100vh - 68px); }
.page-view { animation: page-in .2s var(--ease); }
@keyframes page-in { from { opacity: .72; transform: translateY(4px); } }
.kicker { margin: 0; color: var(--action); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .7rem 1rem; border: 1px solid transparent; border-radius: 8px; font-weight: 760; transition: background .18s, border-color .18s, color .18s, transform .18s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--action); }
.button.primary:hover:not(:disabled) { background: var(--action-hover); }
.button.secondary { color: var(--ink); border-color: #c9d5e3; background: #fff; }
.button.secondary:hover:not(:disabled) { border-color: #8fa9c7; background: #f8fbff; }
.button.wide { width: 100%; }
.text-action { padding: .25rem 0; border: 0; color: var(--action); background: transparent; font-size: .82rem; font-weight: 750; }
.text-action:hover { color: var(--action-hover); }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--success); }
.progress-bar { height: 5px; overflow: hidden; border-radius: 2px; background: rgba(114, 137, 164, .2); }
.progress-bar span { display: block; width: 100%; height: 100%; background: var(--action); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.toast { position: fixed; z-index: 100; top: 84px; left: 50%; max-width: min(90vw, 440px); padding: .72rem 1rem; border-radius: 8px; color: #fff; background: var(--navy); box-shadow: var(--shadow-dark); opacity: 0; pointer-events: none; transform: translate(-50%, -10px); transition: .18s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Login */
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 2.5rem; background: linear-gradient(rgba(7,23,45,.2), rgba(7,23,45,.48)), url('./assets/agent-islands-map-v2.png') center / cover no-repeat; }
.login-shell { width: min(1120px, 100%); min-height: 650px; display: grid; grid-template-columns: 1.45fr .78fr; overflow: hidden; border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 30px 80px rgba(2,13,29,.32); }
.login-art { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 4.25rem; color: #fff; background: linear-gradient(0deg, rgba(7,23,45,.9), rgba(7,23,45,.05) 68%), url('./assets/agent-islands-map-v2.png') 20% center / cover no-repeat; }
.login-art::before { content: ""; position: absolute; inset: 2.2rem; border: 1px solid rgba(255,255,255,.28); border-radius: 10px; pointer-events: none; }
.login-art p { position: relative; z-index: 2; max-width: 11ch; margin: 0; font-size: 3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.17; text-wrap: balance; }
.login-tag { position: absolute; z-index: 1; top: 3.8rem; left: 4.25rem; padding: .45rem .72rem; border: 1px solid rgba(255,255,255,.48); border-radius: 6px; font-size: .78rem; font-weight: 750; }
.login-mascot { position: absolute; z-index: 1; top: 5.8rem; right: 2.8rem; width: min(43%,280px); filter: drop-shadow(0 22px 28px rgba(4,15,31,.34)); }
.login-form { align-content: center; display: grid; padding: 4rem; background: #fff; }
.site-return { width: fit-content; min-height: 34px; display: inline-flex; align-items: center; gap: .42rem; padding: .35rem .55rem; border: 1px solid transparent; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: .76rem; font-weight: 750; transition: background .18s, border-color .18s, color .18s; }
.site-return:hover { color: var(--ink); border-color: #d4dee9; background: #f6f8fb; }
.login-site-return { margin: 0 0 1.25rem -.55rem; }
.login-form h1 { margin: .95rem 0 .5rem; font-size: 2rem; letter-spacing: -.025em; }
.login-lead { margin: 0 0 2.3rem; color: var(--muted); line-height: 1.65; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: .35rem; border-bottom: 1px solid #d8e1eb; }
.auth-tabs button { min-height: 42px; padding: .55rem; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font: inherit; font-size: .82rem; font-weight: 750; cursor: pointer; }
.auth-tabs button:hover { color: var(--ink); background: #f6f8fb; }
.auth-tabs button[aria-selected="true"] { color: var(--action); border-bottom-color: var(--action); }
.auth-tabs button:focus-visible { outline: 3px solid rgba(47,114,232,.2); outline-offset: 2px; }
.login-form label { display: grid; gap: .45rem; margin-top: 1rem; font-size: .82rem; font-weight: 750; }
.login-form input { min-height: 50px; width: 100%; padding: .78rem .9rem; border: 1px solid #cbd6e2; border-radius: 7px; color: var(--ink); background: #fff; }
.login-form input:hover { border-color: #90a4bc; }
.login-form input:focus { border-color: var(--action); box-shadow: 0 0 0 3px rgba(47,114,232,.12); outline: 0; }
.form-error { min-height: 1.3rem; margin: .65rem 0 .1rem; color: var(--danger); font-size: .82rem; }
.login-note { display: flex; align-items: center; gap: .5rem; margin: 1.1rem 0 0; color: var(--muted); font-size: .76rem; }

/* Application chrome */
.topbar { position: sticky; z-index: 50; top: 0; height: 68px; display: grid; grid-template-columns: 240px auto 1fr auto; align-items: center; gap: 1.2rem; padding: 0 1.5rem; color: #fff; background: var(--navy); border-bottom: 1px solid rgba(255,255,255,.09); }
.brand { display: flex; align-items: center; gap: .7rem; padding: 0; border: 0; color: #fff; background: transparent; font-size: 1.08rem; font-weight: 800; }
.brand-symbol { position: relative; width: 29px; height: 29px; display: inline-block; }
.brand-symbol i { position: absolute; left: 11px; top: 2px; width: 8px; height: 15px; border-radius: 8px 8px 3px 3px; background: #4d8bf2; transform-origin: 4px 13px; }
.brand-symbol i:nth-child(2) { transform: rotate(120deg); }
.brand-symbol i:nth-child(3) { transform: rotate(240deg); }
.main-nav { align-self: stretch; display: flex; align-items: stretch; gap: .15rem; }
.nav-item { position: relative; min-width: 76px; padding: 0 .85rem; border: 0; color: #9fb1c9; background: transparent; font-size: .82rem; font-weight: 720; }
.nav-item:hover { color: #fff; }
.nav-item.active { color: #fff; }
.nav-item.active::after { content: ""; position: absolute; right: .8rem; bottom: 0; left: .8rem; height: 3px; background: #62a0ff; }
.top-context { justify-self: end; display: grid; padding-right: 1.25rem; border-right: 1px solid rgba(255,255,255,.11); text-align: right; }
.top-context span { color: #7286a2; font-size: .68rem; }
.top-context b { max-width: 180px; overflow: hidden; color: #c8d5e5; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: .8rem; }
.topbar-site-return { flex: 0 0 auto; color: #9db0c8; }
.topbar-site-return:hover { color: #fff; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.04); }
.user-chip { display: flex; align-items: center; gap: .58rem; padding: .25rem .35rem; border: 1px solid transparent; border-radius: 9px; color: inherit; background: transparent; text-align: left; }
.user-chip:hover { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.04); }
.user-chip > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; color: #dfe9f6; background: var(--navy-2); font-size: .76rem; font-weight: 800; }
.user-chip > span:first-child img, .avatar-large img, .rank-avatar img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; }
.user-chip > span:last-child { display: grid; }
.user-chip b { max-width: 100px; overflow: hidden; color: #eef4fb; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { color: #70849f; font-size: .62rem; }
.icon-button { padding: .45rem .62rem; border: 1px solid rgba(255,255,255,.12); border-radius: 6px; color: #9db0c8; background: transparent; font-size: .72rem; }
.icon-button:hover { color: #fff; border-color: rgba(255,255,255,.3); }

/* Shared platform pages */
.standard-page, .home-view { width: min(1240px, calc(100% - 3rem)); margin: 0 auto; padding: 2.5rem 0 4.5rem; }
.page-header { max-width: 760px; padding: 1.2rem 0 2.1rem; }
.page-header h1 { margin: .6rem 0 .65rem; font-size: 2.8rem; letter-spacing: -.03em; line-height: 1.08; }
.page-header > p:last-child { max-width: 65ch; margin: 0; color: var(--muted); font-size: .98rem; line-height: 1.75; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.25rem; }
.section-heading h2 { margin: .4rem 0 0; font-size: 1.55rem; letter-spacing: -.02em; }
.section-heading > p { max-width: 38ch; margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.6; }
.category-row, .catalog-toolbar, .skill-filter { display: flex; align-items: center; gap: .55rem; }
.filter-chip { min-height: 34px; padding: .38rem .8rem; border: 1px solid #d2dce7; border-radius: 999px; color: #4d5d72; background: #fff; font-size: .76rem; font-weight: 700; }
.filter-chip:hover:not(:disabled), .filter-chip.active { color: #fff; border-color: var(--action); background: var(--action); }
.course-status { color: var(--action); font-size: .72rem; font-weight: 800; }
.course-meta { display: flex; flex-wrap: wrap; gap: .65rem 1.2rem; color: var(--muted); font-size: .76rem; }
.course-meta > span { position: relative; }
.course-meta > span + span::before { content: ""; position: absolute; top: 50%; left: -.65rem; width: 3px; height: 3px; border-radius: 50%; background: #99a8b9; }
.release-note { display: grid; grid-template-columns: 110px 1fr; gap: 1.5rem; margin-top: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.release-note span { color: var(--ink); font-size: .78rem; font-weight: 780; }
.release-note p { margin: 0; font-size: .82rem; line-height: 1.65; }

/* Home */
.home-view { display: grid; grid-template-columns: minmax(0, 2.05fr) minmax(280px, .95fr); gap: 1.2rem; }
.home-hero { min-height: 430px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(290px, .85fr); overflow: hidden; border-radius: 14px; color: #fff; background: var(--navy); box-shadow: var(--shadow-dark); }
.hero-copy { align-content: center; display: grid; padding: 3rem; }
.hero-copy .kicker { color: #78adff; }
.pathline { display: flex; align-items: center; gap: .7rem; margin: .8rem 0 0; color: #b9c9dc; font-size: .75rem; font-weight: 740; }
.pathline i { color: #5c718d; font-style: normal; }
.hero-copy h1 { margin: .8rem 0 1rem; max-width: 12ch; font-size: 2.75rem; letter-spacing: -.035em; line-height: 1.08; text-wrap: balance; }
.hero-copy > p:not(.kicker):not(.pathline) { max-width: 52ch; margin: 0; color: #b7c6d9; font-size: .92rem; line-height: 1.72; }
.hero-progress { display: grid; grid-template-columns: 1fr auto; gap: .55rem; margin-top: 1.65rem; color: #aebed2; font-size: .75rem; }
.hero-progress b { color: #fff; font-variant-numeric: tabular-nums; }
.hero-progress .progress-bar { grid-column: 1 / -1; background: rgba(255,255,255,.13); }
.hero-actions { display: flex; gap: .65rem; margin-top: 1.5rem; }
.hero-actions .secondary { color: #e7eef8; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.05); }
.hero-actions .secondary:hover { background: rgba(255,255,255,.1); }
.hero-map { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 2rem; background: linear-gradient(0deg, rgba(7,23,45,.87), transparent 66%), url('./assets/agent-islands-map-v2.png') 47% center / cover no-repeat; }
.hero-map::before { content: ""; position: absolute; inset: 1rem; border: 1px solid rgba(255,255,255,.24); border-radius: 9px; }
.hero-map > * { position: relative; }
.hero-robot { position: absolute; z-index: 1; top: 3.6rem; right: 1.4rem; width: min(82%,230px); filter: drop-shadow(0 18px 18px rgba(4,18,39,.26)); }
.map-stamp { padding: .3rem .5rem; border: 1px solid rgba(255,255,255,.35); border-radius: 5px; color: #d8e7fa; font-size: .68rem; font-weight: 760; }
.hero-map strong { margin-top: .55rem; font-size: 2.1rem; letter-spacing: -.03em; }
.hero-map small { margin-top: .18rem; color: #c0cee0; }
.home-status { position: relative; min-height: 430px; display: flex; flex-direction: column; padding: 1.5rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.status-head { display: flex; align-items: center; gap: .85rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.avatar-large { width: 52px; height: 52px; display: grid; flex: 0 0 auto; place-items: center; overflow: hidden; padding: 0; border: 2px solid #d8e3ef; border-radius: 50%; color: #fff; background: var(--navy); font-weight: 800; transition: border-color .18s, transform .18s; }
.avatar-large:hover { border-color: var(--action); transform: translateY(-1px); }
.status-head > div { display: grid; gap: .15rem; }
.status-head span:not(.avatar-large) { color: var(--muted); font-size: .72rem; }
.status-head strong { font-size: 1rem; }
.avatar-change { justify-self: start; padding: 0; border: 0; color: var(--action); background: transparent; font-size: .68rem; font-weight: 730; }
.avatar-picker { position: absolute; z-index: 15; top: 5.1rem; right: 1rem; left: 1rem; padding: 1rem; border: 1px solid #cfdbe8; border-radius: 12px; background: #fff; box-shadow: 0 18px 42px rgba(25,48,78,.2); }
.avatar-picker-head { display: flex; align-items: center; justify-content: space-between; }
.avatar-picker-head strong { font-size: .86rem; }
.avatar-picker-head button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: #f0f4f8; font-size: 1.1rem; line-height: 1; }
.avatar-filter { display: flex; gap: .35rem; margin-top: .65rem; }
.avatar-filter button { min-height: 28px; padding: .25rem .62rem; border: 1px solid #d5dfeb; border-radius: 999px; color: var(--muted); background: #fff; font-size: .68rem; }
.avatar-filter button.active { color: #fff; border-color: var(--action); background: var(--action); }
.avatar-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: .42rem; max-height: 190px; margin-top: .75rem; overflow: auto; }
.avatar-option { aspect-ratio: 1; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 50%; background: #edf2f7; }
.avatar-option:hover, .avatar-option[aria-pressed="true"] { border-color: var(--action); }
.avatar-option img { width: 100%; height: 100%; display: block; object-fit: cover; }
.personal-stats { display: grid; gap: 0; margin: 1rem 0; }
.personal-stats > div { display: flex; justify-content: space-between; align-items: baseline; padding: .85rem 0; border-bottom: 1px solid #e8edf3; }
.personal-stats dt { color: var(--muted); font-size: .75rem; }
.personal-stats dd { margin: 0; font-size: 1.1rem; font-weight: 790; font-variant-numeric: tabular-nums; }
.achievement-summary { padding: .9rem 0 1rem; border-bottom: 1px solid #e8edf3; }
.achievement-summary > div:first-child { display: flex; align-items: baseline; justify-content: space-between; }
.achievement-summary > div:first-child span { color: var(--muted); font-size: .75rem; }
.achievement-summary > div:first-child b { font-size: .75rem; font-variant-numeric: tabular-nums; }
.achievement-preview { min-height: 50px; display: flex; align-items: center; gap: .55rem; margin: .7rem 0 .35rem; }
.achievement-preview-item { position: relative; width: 46px; height: 46px; display: grid; place-items: center; }
.achievement-preview-item img { width: 44px; height: 44px; object-fit: contain; }
.achievement-preview-item.locked { filter: grayscale(1); opacity: .28; }
.achievement-summary .text-action { font-size: .72rem; }
.home-status .text-action { align-self: flex-start; margin-top: auto; }
.status-sync { display: flex; align-items: center; gap: .45rem; margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .7rem; }
.achievement-wall { grid-column: 1 / -1; padding: 1.4rem 1.5rem 1.5rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; animation: achievement-in .22s var(--ease); }
.achievement-wall-meta { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: .75rem; }
.achievement-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.achievement-item { min-width: 0; display: grid; grid-template-columns: 54px minmax(0,1fr); align-items: center; gap: .7rem; min-height: 92px; padding: .8rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.achievement-item img { width: 52px; height: 52px; object-fit: contain; }
.achievement-item div { min-width: 0; display: grid; gap: .2rem; }
.achievement-item strong { font-size: .78rem; }
.achievement-item span { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.achievement-item.locked img { filter: grayscale(1); opacity: .22; }
.achievement-item.locked strong { color: #7a8798; }
.achievement-item.pending { background: #f7f9fc; }
@keyframes achievement-in { from { opacity: .65; transform: translateY(-6px); } }
.home-library { grid-column: 1 / -1; margin-top: 1.5rem; }
.home-library .category-row { margin-bottom: 1rem; }
.featured-course { width: 100%; display: grid; grid-template-columns: 240px minmax(0, 1fr) auto; align-items: stretch; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; text-align: left; transition: transform .2s var(--ease), box-shadow .2s; }
.featured-course:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.course-visual { position: relative; min-height: 180px; display: flex; flex-direction: column; justify-content: space-between; padding: 1.35rem; color: #fff; background: linear-gradient(0deg, rgba(7,23,45,.64), rgba(7,23,45,.03)), url('./assets/agent-islands-map-v2.png') 15% center / cover no-repeat; }
.course-visual b { letter-spacing: .18em; font-size: .72rem; }
.course-visual i { align-self: flex-end; font-size: 3.5rem; font-style: normal; font-weight: 800; letter-spacing: -.05em; }
.course-mascot { position: absolute; right: .8rem; bottom: .8rem; width: 116px; filter: drop-shadow(0 12px 14px rgba(4,18,39,.28)); }
.course-info { align-content: center; display: grid; gap: .5rem; padding: 1.5rem 1.8rem; }
.course-info > strong { font-size: 1.55rem; letter-spacing: -.02em; }
.course-info > span:nth-child(3) { color: var(--muted); font-size: .88rem; }
.course-cta { align-self: center; padding: 1.8rem; color: var(--action); font-size: .82rem; font-weight: 780; white-space: nowrap; }
.utility-links { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.utility-links button { min-height: 96px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; text-align: left; }
.utility-links button:hover { border-color: #a9bdd5; background: #f9fbfe; }
.utility-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; color: var(--action); background: var(--action-soft); font-size: 1.15rem; font-weight: 800; }
.utility-icon img { width: 34px; height: 34px; object-fit: contain; }
.utility-links button > span:nth-child(2) { display: grid; gap: .22rem; }
.utility-links b { font-size: .88rem; }
.utility-links small { color: var(--muted); font-size: .72rem; }
.utility-links i { color: var(--action); font-style: normal; }

/* Catalog and course detail */
.catalog-toolbar { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.catalog-toolbar > span { margin-left: auto; color: var(--muted); font-size: .75rem; }
.catalog-course { width: 100%; display: grid; grid-template-columns: 230px minmax(0,1fr) auto; align-items: stretch; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; text-align: left; transition: transform .2s, box-shadow .2s; }
.catalog-course:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.catalog-cover { position: relative; min-height: 250px; display: flex; flex-direction: column; justify-content: space-between; padding: 1.5rem; color: #fff; background: linear-gradient(0deg, rgba(7,23,45,.76), rgba(7,23,45,.04)), url('./assets/agent-islands-map-v2.png') 18% center / cover no-repeat; }
.catalog-cover i { font-style: normal; font-size: .76rem; font-weight: 800; }
.catalog-cover b { font-size: 2rem; line-height: 1.05; }
.catalog-mascot { position: absolute; top: 3.25rem; right: 1rem; width: 150px; filter: drop-shadow(0 14px 16px rgba(4,18,39,.3)); }
.catalog-body { align-content: center; display: grid; gap: .65rem; padding: 2rem; }
.catalog-body > strong { font-size: 1.75rem; }
.catalog-body p { max-width: 64ch; margin: 0; color: var(--muted); line-height: 1.68; }
.catalog-action { align-self: center; padding: 2rem; color: var(--action); font-size: .82rem; font-weight: 780; white-space: nowrap; }
.empty-roadmap { margin-top: 2rem; padding: 1.5rem 0 0 250px; border-top: 1px solid var(--line); }
.empty-roadmap span { color: var(--muted); font-size: .72rem; }
.empty-roadmap h2 { margin: .35rem 0 .4rem; font-size: 1rem; }
.empty-roadmap p { margin: 0; color: var(--muted); font-size: .82rem; }
.breadcrumb { display: flex; gap: .5rem; margin-bottom: 1rem; color: var(--muted); font-size: .76rem; }
.breadcrumb button { padding: 0; border: 0; color: var(--action); background: transparent; }
.course-hero { min-height: 350px; display: grid; grid-template-columns: minmax(0,1fr) 42%; overflow: hidden; border-radius: 14px; color: #fff; background: var(--navy); box-shadow: var(--shadow-dark); }
.course-hero > div:first-child { align-content: center; display: grid; padding: 3rem; }
.course-hero h1 { margin: .7rem 0 .8rem; font-size: 3.2rem; letter-spacing: -.035em; }
.course-hero p { max-width: 60ch; margin: 0 0 1.4rem; color: #b8c8dc; line-height: 1.75; }
.course-hero .course-meta { color: #d3deeb; }
.course-hero-map { position: relative; overflow: hidden; background: linear-gradient(90deg, var(--navy), transparent 28%), linear-gradient(0deg, rgba(7,23,45,.5), transparent), url('./assets/agent-islands-map-v2.png') center / cover no-repeat; }
.course-hero-map img { position: absolute; right: 8%; bottom: 8%; width: min(72%,260px); filter: drop-shadow(0 18px 20px rgba(3,15,33,.3)); }
.stage-section { margin-top: 2.5rem; }
.stage-list { border-top: 1px solid var(--line); }
.stage-item { display: grid; grid-template-columns: 76px minmax(0,1fr) auto; align-items: center; gap: 1.25rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.stage-index { position: relative; width: 58px; height: 58px; display: grid; place-items: center; color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.stage-index img { width: 58px; height: 58px; object-fit: contain; }
.stage-index small { position: absolute; right: -4px; bottom: -4px; min-width: 22px; padding: 3px 4px; border: 2px solid #fff; border-radius: 999px; color: #fff; background: var(--navy); font-size: .6rem; line-height: 1; }
.stage-item.planned .stage-index { filter: grayscale(.8); opacity: .55; }
.stage-copy { display: grid; gap: .28rem; }
.stage-copy strong { font-size: 1.05rem; }
.stage-copy p { margin: 0; color: var(--muted); font-size: .82rem; }
.stage-copy small { color: var(--muted); font-size: .72rem; }
.stage-state { min-width: 150px; text-align: right; }
.stage-state span { color: var(--muted); font-size: .75rem; }

/* Leaderboard */
.leaderboard-summary { display: grid; grid-template-columns: minmax(0,1fr) minmax(320px,380px); align-items: center; gap: 2rem; margin-bottom: 1.25rem; }
.leaderboard-header { padding: 1.2rem 0; }
.leaderboard-header h1 { margin: 0; }
.rank-self { display: grid; grid-template-columns: 56px minmax(0,1fr); align-items: center; gap: .75rem 1rem; padding: 1rem 1.2rem; border-radius: 12px; color: #fff; background: var(--navy); box-shadow: var(--shadow-dark); }
.rank-position { font-size: 2rem; font-weight: 820; font-variant-numeric: tabular-nums; }
.rank-self > div { min-width: 0; display: grid; gap: .18rem; }
.rank-self > div span { color: #8fa4bf; font-size: .7rem; }
.rank-self > div strong { overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.rank-self dl { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0; padding-top: .75rem; border-top: 1px solid var(--line-dark); }
.rank-self dl div { display: grid; gap: .15rem; }
.rank-self dt { color: #8fa4bf; font-size: .68rem; }
.rank-self dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.ranking-table { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.table-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.table-head h2 { margin: 0; font-size: .94rem; }
.ranking-row { min-height: 58px; display: grid; grid-template-columns: 80px minmax(200px,1fr) minmax(150px,.7fr) 110px 110px; align-items: center; gap: .5rem; padding: 0 1.25rem; border-bottom: 1px solid #e8edf3; font-size: .82rem; }
.ranking-row:last-child { border-bottom: 0; }
.ranking-labels { min-height: 38px; color: var(--muted); background: #f6f8fb; font-size: .68rem; font-weight: 740; }
.ranking-entry.place-1 { background: #fff8e8; }
.ranking-entry.place-2 { background: #f3f6f9; }
.ranking-entry.place-3 { background: #fbf1ea; }
.ranking-entry.current:not(.place-1):not(.place-2):not(.place-3) { background: #f2f7ff; }
.ranking-entry.current { box-shadow: inset 0 0 0 1px #91b8f4; }
.rank-number { color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.place-1 .rank-number { color: #8a5a0a; }
.place-2 .rank-number { color: #536276; }
.place-3 .rank-number { color: #8c5437; }
.rank-user { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.rank-avatar { width: 32px; height: 32px; display: grid; flex: 0 0 auto; place-items: center; overflow: hidden; border-radius: 50%; color: #dce8f8; background: var(--navy-2); font-size: .7rem; font-style: normal; font-weight: 800; }
.rank-badge { width: 24px; height: 24px; flex: 0 0 auto; margin-left: .15rem; object-fit: contain; }
.rank-user b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-stage { color: var(--muted); }
.rank-done, .rank-xp { font-weight: 760; font-variant-numeric: tabular-nums; }
.table-empty { padding: 2.5rem 1.25rem; color: var(--muted); text-align: center; }

/* Skill Hub */
.skills-coming-soon { min-height: 410px; display: grid; align-content: center; justify-items: start; padding: clamp(2rem,6vw,5rem); border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.skills-coming-soon-mark { width: 64px; height: 50px; display: flex; align-items: end; gap: 7px; margin-bottom: 1.4rem; padding: 9px 10px; border: 1px solid #cbd9e8; border-radius: 10px; background: #f4f8fc; }
.skills-coming-soon-mark span { width: 9px; border-radius: 2px 2px 0 0; background: var(--action); }
.skills-coming-soon-mark span:nth-child(1) { height: 15px; opacity: .42; }
.skills-coming-soon-mark span:nth-child(2) { height: 25px; opacity: .68; }
.skills-coming-soon-mark span:nth-child(3) { height: 32px; }
.skills-status { margin: 0 0 .5rem; color: var(--action); font-size: .75rem; font-weight: 800; letter-spacing: .08em; }
.skills-coming-soon h2 { margin: 0; font-size: 1.75rem; letter-spacing: -.025em; }
.skills-coming-soon > p:not(.skills-status) { max-width: 620px; margin: .8rem 0 1.6rem; color: var(--muted); line-height: 1.75; }

/* Profile settings */
.profile-settings-grid { display: grid; grid-template-columns: 290px minmax(0,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.profile-identity { position: relative; display: grid; align-content: start; justify-items: center; padding: 2rem 1.5rem; color: #fff; background: var(--navy); text-align: center; }
.profile-avatar-large { width: 96px; height: 96px; display: grid; place-items: center; overflow: hidden; border: 3px solid rgba(255,255,255,.2); border-radius: 50%; background: var(--navy-2); }
.profile-avatar-large img { width: 100%; height: 100%; display: block; object-fit: cover; }
.profile-identity > div { display: grid; gap: .2rem; margin-top: 1rem; }
.profile-identity > div span, .profile-identity > div small { color: #8fa4bf; font-size: .75rem; }
.profile-identity > div strong { max-width: 220px; overflow: hidden; font-size: 1.18rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-identity dl { width: 100%; display: grid; gap: 0; margin: 1.5rem 0 0; }
.profile-identity dl div { display: flex; align-items: baseline; justify-content: space-between; padding: .8rem 0; border-top: 1px solid var(--line-dark); }
.profile-identity dt { color: #8fa4bf; font-size: .75rem; }
.profile-identity dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.profile-avatar-settings { min-width: 0; padding: 1.75rem; }
.profile-section-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.profile-section-head h2 { margin: 0; font-size: 1.25rem; }
.profile-section-head p { margin: .35rem 0 0; color: var(--muted); font-size: .82rem; }
.profile-section-head > span { color: var(--success); font-size: .75rem; white-space: nowrap; }
.profile-avatar-settings .avatar-filter { margin-top: 1rem; }
.profile-avatar-grid { grid-template-columns: repeat(9,minmax(44px,1fr)); max-height: none; margin-top: 1rem; overflow: visible; }
.profile-avatar-grid .avatar-option { width: 58px; max-width: 100%; justify-self: center; }
.profile-achievements { margin-top: 2rem; }
.profile-achievements .section-heading > span { color: var(--muted); font-size: .75rem; }

/* Stage map */
.dashboard { position: relative; height: calc(100vh - 68px); display: grid; grid-template-columns: 304px minmax(0,1fr) 270px; gap: 16px; overflow: hidden; padding: 16px; background: #d6e7f5; }
.journey { position: relative; min-width: 0; height: 100%; overflow: hidden; border: 1px solid rgba(7,23,45,.18); border-radius: 12px; background: #b9ddf2; isolation: isolate; }
.journey-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.map-canvas { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; background: #b9ddf2 url('./assets/agent-islands-map-v2.png') center / cover no-repeat; }
.map-canvas::after { content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(4,18,37,.08), transparent 18%, transparent 76%, rgba(4,18,37,.16)); }
.left-rail, .right-rail { position: relative; z-index: 12; min-width: 0; height: 100%; }
.current-panel, .chapter-panel { height: 100%; color: #fff; border: 1px solid var(--line-dark); border-radius: 12px; background: rgba(7,23,45,.96); box-shadow: var(--shadow-dark); }
.current-panel { display: flex; flex-direction: column; padding: 1rem; }
.mission-label { display: flex; align-items: center; justify-content: space-between; padding-bottom: .85rem; border-bottom: 1px solid var(--line-dark); }
.mission-label span { color: #dce7f5; font-size: .75rem; font-weight: 750; }
.mission-label button { padding: .2rem 0; border: 0; color: #88b6ff; background: transparent; font-size: .75rem; }
.mission-series { padding: 1.2rem 0 1rem; }
.mission-series > span { color: var(--muted-dark); font-size: .75rem; }
.mission-series h2 { margin: .35rem 0 .2rem; color: #fff; font-size: 1.35rem; letter-spacing: -.025em; }
.mission-series p { margin: 0; color: var(--muted-dark); font-size: .8rem; }
.mission-current { display: grid; gap: .42rem; padding: .9rem; border: 1px solid var(--line-dark); border-radius: 8px; background: rgba(255,255,255,.025); }
.mission-current > span { color: #77a9f7; font-size: .72rem; font-weight: 800; }
.mission-current strong { min-height: 2.8em; line-height: 1.4; }
.mission-current small { color: var(--muted-dark); }
.current-panel > .button { margin-top: 1rem; }
.mission-meta { display: flex; justify-content: space-between; gap: .4rem; margin-top: .9rem; color: var(--muted-dark); font-size: .75rem; }
.mission-meta b { color: #e5edf7; font-variant-numeric: tabular-nums; }
.chapter-panel { display: flex; flex-direction: column; padding: 1rem; }
.panel-title { display: flex; align-items: center; justify-content: space-between; padding-bottom: .8rem; border-bottom: 1px solid var(--line-dark); }
.panel-title h2 { margin: 0; font-size: .85rem; }
.panel-title span { color: var(--muted-dark); font-size: .75rem; }
#chapterProgress { display: grid; gap: .7rem; margin-top: .9rem; }
.chapter-item { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: .6rem; padding: .78rem .65rem; border: 1px solid var(--line-dark); border-radius: 8px; background: rgba(255,255,255,.02); }
.chapter-item.is-active { border-color: rgba(74,139,245,.78); background: rgba(47,114,232,.12); }
.chapter-item.is-done .chapter-icon { color: #fff; background: var(--success); }
.chapter-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: #8bb8ff; background: rgba(47,114,232,.14); font-size: .76rem; font-weight: 800; }
.chapter-copy { min-width: 0; display: grid; gap: .12rem; }
.chapter-copy b { color: #edf3fa; font-size: .75rem; }
.chapter-copy span { overflow: hidden; color: var(--muted-dark); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.chapter-count { color: #83adf0; font-size: .75rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.sync-card { display: flex; align-items: center; gap: .45rem; margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--line-dark); }
.sync-card p { margin: 0; color: var(--muted-dark); font-size: .75rem; }
.sync-card button { margin-left: auto; padding: .25rem 0; border: 0; color: #83adf0; background: transparent; font-size: .75rem; }
#lessonNodes { position: absolute; z-index: 6; inset: 0; }
.lesson-node { position: absolute; z-index: 8; width: 42px; height: 42px; display: grid; place-items: center; border: 4px solid #fff; border-radius: 50%; color: #fff; background: var(--locked); box-shadow: 0 3px 0 #536071, 0 8px 18px rgba(4,19,39,.26); font-size: .9rem; font-weight: 850; transform: translate(-50%,-50%); transition: transform .2s var(--ease), box-shadow .2s; }
.lesson-node:hover:not(:disabled), .lesson-node:focus-visible { transform: translate(-50%,-56%); }
.lesson-node.done { background: var(--success); }
.lesson-node.current { width: 52px; height: 52px; background: var(--action); box-shadow: 0 4px 0 #1e55ad, 0 10px 24px rgba(26,89,187,.38); }
.lesson-node.current::after { content: ""; position: absolute; inset: -10px; border: 2px solid rgba(89,147,242,.62); border-radius: 50%; animation: locate 2.8s ease-out infinite; }
.lesson-node.locked { opacity: .82; }
.node-label { position: absolute; z-index: 7; width: max-content; max-width: 210px; padding: .46rem .65rem; border: 1px solid rgba(7,23,45,.12); border-radius: 7px; color: var(--ink); background: rgba(255,255,255,.97); box-shadow: 0 8px 20px rgba(4,19,39,.2); font-size: .72rem; font-weight: 700; line-height: 1.35; opacity: 0; pointer-events: none; transition: opacity .16s, transform .22s var(--ease); }
.node-label b { margin-right: .3rem; color: var(--action); }
.node-label.label-right { transform: translate(1.6rem,-50%) translateX(-8px); }
.node-label.label-left { transform: translate(calc(-100% - 1.6rem),-50%) translateX(8px); }
.lesson-node:hover + .node-label, .lesson-node:focus-visible + .node-label, .lesson-node.current + .node-label { opacity: 1; }
.lesson-node:hover + .node-label.label-right, .lesson-node:focus-visible + .node-label.label-right, .lesson-node.current + .node-label.label-right { transform: translate(1.6rem,-50%); }
.lesson-node:hover + .node-label.label-left, .lesson-node:focus-visible + .node-label.label-left, .lesson-node.current + .node-label.label-left { transform: translate(calc(-100% - 1.6rem),-50%); }
.lesson-node.current + .node-label.clear-left-rail { transform: translate(1.6rem,-50%); }
.map-legend { position: absolute; z-index: 8; top: 12px; right: 12px; display: flex; gap: .8rem; padding: .48rem .65rem; border: 1px solid rgba(7,23,45,.14); border-radius: 7px; color: #42536a; background: rgba(255,255,255,.94); font-size: .68rem; }
.map-legend span { display: flex; align-items: center; gap: .28rem; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--locked); }
.legend-dot.done { background: var(--success); }
.legend-dot.current { background: var(--action); }
.chapter-dock { position: absolute; z-index: 9; bottom: 12px; left: 50%; width: min(520px,calc(100% - 32px)); display: grid; grid-template-columns: repeat(3,minmax(120px,1fr)); gap: .45rem; padding: .55rem; border: 1px solid var(--line-dark); border-radius: 10px; background: rgba(7,23,45,.96); transform: translateX(-50%); }
.chapter-dock button { min-width: 0; padding: .55rem .7rem; border: 1px solid var(--line-dark); border-radius: 7px; color: var(--muted-dark); background: rgba(255,255,255,.02); }
.chapter-dock button:hover { color: #fff; border-color: rgba(114,168,255,.5); }
.chapter-dock button.is-active { color: #fff; border-color: #5d9bff; background: rgba(47,114,232,.14); }
.chapter-dock span, .chapter-dock b { display: block; overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.chapter-dock b { margin-top: .12rem; }
@keyframes locate { 0% { transform: scale(.92); opacity: 1; } 75%,100% { transform: scale(1.3); opacity: 0; } }

/* Lesson */
.lesson-dialog { width: min(1180px,calc(100vw - 2.5rem)); height: min(790px,calc(100vh - 2.5rem)); padding: 0; overflow: hidden; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 28px 90px rgba(3,15,33,.42); }
.lesson-dialog::backdrop { background: rgba(3,13,29,.76); }
.lesson-layout { height: 100%; display: grid; grid-template-columns: 260px 1fr; }
.lesson-side { display: flex; flex-direction: column; padding: 1.25rem 1.35rem; color: #fff; background: var(--navy); }
.back-link { align-self: flex-start; padding: .45rem 0; border: 0; color: #9fc0f2; background: transparent; font-size: .78rem; }
.lesson-side .kicker { margin-top: 3rem; color: #79aaff; }
.lesson-side h2 { margin: .7rem 0 1.3rem; font-size: 1.25rem; line-height: 1.35; }
.lesson-track { height: 5px; overflow: hidden; border-radius: 2px; background: rgba(255,255,255,.13); }
.lesson-track span { display: block; width: 100%; height: 100%; background: var(--action); transform: scaleX(.5); transform-origin: left; transition: transform .25s var(--ease); }
.lesson-side > p:last-child { color: #8da0ba; font-size: .72rem; }
.lesson-content { overflow: auto; padding: clamp(2rem,5vw,5rem); background: #f8fafc; }
.lesson-content > div { max-width: 760px; margin: 0 auto; }
.step-tag { width: max-content; margin: 0 0 1rem; padding: .3rem .48rem; border-radius: 5px; color: var(--action-hover); background: var(--action-soft); font-size: .7rem; font-weight: 800; }
.lesson-content h1 { margin: 0; font-size: 2.35rem; letter-spacing: -.03em; line-height: 1.15; }
.lesson-lead { margin: .7rem 0 2.2rem; color: var(--muted); font-size: .95rem; line-height: 1.7; }
.lesson-body { padding-top: 1rem; border-top: 1px solid #dce4ed; }
.lesson-body h2 { margin: .25rem 0 .55rem; font-size: 1.15rem; }
.lesson-body p { margin: 0 0 1.3rem; line-height: 1.7; }
.lesson-body ul { margin: 0; padding: 0; list-style: none; }
.lesson-body li { position: relative; padding: .75rem 0 .75rem 1.8rem; border-top: 1px solid #e3e8ef; line-height: 1.6; }
.lesson-body li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 900; }
.lesson-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.8rem; }
.quiz-options { display: grid; gap: .65rem; margin-top: 2rem; }
.quiz-option { min-height: 56px; display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: .75rem; padding: .55rem .75rem; border: 1px solid #cbd5e1; border-radius: 8px; color: var(--ink); background: #fff; text-align: left; }
.quiz-option:hover { border-color: #8aa7cd; }
.quiz-option.selected { border-color: var(--action); background: var(--action-soft); }
.choice-key { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: #eef2f7; font-size: .75rem; font-weight: 800; }
.quiz-feedback { margin-top: 1rem; padding: .8rem 1rem; border-radius: 7px; font-size: .84rem; line-height: 1.6; }
.quiz-feedback.good { color: #17663b; background: #e9f7ef; }
.quiz-feedback.bad { color: #8b2d3a; background: #fff0f2; }

@media (max-width: 1320px) {
  .dashboard { grid-template-columns: 304px minmax(0,1fr); }
  .right-rail { display: none; }
  .map-legend { right: 18px; }
}

@media (max-width: 980px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .top-context { display: none; }
  .main-nav { justify-self: start; }
  .home-view { grid-template-columns: 1fr; }
  .home-status { min-height: 0; }
  .home-library, .utility-links { grid-column: 1; }
  .home-hero { grid-template-columns: 1fr 36%; }
  .featured-course, .catalog-course { grid-template-columns: 190px 1fr; }
  .course-cta, .catalog-action { grid-column: 2; padding: 0 1.8rem 1.35rem; }
  .course-hero { grid-template-columns: 1fr 34%; }
  .achievement-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .profile-settings-grid { grid-template-columns: 240px minmax(0,1fr); }
  .profile-avatar-grid { grid-template-columns: repeat(6,minmax(44px,1fr)); }
}

@media (max-width: 760px) {
  .topbar { height: auto; min-height: 68px; grid-template-columns: auto minmax(0,1fr) auto; gap: .55rem; padding: 0 .75rem; }
  .brand > span:last-child, .user-chip > span:last-child { display: none; }
  .main-nav { overflow-x: auto; }
  .nav-item { min-width: auto; padding: 0 .62rem; white-space: nowrap; }
  .top-actions { gap: .4rem; }
  .topbar-site-return { min-height: 32px; padding: .3rem .42rem; }
  .workspace { min-height: calc(100vh - 68px); }
  .standard-page, .home-view { width: min(100% - 1.5rem,1240px); padding: 1.35rem 0 3rem; }
  .page-header { padding-top: .5rem; }
  .page-header h1 { font-size: 2.1rem; }
  .home-hero { min-height: 0; grid-template-columns: 1fr; }
  .hero-copy { padding: 1.6rem; }
  .hero-copy h1 { font-size: 2.1rem; }
  .hero-map { min-height: 210px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .featured-course, .catalog-course { grid-template-columns: 1fr; }
  .course-visual { min-height: 190px; }
  .course-cta, .catalog-action { grid-column: 1; padding: 0 1.5rem 1.35rem; }
  .utility-links { grid-template-columns: 1fr; }
  .empty-roadmap { padding-left: 0; }
  .course-hero { grid-template-columns: 1fr; }
  .course-hero > div:first-child { padding: 1.6rem; }
  .course-hero h1 { font-size: 2.35rem; }
  .course-hero-map { min-height: 210px; background: linear-gradient(0deg,var(--navy),transparent 28%), url('./assets/agent-islands-map-v2.png') center / cover no-repeat; }
  .stage-item { grid-template-columns: 58px 1fr; }
  .stage-state { grid-column: 2; min-width: 0; text-align: left; }
  .leaderboard-summary { grid-template-columns: 1fr; gap: .8rem; }
  .leaderboard-header { padding: .5rem 0; }
  .ranking-table { overflow-x: auto; }
  .ranking-row { min-width: 720px; }
  .release-note { grid-template-columns: 1fr; gap: .4rem; }
  .profile-settings-grid { grid-template-columns: 1fr; }
  .profile-identity { justify-items: start; text-align: left; }
  .profile-identity > div { position: absolute; margin: .65rem 0 0 118px; }
  .profile-identity dl { grid-template-columns: repeat(3,1fr); gap: 1rem; }
  .profile-identity dl div { display: grid; gap: .2rem; }
  .dashboard { height: auto; min-height: calc(100vh - 68px); grid-template-columns: 1fr; grid-template-rows: auto 760px; overflow: visible; padding: .75rem; gap: .75rem; }
  .left-rail { position: relative; top: auto; bottom: auto; left: auto; width: auto; }
  .current-panel { height: auto; display: grid; grid-template-columns: 1fr minmax(220px,.75fr); gap: .85rem; padding: .9rem; }
  .mission-label { grid-column: 1 / -1; padding-bottom: .65rem; }
  .mission-series { padding: .2rem 0; }
  .mission-current { grid-column: 2; grid-row: 2 / span 2; }
  .current-panel > .button { grid-column: 1; margin-top: 0; }
  .mission-meta { grid-column: 1 / -1; margin-top: 0; }
  .journey { position: relative; inset: auto; min-height: 760px; border-radius: 12px; }
  .map-canvas { position: absolute; }
  .right-rail { display: none; }
  .chapter-dock { width: calc(100% - 24px); bottom: 12px; }
  .map-legend { display: none; }
  .lesson-dialog { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0; }
  .lesson-layout { grid-template-columns: 210px 1fr; }
}

@media (max-width: 560px) {
  .user-chip { display: none; }
  .topbar-site-return span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .home-hero { border-radius: 11px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: .6rem; }
  .featured-course { border-radius: 10px; }
  .category-row, .catalog-toolbar { overflow-x: auto; padding-bottom: .25rem; }
  .catalog-toolbar > span { display: none; }
  .skills-coming-soon { min-height: 360px; padding: 1.5rem; border-radius: 10px; }
  .dashboard { grid-template-rows: auto 1040px; padding: .55rem; background: #dce9f4; }
  .current-panel { display: flex; }
  .mission-current { order: initial; }
  .journey { min-height: 1040px; }
  .map-canvas { background-position: 48% center; }
  .map-canvas::after { background: rgba(232,243,251,.72); }
  .lesson-node { left: 34px !important; width: 40px; height: 40px; }
  .lesson-node.current { width: 46px; height: 46px; }
  .node-label, .node-label.label-right, .node-label.label-left { left: 62px !important; width: calc(100vw - 112px); max-width: none; opacity: 1; transform: translate(0,-50%); }
  .chapter-dock { display: none; }
  .login-view { padding: .75rem; background-position: 45% center; }
  .login-shell { min-height: 0; grid-template-columns: 1fr; background: transparent; box-shadow: none; }
  .login-art { display: none; }
  .login-form { padding: 1.65rem; border-radius: 12px; }
  .login-form h1 { font-size: 1.7rem; }
  .lesson-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .lesson-side { padding: .75rem 1rem; }
  .lesson-side .kicker, .lesson-side .lesson-track, .lesson-side > p:last-child { display: none; }
  .lesson-side h2 { margin: .3rem 0 0; font-size: .85rem; }
  .lesson-content { padding: 1.35rem 1rem 2rem; }
  .lesson-content h1 { font-size: 1.72rem; }
  .avatar-grid { grid-template-columns: repeat(5,1fr); }
  .profile-avatar-settings { padding: 1.15rem; }
  .profile-avatar-grid { grid-template-columns: repeat(5,minmax(42px,1fr)); }
  .profile-avatar-grid .avatar-option { width: 48px; }
  .profile-identity { padding: 1.25rem; }
  .profile-avatar-large { width: 84px; height: 84px; }
  .profile-identity > div { margin-left: 100px; }
  .profile-identity dl { gap: .6rem; margin-top: 1.2rem; }
  .achievement-grid { grid-template-columns: 1fr 1fr; }
  .achievement-item { grid-template-columns: 46px minmax(0,1fr); min-height: 82px; padding: .65rem; }
  .achievement-item img { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
