/* Light Theme (Default) */
:root {
  /* Light theme colors */
  --color-bg: #e9eff3;
  --color-bg-light: #f6f8fa;
  --color-surface: #ffffff;
  --color-header: #1f2a33;
  --color-sidebar: #f4f7f9;
  --color-accent: #1bb39a;
  --color-accent-soft: rgba(27, 179, 154, 0.12);
  --color-accent-hover: #16a085;
  --color-border: #d3dde6;
  --color-text: #1f2933;
  --color-text-muted: #6b7a8a;
  --color-text-soft: #9ca3af;
  --shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.12);
  --shadow-medium: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 20px 50px rgba(15, 23, 42, 0.15);
  --shadow-deep: 0 24px 80px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 0 1px rgba(27, 179, 154, 0.3), 0 0 20px rgba(27, 179, 154, 0.2);
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;
  --transition-fast: 0.15s ease;
  --transition-medium: 0.25s ease;
  
  /* Background gradients */
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e9eff3 50%, #dde5ee 100%);
  --header-gradient: linear-gradient(135deg, #1f2a33 0%, #2a3a47 100%);
  --card-gradient: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
  --sidebar-gradient: rgba(255, 255, 255, 0.95);
  --code-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Dark Theme */
[data-theme="dark"] {
  --color-bg: #0b1720;
  --color-bg-light: #060b10;
  --color-surface: #0f1924;
  --color-header: #050b10;
  --color-sidebar: #0d1720;
  --color-accent: #0F9E87;
  --color-accent-soft: rgba(15, 158, 135, 0.18);
  --color-accent-hover: #0d8a75;
  --color-border: #1f2933;
  --color-text: #e5e7eb;
  --color-text-muted: #6b7280;
  --color-text-soft: #9ca3af;
  --shadow-soft: 0 14px 30px rgba(0, 0, 0, 0.5);
  --shadow-medium: 0 8px 20px rgba(0, 0, 0, 0.4);
  --shadow-strong: 0 20px 50px rgba(0, 0, 0, 0.7);
  --shadow-deep: 0 24px 80px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 0 1px rgba(15, 158, 135, 0.5), 0 0 40px rgba(15, 158, 135, 0.45);
  
  --bg-gradient: radial-gradient(circle at top left, #0f172a 0, #020617 38%, #020617 55%, #020617 100%);
  --header-gradient: linear-gradient(135deg, #020617 0%, #020617 40%, #04141c 70%, #071f28 100%);
  --card-gradient: radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.9), #020617 80%);
  --sidebar-gradient: radial-gradient(circle at top left, #111827, #020617 65%);
  --code-bg: radial-gradient(circle at top left, #020617, #020617 45%, #020617 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  transition: background var(--transition-medium), color var(--transition-medium);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: 64px;
  background: var(--header-gradient);
  color: #f9fafb;
  display: flex;
  align-items: center;
  padding: 0 28px;
  box-shadow: var(--shadow-soft);
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1000 !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.3);
  transition: background var(--transition-medium), box-shadow var(--transition-medium);
  box-sizing: border-box;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

[data-theme="dark"] .app-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
}

.app-header__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #facc15 0%, #fbbf24 100%);
  color: #111827;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 20px;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(250, 204, 21, 0.3);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

[data-theme="dark"] .app-header__logo {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
}

.app-header__logo:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.4);
}

[data-theme="dark"] .app-header__logo:hover {
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85);
}

.app-header__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-right: auto;
  letter-spacing: -0.01em;
}

.app-header__status {
  display: flex;
  align-items: center;
  margin-right: 48px;
}

.app-header__status .doc-label {
  margin: 0;
  font-size: 0.75rem;
  padding: 4px 12px;
  background: rgba(15, 158, 135, 0.12) !important;
  color: #a7f3d0 !important;
  border: 1px solid rgba(45, 212, 191, 0.7) !important;
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.45) !important;
}

/* Keep online indicator styling consistent in both themes */
[data-theme="dark"] .app-header__status .doc-label {
  background: rgba(15, 158, 135, 0.12) !important;
  color: #a7f3d0 !important;
  border: 1px solid rgba(45, 212, 191, 0.7) !important;
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.45) !important;
}

.app-header__badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(148, 163, 184, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #e5e7eb;
  font-weight: 500;
  margin-right: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-block;
}

.app-header__badge:hover {
  background: rgba(148, 163, 184, 0.3);
  border-color: rgba(148, 163, 184, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .app-header__badge {
  background: rgba(15, 158, 135, 0.15);
}

/* Theme Toggle Button */
.theme-toggle {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-pill);
  color: #e5e7eb;
  cursor: pointer;
  padding: 8px 14px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  width: 40px;
  height: 40px;
}

.theme-toggle:hover {
  background: rgba(148, 163, 184, 0.25);
  transform: scale(1.05);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(15, 158, 135, 0.2);
  border-color: rgba(15, 158, 135, 0.4);
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(15, 158, 135, 0.3);
}

.app-main {
  flex: 1;
  display: flex;
  padding: 24px;
  padding-top: 88px;
  gap: 4px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.sidebar {
  width: 280px;
  background: var(--sidebar-gradient);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  padding: 20px 16px;
  box-shadow: var(--shadow-medium);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 88px;
  align-self: flex-start;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  transition: background var(--transition-medium), border-color var(--transition-medium), box-shadow var(--transition-medium);
}

[data-theme="dark"] .sidebar {
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.sidebar:hover {
  box-shadow: var(--shadow-soft);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.5);
}

[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 0.7);
}

.sidebar__section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin: 0 4px 12px;
  font-weight: 600;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
}

.sidebar-nav__item {
  margin-bottom: 8px;
}

.sidebar-nav__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-nav__link::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 999px;
  background: transparent;
  margin-right: 2px;
  transition: background var(--transition-fast);
}

.sidebar-nav__link--depth-1 {
  padding-left: 20px;
}

.sidebar-nav__link--depth-2 {
  padding-left: 32px;
  font-size: 0.82rem;
}

/* Collection item - styled as bubble container */
.sidebar-nav__item:has(.sidebar-nav__link--collection) {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  box-shadow: var(--shadow-medium);
  margin-bottom: 8px;
  transition: all var(--transition-medium);
}

[data-theme="dark"] .sidebar-nav__item:has(.sidebar-nav__link--collection) {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(55, 65, 81, 0.5);
}

.sidebar-nav__item:has(.sidebar-nav__link--collection):hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

[data-theme="dark"] .sidebar-nav__item:has(.sidebar-nav__link--collection):hover {
  background: rgba(15, 23, 42, 0.8);
}

.sidebar-nav__item:has(.sidebar-nav__link--collection.is-active) {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-medium);
}

[data-theme="dark"] .sidebar-nav__item:has(.sidebar-nav__link--collection.is-active) {
  background: radial-gradient(circle at top left, rgba(15, 158, 135, 0.35), rgba(15, 23, 42, 0.9));
  border-color: rgba(15, 158, 135, 0.7);
  box-shadow: var(--shadow-glow);
}

/* Collection links - styled as bubbles */
.sidebar-nav__link--collection {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  margin-bottom: 0;
  font-weight: 600;
}

.sidebar-nav__link--collection::before {
  display: none;
}

.sidebar-nav__link--collection:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
  color: var(--color-text);
}

[data-theme="dark"] .sidebar-nav__link--collection {
  background: transparent;
  border: none;
}

[data-theme="dark"] .sidebar-nav__link--collection:hover {
  background: transparent;
  box-shadow: none;
}

.sidebar-nav__link--collection.is-active {
  background: transparent;
  border: none;
  color: var(--color-text);
  font-weight: 600;
  box-shadow: none;
}

[data-theme="dark"] .sidebar-nav__link--collection.is-active {
  background: transparent;
  border: none;
  color: #ecfeff;
  box-shadow: none;
}

/* Nested tools list - inside the bubble */
.sidebar-nav__tools {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
}

.sidebar-nav__item--tool {
  margin-bottom: 4px;
}

/* Tool links - nested under collections */
.sidebar-nav__link--tool {
  padding: 4px 8px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  border-radius: 6px;
}

.sidebar-nav__link--tool::before {
  display: none;
}

.sidebar-nav__link--tool:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--color-text);
  transform: translateX(2px);
}

[data-theme="dark"] .sidebar-nav__link--tool:hover {
  background: rgba(31, 41, 55, 0.6);
}

.sidebar-nav__link--tool.is-active {
  background: rgba(27, 179, 154, 0.15);
  color: var(--color-accent);
  font-weight: 500;
}

[data-theme="dark"] .sidebar-nav__link--tool.is-active {
  background: rgba(15, 158, 135, 0.25);
  color: #67e8f9;
}

.sidebar-nav__link:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--color-text);
  transform: translateX(2px);
}

[data-theme="dark"] .sidebar-nav__link:hover {
  background: rgba(31, 41, 55, 0.85);
}

.sidebar-nav__link.is-active {
  background: var(--color-accent-soft);
  color: var(--color-text);
  font-weight: 600;
}

[data-theme="dark"] .sidebar-nav__link.is-active {
  background: radial-gradient(circle at top left, rgba(15, 158, 135, 0.42), rgba(15, 23, 42, 0.96));
  color: #ecfeff;
  box-shadow: var(--shadow-glow);
}

.sidebar-nav__link.is-active::before {
  background: var(--color-accent);
}

.sidebar-nav__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.6);
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

[data-theme="dark"] .sidebar-nav__dot {
  background: rgba(148, 163, 184, 0.9);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.75);
}

.sidebar-nav__link.is-active .sidebar-nav__dot {
  background: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-soft);
}

[data-theme="dark"] .sidebar-nav__link.is-active .sidebar-nav__dot {
  background: #a7f3d0;
  box-shadow: 0 0 0 1px rgba(15, 158, 135, 0.9), 0 0 18px rgba(34, 197, 94, 0.7);
}

.app-content-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
}

.app-content-card {
  width: 100%;
  max-width: 1000px;
  background: var(--card-gradient);
  border-radius: 24px;
  padding: 32px 40px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
  overflow: hidden;
  transition: background var(--transition-medium), border-color var(--transition-medium), box-shadow var(--transition-medium);
}

[data-theme="dark"] .app-content-card {
  border: 1px solid rgba(30, 64, 175, 0.4);
}

.app-content-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(27, 179, 154, 0.04), transparent 50%, rgba(59, 130, 246, 0.03));
  pointer-events: none;
}

[data-theme="dark"] .app-content-card::before {
  background: transparent;
  opacity: 1;
  mix-blend-mode: normal;
}

.app-content-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  background: transparent;
  opacity: 0;
}

.app-content-inner {
  position: relative;
  z-index: 1;
  background: transparent;
  border-radius: 18px;
  padding: 0;
}

[data-theme="dark"] .app-content-inner {
  background: transparent;
  padding: 0;
  border: none;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid rgba(226, 232, 240, 0.8);
  transition: border-color var(--transition-medium);
}

[data-theme="dark"] .doc-header {
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.doc-header__title-block h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.03em;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: background var(--transition-medium);
}

[data-theme="dark"] .doc-header__title-block h1 {
  color: #e5e7eb;
  -webkit-text-fill-color: #e5e7eb;
  background: none;
}

.doc-header__title-block p {
  margin: 8px 0 0;
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  transition: color var(--transition-medium);
}

[data-theme="dark"] .doc-header__title-block p {
  color: var(--color-text-soft);
}

.doc-header__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  transition: color var(--transition-medium);
}

.doc-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(15, 158, 135, 0.12) !important;
  color: #a7f3d0 !important;
  border: 1px solid rgba(45, 212, 191, 0.7) !important;
  font-weight: 600;
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.45) !important;
  transition: all var(--transition-medium);
}

/* Keep online indicator styling consistent in both themes */
[data-theme="dark"] .doc-label {
  background: rgba(15, 158, 135, 0.12) !important;
  color: #a7f3d0 !important;
  border: 1px solid rgba(45, 212, 191, 0.7) !important;
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.45) !important;
}

.doc-label__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e !important;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8) !important;
  animation: pulse 2s infinite;
}

/* Keep dot styling consistent in both themes */
[data-theme="dark"] .doc-label__dot {
  background: #22c55e !important;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8) !important;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.doc-updated {
  opacity: 0.85;
}

.doc-tag-badge {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.08);
  font-weight: 500;
  transition: all var(--transition-medium);
}

[data-theme="dark"] .doc-tag-badge {
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.9);
}

#main-content h1,
#main-content h2,
#main-content h3,
#main-content h4 {
  scroll-margin-top: 100px;
  color: var(--color-text);
  transition: color var(--transition-medium);
}

#main-content h1 {
  font-size: 1.75rem;
  margin-top: 2em;
  margin-bottom: 0.5em;
  border-bottom: 2px solid rgba(209, 213, 219, 0.6);
  padding-bottom: 0.5em;
  font-weight: 700;
}

[data-theme="dark"] #main-content h1 {
  border-bottom: 1px solid rgba(55, 65, 81, 0.9);
}

#main-content h2 {
  font-size: 1.4rem;
  margin-top: 2em;
  margin-bottom: 0.75em;
  font-weight: 600;
}

#main-content h3 {
  font-size: 1.15rem;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
}

#main-content p {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.7;
  margin: 1em 0;
  transition: color var(--transition-medium);
}

#main-content strong {
  color: var(--color-text);
  font-weight: 600;
}

[data-theme="dark"] #main-content strong {
  color: #fef08a;
}

#main-content em {
  font-style: italic;
}

[data-theme="dark"] #main-content em {
  color: #93c5fd;
}

#main-content a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(27, 179, 154, 0.4);
  transition: all var(--transition-fast);
  font-weight: 500;
}

[data-theme="dark"] #main-content a {
  color: #67e8f9;
  border-bottom-color: rgba(103, 232, 249, 0.55);
}

#main-content a:hover {
  color: var(--color-accent-hover);
  border-bottom-style: solid;
  border-bottom-color: var(--color-accent);
}

[data-theme="dark"] #main-content a:hover {
  border-bottom-style: solid;
}

#main-content hr {
  border: none;
  border-top: 2px solid rgba(209, 213, 219, 0.5);
  margin: 2.5em 0;
  border-radius: 2px;
  transition: border-color var(--transition-medium);
}

[data-theme="dark"] #main-content hr {
  border-top-color: rgba(55, 65, 81, 0.7);
}

/* Section Container - wraps each tool category */
.section-container {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  padding: 7px 8px;
  margin: 2.5em 0;
  box-shadow: var(--shadow-medium);
  transition: all var(--transition-medium);
}

[data-theme="dark"] .section-container {
  background: var(--color-surface);
  border: 1px solid rgba(55, 65, 81, 0.6);
  box-shadow: var(--shadow-soft);
}

.section-container:hover {
  box-shadow: var(--shadow-soft);
}

.section-container > h2 {
  margin-top: 0;
  margin-bottom: 0.1em;
  padding-bottom: 0.1em;
  border-bottom: 2px solid var(--color-border);
}

[data-theme="dark"] .section-container > h2 {
  border-bottom-color: rgba(55, 65, 81, 0.6);
}

/* Tool Card - wraps each individual tool */
.tool-card {
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 6px 7px;
  margin: 0.375em 0;
  box-shadow: var(--shadow-medium);
  transition: all var(--transition-medium);
}

.section-container > .tool-card:first-of-type {
  margin-top: 0.1em;
}

[data-theme="dark"] .tool-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(55, 65, 81, 0.5);
}

.tool-card:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.tool-card > h3 {
  margin-top: 0;
  margin-bottom: 0.4em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--color-border);
}

[data-theme="dark"] .tool-card > h3 {
  border-bottom-color: rgba(55, 65, 81, 0.5);
}

.tool-card hr {
  display: none;
}

#main-content ul,
#main-content ol {
  font-size: 0.95rem;
  padding-left: 1.5rem;
  line-height: 1.8;
  margin: 1em 0;
}

#main-content li {
  margin: 0.5em 0;
  color: var(--color-text);
  transition: color var(--transition-medium);
}

#main-content code {
  font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Code", "Droid Sans Mono", "Source Code Pro", monospace;
  font-size: 0.85rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.04));
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #1e293b;
  font-weight: 500;
  transition: all var(--transition-medium);
}

[data-theme="dark"] #main-content code {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
}

#main-content pre {
  background: var(--code-bg);
  border-radius: 14px;
  padding: 20px 24px;
  font-size: 0.85rem;
  overflow-x: auto;
  color: #e2e8f0;
  border: 1px solid rgba(15, 23, 42, 0.9);
  box-shadow: var(--shadow-strong);
  position: relative;
  margin: 1.5em 0;
  transition: all var(--transition-medium);
}

[data-theme="dark"] #main-content pre {
  border: 1px solid rgba(30, 64, 175, 0.85);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(15, 23, 42, 1);
}

#main-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-weight: 400;
}

.code-header {
  position: absolute;
  inset: 0 0 auto;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 14px;
  gap: 8px;
  background: linear-gradient(to right, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85));
  border-radius: 14px 14px 0 0;
}

[data-theme="dark"] .code-header {
  background: linear-gradient(to right, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.8));
}

.code-header__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #f97373;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.code-header__dot:nth-child(2) {
  background: #facc15;
}

.code-header__dot:nth-child(3) {
  background: #22c55e;
}

pre[data-has-header="true"] {
  padding-top: 40px;
}

#main-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
  background: var(--color-surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-medium);
  transition: all var(--transition-medium);
}

#main-content th,
#main-content td {
  border: 1px solid rgba(209, 213, 219, 0.6);
  padding: 12px 16px;
  text-align: left;
  transition: border-color var(--transition-medium);
}

[data-theme="dark"] #main-content th,
[data-theme="dark"] #main-content td {
  border: 1px solid rgba(55, 65, 81, 0.9);
}

#main-content th {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(148, 163, 184, 0.1));
  font-weight: 600;
  color: var(--color-text);
  transition: all var(--transition-medium);
}

[data-theme="dark"] #main-content th {
  background: radial-gradient(circle at top left, rgba(15, 158, 135, 0.35), rgba(15, 23, 42, 0.95));
}

#main-content tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.5);
}

[data-theme="dark"] #main-content tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.3);
}

.callout {
  border-radius: 14px;
  padding: 16px 20px;
  margin: 1.5em 0;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(248, 250, 252, 0.95);
  font-size: 0.9rem;
  box-shadow: var(--shadow-medium);
  transition: all var(--transition-medium);
}

[data-theme="dark"] .callout {
  border: 1px solid rgba(75, 85, 99, 0.9);
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
}

.callout--info {
  border-color: rgba(59, 130, 246, 0.6);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.04));
}

[data-theme="dark"] .callout--info {
  border-color: rgba(56, 189, 248, 0.9);
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 0.98));
}

.callout--success {
  border-color: rgba(34, 197, 94, 0.6);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(34, 197, 94, 0.04));
}

[data-theme="dark"] .callout--success {
  border-color: rgba(34, 197, 94, 0.9);
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), rgba(15, 23, 42, 0.98));
}

.callout__label {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
  color: var(--color-text-muted);
  transition: color var(--transition-medium);
}

[data-theme="dark"] .callout__label {
  color: var(--color-text-soft);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #f9fafb;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  margin-right: 16px;
  transition: transform var(--transition-fast);
}

.mobile-menu-toggle:hover {
  transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .app-main {
    padding: 20px;
    padding-top: 84px;
    gap: 20px;
  }
  
  .sidebar {
    width: 240px;
  }
  
  .app-content-card {
    padding: 28px 32px;
  }
}

@media (max-width: 960px) {
  .app-main {
    flex-direction: column;
    padding: 16px;
    padding-top: 80px;
  }
  
  .sidebar {
    position: static;
    max-height: none;
    width: 100%;
    display: none;
    border-radius: 16px;
  }
  
  .sidebar.is-open {
    display: block;
  }
  
  .app-content-card {
    padding: 24px 20px;
    border-radius: 20px;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .doc-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .doc-header__meta {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 0 16px;
    height: 56px;
  }
  
  .app-header__logo {
    font-size: 0.75rem;
    padding: 5px 10px;
    margin-right: 12px;
  }
  
  .app-header__title {
    font-size: 0.9rem;
  }
  
  .app-content-card {
    padding: 20px 16px;
    border-radius: 16px;
  }
  
  .doc-header__title-block h1 {
    font-size: 1.5rem;
  }
  
  #main-content h1 {
    font-size: 1.5rem;
  }
  
  #main-content h2 {
    font-size: 1.25rem;
  }
  
  #main-content h3 {
    font-size: 1.1rem;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection styling */
::selection {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

::-moz-selection {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

/* Workflow step styling */
.workflow-step {
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1rem 1.25rem;
  margin: 1em 0;
  box-shadow: var(--shadow-medium);
  transition: all var(--transition-medium);
}

[data-theme="dark"] .workflow-step {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(55, 65, 81, 0.5);
}

.workflow-step > p {
  margin-top: 0;
  margin-bottom: 0.75em;
  font-weight: 600;
  color: var(--color-text);
}

.workflow-step ul {
  margin-bottom: 0;
}

/* Mistake card styling */
.mistake-card {
  background: var(--color-bg-light);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--color-accent);
  padding: 1rem 1.25rem;
  margin: 1em 0;
  box-shadow: var(--shadow-medium);
}

[data-theme="dark"] .mistake-card {
  background: rgba(15, 23, 42, 0.4);
  border-left-color: var(--color-accent);
}

.mistake-card > p {
  margin: 0.5em 0;
}

.mistake-card > p:first-child {
  margin-top: 0;
}

.mistake-card > p:last-child {
  margin-bottom: 0;
}
