:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --secondary: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;
  --radius-md: calc(var(--radius) - 2px);
  --font-sans: "Rubik", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --brand-indigo-50: #eef2ff;
  --brand-indigo-100: #e0e7ff;
  --brand-indigo-500: #6366f1;
  --brand-indigo-600: #4f46e5;
  --brand-purple-600: #9333ea;
  --brand-purple-700: #7e22ce;
  --brand-gradient: linear-gradient(to bottom right, var(--brand-indigo-500), var(--brand-purple-600));
  --brand-gradient-strong: linear-gradient(to bottom right, var(--brand-indigo-600), var(--brand-purple-700));
  --success-50: #ecfdf5;
  --success-200: #a7f3d0;
  --success-700: #047857;
  --warning-50: #fffbeb;
  --warning-200: #fde68a;
  --warning-700: #b45309;
  --danger-50: #fff1f2;
  --danger-200: #fecdd3;
  --danger-700: #be123c;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

* { box-sizing: border-box; }

html { text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: hsl(var(--secondary) / 0.4);
  color: hsl(var(--foreground));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }

button { cursor: pointer; }

h1, h2, h3 { margin: 0; letter-spacing: -0.025em; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid hsl(var(--border));
}

.header-inner,
.wrap {
  max-width: 1152px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  padding: 0;
  color: inherit;
}

.brand:hover { color: hsl(var(--foreground)); }

.logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo.sm { width: 34px; height: 34px; border-radius: 9px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.05; text-align: right; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: hsl(var(--muted-foreground)); font-weight: 500; }

.nav { display: flex; align-items: center; gap: 4px; }

.nav-btn {
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
}

.nav-btn:hover,
.nav-btn.active { background: hsl(var(--secondary)); }

.nav-btn.active { color: hsl(var(--foreground)); }

.main { flex: 1; }

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, #eef2ff 0%, #ffffff 45%, #faf5ff 100%);
}

.hero-wash,
.hero-dots {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 100% 62%, 0 82%);
}

.hero-wash { background: var(--brand-gradient); }

.hero-dots {
  opacity: 0.25;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.35) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}

.hero-inner {
  position: relative;
  max-width: 1152px;
  margin: 0 auto;
  padding: 72px 24px 120px;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.hero h1 {
  margin: 22px auto 0;
  max-width: 760px;
  font-size: 52px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  text-wrap: balance;
}

.hero-lead {
  margin: 20px auto 0;
  max-width: 560px;
  font-size: 18px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.search-card {
  max-width: 620px;
  margin: 36px auto 0;
  background: hsl(var(--card));
  border-radius: 18px;
  box-shadow: var(--shadow-2xl);
  padding: 20px;
  text-align: right;
}

.search-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.search-label {
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.free-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--success-50);
  color: var(--success-700);
  border: 1px solid var(--success-200);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.search-row { display: flex; gap: 10px; align-items: stretch; }

.field { position: relative; flex: 1; }

.field-icon {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  display: inline-flex;
  pointer-events: none;
}

.pp-input {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  border: 1px solid hsl(var(--input));
  padding: 0 40px 0 14px;
  font-size: 16px;
  color: hsl(var(--foreground));
  background: #fff;
}

.pp-input.plain { padding: 0 14px; height: 44px; border-radius: 8px; font-size: 15px; }

.pp-input.ltr { direction: ltr; text-align: right; }

.pp-input::placeholder { color: hsl(var(--muted-foreground) / 0.6); }

.pp-input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.search-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  height: 44px;
  padding: 0 32px;
  user-select: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s, transform 0.15s;
}

.btn:active { transform: translateY(0.5px); }

.btn:disabled { opacity: 0.55; pointer-events: none; }

.btn-brand { background: var(--brand-gradient); color: #fff; height: 48px; }

.btn-brand:hover { background: var(--brand-gradient-strong); }

.btn-brand.sm { height: 36px; padding: 0 16px; font-size: 14px; }

.btn-outline {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

.btn-outline:hover { background: hsl(var(--secondary)); }

.btn-block { width: 100%; margin-top: 6px; }

.stats {
  max-width: 1152px;
  margin: -68px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

.stats-grid,
.steps-grid {
  display: grid;
  gap: 16px;
}

.stats-grid { grid-template-columns: repeat(2, 1fr); }

.stat,
.step,
.panel,
.record,
.notice,
.save-banner,
.case-table {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-sm);
}

.stat { border-radius: 14px; padding: 20px 22px; }

.stat-top,
.record,
.save-banner,
.profile-head,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.stat-label { font-size: 13px; font-weight: 500; color: hsl(var(--muted-foreground)); }
.stat-icon { color: var(--brand-indigo-500); display: inline-flex; }
.stat-value { margin-top: 6px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stat-sub { margin-top: 2px; font-size: 12px; color: hsl(var(--muted-foreground)); }

.steps {
  max-width: 1152px;
  margin: 0 auto;
  padding: 72px 24px 24px;
  text-align: center;
}

.steps h2 { font-size: 30px; font-weight: 700; }
.steps-lead { color: hsl(var(--muted-foreground)); font-size: 16px; margin: 10px 0 0; }

.steps-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
  text-align: right;
}

.step { border-radius: 14px; padding: 26px 24px; }

.step-kicker { display: flex; align-items: center; gap: 12px; }

.step-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-indigo-50);
  color: var(--brand-indigo-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.step-n { font-size: 13px; font-weight: 600; color: var(--brand-indigo-600); }
.step h3 { font-size: 18px; font-weight: 600; margin: 16px 0 6px; letter-spacing: -0.02em; }
.step p { font-size: 14px; line-height: 1.6; color: hsl(var(--muted-foreground)); margin: 0; }

.view { animation: bt-fade 0.28s ease both; }

.profile {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 24px 72px;
}

.back {
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.back:hover { color: hsl(var(--foreground)); }

.panel { border-radius: 16px; padding: 28px; margin-top: 8px; }

.profile-head { align-items: center; flex-wrap: wrap; justify-content: flex-start; }

.avatar {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-id { flex: 1; min-width: 200px; }
.profile-id h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.profile-sub { font-size: 15px; color: hsl(var(--muted-foreground)); margin-top: 4px; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 16px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge.danger { background: var(--danger-50); color: var(--danger-700); border-color: var(--danger-200); }
.badge.warning { background: var(--warning-50); color: var(--warning-700); border-color: var(--warning-200); }
.badge.success { background: var(--success-50); color: var(--success-700); border-color: var(--success-200); }
.badge.demo { background: var(--brand-indigo-50); color: var(--brand-indigo-600); border-color: var(--brand-indigo-100); font-size: 12px; padding: 4px 10px; }

.badge-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.section-title { font-size: 18px; font-weight: 600; margin: 32px 0 14px; letter-spacing: -0.02em; }

.records { display: flex; flex-direction: column; gap: 12px; }

.record {
  border-radius: 12px;
  padding: 18px 20px;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  box-shadow: none;
}

.record-icon { display: inline-flex; flex-shrink: 0; margin-top: 2px; }
.record-copy { flex: 1; }
.record-label { font-size: 15px; font-weight: 600; }
.record-detail { font-size: 13.5px; color: hsl(var(--muted-foreground)); margin-top: 3px; line-height: 1.5; }

.cases { margin-top: 24px; }
.cases-label { font-size: 13.5px; font-weight: 600; color: hsl(var(--muted-foreground)); margin-bottom: 8px; }

.case-table { border-radius: 10px; overflow: hidden; box-shadow: none; }

table { width: 100%; border-collapse: collapse; text-align: right; }

th {
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--secondary) / 0.6);
}

td { padding: 12px 16px; font-size: 13.5px; border-bottom: 1px solid hsl(var(--border)); }
td.nowrap { white-space: nowrap; }
tr:last-child td { border-bottom: none; }

.save-banner {
  margin-top: 20px;
  background: var(--brand-indigo-50);
  border: 1px solid var(--brand-indigo-100);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: none;
  flex-wrap: wrap;
}

.save-copy { display: flex; gap: 12px; align-items: flex-start; flex: 1; min-width: 240px; color: var(--brand-indigo-600); }
.save-copy p { font-size: 14px; line-height: 1.55; margin: 0; font-weight: 500; }

.notice {
  margin-top: 14px;
  background: hsl(var(--secondary) / 0.6);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  box-shadow: none;
  color: hsl(var(--muted-foreground));
}

.notice p { font-size: 12.5px; line-height: 1.55; margin: 0; }

.empty-card { text-align: center; padding: 36px 28px; }
.empty-card h1 { font-size: 24px; margin-top: 14px; }
.empty-card p { color: hsl(var(--muted-foreground)); font-size: 15px; line-height: 1.6; margin: 10px auto 0; max-width: 460px; }

.examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }

.chip {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
}

.chip:hover { background: var(--brand-indigo-50); border-color: var(--brand-indigo-100); }

.footer {
  background: hsl(var(--card));
  border-top: 1px solid hsl(var(--border));
  margin-top: auto;
}

.footer-inner { padding: 40px 24px; flex-wrap: wrap; max-width: 1152px; margin: 0 auto; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.footer p {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin: 0;
  max-width: 640px;
  line-height: 1.55;
  text-align: left;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgb(15 23 42 / 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: bt-fade-in 0.15s ease-out;
}

.modal {
  width: 100%;
  max-width: 400px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 18px;
  box-shadow: var(--shadow-2xl);
  padding: 28px;
  position: relative;
  animation: bt-modal-in 0.18s ease-out;
}

.modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  border: none;
  background: hsl(var(--secondary));
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
}

.modal-head { text-align: center; }
.modal-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-head h1 { font-size: 20px; font-weight: 700; margin: 14px 0 4px; }
.modal-head p { font-size: 14px; color: hsl(var(--muted-foreground)); margin: 0 0 20px; }

.google-btn {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 18px;
}

.google-btn:hover { background: hsl(var(--secondary)); }

.or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
}

.or span.line { flex: 1; height: 1px; background: hsl(var(--border)); }

.tabs {
  display: flex;
  background: hsl(var(--secondary));
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  border: none;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 0;
  border-radius: 8px;
  background: transparent;
  color: hsl(var(--muted-foreground));
}

.tab.active {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
}

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { font-size: 13px; font-weight: 500; color: hsl(var(--muted-foreground)); display: block; margin-bottom: 6px; }
.legal { font-size: 12px; color: hsl(var(--muted-foreground)); text-align: center; margin: 18px 0 0; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: hsl(var(--foreground));
  color: white;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes bt-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bt-fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes bt-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 800px) {
  .hero h1 { font-size: 34px; }
  .hero-inner { padding: 48px 20px 96px; }
  .stats-grid, .steps-grid { grid-template-columns: 1fr; }
  .search-row { flex-direction: column; }
  .btn-brand { width: 100%; }
  .footer p { text-align: right; }
  .profile-head { align-items: flex-start; }
}
