/* ==========================================================================
   SPRING HUB & LEARNING GUIDES - TOKYO NIGHT THEME & RESPONSIVE DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Pure Black Everywhere (#000000) & Crisp Monochrome UI System */
  --bg: #000000;                /* Pure Black Background */
  --bg-gradient: #000000;
  --panel: #000000;             /* Pure Black Surface */
  --panel2: #000000;            /* Pure Black Secondary Surface */
  --surface: #000000;
  --surface-2: #000000;
  --text: #f0f0f2;              /* Clean Crisp White Text */
  --text-bright: #ffffff;       /* Pure Bright White Headings */
  --muted: #888888;             /* Clean Silver Gray */
  --border: #222222;            /* Minimal Dark Border */
  --line: #222222;
  --border-focus: #7aa2f7;
  --primary: #ffffff;           /* Pure White Button */
  --primary-2: #e4e4e7;
  --primary-soft: #16161e;
  --accent: #7aa2f7;            /* Vibrant Tokyo Night Blue */
  --accent2: #bb9af7;           /* Vibrant Purple */
  --cyan: #7dcfff;              /* Neon Cyan */
  --purple: #bb9af7;            /* Vibrant Violet/Purple */
  --magenta: #d2a8ff;           /* Bright Magenta */
  --green: #64ffb4;             /* Vibrant Emerald Green */
  --success: #64ffb4;
  --yellow: #e0af68;            /* Warm Amber Gold */
  --warning: #ffa657;           /* Vivid Orange-Gold */
  --orange: #ff9e64;            /* Vibrant Coral Orange */
  --danger: #ff6b6b;            /* Vivid Coral Red */
  --blue: #79c0ff;              /* Bright Sky Blue */
  --code-bg: #0d0d0d;           /* Pure Black Code Background */
  --code-header: #141414;       /* Sleek Sandbox Header */
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --radius: 10px;
  --max: 1280px;

  /* Rich & Vibrant Code Syntax Tokens (Colorful) */
  --syn-keyword: #c678dd;       /* Vibrant Purple - public, class, return, void */
  --syn-annotation: #ff7b72;    /* Vibrant Coral Red - @Transactional, @Entity, @Valid */
  --syn-type: #e5c07b;          /* Vibrant Gold/Amber - String, EntityManager, DTO */
  --syn-string: #98c379;        /* Vibrant Mint Green - "strings", 'chars' */
  --syn-function: #61afef;      /* Vibrant Sky Blue - methods, functions */
  --syn-comment: #768390;       /* Readable Slate Gray - comments */
  --syn-number: #d19a66;        /* Vibrant Orange - 123, 0.5 */
  --syn-tag: #ff7b72;           /* Vibrant Red/Pink - <bean>, <servlet>, <form:form> */
  --syn-attr: #79c0ff;          /* Vibrant Cyan - id=, class=, name=, path= */
  --syn-entity: #e5c07b;        /* Amber - &lt; &gt; */
  --syn-operator: #56b6c2;      /* Cyan - =, +, -, -> */
  --syn-property: #61afef;      /* Sky Blue - properties, keys */
  --syn-sql: #ff9e64;           /* Orange - SELECT, WHERE */
}

/* Clean High-Contrast Vibrant Light Theme */
body.light {
  --bg: #f8fafc;
  --bg-gradient: #f8fafc;
  --panel: #ffffff;
  --panel2: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #1e293b;             /* Crisp dark slate text */
  --text-bright: #0f172a;      /* Sharp black headings */
  --muted: #64748b;            /* Clean neutral slate gray */
  --border: #e2e8f0;           /* Subtle clean border */
  --line: #e2e8f0;
  --border-focus: #2563eb;
  --primary: #0f172a;          /* Dark button on white background */
  --primary-2: #334155;
  --primary-soft: #f1f5f9;
  --accent: #2563eb;           /* Vivid Royal Blue */
  --accent2: #7c3aed;          /* Vivid Violet */
  --cyan: #0284c7;             /* Rich Sky Blue */
  --purple: #7c3aed;           /* Rich Purple */
  --magenta: #9333ea;          /* Vivid Magenta */
  --green: #059669;            /* Rich Emerald Green */
  --success: #10b981;
  --yellow: #d97706;           /* Rich Amber */
  --warning: #f59e0b;
  --orange: #ea580c;           /* Vivid Orange */
  --danger: #dc2626;           /* Vivid Red */
  --blue: #2563eb;
  --code-bg: #1e1e2e;          /* Keep code sandbox dark so colorful syntax shines */
  --code-header: #181825;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);

  --syn-keyword: #c678dd;
  --syn-annotation: #ff7b72;
  --syn-type: #e5c07b;
  --syn-string: #98c379;
  --syn-function: #61afef;
  --syn-comment: #768390;
  --syn-number: #d19a66;
  --syn-tag: #ff7b72;
  --syn-attr: #79c0ff;
  --syn-entity: #e5c07b;
  --syn-operator: #56b6c2;
  --syn-property: #61afef;
  --syn-sql: #ff9e64;
}

/* ==========================================================================
   BASE & STRICT OVERFLOW PREVENTION (NO HORIZONTAL SCROLL)
   ========================================================================== */

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

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; /* Zero horizontal page spill */
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  text-decoration: underline;
}

.container, header .wrap, main, .page {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: clamp(16px, 3vw, 24px);
  padding-right: clamp(16px, 3vw, 24px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-bright);
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: -0.04em;
  margin-bottom: 14px;
}

h1 span {
  color: var(--purple);
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: -0.025em;
  margin-top: 0;
  margin-bottom: 14px;
}

h3 {
  font-size: 1.22rem;
  margin-top: 24px;
  margin-bottom: 10px;
  color: var(--text-bright);
}

p {
  margin-bottom: 14px;
  color: var(--text);
  word-break: break-word;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 18px;
}

ul, ol {
  margin: 0 0 16px 22px;
}

li {
  margin-bottom: 6px;
  word-break: break-word;
}

/* ==========================================================================
   UNIVERSAL GUIDE TOP BAR (STICKY NAV + HAMBURGER + THEME TOGGLE)
   ========================================================================== */

.guide-header-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.guide-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 24px);
}

.nav-actions-left, .nav-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hamburger Jump to Topic Trigger Button */
.jump-topic-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text-bright);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.jump-topic-btn:hover {
  border-color: var(--accent);
  background: var(--border);
  color: var(--accent);
}

.jump-topic-btn .hamburger-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 16px;
}

.jump-topic-btn .hamburger-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
}

/* ==========================================================================
   TOKYO NIGHT HAMBURGER TOPIC DRAWER (MOBILE-FIRST OFFCANVAS)
   ========================================================================== */

.topic-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 20000;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.topic-drawer-overlay.open {
  display: flex;
  opacity: 1;
}

.topic-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(420px, 92vw);
  background: #000000;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.9);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 20001;
}

.topic-drawer-overlay.open .topic-drawer {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: #000000;
}

.drawer-header h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s ease;
}

.drawer-close-btn:hover {
  background: #111111;
  color: #ffffff;
}

.drawer-search-wrap {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #000000;
}

.drawer-search-wrap input {
  width: 100%;
  padding: 10px 14px;
  background: #000000;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-bright);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.drawer-search-wrap input:focus {
  border-color: var(--accent);
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 3px;
  transition: all 0.15s ease;
}

.drawer-item:hover, .drawer-item.active {
  background: var(--panel2);
  color: var(--accent);
  text-decoration: none;
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}

.drawer-item .item-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--purple);
  padding: 2px 6px;
  background: rgba(187, 154, 247, 0.12);
  border-radius: 4px;
  flex-shrink: 0;
}

/* ==========================================================================
   HEADER, HERO & NAVIGATION
   ========================================================================== */

header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: clamp(24px, 4vw, 40px) 0;
}

header.hero-landing {
  min-height: 60vh;
  display: flex;
  align-items: center;
  padding: clamp(80px, 12vw, 110px) 0 clamp(40px, 6vw, 60px);
  background: var(--bg);
}

nav.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

body.light nav.landing-nav {
  background: var(--bg);
}

.nav-inner {
  width: 100%;
  max-width: var(--max);
  margin: auto;
  padding: 0 clamp(16px, 3vw, 24px);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.spring-logo-svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.logo:hover .spring-logo-svg {
  transform: rotate(12deg) scale(1.08);
}

.logo span b {
  color: #ffffff;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 999px;
  color: var(--text-bright);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 16px;
  box-shadow: none;
}

.subtitle {
  color: var(--text);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.75;
  max-width: 850px;
  margin-bottom: 18px;
}

.buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.button, .home-button, .theme-toggle, .add-page-btn, .hero-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-bright);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.button:hover, .home-button:hover, .theme-toggle:hover, .add-page-btn:hover, .hero-nav-button:hover {
  border-color: #444444;
  background: #111111;
  text-decoration: none;
  color: var(--text-bright);
}

.button.primary, .add-page-btn.primary, a.button.primary, button.button.primary {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #ffffff !important;
  font-weight: 600;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.button.primary:hover, .add-page-btn.primary:hover, a.button.primary:hover, button.button.primary:hover {
  background: #e4e4e7 !important;
  border-color: #e4e4e7 !important;
  color: #000000 !important;
}

/* Light Theme Button Overrides */
body.light .button,
body.light .home-button,
body.light .theme-toggle,
body.light .add-page-btn,
body.light .hero-nav-button {
  background: #ffffff;
  color: #18181b;
  border-color: #e4e4e7;
}

body.light .button:hover,
body.light .home-button:hover,
body.light .theme-toggle:hover,
body.light .add-page-btn:hover,
body.light .hero-nav-button:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
  color: #09090b;
}

body.light .button.primary,
body.light .add-page-btn.primary,
body.light a.button.primary,
body.light button.button.primary {
  background: #09090b !important;
  color: #ffffff !important;
  border: 1px solid #09090b !important;
}

body.light .button.primary:hover,
body.light .add-page-btn.primary:hover,
body.light a.button.primary:hover,
body.light button.button.primary:hover {
  background: #27272a !important;
  border-color: #27272a !important;
  color: #ffffff !important;
}

/* Badges & Chips */
.badge, .chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  margin: 3px 2px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--panel2);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  word-break: normal;
}

.chips, .tag-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ==========================================================================
   SEARCH BAR & ADD PAGE CONTROLS
   ========================================================================== */

.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-box input {
  width: 100%;
  padding: 8px 14px 8px 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-bright);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.2);
  background: var(--panel2);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 0.95rem;
}

/* ==========================================================================
   MODAL - ADD PAGE DIALOG (TOKYO NIGHT)
   ========================================================================== */

.page-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 16, 24, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.page-modal-overlay.open {
  display: flex;
}

.page-modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(520px, 100%);
  padding: clamp(20px, 4vw, 28px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  position: relative;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-bright);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.modal-close-btn:hover {
  background: var(--panel2);
  color: var(--danger);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 6px;
}

.form-group .hint {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 4px;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-bright);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Delete Card Button */
.card-delete-btn {
  position: absolute;
  top: 14px;
  right: 44px;
  background: rgba(247, 118, 142, 0.12);
  border: 1px solid rgba(247, 118, 142, 0.25);
  color: var(--danger);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transition: all 0.18s ease;
  z-index: 5;
}

a.card:hover .card-delete-btn {
  opacity: 1;
}

.card-delete-btn:hover {
  background: var(--danger);
  color: #1a1b26;
}

/* ==========================================================================
   MAIN CONTENT, GRIDS & SECTIONS
   ========================================================================== */

main {
  padding: 28px 0 80px;
  width: 100%;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.topic {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.topic h4 {
  color: var(--text-bright);
  font-size: 1.02rem;
  margin-bottom: 8px;
}

/* Cards */
.card, .section, .codefile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  width: 100%;
}

a.card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  color: var(--text-bright);
  box-shadow: var(--shadow-sm);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

a.card:hover {
  transform: none;
  border-color: #3f3f46;
  background: var(--panel2);
  text-decoration: none;
}

a.card .num {
  flex: 0 0 auto;
  color: var(--muted);
  font: 600 0.75rem/1.2 'JetBrains Mono', monospace;
  padding: 4px 8px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 6px;
}

a.card h3 {
  margin: 0 24px 6px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.015em;
}

a.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

a.card .file-tag {
  display: inline-block;
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}

a.card .arrow {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--muted);
  font-size: 1rem;
  transition: color 0.15s ease;
}

a.card:hover .arrow {
  color: var(--text-bright);
}

/* File label */
.file {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-bright);
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 3px 7px;
  border-radius: 6px;
  word-break: break-all;
}

/* Callouts & Alert Boxes (shadcn alert style) */
.memory, .warning, .callout, .note, .good, .callout.success, .callout.danger, .callout.interview {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 18px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid #71717a;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.65;
  word-break: break-word;
}

.memory { border-left-color: #fafafa; }
.warning, .callout.warning { border-left-color: #a1a1aa; }
.callout { border-left-color: #71717a; }
.note { border-left-color: #52525b; }
.good, .callout.success { border-left-color: #fafafa; }

.memory strong, .warning strong, .callout strong, .note strong, .good strong {
  color: var(--text-bright);
}

/* Responsive Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.88rem;
  background: var(--panel2);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: table;
}

@media (max-width: 768px) {
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--panel);
  color: var(--text-bright);
  font-weight: 700;
}

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

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Desktop Sidebar Nav for Two-Column Layout */
.layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px clamp(12px, 2vw, 24px);
}

nav.sidebar-nav {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

nav.sidebar-nav a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 2px;
  transition: all 0.15s ease;
}

nav.sidebar-nav a:hover, nav.sidebar-nav a.active {
  background: var(--panel2);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

/* Hide unstyled legacy select dropdown */
.mobile-bar {
  display: none !important;
}

.toc, .toc-inner {
  display: none !important; /* Replaced by modern Tokyo Night Drawer Navigation */
}

/* ==========================================================================
   VIBRANT COLORFUL CODE SANDBOX (TOKYO NIGHT)
   ========================================================================== */

code:not(pre code) {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-bright);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.86em;
  font-weight: 600;
  word-break: break-all;
}

.code-sandbox, .codefile, .code-wrap {
  position: relative;
  background: #000000 !important;
  border: 1px solid #2d2d2d;
  border-radius: var(--radius);
  margin: 18px 0;
  overflow: hidden;
  box-shadow: none;
  width: 100%;
  max-width: 100%;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #000000;
  border-bottom: 1px solid #2d2d2d;
  padding: 7px 12px;
  font-size: 0.78rem;
  user-select: none;
}

.code-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.code-dots {
  display: flex;
  gap: 5px;
}

.code-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0.85;
}

.code-dot.red { background: #f7768e; }
.code-dot.yellow { background: #e0af68; }
.code-dot.green { background: #9ece6a; }

.code-lang-badge {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(122, 162, 247, 0.15);
  color: var(--accent);
  border: 1px solid rgba(122, 162, 247, 0.3);
  text-transform: uppercase;
}

.code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1f2335;
  border: 1px solid #292e42;
  color: #c0caf5;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.code-copy-btn:hover {
  background: #24283b;
  border-color: #7aa2f7;
  color: #ffffff;
}

.code-copy-btn.copied {
  background: rgba(158, 206, 106, 0.2);
  border-color: var(--success);
  color: #9ece6a;
}

pre {
  background: var(--code-bg);
  padding: 16px 18px;
  margin: 0;
  overflow-x: auto;
  color: #c0caf5;
  font-size: 0.85rem;
  line-height: 1.6;
  tab-size: 4;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  scrollbar-width: thin;
  scrollbar-color: #292e42 #16161e;
  -webkit-overflow-scrolling: touch;
}

pre::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

pre::-webkit-scrollbar-track {
  background: #16161e;
}

pre::-webkit-scrollbar-thumb {
  background: #24283b;
  border-radius: 4px;
}

pre code {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  white-space: pre;
}

/* Syntax Highlighting Tokens */
.token.keyword, .token.boolean, .token.constant, .hljs-keyword, .hljs-literal, .kw {
  color: var(--syn-keyword) !important;
  font-weight: 600;
}

.token.annotation, .token.decorator, .hljs-meta, .ann {
  color: var(--syn-annotation) !important;
  font-weight: 600;
}

.token.class-name, .token.type, .hljs-type, .hljs-title.class_, .typ {
  color: var(--syn-type) !important;
  font-weight: 600;
}

.token.string, .token.char, .token.attr-value, .hljs-string, .str {
  color: var(--syn-string) !important;
}

.token.function, .token.method, .hljs-title.function_, .fn {
  color: var(--syn-function) !important;
}

.token.comment, .token.block-comment, .token.prolog, .token.doctype, .token.cdata, .hljs-comment, .com {
  color: var(--syn-comment) !important;
  font-style: italic;
}

.token.number, .hljs-number, .num-tok {
  color: var(--syn-number) !important;
}

.token.operator, .token.arrow, .hljs-operator, .op {
  color: var(--syn-operator) !important;
}

.token.tag, .token.tag .token.punctuation, .hljs-tag, .tag {
  color: var(--syn-tag) !important;
}

.token.attr-name, .hljs-attr, .attr {
  color: var(--syn-attr) !important;
}

.token.entity, .token.url, .hljs-symbol, .ent {
  color: var(--syn-entity) !important;
}

.token.property, .token.symbol, .hljs-property, .prop {
  color: var(--syn-property) !important;
}

.token.punctuation, .hljs-punctuation, .punc {
  color: #7982a9;
}

.token.sql-keyword, .sql-kw {
  color: var(--syn-sql) !important;
  font-weight: 700;
}

/* ==========================================================================
   CLEAN RESPONSIVE DIAGRAM CONTAINERS (NO TRAPPED MOUSE-DRAG)
   ========================================================================== */

.diagram, .diagram-wrap, pre.mermaid {
  position: relative;
  overflow-x: auto !important;
  max-width: 100%;
  border: 1px solid #2d2d2d;
  border-radius: var(--radius);
  background: #000000 !important;
  padding: 16px 18px 22px;
  margin: 20px 0;
  box-shadow: none;
  color: #ffffff !important;
  -webkit-overflow-scrolling: touch;
  cursor: default !important;
  scrollbar-width: thin;
  scrollbar-color: #222222 #000000;
  text-align: center;
}

.mermaid {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  width: 100%;
  min-height: 80px;
}

.diagram::-webkit-scrollbar, .diagram-wrap::-webkit-scrollbar, pre.mermaid::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.diagram::-webkit-scrollbar-track, .diagram-wrap::-webkit-scrollbar-track, pre.mermaid::-webkit-scrollbar-track {
  background: #000000;
}

.diagram::-webkit-scrollbar-thumb, .diagram-wrap::-webkit-scrollbar-thumb, pre.mermaid::-webkit-scrollbar-thumb {
  background: #222222;
  border-radius: 4px;
}

.diagram-ctrl-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.diagram-ctrl-bar .d-btn {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text-bright);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.15s ease;
}

.diagram-ctrl-bar .d-btn:hover {
  background: var(--border);
  border-color: var(--accent);
  color: #ffffff;
}

.diagram-ctrl-bar .d-btn.d-modal {
  background: rgba(187, 154, 247, 0.12);
  border-color: rgba(187, 154, 247, 0.35);
  color: var(--purple);
}

.diagram svg, .diagram-wrap svg, .mermaid svg, pre.mermaid svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  background: transparent !important;
}

.diagram, .diagram *, .diagram-wrap, .diagram-wrap *, .mermaid, .mermaid *, pre.mermaid, pre.mermaid * {
  color: #ffffff !important;
}

pre.mermaid text, pre.mermaid tspan, pre.mermaid .nodeLabel, pre.mermaid .label, pre.mermaid .node .label span, pre.mermaid foreignObject span {
  fill: #ffffff !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
}

pre.mermaid .edgeLabel, pre.mermaid .edgeLabel span, pre.mermaid .edgeLabel p {
  color: #ffffff !important;
  fill: #ffffff !important;
  background-color: #1f2335 !important;
  font-weight: 600 !important;
  font-size: 12.5px !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  border: 1px solid #292e42 !important;
}

pre.mermaid .edgeLabel rect {
  fill: #1f2335 !important;
  stroke: #292e42 !important;
  rx: 6px !important;
  ry: 6px !important;
}

pre.mermaid .node rect, pre.mermaid .node circle, pre.mermaid .node polygon, pre.mermaid .node path {
  fill: #1f2335 !important;
  stroke: #3b4261 !important;
  stroke-width: 1.5px !important;
}

pre.mermaid .edgePath .path, pre.mermaid .flowchart-link {
  stroke: #7aa2f7 !important;
  stroke-width: 1.5px !important;
}

pre.mermaid marker path, pre.mermaid marker polygon {
  fill: #7aa2f7 !important;
  stroke: #7aa2f7 !important;
}

/* Diagram Fullscreen Modal */
#diagram-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 16, 24, 0.95);
  backdrop-filter: blur(16px);
  align-items: center;
  justify-content: center;
  padding: 12px;
}

#diagram-modal.open {
  display: flex;
}

#diagram-modal .modal-backdrop {
  position: absolute;
  inset: 0;
}

#diagram-modal .modal-box {
  position: relative;
  width: 96vw;
  height: 94vh;
  background: #16161e;
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95);
  z-index: 2;
}

#diagram-modal .modal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #1a1b26;
}

#diagram-modal .modal-title {
  color: var(--text-bright);
  font-weight: 700;
  font-size: 13.5px;
}

#diagram-modal .modal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

#diagram-modal .m-btn {
  background: #1f2335;
  border: 1px solid #292e42;
  color: #c0caf5;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

#diagram-modal .m-btn:hover {
  background: #24283b;
  border-color: #7aa2f7;
}

#diagram-modal .m-btn.m-close {
  background: rgba(247, 118, 142, 0.15);
  border-color: rgba(247, 118, 142, 0.3);
  color: var(--danger);
}

#diagram-modal .modal-view {
  flex: 1;
  overflow: auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-overflow-scrolling: touch;
}

#diagram-modal .modal-stage svg {
  max-width: none !important;
  height: auto !important;
  min-width: 600px;
}

/* ==========================================================================
   FOOTER & BACK TO TOP
   ========================================================================== */

footer {
  padding: 35px 20px 50px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  background: var(--panel);
}

.top, .back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  color: var(--text-bright);
  text-decoration: none;
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
  z-index: 999;
  cursor: pointer;
}

.top:hover, .back-top:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--panel);
  color: var(--text-bright);
}

/* ==========================================================================
   MOBILE RESPONSIVE BREAKPOINTS (NO HORIZONTAL SPILL)
   ========================================================================== */

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 16px 12px;
  }

  nav.sidebar-nav {
    display: none !important; /* On mobile/tablet, replaced by Tokyo Night Drawer */
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  header.hero-landing {
    min-height: auto;
    padding: 85px 0 35px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .section, .codefile, .card {
    padding: 16px 12px;
    border-radius: 11px;
  }

  .code-sandbox pre {
    padding: 12px 10px;
    font-size: 0.8rem;
  }

  .button, .home-button, .theme-toggle, .add-page-btn, .hero-nav-button {
    padding: 8px 12px;
    font-size: 0.82rem;
  }
}

/* ==========================================================================
   SEGMENTED STUDY/INTERVIEW SWITCHER & FORMS EXTENSIONS
   ========================================================================== */
.content-switcher {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 480px);
  margin: 16px auto 28px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel2);
}

.switch-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
}

.content-switcher.interview-active .switch-indicator {
  transform: translateX(100%);
  background: var(--panel);
  border-color: var(--border);
}

.switch-btn {
  position: relative;
  z-index: 1;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.15s ease;
  padding: 6px 12px;
}

.switch-btn.active {
  color: var(--text-bright);
}

.content-panel {
  display: none;
  animation: panelFadeIn 0.22s ease;
}

.content-panel.active {
  display: block;
}

@keyframes panelFadeIn {
  from { opacity: 0.2; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.flow-item {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
  text-align: center;
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.9rem;
}

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

.memory-item {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px;
}

.memory-item b {
  color: var(--cyan);
}

.question {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 14px;
  padding: 16px;
  margin: 14px 0;
}

.question .q {
  color: var(--text-bright);
  font-weight: 700;
  font-size: 0.98rem;
}

.answer {
  margin-top: 8px;
  padding-left: 14px;
  border-left: 3px solid var(--green);
  color: var(--muted);
  font-size: 0.92rem;
}

.answer strong {
  color: var(--green);
}

/* ==========================================================================
   PAGINATION CONTROLS (TOKYO NIGHT)
   ========================================================================== */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
  gap: 14px;
}

.pagination-info {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}

.pagination-info strong {
  color: var(--text-bright);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(122, 162, 247, 0.15);
  color: var(--text-bright);
  transform: translateY(-1px);
}

.pagination-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1b26;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(122, 162, 247, 0.4);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   GLOBAL LAYMAN CONCEPT GUIDES UI SYSTEM (TOKYO NIGHT & TOKYO DAY)
   ========================================================================== */

.concept-hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.concept-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 80% 20%, rgba(100, 255, 180, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 20% 80%, rgba(121, 192, 255, 0.07) 0%, transparent 60%);
  pointer-events: none;
}

body.light .concept-hero::before {
  background:
    radial-gradient(ellipse 70% 60% at 80% 20%, rgba(5, 150, 105, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 20% 80%, rgba(37, 99, 235, 0.06) 0%, transparent 60%);
}

.concept-hero .hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 32px) 40px;
  position: relative;
  z-index: 1;
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.home-btn, .hero-top-row .home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.home-btn:hover, .hero-top-row .home-btn:hover {
  background: var(--border);
  color: var(--text-bright);
  border-color: var(--border-focus);
  transform: translateY(-1px);
  text-decoration: none;
}

.chapter-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  background: rgba(100, 255, 180, 0.1);
  border: 1px solid rgba(100, 255, 180, 0.25);
  padding: 4px 12px;
  border-radius: 100px;
}

body.light .chapter-tag {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.25);
}

.concept-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-bright);
  margin-bottom: 14px;
  line-height: 1.15;
}

.concept-hero h1 .accent {
  color: var(--green);
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--muted);
  max-width: 680px;
  line-height: 1.7;
  margin-bottom: 28px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.hbadge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--panel2);
  transition: all 0.18s ease;
}

.hbadge.green {
  color: var(--green);
  border-color: rgba(100, 255, 180, 0.35);
  background: rgba(100, 255, 180, 0.08);
}

.hbadge.blue {
  color: var(--blue);
  border-color: rgba(121, 192, 255, 0.35);
  background: rgba(121, 192, 255, 0.08);
}

.hbadge.purple {
  color: var(--purple);
  border-color: rgba(210, 168, 255, 0.35);
  background: rgba(210, 168, 255, 0.08);
}

.hbadge.orange {
  color: var(--warning);
  border-color: rgba(255, 166, 87, 0.35);
  background: rgba(255, 166, 87, 0.08);
}

.hbadge.red {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.08);
}

.hero-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.hero-flow .step {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text-bright);
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 600;
}

.hero-flow .arrow {
  color: var(--green);
  font-size: 1rem;
  font-weight: 700;
}

.page-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px clamp(16px, 3vw, 32px) 80px;
}

.concept-section {
  margin-bottom: 56px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--green);
  background: rgba(100, 255, 180, 0.08);
  border: 1px solid rgba(100, 255, 180, 0.2);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.tagline {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 24px;
  font-style: italic;
}

.ccard {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 16px;
  transition: border-color 0.2s ease, transform 0.18s ease;
}

.ccard:hover {
  border-color: var(--border-focus);
}

.ccard h3 {
  font-size: 1.05rem;
  color: var(--text-bright);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ccard h3 .icon {
  font-size: 1.3rem;
}

.ccard p {
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

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

.ccard ul {
  padding-left: 1.2em;
  margin: 6px 0;
}

.ccard ul li {
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 5px;
}

.analogy-box {
  background: rgba(100, 255, 180, 0.05);
  border: 1px solid rgba(100, 255, 180, 0.25);
  border-left: 4px solid var(--green);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 18px 0;
}

body.light .analogy-box {
  background: rgba(5, 150, 105, 0.06);
  border-color: rgba(5, 150, 105, 0.25);
}

.analogy-box .analogy-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 6px;
}

.analogy-box p {
  color: var(--text);
  font-size: 0.95rem;
  margin: 0;
}

.trap-box {
  background: rgba(255, 107, 107, 0.06);
  border: 1px solid rgba(255, 107, 107, 0.25);
  border-left: 4px solid var(--danger);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 18px 0;
}

body.light .trap-box {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.25);
}

.trap-box .trap-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--danger);
  margin-bottom: 6px;
}

.trap-box p {
  color: var(--text);
  font-size: 0.95rem;
  margin: 0;
}

.key-box {
  background: rgba(121, 192, 255, 0.05);
  border: 1px solid rgba(121, 192, 255, 0.25);
  border-left: 4px solid var(--blue);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 18px 0;
}

body.light .key-box {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.25);
}

.key-box p {
  color: var(--text);
  font-size: 0.95rem;
  margin: 0;
}

.state-box {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  transition: all 0.2s ease;
}

.state-box .state-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.state-box p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.state-box.new .state-name {
  color: var(--warning);
}

.state-box.managed .state-name {
  color: var(--green);
}

.state-box.detached .state-name {
  color: var(--blue);
}

.state-box.removed .state-name {
  color: var(--danger);
}

.concept-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9rem;
}

.concept-table th {
  background: rgba(100, 255, 180, 0.08);
  color: var(--green);
  font-weight: 700;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(100, 255, 180, 0.25);
}

body.light .concept-table th {
  background: #f1f5f9;
  color: var(--green);
  border-bottom: 2px solid #cbd5e1;
}

.concept-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.concept-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

body.light .concept-table tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

.concept-table code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--blue);
  font-size: 0.85em;
}

.qa-block {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
}

.qa-q {
  padding: 14px 18px;
  font-weight: 600;
  color: var(--purple);
  font-size: 0.95rem;
  cursor: default;
  border-bottom: 1px solid var(--border);
}

.qa-q::before {
  content: 'Q: ';
  color: var(--muted);
  font-weight: 400;
}

.qa-a {
  padding: 14px 18px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.7;
}

.qa-a::before {
  content: 'A: ';
  color: var(--green);
  font-weight: 700;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.memory-card {
  background: rgba(210, 168, 255, 0.05);
  border: 1px solid rgba(210, 168, 255, 0.15);
  border-radius: 10px;
  padding: 16px;
}

body.light .memory-card {
  background: #f8fafc;
  border-color: rgba(124, 58, 237, 0.2);
}

.memory-card .mc-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 6px;
}

.memory-card .mc-val {
  font-size: 0.88rem;
  color: var(--text-bright);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.6;
}

.toc-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 40px;
  padding: 18px 20px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.toc-bar a {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.toc-bar a:hover {
  color: var(--text-bright);
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

body.light .toc-bar a:hover {
  background: rgba(0, 0, 0, 0.05);
}

.back-top {
  text-align: center;
  margin-top: 40px;
}

.back-top a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.back-top a:hover {
  color: var(--text-bright);
  border-color: var(--border-focus);
  text-decoration: none;
}

.prop-card {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}

.prop-card .prop-name {
  font-size: 0.88rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--purple);
  margin-bottom: 6px;
}

.prop-card .prop-exists {
  font-size: 0.8rem;
  color: var(--green);
  margin-bottom: 2px;
}

.prop-card .prop-none {
  font-size: 0.8rem;
  color: var(--warning);
  margin-bottom: 4px;
}

.prop-card p {
  font-size: 0.85rem;
  color: var(--text);
  margin: 4px 0 0;
}

.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: #e0e0e0;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.7;
  white-space: pre;
}

.code-block .kw  { color: var(--syn-keyword); }
.code-block .ann { color: var(--syn-annotation); }
.code-block .str { color: var(--syn-string); }
.code-block .cmt { color: var(--syn-comment); }
.code-block .cls { color: var(--syn-type); }
.code-block .fn  { color: var(--syn-function); }
.code-block .num { color: var(--syn-number); }
.code-block .tag { color: var(--syn-tag); }
.code-block .attr{ color: var(--syn-attr); }

.interview-answer {
  background: rgba(100, 255, 180, 0.05);
  border: 1px solid rgba(100, 255, 180, 0.2);
  border-left: 4px solid var(--green);
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  border-radius: 8px;
}

.interview-answer strong {
  color: var(--green);
  display: block;
  margin-bottom: 0.5rem;
}

.interview-answer p {
  color: var(--text);
  margin: 0.25rem 0;
}

.eli5-card {
  background: var(--panel2);
  border: 1px solid rgba(121, 192, 255, 0.25) !important;
  border-radius: 12px;
}

.eli5-card h3 {
  color: var(--blue);
}

.cheat-sheet {
  background: rgba(210, 168, 255, 0.06);
  border: 1px solid rgba(210, 168, 255, 0.2);
  padding: 1.5rem;
  border-radius: 10px;
  margin: 1.5rem 0;
}

.cheat-sheet h3 {
  margin-top: 0;
  color: var(--purple);
  font-size: 1.05rem;
}

.cheat-sheet p {
  color: var(--text);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
}

