:root {
  color-scheme: light;
  --ink: #18211c;
  --muted: #5e6a62;
  --line: #dce4de;
  --soft: #f3f7f4;
  --paper: #ffffff;
  --green: #17633b;
  --green-2: #0e4c2c;
  --green-soft: #e9f5ee;
  --gold: #b97819;
  --blue: #1769aa;
  --warn: #835514;
  --warn-bg: #fff7e8;
  --shadow: 0 18px 60px rgba(20, 47, 30, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #f7faf8; font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif; line-height: 1.65; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 99; padding: .75rem 1rem; color: white; background: var(--green-2); border-radius: .5rem; }
.skip-link:focus { top: 1rem; }

.topbar { min-height: 72px; padding: 12px clamp(18px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--green); font-weight: 800; }
.brand strong, .brand small { display: block; line-height: 1.25; }
.brand small { color: var(--muted); font-size: .76rem; margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.safe-badge { padding: 7px 11px; border-radius: 999px; color: var(--green-2); background: var(--green-soft); font-size: .82rem; font-weight: 700; }
.quiet-button, .secondary { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 9px; padding: 8px 13px; font-weight: 700; }
.quiet-button:hover, .secondary:hover { background: var(--soft); }

main { width: min(1500px, 100%); margin: 0 auto; }
.hero { padding: clamp(54px, 8vw, 96px) clamp(20px, 6vw, 90px) 42px; background: radial-gradient(circle at 82% 12%, #dcefe3 0, transparent 30%), linear-gradient(140deg, #fbfdfb, #eef6f1); }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: .84rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { max-width: 900px; margin: 0; font-size: clamp(2rem, 5vw, 4.4rem); line-height: 1.1; letter-spacing: -.05em; }
.hero > p:not(.eyebrow) { max-width: 850px; margin: 22px 0; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.2rem); }
.flow-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; }
.flow-summary span { padding: 8px 13px; border: 1px solid #cfe0d4; border-radius: 999px; background: rgba(255,255,255,.8); font-weight: 700; font-size: .9rem; }
.flow-summary i { color: #819087; font-style: normal; }

.workspace { margin: 0 clamp(14px, 3vw, 48px) 64px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 760px; }
.lesson-nav { background: #143724; color: white; padding: 28px 18px; }
.nav-title { margin: 0 10px 16px; color: #a8c8b4; font-size: .78rem; font-weight: 800; letter-spacing: .1em; }
.lesson-tab { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 12px; border: 0; border-radius: 12px; color: #dcebe1; background: transparent; text-align: left; }
.lesson-tab:hover { background: rgba(255,255,255,.08); }
.lesson-tab.active { color: #143724; background: white; }
.lesson-tab strong, .lesson-tab small { display: block; }
.lesson-tab small { margin-top: 2px; color: inherit; opacity: .72; font-size: .75rem; }
.tab-number { font-size: .74rem; font-weight: 900; opacity: .68; }
.nav-help { margin: 28px 8px 0; padding: 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 13px; background: rgba(255,255,255,.06); }
.nav-help strong { font-size: .84rem; }
.nav-help p { margin: 7px 0 0; color: #bed3c5; font-size: .78rem; line-height: 1.55; }

.lesson-stage { min-width: 0; padding: clamp(22px, 4vw, 50px); }
.lesson-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.role-line { margin: 0 0 3px; color: var(--green); font-weight: 800; font-size: .84rem; }
.lesson-heading h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2.25rem); line-height: 1.25; letter-spacing: -.035em; }
.progress-box { min-width: 160px; color: var(--muted); font-size: .78rem; text-align: right; }
.progress-track { width: 160px; height: 6px; margin-top: 7px; border-radius: 999px; background: #e8ede9; overflow: hidden; }
.progress-track span { display: block; width: 25%; height: 100%; border-radius: inherit; background: var(--green); transition: width .3s ease; }
.guide-grid { display: grid; grid-template-columns: minmax(250px, 340px) minmax(460px, 1fr); gap: 28px; align-items: start; }
.instruction-card { position: sticky; top: 100px; }
.step-label { margin: 0 0 7px; color: var(--green); font-size: .78rem; font-weight: 900; }
.instruction-card h3 { margin: 0 0 12px; font-size: 1.35rem; line-height: 1.35; }
.instruction-card > p { color: var(--muted); }
.check-card, .warning-card { margin-top: 16px; padding: 14px 15px; border-radius: 11px; font-size: .88rem; }
.check-card { border-left: 4px solid var(--green); background: var(--green-soft); }
.warning-card { border-left: 4px solid var(--gold); background: var(--warn-bg); }
.check-card p, .warning-card p { margin: 4px 0 0; }
.action-hint { font-size: .82rem; }
.action-hint span { color: var(--blue); }
.step-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; }
.primary { border: 1px solid var(--green); background: var(--green); color: white; border-radius: 9px; padding: 9px 14px; font-weight: 800; }
.primary:hover { background: var(--green-2); }
.primary:disabled, .secondary:disabled { opacity: .42; cursor: not-allowed; }

.simulator { min-width: 0; }
.sim-window { min-height: 520px; border: 1px solid #cdd7d0; border-radius: 15px; overflow: hidden; background: #edf2ee; box-shadow: 0 8px 28px rgba(25, 47, 32, .10); }
.window-titlebar { height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: white; background: #213a2b; font-size: .8rem; }
.window-titlebar .dots { letter-spacing: 3px; opacity: .7; }
.app-shell { display: grid; grid-template-columns: 160px 1fr; min-height: 476px; }
.app-nav { padding: 15px 10px; color: #dce8df; background: #1b2d22; }
.app-nav p { margin: 4px 8px 12px; font-size: .66rem; opacity: .66; }
.app-nav button { width: 100%; margin: 2px 0; padding: 9px 10px; border: 0; border-radius: 7px; color: inherit; background: transparent; text-align: left; font-size: .77rem; }
.app-nav button.selected { color: #173522; background: white; font-weight: 800; }
.app-content { position: relative; padding: 20px; background: #f7faf8; overflow: hidden; }
.app-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.app-toolbar h4 { margin: 0; font-size: 1.1rem; }
.sim-btn { border: 1px solid #becac1; border-radius: 7px; padding: 7px 11px; color: #1d3024; background: white; font-weight: 700; font-size: .74rem; }
.sim-btn.green { border-color: var(--green); color: white; background: var(--green); }
.sim-btn.target { outline: 4px solid rgba(23,105,170,.25); border-color: var(--blue); animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(23,105,170,.12); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
.status-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.status-pill { padding: 5px 8px; border-radius: 999px; background: #e6eee9; color: #31533e; font-size: .66rem; font-weight: 800; }
.status-pill.good { background: #dff3e7; color: #116438; }
.sim-card { padding: 14px; border: 1px solid #d8e0da; border-radius: 10px; background: white; }
.sim-card + .sim-card { margin-top: 10px; }
.sim-card h5 { margin: 0 0 9px; font-size: .82rem; }
.sim-table { width: 100%; border-collapse: collapse; font-size: .68rem; }
.sim-table th, .sim-table td { padding: 8px 7px; border-bottom: 1px solid #e5ebe6; text-align: left; }
.sim-table th { color: #657169; background: #f5f8f6; }
.fake-field { width: 100%; min-height: 35px; border: 1px solid #cbd5cd; border-radius: 7px; padding: 7px 9px; color: #24372a; background: white; font-size: .72rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-label { display: block; margin-bottom: 4px; color: #536158; font-size: .65rem; font-weight: 700; }
.modal-backdrop { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(17, 30, 22, .43); }
.sim-modal { width: min(390px, 96%); padding: 19px; border-radius: 12px; background: white; box-shadow: 0 18px 55px rgba(0,0,0,.22); }
.sim-modal h5 { margin: 0 0 5px; font-size: .95rem; }
.sim-modal > p { margin: 0 0 14px; color: var(--muted); font-size: .7rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.mobile-wrap { min-height: 520px; display: grid; place-items: center; padding: 18px; background: linear-gradient(145deg, #dce9e0, #f5f8f6); }
.phone { width: min(290px, 100%); min-height: 470px; border: 8px solid #18221c; border-radius: 30px; background: white; overflow: hidden; box-shadow: 0 15px 40px rgba(17,35,23,.23); }
.phone-top { height: 25px; display: grid; place-items: center; color: #657069; background: #f7f8f7; font-size: .57rem; }
.phone-body { padding: 18px 15px; }
.phone-body h4 { margin: 0 0 5px; font-size: 1rem; }
.phone-body > p { margin: 0 0 14px; color: var(--muted); font-size: .67rem; }
.phone .sim-btn { width: 100%; margin-top: 10px; }
.phone-card { margin: 9px 0; padding: 11px; border: 1px solid #dce4de; border-radius: 10px; background: #fbfcfb; font-size: .68rem; }
.phone-card strong, .phone-card span { display: block; }
.phone-card span { margin-top: 3px; color: var(--muted); }
.amount { margin: 8px 0; color: var(--green); font-size: 1rem; font-weight: 900; }
.qr { width: 110px; height: 110px; margin: 12px auto; display: grid; place-items: center; border: 8px solid white; outline: 1px solid #d1dad3; background: repeating-conic-gradient(#1a2b20 0 25%, white 0 50%) 0/18px 18px; color: transparent; }
.preview-sheet { width: min(330px, 90%); min-height: 390px; margin: 10px auto; padding: 28px 25px; background: white; box-shadow: 0 5px 18px rgba(22,39,27,.18); font-size: .65rem; }
.preview-sheet h5 { margin: 0 0 18px; text-align: center; font-size: 1rem; }
.preview-line { height: 7px; margin: 9px 0; border-radius: 2px; background: #dce3de; }
.preview-line.short { width: 58%; }
.live-message { min-height: 42px; margin-top: 10px; padding: 9px 12px; border-radius: 9px; color: #31513d; background: var(--green-soft); font-size: .82rem; }

.reference { padding: 20px clamp(20px, 6vw, 90px) 80px; }
.reference h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.7rem); letter-spacing: -.04em; }
.reference-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.reference article { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.reference article span { color: var(--green); font-size: .75rem; font-weight: 900; }
.reference article h3 { margin: 5px 0 8px; }
.reference article p { margin: 0; color: var(--muted); font-size: .9rem; }
details { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; }
summary { padding: 17px 20px; cursor: pointer; font-weight: 800; }
.trouble-list { margin: 0; padding: 0 20px 20px; }
.trouble-list div { padding: 13px 0; border-top: 1px solid #e8ede9; }
.trouble-list dt { font-weight: 800; }
.trouble-list dd { margin: 4px 0 0; color: var(--muted); }
footer { padding: 26px; color: #c8d7cd; background: #173122; text-align: center; font-size: .78rem; }

:focus-visible { outline: 3px solid #1475bd; outline-offset: 3px; }
@media (max-width: 1050px) {
  .workspace { grid-template-columns: 1fr; }
  .lesson-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 15px; }
  .nav-title, .nav-help { display: none; }
  .guide-grid { grid-template-columns: 1fr; }
  .instruction-card { position: static; }
}
@media (max-width: 720px) {
  .topbar { align-items: flex-start; }
  .safe-badge { display: none; }
  .hero { padding-top: 42px; }
  .flow-summary i { display: none; }
  .flow-summary span { width: 100%; }
  .workspace { margin-inline: 8px; border-radius: 15px; }
  .lesson-nav { grid-template-columns: 1fr; }
  .lesson-tab { padding: 10px 12px; }
  .lesson-tab small { display: inline; margin-left: 6px; }
  .lesson-stage { padding: 18px 13px 28px; }
  .lesson-heading { align-items: start; flex-direction: column; }
  .progress-box, .progress-track { width: 100%; text-align: left; }
  .guide-grid { gap: 18px; }
  .sim-window { min-height: 500px; }
  .app-shell { grid-template-columns: 1fr; }
  .app-nav { display: flex; overflow-x: auto; }
  .app-nav p { display: none; }
  .app-nav button { white-space: nowrap; }
  .app-content { padding: 13px; }
  .field-grid, .reference-grid { grid-template-columns: 1fr; }
}
@media (forced-colors: active) {
  .safe-badge, .status-pill, .check-card, .warning-card { border: 1px solid CanvasText; }
  .sim-btn.target { outline: 4px solid Highlight; }
}
