:root {
  --p-50: #f6f3ff;
  --p-100: #ede8ff;
  --p-200: #ddd4fe;
  --p-300: #c4b5fd;
  --p-400: #a78bfa;
  --p-500: #8b5cf6;
  --p-600: #7c3aed;
  --p-700: #6d28d9;
  --p-800: #5b21b6;
  --p-900: #3b1a78;
  --ink: #1d1a2e;
  --ink-2: #4a4662;
  --muted: #8a86a0;
  --line: #ebe7f5;
  --bg: #faf9fe;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(40, 20, 90, .04), 0 8px 28px rgba(60, 30, 140, .07);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tt-label: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }

/* background */
.bg-blob {
  position: fixed; z-index: -1; border-radius: 50%; filter: blur(80px); opacity: .55; pointer-events: none;
}
.bg-blob.b1 { width: 520px; height: 520px; background: #e4d9ff; top: -180px; right: -120px; }
.bg-blob.b2 { width: 420px; height: 420px; background: #f3e3ff; bottom: -160px; left: -140px; }

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px;
  background: rgba(250, 249, 254, .78);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(235, 231, 245, .8);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--p-500), var(--p-800)); color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, .35);
}
.brand-name { font-weight: 800; font-size: 17px; }
.brand-sub { color: var(--muted); font-size: 13px; }

.stepper { display: flex; gap: 6px; align-items: center; }
.stepper .st {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  font-size: 12.5px; color: var(--muted); transition: all .35s var(--ease); white-space: nowrap;
}
.stepper .st .n {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--line); color: var(--muted); transition: all .35s var(--ease);
}
.stepper .st.done .n { background: var(--p-200); color: var(--p-700); }
.stepper .st.on { background: var(--p-100); color: var(--p-800); font-weight: 600; }
.stepper .st.on .n { background: var(--p-600); color: #fff; box-shadow: 0 0 0 4px rgba(124, 58, 237, .15); }
.stepper .bar { width: 14px; height: 2px; background: var(--line); border-radius: 2px; }

main { max-width: 1080px; margin: 0 auto; padding: 36px 24px 120px; }

/* step transitions */
.step { animation: stepInFwd .55s var(--ease) both; }
.step.back { animation-name: stepInBack; }
.step.still { animation: none; }
@keyframes stepInFwd {
  from { opacity: 0; transform: translateX(28px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes stepInBack {
  from { opacity: 0; transform: translateX(-28px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
.step > * { animation: rise .6s var(--ease) both; }
.step.still > *, .step.still .entry, .step.still .reveal { animation: none; }
.step.still .entry.fresh { animation: rise .35s var(--ease) both; }
.step > *:nth-child(2) { animation-delay: .05s; }
.step > *:nth-child(3) { animation-delay: .1s; }
.step > *:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.step-head { margin-bottom: 22px; }
.eyebrow { color: var(--p-600); font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.step-head h2 { margin: 6px 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.step-head p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.6; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px;
}
.card + .card { margin-top: 16px; }
.card-title { font-weight: 700; font-size: 15px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }

.field + .field { margin-top: 26px; padding-top: 24px; border-top: 1px dashed var(--line); }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.field-head label, .lbl { font-weight: 700; font-size: 15px; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 6px; }
.req { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--p-600); padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }
.sub-label { font-size: 13px; color: var(--ink-2); font-weight: 600; margin: 12px 0 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.grid2 > .field { margin-top: 26px !important; padding-top: 24px; border-top: 1px dashed var(--line); }
.disabled-area { opacity: .35; pointer-events: none; filter: grayscale(.4); transition: all .3s var(--ease); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 15px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: transform .2s var(--ease), background .25s, color .25s, border-color .25s, box-shadow .25s;
}
.chip:hover { border-color: var(--p-300); color: var(--p-700); }
.chip:active { transform: scale(.96); }
.chip.on {
  background: var(--p-600); border-color: var(--p-600); color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, .28);
}
.chip.sm { padding: 6px 12px; font-size: 13px; }

/* inputs */
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 14px; font-size: 14.5px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--p-400); box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }
select.input { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%238a86a0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
.input-unit { position: relative; }
.input-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline .input { width: auto; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .tr { width: 36px; height: 21px; border-radius: 999px; background: #e3dff0; position: relative; transition: background .25s var(--ease); }
.switch .tr::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .3s var(--ease); }
.switch input:checked + .tr { background: var(--p-600); }
.switch input:checked + .tr::after { transform: translateX(15px); }

/* big option cards */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.opt {
  border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius); padding: 24px; cursor: pointer; text-align: left;
  transition: all .3s var(--ease); position: relative; overflow: hidden;
}
.opt:hover { border-color: var(--p-300); transform: translateY(-2px); box-shadow: var(--shadow); }
.opt.on { border-color: var(--p-600); background: linear-gradient(160deg, #fff 30%, var(--p-50)); box-shadow: 0 10px 30px rgba(124, 58, 237, .16); }
.opt .big { font-size: 30px; font-weight: 800; color: var(--p-700); letter-spacing: -0.03em; }
.opt .t { font-weight: 700; margin: 6px 0 4px; font-size: 16px; }
.opt .d { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.opt .check { position: absolute; top: 18px; right: 18px; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; transition: all .3s var(--ease); }
.opt.on .check { background: var(--p-600); border-color: var(--p-600); }
.opt.on .check::after { content: ""; width: 8px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }

.reveal { animation: rise .45s var(--ease) both; }

/* footer nav */
.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: flex; justify-content: center; padding: 14px 24px 18px;
  background: linear-gradient(to top, rgba(250,249,254,1) 55%, rgba(250,249,254,0));
  pointer-events: none;
}
.navbar .inner { max-width: 1032px; width: 100%; display: flex; justify-content: space-between; gap: 10px; pointer-events: auto; }
.btn {
  border: 0; border-radius: 13px; padding: 13px 22px; font-weight: 700; font-size: 15px; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .25s, background .25s, opacity .25s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--p-600), var(--p-800)); color: #fff; box-shadow: 0 8px 22px rgba(109, 40, 217, .32); }
.btn.primary:hover { box-shadow: 0 10px 28px rgba(109, 40, 217, .42); transform: translateY(-1px); }
.btn.ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--p-300); color: var(--p-700); }
.btn.soft { background: var(--p-100); color: var(--p-800); }
.btn.soft:hover { background: var(--p-200); }
.btn.sm { padding: 9px 14px; font-size: 13.5px; border-radius: 11px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* intro */
.hero { text-align: center; padding: 60px 0 30px; }
.pill { display: inline-flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 8px; font-size: 13px; color: var(--ink-2); box-shadow: var(--shadow); }
.pill b { background: var(--p-600); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; }
.hero h1 { font-size: 52px; line-height: 1.18; letter-spacing: -0.045em; margin: 24px 0 16px; font-weight: 800; }
.hero h1 .grad { background: linear-gradient(120deg, var(--p-500), var(--p-800) 60%, #b04bd8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--ink-2); font-size: 17px; line-height: 1.7; margin: 0 auto 30px; max-width: 560px; }
.hero .cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 56px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--p-100); color: var(--p-700); display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }
.feature b { display: block; font-size: 15.5px; margin-bottom: 4px; }
.feature span { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.mock { margin: 50px auto 0; max-width: 860px; }

/* period */
.period-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: end; }
.period-row .arrow { color: var(--p-400); font-size: 22px; padding-bottom: 10px; }
.period-box .lbl { display: block; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.period-box .pair { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; }
.summary-strip { margin-top: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--ink-2); font-size: 14px; }
.summary-strip b { color: var(--p-700); }
.month-strip { display: flex; gap: 3px; margin-top: 16px; }
.month-strip i { flex: 1; height: 30px; border-radius: 7px; background: var(--p-100); display: grid; place-items: center; font-style: normal; font-size: 11px; color: var(--p-700); font-weight: 600; animation: rise .4s var(--ease) both; }

/* academy / teacher / course pickers */
.chip.own { border-color: var(--p-200); background: var(--p-50); color: var(--p-800); }
.chip.own.on { background: var(--p-600); color: #fff; }
.note-box { font-size: 13px; color: var(--muted); background: var(--p-50); border-radius: 10px; padding: 10px 12px; }
.kind-hint { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.kind-hint .sw { width: 12px; height: 9px; border-radius: 3px; }

/* curriculum builder */
.builder { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.subj-list { display: flex; flex-direction: column; gap: 6px; }
.subj {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 13px; cursor: pointer;
  border: 1px solid transparent; background: transparent; text-align: left; font-weight: 600; color: var(--ink-2); font-size: 14.5px;
  transition: all .25s var(--ease);
}
.subj:hover { background: #fff; border-color: var(--line); }
.subj.on { background: #fff; border-color: var(--p-300); color: var(--p-800); box-shadow: var(--shadow); }
.subj .cnt { font-size: 12px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--muted); display: grid; place-items: center; }
.subj.on .cnt, .subj .cnt.has { background: var(--p-600); color: #fff; }
.seg { display: inline-flex; background: var(--p-50); border: 1px solid var(--line); border-radius: 13px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); transition: all .25s var(--ease); }
.seg button.on { background: #fff; color: var(--p-700); box-shadow: 0 1px 4px rgba(60, 30, 140, .12); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row { margin-top: 16px; }
.form-row > .lbl { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; font-weight: 600; }
.entries { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.entry { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--p-50); font-size: 13.5px; animation: rise .35s var(--ease) both; }
.entry .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.entry .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.entry .x { border: 0; background: transparent; cursor: pointer; color: var(--muted); width: 26px; height: 26px; border-radius: 8px; font-size: 16px; line-height: 1; }
.entry .x:hover { background: #fff; color: #d6336c; }
.empty { color: var(--muted); font-size: 13.5px; padding: 14px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; margin-top: 18px; }

/* timetable */
.tt-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px 4px; }
.tt { display: grid; grid-auto-rows: minmax(26px, auto); min-width: 640px; font-size: 11px; position: relative; }
.tt .h { grid-row: 1; text-align: center; font-weight: 700; color: var(--ink-2); padding: 6px 0 7px; font-size: 11.5px; border-bottom: 1.5px solid var(--p-200); position: relative; }
.tt .h small { display: block; font-size: 9.5px; color: var(--p-500); font-weight: 600; line-height: 1; margin-bottom: 2px; }
.tt .h.y0 small { visibility: hidden; }
.tt .corner { grid-row: 1; grid-column: 1; border-bottom: 1.5px solid var(--p-200); }
.tt .lab { grid-column: 1; display: flex; align-items: center; font-weight: 700; color: var(--ink); font-size: 12px; padding: 0 8px 0 4px; border-top: 1px solid var(--line); background: #fff; }
.tt .lab.first, .tt .bgc.first { border-top: 0; }
.tt .bgc {
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
  background-image: linear-gradient(to right, transparent calc(50% - .5px), #f1eef8 calc(50% - .5px), #f1eef8 calc(50% + .5px), transparent calc(50% + .5px));
}
.tt .bgc.alt { background-color: #fcfbff; }
.tt .bar {
  margin: 2.5px 1.5px; border-radius: 6px; padding: 3px 7px; display: flex; align-items: center; min-width: 0; overflow: hidden;
  font-weight: 600; font-size: 10.5px; line-height: 1.25; z-index: 1; position: relative;
}
.tt .bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt .bar.pop { animation: barIn .6s var(--ease) both; transform-origin: left center; }
.tt .bar.deletable span { flex: 1; min-width: 0; }
.tt .bar .bar-x {
  flex: none; margin-left: 3px; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 4px;
  background: rgba(255, 255, 255, .75); color: #333; font-size: 12px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.tt .bar:hover .bar-x, .tt .bar .bar-x:focus-visible { opacity: 1; }
.tt .bar .bar-x:hover { background: #fff; color: #d6336c; }
@media (hover: none) { .tt .bar .bar-x { opacity: 1; } }
@keyframes barIn { from { opacity: 0; transform: scaleX(.3); } to { opacity: 1; transform: none; } }

/* type colors */
.k-basic { background: #6d28d9; color: #fff; }
.k-adv { background: #9b6cf6; color: #fff; }
.k-law { background: #c13fd6; color: #fff; }
.k-case { background: #4f46e5; color: #fff; }
.k-read { background: #ece6ff; color: #4c1d95; border: 1px solid #b9a4fb; }
.k-study { background: repeating-linear-gradient(135deg, #fbe4f8, #fbe4f8 5px, #f7d6f3 5px, #f7d6f3 10px); color: #86197f; border: 1px solid #eeb3e7; }
.g-live { background: #7c3aed; color: #fff; }
.g-solo { background: #c4b5fd; color: #2e1065; }
.g-toc { background: #fff; color: #5b21b6; border: 1px dashed #8b5cf6; }
.g-group { background: #efeaff; color: #4c1d95; border: 1px solid #a78bfa; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 11.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }

.preview-card .card-title { justify-content: space-between; }

/* result sheet */
.result-tools { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; margin-bottom: 18px; }
.result-tools .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sheet-wrap { overflow: hidden; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(60, 30, 140, .14); border: 1px solid var(--line); background: #fff; }
.sheet { width: 1120px; background: #fff; padding: 34px 38px 26px; color: var(--ink); }
.sh-head {
  border-radius: 18px; padding: 24px 28px; color: #fff; display: flex; justify-content: space-between; gap: 24px; align-items: flex-end;
  background: linear-gradient(125deg, #4c1d95 0%, #6d28d9 45%, #8b5cf6 80%, #b56be8 100%);
  position: relative; overflow: hidden;
}
.sh-head::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.08); }
.sh-kicker { font-size: 11px; letter-spacing: .14em; font-weight: 700; opacity: .75; }
.sh-head h1 { margin: 8px 0 6px; font-size: 26px; letter-spacing: -0.03em; font-weight: 800; }
.sh-period { font-size: 13.5px; opacity: .88; }
.sh-badges { display: grid; grid-template-columns: repeat(2, auto); gap: 8px; position: relative; z-index: 1; }
.sh-badge { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 12px; padding: 8px 12px; min-width: 150px; }
.sh-badge small { display: block; font-size: 10.5px; opacity: .72; font-weight: 600; margin-bottom: 2px; }
.sh-badge b { font-size: 13.5px; font-weight: 700; }
.sh-badge b.anon { opacity: .6; font-weight: 500; }
.sh-sec { margin-top: 22px; }
.sh-sec h2 { font-size: 14.5px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; letter-spacing: -0.02em; }
.sh-sec h2::before { content: ""; width: 4px; height: 15px; border-radius: 2px; background: var(--p-600); }
.sh-sec h2 small { color: var(--muted); font-weight: 500; font-size: 12px; }
.sheet .tt { min-width: 0; }
.sh-comment { background: var(--p-50); border-radius: 14px; padding: 14px 18px; font-size: 13px; line-height: 1.65; color: var(--ink-2); white-space: pre-wrap; border: 1px solid var(--p-100); }
.sh-foot { margin-top: 18px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 500;
  transition: all .35s var(--ease); box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.busy { position: fixed; inset: 0; background: rgba(250,249,254,.7); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 60; font-weight: 600; color: var(--p-800); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--p-200); border-top-color: var(--p-600); animation: spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .brand-sub, .stepper .st .lb, .stepper .bar { display: none; }
  .stepper .st { padding: 4px; }
  .topbar { padding: 12px 16px; }
  main { padding: 24px 16px 120px; }
  .hero h1 { font-size: 36px; }
  .features, .opts, .grid2, .form-grid { grid-template-columns: 1fr; }
  .builder { grid-template-columns: 1fr; }
  .subj-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .subj { flex: none; }
  .period-row { grid-template-columns: 1fr; }
  .period-row .arrow { display: none; }
  .result-tools { grid-template-columns: 1fr; }
  .result-tools .actions { justify-content: flex-start; }
  .card { padding: 20px; }
}

/* half-month period bar */
.sb-scroll, .wk-scroll { overflow-x: auto; padding-bottom: 4px; }
.slotbar { display: grid; grid-template-rows: auto 40px; min-width: 100%; user-select: none; }
.sb-m { grid-row: 1; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--ink-2); padding-bottom: 6px; white-space: nowrap; }
.sb-m small { display: block; font-size: 9.5px; color: var(--p-500); line-height: 1; margin-bottom: 2px; }
.sb-s {
  grid-row: 2; background: var(--p-50); cursor: pointer; position: relative; touch-action: none;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background .18s var(--ease);
}
.sb-s.h1 { border-left: 1.5px solid #cfc6ea; }
.sb-s.h2 { border-left: 1px dashed #d9d2ef; }
.sb-s:last-child { border-right: 1.5px solid #cfc6ea; }
.sb-s:nth-child(1 of .sb-s) { border-radius: 8px 0 0 8px; }
.sb-s:hover { background: var(--p-100); }
.sb-s.used::after { content: ""; position: absolute; left: 3px; right: 3px; bottom: 4px; height: 3px; border-radius: 2px; background: var(--p-300); }
.sb-s.on { background: var(--p-600); }
.sb-s.on:hover { background: var(--p-700); }
.sb-s.on.used::after { background: rgba(255,255,255,.6); }
.sb-legend { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.sb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sb-legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; background: var(--p-50); border: 1px solid var(--line); position: relative; }
.sb-legend i.on { background: var(--p-600); border-color: var(--p-600); }
.sb-legend i.used::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 1px; height: 2px; background: var(--p-300); }
.sb-sum, .tb-sum { margin-top: 8px; font-size: 13px; color: var(--p-800); font-weight: 600; background: var(--p-50); border-radius: 10px; padding: 9px 12px; }
.tb-sum b { color: var(--p-700); }
.link-btn { border: 0; background: none; color: var(--p-600); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 0; margin-left: auto; }
.link-btn:hover { text-decoration: underline; }

/* daily study-time bar */
.tb { padding: 30px 12px 0; user-select: none; touch-action: none; cursor: pointer; }
.tb-track { position: relative; height: 14px; border-radius: 999px; background: var(--p-100); }
.tb-fill { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--p-500), var(--p-700)); }
.tb-h {
  position: absolute; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--p-600); box-shadow: 0 3px 10px rgba(91, 33, 182, .3); cursor: grab;
  transition: transform .15s var(--ease);
}
.tb-h:hover, .tb.dragging .tb-h { transform: scale(1.12); }
.tb.dragging .tb-h { cursor: grabbing; }
.tb-h b { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; color: #fff; background: var(--p-800); padding: 3px 7px; border-radius: 6px; }
.tb-ticks { position: relative; height: 22px; margin-top: 6px; }
.tb-ticks span { position: absolute; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); }
.tb.static { padding: 4px 6px 0; cursor: default; }
.tb.static .tb-track { height: 9px; }
.tb.static .tb-ticks { height: 14px; margin-top: 3px; }
.tb.static .tb-ticks span { font-size: 8.5px; }

/* weekly rest grid */
.wk { display: grid; grid-template-columns: repeat(14, minmax(34px, 1fr)); user-select: none; min-width: 480px; }
.wk-d { text-align: center; font-weight: 700; font-size: 13px; padding-bottom: 4px; }
.wk-ap { text-align: center; font-size: 10.5px; color: var(--muted); padding-bottom: 4px; }
.wk-c {
  height: 42px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted);
  background: #f4f2f9; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; touch-action: none;
  transition: background .18s var(--ease);
}
.wk-c.h1 { border-left: 1.5px solid #b9aee0; }
.wk-c.h2 { border-left: 1px dashed #cfc6ea; }
.wk-c:last-child { border-right: 1.5px solid #b9aee0; }
.wk-c.on { background: var(--p-500); }
.wk-c.on:hover { background: var(--p-600); }
.wk-c:not(.on):hover { background: var(--p-100); }
.wk.static { min-width: 0; grid-template-columns: repeat(14, 1fr); }
.wk.static .wk-d { font-size: 10px; padding-bottom: 2px; }
.wk.static .wk-c { height: 18px; font-size: 8.5px; cursor: default; }

/* routine section on the result sheet */
.sh-routine { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr 1fr; gap: 10px; }
.rt-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fcfbff; }
.rt-box > small { display: block; font-size: 10.5px; font-weight: 700; color: var(--p-600); margin-bottom: 6px; }
.rt-v { font-size: 11px; color: var(--ink-2); margin-top: 6px; }
.rt-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.rt-tags span { font-size: 11px; background: var(--p-100); color: var(--p-800); border-radius: 999px; padding: 3px 9px; font-weight: 600; }
.rt-tags em { font-size: 11px; color: var(--muted); font-style: normal; }

/* stepper sub-step dots */
.stepper .dots { display: inline-flex; gap: 3px; margin-left: 2px; }
.stepper .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line); display: inline-block; }
.stepper .dots i.d { background: var(--p-300); }
.stepper .dots i.c { background: var(--p-600); }

/* extra-study period rows */
.ex-list { margin-top: 14px; display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; align-items: start; }
.ex-months { grid-column: 2; }
.ex-row { display: contents; }
.ex-name { font-size: 13px; font-weight: 700; color: var(--ink); padding-top: 7px; }
.slotbar.head { grid-template-rows: auto; }
.slotbar.compact { grid-template-rows: 30px; }
.slotbar.compact .sb-s { grid-row: 1; }
.sb-sum.sm { font-size: 12px; padding: 6px 10px; margin-top: 5px; font-weight: 600; }

/* 순공 input */
.pure-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pure-row .lbl { font-size: 13.5px; font-weight: 700; }
.pure-row .input-unit { width: 140px; }

/* stage blocks on the sheet */
.sh-stage { margin-top: 22px; border: 1px solid var(--line); border-radius: 16px; padding: 4px 18px 16px; }
.sh-stage-h { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 -6px; }
.sh-stage-h b { font-size: 15px; color: #fff; background: var(--p-700); padding: 3px 11px; border-radius: 999px; }
.sh-stage-h span { font-size: 12.5px; color: var(--ink-2); }
.sh-extra { margin-top: 10px; }

@media (max-width: 860px) {
  .ex-list { grid-template-columns: 76px 1fr; }
  .stepper .dots { display: none; }
}

/* on-screen marker where the PDF splits into a second page */
.sh-pagebreak { position: relative; margin: 26px 0 4px; border-top: 2px dashed var(--p-200); text-align: center; }
.sh-pagebreak span { position: relative; top: -11px; background: #fff; padding: 0 10px; font-size: 11px; font-weight: 700; color: var(--p-500); letter-spacing: .04em; }

/* in-page confirm dialog */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(29, 26, 46, .35); display: grid; place-items: center; padding: 16px; }
.modal-box { background: var(--card); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(60, 30, 140, .25); padding: 22px; max-width: 360px; width: 100%; }
.modal-box p { margin: 0 0 18px; font-size: 15px; line-height: 1.6; font-weight: 600; }
.modal-btns { display: flex; justify-content: flex-end; gap: 8px; }
