:root {
  --ink: #17212b;
  --muted: #66717d;
  --paper: #f5f3ef;
  --card: #ffffff;
  --line: #d9d6cf;
  --navy: #172b4d;
  --red: #c9353b;
  --green: #16724f;
  --amber: #9a6500;
  --shadow: 0 16px 42px rgba(25, 33, 43, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, sans-serif; line-height: 1.55; }
.hero { min-height: 300px; padding: 54px max(6vw, 28px); color: white; background: linear-gradient(120deg, #101c30, #1b365f 68%, #b92c34 68%); display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.eyebrow { margin: 0 0 12px; color: #f0b7ba; font-size: 12px; font-weight: 800; letter-spacing: .2em; }
h1 { margin: 0; font-size: clamp(36px, 6vw, 70px); line-height: .98; letter-spacing: -.045em; }
.hero-copy { max-width: 640px; margin: 20px 0 0; color: #dbe3ee; }
.hero-status { min-width: 180px; padding: 18px; border: 1px solid rgba(255,255,255,.28); background: rgba(8,17,32,.35); backdrop-filter: blur(8px); }
.hero-status span { display: block; font-size: 40px; font-weight: 800; }
.hero-status small { color: #dbe3ee; }
.progress-track { height: 5px; margin-top: 16px; background: rgba(255,255,255,.2); overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: white; transition: width .25s ease; }
.layout { width: min(1320px, calc(100% - 36px)); margin: 36px auto 80px; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; }
.layout.sidebar-collapsed { grid-template-columns: 58px minmax(0, 1fr); }
.side-nav { position: sticky; top: 22px; padding: 0; border-top: 3px solid var(--navy); transition: width .2s ease; }
.sidebar-toggle { width: 100%; min-height: 44px; padding: 8px 6px; display: flex; align-items: center; justify-content: space-between; color: var(--navy); background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; font-size: 13px; font-weight: 900; }
.sidebar-toggle-icon { font-size: 19px; }
.side-progress { padding: 16px 7px; border-bottom: 1px solid var(--line); }
.side-progress > div:first-child { display: flex; flex-direction: column; gap: 1px; }
.side-progress strong { color: var(--navy); font-size: 27px; line-height: 1; }
.side-progress span { color: var(--muted); font-size: 11px; }
.side-progress-track { height: 4px; margin-top: 11px; overflow: hidden; background: #dcd8d1; }
.side-progress-track span { display: block; width: 0; height: 100%; background: var(--red); transition: width .25s ease; }
.side-nav a { display: flex; gap: 9px; padding: 10px 6px; color: var(--muted); text-decoration: none; font-size: 14px; border-bottom: 1px solid var(--line); }
.side-nav a b { color: var(--red); font-size: 11px; letter-spacing: .06em; }
.side-nav a:hover { color: var(--red); }
.side-nav.collapsed .sidebar-toggle-label, .side-nav.collapsed .side-progress, .side-nav.collapsed .side-links a span { display: none; }
.side-nav.collapsed .sidebar-toggle { justify-content: center; }
.side-nav.collapsed .sidebar-toggle-icon { transform: rotate(180deg); }
.side-nav.collapsed .side-links a { justify-content: center; padding-inline: 0; }
.content { min-width: 0; }
.card { margin-bottom: 24px; padding: clamp(22px, 4vw, 42px); background: var(--card); border: 1px solid #e6e2dc; box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 30px; }
.section-heading > span { flex: 0 0 auto; color: var(--red); font-size: 13px; font-weight: 900; letter-spacing: .1em; padding-top: 5px; }
.section-heading h2 { margin: 0; font-size: 27px; letter-spacing: -.03em; }
.section-heading p { margin: 4px 0 0; color: var(--muted); }
.field-grid { display: grid; gap: 20px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: block; color: #29333d; font-size: 14px; font-weight: 700; }
label b { color: var(--red); }
label small { display: block; margin-top: 6px; color: var(--muted); font-weight: 400; }
label > input, label > select, label > textarea { display: block; margin-top: 8px; }
.optional { color: var(--muted); font-size: 11px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 46px; padding: 11px 12px; color: var(--ink); background: #fbfaf8; border: 1px solid #cbc7c0; border-radius: 2px; font: inherit; font-weight: 500; outline: none; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(23,43,77,.1); }
input.invalid, select.invalid, textarea.invalid { border-color: var(--red); background: #fff7f7; }
.wide { margin-top: 18px; }
.notice { margin-bottom: 22px; padding: 16px 18px; background: #f2f6fa; border-left: 4px solid var(--navy); display: flex; flex-direction: column; gap: 3px; }
.notice span { color: var(--muted); font-size: 14px; }
.notice.secure { background: #edf7f2; border-color: var(--green); }
.computed-box { margin-top: 24px; padding: 18px; color: #253b32; background: #edf7f2; border: 1px solid #bddcca; }
.computed-box.warning { color: #5d4208; background: #fff7df; border-color: #e8d08b; }
.scope-card { border-top: 4px solid var(--navy); }
.scope-selector { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.scope-option { position: relative; min-height: 205px; padding: 20px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; color: var(--ink); background: #f7f6f3; border: 2px solid transparent; transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.scope-option:hover { transform: translateY(-2px); border-color: #aeb8c5; }
.scope-option:has(input:checked) { color: white; background: var(--navy); border-color: var(--navy); box-shadow: 0 10px 28px rgba(23,43,77,.18); }
.scope-option input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.scope-option .scope-number { width: fit-content; padding: 4px 8px; color: var(--navy); background: #dfe6ee; font-size: 11px; font-weight: 900; }
.scope-option strong { margin-top: 7px; font-size: 18px; line-height: 1.35; }
.scope-option small { color: var(--muted); font-size: 12px; line-height: 1.55; }
.scope-option:has(input:checked) small { color: #dbe3ee; }
.scope-option:has(input:checked) .scope-number { color: #77242a; background: #f5c8cb; }
.scope-track { height: 6px; margin: 18px 7% 0; background: #d9dfe7; border-radius: 999px; overflow: hidden; }
.scope-track span { display: block; width: 0; height: 100%; background: var(--red); transition: width .25s ease; }
.login-settings { display: none; margin-top: 24px; padding: 20px; background: #edf7f2; border-left: 4px solid var(--green); }
.login-settings.visible { display: block; }
.conditional { display: none; margin-top: 22px; padding: 22px; background: #f7f6f3; border-top: 2px solid var(--navy); }
.conditional.visible { display: block; }
.inline-guide { margin-top: 14px; padding: 12px 14px; color: #42505e; background: #eef3f7; font-size: 13px; }
.evidence-box { margin-top: 20px; padding: 18px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr); gap: 18px; align-items: end; background: #fff; border: 1px solid #d8dfe7; border-left: 4px solid var(--green); }
.evidence-box strong { color: var(--green); }
.evidence-box p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.evidence-box input[type=file] { padding: 8px; background: #fbfaf8; }
hr { margin: 30px 0; border: 0; border-top: 1px solid var(--line); }
.file-manifest { margin-top: 22px; padding: 14px; background: #f7f6f3; color: var(--muted); font-size: 13px; }
.file-manifest ul { margin: 6px 0 0 20px; padding: 0; }
.validation-result { padding: 18px; background: #edf7f2; border: 1px solid #bddcca; }
.validation-result.has-errors { background: #fff1f1; border-color: #e7b2b2; }
.validation-result ul { margin: 8px 0 0 20px; padding: 0; }
details { margin-top: 20px; border: 1px solid var(--line); }
summary { padding: 14px 16px; cursor: pointer; font-weight: 800; }
pre { max-height: 480px; margin: 0; padding: 18px; overflow: auto; background: #111b2b; color: #dce7f5; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.button { min-height: 46px; padding: 11px 18px; border: 0; cursor: pointer; font: inherit; font-weight: 800; }
.button.primary { color: white; background: var(--red); }
.button.package { color: white; background: var(--green); }
.button.secondary { color: var(--navy); background: #e8edf3; }
.button:disabled { cursor: wait; opacity: .65; }
.button:hover { filter: brightness(.96); }
.save-hint { text-align: right; color: var(--muted); font-size: 13px; }
.package-status { margin: 14px 0 0; padding: 12px 14px; color: #315043; background: #edf7f2; font-size: 13px; }
.usage-guide { margin-top: 18px; border-color: #cbd4df; }
.usage-guide > summary { color: var(--navy); background: #eef3f7; }
.usage-guide-body { padding: 20px; }
.usage-guide-body > p { margin-top: 0; color: var(--muted); }
.agent-command-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.agent-command-grid article { min-width: 0; padding: 18px; background: #f7f6f3; border-top: 3px solid var(--navy); }
.agent-command-grid h3 { margin: 0 0 12px; font-size: 18px; }
.agent-command-grid p { margin: 16px 0 8px; color: var(--muted); font-size: 13px; }
.terminal-command { max-height: none; padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; color: #e6edf7; background: #111b2b; border-radius: 3px; line-height: 1.55; }
.terminal-command code { color: inherit; }
.usage-caution { margin-top: 18px; padding: 14px; color: #5d4208; background: #fff7df; border: 1px solid #e8d08b; font-size: 13px; }
code { color: var(--navy); }
footer { padding: 30px; text-align: center; color: var(--muted); font-size: 13px; }
.back-link { display: inline-block; margin: 0 0 14px; color: var(--navy); font-size: 13px; font-weight: 800; text-decoration: none; }
.back-link:hover { color: var(--red); }
.landing-page { min-height: 100vh; }
.landing-hero { min-height: 390px; }
.offline-seal { width: 180px; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; background: rgba(8,17,32,.3); text-align: center; }
.offline-seal strong { font-size: 15px; letter-spacing: .12em; }
.offline-seal span { color: #dbe3ee; font-size: 12px; }
.agent-picker { width: min(1120px, calc(100% - 36px)); margin: 58px auto 80px; }
.picker-heading { margin-bottom: 28px; }
.picker-heading h2 { margin: 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.035em; }
.picker-heading > p:last-child { color: var(--muted); }
.eyebrow.dark { color: var(--red); }
.agent-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.agent-choice { min-height: 350px; padding: 34px; display: grid; grid-template-columns: auto 1fr; gap: 24px; color: var(--ink); background: white; border: 1px solid #e2ded7; border-top: 5px solid var(--navy); box-shadow: var(--shadow); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.agent-choice.portfolio-choice { border-top-color: var(--red); }
.agent-choice:hover { transform: translateY(-5px); box-shadow: 0 22px 48px rgba(25,33,43,.14); }
.choice-number { color: var(--red); font-size: 13px; font-weight: 900; letter-spacing: .1em; }
.agent-choice h3 { margin: 0; font-size: clamp(25px, 3vw, 35px); line-height: 1.15; letter-spacing: -.035em; }
.agent-choice p { margin: 24px 0; color: var(--muted); }
.choice-link { color: var(--navy); }
.landing-notice { margin-top: 24px; }
.portfolio-hero { background: linear-gradient(120deg, #101c30, #1b365f 62%, #8f2730 62%); }
.template-picker { padding: 20px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); gap: 20px; align-items: end; background: #eef3f7; border-left: 4px solid var(--navy); }
.template-picker p { margin: 5px 0 12px; color: var(--muted); font-size: 13px; }
.text-link { color: var(--navy); font-weight: 800; }
.portfolio-scope { margin-top: 24px; }
.portfolio-scope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.subsection { margin-top: 26px; padding: 24px; background: #f7f6f3; border-top: 3px solid var(--navy); }
.subsection h3, .project-box h3, .writing-prompts h3 { margin: 0 0 18px; font-size: 20px; }
.subsection h3 b, .project-box h3 b, .writing-prompts h3 b { color: var(--red); }
.activity-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.activity-item { padding: 18px; background: #f7f6f3; border: 1px solid var(--line); }
.activity-item label + label { margin-top: 14px; }
.stacked-files { display: grid; gap: 12px; }
.project-box, .writing-prompts { margin-top: 28px; padding: 24px; border: 1px solid var(--line); }
.writing-prompts label + label { margin-top: 18px; }
.compact-conditional { padding: 18px; }
.field-conditional { margin-top: 0; padding: 0; background: transparent; border: 0; }
.choice-fieldset { margin: 0; padding: 0; border: 0; }
.choice-fieldset legend { margin-bottom: 9px; color: #29333d; font-size: 14px; font-weight: 800; }
.choice-fieldset legend b { color: var(--red); }
.radio-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.radio-option { padding: 13px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; background: white; border: 1px solid #cbc7c0; }
.radio-option:has(input:checked) { color: white; background: var(--navy); border-color: var(--navy); }
.radio-option input { flex: 0 0 auto; width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--red); }
.radio-option span { line-height: 1.35; }
.optional-section-title { margin: 34px 0 4px; font-size: 21px; }
.section-help { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.resource-guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.resource-guide-grid article, .resource-guide { padding: 18px; background: #eef3f7; border-top: 3px solid var(--navy); }
.resource-guide-grid h4, .resource-guide h4 { margin: 0 0 8px; font-size: 16px; }
.resource-guide-grid p, .resource-guide p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.resource-guide-grid a, .resource-guide a { color: var(--navy); font-size: 13px; font-weight: 900; }
.single-guide { margin-top: 28px; }
.prompt-box { margin-bottom: 18px; padding: 16px; color: #283746; background: #eef3f7; border-left: 4px solid var(--navy); }
.prompt-box p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.prompt-list { margin-bottom: 20px; display: grid; gap: 10px; }
.prompt-list article { padding: 14px 16px; background: #f7f6f3; border-left: 3px solid var(--red); }
.prompt-list p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
  .hero { align-items: flex-start; flex-direction: column; background: linear-gradient(145deg, #101c30, #1b365f); }
  .hero-status { width: 100%; }
  .layout { grid-template-columns: 1fr; }
  .layout.sidebar-collapsed { grid-template-columns: 1fr; }
  .side-nav { position: static; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; border: 0; }
  .sidebar-toggle { max-width: none; min-height: 54px; border: 1px solid var(--line); background: white; }
  .side-progress { max-width: none; min-width: 0; padding: 8px 14px; display: grid; grid-template-columns: auto minmax(90px, 1fr); align-items: center; gap: 16px; background: white; border: 1px solid var(--line); }
  .side-progress > div:first-child { flex-direction: row; align-items: baseline; gap: 8px; white-space: nowrap; }
  .side-progress strong { font-size: 22px; }
  .side-progress-track { margin-top: 0; }
  .side-links { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
  .side-nav a { min-width: 0; justify-content: center; border: 1px solid var(--line); padding: 9px 8px; background: white; white-space: nowrap; }
  .side-nav.collapsed { grid-template-columns: 58px; }
  .side-nav.collapsed .side-links { display: none; }
  .scope-selector { grid-template-columns: 1fr; }
  .scope-option { min-height: 0; }
  .agent-command-grid { grid-template-columns: 1fr; }
  .agent-choice-grid, .activity-grid { grid-template-columns: 1fr; }
  .template-picker { grid-template-columns: 1fr; }
  .resource-guide-grid { grid-template-columns: 1fr; }
  .field-grid.two, .field-grid.three { grid-template-columns: 1fr; }
  .evidence-box { grid-template-columns: 1fr; align-items: stretch; }
}
@media (max-width: 520px) {
  .hero { min-height: 0; padding: 36px 22px; }
  .layout { width: min(100% - 20px, 1320px); margin-top: 18px; }
  .side-nav { grid-template-columns: 1fr; }
  .sidebar-toggle { min-height: 46px; }
  .side-progress { grid-template-columns: auto minmax(70px, 1fr); }
  .side-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-nav.collapsed { grid-template-columns: 58px; }
  .card { padding: 22px 18px; }
  .actions { flex-direction: column; }
  .button { width: 100%; }
  .agent-choice { min-height: 0; padding: 24px; grid-template-columns: 1fr; gap: 12px; }
  .offline-seal { width: 130px; }
  .radio-options, .portfolio-scope { grid-template-columns: 1fr; }
}
