:root {
  --bg: #fff7ef;
  --bg-accent: #ffe9da;
  --surface: rgba(255, 255, 252, 0.94);
  --surface-strong: #fffefb;
  --surface-dark: rgba(29, 24, 34, 0.9);
  --ink: #1f2230;
  --muted: #596173;
  --border: rgba(87, 72, 128, 0.12);
  --brand: #2a7fff;
  --brand-strong: #175fe0;
  --brand-soft: rgba(42, 127, 255, 0.16);
  --accent: #ff7a59;
  --accent-soft: rgba(255, 122, 89, 0.16);
  --danger: #c43d52;
  --danger-soft: rgba(196, 61, 82, 0.12);
  --ok: #0a8f6a;
  --ok-soft: rgba(10, 143, 106, 0.12);
  --shadow: 0 28px 72px rgba(83, 59, 124, 0.14);
  --shadow-soft: 0 18px 44px rgba(83, 59, 124, 0.1);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans KR", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(42, 127, 255, 0.2), transparent 30%),
    radial-gradient(circle at 82% 8%, rgba(255, 122, 89, 0.18), transparent 24%),
    radial-gradient(circle at 55% 100%, rgba(145, 108, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #fffaf4 0%, #fff0e6 52%, #f7edff 100%);
}

a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

.page-shell {
  max-width: 1780px;
  margin: 0 auto;
  padding: 28px 28px 48px;
}

.hero-panel,
.card,
.siteCard,
.stat-card,
.info-card,
.pre-shell,
.glass-bar {
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  padding: 30px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.38), transparent 32%),
    linear-gradient(135deg, #306dff 0%, #6b63ff 38%, #ff7f66 100%);
  color: #fdfcff;
  box-shadow: var(--shadow);
}

.hero-panel .eyebrow,
.hero-panel h1,
.hero-panel .hero-copy,
.hero-panel .kicker-link,
.hero-panel .chip.accent {
  text-shadow: 0 1px 2px rgba(19, 20, 44, 0.22);
}

.hero-panel .stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 243, 255, 0.92));
  border-color: rgba(71, 80, 160, 0.18);
  box-shadow: 0 16px 32px rgba(36, 40, 115, 0.14);
}

.hero-panel .stat-card .stat-label {
  color: #4d4a73;
}

.hero-panel .stat-card .stat-value {
  color: #161c33;
}

.hero-panel .stat-card .meta {
  color: #5a6178;
}

.hero-panel h1,
.display-title,
.section-title,
.book-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.01em;
}

.hero-panel h1,
.display-title { font-size: clamp(2rem, 3vw, 3.4rem); }
.section-title { font-size: 1.15rem; }

.eyebrow {
  margin: 0 0 8px;
  color: rgba(255, 247, 255, 0.82);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
}

.hero-copy,
.sub,
.muted,
.meta,
.hint,
.footer-note {
  color: var(--muted);
}

.hero-copy {
  color: rgba(255, 247, 255, 0.92);
  line-height: 1.7;
  margin: 12px 0 0;
  max-width: 760px;
}

.card,
.siteCard,
.pre-shell {
  border-radius: var(--radius-lg);
}

.card,
.pre-shell { padding: 20px; }
.siteCard { padding: 16px; }

.glass-bar {
  border-radius: 999px;
  padding: 6px;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack { display: grid; gap: 14px; }

.btn,
button,
input,
select,
textarea {
  font: inherit;
}

.btn,
button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.btn:hover,
button:hover { transform: translateY(-1px); text-decoration: none; }
button:disabled,
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary { background: linear-gradient(135deg, var(--brand), #6b63ff); color: white; box-shadow: 0 12px 24px rgba(42, 127, 255, 0.22); }
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-strong), #594ef0); }
.btn-secondary { background: rgba(255, 255, 255, 0.72); color: var(--ink); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.9); }
.btn-accent { background: linear-gradient(135deg, var(--accent), #ff9a62); color: white; }
.btn-accent:hover { background: linear-gradient(135deg, #ee6848, #ff8d57); }

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(27, 29, 28, 0.16);
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.82);
  color: var(--ink);
}

label { font-size: 0.9rem; color: var(--muted); }

.pill,
.chip,
.stat-card {
  border-radius: 999px;
}

.pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  min-height: 40px;
  max-width: 100%;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.pill,
.chip,
.chip.neutral { background: rgba(255, 255, 255, 0.7); color: var(--ink); }
.chip.brand { background: var(--brand-soft); color: #175fe0; }
.chip.accent { background: var(--accent-soft); color: #241f2c; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.err { background: var(--danger-soft); color: var(--danger); }

.status {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-strong);
}
.status.ok { border-color: rgba(4,120,87,0.24); background: rgba(4,120,87,0.08); color: var(--ok); }
.status.err { border-color: rgba(167,52,52,0.24); background: rgba(167,52,52,0.08); color: var(--danger); }

.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(340px, 0.72fr);
  gap: 20px;
  margin-top: 18px;
  align-items: start;
}

.siteGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.siteCard.site-card-compact {
  min-width: 0;
}

.siteCard.site-card-wide {
  min-width: 0;
}

.sites-panel {
  overflow: hidden;
}

@media (min-width: 1180px) {
  .layout-2.dashboard-balance-layout .siteGrid {
    grid-template-columns: var(--site-grid-columns-1180, minmax(0, 0.89fr) minmax(0, 0.94fr) minmax(0, 0.89fr) minmax(0, 1.25fr));
    gap: 14px;
    align-items: start;
  }

  .layout-2.dashboard-balance-layout .siteCard {
    min-height: 100%;
  }
}

@media (min-width: 1400px) {
  .layout-2.dashboard-balance-layout {
    grid-template-columns: minmax(0, 2.8fr) minmax(340px, 0.58fr);
    gap: 24px;
  }

  .layout-2.dashboard-balance-layout .sites-panel {
    padding: 22px 22px 24px;
  }

  .layout-2.dashboard-balance-layout .siteGrid {
    grid-template-columns: var(--site-grid-columns-1400, minmax(0, 0.85fr) minmax(0, 0.90fr) minmax(0, 0.85fr) minmax(0, 1.50fr));
    gap: 16px;
    align-items: start;
  }
}

@media (min-width: 1700px) {
  .layout-2.dashboard-balance-layout {
    grid-template-columns: minmax(0, 3.05fr) minmax(340px, 0.54fr);
  }

  .layout-2.dashboard-balance-layout .siteGrid {
    grid-template-columns: var(--site-grid-columns-1700, minmax(0, 0.81fr) minmax(0, 0.86fr) minmax(0, 0.81fr) minmax(0, 1.73fr));
    gap: 18px;
  }
}

.siteHead,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.siteCard {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(249,245,255,0.94));
  border-color: rgba(86, 92, 168, 0.14);
}

.list { display: grid; gap: 0; margin-top: 6px; }
.item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 4px;
  border-top: 1px solid rgba(86, 92, 168, 0.1);
  align-items: start;
}
.item:first-child { border-top: 0; }
.rank { color: var(--muted); font-weight: 800; }
.title { font-weight: 800; line-height: 1.45; }
.meta { font-size: 0.84rem; margin-top: 3px; line-height: 1.5; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.stat-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 242, 255, 0.82));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 30px rgba(59, 61, 150, 0.12);
}
.stat-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 248, 255, 0.82);
}
.stat-value {
  font-size: 1.32rem;
  font-weight: 800;
  color: #fffefe;
  line-height: 1.25;
}

.pre-shell pre,
pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.68;
  font-size: 0.95rem;
}

.code-block,
pre.code-block {
  background: #171816;
  color: #ece7df;
  border-radius: 18px;
  padding: 16px;
  overflow: auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.footer-note {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid rgba(27,29,28,0.12);
  font-size: 0.84rem;
  line-height: 1.8;
  white-space: pre-line;
}

.kicker-link {
  color: rgba(248, 244, 238, 0.92);
  text-decoration: none;
}
.kicker-link:hover { text-decoration: underline; }

@media (max-width: 980px) {
  .layout-2 { grid-template-columns: 1fr; }
  .hero-panel { padding: 24px; }
}

@media (max-width: 680px) {
  .page-shell { padding: 16px 12px 26px; }
  .hero-panel,
  .card,
  .pre-shell,
  .siteCard { padding: 16px; border-radius: 20px; }
  .hero-panel h1,
  .display-title { font-size: clamp(1.85rem, 8vw, 2.5rem); line-height: 1.08; }
  .section-title { font-size: 1.05rem; }
  .row { gap: 10px; }
  .glass-bar { border-radius: 22px; padding: 10px; }
  .siteHead,
  .section-head { flex-direction: column; align-items: flex-start; }
  .pill,
  .chip { width: 100%; justify-content: center; text-align: center; white-space: normal; }
  .btn,
  button { width: 100%; justify-content: center; }
  .item { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 14px 0; }
  .title { font-size: 0.98rem; }
  .meta { font-size: 0.82rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { border-radius: 18px; }
  .footer-note { margin-top: 24px; padding-top: 16px; }
}
