:root {
  --bg: #020711;
  --panel: rgba(8, 18, 32, 0.86);
  --panel-strong: rgba(12, 28, 44, 0.94);
  --line: rgba(120, 242, 251, 0.18);
  --line-strong: rgba(120, 242, 251, 0.42);
  --text: #edf6ff;
  --muted: rgba(237, 246, 255, 0.68);
  --dim: rgba(237, 246, 255, 0.46);
  --cyan: #78f2fb;
  --gold: #ffe1a3;
  --green: #63e6a6;
  --danger: #ff6f8d;
  --mono: "Cascadia Mono", "Consolas", monospace;
  --font: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(120, 242, 251, 0.16), transparent 34%),
    radial-gradient(circle at 82% 14%, rgba(255, 225, 163, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(7, 17, 31, 0.98), #020711 58%, #01040a);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1760px, calc(100% - 28px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  backdrop-filter: blur(18px);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 -14px;
  z-index: -1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(3, 7, 13, 0.94), rgba(3, 7, 13, 0.66));
}

.brand,
.top-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 210px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #061018;
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  font-size: 19px;
  font-weight: 1000;
  box-shadow: 0 0 28px rgba(120, 242, 251, 0.18);
}

.brand strong {
  display: block;
  color: #f8fcff;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 900;
}

.top-nav {
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(120, 242, 251, 0.14);
  border-radius: 9px;
  background: rgba(2, 8, 16, 0.48);
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 7px;
  color: rgba(237, 246, 255, 0.68);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.top-nav a:hover,
.top-nav a.is-active {
  color: #f8fcff;
  background: rgba(120, 242, 251, 0.12);
}

.optimizer-page {
  display: grid;
  gap: 18px;
  padding: 28px 0 70px;
}

.optimizer-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 18px;
  align-items: stretch;
  min-height: 230px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(4, 10, 19, 0.95), rgba(4, 10, 19, 0.64)),
    radial-gradient(circle at 86% 18%, rgba(120, 242, 251, 0.2), transparent 38%),
    linear-gradient(135deg, rgba(120, 242, 251, 0.11), rgba(255, 225, 163, 0.06));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.eyebrow,
.panel-head span,
.section-title span,
.result-head span,
.code-head span {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.04em;
}

.optimizer-title h1 {
  max-width: 900px;
  margin: 10px 0 12px;
  color: #f8fcff;
  font-size: clamp(42px, 5vw, 74px);
  line-height: 1.02;
  letter-spacing: 0;
}

.lead {
  max-width: 920px;
  margin: 0;
  color: rgba(237, 246, 255, 0.78);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.75;
}

code {
  padding: 2px 6px;
  border: 1px solid rgba(120, 242, 251, 0.18);
  border-radius: 5px;
  color: #dffcff;
  background: rgba(120, 242, 251, 0.08);
  font-family: var(--mono);
  font-size: 0.92em;
}

.policy-note {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 20px;
  border: 1px solid rgba(255, 225, 163, 0.26);
  border-radius: 9px;
  background: rgba(255, 225, 163, 0.07);
}

.policy-note strong {
  color: var(--gold);
  font-size: 15px;
  font-weight: 1000;
}

.policy-note span {
  color: rgba(255, 245, 220, 0.78);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.65;
}

.quick-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quick-steps article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 5px 12px;
  min-height: 112px;
  padding: 17px;
  border: 1px solid rgba(120, 242, 251, 0.16);
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(120, 242, 251, 0.08), rgba(255, 225, 163, 0.035)),
    rgba(4, 12, 22, 0.72);
}

.quick-steps b {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(120, 242, 251, 0.34);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(120, 242, 251, 0.1);
  font-size: 17px;
  font-weight: 1000;
}

.quick-steps strong {
  color: #f8fcff;
  font-size: 17px;
  font-weight: 1000;
}

.quick-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.optimizer-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(520px, 1fr) minmax(360px, 500px);
  gap: 16px;
  align-items: start;
}

.profile-panel,
.builder-panel,
.result-card,
.code-card {
  border: 1px solid rgba(120, 242, 251, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(12, 28, 44, 0.8), rgba(3, 8, 16, 0.9)),
    rgba(3, 8, 16, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.profile-panel,
.builder-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.profile-panel,
.result-panel {
  position: sticky;
  top: 88px;
}

.panel-head,
.section-title {
  display: grid;
  gap: 6px;
}

.panel-head h2,
.section-title h2,
.problem-guide h2,
.result-head h2 {
  margin: 0;
  color: #f8fcff;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1.18;
}

.panel-head p,
.section-title p,
.result-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.6;
}

.profile-select-label,
.range-control,
.select-control {
  display: grid;
  gap: 8px;
}

.profile-select-label span,
.range-control span,
.select-control span {
  color: #f8fcff;
  font-size: 13px;
  font-weight: 950;
}

select {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid rgba(120, 242, 251, 0.22);
  border-radius: 8px;
  color: #f8fcff;
  background: rgba(3, 8, 16, 0.94);
  font-size: 13px;
  font-weight: 850;
}

.profile-grid {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 286px);
  overflow: auto;
  padding-right: 3px;
  scrollbar-color: rgba(120, 242, 251, 0.36) rgba(255, 255, 255, 0.06);
}

.profile-button,
.goal-button {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 8px;
  color: rgba(237, 246, 255, 0.74);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
  cursor: pointer;
}

.profile-button strong,
.goal-button strong {
  color: inherit;
  font-size: 14px;
  font-weight: 1000;
}

.profile-button span,
.goal-button span {
  color: rgba(237, 246, 255, 0.54);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.profile-button:hover,
.profile-button.is-active,
.goal-button:hover,
.goal-button.is-active {
  border-color: var(--line-strong);
  color: #f8fcff;
  background:
    linear-gradient(135deg, rgba(120, 242, 251, 0.16), rgba(255, 225, 163, 0.055)),
    rgba(4, 12, 22, 0.82);
  box-shadow: 0 0 24px rgba(120, 242, 251, 0.1);
}

.goal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.goal-button {
  min-height: 112px;
}

.goal-button em {
  color: var(--gold);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
}

.tuning-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tuning-summary article {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(120, 242, 251, 0.15);
  border-radius: 8px;
  background: rgba(2, 8, 16, 0.48);
}

.tuning-summary b {
  color: var(--cyan);
  font-size: 20px;
  font-weight: 1000;
}

.tuning-summary span {
  color: var(--dim);
  font-size: 11px;
  font-weight: 950;
}

.control-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.range-control,
.select-control {
  min-height: 126px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 8px;
  background: rgba(2, 8, 16, 0.48);
}

.select-control.is-wide {
  grid-column: 1 / -1;
}

.range-control {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
}

.range-control b {
  color: var(--gold);
  font-size: 12px;
  font-weight: 950;
}

.range-control input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--cyan);
}

.range-control small,
.select-control small {
  grid-column: 1 / -1;
  color: rgba(237, 246, 255, 0.56);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
}

.problem-guide {
  display: grid;
  gap: 12px;
}

.problem-guide > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.problem-guide article {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid rgba(255, 225, 163, 0.15);
  border-radius: 8px;
  background: rgba(255, 225, 163, 0.045);
}

.problem-guide b {
  color: var(--gold);
  font-size: 13px;
  font-weight: 1000;
}

.problem-guide span {
  color: rgba(255, 245, 220, 0.72);
  font-size: 12px;
  font-weight: 830;
  line-height: 1.55;
}

.result-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.result-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.copy-primary {
  min-height: 46px;
  border: 1px solid rgba(120, 242, 251, 0.5);
  border-radius: 8px;
  color: #02131a;
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  font-size: 14px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(120, 242, 251, 0.18);
}

.result-steps {
  padding: 14px;
  border: 1px solid rgba(120, 242, 251, 0.14);
  border-radius: 8px;
  background: rgba(2, 8, 16, 0.46);
}

.result-steps h3 {
  margin: 0 0 10px;
  color: #f8fcff;
  font-size: 15px;
  font-weight: 1000;
}

.result-steps ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.55;
}

.rollback-box {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid rgba(255, 111, 141, 0.18);
  border-radius: 8px;
  background: rgba(255, 111, 141, 0.055);
}

.rollback-box b {
  color: var(--danger);
  font-size: 13px;
  font-weight: 1000;
}

.rollback-box span {
  color: rgba(255, 221, 228, 0.76);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.55;
}

.code-card {
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.code-head button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(120, 242, 251, 0.3);
  border-radius: 7px;
  color: #f8fcff;
  background: rgba(120, 242, 251, 0.12);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.code-card pre {
  max-height: 480px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: rgba(237, 246, 255, 0.84);
  background:
    linear-gradient(180deg, rgba(2, 6, 13, 0.58), rgba(2, 6, 13, 0.88)),
    rgba(2, 6, 13, 0.82);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.62;
  white-space: pre;
  scrollbar-color: rgba(120, 242, 251, 0.36) rgba(255, 255, 255, 0.06);
}

.code-card code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

@media (max-width: 1320px) {
  .optimizer-workspace {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  }

  .result-panel {
    grid-column: 1 / -1;
    position: static;
  }

  .result-panel {
    grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .site-header,
  .optimizer-title,
  .optimizer-workspace,
  .result-panel {
    grid-template-columns: 1fr;
  }

  .site-header {
    display: grid;
    align-items: start;
    padding: 10px 0;
  }

  .top-nav {
    overflow-x: auto;
    justify-content: start;
  }

  .profile-panel {
    position: static;
  }

  .profile-grid {
    max-height: none;
  }

  .quick-steps,
  .goal-grid,
  .control-grid,
  .problem-guide > div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 18px, 520px);
  }

  .optimizer-title,
  .profile-panel,
  .builder-panel,
  .result-card {
    padding: 14px;
  }

  .optimizer-title h1 {
    font-size: 34px;
  }

  .lead {
    font-size: 14px;
  }

  .quick-steps article {
    min-height: 0;
  }

  .tuning-summary {
    grid-template-columns: 1fr;
  }
}
