:root {
  --ink: #17221d;
  --muted: #68736d;
  --line: #dfe5e1;
  --paper: #f7f8f5;
  --white: #ffffff;
  --green: #0d8b5f;
  --green-dark: #086c4a;
  --green-soft: #e6f4ee;
  --lime: #d9f378;
  --warm: #f1ede5;
  --danger: #c4473d;
  --shadow: 0 24px 70px rgba(29, 45, 37, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(217, 243, 120, 0.18), transparent 25rem),
    var(--paper);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 84px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 4vw;
  border-bottom: 1px solid rgba(23, 34, 29, 0.08);
  background: rgba(247, 248, 245, 0.88);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; width: max-content; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  color: white; background: var(--ink); border-radius: 12px 4px 12px 4px;
  font-family: Georgia, serif; font-size: 20px; font-weight: 700;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -0.02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.nav-tabs { display: flex; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.7); }
.nav-tab { border: 0; background: transparent; padding: 9px 18px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; }
.nav-tab.is-active { color: white; background: var(--ink); box-shadow: 0 5px 15px rgba(23,34,29,.18); }
.connection-pill { justify-self: end; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #d19b32; box-shadow: 0 0 0 5px rgba(209,155,50,.12); }
.connection-pill[data-state="ready"] .status-dot { background: var(--green); box-shadow: 0 0 0 5px rgba(13,139,95,.12); }
.connection-pill[data-state="error"] .status-dot { background: var(--danger); box-shadow: 0 0 0 5px rgba(196,71,61,.12); }

main { width: min(1480px, 92vw); margin: 0 auto; padding-bottom: 80px; }
.view { display: none; }
.view.is-active { display: block; }
.hero { padding: 70px 0 46px; }
.eyebrow, .section-kicker { margin: 0 0 12px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.hero h1, .collection-header h1 { margin: 0; max-width: 800px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(50px, 6vw, 88px); line-height: .98; font-weight: 500; letter-spacing: -.06em; }
.hero-copy { max-width: 620px; margin: 26px 0 32px; color: var(--muted); font-size: 17px; line-height: 1.75; }
.pipeline { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12px; font-weight: 700; color: #4b5750; }
.pipeline span { display: flex; align-items: center; gap: 7px; }
.pipeline b { color: var(--green); font-size: 10px; }
.pipeline i { width: 32px; height: 1px; background: #bcc5bf; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(370px, .82fr); gap: 22px; align-items: start; }
.search-card, .result-card { border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.search-card { padding: 32px; }
.result-card { position: sticky; top: 106px; min-height: 620px; padding: 32px; background: var(--ink); color: white; overflow: hidden; }
.result-card::after { content: ""; position: absolute; right: -120px; bottom: -140px; width: 330px; height: 330px; border: 1px solid rgba(217,243,120,.22); border-radius: 50%; box-shadow: 0 0 0 50px rgba(217,243,120,.035), 0 0 0 100px rgba(217,243,120,.025); }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.card-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.step-badge { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--green-dark); background: var(--lime); font-size: 11px; font-weight: 900; }
.step-badge.muted { color: var(--ink); background: rgba(255,255,255,.78); }
.form-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: 1.5fr .5fr; }
.field { display: grid; gap: 9px; margin-bottom: 22px; }
.field > span, .option-group legend { color: #405048; font-size: 12px; font-weight: 800; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px;
  color: var(--ink); background: #fbfcfa; outline: none; transition: .2s border-color, .2s box-shadow;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(13,139,95,.1); }
.option-group { min-width: 0; margin: 0 0 24px; padding: 0; border: 0; }
.option-group legend { margin-bottom: 12px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip input, .domain-grid input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip span, .domain-grid span { display: block; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fbfcfa; font-size: 12px; font-weight: 700; cursor: pointer; transition: .2s; }
.choice-chip input:checked + span, .domain-grid input:checked + span { color: var(--green-dark); border-color: rgba(13,139,95,.32); background: var(--green-soft); }
.option-columns { grid-template-columns: 1fr 1.35fr; gap: 14px; }
.option-group.compact { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; }
.check-row { display: flex; align-items: center; gap: 9px; margin-top: 9px; color: #445049; font-size: 12px; font-weight: 650; }
.check-row input { accent-color: var(--green); }
.domain-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.domain-grid span { padding: 11px 8px; text-align: center; border-radius: 10px; }
.primary-button { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 14px; padding: 17px 20px; color: white; background: var(--green); font-weight: 800; cursor: pointer; box-shadow: 0 12px 30px rgba(13,139,95,.22); transition: .2s transform, .2s background; }
.primary-button:hover { transform: translateY(-2px); background: var(--green-dark); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.form-note { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: 11px; }
.result-body { position: relative; z-index: 1; min-height: 465px; display: grid; place-content: center; justify-items: center; text-align: center; }
.result-body h3 { margin: 24px 0 8px; font-size: 20px; }
.result-body p { max-width: 330px; margin: 0; color: rgba(255,255,255,.58); font-size: 13px; line-height: 1.7; }
.empty-illustration { width: 180px; display: grid; gap: 9px; transform: rotate(-3deg); }
.empty-illustration span { height: 42px; border: 1px solid rgba(255,255,255,.17); border-radius: 10px; background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); }
.empty-illustration span:nth-child(2) { transform: translateX(18px); border-color: rgba(217,243,120,.28); }
.integration-warning { width: 100%; padding: 24px; border: 1px solid rgba(217,243,120,.22); border-radius: 16px; background: rgba(217,243,120,.06); text-align: left; }
.integration-warning strong { display: block; margin-bottom: 8px; color: var(--lime); font-size: 14px; }
.integration-warning ul { margin: 16px 0 0; padding: 0; list-style: none; }
.integration-warning li { padding: 8px 0; border-top: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.72); font-size: 12px; }

.collection-view { padding-top: 70px; }
.collection-header { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 44px; }
.collection-header h1 { font-size: clamp(48px, 6vw, 78px); }
.collection-header > p { max-width: 360px; color: var(--muted); line-height: 1.7; }
.candidate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.candidate-card { min-height: 190px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 12px 35px rgba(29,45,37,.06); }
.candidate-card .candidate-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.candidate-card h3 { margin: 28px 0 7px; font-family: Georgia, serif; font-size: 29px; letter-spacing: -.035em; }
.candidate-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.status-label { color: var(--green-dark); font-weight: 800; }
.empty-collection { grid-column: 1 / -1; padding: 70px 24px; border: 1px dashed #cbd3ce; border-radius: 18px; text-align: center; color: var(--muted); background: rgba(255,255,255,.45); }
.empty-collection strong { display: block; margin-bottom: 8px; color: var(--ink); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: min(390px, calc(100vw - 48px)); padding: 14px 17px; border-radius: 12px; color: white; background: var(--ink); box-shadow: 0 16px 44px rgba(0,0,0,.2); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; font-size: 13px; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1000px) {
  .topbar { grid-template-columns: 1fr auto; }
  .nav-tabs { position: fixed; left: 50%; bottom: 18px; z-index: 30; transform: translateX(-50%); box-shadow: 0 12px 35px rgba(23,34,29,.18); }
  .connection-pill { display: none; }
  .workspace-grid { grid-template-columns: 1fr; }
  .result-card { position: relative; top: auto; min-height: 480px; }
  .candidate-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .topbar { height: 72px; padding: 0 20px; }
  .brand small { display: none; }
  main { width: min(100% - 28px, 1480px); }
  .hero { padding-top: 50px; }
  .hero h1 { font-size: 50px; }
  .pipeline { gap: 9px; }
  .pipeline i { width: 12px; }
  .search-card, .result-card { padding: 22px; border-radius: 18px; }
  .two-columns, .option-columns { grid-template-columns: 1fr; }
  .domain-grid { grid-template-columns: repeat(3, 1fr); }
  .candidate-grid { grid-template-columns: 1fr; }
  .collection-header { align-items: start; flex-direction: column; }
  .nav-tab { padding: 9px 13px; }
}
