:root {
  --mint-50: #effaf6;
  --mint-100: #d7f2e9;
  --mint-300: #7fe1c9;
  --mint-500: #28c5a5;
  --mint-600: #17a98d;
  --teal-700: #0f7b6a;
  --teal-900: #172f2a;
  --lime-100: #dff2cf;
  --yellow-100: #fff1bd;
  --yellow-700: #8d6800;
  --red-100: #ffe0dc;
  --red-700: #a13a2f;
  --canvas: #dfecea;
  --surface: #f7fbf9;
  --panel: rgba(255, 255, 255, 0.88);
  --line: #dbe8e3;
  --muted: #728681;
  --text: #213b36;
  --card-shadow: 0 10px 28px rgba(28, 63, 55, 0.07);
  --card-shadow-hover: 0 22px 52px rgba(28, 63, 55, 0.16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 30px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background:
    radial-gradient(circle at 78% 0%, rgba(40, 197, 165, 0.22), transparent 32%),
    radial-gradient(circle at 12% 12%, rgba(223, 242, 207, 0.88), transparent 30%),
    linear-gradient(90deg, rgba(15, 123, 106, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(15, 123, 106, 0.06) 1px, transparent 1px),
    var(--canvas);
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, pre { margin: 0; }
h1 { max-width: 760px; font-size: clamp(28px, 5vw, 44px); line-height: 1; letter-spacing: 0; }
h2 { font-size: clamp(24px, 3vw, 38px); line-height: 1.04; letter-spacing: 0; }
h3 { font-size: 15px; line-height: 1.25; letter-spacing: 0; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
code, pre { font-family: var(--mono); }

.sidebar-toggle { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  align-items: start;
  width: min(1360px, calc(100% - 48px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 30px;
  background: rgba(246, 250, 248, 0.84);
  box-shadow: 0 22px 70px rgba(28, 63, 55, 0.09);
  backdrop-filter: blur(18px);
  transition: grid-template-columns 220ms ease;
}
.sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: calc(100vh - 48px);
  overflow-x: clip;
  overflow-y: auto;
  padding: 28px 18px;
  border-right: 1px solid rgba(219, 232, 227, 0.78);
  border-radius: 30px 0 0 30px;
  background: rgba(239, 250, 246, 0.74);
}
.brand, .nav-item, .system-card, .status-dot, .badge, .metric-icon, .user-pill, .btn { display: inline-flex; align-items: center; }
.brand { gap: 10px; padding: 0 8px; color: var(--teal-700); font-weight: 800; }
.brand-mark, .avatar {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(145deg, var(--mint-500), var(--teal-700));
}
.brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 11px; }
.nav-list { display: grid; gap: 7px; }
.nav-item {
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #5e766f;
  font-size: 13px;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.nav-item:hover { color: var(--teal-700); border-color: var(--line); background: var(--panel); }
.nav-item.active { color: #fff; background: var(--mint-500); }
.system-card {
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}
.system-card strong { display: block; font-size: 12px; }
.system-card p { color: var(--muted); font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mint-500); box-shadow: 0 0 0 4px rgba(40, 197, 165, 0.14); }
.collapse-btn {
  position: absolute;
  top: 50%;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal-700);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(28, 63, 55, 0.08);
  transform: translateY(-50%);
  z-index: 3;
}
.sidebar-toggle:checked ~ .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
.sidebar-toggle:checked ~ .app-shell .sidebar { align-items: center; padding-inline: 14px; }
.sidebar-toggle:checked ~ .app-shell .brand-name,
.sidebar-toggle:checked ~ .app-shell .nav-item span,
.sidebar-toggle:checked ~ .app-shell .system-card {
  width: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateX(-4px);
  pointer-events: none;
}
.sidebar-toggle:checked ~ .app-shell .nav-item { justify-content: center; width: 42px; padding-inline: 0; }
.sidebar-toggle:checked ~ .app-shell .collapse-btn svg { transform: rotate(180deg); }

.page { min-width: 0; padding: 28px; }
.topbar, .topbar-actions, .section-head, .panel-title, .button-row, .hero-actions { display: flex; align-items: center; }
.topbar { justify-content: space-between; gap: 22px; margin-bottom: 24px; }
.topbar-actions { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { color: var(--mint-600); font-size: 12px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(290px, 100%);
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--panel);
}
.search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; }
.user-pill { gap: 8px; min-height: 40px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 12px; font-weight: 700; }
.icon-btn {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--teal-700);
  background: var(--panel);
}

.bento-grid { display: grid; grid-template-columns: 1.2fr 0.45fr 0.45fr; grid-auto-rows: minmax(156px, auto); gap: 14px; }
.panel {
  border: 1px solid rgba(219, 232, 227, 0.9);
  border-radius: var(--radius-md);
  background: radial-gradient(circle at var(--card-glow-x, 50%) var(--card-glow-y, 0%), rgba(127, 225, 201, 0.14), transparent 42%), var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--card-shadow);
  transition: border-color 180ms ease, box-shadow 220ms ease, transform 220ms ease;
}
.panel:hover { border-color: rgba(40, 197, 165, 0.62); box-shadow: var(--card-shadow-hover), 0 0 0 1px rgba(127, 225, 201, 0.18) inset; }
.panel, .metric-panel, .code-panel { padding: 16px; }
.hero-panel {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-color: rgba(40, 197, 165, 0.28);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 250, 246, 0.76)), radial-gradient(circle at 100% 0%, rgba(40, 197, 165, 0.22), transparent 42%);
}
.hero-copy { max-width: 640px; margin-top: 12px; color: var(--muted); font-size: 15px; }
.hero-actions, .button-row { gap: 8px; flex-wrap: wrap; }
.metric-panel p { margin-top: 14px; color: var(--muted); font-size: 12px; font-weight: 800; }
.metric-panel strong { display: block; margin: 3px 0 14px; font-size: 32px; line-height: 1; }
.metric-panel.lime { background: var(--lime-100); }
.metric-icon { justify-content: center; width: 34px; height: 34px; border-radius: 10px; color: var(--teal-700); background: var(--mint-100); }
.code-panel { grid-column: span 2; color: #d7f2e9; border-color: rgba(127, 225, 201, 0.18); background: linear-gradient(135deg, rgba(23, 47, 42, 0.97), rgba(15, 123, 106, 0.84)), var(--teal-900); }
.code-panel h3 { color: #fff; }
.code-panel pre { overflow: auto; padding: 14px; border: 1px solid rgba(215, 242, 233, 0.15); border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.18); }
.code-panel code { color: #dff2cf; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.panel-title { justify-content: space-between; gap: 10px; margin-bottom: 12px; }

.btn {
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 800;
}
.btn-sm { min-height: 34px; padding-inline: 12px; font-size: 12px; }
.btn-primary { color: #fff; background: var(--mint-500); box-shadow: 0 14px 24px rgba(40, 197, 165, 0.22); }
.btn-secondary { color: var(--teal-700); border-color: var(--mint-300); background: var(--mint-50); }
.btn-ghost { color: var(--teal-700); border-color: var(--line); background: rgba(255, 255, 255, 0.64); }
.badge {
  gap: 7px;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal-700);
  background: var(--mint-50);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint-500); box-shadow: 0 0 0 4px rgba(40, 197, 165, 0.14); }
.badge-success { color: var(--teal-700); background: var(--lime-100); }
.badge-warning { color: var(--yellow-700); background: var(--yellow-100); }
.badge-danger { color: var(--red-700); background: var(--red-100); }
.badge-dark { color: #dff2cf; border-color: rgba(215, 242, 233, 0.18); background: rgba(23, 47, 42, 0.78); }

.field { display: grid; gap: 7px; }
.field span { color: var(--muted); font-size: 12px; font-weight: 800; }
.field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
}
.field input:focus { border-color: var(--mint-500); box-shadow: 0 0 0 4px rgba(40, 197, 165, 0.12); }
.inline-message { color: var(--muted); font-size: 12px; font-weight: 800; }
.section { margin-top: 34px; }
.section-head { justify-content: space-between; gap: 14px; margin-bottom: 14px; }

.video-list { display: grid; gap: 12px; }
.video-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
}
.video-card img { width: 132px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); background: var(--mint-100); }
.video-card h3 { margin-bottom: 6px; font-size: 16px; }
.video-card p { color: var(--muted); font-size: 12px; font-weight: 700; }
.video-actions { display: grid; justify-items: end; gap: 8px; }
.progress { overflow: hidden; height: 8px; margin-top: 10px; border-radius: 999px; background: rgba(15, 123, 106, 0.12); }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint-500), var(--teal-700)); }

.reader-panel { padding: 0; overflow: hidden; }
.tabs { display: flex; gap: 7px; padding: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal-700);
  background: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
}
.tab.active { color: #fff; border-color: var(--mint-500); background: var(--mint-500); }
.reader-meta { padding: 12px 16px 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.markdown-body { padding: 18px; color: var(--text); font-size: 15px; line-height: 1.68; }
.markdown-body.empty-state { color: var(--muted); font-weight: 700; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1em 0 0.45em; line-height: 1.15; }
.markdown-body h1 { font-size: 30px; }
.markdown-body h2 { font-size: 22px; }
.markdown-body h3 { font-size: 17px; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body table, .markdown-body blockquote, .markdown-body pre { margin: 0 0 1em; }
.markdown-body table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: var(--radius-sm); }
.markdown-body th, .markdown-body td { padding: 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown-body th { background: var(--mint-50); }
.markdown-body blockquote { padding: 12px 14px; border-left: 4px solid var(--mint-500); border-radius: var(--radius-sm); background: var(--mint-50); color: #45635c; }
.markdown-body pre { overflow: auto; padding: 14px; border-radius: var(--radius-sm); background: var(--teal-900); color: #dff2cf; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; width: min(100% - 24px, 760px); margin: 12px auto; }
  .sidebar { position: relative; top: 0; height: auto; border-right: 0; border-bottom: 1px solid var(--line); border-radius: 30px 30px 0 0; }
  .collapse-btn { display: none; }
  .nav-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bento-grid { grid-template-columns: 1fr; }
  .hero-panel, .code-panel { grid-column: auto; }
  .video-card { grid-template-columns: 96px minmax(0, 1fr); }
  .video-actions { grid-column: 1 / -1; justify-items: stretch; }
  .topbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 640px) {
  .page { padding: 18px; }
  .app-shell { width: min(100% - 12px, 760px); border-radius: 22px; }
  .sidebar { padding: 18px; border-radius: 22px 22px 0 0; }
  .nav-list { grid-template-columns: 1fr; }
  .video-card { grid-template-columns: 1fr; }
  .video-card img { width: 100%; }
  .section-head { align-items: flex-start; flex-direction: column; }
}
