:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --ink: #132742;
  --muted: #5f7089;
  --line: #d7deea;
  --accent: #1866d8;
  --accent-soft: #e8f1ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, #f7fbff 0%, var(--bg) 50%);
  color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f7fbff);
  display: flex;
  flex-direction: column;
}

.sidebar-top {
  padding: 22px 18px 14px;
}

.sidebar-top h1 {
  margin: 0;
  font-size: 21px;
}

.sidebar-top p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toc {
  padding: 8px 12px 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.toc a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border-radius: 8px;
}

.toc-home,
.toc-section {
  padding: 9px 10px;
  font-size: 14px;
  font-weight: 600;
}

.toc-step {
  margin-left: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: #2b3d58;
}

.toc a:hover {
  background: var(--accent-soft);
}

.toc a.active {
  background: var(--accent-soft);
  color: #0f4ba0;
}

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 14px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sidebar-bottom .logo-inline,
.sidebar-bottom img {
  width: 80px;
  height: auto;
  margin: 0 auto;
  display: block;
}

.sidebar-bottom .logo-inline svg {
  width: 100%;
  height: auto;
}

.sidebar-bottom small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}

.content {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 6px 24px rgba(17, 37, 64, 0.06);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.card h3 {
  margin: 16px 0 8px;
  font-size: 21px;
}

.card h4 {
  margin: 14px 0 8px;
  font-size: 19px;
  color: #1e3b63;
}

.flow-title {
  margin-top: 20px;
}

.step-line h4 {
  font-size: 22px;
  margin: 6px 0 10px;
}

.card p,
.card li {
  line-height: 1.6;
}

.desc {
  color: var(--muted);
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb-card {
  padding: 10px 16px;
  background: #f8fbff;
}

.hero ol {
  margin-top: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.section-card h2,
.step-card h3 {
  margin-bottom: 8px;
}

.section-card a,
.step-card a {
  color: #0f4ba0;
  text-decoration: none;
}

.section-card a:hover,
.step-card a:hover {
  text-decoration: underline;
}

.kicker {
  margin: 0 0 6px;
  color: #355b8c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

figure {
  margin: 12px 0;
}

figure img {
  display: block;
  width: 100%;
  border-radius: 10px;
  background: #fff;
}

.shot-wrap {
  position: relative;
  display: inline-block;
  max-width: 900px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: visible;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.hotspot {
  position: absolute;
  border: 2px solid #e53935;
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(229, 57, 53, 0.04) inset;
  min-width: 12px;
  min-height: 12px;
}

.hotspot em {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-100%, -100%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e53935;
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 0 0 2px #fff;
}

figcaption {
  margin-top: 6px;
  color: #2a3f5f;
  font-weight: 600;
  font-size: 13px;
}

.capture-note {
  margin: 4px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.meta-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid #b7d2ff;
  color: #0f4ba0;
  font-size: 11px;
}

.region-guide {
  margin: 8px 0 0;
  padding-left: 18px;
}

.region-guide li {
  font-size: 13px;
  color: #364a67;
}

.nav-card {
  display: flex;
  justify-content: flex-end;
}

.next-link {
  color: #0f4ba0;
  text-decoration: none;
  font-weight: 600;
}

.next-link:hover {
  text-decoration: underline;
}

code {
  background: #edf3fd;
  border: 1px solid #dbe6fb;
  border-radius: 6px;
  padding: 1px 6px;
}

.muted {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .sidebar-bottom {
    display: none;
  }

  .content {
    padding: 18px;
  }
}

/* Language switcher */
.lang-bar {
  text-align: right;
  padding: 8px 0;
  font-size: 0.85em;
  margin-bottom: 8px;
}

.lang-current {
  font-weight: 700;
  color: var(--ink);
}

.lang-link {
  color: var(--accent);
  text-decoration: none;
}

.lang-link:hover {
  text-decoration: underline;
}

/* Home page hero */
.hero-tagline {
  font-size: 1.35em;
  font-weight: 700;
  color: var(--ink);
  margin: 4px 0 8px;
  line-height: 1.4;
}

.hero-desc {
  font-size: 0.95em;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.hero-subtitle {
  font-size: 1.1em;
  color: var(--muted);
  margin-top: -4px;
}

/* Wow points */
.section-heading {
  font-size: 1.1em;
  margin: 0 0 16px;
  color: var(--ink);
}

.wow-section {
  padding: 24px;
}

.wow-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.wow-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
}

.wow-number {
  font-size: 1.8em;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.3;
  line-height: 1;
  margin-bottom: 4px;
}

.wow-card h4 {
  margin: 0 0 6px;
  font-size: 0.95em;
  color: var(--ink);
}

.wow-card p {
  margin: 0;
  font-size: 0.85em;
  color: var(--muted);
  line-height: 1.6;
}

/* Persona cards */
.persona-section {
  padding: 24px;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.persona-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}

.persona-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.persona-icon {
  font-size: 1.6em;
  margin-bottom: 6px;
}

.persona-role {
  font-weight: 700;
  font-size: 0.9em;
  color: var(--ink);
  margin-bottom: 8px;
}

.persona-card p {
  margin: 0;
  font-size: 0.82em;
  color: var(--muted);
  line-height: 1.6;
  text-align: left;
}

/* FAQ page */
.faq-search {
  margin-bottom: 20px;
}

.faq-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95em;
  outline: none;
  transition: border-color 0.2s;
}

.faq-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.faq-page h3 {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: 1.05em;
}

.faq-page h3:first-of-type {
  border-top: none;
  padding-top: 0;
}

.faq-page h4 {
  margin: 20px 0 8px;
  font-size: 0.95em;
  color: var(--ink);
}

.faq-page h4::before {
  content: 'Q. ';
  color: var(--accent);
  font-weight: 700;
}

.faq-related {
  margin: 10px 0 0;
  padding: 0;
  font-size: 0.85em;
}

.faq-related a {
  display: inline-block;
  padding: 4px 12px;
  margin: 3px 4px 3px 0;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.92em;
  transition: all 0.15s;
}

.faq-related a:hover {
  background: var(--accent);
  color: #fff;
}

.faq-page ul {
  margin: 8px 0;
  padding-left: 20px;
}

.faq-page li {
  margin-bottom: 4px;
  font-size: 0.9em;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .wow-grid { grid-template-columns: 1fr; }
  .persona-grid { grid-template-columns: 1fr; }
}

.home-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}

.feature-icon {
  font-size: 1.6em;
  margin-bottom: 8px;
}

.feature-card h3 {
  margin: 0 0 6px;
  font-size: 1em;
  color: var(--ink);
}

.feature-card p {
  margin: 0;
  font-size: 0.88em;
  color: var(--muted);
  line-height: 1.6;
}

/* Quick links grid */
.quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.quick-link {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.quick-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quick-link strong {
  font-size: 0.92em;
  margin-bottom: 2px;
}

.quick-link span {
  font-size: 0.8em;
  color: var(--muted);
}

.quick-link .badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7em;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* TOC group headers */
.toc-group-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 16px 12px 4px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

.toc-group-header:first-of-type {
  border-top: none;
  margin-top: 4px;
}

/* Concepts section (A.3 등) */
.concepts dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 16px 0;
}

.concepts dt {
  font-weight: 700;
  color: var(--accent);
  padding: 12px 0 4px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.concepts dt:first-of-type {
  border-top: none;
  margin-top: 0;
}

.concepts dd {
  margin: 0 0 8px 0;
  padding: 0 0 0 16px;
  color: var(--ink);
  line-height: 1.7;
}

/* Glossary table */
.glossary table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.92em;
}

.glossary th {
  background: var(--accent-soft);
  color: var(--accent);
  text-align: left;
  padding: 10px 12px;
  font-weight: 700;
}

.glossary td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.glossary tr:hover td {
  background: var(--accent-soft);
}

/* Glossary tooltip on terms */
.glossary-term {
  border-bottom: 1px dotted var(--accent);
  cursor: help;
  position: relative;
}

.glossary-term:hover::after,
.glossary-term:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.82em;
  line-height: 1.5;
  white-space: normal;
  width: max-content;
  max-width: 300px;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.glossary-term:hover::before,
.glossary-term:focus::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
  z-index: 101;
}
