:root {
  --ink: #233244;
  --muted: #6d7d8b;
  --line: #dbe5ea;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --coral: #ff775a;
  --coral-soft: #fff0eb;
  --mint: #56bba4;
  --mint-soft: #e9f8f3;
  --blue: #6f9ed2;
  --blue-soft: #edf4fb;
  --shadow: 0 16px 44px rgba(38, 55, 71, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 1180px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
}

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 30px 22px;
  background: #223244;
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand-block { display: flex; align-items: center; gap: 14px; padding: 0 6px 28px; border-bottom: 1px solid rgba(255,255,255,.13); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--coral); font-size: 24px; font-weight: 900; }
.brand-block strong, .brand-block span { display: block; }
.brand-block strong { font-size: 18px; }
.brand-block span { margin-top: 4px; color: #aebbc7; font-size: 13px; }
.sidebar nav { display: grid; gap: 9px; margin-top: 30px; }
.sidebar nav a { padding: 14px 15px; border-radius: 12px; color: #c7d0d8; text-decoration: none; font-size: 15px; font-weight: 700; transition: .2s; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.side-note { margin-top: auto; padding: 16px; border-radius: 14px; background: rgba(255,255,255,.07); }
.side-note span, .side-note strong { display: block; }
.side-note span { color: #94a4b2; font-size: 11px; letter-spacing: .15em; }
.side-note strong { margin-top: 8px; font-size: 14px; }

main { grid-column: 2; width: 100%; max-width: none; padding: 38px 42px 90px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.eyebrow, .section-heading span, .panel-title span { margin: 0 0 7px; color: var(--coral); font-size: 12px; font-weight: 900; letter-spacing: .14em; }
h1 { margin: 0; font-size: 46px; letter-spacing: -.04em; line-height: 1.15; }
h2 { margin: 0; font-size: 30px; line-height: 1.2; }
h3 { margin: 0; font-size: 20px; line-height: 1.35; }
p { color: var(--muted); line-height: 1.7; }
.lead { margin: 14px 0 0; max-width: 820px; font-size: 18px; }
.connection-pill { display: flex; align-items: center; gap: 9px; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 800; white-space: nowrap; }
.connection-pill.ok { background: var(--mint-soft); color: #2b806d; }
.connection-pill i { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); }
.updated-at { color: #8c99a3; font-size: 14px; }

.panel { margin-top: 28px; padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); }
.panel-title, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading { margin: 0 0 17px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.metric-grid article { min-height: 158px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.metric-grid span, .metric-grid small { display: block; }
.metric-grid span { color: var(--muted); font-size: 15px; font-weight: 800; }
.metric-grid strong { display: block; margin: 13px 0 9px; font-size: 44px; line-height: 1; }
.metric-grid small { color: #96a2ab; font-size: 14px; }

.workflow-grid { display: grid; grid-template-columns: minmax(0,1fr) 36px minmax(0,1fr) 36px minmax(0,1fr) 36px minmax(0,1fr); align-items: stretch; }
.workflow-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fcfdfd; }
.step-number { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 14px; background: var(--coral-soft); color: #c45139; font-size: 15px; font-weight: 900; }
.workflow-grid article:nth-of-type(2) .step-number { background: var(--mint-soft); color: #2d806e; }
.workflow-grid article:nth-of-type(3) .step-number { background: var(--blue-soft); color: #426f9e; }
.workflow-grid article:nth-of-type(4) .step-number { background: #fff7dc; color: #9c741b; }
.workflow-grid p { margin: 12px 0 0; font-size: 15px; }
.flow-arrow { display: grid; place-items: center; color: #a6b2ba; font-size: 28px; font-weight: 700; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 15px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 16px 17px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { background: #f5f7f8; color: #647481; font-weight: 800; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfb; }
.badge { display: inline-flex; padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.badge.succeeded { background: var(--mint-soft); color: #2d806e; }
.button-link, .primary-link { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 13px; border-radius: 10px; background: var(--ink); color: #fff; text-decoration: none; font-size: 13px; font-weight: 800; }

.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.report-grid > article { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.report-cover { min-height: 245px; padding: 25px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.report-cover span { font-size: 14px; font-weight: 900; opacity: .8; }
.report-cover strong { font-size: 34px; line-height: 1.2; letter-spacing: -.03em; }
.report-cover small { font-size: 14px; }
.cover-one { background: linear-gradient(145deg, #4b8db8, #78c7cb); }
.cover-two { background: linear-gradient(145deg, #5a5f86, #948db7); }
.cover-three { background: linear-gradient(145deg, #6e8e72, #a9bd83); }
.report-info { padding: 22px; }
.report-info p { min-height: 54px; margin: 10px 0 18px; font-size: 15px; }
.primary-link { min-height: 44px; padding: 10px 16px; }

.system-note { margin-top: 28px; padding: 22px 24px; border-radius: 18px; background: #eef3f5; }
.system-note strong { display: block; font-size: 16px; }
.system-note p { margin: 7px 0 0; font-size: 14px; }

@media (max-width: 1500px) {
  .workflow-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
  .flow-arrow { display: none; }
}

.hero-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.primary-action, .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}
.primary-action { background: var(--ink); color: #fff; }
.primary-action.disabled { opacity: .45; cursor: not-allowed; }
.secondary-action { border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.secondary-action:disabled { opacity: .5; cursor: wait; }
.connection-pill.waiting { background: #eef2f4; color: #637582; }
.connection-pill.waiting i { background: #9aa8b2; }
.connection-pill.error { background: var(--coral-soft); color: #b84e37; }
.connection-pill.error i { background: var(--coral); }
.results-title { align-items: flex-end; }
.privacy-note { margin: 0; font-size: 13px; text-align: right; }
.badge.failed { background: var(--coral-soft); color: #bd5139; }
.empty { padding: 38px 18px; text-align: center; color: #96a2ab; font-size: 15px; }
.muted-text { color: #96a2ab; font-size: 13px; }
.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  max-width: 480px;
  padding: 15px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: .2s;
  z-index: 30;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a84632; }
.sample-actions, .result-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.secondary-link { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); font-size: 14px; font-weight: 800; text-decoration: none; background: #fff; }
.subtle-link { background: #eef3f5 !important; color: var(--ink) !important; }
