:root {
  --primary: #8b5cf6;
  --primary-strong: #7c3aed;
  --bg: #f5f4f8;
  --surface: #ffffff;
  --line: #e6e8ef;
  --text: #182233;
  --muted: #667387;
  --ok: #10b981;
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-strong: 0 16px 36px rgba(15, 23, 42, 0.1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Public Sans', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.01em;
}

.app-shell {
  width: min(460px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  border-left: 1px solid #f1f2f4;
  border-right: 1px solid #f1f2f4;
}

.view { display: none; min-height: 100vh; }
.view.active { display: block; }

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 244, 248, 0.93);
  backdrop-filter: blur(8px);
}

.header h1, .header h2 { margin: 0; font-size: 28px; letter-spacing: -0.025em; font-weight: 800; }
.brand-row { display: inline-flex; align-items: center; gap: 8px; }
.brand-badge {
  width: 28px; height: 28px; border-radius: 9px;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
}

.icon-btn {
  width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid #dde3ec; background: #fff; cursor: pointer;
  color: #4b5669; font-weight: 700;
}

.home-main { padding: 14px 14px 92px; display: grid; gap: 20px; }
.hero {
  min-height: 350px;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  background-image: url('https://lh3.googleusercontent.com/aida-public/AB6AXuDSlK4Q-8PH_nfpg3eOesmxfNSH1MWawt-wEWvutwU4kl0AQ0fCAllb6jOUeJHsjhK387zWjODMygsaxBkgzIo54XS4ZFSJgKEnCou7tTjoaEYYoZPqGFSV4mNxEPGyWKC1cyHywDVhUiYS2olrGH3De8deMgq76s4ZWdLAFoob2bZ6W_susg1R1oKF8xBcxo8jHcPBk9vCO0_1DWDAJezKzGWLZCjXzYeGts2yurvHcfPVadP4CWVY6Q9gwEWaQkcC5k03r2CoyFcw');
  background-size: cover;
  background-position: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.08) 20%, rgba(17, 24, 39, 0.68) 100%);
}
.hero-inner { position: absolute; left: 18px; right: 18px; bottom: 20px; z-index: 1; color: #fff; }
.hero-pill { display: inline-block; background: var(--primary); color: #fff; border-radius: 999px; padding: 6px 10px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; }
.hero h2 { margin: 12px 0 8px; color: #fff; font-size: 46px; line-height: 1.04; }
.hero p { margin: 0; font-size: 14px; color: rgba(255,255,255,0.9); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head h3 { margin: 0; font-size: 27px; letter-spacing: -0.02em; }
.section-head button { background: none; border: none; color: var(--primary); font-weight: 700; font-size: 13px; cursor: pointer; }

.promo {
  border-radius: 18px;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  color: #fff;
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.promo::after {
  content: '';
  position: absolute;
  right: -14px;
  top: -18px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
  transform: rotate(18deg);
}
.promo h4 { margin: 0; font-size: 34px; line-height: 1.02; }
.promo p { margin: 10px 0 16px; font-size: 13px; color: rgba(255,255,255,0.87); }
.promo button { border: none; background: #fff; color: #6d28d9; padding: 9px 15px; border-radius: 999px; font-weight: 700; cursor: pointer; }

.guides { display: grid; gap: 10px; }
.guide {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 12px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.03);
}
.guide i {
  width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: #ede9fe; color: var(--primary); font-style: normal; font-weight: 700; font-size: 11px;
}
.guide strong { display: block; font-size: 14px; }
.guide p { margin: 4px 0 0; font-size: 12px; color: #6b7280; }

.bottom-nav {
  position: fixed;
  z-index: 40;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(460px, 100vw);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.97);
  padding: 8px 8px 16px;
}
.bottom-nav button {
  border: none;
  background: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 0;
  border-radius: 10px;
  cursor: pointer;
}
.bottom-nav button.active { color: var(--primary); background: #f5f3ff; }

.search-main { padding: 12px 14px 96px; display: grid; gap: 16px; }
.search-form { display: grid; gap: 16px; }
.search-section {
  display: grid;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}
.search-section h3 { margin: 0; font-size: 31px; line-height: 1.06; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 8px; }
.search-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: grid; gap: 7px; }
label span { color: #4b5a70; font-size: 12px; font-weight: 700; letter-spacing: -0.005em; }
input, select, textarea {
  width: 100%;
  border: 1px solid #d7deea;
  border-radius: 12px;
  background: #fcfdff;
  padding: 13px 12px;
  font: inherit;
  color: #1f2937;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
input::placeholder { color: #a1abbb; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #b8a7ff;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
  background: #fff;
}

.cta { border: none; border-radius: 13px; background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: #fff; font-size: 27px; font-weight: 800; padding: 15px 14px; cursor: pointer; box-shadow: var(--shadow-strong); }
.status { font-size: 12px; color: #64748b; }
.sec-icon { color: var(--primary); font-size: 19px; line-height: 1; font-weight: 700; }
.tip-box { border: 1px solid #e6e2ff; border-radius: 12px; background: #f8f6ff; padding: 12px; display: grid; gap: 7px; }
.tip-box strong { font-size: 13px; color: #4a3ca8; }
.tip-box p { margin: 0; color: #5d6678; font-size: 12px; line-height: 1.5; }

.policy-teaser {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.policy-teaser p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.policy-teaser button {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.result-main { padding: 12px 10px 92px; display: grid; gap: 12px; }
.confidence {
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(140deg, var(--primary), var(--primary-strong));
  color: #fff;
  position: relative;
  overflow: hidden;
}
.confidence::after { content:''; position:absolute; width:120px; height:120px; right:-22px; top:-28px; border-radius:24px; background: rgba(255,255,255,0.12); }
.confidence small { display:block; font-size:12px; letter-spacing:0.08em; opacity:0.85; }
.confidence .score { margin-top: 6px; font-size: 56px; font-weight: 800; line-height: 1; }
.confidence .chip { display:inline-flex; margin-top: 10px; background: rgba(255,255,255,0.2); border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 600; }

.card { border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 14px; }
.card h3 { margin: 0; font-size: 34px; letter-spacing: -0.02em; }
.sub { font-size: 12px; color: #64748b; }
.recommend-top { display: flex; align-items: baseline; justify-content: space-between; }
.recommend-top h2 { margin: 0; font-size: 40px; line-height: 1; color: var(--primary); letter-spacing: -0.02em; }
.variation { display: flex; gap: 10px; align-items: center; border:1px solid var(--line); border-radius:12px; background:#fbfbff; padding:10px; margin: 10px 0 12px; }
.variation b { color: var(--primary); font-size: 29px; line-height: 1; }
.metrics { display: grid; gap: 12px; }
.metric { display: grid; gap: 4px; }
.metric .row { display:flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.metric .row b.pos { color: var(--primary); }
.metric .row b.neg { color: var(--ok); }
.track { position: relative; height: 10px; border-radius: 999px; background: #d8dde5; overflow: hidden; }
.track::before { content:''; position:absolute; left:50%; width:2px; top:0; bottom:0; background:#bcc5d3; }
.fill { position:absolute; top:0; bottom:0; border-radius:999px; }
.fill.pos { background: var(--primary); }
.fill.neg { background: var(--ok); }
.legend { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 10px; color: #9ca3af; letter-spacing: 0.08em; }

.reviews { display: grid; gap: 10px; }
.review { border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.r-top { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.avatar { width: 30px; height: 30px; border-radius: 999px; background: #ede9fe; color: var(--primary); display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; }
.tag { font-size: 10px; border-radius: 999px; border: 1px solid var(--line); padding: 4px 7px; color:#334155; background:#f8fafc; }
.review p { margin: 8px 0 0; font-size: 12px; color: #334155; line-height: 1.42; }

.history-list { display:grid; gap: 8px; }
.history-item { border:1px solid var(--line); border-radius: 12px; background:#fff; padding: 10px; cursor: pointer; }
.history-item strong { font-size: 14px; }
.history-item p { margin: 4px 0 0; font-size: 12px; color: #64748b; }

.policy-main { padding: 14px 14px 92px; display:grid; gap: 10px; }
.policy-main h3 { margin: 8px 0 2px; font-size: 22px; }
.policy-main .p-card { border:1px solid var(--line); border-radius: 12px; background:#fff; padding: 12px; }
.policy-main p, .policy-main li { font-size: 13px; line-height: 1.5; color: #334155; }

.hidden { display: none !important; }
