:root {
  color-scheme: dark;
  --bg: #071119;
  --bg-soft: #0a1722;
  --panel: rgba(12, 28, 40, 0.84);
  --panel-strong: #0d2230;
  --line: rgba(117, 177, 196, 0.19);
  --line-strong: rgba(110, 219, 220, 0.42);
  --text: #eef7f7;
  --muted: #89a4ae;
  --teal: #42d8d0;
  --teal-soft: #1b9d9c;
  --blue: #63a9ff;
  --gold: #d6a855;
  --danger: #ff7d75;
  --success: #77e2a8;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(66, 216, 208, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 216, 208, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  color: var(--text);
  font-family:
    "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 44rem;
  height: 44rem;
  border-radius: 999px;
  filter: blur(120px);
  opacity: 0.11;
  pointer-events: none;
}

.ambient-a {
  top: -18rem;
  right: -12rem;
  background: var(--teal);
}

.ambient-b {
  bottom: -24rem;
  left: -18rem;
  background: #2357a5;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 5vw;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 25, 0.88);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 8px);
  align-items: end;
  gap: 3px;
  width: 38px;
  height: 38px;
  padding: 8px;
  border: 1px solid rgba(66, 216, 208, 0.5);
  border-radius: 10px;
  background: rgba(66, 216, 208, 0.08);
  box-shadow: inset 0 0 20px rgba(66, 216, 208, 0.06);
}

.brand-mark span {
  display: block;
  border-radius: 8px;
  background: linear-gradient(180deg, #7af1e9, #228e9c);
}

.brand-mark span:nth-child(1) {
  height: 10px;
}

.brand-mark span:nth-child(2) {
  height: 20px;
}

.brand-mark span:nth-child(3) {
  height: 15px;
}

.brand strong {
  display: block;
  font-size: 19px;
  letter-spacing: 0.02em;
}

.brand small {
  display: block;
  margin-top: -2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top-status,
.console-meta,
.hero-badges {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.top-status {
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #70808a;
  box-shadow: 0 0 0 4px rgba(112, 128, 138, 0.08);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 13px rgba(119, 226, 168, 0.75);
}

.version-chip,
.console-meta span,
.hero-badges span,
.path-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
}

.version-chip {
  padding: 5px 10px;
  color: #bdd1d6;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.shell {
  width: min(1440px, 92vw);
  margin: 0 auto;
}

.hero {
  padding: 92px 0 58px;
}

.eyebrow,
.section-kicker {
  color: var(--teal);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.2em;
}

.hero h1 {
  max-width: 900px;
  margin: 18px 0 22px;
  font-size: clamp(45px, 7vw, 86px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: transparent;
  background: linear-gradient(90deg, #5be0d7, #82b9ff);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero > p {
  max-width: 760px;
  margin: 0;
  color: #a5bac1;
  font-size: 17px;
}

.hero-badges {
  margin-top: 28px;
}

.hero-badges span {
  padding: 8px 12px;
  color: #b7cbd0;
  font-size: 12px;
}

.system-strip {
  display: grid;
  grid-template-columns: 1fr 28px 1fr 28px 1fr 28px 1fr 28px 1fr;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(9, 24, 34, 0.7);
  box-shadow: var(--shadow);
}

.flow-node {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1px 10px;
  min-width: 0;
  padding: 8px 10px;
}

.flow-node b {
  grid-row: 1 / 3;
  color: #5d7882;
  font-size: 12px;
}

.flow-node span {
  font-size: 13px;
  font-weight: 700;
}

.flow-node small {
  color: #5d7882;
  font-size: 9px;
  letter-spacing: 0.13em;
}

.flow-node.active b,
.flow-node.active small {
  color: var(--teal);
}

.system-strip > i,
.foundation-rail > i {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, var(--line), var(--teal-soft));
}

.notice {
  display: flex;
  gap: 14px;
  margin: 22px 0;
  padding: 16px 18px;
  border: 1px solid rgba(214, 168, 85, 0.25);
  border-radius: 14px;
  background: rgba(214, 168, 85, 0.055);
}

.notice-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(214, 168, 85, 0.55);
  border-radius: 50%;
  color: var(--gold);
  font-weight: 800;
}

.notice strong {
  color: #e7ca90;
  font-size: 13px;
}

.notice p {
  margin: 3px 0 0;
  color: #9fb0b5;
  font-size: 12px;
}

.console-card,
.answer-card,
.inspection-card,
.core-foundation {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.console-card {
  padding: clamp(22px, 4vw, 42px);
  border-radius: 22px;
}

.console-head,
.results-heading,
.answer-head,
.recovery-title,
.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.console-head h2,
.results-heading h2,
.core-foundation h2 {
  margin: 3px 0 0;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.035em;
}

.console-meta span {
  padding: 6px 10px;
  color: var(--muted);
  font-size: 10px;
}

.question-form {
  margin-top: 28px;
}

.question-form label {
  display: block;
  margin-bottom: 9px;
  color: #bdd0d5;
  font-size: 13px;
}

.question-form textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  resize: vertical;
  padding: 20px;
  border: 1px solid rgba(119, 190, 207, 0.26);
  border-radius: 14px;
  outline: none;
  background: rgba(2, 12, 19, 0.58);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  transition: border-color 160ms, box-shadow 160ms;
}

.question-form textarea:focus,
.decision-input-row input:focus,
.access-modal input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(66, 216, 208, 0.09);
}

.question-form textarea::placeholder,
input::placeholder {
  color: #526a74;
}

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
}

.input-footer > span {
  color: #617983;
  font-size: 11px;
}

.primary-button,
.access-modal button,
.decision-input-row button {
  border: 0;
  border-radius: 11px;
  color: #031314;
  font-weight: 800;
  background: linear-gradient(135deg, #5be2d9, #66b7e9);
  box-shadow: 0 10px 30px rgba(66, 216, 208, 0.15);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
}

.primary-button:disabled,
.decision-input-row button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.processing-panel,
.recovery-panel {
  margin-top: 24px;
  border-radius: 15px;
}

.processing-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 19px;
  border: 1px solid var(--line-strong);
  background: rgba(25, 96, 105, 0.09);
}

.processing-panel strong {
  font-size: 14px;
}

.processing-panel p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.scanner {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(66, 216, 208, 0.18);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.recovery-panel {
  padding: 22px;
  border: 1px solid rgba(255, 125, 117, 0.36);
  background: linear-gradient(
    135deg,
    rgba(118, 36, 39, 0.2),
    rgba(70, 28, 32, 0.08)
  );
}

.recovery-title span {
  color: #ff9b95;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.recovery-title b {
  padding: 4px 9px;
  border: 1px solid rgba(255, 125, 117, 0.42);
  border-radius: 999px;
  color: var(--danger);
  font-size: 11px;
}

.recovery-panel h3 {
  margin: 14px 0 4px;
  font-size: 22px;
}

.recovery-panel > p,
.recovery-panel > small {
  color: #bd9fa0;
  font-size: 12px;
}

.recovery-panel blockquote {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 17px;
  font-weight: 750;
  text-align: center;
}

.score-row {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #bba6a7;
  font-size: 12px;
}

.score-row strong {
  color: var(--danger);
  font-size: 20px;
}

.results-section {
  padding: 80px 0 0;
}

.request-meta {
  color: var(--muted);
  font-family: "Consolas", monospace;
  font-size: 10px;
  text-align: right;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

.answer-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
}

.guarded-card {
  border-color: rgba(66, 216, 208, 0.38);
}

.answer-head {
  padding: 19px 21px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.path-number {
  display: block;
  color: #59727d;
  font-family: "Consolas", monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
}

.answer-head h3 {
  margin: 3px 0 0;
  font-size: 17px;
}

.path-chip {
  flex: 0 0 auto;
  padding: 5px 9px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.path-chip.muted {
  color: #6f8790;
}

.path-chip.temporary {
  border-color: rgba(214, 168, 85, 0.36);
  color: #e4be77;
}

.path-chip.confirmed {
  border-color: rgba(119, 226, 168, 0.42);
  color: var(--success);
}

.path-chip.discarded {
  border-color: rgba(255, 125, 117, 0.42);
  color: var(--danger);
}

.answer-body {
  flex: 1;
  min-height: 230px;
  padding: 24px;
  color: #c6d3d7;
  font-size: 14px;
  line-height: 1.78;
  white-space: pre-wrap;
  word-break: break-word;
}

.answer-body.emphasized {
  color: #ecf7f7;
}

.guard-details {
  display: grid;
  gap: 10px;
  padding: 0 22px 20px;
}

.detail-block {
  padding: 12px 14px;
  border-left: 2px solid var(--teal-soft);
  background: rgba(66, 216, 208, 0.035);
}

.detail-block strong {
  display: block;
  margin-bottom: 4px;
  color: #7fded9;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.detail-block p,
.detail-block ul {
  margin: 0;
  color: #a9bec3;
  font-size: 12px;
}

.detail-block ul {
  padding-left: 17px;
}

.decision-box {
  margin: 0 20px 20px;
  padding: 17px;
  border: 1px solid rgba(214, 168, 85, 0.24);
  border-radius: 12px;
  background: rgba(214, 168, 85, 0.045);
}

.decision-box strong {
  color: #e4c184;
  font-size: 12px;
}

.decision-box p {
  margin: 2px 0 12px;
  color: #8e9fa4;
  font-size: 11px;
}

.decision-examples {
  display: flex;
  gap: 6px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}

.decision-examples span {
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #7d9198;
  font-family: "Consolas", monospace;
  font-size: 9px;
}

.decision-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.decision-input-row input,
.access-modal input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: rgba(1, 9, 14, 0.55);
  color: var(--text);
}

.decision-input-row input {
  min-width: 0;
  padding: 9px 11px;
  font-size: 12px;
}

.decision-input-row button {
  padding: 8px 12px;
  font-size: 11px;
}

.decision-message {
  min-height: 16px;
  margin: 8px 0 0 !important;
  color: var(--teal) !important;
}

.answer-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  color: #607882;
  font-size: 9px;
}

.inspection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.inspection-card {
  padding: 22px;
  border-radius: 17px;
}

.inspection-card.state-card {
  grid-column: 1 / -1;
}

.inspection-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.inspection-title span {
  color: var(--teal);
  font-family: "Consolas", monospace;
  font-size: 10px;
}

.inspection-title h3 {
  margin: 0;
  font-size: 15px;
}

.inspection-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding-top: 16px;
}

.analysis-item {
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.analysis-item span {
  display: block;
  color: #657f88;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.analysis-item strong {
  display: block;
  margin-top: 4px;
  color: #d9e6e8;
  font-size: 12px;
  word-break: break-word;
}

.principles-list {
  display: grid;
  gap: 9px;
  padding-top: 16px;
}

.principle {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(66, 216, 208, 0.09);
  border-radius: 9px;
  background: rgba(66, 216, 208, 0.025);
}

.principle b {
  color: var(--teal);
  font-family: "Consolas", monospace;
  font-size: 10px;
}

.principle strong {
  display: block;
  font-size: 11px;
}

.principle p {
  margin: 2px 0 0;
  color: #748c94;
  font-size: 9px;
}

.state-machine {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.5fr;
  align-items: center;
  gap: 12px;
  padding: 24px 0 10px;
}

.state-machine > i {
  color: #51717b;
  font-style: normal;
}

.state-node,
.state-branches span {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #75909a;
  font-family: "Consolas", monospace;
  font-size: 10px;
  text-align: center;
}

.state-node.done {
  color: var(--blue);
}

.state-node.current {
  border-color: rgba(214, 168, 85, 0.45);
  color: #e6bf76;
  background: rgba(214, 168, 85, 0.07);
  box-shadow: 0 0 24px rgba(214, 168, 85, 0.08);
}

.state-branches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.state-branches span.active-confirmed {
  border-color: rgba(119, 226, 168, 0.45);
  color: var(--success);
}

.state-branches span.active-revision {
  border-color: rgba(99, 169, 255, 0.45);
  color: var(--blue);
}

.state-branches span.active-discarded {
  border-color: rgba(255, 125, 117, 0.45);
  color: var(--danger);
}

.state-card > p {
  margin: 10px 0 0;
  color: #738a92;
  font-size: 11px;
  text-align: center;
}

.core-foundation {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  align-items: center;
  gap: 50px;
  margin: 80px 0;
  padding: clamp(25px, 5vw, 52px);
  border-radius: 22px;
}

.core-foundation p {
  color: var(--muted);
  font-size: 13px;
}

.foundation-rail {
  display: grid;
  grid-template-columns: 1fr 20px 1fr 20px 1fr 20px 1fr;
  align-items: center;
}

.foundation-rail span {
  display: grid;
  gap: 5px;
  color: #a8bcc1;
  font-size: 11px;
  text-align: center;
}

.foundation-rail b {
  color: var(--teal);
  font-family: "Consolas", monospace;
  font-size: 9px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 5vw;
  border-top: 1px solid var(--line);
  color: #526b74;
  font-size: 10px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 12, 0.86);
  backdrop-filter: blur(14px);
}

.access-modal {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #0b1b25;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.48);
}

.access-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(66, 216, 208, 0.46);
  border-radius: 14px;
  color: var(--teal);
  font-family: "Consolas", monospace;
  font-weight: 900;
  background: rgba(66, 216, 208, 0.06);
}

.access-modal h2 {
  margin: 20px 0 7px;
}

.access-modal > p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.access-modal label {
  display: block;
  margin-bottom: 7px;
  color: #b9c9cd;
  font-size: 12px;
}

.access-modal input {
  padding: 12px;
}

.access-modal button {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
}

#accessError {
  min-height: 18px;
  margin: 9px 0 0;
  color: var(--danger);
  font-size: 11px;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .system-strip {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .system-strip > i {
    width: 1px;
    height: 12px;
    margin-left: 24px;
  }

  .comparison-grid,
  .inspection-grid,
  .core-foundation {
    grid-template-columns: 1fr;
  }

  .inspection-card.state-card {
    grid-column: auto;
  }

  .foundation-rail {
    margin-top: 12px;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 0 18px;
  }

  .brand small,
  .version-chip {
    display: none;
  }

  .top-status {
    font-size: 10px;
  }

  .shell {
    width: min(100% - 28px, 1440px);
  }

  .hero {
    padding-top: 62px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .console-head,
  .results-heading,
  .answer-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .input-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    justify-content: center;
  }

  .comparison-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .inspection-content {
    grid-template-columns: 1fr;
  }

  .state-machine {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .state-machine > i {
    transform: rotate(90deg);
  }

  .state-branches {
    grid-template-columns: 1fr;
  }

  .foundation-rail {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .foundation-rail > i {
    width: 1px;
    height: 14px;
    margin: 0 auto;
  }

  .decision-input-row {
    grid-template-columns: 1fr;
  }

  .page-footer {
    flex-direction: column;
  }
}
