/* ==========================================================================
   PandaLive Capture & Playback Handbook (pandaliverecorder.com)
   Independent Technical Reference Stylesheet — Static, Zero External Fonts
   ========================================================================== */

:root {
  --bg-canvas: #f7f9f9;
  --bg-surface: #ffffff;
  --bg-subtle: #eef3f3;
  --bg-dark: #10181e;

  --ink-heading: #131a20;
  --ink-body: #27323b;
  --ink-muted: #52616d;

  --accent-primary: #0d6e66;
  --accent-hover: #09524c;
  --accent-soft: #e6f4f2;
  --accent-border: #99d5cf;

  --border-hairline: #d8e1e5;
  --border-strong: #b8c7ce;

  --info-bg: #eff6ff;
  --info-border: #93c5fd;
  --info-ink: #1e3a8a;

  --warn-bg: #fffbeb;
  --warn-border: #fcd34d;
  --warn-ink: #78350f;

  --danger-bg: #fef2f2;
  --danger-border: #fca5a5;
  --danger-ink: #7f1d1d;

  --ok-bg: #ecfdf5;
  --ok-border: #6ee7b7;
  --ok-ink: #064e3b;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --max-shell: 1180px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(19, 26, 32, 0.06);
  --shadow-md: 0 6px 18px rgba(19, 26, 32, 0.07);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-body);
  background-color: var(--bg-canvas);
  line-height: 1.68;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img, svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  background: var(--ink-heading);
  color: #ffffff;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
  outline: 3px solid var(--accent-border);
}

/* Top Independence Notice Strip */
.notice-bar {
  background: var(--bg-dark);
  color: #dbe4ea;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid #24323d;
}

.notice-bar__inner {
  max-width: var(--max-shell);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.notice-bar a {
  color: #8ce3da;
}

/* Header & Navigation */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  max-width: var(--max-shell);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink-heading);
}

.brand:hover {
  color: var(--ink-heading);
}

.brand__logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
}

.brand__name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.brand__tag {
  font-size: 0.74rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.nav-toggle {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  color: var(--ink-heading);
  padding: 0.48rem 0.8rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  gap: 0.45rem;
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.primary-nav a {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink-body);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.primary-nav a:hover {
  background: var(--bg-subtle);
  color: var(--accent-primary);
}

.primary-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

@media (max-width: 920px) {
  html.js-enabled .nav-toggle {
    display: inline-flex;
  }

  html.js-enabled .primary-nav {
    display: none;
    width: 100%;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-hairline);
  }

  html.js-enabled .primary-nav.is-open {
    display: block;
  }

  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-nav a {
    display: block;
    padding: 0.6rem 0.75rem;
  }
}

/* Layout Containers */
.shell {
  max-width: var(--max-shell);
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
  min-width: 0;
}

main {
  flex: 1 0 auto;
  width: 100%;
  min-width: 0;
  padding-bottom: 3.5rem;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 1rem 0 0.25rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--border-strong);
}

.breadcrumbs a {
  color: var(--ink-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* Hero Sections */
.hero {
  background: linear-gradient(180deg, #ffffff 0%, #f1f6f6 100%);
  border-bottom: 1px solid var(--border-hairline);
  padding: 2.5rem 0 2.75rem;
  margin-bottom: 2.25rem;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid var(--accent-border);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.9rem;
}

.hero h1 {
  font-size: clamp(1.85rem, 3.4vw, 2.6rem);
  line-height: 1.18;
  color: var(--ink-heading);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  max-width: 26ch;
}

.hero__lead {
  font-size: 1.12rem;
  color: var(--ink-body);
  max-width: 68ch;
  margin: 0 0 1.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn--primary {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.btn--secondary {
  background: var(--bg-surface);
  color: var(--ink-heading);
  border-color: var(--border-strong);
}

.btn--secondary:hover {
  background: var(--bg-subtle);
  color: var(--accent-hover);
  border-color: var(--accent-primary);
}

/* Quick Answer Reality Box on Home */
.reality-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-left: 5px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.reality-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  color: var(--ink-heading);
}

.reality-panel ul {
  margin: 0;
  padding-left: 1.25rem;
}

.reality-panel li + li {
  margin-top: 0.45rem;
}

/* Two-Column Article Shell with Sticky TOC */
.doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 2.5rem;
  align-items: start;
  margin-top: 1.5rem;
}

@media (max-width: 960px) {
  .doc-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .toc-aside {
    order: -1;
  }
}

.article-header {
  padding: 1.5rem 0 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 1.75rem;
}

.article-header h1 {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.22;
  color: var(--ink-heading);
  margin: 0.35rem 0 0.75rem;
  letter-spacing: -0.018em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.prose {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .prose {
    padding: 1.35rem 1.15rem;
  }
}

.prose h2 {
  font-size: 1.45rem;
  color: var(--ink-heading);
  margin: 2.25rem 0 0.8rem;
  padding-top: 0.4rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  scroll-margin-top: 5rem;
}

.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
}

.prose h3 {
  font-size: 1.15rem;
  color: var(--ink-heading);
  margin: 1.6rem 0 0.55rem;
  line-height: 1.35;
  scroll-margin-top: 5rem;
}

.prose p {
  margin: 0 0 1.05rem;
  max-width: 70ch;
}

.prose ul, .prose ol {
  margin: 0 0 1.2rem;
  padding-left: 1.4rem;
  max-width: 68ch;
}

.prose li + li {
  margin-top: 0.42rem;
}

/* Sticky TOC */
.toc-card {
  position: sticky;
  top: 5.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.toc-card__title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin: 0 0 0.7rem;
}

.toc-card ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc-card a {
  display: block;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ink-body);
  text-decoration: none;
  padding: 0.3rem 0.55rem;
  border-left: 2px solid var(--border-hairline);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.toc-card a:hover,
.toc-card a.is-active {
  color: var(--accent-hover);
  background: var(--accent-soft);
  border-left-color: var(--accent-primary);
  font-weight: 600;
}

/* Cards & Grids */
.doc-grid > * {
  min-width: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.12rem;
  color: var(--ink-heading);
}

.card p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--ink-body);
  flex: 1 0 auto;
}

.card__link {
  font-weight: 700;
  font-size: 0.92rem;
}

.section-heading {
  margin: 2.5rem 0 0.85rem;
}

.section-heading h2 {
  font-size: 1.55rem;
  color: var(--ink-heading);
  margin: 0 0 0.35rem;
  letter-spacing: -0.015em;
}

.section-heading p {
  margin: 0;
  color: var(--ink-muted);
  max-width: 68ch;
}

/* Badges, Korean Terms & Keyboard Chips */
.badge {
  display: inline-block;
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
  vertical-align: middle;
}

.badge--verified {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border: 1px solid var(--ok-border);
}

.badge--dated {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border: 1px solid var(--warn-border);
}

.badge--restricted {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border: 1px solid var(--danger-border);
}

.badge--info {
  background: var(--info-bg);
  color: var(--info-ink);
  border: 1px solid var(--info-border);
}

.kr-term {
  font-family: var(--font-sans);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: 4px;
  padding: 0.06rem 0.38rem;
  font-size: 0.9em;
  font-weight: 600;
  color: var(--ink-heading);
  overflow-wrap: break-word;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  padding: 0.1rem 0.36rem;
  border-radius: 4px;
  color: var(--ink-heading);
  overflow-wrap: anywhere;
}

.notice-bar code,
.site-footer code {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: #f8fafc;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  color: var(--ink-heading);
}

/* Callouts */
.callout {
  border-radius: var(--radius-md);
  padding: 1.05rem 1.25rem;
  margin: 1.35rem 0;
  border: 1px solid transparent;
}

.callout__title {
  display: block;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 0;
}

.callout--info {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--info-ink);
}

.callout--warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-ink);
}

.callout--danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-ink);
}

.callout--ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok-ink);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.35rem 0;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

th, td {
  padding: 0.78rem 0.95rem;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: top;
}

th {
  background: var(--bg-subtle);
  color: var(--ink-heading);
  font-weight: 700;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

/* Figures & SVG Diagrams */
.diagram-figure {
  margin: 1.65rem 0;
  background: #fbfdfd;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  text-align: center;
}

.diagram-figure img {
  display: block;
  margin: 0 auto;
}

.diagram-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-align: left;
}

/* Interactive Storage Calculator */
.calc-card {
  background: var(--bg-surface);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  margin: 1.5rem 0 2rem;
  box-shadow: var(--shadow-md);
}

.calc-card h2 {
  margin-top: 0;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.preset-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  color: var(--ink-heading);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.preset-btn:hover,
.preset-btn.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent-primary);
  color: var(--accent-hover);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-heading);
}

.field span.field-hint {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.field input,
.field select {
  padding: 0.58rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.96rem;
  color: var(--ink-heading);
  background: #ffffff;
}

.calc-results {
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 1rem;
}

.result-stat {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem;
}

.result-stat__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

.result-stat__value {
  display: block;
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--accent-hover);
  font-family: var(--font-mono);
}

.result-stat__sub {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

.calc-error {
  color: var(--danger-ink);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* FAQ Accordion / Details */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.25rem 0;
}

.faq-item {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  padding: 1.1rem 1.25rem;
}

.faq-item h2,
.faq-item h3 {
  margin: 0 0 0.55rem;
  font-size: 1.1rem;
  color: var(--ink-heading);
}

.faq-item p:last-child {
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  background: var(--bg-dark);
  color: #cbd5e1;
  padding: 2.75rem 0 2.25rem;
  border-top: 1px solid #24323d;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 780px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.site-footer h2 {
  color: #ffffff;
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}

.site-footer p {
  margin: 0 0 0.75rem;
  color: #b6c4d1;
  font-size: 0.88rem;
  max-width: 54ch;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.site-footer a {
  color: #a7f3d0;
  text-decoration: none;
}

.site-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-legal {
  padding-top: 1.35rem;
  border-top: 1px solid #23313d;
  font-size: 0.82rem;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

@media print {
  .notice-bar,
  .site-header,
  .toc-aside,
  .hero__actions,
  .site-footer {
    display: none !important;
  }

  body, .prose {
    background: #ffffff;
    border: none;
    box-shadow: none;
    padding: 0;
  }
}
