:root {
  --ink: #15231e;
  --muted: #61716a;
  --green: #087354;
  --green-dark: #064f3c;
  --green-soft: #e8f3ef;
  --cream: #f4f2eb;
  --paper: #fffefa;
  --line: #d9ddd7;
  --red: #a93425;
  --amber: #a46408;
  --shadow: 0 18px 60px rgba(25, 43, 35, .08);
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 85% 0, #e3ede7 0, transparent 33%), var(--cream); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.topbar { height: 76px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; background: rgba(255,254,250,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-session { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.user-session span { font-size: 12px; font-weight: 800; }
.user-session button { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: white; color: var(--ink); font-size: 11px; font-weight: 800; }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: white; background: var(--green); border-radius: 12px; font-weight: 900; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.health { font-size: 12px; padding: 7px 12px; border-radius: 99px; background: #eee; color: var(--muted); }
.health.ok { color: var(--green-dark); background: var(--green-soft); }
.health.error { color: var(--red); background: #f9e9e6; }
.shell { width: min(1480px, calc(100% - 40px)); margin: 0 auto 80px; }
.intro { padding: 76px 3.3vw 52px; }
.eyebrow, .kicker { margin: 0 0 12px; color: var(--green); font-weight: 900; letter-spacing: .14em; font-size: 12px; }
.intro h1 { font-size: clamp(38px, 5.5vw, 78px); letter-spacing: -.055em; line-height: 1.02; margin: 0; max-width: 900px; }
.intro > p:last-child { font-size: 19px; color: var(--muted); margin: 24px 0 0; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: #e6e7e2; gap: 1px; border: 1px solid var(--line); border-radius: 18px 18px 0 0; overflow: hidden; }
html[data-release-profile="purpose1"] .tabs { grid-template-columns: 1fr; }
html[data-release-profile="purpose1"] [data-purpose-feature="purpose2"],
html[data-release-profile="purpose1"] [data-purpose-feature="purpose3"] { display: none !important; }
.login-page { min-height: 100vh; background: linear-gradient(150deg, #eef3ef, #fbfaf6 62%); }
.login-shell { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid var(--line); border-top: 7px solid var(--green); border-radius: 16px; background: var(--paper); box-shadow: 0 22px 60px rgba(28,45,37,.12); }
.login-card h1 { margin: 8px 0 10px; font-size: 29px; }
.login-card > p { color: var(--muted); line-height: 1.6; }
.login-card form { display: grid; gap: 9px; margin-top: 24px; }
.login-card form label { margin-top: 7px; font-size: 13px; font-weight: 900; }
.login-card form input { width: 100%; border: 1px solid #b9c5be; border-radius: 9px; padding: 13px 14px; background: white; font: inherit; }
.login-card form button { margin-top: 12px; border: 0; border-radius: 9px; padding: 14px; background: var(--green); color: white; font-weight: 900; }
.login-card form button:disabled { opacity: .55; }
.login-card .status { margin-top: 18px; }
.login-note { margin: 16px 0 0; font-size: 12px; }
.tab { border: 0; background: rgba(255,254,250,.72); padding: 22px 26px; text-align: left; display: grid; grid-template-columns: 36px 1fr; column-gap: 10px; }
.tab > span { grid-row: span 2; color: var(--green); font-size: 12px; font-weight: 900; padding-top: 4px; }
.tab strong { font-size: 19px; }
.tab small { color: var(--muted); margin-top: 2px; }
.tab.active { background: var(--green); color: white; }
.tab.active > span, .tab.active small { color: #c7e6da; }
.workspace { background: var(--paper); border: 1px solid var(--line); border-top: 0; padding: clamp(28px, 4vw, 58px); min-height: 580px; box-shadow: var(--shadow); }
.workspace-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; padding-bottom: 30px; }
.workspace-head h2 { font-size: clamp(28px, 3vw, 44px); letter-spacing: -.04em; margin: 0 0 8px; }
.workspace-head p:not(.kicker) { color: var(--muted); margin: 0; }
.policy { white-space: nowrap; border: 1px solid; padding: 9px 13px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.strict-policy { color: var(--green); background: var(--green-soft); border-color: #b8dbcd; }
.permissive-policy { color: var(--amber); background: #fff4d9; border-color: #ecd29b; }
.query-card { background: #f8f8f4; border: 1px solid var(--line); border-radius: 16px; padding: clamp(20px, 3vw, 34px); }
.query-card label { display: grid; gap: 9px; color: #31423b; font-weight: 800; font-size: 14px; }
.query-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-top: 10px; }
input, textarea, select { width: 100%; border: 1px solid #bec8c2; border-radius: 10px; background: white; color: var(--ink); padding: 14px 15px; outline: 0; }
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
select[multiple] { padding: 6px; min-height: 150px; }
select[multiple] option { padding: 8px; border-radius: 6px; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,115,84,.13); }
.query-card button, .query-row button { border: 0; border-radius: 10px; padding: 0 28px; min-height: 52px; background: var(--green); color: white; font-weight: 900; }
.query-card button:hover { background: var(--green-dark); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid label small { color: var(--muted); font-size: 11px; font-weight: 500; }
.form-grid.compact { grid-template-columns: repeat(4, 1fr); }
.form-grid.compact .wide { grid-column: 1 / -1; }
.form-grid.compact label:nth-of-type(2), .form-grid.compact label:nth-of-type(3) { grid-column: span 2; }
.source-filter { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; background: white; }
.source-filter legend { padding: 0 7px; color: #31423b; font-size: 14px; font-weight: 900; }
.source-filter label { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; font-size: 13px; }
.source-filter input { width: 18px; height: 18px; padding: 0; accent-color: var(--green); flex: 0 0 auto; }
.source-filter label:has(input:checked) { border-color: #9dcbbb; background: var(--green-soft); color: var(--green-dark); }
.source-filter label:has(input:disabled) { opacity: .52; background: #f3f3f0; }
.source-filter small { display: block; color: var(--muted); font-size: 10px; font-weight: 500; margin-top: 2px; }
.recent { margin-top: 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.recent > strong { margin-right: 4px; color: var(--ink); }
#p1-recent-list { display: contents; }
.recent-item { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 99px; background: white; overflow: hidden; }
.recent-item button { min-height: auto; background: transparent; color: var(--muted); padding: 7px 4px 7px 12px; }
.recent-item button:last-child { color: var(--red); padding: 7px 10px 7px 5px; font-size: 18px; }
.status { margin: 22px 0; border-left: 4px solid #b6c7c0; background: #f5f6f3; color: var(--muted); padding: 16px 19px; }
.status.busy { border-color: var(--green); color: var(--ink); }
.status.error { border-color: var(--red); color: var(--red); background: #fff4f2; }
.result-stack { display: grid; gap: 22px; }
.metric-grid { display: grid; gap: 14px; }
.metric-grid.five { grid-template-columns: repeat(5, 1fr); }
.metric { background: #f8f8f4; border: 1px solid var(--line); padding: 20px; min-height: 112px; }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; font-size: 32px; margin-top: 10px; letter-spacing: -.04em; }
.panel { border: 1px solid var(--line); background: white; padding: clamp(22px, 3vw, 34px); }
.panel h3 { margin: 0 0 18px; font-size: 25px; letter-spacing: -.03em; }
.panel h4 { margin: 26px 0 12px; font-size: 15px; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.badge { color: var(--green-dark); border: 1px solid #a9cfbf; background: var(--green-soft); border-radius: 99px; padding: 8px 12px; font-size: 12px; font-weight: 800; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.publisher-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.publisher { display: grid; gap: 5px; padding: 15px; background: #f6f6f2; border-top: 3px solid #c6cbc7; }
.publisher.yes { border-color: var(--green); background: var(--green-soft); }
.publisher .mark { font-size: 25px; font-weight: 900; }
.publisher small { color: var(--muted); }
.evidence-list { display: grid; gap: 9px; }
.evidence-button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; text-align: left; background: #fafaf7; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 13px 15px; }
.evidence-button strong { font-size: 14px; }
.evidence-button span { grid-column: 1; color: var(--muted); font-size: 12px; }
.evidence-button em { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--green); font-style: normal; font-size: 12px; font-weight: 900; }
.empty { color: var(--muted); font-size: 13px; padding: 16px; border: 1px dashed var(--line); }
.suggestions { display: flex; flex-wrap: wrap; gap: 9px; }
.suggestion { border: 1px solid #b8d2c7; background: var(--green-soft); color: var(--green-dark); padding: 10px 14px; border-radius: 99px; font-weight: 800; }
.verdict-card { display: flex; align-items: center; justify-content: space-between; gap: 30px; background: var(--ink); color: white; padding: clamp(26px, 4vw, 48px); }
.verdict-card h3 { font-size: 38px; margin: 0 0 10px; }
.verdict-card p:not(.kicker) { color: #cbd6d1; margin: 0; max-width: 900px; line-height: 1.7; }
#p2-verdict-mark { width: 70px; height: 70px; display: grid; place-items: center; flex: 0 0 70px; border-radius: 50%; background: var(--green); font-size: 32px; font-weight: 900; }
.classification { display: grid; gap: 8px; }
.classification strong { font-size: 25px; }
.classification p { color: var(--muted); line-height: 1.6; margin: 0; }
.score-detail { border: 1px solid var(--line); background: #f8f8f4; padding: 10px 12px; margin-top: 5px; }
.score-detail summary { color: var(--green-dark); cursor: pointer; font-weight: 800; font-size: 13px; }
.score-detail ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.score-detail li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.score-detail li strong, .score-detail li span { font-size: 12px; }
.score-detail li small { grid-column: 1 / -1; color: var(--muted); line-height: 1.45; }
.corpus-support { display: grid; gap: 5px; background: var(--green-soft); border-left: 4px solid var(--green); padding: 14px 16px; }
.corpus-support span, .corpus-support small { color: var(--muted); }
.semantic-panel { border-left: 5px solid var(--green); }
.semantic-table tbody th { width: 175px; }
.contextual-panel { border-left: 5px solid #d79a20; background: #fffdf7; }
.contextual-suggestion { display: grid; gap: 13px; padding: 17px; border: 1px solid #ecd7a9; background: white; }
.contextual-suggestion + .contextual-suggestion { margin-top: 12px; }
.contextual-suggestion > p { margin: 0; color: #594924; line-height: 1.65; }
.contextual-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.contextual-head strong { font-size: 18px; }
.contextual-head span { padding: 6px 9px; border-radius: 99px; background: #fff1c9; color: #835b0a; font-size: 12px; font-weight: 900; white-space: nowrap; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { border: 1px solid var(--line); border-radius: 99px; padding: 7px 10px; font-size: 12px; }
.caution { background: #fff9eb; border-color: #ecd7a9; }
.caution ul { margin: 0; padding-left: 20px; color: #624a22; line-height: 1.7; }
.question-list, .question-slider { display: grid; gap: 22px; }
.result-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 18px 0; padding: 13px 15px; border: 1px solid var(--line); background: #f8f8f4; }
.status-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 12px; }
.view-toggle { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.view-toggle button { border: 0; border-right: 1px solid var(--line); padding: 9px 12px; background: white; color: var(--muted); font-size: 12px; font-weight: 800; }
.view-toggle button:last-child { border-right: 0; }
.view-toggle button.active { background: var(--green); color: white; }
.slide-shell { display: grid; gap: 13px; }
.slide-nav { display: flex; justify-content: space-between; align-items: center; }
.slide-nav button { border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--green-dark); padding: 10px 14px; font-weight: 800; }
.slide-nav button:disabled { opacity: .35; cursor: default; }
.slide-nav strong { font-size: 14px; }
.question-card { border: 1px solid var(--line); background: white; display: grid; grid-template-columns: minmax(280px, 38%) 1fr; box-shadow: 0 9px 30px rgba(25,43,35,.05); }
.question-preview { position: relative; border: 0; border-right: 1px solid var(--line); background: #f1f1ed; padding: 18px; min-height: 300px; }
.question-preview img { width: 100%; height: 100%; max-height: 480px; object-fit: contain; display: block; }
.question-preview > span { position: absolute; right: 15px; bottom: 15px; border-radius: 99px; padding: 7px 10px; background: rgba(21,35,30,.86); color: white; font-size: 11px; font-weight: 800; }
.question-body { padding: 27px; display: grid; align-content: start; gap: 16px; }
.question-rank { color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.question-body h3 { margin: 0; font-size: 21px; line-height: 1.45; }
.metadata { color: var(--muted); font-size: 13px; }
.answer { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 8px 11px; background: var(--ink); color: white; border-radius: 7px; font-size: 13px; }
.comment { border-left: 3px solid var(--green); background: var(--green-soft); padding: 13px 15px; color: #24483a; line-height: 1.6; font-size: 14px; }
.comment.review_required, .comment.scope_review_required { border-color: var(--amber); background: #fff6e0; color: #654912; }
.comment.replacement_required { border-color: var(--red); background: #fff1ee; color: #773225; }
.verdict-status { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-left: 5px solid #929b97; background: #f2f3f1; padding: 14px 16px; }
.verdict-status strong { font-size: 18px; }
.verdict-status span { white-space: nowrap; font-weight: 900; }
.verdict-status.ready { border-color: var(--green); background: var(--green-soft); }
.verdict-status.adaptable { border-color: #d79a20; background: #fff6df; }
.verdict-status.replacement_required { border-color: var(--red); background: #fff1ee; }
.table-block h4 { margin: 4px 0 9px; font-size: 15px; }
.review-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.review-table th, .review-table td { border: 1px solid var(--line); padding: 10px 11px; text-align: left; vertical-align: top; line-height: 1.5; }
.review-table tbody th { width: 155px; background: #f4f5f2; color: #425149; }
.review-table thead th { background: var(--ink); color: white; }
.rationale-table tbody td:first-child { width: 50%; }
.rationale-table td small { display: block; color: var(--muted); margin-top: 4px; }
.review-detail { border: 1px solid var(--line); background: #f8f8f4; padding: 12px 14px; }
.review-detail summary { cursor: pointer; color: var(--green-dark); font-weight: 800; }
.review-detail p { color: var(--muted); line-height: 1.65; }
.slide-dots { display: flex; justify-content: center; gap: 8px; }
.slide-dots button { width: 10px; height: 10px; border: 0; border-radius: 50%; padding: 0; background: #c9cfcb; }
.slide-dots button.active { width: 28px; border-radius: 99px; background: var(--green); }
.comparison-wrap { overflow-x: auto; border: 1px solid var(--line); background: white; }
.comparison-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 13px; }
.comparison-table th, .comparison-table td { border-bottom: 1px solid var(--line); padding: 13px 12px; text-align: left; vertical-align: top; }
.comparison-table thead th { background: var(--ink); color: white; }
.comparison-table td span { display: block; color: var(--muted); margin-top: 4px; }
.comparison-table button { border: 1px solid #a9cfbf; border-radius: 7px; background: var(--green-soft); color: var(--green-dark); padding: 8px 10px; font-weight: 800; white-space: nowrap; }
.source-note { color: var(--muted); line-height: 1.6; font-size: 13px; }
.image-dialog { width: min(1100px, calc(100vw - 30px)); height: min(94vh, 1100px); border: 0; border-radius: 16px; padding: 0; box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.image-dialog::backdrop { background: rgba(10,22,17,.72); backdrop-filter: blur(4px); }
.image-dialog header { height: 70px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.image-dialog header strong, .image-dialog header small { display: block; }
.image-dialog header small { color: var(--muted); margin-top: 3px; }
.image-dialog header button { border: 0; background: transparent; color: var(--ink); font-size: 30px; }
.image-dialog img { width: 100%; height: calc(100% - 70px); object-fit: contain; background: #e7e7e2; }
.dialog-loading { height: calc(100% - 70px); display: grid; place-items: center; color: var(--muted); }

@media (max-width: 900px) {
  .shell { width: min(100% - 20px, 1480px); }
  .intro { padding: 48px 10px 34px; }
  .tabs { grid-template-columns: 1fr; border-radius: 14px 14px 0 0; }
  .tab { padding: 14px 18px; }
  .workspace-head, .verdict-card { flex-direction: column; }
  .contextual-head { align-items: flex-start; flex-direction: column; }
  .policy { align-self: flex-start; }
  .metric-grid.five, .publisher-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid, .form-grid, .form-grid.compact, .question-card { grid-template-columns: 1fr; }
  .source-filter { grid-template-columns: repeat(2, 1fr); }
  .form-grid.compact label:nth-of-type(2), .form-grid.compact label:nth-of-type(3) { grid-column: 1; }
  .form-grid .wide, .form-grid.compact .wide { grid-column: 1; }
  .question-preview { border-right: 0; border-bottom: 1px solid var(--line); max-height: 450px; }
  .result-toolbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 540px) {
  .topbar { padding: 0 15px; }
  .health { display: none; }
  .workspace { padding: 22px 14px; }
  .query-row { grid-template-columns: 1fr; }
  .query-row button { min-height: 52px; }
  .metric-grid.five, .publisher-grid { grid-template-columns: 1fr; }
  .source-filter { grid-template-columns: 1fr; }
  .slide-nav button { padding: 8px 10px; font-size: 12px; }
  .review-table tbody th { width: 115px; }
  .verdict-status { align-items: flex-start; flex-direction: column; }
}
