/* Superloopy 백엔드 스킬 설명 페이지: superloopy.dev와 같은 밤 팔레트 */
@font-face { font-family: "Manrope"; src: url("assets/fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("assets/fonts/ibm-plex-mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("assets/fonts/silkscreen.woff2") format("woff2"); font-weight: 400; font-display: swap; }


:root {
  /* Night palette shared with superloopy.dev: one ground, ivory text, one brand orange,
     five supporting hues. Each hue has a solid tone for text/icons and a 14% tint for fills;
     text on a solid fill always uses --on-accent. */
  --ground: #0b0d18;
  --surface: #12152b;
  --surface-2: #191d3a;
  --paper: #0e1124;
  --paper-2: #151933;
  --term-bg: #070913;
  --term-ink: #eeeae0;
  --line: rgba(238, 234, 224, 0.1);
  --line-strong: rgba(238, 234, 224, 0.22);
  --ink: #eeeae0;
  --navy: #eeeae0;
  --navy-2: #cfcdd3;
  --text-soft: #cfcdd3;
  --muted: #a3a5b4;
  --grey: #6e7186;
  --on-accent: #0b0d18;
  --coral: #f2a65a;
  --coral-ink: #f2a65a;
  --amber: #f5cf6b;
  --green: #5ec9a0;
  --red: #ff8a75;
  --lilac: #b3adf0;
  --sky: #8ec5ff;
  --coral-soft: rgba(242, 166, 90, 0.14);
  --amber-soft: rgba(245, 207, 107, 0.13);
  --green-soft: rgba(94, 201, 160, 0.14);
  --red-soft: rgba(255, 138, 117, 0.14);
  --lilac-soft: rgba(179, 173, 240, 0.15);
  --sky-soft: rgba(142, 197, 255, 0.13);
  --grey-soft: rgba(238, 234, 224, 0.06);
  --butter: var(--amber-soft);
  --butter-strong: rgba(245, 207, 107, 0.26);
  --mint: var(--green-soft);
  --mint-soft: rgba(94, 201, 160, 0.09);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 0 0 transparent;
  --shadow-sm: 0 0 0 transparent;
  --font: "Manrope", "Pretendard", "Pretendard Variable", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "D2Coding", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(238, 234, 224, 0.042) 1.1px, transparent 1.3px);
  background-size: 28px 28px;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

svg { display: block; }
a { color: var(--navy); text-underline-offset: 3px; }
p { margin: 0 0 1em; }
h1, h2, h3 { color: var(--ink); line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 0.5em; font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.035em; }
section[id], #agents { scroll-margin-top: 76px; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(238, 234, 224, 0.07);
  padding: 0.08em 0.36em;
  border-radius: 6px;
  word-break: normal;
  overflow-wrap: anywhere;
}

.wrap { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.small { font-size: 0.9rem; color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--ink); color:var(--ground); padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }

/* ---------- 머리글 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 24, 0.72);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand-logo { width: 32px; height: 16px; display: block; flex: none; }
.brand-word { font-family: "Silkscreen", var(--mono); font-size: 15px; letter-spacing: 0.06em; }
.brand-sub { padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); }
.nav-list { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.nav-list a { display: block; padding: 6px 11px; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: 0.92rem; font-weight: 600; white-space: nowrap; }
.nav-list a:hover { background: rgba(238, 234, 224, 0.07); }
.nav-list a.is-current { background: rgba(238, 234, 224, 0.1); color: var(--ink); }
.nav-toggle { display: none; }
.progress { position: absolute; left: 0; right: 0; bottom: -2px; height: 4px; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--coral); transform-origin: left center; transform: scaleX(0); }

@media (max-width: 1080px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    font: inherit; font-weight: 700; font-size: 0.95rem;
    padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); cursor: pointer;
  }
  .nav-list {
    display: none; position: absolute; right: 20px; top: 70px;
    flex-direction: column; gap: 2px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
    padding: 8px; min-width: 210px;
  }
  .nav-list.is-open { display: flex; }
  .nav-list a { padding: 10px 14px; font-size: 1rem; }
  .no-js .nav-toggle { display: none; }
  .no-js .nav-list { display: flex; position: static; flex-direction: row; flex-wrap: wrap; border: 0; box-shadow: none; background: transparent; padding: 0; min-width: 0; }
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: 0.98rem; line-height: 1.3;
  padding: 12px 22px; border-radius: 999px; border: 1px solid var(--line-strong);
  text-decoration: none; cursor: pointer; color: var(--ink); background: transparent;
  transition: transform 0.15s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn:hover { transform: translateY(-1px); border-color: rgba(238, 234, 224, 0.34); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 1; color: var(--muted); background: transparent; border-color: var(--line); cursor: not-allowed; transform: none; }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.btn-primary:hover { background: #fff; border-color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-coral { background: var(--coral); border-color: var(--coral); color: var(--ground); }
.btn-small { font-size: 0.9rem; padding: 8px 16px; }

/* ---------- 첫 화면: superloopy.dev와 같은 점 그림 히어로 ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: min(100svh - 64px, 820px); padding: 72px 0 84px; border-bottom: 1px solid var(--line); }
.hero-field { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; opacity: 0; transition: opacity 900ms var(--ease); --field-ground: #0b0d18; --field-lattice: #1a1f36; --field-word: #8f97cc; }
.hero-field.is-ready { opacity: 1; }
.hero-veil { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, var(--ground) 0%, rgba(11, 13, 24, 0.9) 32%, rgba(11, 13, 24, 0.35) 58%, rgba(11, 13, 24, 0) 74%), linear-gradient(0deg, var(--ground) 0%, rgba(11, 13, 24, 0) 22%); }
.hero-grid { display: block; }
.hero-copy { max-width: 640px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font: 600 13px/1.4 var(--font); color: var(--muted); background: rgba(11, 13, 24, 0.6); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 13px 6px 10px; margin-bottom: 24px; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(94, 201, 160, 0.18); }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.9rem); font-weight: 700; line-height: 1.16; letter-spacing: -0.04em; margin-bottom: 22px; color: var(--ink); }
.hl { background: linear-gradient(92deg, #fbe2b0 0%, #f2a65a 46%, #e2804f 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 36em; }
.summary-pill { display: flex; gap: 14px; align-items: flex-start; background: rgba(16, 19, 42, 0.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line-strong); border-radius: 16px; padding: 14px 18px; margin: 28px 0; max-width: 40em; }
.summary-pill strong { flex: none; color: var(--coral); font: 700 13px/1.85 var(--font); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.hero-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.hero-meta li { font: 500 12.5px/1.4 var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
@media (max-width: 760px) {
  .hero { align-items: flex-end; min-height: auto; padding-top: 220px; }
  .hero-veil { background: linear-gradient(180deg, rgba(11, 13, 24, 0.1) 0%, rgba(11, 13, 24, 0.75) 30%, var(--ground) 52%); }
}


/* ---------- 구역 공통 ---------- */
.section { padding: 88px 0; position: relative; }
.section-tinted { background-color: rgba(238, 234, 224, 0.035); border-block: 1px solid var(--line); }
.section-navy {
  background-color: var(--surface);
  background-image: radial-gradient(rgba(238, 234, 224, 0.05) 1.1px, transparent 1.3px);
  background-size: 28px 28px;
  color: var(--ink);
  border-block: 1px solid var(--line);
}
.section-navy h2, .section-navy .section-lead { color: var(--ink); }
.section-navy .kicker { color: var(--coral); }
.kicker { display: inline-flex; align-items: center; gap: 8px; font: 600 13px/1 var(--font); color: var(--coral); letter-spacing: 0.02em; margin-bottom: 14px; }
.kicker::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.section-lead { font-size: 1.08rem; color: var(--muted); max-width: 46em; margin-bottom: 36px; }
@media (max-width: 720px) { .section { padding: 64px 0; } }

/* ---------- 세 단어 ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; }
.card h3 { font-size: 1.28rem; }
.card-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; border: 1px solid var(--line); margin-bottom: 16px; flex: none; }
.card-icon .icon { width: 30px; height: 30px; }
.term { background: linear-gradient(transparent 60%, rgba(179, 173, 240, 0.32) 60%); padding: 0 0.06em; }
.note { margin-top: auto; padding-top: 12px; border-top: 1px dashed rgba(238, 234, 224, 0.225); font-size: 0.9rem; color: var(--muted); margin-bottom: 0; }

.tone-butter { background-color: var(--amber-soft); color: var(--amber); }
.tone-mint { background-color: var(--green-soft); color: var(--green); }
.tone-lilac { background-color: var(--lilac-soft); color: var(--lilac); }
.tone-coral { background-color: var(--coral-soft); color: var(--coral); }
.tone-sky { background-color: var(--sky-soft); color: var(--sky); }

.kitchen { margin: 40px 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.3fr) auto minmax(0, 1fr); align-items: stretch; gap: 12px; }
.k-node { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.k-node > .icon { width: 34px; height: 34px; margin-bottom: 8px; color: var(--navy); }
.k-node b { font-size: 1.1rem; color: var(--navy); }
.k-node > span { color: var(--muted); font-size: 0.95rem; }
.k-back { background: var(--mint-soft); }
.k-helper { margin-top: 10px; display: flex; gap: 8px; align-items: center; font-style: normal; font-size: 0.9rem; font-weight: 700; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; line-height: 1.4; }
.k-helper .icon { width: 22px; height: 22px; color: var(--coral-ink); }
.k-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-width: 92px; font-weight: 800; color: var(--navy); font-size: 0.92rem; line-height: 1.35; }
.k-arrow small { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.k-arrow::after {
  content: ""; display: block; width: 72px; height: 14px; margin-top: 6px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 14'%3E%3Cpath d='M2 7h64M58 1l8 6-8 6' fill='none' stroke='%23101217' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (max-width: 900px) {
  .cards-3 { grid-template-columns: 1fr; }
  .kitchen { grid-template-columns: 1fr; }
  .k-arrow { flex-direction: row; gap: 8px; min-height: 40px; }
  .k-arrow::after { width: 30px; height: 14px; margin: 0; transform: rotate(90deg); }
}

/* ---------- 8단계 ---------- */
.step-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; scroll-margin-top: 90px; }
.step-tab {
  display: flex; align-items: center; gap: 10px; text-align: left;
  font: inherit; font-weight: 700; font-size: 0.95rem; line-height: 1.35; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.step-tab:hover { transform: translate(-1px, -1px); box-shadow: 0 0 0 transparent; }
.step-tab .num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--butter); border: 1px solid var(--line); font-weight: 800; }
.step-tab.is-active { background: var(--surface-2); color: var(--ink); border-color: var(--coral); }
.step-tab.is-active .num { background: var(--coral); color: var(--on-accent); }
.no-js .step-tabs { display: none; }

.step-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 0 0 transparent; padding: 30px; }
.js .step-panel:not(.is-active) { display: none; }
.no-js .step-panel + .step-panel { margin-top: 24px; }
.panel-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.panel-icon { width: 64px; height: 64px; border-radius: 18px; border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.panel-icon .icon { width: 34px; height: 34px; }
.panel-step { margin: 0; font-weight: 800; color: var(--coral-ink); font-size: 0.9rem; }
.panel-head h3 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
.panel-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.easy { font-size: 1.08rem; }
.easy-tag { display: inline-block; background: var(--butter); border: 1px solid var(--line); border-radius: 8px; font-size: 0.82rem; font-weight: 800; padding: 0 8px; margin-right: 8px; line-height: 1.7; vertical-align: 1px; }
.dot-list { padding-left: 1.2em; margin: 0 0 1em; }
.dot-list li { margin-bottom: 0.35em; }
.dot-list li::marker { color: var(--coral); }
.java-box { background: var(--mint-soft); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin-bottom: 16px; }
.java-box p:last-child { margin-bottom: 0; }
.box-title { font-weight: 800; color: var(--navy); font-size: 0.95rem; margin-bottom: 8px; }
.source-quote { margin: 0; background: var(--paper-2); border-left: 5px solid var(--lilac); border-radius: 0 16px 16px 0; padding: 16px 18px; font-size: 0.95rem; color: var(--text-soft); }
.source-quote p:last-child { margin-bottom: 0; }
.step-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.step-count { font-weight: 800; color: var(--navy); font-family: var(--mono); }
.no-js .step-nav { display: none; }

@media (max-width: 960px) {
  .step-tabs { display: flex; overflow-x: auto; padding: 4px 4px 10px; margin-inline: -4px; scroll-snap-type: x mandatory; }
  .step-tab { flex: none; width: 210px; scroll-snap-align: start; }
  .panel-body { grid-template-columns: 1fr; }
  .step-panel { padding: 22px; }
}
@media (max-width: 520px) {
  .step-panel { padding: 18px; }
  .panel-head { gap: 12px; }
  .panel-icon { width: 52px; height: 52px; border-radius: 14px; }
  .panel-icon .icon { width: 28px; height: 28px; }
}

/* ---------- 작은 실습 도구 ---------- */
.widget { border: 1px dashed rgba(238, 234, 224, 0.36); border-radius: 18px; padding: 18px; margin: 18px 0; background: var(--paper); }
.widget-title { font-weight: 800; color: var(--navy); margin-bottom: 12px; }
.widget-title span { font-weight: 600; color: var(--muted); font-size: 0.9rem; }

.wake-options { display: grid; gap: 8px; }
.wake-option {
  text-align: left; font-family: var(--mono); font-size: 0.86rem; line-height: 1.5; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.wake-option:hover { transform: translateX(2px); }
.wake-option[aria-pressed="true"] { background: var(--ink); color:var(--ground); }
.wake-result { margin-top: 14px; min-height: 64px; }
.wake-placeholder { color: var(--muted); font-size: 0.95rem; margin: 0; }
.verdict { display: inline-flex; align-items: center; font-weight: 800; border-radius: 999px; padding: 2px 14px; border: 1px solid var(--line); margin: 0 0 8px; }
.verdict.is-yes { background: var(--green-soft); color: var(--green); }
.verdict.is-no { background: var(--grey-soft); color: var(--muted); }
.wake-reason { margin-bottom: 8px; }

.ctx-card { background: var(--surface); border-style: solid; }
.ctx-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ctx-top .widget-title { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg-btn { font: inherit; font-size: 0.86rem; font-weight: 700; padding: 6px 14px; border: 0; background: transparent; cursor: pointer; color: var(--ink); }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn[aria-pressed="true"] { background: var(--ink); color:var(--ground); }
.ctx-lines { list-style: none; counter-reset: ctx; margin: 0; padding: 0; display: grid; gap: 6px; }
.ctx-line { counter-increment: ctx; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--paper); border: 1px solid rgba(238, 234, 224, 0.108); transition: opacity 0.25s ease; }
.ctx-line::before { content: counter(ctx); grid-column: 1; grid-row: 1 / span 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color:var(--ground); font-weight: 800; font-size: 0.78rem; margin-top: 2px; }
.ctx-label, .ctx-value { grid-column: 2; }
.ctx-label { font-weight: 800; font-size: 0.86rem; color: var(--navy); }
.ctx-value { font-size: 0.95rem; }
.ctx-card[data-mode="small"] .v-big, .ctx-card[data-mode="big"] .v-small { display: none; }
.ctx-card[data-mode="small"] .is-extra { color: var(--muted); background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(238, 234, 224, 0.035) 8px 16px); }
.ctx-card[data-mode="small"] .is-extra .ctx-label { color: var(--muted); }
.ctx-card[data-mode="small"] .is-extra::before { background: var(--grey-soft); color: var(--muted); }
.ctx-value.is-empty { color: var(--muted); font-style: italic; }
.ctx-count { margin: 12px 0 0; font-weight: 700; color: var(--navy); font-size: 0.95rem; }
.no-js .ctx-card .v-small.is-empty { display: none; }
.no-js .ctx-card[data-mode="small"] .v-big { display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { font: inherit; font-size: 0.9rem; font-weight: 700; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: background-color 0.15s ease; }
.chip:hover { background: var(--butter); }
.chip[aria-pressed="true"] { background: var(--coral); border-color: var(--coral); color: var(--on-accent); }
.chip[aria-pressed="true"]::before { content: "✓ "; }
.books { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.book { position: relative; border: 1px solid rgba(238, 234, 224, 0.198); border-radius: 10px 16px 16px 10px; padding: 10px 12px 10px 22px; background: var(--surface-2); color: var(--muted); transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.book::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; border-radius: 8px 0 0 8px; background: var(--grey); transition: background-color 0.25s ease; }
.book b { display: block; font-size: 0.98rem; }
.book small { display: block; font-size: 0.8rem; line-height: 1.45; }
.book.is-open { background: var(--surface); color: var(--ink); border-color: rgba(242, 166, 90, 0.5); box-shadow: var(--shadow-sm); transform: translateY(-3px); }
.book.is-open b { color: var(--navy); }
.book.is-open::before { background: var(--coral); }
.book[data-book="evidence"].is-open::before { background: var(--lilac); }
.classifier-out { margin: 14px 0 0; font-weight: 700; color: var(--navy); }
@media (max-width: 600px) { .books { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.contract-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.contract-list li { display: flex; gap: 8px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 0.93rem; font-weight: 600; line-height: 1.5; }
.contract-list li::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 5px; border: 1px solid var(--line);
  background: var(--green) no-repeat center / 11px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2 6.5 2.5 2.5L10 3' fill='none' stroke='%23101217' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.authority { border: 1px solid var(--line); border-radius: 18px; background: var(--coral-soft); padding: 18px; margin: 18px 0; }
.authority-title { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--coral-ink); margin-bottom: 8px; }
.authority .code { margin-bottom: 6px; }
.authority p:last-child { margin-bottom: 0; }

.rule-mini { counter-reset: rm; list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.rule-mini li { counter-increment: rm; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; background: var(--paper); border: 1px solid rgba(238, 234, 224, 0.135); border-radius: 12px; padding: 9px 12px; font-size: 0.95rem; line-height: 1.55; }
.rule-mini li::before { content: counter(rm); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--coral); color: var(--on-accent); border: 1px solid var(--line); font-weight: 800; font-size: 0.85rem; }
.rule-mini b { display: block; color: var(--navy); }

.sweep-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sweep-top .widget-title { margin: 0; }
.windows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.window {
  --glass: var(--sky);
  font: inherit; text-align: left; color: var(--ink);
  display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-content: start; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}
.window:hover { transform: translate(-1px, -1px); box-shadow: 0 0 0 transparent; }
.window-pane {
  grid-column: 1; grid-row: 1 / span 3; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 8px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 3px 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 100% 3px no-repeat,
    var(--glass);
  transition: background-color 0.3s ease;
}
.window-name, .window-hint, .window-badge, .window-desc { grid-column: 2; }
.window-name { font-weight: 800; color: var(--navy); line-height: 1.4; }
.window-hint { font-size: 0.85rem; color: var(--muted); }
.window-badge { justify-self: start; font-size: 0.8rem; font-weight: 800; border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; }
.window-desc { font-size: 0.9rem; color: var(--text-soft); line-height: 1.6; }
.js .window:not(.is-open) .window-badge, .js .window:not(.is-open) .window-desc { display: none; }
.window.is-open .window-hint, .no-js .window-hint { display: none; }
.window[data-verdict="fix"] .window-badge { background: var(--coral); color: var(--on-accent); }
.window[data-verdict="pin"] .window-badge { background: var(--lilac); color: var(--on-accent); }
.window[data-verdict="out"] .window-badge { background: var(--amber); color: var(--on-accent); }
.window[data-verdict="unknown"] .window-badge { background: var(--surface); }
.window.is-open[data-verdict="fix"] { background: var(--red-soft); --glass: var(--red); }
.window.is-open[data-verdict="pin"] { background: var(--lilac-soft); --glass: var(--lilac); }
.window.is-open[data-verdict="out"] { background: var(--amber-soft); --glass: var(--amber); }
.window.is-open[data-verdict="unknown"] { background: var(--grey-soft); --glass: var(--muted); }
@media (max-width: 640px) { .windows { grid-template-columns: 1fr; } }

.failclosed-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.failclosed-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.fc-if { padding: 10px 14px; background: var(--amber-soft); font-weight: 700; font-size: 0.94rem; line-height: 1.55; }
.fc-then { padding: 10px 14px; font-size: 0.94rem; line-height: 1.55; border-left: 1px solid var(--line); }
.analogy { background: var(--butter); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-size: 0.97rem; }
@media (max-width: 640px) {
  .failclosed-list li { grid-template-columns: 1fr; }
  .fc-then { border-left: 0; border-top: 1px solid var(--line); }
}

.receipt-mini { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px 22px 18px; margin: 18px 0; box-shadow: var(--shadow); font-size: 0.94rem; }
.receipt-mini::before, .receipt-mini::after { content: ""; position: absolute; left: 14px; right: 14px; height: 8px; background: radial-gradient(circle, var(--paper-2) 3.2px, transparent 3.8px) 0 0 / 14px 8px repeat-x; }
.receipt-mini::before { top: 6px; }
.receipt-mini::after { bottom: 6px; }
.receipt-title { font-family: var(--mono); font-weight: 800; text-align: center; letter-spacing: 0.08em; margin: 6px 0 2px; color: var(--navy); }
.receipt-sub { text-align: center; color: var(--muted); font-size: 0.85rem; border-bottom: 1px dashed rgba(238, 234, 224, 0.27); padding-bottom: 12px; }
.receipt-must { font-weight: 800; color: var(--coral-ink); margin: 12px 0 4px; }
.receipt-fields { margin: 0; }
.receipt-fields dt { margin-top: 10px; }
.receipt-fields dd { margin: 4px 0 0; color: var(--text-soft); font-size: 0.92rem; }
.receipt-end { border-top: 1px dashed rgba(238, 234, 224, 0.27); padding-top: 12px; margin: 14px 0 6px; font-size: 0.85rem; }

/* ---------- 코드 ---------- */
.code {
  margin: 12px 0; background: var(--term-bg); color: var(--term-ink);
  border-radius: 14px; border: 1px solid var(--line); padding: 14px 16px;
  overflow-x: auto; font-family: var(--mono); font-size: 0.83rem; line-height: 1.65; tab-size: 4;
}
.code code { background: none; padding: 0; color: inherit; font-size: inherit; border-radius: 0; white-space: pre; word-break: normal; overflow-wrap: normal; display: block; }
.habit .code code, .agent-story .code code, .rule-back .code code { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 560px) { .code code { white-space: pre-wrap; overflow-wrap: anywhere; } }
.tk-kw { color: var(--coral); }
.tk-str { color: #b5e3a1; }
.tk-com { color: var(--muted); font-style: italic; }
.tk-ann { color: var(--lilac); }
.tk-num { color: var(--amber); }
.tk-type { color: var(--sky); }
.df { display: block; padding: 0 8px; margin: 0 -8px; border-radius: 4px; min-height: 1.65em; }
.df-add { background: rgba(61, 220, 132, 0.16); }
.df-del { background: rgba(255, 90, 67, 0.2); }
.df-mark { display: inline-block; width: 1.3em; color: var(--muted); -webkit-user-select: none; user-select: none; }
.df-add .df-mark { color: var(--green); }
.df-del .df-mark { color: var(--red); }
.tl-cmd { color: var(--ink); }
.tl-prompt { color: var(--green); font-weight: 700; }
.tl-note { color: var(--muted); }
.tl-bad { color: var(--red); }
.tl-good { color: var(--green); }
.tl-brand { color: var(--amber); font-weight: 700; }

/* ---------- 직접 보기 ---------- */
.bug-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 20px 22px; margin-bottom: 26px; }
.bug-badge { background: var(--coral); color: var(--on-accent); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; font-weight: 800; white-space: nowrap; }
.bug-card h3 { margin: 0 0 6px; font-size: 1.25rem; }
.bug-card p { margin: 0; color: var(--text-soft); }

.sim { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.sim-index { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; position: sticky; top: 90px; }
.sim-index button {
  width: 100%; display: flex; gap: 10px; align-items: center; text-align: left;
  font: inherit; font-size: 0.93rem; font-weight: 600; line-height: 1.35; color: var(--ink);
  background: rgba(255, 255, 255, 0.07); border: 2px solid transparent; border-radius: 12px;
  padding: 7px 10px; cursor: pointer; transition: background-color 0.15s ease;
}
.sim-index button:hover { background: rgba(255, 255, 255, 0.14); }
.sim-index button span { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); font-weight: 800; font-size: 0.8rem; }
.sim-index button.is-done span { background: var(--green); color: var(--on-accent); }
.sim-index button.is-active { background: var(--surface-2); color: var(--ink); border-color: var(--coral); font-weight: 800; }
.sim-index button.is-active span { background: var(--coral); color: var(--on-accent); }
.no-js .sim-index { display: none; }

.sim-stage { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 22px 24px; min-width: 0; }
.sim-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sim-counter { margin: 0; font-weight: 800; color: var(--navy); font-family: var(--mono); }
.lamp { display: flex; gap: 6px; padding: 6px 9px; background: var(--term-bg); border: 1px solid var(--line); border-radius: 999px; }
.lamp-light { width: 14px; height: 14px; border-radius: 50%; background: #262a40; transition: background-color 0.3s ease, box-shadow 0.3s ease; }
.lamp[data-state="red"] .red { background: #ff6b57; box-shadow: 0 0 10px #ff6b57; }
.lamp[data-state="amber"] .amber { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.lamp[data-state="green"] .green { background: var(--green); box-shadow: 0 0 10px var(--green); }
.lamp[data-state="check"] .red { animation: lamp-red 2.6s ease-in-out infinite; }
.lamp[data-state="check"] .green { animation: lamp-green 2.6s ease-in-out infinite; }
@keyframes lamp-red { 0%, 45% { background: #ff6b57; box-shadow: 0 0 10px #ff6b57; } 55%, 100% { background: #262a40; box-shadow: none; } }
@keyframes lamp-green { 0%, 45% { background: #262a40; box-shadow: none; } 55%, 100% { background: var(--green); box-shadow: 0 0 10px var(--green); } }
.lamp-text { margin: 0; font-weight: 700; font-size: 0.92rem; color: var(--text-soft); }
.sim-bar { height: 6px; background: var(--grey-soft); border-radius: 6px; margin: 14px 0 18px; overflow: hidden; }
.sim-bar span { display: block; height: 100%; background: var(--coral); transform-origin: left center; transform: scaleX(0.09); transition: transform 0.35s ease; }
.sim-frames { min-height: 440px; }
.js .sim-frame:not(.is-active) { display: none; }
.sim-frame.is-active { animation: frame-in 0.35s ease; }
@keyframes frame-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.no-js .sim-frame + .sim-frame { margin-top: 28px; padding-top: 28px; border-top: 1px dashed rgba(238, 234, 224, 0.18); }
.sim-frame h3 { font-size: 1.4rem; margin-bottom: 6px; }
.sim-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag { display: inline-block; font-size: 0.78rem; font-weight: 800; border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; background: var(--butter); line-height: 1.7; white-space: nowrap; }
.tag-navy { background: var(--ink); color:var(--ground); }
.tag-green { background: var(--green-soft); }
.tag-grey { background: var(--grey-soft); color: var(--muted); }
.tag-lilac { background: var(--lilac); color: var(--on-accent); }
.tag-coral { background: var(--coral); color: var(--on-accent); }
.sim-narration { font-size: 1.04rem; }
.sim-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed rgba(238, 234, 224, 0.162); }
.sim-controls [data-sim-next] { margin-left: auto; }
.no-js .sim-controls, .no-js .sim-bar, .no-js .sim-head { display: none; }
.demo-note { margin: 18px 0 0; font-size: 0.9rem; color: var(--text-soft); }

.chat { display: grid; gap: 10px; }
.bubble { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin: 0; max-width: 94%; min-width: 0; }
.bubble .who { display: inline-block; font-size: 0.76rem; font-weight: 800; border-radius: 999px; padding: 0 8px; margin-right: 8px; background: var(--ink); color:var(--ground); line-height: 1.7; }
.bubble-me { background: var(--butter); justify-self: end; border-bottom-right-radius: 4px; }
.bubble-ai { background: var(--mint-soft); justify-self: start; border-bottom-left-radius: 4px; width: 94%; }
.bubble-ai .code { margin: 8px 0 0; }

.ctx-mini { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.ctx-mini dt { font-weight: 800; color: var(--navy); font-size: 0.9rem; }
.ctx-mini dd { margin: 0; font-size: 0.95rem; }
.route-books { display: grid; gap: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.route-books p { margin: 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; margin-top: 12px; }
.route-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
.route-table th, .route-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid rgba(238, 234, 224, 0.108); vertical-align: top; line-height: 1.55; }
.route-table th { background: var(--surface-2); color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--line-strong); }
.route-table tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; font-size: 0.76rem; font-weight: 800; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; margin-right: 6px; white-space: nowrap; line-height: 1.7; }
.b-fix { background: var(--coral); color: var(--on-accent); }
.b-pin { background: var(--lilac); color: var(--on-accent); }
.b-out { background: var(--amber); color: var(--on-accent); }
.b-unk { background: var(--surface); }
.b-wait { background: var(--surface); }
.dod-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.dod-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(238, 234, 224, 0.135); background: var(--paper); font-size: 0.94rem; line-height: 1.55; }
.st { flex: none; font-size: 0.74rem; font-weight: 800; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; margin-top: 1px; line-height: 1.7; white-space: nowrap; }
.st-done { background: var(--green-soft); }
.st-na { background: var(--grey-soft); }
.st-later { background: var(--amber-soft); }

@media (max-width: 960px) {
  .sim { grid-template-columns: 1fr; }
  .sim-index { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 6px; }
  .sim-index li { flex: none; }
  .sim-index button { white-space: nowrap; }
  .sim-frames { min-height: 0; }
}
@media (max-width: 560px) {
  .sim-stage { padding: 18px 16px; }
  .bug-card { grid-template-columns: 1fr; gap: 10px; }
  .bug-badge { justify-self: start; }
  .sim-controls [data-sim-next] { margin-left: 0; }
  .sim-controls .btn { flex: 1 1 40%; }
  .ctx-mini { grid-template-columns: 1fr; gap: 2px; }
  .ctx-mini dd { margin-bottom: 8px; }
}

/* ---------- 규칙 카드 ---------- */
.rules-actions { display: flex; justify-content: flex-end; margin: -12px 0 18px; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.rule-card { position: relative; perspective: 1600px; cursor: pointer; }
.rule-inner { display: grid; height: 100%; transform-style: preserve-3d; transition: transform 0.65s cubic-bezier(0.2, 0.75, 0.25, 1); }
.rule-face {
  grid-area: 1 / 1; display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px 24px 78px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.rule-front { background: var(--surface); }
.rule-back { background: var(--surface-2); color: var(--ink); border-color: rgba(242, 166, 90, 0.4); transform: rotateY(180deg); }
.rule-card.is-flipped .rule-inner { transform: rotateY(180deg); }
.rule-num { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-weight: 900; font-size: 1.6rem; border: 1px solid var(--line); margin-bottom: 16px; background: var(--tone, var(--amber-soft)); color: var(--tone-fg, var(--amber)); }
.rule-front h3 { font-size: 1.35rem; }
.rule-analogy { color: var(--text-soft); font-size: 1.04rem; margin: 0; }
.rule-hint { margin: auto 0 0; padding-top: 18px; font-size: 0.92rem; font-weight: 700; color: var(--navy); line-height: 1.6; }
.rule-hint span { display: inline-block; background: var(--tone, var(--amber-soft)); border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; margin-right: 8px; font-size: 0.76rem; font-weight: 800; color: var(--tone-fg, var(--amber)); line-height: 1.7; vertical-align: 1px; }
.rule-back-title { font-weight: 800; color: var(--coral); margin-bottom: 10px; }
.rule-back p { font-size: 0.95rem; }
.rule-back code { background: rgba(238, 234, 224, 0.08); color: var(--ink); }
.rule-back .code { background: var(--term-bg); margin-top: 0; }
.rule-back .code code { background: none; }
.rule-java { background: var(--grey-soft); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; margin: 0; }
.rule-java b { display: block; color: var(--green); font-size: 0.85rem; margin-bottom: 2px; }
.rule-flip {
  position: absolute; left: 24px; bottom: 22px; z-index: 3;
  font: inherit; font-size: 0.9rem; font-weight: 800; color: var(--ink);
  padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--butter); cursor: pointer; box-shadow: var(--shadow-sm);
}
.rule-card.is-flipped .rule-flip { background: var(--surface); }
.no-js .rule-inner { transform: none !important; }
.no-js .rule-face { grid-area: auto; -webkit-backface-visibility: visible; backface-visibility: visible; padding-bottom: 24px; }
.no-js .rule-back { transform: none; margin-top: 12px; }
.no-js .rule-flip, .no-js .rules-actions { display: none; }
@media (max-width: 760px) { .rules-grid { grid-template-columns: 1fr; } }

/* ---------- 퀴즈 ---------- */
.quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.quiz-score { font-weight: 800; font-size: 1.1rem; color: var(--navy); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 18px; box-shadow: var(--shadow-sm); margin: 0; }
.quiz-list { list-style: none; counter-reset: q; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.quiz-item { counter-increment: q; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; }
.quiz-q { font-weight: 700; font-size: 1.02rem; flex: 1; }
.quiz-q::before { content: "Q" counter(q); display: inline-block; font-weight: 900; color:var(--ground); background: var(--ink); border-radius: 8px; padding: 0 8px; margin-right: 8px; font-size: 0.82rem; vertical-align: 2px; line-height: 1.7; }
.quiz-actions { display: flex; gap: 10px; }
.choice {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; font-size: 0.95rem; line-height: 1.35; color: var(--ink);
  padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.choice:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 0 0 0 transparent; }
.choice .icon { width: 18px; height: 18px; }
.choice-go { background: var(--green-soft); }
.choice-stop { background: var(--red-soft); }
.choice:disabled { cursor: default; opacity: 1; color: var(--muted); box-shadow: none; }
.choice:disabled:not(.is-chosen) { background: var(--grey-soft); }
.choice.is-chosen { color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.quiz-feedback { margin-top: 14px; border-radius: 14px; padding: 12px 14px; background: var(--paper); border: 1px solid rgba(238, 234, 224, 0.135); }
.js .quiz-item:not(.is-answered) .quiz-feedback { display: none; }
.quiz-item.is-right .quiz-feedback { background: var(--green-soft); border-color: var(--green); }
.quiz-item.is-wrong .quiz-feedback { background: var(--coral-soft); border-color: var(--coral-ink); }
.quiz-verdict { font-weight: 800; margin-bottom: 4px; }
.quiz-verdict:empty { display: none; }
.quiz-why { margin: 0; font-size: 0.95rem; }
.quiz-done { margin: 20px 0 0; font-weight: 800; font-size: 1.08rem; background: var(--butter); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow-sm); }
.no-js .quiz-actions, .no-js .quiz-head { display: none; }
@media (max-width: 760px) { .quiz-list { grid-template-columns: 1fr; } }

/* ---------- 안전 습관 ---------- */
.habits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.habit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.habit .card-icon { width: 50px; height: 50px; margin-bottom: 12px; }
.habit .card-icon .icon { width: 28px; height: 28px; }
.habit h3 { font-size: 1.12rem; }
.habit p { font-size: 0.96rem; }
.habit p:last-child { margin-bottom: 0; }
.habit .code { font-size: 0.74rem; }
@media (max-width: 1000px) { .habits { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .habits { grid-template-columns: 1fr; } }

.agents { margin-top: 56px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.agent-story { background: var(--lilac-soft); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; min-width: 0; }
.agent-story h3 { font-size: 1.45rem; }
.agent-story p:last-child { margin-bottom: 0; }
.agent-rules { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.agent-rules li { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-sm); font-size: 0.94rem; line-height: 1.6; }
.agent-rules b { display: flex; align-items: center; gap: 8px; color: var(--navy); margin-bottom: 4px; font-size: 1rem; }
.agent-rules b .icon { width: 22px; height: 22px; color: var(--coral-ink); }
@media (max-width: 960px) { .agents { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .agent-rules { grid-template-columns: 1fr; } }

/* ---------- 효과 ---------- */
.effect-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 26px; align-items: start; }
.how-measured { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.chart { margin-top: 22px; }
.chart-title { font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.bar-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) 92px; gap: 12px; align-items: center; margin-bottom: 10px; }
.bar-label { font-weight: 700; font-size: 0.9rem; }
.bar-track { position: relative; height: 30px; background: var(--grey-soft); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--fill, var(--ink)); transform-origin: left center; transform: scaleX(0); transition: transform 1.1s cubic-bezier(0.2, 0.75, 0.25, 1); }
.chart.is-visible .bar-fill { transform: scaleX(1); }
.bar-range { position: absolute; top: 3px; bottom: 3px; left: var(--from); width: calc(var(--to) - var(--from)); border: 1px dashed var(--line-strong); border-radius: 6px; background: rgba(255, 255, 255, 0.35); opacity: 0; transition: opacity 0.5s ease 0.9s; }
.chart.is-visible .bar-range { opacity: 1; }
.bar-value { font-weight: 800; font-size: 0.9rem; }
.no-js .bar-fill { transform: none; }
.no-js .bar-range { opacity: 1; }
.effect-facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.effect-facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.fact-tag { font-size: 0.76rem; font-weight: 800; border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; white-space: nowrap; margin-top: 3px; line-height: 1.7; }
.fact-good .fact-tag { background: var(--green-soft); color: var(--green); }
.fact-cost .fact-tag { background: var(--amber-soft); color: var(--amber); }
.fact-same .fact-tag { background: var(--grey-soft); color: var(--text-soft); }
.fact-unmeasured .fact-tag { background: var(--lilac-soft); color: var(--lilac); }
.kid-summary { margin: 18px 0 0; background: var(--butter); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; font-weight: 700; box-shadow: var(--shadow-sm); }
@media (max-width: 960px) { .effect-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .bar-row { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- 시작하기 ---------- */
.start-steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 22px; }
.start-step { counter-increment: s; display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.start-step::before { content: counter(s); width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--coral); color: var(--on-accent); border: 1px solid var(--line); font-weight: 900; font-size: 1.4rem; }
.start-step > div { min-width: 0; }
.start-step h3 { font-size: 1.3rem; }
.start-step p:last-child { margin-bottom: 0; }
.tab-list { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 4px; }
.tab { font: inherit; font-weight: 700; font-size: 0.92rem; padding: 6px 18px; border: 0; background: var(--surface); color: var(--ink); cursor: pointer; }
.tab + .tab { border-left: 1px solid var(--line); }
.tab[aria-selected="true"] { background: var(--ink); color:var(--ground); }
.js .tab-panel:not(.is-active) { display: none; }
.no-js .tab-list { display: none; }
.cmd { position: relative; }
.cmd .code { padding-right: 104px; }
.copy-btn {
  position: absolute; top: 9px; right: 9px; display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 0.8rem; font-weight: 800; padding: 4px 10px; border-radius: 10px;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer;
}
.copy-btn .icon { width: 15px; height: 15px; stroke-width: 3.5; }
.no-js .copy-btn { display: none; }
.prompt-list { display: grid; gap: 12px; }
.prompt-name { font-weight: 800; font-size: 0.9rem; color: var(--navy); margin: 0 0 -6px; }
.prompt .code code { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.prompt .code { font-family: var(--font); font-size: 0.95rem; line-height: 1.6; }
.tips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.tip { background: var(--mint-soft); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 0.94rem; margin: 0; }
@media (max-width: 700px) {
  .start-step { grid-template-columns: 1fr; padding: 20px; }
  .start-step::before { width: 44px; height: 44px; font-size: 1.2rem; }
  .tips { grid-template-columns: 1fr; }
  .cmd .code { padding-right: 16px; padding-top: 46px; }
}

/* ---------- 한 장 요약 ---------- */
.cheat { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 0 0 transparent; padding: 30px; }
.cheat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cheat-head h2 { margin: 0; }
.cheat-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cheat-grid a { display: block; height: 100%; text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.cheat-grid a:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-sm); }
.cheat-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color:var(--ground); font-weight: 800; font-size: 0.85rem; margin-bottom: 8px; }
.cheat-grid b { display: block; color: var(--navy); margin-bottom: 4px; line-height: 1.4; }
.cheat-desc { display: block; font-size: 0.88rem; color: var(--text-soft); line-height: 1.6; }
@media (max-width: 1000px) { .cheat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .cheat-grid { grid-template-columns: 1fr; } .cheat { padding: 20px; } }

/* ---------- 증거 ---------- */
.ev-analogy { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; max-width: 880px; }
.ev-analogy .card-icon { margin: 0; }
.ev-analogy p { margin: 0; font-size: 1.05rem; }
.ev-title { display: flex; align-items: center; gap: 12px; font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin: 52px 0 18px; }
.ev-title > span { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--coral); border: 1px solid var(--line); font-size: 1rem; color: var(--on-accent); }
.ev-lead { margin: -6px 0 16px; color: var(--text-soft); }
.pipe, .guard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 0 0 transparent; padding: 22px; }
.pipe-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.pipe-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  font: inherit; font-size: 0.85rem; font-weight: 700; line-height: 1.3; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.pipe-tab:hover { transform: translateY(-2px); }
.pipe-tab > span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-weight: 800; }
.pipe-tab:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -14px; width: 14px; height: 1px; background: var(--line-strong); }
.pipe-tab.is-active { background: var(--surface-2); color: var(--ink); border-color: var(--coral); }
.pipe-tab.is-active > span { background: var(--coral); color: var(--on-accent); }
.js .pipe-panel:not(.is-active) { display: none; }
.pipe-panel { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 26px; align-items: start; }
.pipe-panel.is-active { animation: frame-in 0.3s ease; }
.pipe-copy h4 { font-size: 1.3rem; color: var(--navy); margin: 0 0 10px; line-height: 1.35; }
.pipe-copy p:last-child { margin-bottom: 0; }
.pipe-proof { min-width: 0; }
.pipe-proof .code { margin-top: 0; }
.proof-label { font-size: 0.82rem; font-weight: 800; color: var(--coral-ink); margin: 0 0 6px; }
.pipe-steps { padding-left: 1.4em; margin: 0 0 1em; }
.pipe-steps li { margin-bottom: 0.3em; }
.pipe-steps li::marker { color: var(--coral-ink); font-weight: 800; }
.pipe-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed rgba(238, 234, 224, 0.162); }
.pipe-count { font-family: var(--mono); font-weight: 800; color: var(--navy); }
.no-js .pipe-tabs, .no-js .pipe-nav, .no-js .guard-tabs { display: none; }
.no-js .pipe-panel + .pipe-panel, .no-js .guard-panel + .guard-panel { margin-top: 20px; padding-top: 20px; border-top: 1px dashed rgba(238, 234, 224, 0.18); }

.shape-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.shape-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.shape-card .code { margin-top: 0; }
.shape-card .dot-list { margin-bottom: 0; }
.shape-wide { margin-top: 20px; }
.tree code { white-space: pre; }
.tree-note { color: var(--muted); }
.tree-hot { color: var(--amber); font-weight: 700; }
.shape-legend { list-style: none; counter-reset: lg; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.shape-legend li { counter-increment: lg; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 0.93rem; line-height: 1.6; }
.shape-legend li::before { content: counter(lg); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.78rem; border: 1px solid var(--line); background: var(--c, var(--amber-soft)); color: var(--cf, var(--amber)); margin-top: 1px; }
.shape-legend b { color: var(--navy); margin-right: 6px; }
.record-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.record-grid > div { min-width: 0; }
.field-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 12px 0 0; font-size: 0.93rem; }
.field-list dd { margin: 0; }

.guard-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.guard-tab { font: inherit; font-size: 0.9rem; font-weight: 700; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; transition: background-color 0.15s ease; }
.guard-tab:hover { background: var(--butter); }
.guard-tab.is-active { background: var(--ink); color:var(--ground); }
.js .guard-panel:not(.is-active) { display: none; }
.guard-panel.is-active { animation: frame-in 0.3s ease; }
.guard-panel .code { margin-top: 0; }
.guard-why { display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.st-refuse { background: var(--red-soft); }
.st-ok { background: var(--green-soft); }
.guard-more { margin: 18px 0 0; font-size: 0.93rem; color: var(--text-soft); background: rgba(238, 234, 224, 0.035); border: 1px dashed rgba(238, 234, 224, 0.27); border-radius: 14px; padding: 12px 16px; }
.guard-more b { color: var(--navy); margin-right: 8px; }
.ev-repo { margin-top: 22px; background: var(--mint-soft); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.ev-repo p:last-child { margin-bottom: 0; }
.ev-note { margin: 16px 0 0; font-size: 0.88rem; color: var(--muted); }

.receipt-stamp { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; font-size: 0.85rem; }
.receipt-stamp span { font-weight: 800; color: var(--navy); }
.receipt-caption { margin: 0 0 6px; font-weight: 700; color: var(--navy); font-size: 0.93rem; }

.md-stamp { color: var(--amber); font-weight: 700; }
.md-h { color: var(--coral); font-weight: 700; }
.md-field { color: var(--sky); font-weight: 700; }
.md-pipe { color: #80859d; }
.md-dash { color: var(--coral); }
.md-skip { color: var(--muted); font-style: italic; }
.jn-key { color: var(--sky); }
.jn-str { color: #b5e3a1; }
.jn-num { color: var(--amber); }
.jn-lit { color: var(--coral); }

@media (max-width: 1000px) {
  .pipe-tabs { display: flex; overflow-x: auto; padding: 2px 2px 8px; gap: 8px; }
  .pipe-tab { flex: none; width: 118px; }
  .pipe-tab::after { display: none; }
  .pipe-panel, .shape-grid, .record-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pipe, .guard { padding: 16px; }
  .ev-analogy { align-items: flex-start; }
  .field-list { grid-template-columns: 1fr; gap: 2px; }
  .field-list dd { margin-bottom: 8px; }
  .tree code { white-space: pre; }
}

/* ---------- 바닥글 ---------- */
.site-footer { padding: 40px 0 56px; color: var(--muted); font-size: 0.9rem; }
.site-footer p { max-width: 62em; }

/* ---------- 움직임 줄이기 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .lamp[data-state="check"] .red { animation: none; background: #262a40; box-shadow: none; }
  .lamp[data-state="check"] .green { animation: none; background: var(--green); box-shadow: 0 0 10px var(--green); }
}

/* ---------- 인쇄 ---------- */
@media print {
  :root { --ground: #fff; --surface: #fff; --surface-2: #f6f4ef; --paper: #fff; --ink: #101217; --navy: #101217; --muted: #59616d; --text-soft: #353c4a; --line: #d5d9df; --line-strong: #b9bec7; --coral: #a8461f; --coral-ink: #a8461f; --amber: #8a6200; --green: #1f7f5c; --red: #b23b2a; --lilac: #5b54b8; --sky: #1f5fa8; --on-accent: #fff; --term-bg: #f6f4ef; --term-ink: #101217; color-scheme: light; }
  body { background: #fff; color: #101217; font-size: 11pt; }
  .site-header, .skip-link, .hero-actions, .step-tabs, .step-nav, .sim-index, .sim-controls, .sim-bar, .sim-head,
  .rules-actions, .rule-flip, .quiz-actions, .quiz-head, .copy-btn, [data-print], .tab-list, .hero-field, .hero-veil, .window-hint { display: none !important; }
  .section, .hero { padding: 20px 0; border: 0; background: var(--surface); }
  .section-navy { color: var(--ink); background: var(--surface); }
  .section-navy h2, .section-navy .section-lead, .section-navy .kicker, .demo-note { color: var(--navy); }
  .js .step-panel:not(.is-active), .js .sim-frame:not(.is-active), .js .tab-panel:not(.is-active) { display: block !important; }
  .step-panel, .card, .rule-face, .quiz-item, .habit, .sim-stage, .cheat, .bug-card, .k-node, .how-measured, .start-step, .agent-story { box-shadow: none !important; break-inside: avoid; }
  .step-panel + .step-panel, .sim-frame + .sim-frame { margin-top: 16px; }
  .sim-frames { min-height: 0; }
  .rule-inner { transform: none !important; }
  .rule-face { grid-area: auto; -webkit-backface-visibility: visible; backface-visibility: visible; padding-bottom: 20px; }
  .rule-back { transform: none; margin-top: 8px; }
  .js .quiz-item:not(.is-answered) .quiz-feedback { display: block; }
  .js .window:not(.is-open) .window-badge, .js .window:not(.is-open) .window-desc { display: block; }
  .bar-fill { transform: none !important; }
  .bar-range { opacity: 1 !important; }
  .code code { white-space: pre-wrap; }
  a { color: inherit; text-decoration: none; }
}


@media print {
  .pipe-tabs, .pipe-nav, .guard-tabs { display: none !important; }
  .js .pipe-panel:not(.is-active) { display: grid !important; }
  .js .guard-panel:not(.is-active) { display: block !important; }
  .pipe-panel + .pipe-panel, .guard-panel + .guard-panel { margin-top: 16px; }
  .pipe, .guard, .shape-card, .ev-analogy { box-shadow: none !important; break-inside: avoid; }
}

/* 증거 장의 출력은 줄을 넘겨서 끝까지 보여 줘요 (폴더 모양은 정렬 유지) */
#evidence .code code { white-space: pre-wrap; overflow-wrap: anywhere; }
#evidence .tree code { white-space: pre; }

/* 긴 줄은 넘겨서 끝까지 보여 줘요 (폴더 모양만 정렬 유지) */
.code code { white-space: pre-wrap; overflow-wrap: anywhere; }
.tree code { white-space: pre; }
@media (max-width: 560px) { .tree { font-size: 0.72rem; } }

/* 영수증이 증명하는 것과 증명하지 못하는 것 */
.ev-limits { margin-top: 22px; background: var(--butter); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.ev-limits > p:last-child { margin-bottom: 0; }
.limits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.limits-col { background: rgba(238, 234, 224, 0.035); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.limits-col .st { display: inline-block; margin-bottom: 6px; }
.limits-col ul { margin: 0; padding-left: 18px; list-style: disc; }
.limits-col li { margin: 6px 0 0; font-size: 0.93rem; line-height: 1.6; }
@media (max-width: 720px) { .limits-grid { grid-template-columns: 1fr; } }

/* ---------- 직접 보기: 실제 스크린샷 ---------- */
.shot { margin: 14px 0 0; }
.shot img { display: block; width: 100%; max-width: 360px; height: auto; border-radius: 12px; border: 1px solid var(--line-strong); background: #f8fafc; }
.shot figcaption { margin-top: 6px; font-size: 0.82rem; color: var(--muted); }
.shot-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.shot-pair .shot { margin: 0; }
@media (max-width: 520px) { .shot-pair { grid-template-columns: 1fr; } }
