:root {
  --bg: #0d1030; --surface: #171b45; --surface-2: #1f2458; --line: rgba(255, 255, 255, .12);
  --ink: #fff6e4; --ink-2: #c9c6e2; --ink-3: #8f8db3; --gold: #ffc45e; --orange: #ff9f3c;
  --good: #5fd08a; --bad: #ff7a7a;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: radial-gradient(ellipse at 50% -10%, #2a2f72 0%, var(--bg) 55%) fixed, var(--bg); color: var(--ink); font-family: 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif; font-size: 14px; line-height: 1.5; min-height: 100vh; }
h1, h2, .tab, .primary, .ghost, .stat b, .char b { font-family: 'Jua', 'Noto Sans KR', sans-serif; font-weight: 400; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; background: none; }
.muted { color: var(--ink-3); font-size: 13px; }

.top { max-width: 1240px; margin: 0 auto; padding: 22px 16px 0; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; }
h1 { font-size: 26px; } h1 span { color: var(--gold); }
.top p { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: 9px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.tab.on { background: linear-gradient(#ffd97a, #ff9f3c); color: #4a2500; border-color: transparent; }

main { max-width: 1240px; margin: 0 auto; padding: 16px; }
.page { display: none; flex-direction: column; gap: 14px; } .page.on { display: flex; }
.cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; }
@media (max-width: 920px) { .cols { grid-template-columns: 1fr; } .side { position: static; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.panel h2 { font-size: 18px; margin-bottom: 8px; }
.panel-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button, .ghost { padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.presets button:hover, .ghost:hover { border-color: var(--gold); color: var(--ink); }

/* 입력 양식 */
.stage { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.stage h3 { font-size: 13px; color: var(--gold); font-weight: 700; margin-bottom: 6px; }
.field { display: grid; grid-template-columns: 118px 1fr; gap: 8px; align-items: center; padding: 4px 0; }
.field > label { color: var(--ink-2); font-size: 13px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.seg button { padding: 5px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.seg button.on { background: #3b4bd0; border-color: #7f8cff; color: #fff; }
.num { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; }
.num span { font-size: 12px; color: var(--ink-3); }
.num button { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.num output { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; }
.field.off { opacity: .35; pointer-events: none; }
.form-foot { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.chk { font-size: 13px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.primary { padding: 12px 20px; border-radius: 14px; font-size: 17px; color: #4a2500; background: linear-gradient(#ffd97a, #ff9f3c); box-shadow: 0 4px 0 #b35a12; }
.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #b35a12; }

/* 캠프 */
.camp-scene { position: relative; height: 120px; border-radius: 14px; overflow: hidden; background: linear-gradient(#182058 0%, #3d3580 55%, #a85a78 78%, #2d6a3f 78%, #1f4d2e 100%); margin-bottom: 10px; }
.camp-scene .moon { position: absolute; top: 12px; right: 26px; width: 26px; height: 26px; border-radius: 50%; background: #fff6d8; box-shadow: 0 0 24px #fff6d8; }
.camp-scene .row { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; align-items: flex-end; gap: 6px; font-size: 26px; }
.camp-scene .row .big { font-size: 40px; line-height: 1; }
.camp-scene .tag { position: absolute; top: 8px; left: 10px; font-size: 12px; background: rgba(0, 0, 0, .35); padding: 2px 8px; border-radius: 999px; }
.camp-scene.dead { filter: grayscale(1) brightness(.6); }
.bars { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 10px; }
.bar label { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.bar div { height: 8px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; margin-top: 3px; }
.bar i { display: block; height: 100%; border-radius: 999px; transition: width .4s; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 6px 4px; text-align: center; }
.stat b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; } .stat small { font-size: 11px; color: var(--ink-3); }
.chars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.char { background: var(--surface-2); border-radius: 10px; padding: 6px 4px; text-align: center; font-size: 11px; color: var(--ink-3); border: 1px solid transparent; }
.char i { font-style: normal; font-size: 22px; display: block; filter: grayscale(1) opacity(.35); }
.char.on { border-color: rgba(255, 196, 94, .6); color: var(--ink-2); } .char.on i { filter: none; }
.char b { display: block; font-size: 13px; color: var(--ink); }
.char .prog { height: 4px; border-radius: 9px; background: rgba(0, 0, 0, .4); margin-top: 4px; overflow: hidden; } .char .prog u { display: block; height: 100%; background: var(--gold); }

.receipt { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.rc { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 5px 8px; border-radius: 9px; background: var(--surface-2); font-size: 13px; animation: slide .35s both; }
.rc b { font-weight: 500; color: var(--ink-2); } .rc small { display: block; color: var(--ink-3); font-size: 11px; }
.rc.bad { box-shadow: inset 3px 0 0 var(--bad); } .rc.none span { color: var(--ink-3); }
.rc-total { margin-top: 6px; padding: 8px; border-radius: 10px; background: rgba(255, 196, 94, .12); border: 1px solid rgba(255, 196, 94, .4); font-size: 13px; }
@keyframes slide { from { opacity: 0; transform: translateX(-10px); } }
.log { list-style: none; display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow-y: auto; font-size: 13px; }
.log li { padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); } .log .day { color: var(--gold); font-size: 12px; margin-top: 4px; }

/* 자동 */
.controls { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.ctl { display: flex; flex-direction: column; gap: 4px; } .ctl > span { font-size: 12px; color: var(--ink-3); }
.controls .ghost { margin-left: auto; padding: 8px 14px; font-size: 14px; }
#insight, #eInsight { border-color: rgba(255, 196, 94, .45); } #insight li, #eInsight li { margin: 4px 0 4px 18px; } #insight strong, #eInsight strong { color: var(--gold); font-weight: 500; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart { position: relative; width: 100%; } .chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--ink-3); font-size: 11px; font-family: inherit; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid rgba(255, 255, 255, .06); vertical-align: middle; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 8px; } .who i { width: 10px; height: 10px; border-radius: 50%; flex: none; } .who small { display: block; color: var(--ink-3); font-size: 11px; }
.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.badge.ok { background: rgba(95, 208, 138, .15); color: var(--good); } .badge.warn { background: rgba(255, 196, 94, .15); color: var(--gold); } .badge.dead { background: rgba(255, 122, 122, .15); color: var(--bad); }
.tip { position: fixed; z-index: 50; pointer-events: none; background: #0a0c26; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); min-width: 150px; }
.tip h4 { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-bottom: 4px; }
.tip div { display: flex; justify-content: space-between; gap: 14px; } .tip div span { display: inline-flex; align-items: center; gap: 5px; } .tip i { width: 8px; height: 8px; border-radius: 50%; }

/* 규칙 */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.char-card { background: var(--surface-2); border-radius: 12px; padding: 10px; display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: center; }
.char-card i { font-style: normal; font-size: 28px; } .char-card b { font-weight: 500; } .char-card small { display: block; color: var(--ink-3); font-size: 12px; }
.guards { list-style: none; display: grid; gap: 8px; } .guards li { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; } .guards b { color: var(--gold); font-weight: 500; }

/* 경제 */
.econ-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.econ-when { flex: 1 1 420px; } .econ-when h2 span { font-family: 'Noto Sans KR', sans-serif; font-size: 13px; }
.econ-go { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.econ-go select, .trade-bar input { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; }
.trade-bar input { width: 90px; padding: 5px 8px; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wallet { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.wallet .stat.big { grid-column: span 2; background: rgba(255, 196, 94, .12); border: 1px solid rgba(255, 196, 94, .4); }
.wallet .stat.big b { font-size: 22px; color: var(--gold); }
@media (max-width: 560px) { .wallet { grid-template-columns: repeat(2, 1fr); } }
.emsg { margin-top: 8px; font-size: 13px; min-height: 20px; color: var(--ink-2); }
.emsg.err { color: var(--bad); }
.trade-bar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 8px; font-size: 13px; }
#market td { padding: 5px 8px; } #market .code { display: inline-grid; place-items: center; min-width: 30px; height: 22px; border-radius: 6px; background: var(--surface-2); font-size: 11px; margin-right: 6px; color: var(--ink-2); }
.up { color: var(--good); } .down { color: var(--bad); }
.tbtn { padding: 3px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.tbtn:hover { border-color: var(--gold); color: var(--ink); } .tbtn:disabled { opacity: .35; cursor: default; }
.estate { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.ecard { background: var(--surface-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 5px; }
.ecard b { font-weight: 500; } .ecard small { color: var(--ink-3); font-size: 12px; line-height: 1.35; }
.ecard .row2 { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.news .paper { background: #f4ecd8; color: #2b2418; border-radius: 10px; padding: 12px; font-size: 13px; }
.news .paper h3 { font-family: 'Jua', sans-serif; font-weight: 400; font-size: 15px; border-bottom: 1px solid #2b241833; padding-bottom: 4px; margin-bottom: 6px; }
.news .paper p { margin: 4px 0; } .news .concept { margin-top: 8px; padding: 8px; border-radius: 8px; background: #2b24180f; }
.ledger td { padding: 4px 6px; font-size: 13px; }
.ledger .sum td { border-top: 1px solid var(--line); font-weight: 500; }
#market { min-width: 640px; } #market td:first-child, #market td:last-child { white-space: nowrap; }
.tbtn { white-space: nowrap; }
#sTable { min-width: 900px; } #result { min-width: 640px; }

/* 일러스트 */
.art { display: inline-block; vertical-align: middle; overflow: visible; }
.stat .art-coin { vertical-align: -7px; margin-right: 6px; }
.rc .art-coin { vertical-align: -3px; }
#market .thumb { display: inline-flex; width: 50px; justify-content: center; margin-right: 8px; vertical-align: middle; }
#market tr[data-c]:hover td { background: rgba(255, 255, 255, .03); }
.tip-art { padding: 4px 2px 8px; }
.vault { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; border-radius: 14px; min-height: 110px; align-items: flex-end;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 210, 120, .14), transparent 60%), linear-gradient(#2a1e3f, #1a1430);
  box-shadow: inset 0 -14px 0 #3a2a1c, inset 0 -16px 0 #5a4028, inset 0 2px 12px rgba(0, 0, 0, .5); }
.vitem { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px 18px; min-width: 100px; text-align: center; }
.vitem .vart { min-height: 56px; display: flex; align-items: flex-end; }
.vitem b { font-weight: 500; font-size: 13px; } .vitem small { color: var(--ink-3); font-size: 11px; }
.estate-art { font-size: 20px; line-height: 1.3; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.flyer { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; will-change: transform; }

/* 세계 지도 */
.whud { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); padding: 0 4px; }
.whud b { color: var(--ink); font-weight: 500; }
.world-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 920px) { .world-grid { grid-template-columns: 1fr; } }
.globe-panel { padding: 10px; }
.globe { position: relative; height: min(64vh, 560px); min-height: 360px; border-radius: 14px; overflow: hidden; background: #03040c; }
.globe canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.glabels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.glabel { position: absolute; left: 0; top: 0; pointer-events: auto; white-space: nowrap; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: rgba(8, 10, 30, .72); border: 1px solid rgba(255, 255, 255, .25); color: var(--ink); backdrop-filter: blur(4px); margin-top: -6px; }
.glabel.far { color: var(--ink-3); border-color: rgba(255, 255, 255, .1); } .glabel.study { color: var(--ink-2); }
.glabel.ready { border-color: #7fd3ff; color: #cfefff; box-shadow: 0 0 12px rgba(127, 211, 255, .5); }
.glabel.owned { border-color: var(--gold); color: #ffe7b0; } .glabel.home { border-color: #7ee0a1; color: #d8ffe6; }
.glabel.sel { background: var(--gold); color: #3a2200; border-color: var(--gold); }
.glegend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.glegend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.ghelp { font-size: 12px; margin-top: 4px; }
.city-panel { max-height: calc(min(64vh, 560px) + 60px); overflow-y: auto; }
.city-head { display: flex; align-items: center; gap: 10px; }
.city-head .cicon { font-size: 34px; } .city-head h2 { margin: 0; } .city-head .cnote { margin-left: auto; }
.clock { font-size: 12px; } .clock.night { color: #b9c4ff; }
.trait { font-size: 13px; color: var(--ink-2); margin: 8px 0; }
.kv { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px 10px; font-size: 13px; margin-bottom: 8px; }
.kv span { color: var(--ink-3); } .kv b { font-weight: 500; }
@media (max-width: 560px) { .kv { grid-template-columns: auto 1fr; } }
.event { font-size: 13px; padding: 6px 10px; border-radius: 10px; background: rgba(127, 211, 255, .1); border: 1px solid rgba(127, 211, 255, .3); margin-bottom: 8px; }
.box { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.box b { font-weight: 500; } .box small { color: var(--ink-3); font-size: 12px; }
.box.ready { border: 1px solid #7fd3ff; box-shadow: 0 0 18px rgba(127, 211, 255, .15); } .box.locked { color: var(--ink-3); font-size: 13px; }
.box .row2 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.box input:not([type=range]), .box select { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; }
.primary.sm { padding: 8px 14px; font-size: 15px; align-self: flex-start; }
.pbar { height: 7px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; } .pbar i { display: block; height: 100%; border-radius: 999px; transition: width .4s; }
.swatches { display: inline-flex; gap: 4px; } .sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .4); }
.sign { align-self: flex-start; font-family: 'Jua', sans-serif; font-size: 18px; padding: 6px 16px; border-radius: 10px; color: #2a1a05;
  background: linear-gradient(var(--sc), color-mix(in srgb, var(--sc) 70%, #000)); box-shadow: 0 3px 0 color-mix(in srgb, var(--sc) 50%, #000), 0 6px 16px rgba(0, 0, 0, .4); display: flex; gap: 8px; align-items: center; }
.slider { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13px; } .slider input { flex: 1 1 100%; accent-color: var(--gold); }
table.mini { font-size: 12px; } table.mini td, table.mini th { padding: 3px 6px; }
.ledgerq { border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; } .ledgerq p { font-size: 13px; }
.qopt.right { border-color: var(--good); color: var(--good); } .qopt.wrong { border-color: var(--bad); color: var(--bad); }
.routes { display: flex; flex-direction: column; gap: 6px; }
.route { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; }
.route:hover { border-color: var(--line); } .route b { font-weight: 500; font-size: 13px; } .route small { display: block; color: var(--ink-3); font-size: 11px; margin-bottom: 3px; }
.route.far { opacity: .5; } .route.ready { border-color: #7fd3ff; }
.deeds { display: flex; flex-wrap: wrap; gap: 8px; max-height: 360px; overflow-y: auto; } .deeds .art-deed { width: 200px; height: auto; }
.friends { display: grid; gap: 6px; } .friend { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.friend b { font-weight: 500; } .friend small { color: var(--ink-3); }
.pcard { display: grid; grid-template-columns: 200px 1fr; gap: 12px; margin-top: 10px; padding: 12px; border-radius: 14px; background: #f7f1e3; color: #2b2418; }
.pcard img { width: 100%; border-radius: 10px; } .pcard h3 { font-family: 'Jua', sans-serif; font-weight: 400; } .pcard ul { margin: 6px 0 0 18px; font-size: 13px; }
.pcard .muted { color: #6b604c; }
@media (max-width: 560px) { .pcard { grid-template-columns: 1fr; } }
.world-grid > * { min-width: 0; }
.globe canvas { position: absolute; inset: 0; }

/* 도시 패널 확장 */
details.sx { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; margin-top: 8px; }
details.sx > summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
details.sx > summary::-webkit-details-marker { display: none; }
details.sx > summary::after { content: '▾'; color: var(--ink-3); margin-left: 6px; } details.sx[open] > summary::after { content: '▴'; }
details.sx > summary small { color: var(--ink-3); font-weight: 400; margin-left: auto; }
details.sx > *:not(summary) { margin-top: 6px; } details.sx small { display: block; color: var(--ink-3); font-size: 12px; }
details.sx .row2 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
details.sx input:not([type=range]) { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; }
.req { font-size: 12px; color: var(--ink-2); }
.recipe { display: grid; gap: 4px; } .recipe label { display: grid; grid-template-columns: 90px 44px 1fr; gap: 6px; align-items: center; font-size: 13px; }
.recipe input { accent-color: var(--gold); } .recipe small { display: block; }
.fshop { display: grid; grid-template-columns: 26px 1fr auto; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: 13px; }
.fshop > span:first-child { font-size: 20px; } .fshop b { font-weight: 500; }
.facs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; } .facs .tbtn { padding: 6px; line-height: 1.3; }
.facrow { font-size: 13px; }

/* ⑤ 무역·반 경제 */
.tbanner { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.tbanner b { color: var(--ink); font-weight: 500; }
.cyc { padding: 2px 10px; border-radius: 999px; background: var(--surface-2); } .cyc.호황 { color: var(--good); } .cyc.불황 { color: var(--bad); }
.tform { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; }
.tform label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ink-3); }
.tform select, .tform input { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; min-width: 110px; }
.tform input { width: 80px; min-width: 0; }
table.calc td { padding: 5px 8px; font-size: 13px; } table.calc tr.sum td { border-top: 1px solid var(--line); }
#tradeDesk .row2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.board td.hi { color: var(--good); font-weight: 600; } .board td.lo { color: var(--ink-3); }
.fairhead { font-size: 15px; margin-bottom: 6px; } .fairscale { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.fairscale span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); } .fairscale span.on { background: rgba(127, 211, 255, .18); color: #cfefff; border: 1px solid #7fd3ff; }
#fair small, #facGoal small, #season small { display: block; font-size: 12px; margin: 4px 0; }
.promise { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 13px; }
.promise textarea { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; resize: vertical; }
.achieved { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: rgba(95, 208, 138, .14); border: 1px solid rgba(95, 208, 138, .5); color: #d8ffe6; font-size: 13px; }
.chron-panel h2 { display: flex; justify-content: space-between; align-items: center; }
ol.chron { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
ol.chron li { display: grid; grid-template-columns: 28px 1fr; gap: 6px; align-items: start; font-size: 13px; }
ol.chron li > span { font-size: 18px; } ol.chron b { font-weight: 500; } ol.chron small { display: block; color: var(--ink-3); font-size: 11px; }
#season .row2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
#season select { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; }

/* ⑥ 진로 카드 */
.chead { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.cstat { background: var(--surface-2); border-radius: 12px; padding: 8px 14px; text-align: center; min-width: 110px; }
.cstat b { display: block; font-family: 'Jua', sans-serif; font-weight: 400; font-size: 26px; color: var(--gold); } .cstat small { color: var(--ink-3); font-size: 12px; }
.mathfirst { flex: 1 1 320px; background: linear-gradient(135deg, rgba(127, 211, 255, .12), rgba(255, 196, 94, .1)); border: 1px solid rgba(127, 211, 255, .4); border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.mathfirst p { margin-top: 4px; color: var(--ink-2); }
.career-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
@media (max-width: 920px) { .career-grid { grid-template-columns: 1fr; } }
.jgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.jcard { position: relative; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 12px 10px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); transition: transform .15s, border-color .15s; }
.jcard:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .3); }
.jcard .jicon { font-size: 30px; line-height: 1; } .jcard b { font-weight: 500; font-size: 14px; } .jcard small { color: var(--ink-3); font-size: 11px; }
.jcard .pbar { width: 100%; } .jcard .mchip { color: #bfe6ff; }
.jcard .jlv { position: absolute; top: 8px; right: 8px; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--ink-3); }
.jcard.lv0 .jicon { filter: grayscale(.8) opacity(.6); }
.jcard.lv1 { border-color: rgba(255, 196, 94, .6); } .jcard.lv1 .jlv { background: rgba(255, 196, 94, .2); color: var(--gold); }
.jcard.lv2 { border-color: var(--gold); background: linear-gradient(160deg, rgba(255, 196, 94, .2), var(--surface-2) 60%); box-shadow: 0 0 18px rgba(255, 180, 70, .2); }
.jcard.lv2 .jlv { background: var(--gold); color: #3a2200; }
.jcard.sel { outline: 2px solid #7fd3ff; }
.jdetail h2 { margin: 0; } .jdetail h3 { font-family: 'Jua', sans-serif; font-weight: 400; font-size: 16px; margin: 14px 0 6px; color: var(--gold); }
.jdetail p { font-size: 13px; color: var(--ink-2); } .jdetail a { color: #9fd7ff; }
.jhead { display: flex; gap: 12px; align-items: center; } .jicon.big { font-size: 44px; }
.whymath { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: rgba(127, 211, 255, .1); border-left: 4px solid #7fd3ff; }
.whymath p { margin-top: 4px; color: var(--ink); }
ol.ladder { list-style: none; display: flex; flex-direction: column; gap: 8px; }
ol.ladder > li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
ol.ladder .step { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #3a2200; font-family: 'Jua', sans-serif; }
ol.ladder > li:first-child .step { background: #7fd3ff; box-shadow: 0 0 0 4px rgba(127, 211, 255, .25); }
ol.ladder > li > div { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; font-size: 13px; }
ol.ladder > li:first-child > div { border: 1px solid rgba(127, 211, 255, .5); }
ul.units, ul.subj { list-style: none; display: grid; gap: 4px; margin-top: 6px; }
ul.units li { display: grid; grid-template-columns: 112px 1fr; gap: 2px 8px; align-items: baseline; }
ul.units li small, ul.subj li small { grid-column: 2; color: var(--ink-3); font-size: 12px; display: block; }
ul.units b, ul.subj b { font-weight: 500; }
.ust { font-size: 11px; color: var(--ink-3); } .u.done .ust { color: var(--good); } .u.doing .ust { color: #7fd3ff; }
.todo { background: rgba(255, 196, 94, .08); border: 1px dashed rgba(255, 196, 94, .5); border-radius: 12px; padding: 8px 12px; }
.todo p { margin: 3px 0; color: var(--ink); }
table.cmap td { padding: 5px 8px; font-size: 13px; } table.cmap tr.done td { background: rgba(95, 208, 138, .06); }
.st { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); white-space: nowrap; }
.st.done { color: var(--good); background: rgba(95, 208, 138, .14); } .st.doing { color: #7fd3ff; background: rgba(127, 211, 255, .12); }
.jmini { font-size: 18px; padding: 0 2px; }

/* 연대기 인쇄 */
@media print {
  body.print-chron * { visibility: hidden; }
  body.print-chron .chron-panel, body.print-chron .chron-panel * { visibility: visible; }
  body.print-chron .chron-panel { position: absolute; left: 0; top: 0; width: 100%; background: #fff; color: #000; border: 0; }
  body.print-chron ol.chron { max-height: none; overflow: visible; } body.print-chron #printChron { display: none; }
  body.print-chron ol.chron small { color: #555; }
}

/* 진로 카드 확장: 공학 연구소, 고1~고3, 학습 이력 */
.cfilter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cfilter button { padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.cfilter button.on { background: #3b4bd0; border-color: #7f8cff; color: #fff; } .cfilter small { opacity: .7; margin-left: 2px; }
.jcard .jlab { position: absolute; top: 8px; left: 8px; font-size: 10px; padding: 1px 6px; border-radius: 999px; background: rgba(127, 211, 255, .15); color: #bfe6ff; }
.jcard .jlab + .jicon { margin-top: 12px; }
.ust { font-size: 11px; color: var(--ink-3); text-align: left; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px dashed transparent; }
.ust:hover { border-color: var(--line); }
.u.done .ust { color: var(--good); } .u.doing .ust { color: #7fd3ff; }
.hsg { display: grid; grid-template-columns: 34px 1fr; gap: 6px; margin-top: 8px; align-items: start; }
.gtag { display: inline-grid; place-items: center; height: 24px; border-radius: 8px; background: rgba(255, 196, 94, .18); color: var(--gold); font-size: 12px; font-weight: 700; }
details.hsub { background: rgba(0, 0, 0, .18); border-radius: 10px; padding: 6px 10px; margin-bottom: 6px; }
details.hsub > summary { cursor: pointer; list-style: none; } details.hsub > summary::-webkit-details-marker { display: none; }
details.hsub > summary::before { content: '▸ '; color: var(--ink-3); } details.hsub[open] > summary::before { content: '▾ '; }
details.hsub summary small { color: var(--ink-3); font-size: 11px; margin-left: 6px; } details.hsub .hdesc { display: block; margin: 2px 0 0 14px; }
.lab { margin-top: 14px; padding: 12px; border-radius: 14px; background: linear-gradient(160deg, rgba(127, 211, 255, .1), rgba(0, 0, 0, .15)); border: 1px solid rgba(127, 211, 255, .35); }
.lab h3 { margin-top: 0 !important; color: #bfe6ff !important; }
.labtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.labtabs button { padding: 5px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.labtabs button.on { border-color: #7fd3ff; color: var(--ink); }
.tier { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; }
.tier.t0, .tier.t1, .tier.t2 { background: rgba(95, 208, 138, .18); color: var(--good); }
.tier.t3 { background: rgba(127, 211, 255, .2); color: #9fdcff; } .tier.t4 { background: rgba(200, 155, 255, .2); color: #d9b8ff; } .tier.t5 { background: rgba(255, 122, 122, .2); color: #ffb0b0; }
.labq { font-size: 14px; color: var(--ink); margin: 6px 0 8px; line-height: 1.6; }
.lab .row2 { display: flex; flex-wrap: wrap; gap: 6px; }
.labres { margin-top: 8px; font-size: 13px; padding: 6px 10px; border-radius: 8px; } .labres.ok { background: rgba(95, 208, 138, .14); color: #d8ffe6; } .labres.no { background: rgba(255, 122, 122, .12); color: #ffd6d6; }
.record { display: flex; flex-direction: column; gap: 10px; }
.rg { display: grid; grid-template-columns: 38px 1fr; gap: 8px; align-items: start; }
.rrow { margin-bottom: 6px; } .rrow > small { color: var(--ink-3); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.uchip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-3); }
.uchip.doing { color: #9fdcff; border-color: rgba(127, 211, 255, .5); } .uchip.done { color: #d8ffe6; background: rgba(95, 208, 138, .16); border-color: rgba(95, 208, 138, .5); }
.uchip.next { color: var(--ink-2); }
table.cmap tr.sep td { background: rgba(255, 196, 94, .08); color: var(--gold); font-weight: 600; font-size: 12px; }
table.cmap tr.doing td { background: rgba(127, 211, 255, .05); }

/* 파란수학 연동 */
.paranbar { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.paranbar .plink { padding: 6px 14px; border-radius: 999px; background: linear-gradient(#7fb6ff, #3b6fd0); color: #fff; font-family: 'Jua', sans-serif; font-size: 15px; }
.paranbar .pnote { color: var(--ink-3); } .paranbar .pwho b { color: var(--gold); font-weight: 500; }
.paranbar a.ghost { text-decoration: none; }
.pmsg { flex: 1 1 100%; font-size: 13px; padding: 6px 12px; border-radius: 10px; background: rgba(95, 208, 138, .14); border: 1px solid rgba(95, 208, 138, .5); color: #d8ffe6; }
.pmodal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(5, 6, 24, .7); backdrop-filter: blur(4px); padding: 16px; }
.pcard2 { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.pcard2 h2 { font-size: 20px; } .pcard2 a { color: #9fd7ff; }
.pcard2 label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.pcard2 label.chk { flex-direction: row; align-items: center; gap: 6px; }
.pcard2 input:not([type=checkbox]) { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 15px; }
.pcard2 .row2 { display: flex; gap: 8px; align-items: center; }
/* 연동 중에는 가상 수업 버튼을 숨기고, 수업은 선생님의 수업체크에서만 들어온다 */
body.linked #btnFinish, body.linked #presets, body.linked #mMakeup, body.linked .chk:has(#mMakeup),
body.linked #wLesson, body.linked #wWeek, body.linked #wPreset, body.linked #eLesson, body.linked #eWeekBtn, body.linked #ePreset,
body.linked [data-act=confirm] { display: none !important; }
body.linked .econ-go::after, body.linked .form-foot::after { content: '📥 수업은 선생님이 수업체크에 기록하면 "새 기록 가져오기"로 들어옵니다'; font-size: 12px; color: var(--ink-3); }

/* 베타 표시, 보기 전용 */
.beta { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: rgba(255, 196, 94, .16); border: 1px solid rgba(255, 196, 94, .5); color: var(--gold); white-space: nowrap; }
.betanote { font-size: 12.5px; color: var(--gold); background: rgba(255, 196, 94, .1); border-radius: 8px; padding: 6px 10px; }
body.viewing .page button:not(.tab):not(.glabel):not(.route):not(.jcard):not(.jmini):not([data-lab]), body.viewing .page input, body.viewing .page select, body.viewing .page textarea { pointer-events: none; opacity: .55; }
body.viewing .econ-go::after, body.viewing .form-foot::after { content: '👁️ 보기 전용입니다'; }

/* 영수증: 학습 급여 카드와 자원 아이콘 */
.art-item.inline { vertical-align: -4px; margin: 0 2px 0 0; }
.stat .art-item { vertical-align: -5px; margin-right: 2px; }
.sal { border-radius: 14px; padding: 10px 12px; background: linear-gradient(135deg, rgba(255, 196, 94, .18), rgba(255, 159, 60, .06) 60%, transparent); border: 1px solid rgba(255, 196, 94, .45); animation: slide .35s both; }
.sal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sal-head b { display: block; font-size: 16px; font-family: 'Jua', sans-serif; font-weight: 400; color: var(--gold); }
.sal-head small { display: block; color: var(--ink-3); font-size: 11.5px; }
.sal-total { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: 'Jua', sans-serif; font-size: 20px; color: var(--ink); }
.sal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.schip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .1); font-size: 12px; }
.schip i { font-style: normal; color: var(--ink-2); } .schip b { color: var(--gold); font-weight: 500; }
.rc { grid-template-columns: 110px 1fr; align-items: center; padding: 7px 10px; }
.rc > span { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.rc-total { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tchip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .25); font-size: 12.5px; }
.tchip.bad { color: var(--bad); }

/* 연동 중: 태블릿 입력 대신 수업 체크 기록 읽기 전용 */
#formPanel.linked-view > .panel-head, #formPanel.linked-view > #form, #formPanel.linked-view > .form-foot { display: none !important; }
.cv-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.cv-head h2 { margin-bottom: 2px; } .cv-head a { color: #9fd7ff; }
.cv-count { font-family: 'Jua', sans-serif; font-size: 18px; color: var(--gold); white-space: nowrap; }
details.crec { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
details.crec > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; font-size: 14px; }
details.crec > summary::-webkit-details-marker { display: none; }
details.crec > summary::before { content: '▸'; color: var(--ink-3); } details.crec[open] > summary::before { content: '▾'; }
.tag { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--ink-3); }
.tag.ok { background: rgba(95, 208, 138, .15); color: var(--good); } .tag.wait { background: rgba(255, 196, 94, .15); color: var(--gold); }
.cv-sec { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.cv-sec h3 { font-size: 13px; color: var(--gold); font-weight: 700; margin-bottom: 4px; }
.cv-row { display: grid; grid-template-columns: 118px 1fr; gap: 6px 8px; align-items: center; padding: 3px 0; font-size: 13px; }
.cv-row label { color: var(--ink-2); } .cv-row > div { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cv-row small { color: var(--ink-3); font-size: 11px; }
.cv { display: inline-block; padding: 3px 10px; border-radius: 9px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink); }
.cv.good { border-color: rgba(95, 208, 138, .5); color: #d8ffe6; } .cv.warn { border-color: rgba(255, 196, 94, .5); color: #ffe7b0; }
.cv.bad { border-color: rgba(255, 122, 122, .5); color: #ffd6d6; } .cv.none { color: var(--ink-3); border-style: dashed; }
.cv.txt { white-space: pre-wrap; text-align: left; }
@media (max-width: 560px) { .cv-row { grid-template-columns: 96px 1fr; } }

/* ① 탭 3D 섬 */
.camp3d { position: relative; height: 300px; border-radius: 14px; overflow: hidden; background: linear-gradient(#182058 0%, #3d3580 60%, #a85a78 100%); margin-bottom: 10px; }
.camp3d canvas { display: block; width: 100% !important; height: 100% !important; }
.camp3d.dead { filter: grayscale(.9) brightness(.55); }
.camp3d-tag { position: absolute; top: 8px; left: 10px; z-index: 2; font-size: 12px; background: rgba(0, 0, 0, .4); padding: 3px 10px; border-radius: 999px; pointer-events: none; }
.camp3d-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); font-size: 14px; }
@media (max-width: 560px) { .camp3d { height: 240px; } }

/* 도시 야경 · 직업 그림 · 경제 아이콘 */
.skyline { position: relative; border-radius: 12px; overflow: hidden; margin-bottom: 10px; line-height: 0; }
.skyline-svg { width: 100%; height: auto; display: block; }
.skyline-name { position: absolute; left: 10px; bottom: 8px; font-size: 11px; line-height: 1.4; color: #fff; background: rgba(0,0,0,.35); padding: 2px 8px; border-radius: 999px; }
.jcard .jicon, .jicon.big { font-size: 30px; line-height: 0; display: inline-block; }
.job-svg { display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.ecard .ehead { display: flex; align-items: center; gap: 8px; } .eicon { flex: none; vertical-align: middle; }
.tbtn .eicon { margin-right: 2px; }

/* 나의 성향 지도 */
.traits h2 { margin-bottom: 8px; }
.tnotice { background: rgba(224,162,58,.15); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.tgrid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px; align-items: center; }
.tradar { text-align: center; } .radar { width: 100%; max-width: 300px; overflow: visible; }
.tside { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tax { border-left: 4px solid var(--c); background: var(--surface-2); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.tax b { color: var(--c); font-size: 16px; } .tax > span { font-size: 12px; opacity: .7; } .tax small { color: var(--ink-3); font-size: 12px; } .tax .tev { font-size: 11px; }
.tchange { font-size: 13px; }
.tsub { margin: 16px 0 8px; font-size: 15px; font-weight: 500; }
.tjobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.tjob { position: relative; display: flex; gap: 10px; align-items: center; text-align: left; background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; padding: 10px; color: inherit; cursor: pointer; font: inherit; }
.tjob:hover { border-color: #7fd3ff; } .tjob b { display: block; font-weight: 500; font-size: 14px; } .tjob small { font-size: 11px; color: var(--ink-3); } .tjob small i { font-style: normal; font-weight: 600; }
.tjob.wild { border: 1px dashed #e0a23a; } .ttag { position: absolute; top: -9px; right: 8px; font-size: 10px; background: #e0a23a; color: #221; padding: 1px 8px; border-radius: 999px; }
.tjob .job-svg { flex: none; }
.tnote { margin-top: 14px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; } .tnote p { margin: 4px 0; }
.tedit { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; } .tedit textarea { min-height: 60px; font: inherit; border-radius: 8px; padding: 6px; }
.tdisclaim { font-size: 11px; color: var(--ink-3); margin: 10px 0 0; }
@media (max-width: 640px) { .tgrid { grid-template-columns: 1fr; } }

/* ② 나와 비교 */
.cmp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; align-items: center; margin-bottom: 6px; }
.cmp-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.cmp-legend i.me { background: #ffd66b; height: 5px; } .cmp-legend i.band { background: rgba(127,211,255,.35); height: 10px; } .cmp-legend i.med { border-top: 2px dashed #7fd3ff; height: 0; }
.cmp-ex { margin-left: auto; cursor: pointer; } .cmp-svg { width: 100%; height: auto; display: block; }
.cmp-say { margin: 8px 0 0; font-size: 14px; }
.exnote { font-size: 13px; color: var(--ink-2); border-left: 4px solid #e0a23a; }

/* ② 탭: 연동한 학생·학부모에게는 '나와 비교'만 */
body.linked:not(.staffview) #auto > .panel:not(#compare) { display: none; }
.cmp-msg { margin: 6px 0 0; font-size: 13px; background: rgba(70,194,142,.12); border-radius: 8px; padding: 6px 10px; }
