:root {
  --paper: #f5f1e8;
  --paper-deep: #ebe5d7;
  --ink: #17231d;
  --muted: #687068;
  --line: rgba(23, 35, 29, 0.14);
  --card: rgba(255, 255, 255, 0.68);
  --solid: #fffdf8;
  --green: #1d6b4f;
  --green-soft: #dcebe1;
  --coral: #e45e45;
  --yellow: #f1c75b;
  --shadow: 0 24px 70px rgba(41, 50, 43, 0.09);
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #111713;
  --paper-deep: #19211c;
  --ink: #edf4ed;
  --muted: #a7b1a9;
  --line: rgba(234, 244, 236, 0.14);
  --card: rgba(28, 38, 32, 0.74);
  --solid: #1b251f;
  --green: #79cfa8;
  --green-soft: #1f3d30;
  --coral: #ff8069;
  --yellow: #e6be58;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Noto Sans KR", sans-serif; min-width: 320px; }
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }

.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 800; text-decoration: none; letter-spacing: -0.04em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; transform: rotate(-18deg); }
.brand-mark::before, .brand-mark::after, .brand-mark span { content: ""; grid-area: 1/1; display: block; background: var(--green); }
.brand-mark::before { width: 2px; height: 20px; }
.brand-mark::after { width: 20px; height: 2px; }
.brand-mark span { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.main-nav { display: flex; align-items: center; gap: 25px; margin-left: auto; margin-right: 28px; }
.main-nav a { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; }
.main-nav a:hover, .main-nav a.active { color: var(--green); }
.privacy-chip { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; }
.status-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--green), transparent 82%); }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); background: transparent; border-radius: 50%; cursor: pointer; transition: .2s ease; }
.icon-button:hover { transform: rotate(12deg); background: var(--solid); }

.hero { min-height: 430px; display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 70px; padding: 58px 5vw 48px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; width: 360px; height: 360px; background: radial-gradient(circle, color-mix(in srgb, var(--yellow), transparent 64%), transparent 68%); left: -190px; bottom: -180px; pointer-events: none; }
.eyebrow, .kicker { margin: 0 0 14px; color: var(--green); font-family: "DM Sans", sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; max-width: 760px; font-size: clamp(40px, 6.2vw, 76px); line-height: 1.08; letter-spacing: -.07em; }
h1 em { color: var(--green); font-style: normal; position: relative; }
h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 7px; background: var(--yellow); z-index: -1; transform: rotate(-1deg); }
.hero-copy { max-width: 600px; margin: 26px 0 0; color: var(--muted); line-height: 1.8; font-size: 16px; }
.hero-orbit { width: min(300px, 100%); aspect-ratio: 1; justify-self: center; position: relative; display: grid; place-items: center; }
.orbit-ring { position: absolute; inset: 5%; border: 1px solid var(--line); border-radius: 50%; }
.orbit-ring::before, .orbit-ring::after { content: ""; position: absolute; inset: 14%; border: 1px dashed var(--line); border-radius: 50%; transform: rotate(30deg); }
.orbit-ring::after { inset: 32%; background: var(--green-soft); border-style: solid; }
.orbit-score { position: relative; z-index: 2; text-align: center; width: 150px; }
.orbit-score strong { display: block; font-family: "DM Sans", sans-serif; font-size: 55px; letter-spacing: -.07em; line-height: 1; }
.orbit-score span { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); }
.orbit-node { position: absolute; width: 15px; height: 15px; border-radius: 50%; border: 4px solid var(--paper); }
.node-a { top: 17%; right: 14%; background: var(--coral); }
.node-b { bottom: 9%; left: 30%; background: var(--yellow); }

.notice { display: flex; align-items: flex-start; gap: 13px; padding: 17px 20px; border: 1px solid color-mix(in srgb, var(--yellow), var(--line) 45%); border-radius: 14px; background: color-mix(in srgb, var(--yellow), transparent 86%); }
.notice p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.notice strong { color: var(--ink); }
.notice-icon { flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: #30270d; font-family: serif; font-weight: 700; }

.workspace { margin: 36px 0 70px; padding: 28px; background: var(--card); border: 1px solid rgba(255,255,255,.4); border-radius: 28px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.control-rail { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.school-switch { display: flex; padding: 4px; background: var(--paper-deep); border-radius: 14px; }
.school-option, .segmented button { border: 0; background: transparent; padding: 10px 18px; border-radius: 10px; color: var(--muted); font-weight: 700; cursor: pointer; }
.school-option.active, .segmented button.active { background: var(--ink); color: var(--paper); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.select-wrap { max-width: 230px; }
.select-wrap label, .grade-system > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
select, input[type="number"], input[type="text"] { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: var(--solid); color: var(--ink); outline: none; }
select { padding: 11px 38px 11px 13px; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green), transparent 86%); }
.grade-system { display: flex; align-items: center; gap: 10px; }
.grade-system > span { margin: 0; }
.grade-system small { color: var(--muted); font-size: 10px; max-width: 110px; }
.semester-status { align-self: center; }
.semester-toggle { display: flex; align-items: center; gap: 9px; max-width: 270px; color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.45; cursor: pointer; }
.semester-toggle input { width: 17px; height: 17px; margin: 0; accent-color: var(--green); flex: 0 0 auto; }
.segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; }
.segmented button { padding: 7px 10px; font-size: 12px; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 24px 0; }
.summary-card { min-height: 130px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--solid); position: relative; overflow: hidden; }
.summary-card.primary { background: var(--green); color: #fff; border-color: transparent; }
.summary-card::after { content: ""; width: 70px; height: 70px; position: absolute; right: -25px; bottom: -30px; border: 1px solid currentColor; border-radius: 50%; opacity: .16; }
.summary-label { display: block; font-size: 12px; color: var(--muted); }
.summary-card.primary .summary-label { color: rgba(255,255,255,.7); }
.summary-value { display: block; margin-top: 17px; font-family: "DM Sans", sans-serif; font-size: 36px; font-weight: 700; letter-spacing: -.05em; }
.summary-note { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.summary-card.primary .summary-note { color: rgba(255,255,255,.65); }

.tabbar { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tab { padding: 18px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.tab:last-child { border-right: 0; }
.tab span { margin-right: 8px; font-family: "DM Sans", sans-serif; font-size: 10px; color: var(--green); }
.tab.active { color: var(--ink); box-shadow: inset 0 -3px var(--coral); }
.tab-panel { display: none; padding-top: 32px; }
.tab-panel.active { display: block; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: clamp(22px, 3vw, 32px); letter-spacing: -.045em; }
.kicker { margin-bottom: 8px; }
.add-button { border: 0; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700; cursor: pointer; transition: .2s ease; }
.add-button:hover { transform: translateY(-2px); }
.add-button span { margin-right: 5px; }

.subject-list { display: grid; gap: 12px; }
.subject-card { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: color-mix(in srgb, var(--solid), transparent 7%); }
.subject-number { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font: 700 12px "DM Sans"; }
.subject-topline { display: grid; grid-template-columns: minmax(120px, 1fr) auto auto; align-items: center; gap: 10px; }
.subject-name { padding: 9px 11px; font-weight: 700; }
.result-badge { min-width: 48px; padding: 7px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); text-align: center; font-size: 12px; font-weight: 800; }
.result-badge.warning { background: color-mix(in srgb, var(--yellow), transparent 70%); color: var(--ink); }
.remove-subject { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.remove-subject:hover { background: color-mix(in srgb, var(--coral), transparent 86%); color: var(--coral); }
.subject-fields { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); gap: 10px; margin-top: 13px; }
.field label { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
.field input, .field select { padding: 10px 11px; }
.subject-help { margin: 8px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.field-message { min-height: 17px; margin: 8px 2px 0; color: var(--coral); font-size: 11px; }
.free-semester-badge { display: inline-flex; align-items: center; min-height: 42px; padding: 9px 13px; border-radius: 11px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 800; }
.empty-state { padding: 64px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 18px; }
.empty-symbol { width: 45px; height: 45px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 23px; }
.empty-state h3 { margin: 0 0 7px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }

.goal-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; }
.goal-form, .goal-result, .analysis-card { padding: 24px; border: 1px solid var(--line); border-radius: 19px; background: var(--solid); }
.goal-form h3, .goal-result h3, .analysis-card h3 { margin: 0 0 18px; font-size: 16px; }
.goal-fields { display: grid; gap: 14px; }
.goal-fields .field input { font-size: 19px; font-family: "DM Sans", sans-serif; font-weight: 700; }
.goal-result { display: grid; align-content: center; min-height: 280px; background: var(--green-soft); }
.goal-result .big-result { font-family: "DM Sans", sans-serif; font-size: clamp(45px, 7vw, 76px); font-weight: 700; letter-spacing: -.07em; color: var(--green); }
.goal-result p { color: var(--muted); line-height: 1.7; }
.formula-note { padding: 13px; border-radius: 12px; background: color-mix(in srgb, var(--solid), transparent 25%); font-size: 11px; color: var(--muted); }
.middle-goal-note { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--solid); line-height: 1.8; }
.middle-goal-note strong { color: var(--green); }
.analysis-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.semester-bars { display: grid; gap: 15px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 52px; align-items: center; gap: 10px; font-size: 12px; }
.bar-track { height: 8px; border-radius: 999px; background: var(--paper-deep); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--green); min-width: 3px; }
.distribution { display: flex; align-items: flex-end; justify-content: space-around; height: 170px; gap: 9px; }
.dist-item { flex: 1; text-align: center; color: var(--muted); font-size: 11px; }
.dist-bar { display: block; width: 100%; max-width: 34px; min-height: 4px; margin: 0 auto 7px; border-radius: 7px 7px 2px 2px; background: var(--coral); }
.analysis-footnote { margin-top: 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }

.methodology { margin: -35px 0 70px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.methodology summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 3px; cursor: pointer; font-weight: 800; list-style: none; }
.methodology summary::-webkit-details-marker { display: none; }
.methodology summary span::before { content: "+"; display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 10px; border: 1px solid var(--line); border-radius: 50%; color: var(--green); }
.methodology[open] summary span::before { content: "−"; }
.methodology summary small { color: var(--muted); font-weight: 500; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 12px 3px 28px; }
.method-grid h3 { margin: 0 0 10px; font-size: 14px; color: var(--green); }
.method-grid p, .source-links { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.source-links { padding: 0 3px 23px; }
.source-links a { color: var(--green); text-underline-offset: 3px; }

.guide-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 0 70px; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--line); }
.guide-strip > div { padding: 25px; background: var(--paper); }
.guide-strip span { color: var(--coral); font: 700 11px "DM Sans"; }
.guide-strip strong { display: block; margin: 24px 0 9px; }
.guide-strip p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
footer { min-height: 130px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; border-top: 1px solid var(--line); }
footer p { color: var(--muted); font-size: 12px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--green); }
footer button { border: 0; border-bottom: 1px solid currentColor; padding: 5px 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.footer-actions { justify-self: end; display: flex; gap: 15px; }
.footer-brand { font-size: 13px; }
.footer-brand .brand-mark { width: 27px; height: 27px; }
.hidden { display: none !important; }

.tutorial-overlay { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.tutorial-shades { position: absolute; inset: 0; pointer-events: none; }
.tutorial-shade { position: absolute; display: block; background: rgba(10, 18, 13, .46); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); pointer-events: auto; transition: inset .22s ease, width .22s ease, height .22s ease; }
.tutorial-shade-top { inset: 0 0 auto 0; height: 100%; }
.tutorial-shade-left, .tutorial-shade-right, .tutorial-shade-bottom { width: 0; height: 0; }
.tutorial-bar { position: absolute; z-index: 1002; left: 50%; bottom: 24px; width: min(860px, calc(100% - 32px)); transform: translateX(-50%); padding: 0 22px 20px; border: 1px solid rgba(255,255,255,.65); border-radius: 22px; background: var(--solid); box-shadow: 0 26px 80px rgba(0,0,0,.3); pointer-events: auto; overflow: hidden; }
.tutorial-progress { height: 5px; margin: 0 -22px 18px; background: var(--paper-deep); }
.tutorial-progress span { display: block; height: 100%; width: 16.666%; border-radius: 0 99px 99px 0; background: var(--coral); transition: width .28s ease; }
.tutorial-copy { display: grid; grid-template-columns: 55px 1fr; gap: 14px; align-items: start; }
.tutorial-step { padding-top: 5px; color: var(--green); font: 700 11px "DM Sans", sans-serif; }
.tutorial-copy h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.035em; }
.tutorial-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.tutorial-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; margin-top: 17px; }
.tutorial-actions button { padding: 9px 16px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700; }
.tutorial-skip { margin-right: auto; border: 0; background: transparent; color: var(--muted); }
.tutorial-prev { border: 1px solid var(--line); background: transparent; }
.tutorial-next { min-width: 76px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); }
.tutorial-prev:disabled { opacity: .35; cursor: default; }
.tutorial-focus { position: relative !important; border-radius: 15px; box-shadow: 0 0 0 5px var(--yellow), 0 18px 50px rgba(0,0,0,.24) !important; background-color: var(--solid) !important; }

@media (max-width: 800px) {
  .app-shell { width: min(100% - 22px, 680px); }
  .topbar { height: auto; min-height: 72px; padding: 13px 0; flex-wrap: wrap; }
  .privacy-chip { display: none; }
  .main-nav { order: 3; width: 100%; margin: 9px 0 0; padding-top: 11px; border-top: 1px solid var(--line); gap: 20px; overflow-x: auto; }
  .main-nav a { white-space: nowrap; }
  .header-actions { margin-left: auto; }
  .hero { min-height: auto; grid-template-columns: 1fr; gap: 24px; padding: 52px 10px 35px; }
  .hero-orbit { width: 220px; justify-self: start; margin-left: 18px; }
  .workspace { padding: 18px; border-radius: 21px; margin-top: 24px; }
  .control-rail { grid-template-columns: 1fr 1fr; align-items: end; }
  .grade-system { grid-column: 1 / -1; align-items: center; flex-wrap: wrap; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 105px; }
  .summary-value { margin-top: 11px; }
  .tab { padding: 15px 8px; font-size: 12px; }
  .tab span { display: none; }
  .subject-fields { grid-template-columns: 1fr 1fr; }
  .goal-layout, .analysis-grid { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; gap: 18px; }
  .guide-strip { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr auto; }
  footer p { display: none; }
  .tutorial-bar { bottom: 12px; padding: 0 16px 16px; border-radius: 18px; }
  .tutorial-progress { margin: 0 -16px 15px; }
  .tutorial-copy { grid-template-columns: 1fr; gap: 4px; }
  .tutorial-copy h2 { font-size: 18px; }
  .tutorial-actions button { padding: 9px 13px; }
}

.content-shell { width: min(940px, calc(100% - 36px)); margin: 0 auto; }
.content-hero { padding: 80px 0 55px; border-bottom: 1px solid var(--line); }
.content-hero h1 { max-width: 820px; font-size: clamp(42px, 7vw, 76px); }
.content-hero p:last-child { max-width: 680px; margin: 24px 0 0; color: var(--muted); line-height: 1.8; }
.article-layout { display: grid; grid-template-columns: 190px 1fr; gap: 60px; padding: 55px 0 90px; }
.article-index { position: sticky; top: 24px; align-self: start; display: grid; gap: 9px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; }
.article-index strong { margin-bottom: 5px; font-size: 12px; }
.article-index a { color: var(--muted); text-decoration: none; font-size: 12px; }
.article-index a:hover { color: var(--green); }
.article-body { min-width: 0; }
.article-section { padding: 0 0 50px; margin: 0 0 48px; border-bottom: 1px solid var(--line); }
.article-section:last-child { border-bottom: 0; }
.article-section h2 { margin: 0 0 18px; font-size: 28px; letter-spacing: -.04em; }
.article-section h3 { margin: 30px 0 12px; font-size: 17px; }
.article-section p, .article-section li { color: var(--muted); line-height: 1.9; font-size: 14px; }
.article-section ul, .article-section ol { padding-left: 22px; }
.formula-box, .example-box { margin: 20px 0; padding: 20px; border-radius: 15px; background: var(--solid); border: 1px solid var(--line); }
.formula-box { font-family: "DM Sans", "Noto Sans KR", sans-serif; color: var(--green); font-weight: 700; }
.example-box strong { display: block; margin-bottom: 8px; color: var(--ink); }
.policy-meta { margin-top: 18px; font-size: 12px !important; }
.content-footer { min-height: 120px; }

@media (max-width: 720px) {
  .content-shell { width: min(100% - 26px, 620px); }
  .content-hero { padding: 52px 0 38px; }
  .article-layout { grid-template-columns: 1fr; gap: 30px; padding-top: 32px; }
  .article-index { position: static; grid-template-columns: repeat(2, 1fr); }
  .article-index strong { grid-column: 1 / -1; }
  .content-footer { grid-template-columns: 1fr; padding: 25px 0; }
  .content-footer .footer-links { flex-wrap: wrap; }
}

@media (max-width: 470px) {
  h1 { font-size: 42px; }
  .hero-orbit { width: 190px; }
  .control-rail { grid-template-columns: 1fr; }
  .select-wrap { max-width: none; }
  .school-switch { width: 100%; }
  .school-option { flex: 1; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .subject-card { grid-template-columns: 1fr; }
  .subject-number { display: none; }
  .subject-fields { grid-template-columns: 1fr 1fr; }
  .field.full-mobile { grid-column: 1 / -1; }
  .footer-actions { flex-direction: column; align-items: flex-end; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
