:root {
  --bg: #f6f8f5;
  --surface: #ffffff;
  --surface-soft: #edf2ec;
  --text: #17211c;
  --muted: #667168;
  --line: #dce4dc;
  --accent: #246b5a;
  --accent-strong: #194f43;
  --accent-soft: #d9ede7;
  --gold: #ba8a23;
  --rose: #b86670;
  --blue: #4f6f9f;
  --shadow: 0 24px 60px rgba(31, 49, 41, 0.12);
  --radius: 8px;
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-user-select: none;
  user-select: none;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(36, 107, 90, 0.12), transparent 34rem),
    linear-gradient(180deg, #f8faf7 0%, var(--bg) 48%, #eef3ef 100%);
  color: var(--text);
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
}

#app,
#app * {
  -webkit-user-select: none;
  user-select: none;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.hero,
main,
.saved-section,
.footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand,
.source-link,
.text-link,
.source-links a,
.locale-option {
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
}

.source-link,
.text-link,
.source-links a {
  color: var(--accent-strong);
  font-weight: 700;
}

.locale-switch {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  z-index: 20;
}

.locale-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: auto;
  min-width: 116px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--accent-strong);
  cursor: pointer;
  padding: 0 12px;
  font-size: 0.88rem;
  font-weight: 850;
  box-shadow: 0 12px 28px rgba(31, 49, 41, 0.08);
}

.locale-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.locale-trigger-icon {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
}

.locale-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  width: max-content;
  min-width: 180px;
  max-width: min(260px, calc(100vw - 24px));
  max-height: min(320px, calc(100vh - 120px));
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.locale-switch.open .locale-menu,
.locale-switch[open] .locale-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.locale-switch > summary {
  list-style: none;
}

.locale-switch > summary::-webkit-details-marker {
  display: none;
}

.locale-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 10px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.locale-option:last-child {
  border-bottom: 0;
}

.locale-option:hover,
.locale-option:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.locale-option.active {
  background: var(--accent);
  color: #fff;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.9fr);
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - 160px);
  padding: 36px 0 72px;
}

.hero-grid > *,
.inventory-grid > *,
.results-grid > *,
.notice-panel > * {
  min-width: 0;
}

.hero-copy h1,
.results-hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.45rem, 6vw, 5.7rem);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-copy p,
.results-hero p {
  max-width: 640px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.hero-actions,
.card-actions,
.result-actions,
.assessment-actions,
.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions {
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 30px rgba(36, 107, 90, 0.18);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent-strong);
}

.hero-art {
  position: relative;
}

.hero-art::before {
  position: absolute;
  inset: 7% -2% -7% 8%;
  content: "";
  background: rgba(36, 107, 90, 0.13);
  filter: blur(34px);
}

.hero-art img {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border: 1px solid rgba(23, 33, 28, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.notice-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  margin: 0 0 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.notice-panel > div {
  background: rgba(255, 255, 255, 0.8);
  padding: 28px;
}

.notice-panel h2,
.section-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

.notice-panel p,
.section-heading p,
.inventory-card p,
.result-card p {
  color: var(--muted);
  line-height: 1.65;
}

.inventory-section {
  padding-bottom: 76px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.section-heading p {
  margin: 0;
}

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

.inventory-card,
.result-card,
.assessment-card,
.sloan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 42px rgba(31, 49, 41, 0.08);
}

.inventory-card {
  display: flex;
  flex-direction: column;
  min-height: 430px;
  padding: 24px;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

.topline-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.facet-badge {
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 800;
}

.inventory-card h3 {
  margin: 24px 0 6px;
  font-size: 1.6rem;
  line-height: 1.15;
}

.subtitle {
  margin: 0;
  font-weight: 800;
}

.factor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.factor-chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 7px 10px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.fine-note {
  margin-top: auto;
  font-size: 0.9rem;
}

.card-actions {
  margin-top: 18px;
  justify-content: flex-end;
}

.assessment-shell,
.results-shell {
  padding: 36px 0 70px;
}

.assessment-card {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px);
}

.assessment-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

.eyeline {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-weight: 900;
}

.assessment-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
}

.progress-count {
  font-weight: 900;
}

.progress-track,
.bar {
  overflow: hidden;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress-track {
  margin: 26px 0 36px;
}

.progress-fill,
.bar div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--rose), var(--blue));
}

.question-block {
  padding: clamp(20px, 4vw, 32px);
  border-radius: 8px;
  background: #f9fbf8;
}

.question-text {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 3.1rem);
  font-weight: 850;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.facet {
  margin: 16px 0 0;
  color: var(--accent-strong);
  font-weight: 800;
}

.scale-group {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0 22px;
  padding: 0;
  border: 0;
}

.scale-group legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.scale-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  min-height: 56px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  cursor: pointer;
}

.scale-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 12px 28px rgba(36, 107, 90, 0.12);
}

.scale-option input {
  position: absolute;
  opacity: 0;
}

.scale-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.scale-label {
  font-weight: 600;
}

.assessment-actions {
  justify-content: space-between;
}

.form-message {
  margin: 18px 0 0;
  color: #8a3c25;
  font-weight: 800;
}

.results-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.result-actions {
  justify-content: flex-end;
  min-width: min(420px, 100%);
}

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

.result-card {
  padding: 24px;
}

.sloan-card {
  padding: 24px;
  margin-bottom: 24px;
}

.sloan-card .eyeline {
  margin-bottom: 8px;
}

.sloan-code {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
  line-height: 1.1;
}

.sloan-char.muted {
  color: var(--muted);
  opacity: 0.65;
}

.sloan-card .fine-note {
  margin-top: 8px;
}

.sloan-legend {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.sloan-legend b {
  color: var(--accent-strong);
}

@media (max-width: 900px) {
  .sloan-code {
    font-size: 2.1rem;
  }
}

.result-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.result-title-row h2 {
  margin: 0;
  font-size: 1.35rem;
}

.result-title-row strong {
  color: var(--accent-strong);
  font-size: 1.4rem;
}

.bar {
  margin: 20px 0 10px;
}

.bar-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.facet-list {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--surface-soft);
}

.facet-list-title {
  margin: 0 0 14px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--muted);
}

.facet-row {
  margin-bottom: 14px;
}

.facet-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.facet-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.facet-percent {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.facet-bar {
  height: 8px;
  margin: 6px 0 4px;
}

.facet-band {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.source-links {
  margin-top: 16px;
}

.results-home-action {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

/* saved results */

.saved-section {
  margin-top: 48px;
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.saved-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.saved-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.saved-info strong {
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-info time {
  font-size: 0.85rem;
  color: var(--muted);
}

.saved-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.saved-title-row strong {
  min-width: 0;
  flex: 0 1 auto;
}

.saved-sloan {
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  color: var(--accent-strong);
}

.saved-sloan .sloan-char.muted {
  color: var(--muted);
  opacity: 0.65;
}

.saved-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.button.danger {
  color: var(--rose);
}

.button.danger:hover {
  background: color-mix(in srgb, var(--rose) 10%, transparent);
}

.footer {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer a {
  color: var(--accent-strong);
  font-weight: 800;
}

.footer-meta {
  margin-top: 6px;
}

.footer-sep {
  margin: 0 8px;
  opacity: 0.6;
}

.legal-doc {
  max-width: 760px;
  padding: 40px 0 80px;
}

.legal-doc h1 {
  margin: 0 0 4px;
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
}

.legal-updated {
  color: var(--muted);
  margin: 0 0 32px;
}

.legal-doc section {
  margin-bottom: 28px;
}

.legal-doc h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.legal-doc p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 10px;
}

.legal-crosslink {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .hero-grid,
  .notice-panel,
  .inventory-grid,
  .results-grid,
  .results-hero {
    grid-template-columns: 1fr;
  }

  .hero-grid,
  .results-hero {
    display: grid;
  }

  .hero-grid {
    min-height: auto;
    padding-top: 20px;
  }

  .section-heading {
    display: block;
  }

  .scale-group {
    grid-template-columns: 1fr;
  }

  .scale-option {
    min-height: 48px;
  }
}

@media (max-width: 560px) {
  .hero,
  main,
  .saved-section,
  .footer {
    width: calc(100% - 24px);
    margin: 0 auto;
  }

  .topbar,
  .assessment-header,
  .result-title-row {
    align-items: start;
  }

  .topbar {
    flex-direction: column;
    align-items: start;
    gap: 12px;
  }

  .topbar-actions {
    align-items: start;
    flex-direction: column;
  }

  .locale-menu {
    left: 0;
    right: auto;
  }

  .source-link {
    font-size: 0.9rem;
  }

  .hero-copy h1,
  .results-hero h1 {
    max-width: 100%;
    font-size: 2rem;
    line-height: 1.08;
    word-break: break-all;
  }

  .hero-copy p,
  .results-hero p,
  .notice-panel p {
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .hero-art img {
    aspect-ratio: 4 / 3;
  }

  .notice-panel > div,
  .inventory-card,
  .result-card {
    padding: 20px;
  }

  .assessment-actions,
  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .saved-row {
    flex-direction: column;
    align-items: stretch;
  }

  .saved-actions {
    justify-content: stretch;
  }

  .saved-actions .button {
    flex: 1;
  }

  .button {
    width: 100%;
  }
}
