/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --sidebar-width: 280px;
  --font-shell: system-ui, sans-serif;
  --font-content: system-ui, sans-serif;
  --color-page-text: oklch(27% 0.02 258);
  --color-page-bg: oklch(97% 0.008 245);
  --color-link: oklch(55% 0.18 257);
  --color-sidebar-bg: oklch(92% 0.04 245);
  --color-sidebar-text: oklch(29% 0.03 258);
  --color-sidebar-muted: oklch(50% 0.02 255);
  --color-sidebar-border: oklch(70% 0.03 245 / 0.45);
  --color-sidebar-subnav-border: oklch(67% 0.03 245 / 0.55);
  --color-flash-alert-bg: oklch(94% 0.045 30);
  --color-flash-alert-text: oklch(47% 0.13 30);
  --color-flash-notice-bg: oklch(95% 0.05 150);
  --color-flash-notice-text: oklch(43% 0.11 150);
  --color-blockquote-border: oklch(84% 0.015 250);
  --color-blockquote-text: oklch(36% 0.03 252);
  --color-inline-code-bg: oklch(94% 0.02 270);
  --color-surface: oklch(100% 0 0);
  --color-border-subtle: oklch(85% 0.01 250);
  --color-toolbar-bg: oklch(97% 0.01 250);
  --color-toolbar-button-hover: oklch(95% 0.02 252);
  --color-drop-bg: oklch(95% 0.03 252);
  --color-drop-outline: oklch(57% 0.16 257);
  --color-drop-shadow: oklch(57% 0.16 257 / 0.25);
  --color-empty-border: oklch(84% 0.04 250);
  --color-empty-bg: oklch(95% 0.03 252 / 0.35);
  --color-admin-node-bg: oklch(96% 0.006 250);
  --color-admin-path: oklch(45% 0.02 252);
  --color-card-bg: oklch(100% 0 0);
  --color-card-border: oklch(84% 0.01 252);
  --color-card-hover-bg: oklch(98% 0.01 252);
  --color-card-hover-border: oklch(73% 0.03 252);
  --color-card-shadow: oklch(21% 0.01 255 / 0.08);
  --color-card-shadow-hover: oklch(21% 0.015 255 / 0.12);
}

body {
  margin: 0;
  font-family: var(--font-shell);
  color: var(--color-page-text);
  background: var(--color-page-bg);
}

body.page-theme-alt-a {
  --font-shell: "Avenir Next", "Segoe UI", sans-serif;
  --font-content: "Avenir Next", "Segoe UI", sans-serif;
  --color-page-bg: oklch(96% 0.014 220);
  --color-page-text: oklch(26% 0.028 245);
  --color-link: oklch(49% 0.17 252);
  --color-sidebar-bg: oklch(89% 0.05 220);
  --color-sidebar-text: oklch(25% 0.03 245);
  --color-sidebar-muted: oklch(46% 0.022 242);
  --color-sidebar-border: oklch(63% 0.04 225 / 0.42);
  --color-sidebar-subnav-border: oklch(61% 0.04 225 / 0.52);
  --color-surface: oklch(99% 0.004 220);
  --color-toolbar-bg: oklch(95% 0.015 220);
  --color-toolbar-button-hover: oklch(93% 0.02 220);
  --color-border-subtle: oklch(83% 0.016 230);
}

body.page-theme-alt-b {
  --font-shell: "Trebuchet MS", "Segoe UI", sans-serif;
  --font-content: Georgia, "Times New Roman", serif;
  --color-page-bg: oklch(97% 0.012 80);
  --color-page-text: oklch(30% 0.028 62);
  --color-link: oklch(48% 0.16 48);
  --color-sidebar-bg: oklch(91% 0.035 78);
  --color-sidebar-text: oklch(28% 0.028 62);
  --color-sidebar-muted: oklch(50% 0.02 62);
  --color-sidebar-border: oklch(66% 0.03 72 / 0.4);
  --color-sidebar-subnav-border: oklch(64% 0.03 72 / 0.52);
  --color-surface: oklch(99% 0.004 78);
  --color-toolbar-bg: oklch(96% 0.014 78);
  --color-toolbar-button-hover: oklch(94% 0.02 78);
  --color-border-subtle: oklch(84% 0.014 74);
}

body.page-theme-alt-c {
  --font-shell: "Gill Sans", "Avenir Next", "Segoe UI", sans-serif;
  --font-content: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --color-page-bg: oklch(95% 0.014 170);
  --color-page-text: oklch(26% 0.03 175);
  --color-link: oklch(46% 0.14 190);
  --color-sidebar-bg: oklch(87% 0.05 170);
  --color-sidebar-text: oklch(24% 0.03 175);
  --color-sidebar-muted: oklch(45% 0.024 175);
  --color-sidebar-border: oklch(59% 0.034 175 / 0.42);
  --color-sidebar-subnav-border: oklch(56% 0.032 175 / 0.54);
  --color-surface: oklch(99% 0.005 170);
  --color-toolbar-bg: oklch(94% 0.02 170);
  --color-toolbar-button-hover: oklch(91% 0.028 170);
  --color-border-subtle: oklch(82% 0.018 176);
}

a {
  color: var(--color-link);
}

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

.sidebar {
  width: var(--sidebar-width);
  box-sizing: border-box;
  flex-shrink: 0;
  background: var(--color-sidebar-bg);
  color: var(--color-sidebar-text);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-title {
  margin: 0;
  font-size: 1.125rem;
}

.sidebar-title-link {
  color: inherit;
  text-decoration: none;
}

.sidebar-title-link:hover {
  text-decoration: underline;
}

.sidebar-toggle-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  flex-shrink: 0;
  border: 1px solid var(--color-sidebar-border);
  border-radius: 0.4rem;
  background: var(--color-surface);
  color: var(--color-sidebar-text);
  cursor: pointer;
}

.sidebar-toggle-button:hover {
  background: var(--color-toolbar-button-hover);
}

.sidebar-toggle-button:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}

.sidebar-toggle-text {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.sidebar-nav-shell {
  display: contents;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-section {
  margin-top: 0.25rem;
}

.sidebar-section-title {
  margin: 0 0 0.375rem;
  color: var(--color-sidebar-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-utility-nav {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-sidebar-border);
}

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

.sidebar-link.is-active {
  text-decoration: underline;
  font-weight: 600;
}

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

.sidebar-subnav {
  margin: 0.25rem 0 0.5rem 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--color-sidebar-subnav-border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-signout {
  width: 100%;
}

.sidebar-signout-form {
  margin: 0;
}

.main-content,
.auth-main {
  flex: 1;
  padding: 1.5rem;
}

.app-shell .main-content {
  margin-left: var(--sidebar-width);
  min-width: 0;
  padding-top: 50px;
  padding-left: 50px;
  padding-right: 50px;
}

.app-shell.sidebar-collapsed .sidebar,
html.sidebar-collapsed-preload .app-shell .sidebar {
  width: auto;
  max-width: none;
  left: 0.4875rem;
  right: auto;
  top: 1.15625rem;
  bottom: auto;
  height: auto;
  padding: 0.35rem 0.45rem;
  gap: 0;
  overflow: visible;
  border: 1px solid var(--color-sidebar-border);
  border-radius: 0.65rem;
  background: var(--color-sidebar-bg);
  box-shadow: none;
  z-index: 24;
}

.app-shell.sidebar-collapsed .main-content,
html.sidebar-collapsed-preload .app-shell .main-content {
  margin-left: 0;
  padding-top: 4.65rem;
}

.app-shell.sidebar-collapsed .sidebar-header,
html.sidebar-collapsed-preload .app-shell .sidebar-header {
  min-height: 0;
  gap: 0.45rem;
}

.app-shell.sidebar-collapsed .sidebar-title,
html.sidebar-collapsed-preload .app-shell .sidebar-title {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.1;
}

.app-shell.sidebar-collapsed .sidebar-toggle-button,
html.sidebar-collapsed-preload .app-shell .sidebar-toggle-button {
  width: auto;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0 0.45rem;
  border-radius: 0.58rem;
  border-color: oklch(70% 0.01 250 / 0.65);
  background: var(--color-surface);
}

.app-shell.sidebar-collapsed .sidebar-toggle-button:focus-visible,
html.sidebar-collapsed-preload .app-shell .sidebar-toggle-button:focus-visible {
  outline: 1px solid var(--color-link);
  outline-offset: 1px;
}

.app-shell.sidebar-collapsed .sidebar-toggle-text,
html.sidebar-collapsed-preload .app-shell .sidebar-toggle-text {
  font-size: 0.72rem;
}

.app-shell.sidebar-collapsed .sidebar-nav-shell,
html.sidebar-collapsed-preload .app-shell .sidebar-nav-shell {
  display: none;
}

.admin-subnav {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: -0.25rem 0 1.1rem;
  padding: 0.65rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.6rem;
  background: var(--color-surface);
}

.admin-subnav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.34rem 0.56rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 999px;
  color: var(--color-page-text);
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.2;
  background: var(--color-surface);
}

.admin-subnav-link:hover {
  background: var(--color-toolbar-button-hover);
}

.admin-subnav-link.is-active {
  border-color: var(--color-link);
  color: var(--color-link);
  font-weight: 600;
}

.admin-subnav-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.32rem;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  color: var(--color-sidebar-muted);
}

.admin-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.admin-hub-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.55rem;
  padding: 0.9rem;
}

.admin-hub-title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.admin-hub-title a {
  color: inherit;
  text-decoration: none;
}

.admin-hub-title a:hover {
  text-decoration: underline;
}

.admin-hub-description {
  margin: 0;
  color: var(--color-sidebar-muted);
}

.admin-hub-status,
.admin-placeholder-copy {
  margin: 0.65rem 0 0;
  color: var(--color-sidebar-muted);
  font-size: 0.9rem;
}

.admin-table-shell {
  margin-top: 0.9rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.6rem;
  background: var(--color-surface);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: left;
  vertical-align: middle;
}

.admin-table thead th {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-sidebar-muted);
  background: var(--color-toolbar-bg);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover td {
  background: var(--color-toolbar-button-hover);
}

.admin-table-actions-heading {
  width: 1%;
  white-space: nowrap;
}

.admin-table-actions {
  white-space: nowrap;
}

.admin-table-actions .inline-form {
  margin-left: 0.45rem;
}

.admin-table-code {
  display: inline-block;
  padding: 0.12rem 0.35rem;
  border-radius: 0.32rem;
  background: var(--color-inline-code-bg);
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.83rem;
}

.admin-toolbar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
}

.page-edit-cta {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border-radius: 0.375rem;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
  color: var(--color-link);
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 2px 10px oklch(38% 0.02 255 / 0.12);
}

.page-edit-cta:hover {
  background: var(--color-toolbar-button-hover);
  text-decoration: none;
}

@media (max-width: 900px) {
  .admin-subnav {
    position: static;
    margin-top: 0;
  }

  .admin-toolbar {
    right: 0.75rem;
    top: 0.75rem;
  }
}

.flash {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  box-shadow: 0 10px 24px oklch(23% 0.01 260 / 0.14);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.flash-message {
  flex: 1;
  min-width: 0;
}

.flash-close {
  flex-shrink: 0;
  margin: 0;
  padding: 0.15rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 0.35rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
  opacity: 0.85;
}

.flash-close:hover {
  opacity: 1;
  background: oklch(100% 0 0 / 0.35);
}

.flash-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(26rem, calc(100vw - 1.5rem));
  pointer-events: none;
}

.flash-stack-with-toolbar {
  top: 4rem;
}

.flash-stack .flash {
  pointer-events: auto;
}

@media (max-width: 900px) {
  .flash-stack {
    top: 0.75rem;
    right: 0.75rem;
    width: calc(100vw - 1.5rem);
  }

  .flash-stack-with-toolbar {
    top: 3.75rem;
  }
}

.flash-alert {
  background: var(--color-flash-alert-bg);
  color: var(--color-flash-alert-text);
}

.flash-notice {
  background: var(--color-flash-notice-bg);
  color: var(--color-flash-notice-text);
}

.page-body {
  max-width: 72ch;
  line-height: 1.65;
  font-family: var(--font-content);
}

.page-body.page-width-narrow,
.page-learn-more.page-width-narrow {
  max-width: 56ch;
}

.page-body.page-width-regular,
.page-learn-more.page-width-regular {
  max-width: 72ch;
}

.page-body.page-width-wide,
.page-learn-more.page-width-wide {
  max-width: 92ch;
}

.page-body.page-width-xl,
.page-learn-more.page-width-xl {
  max-width: 112ch;
}

.page-body.page-width-full,
.page-learn-more.page-width-full {
  max-width: none;
  width: 100%;
}

.page-body.page-template-directory h2,
.page-body.page-template-directory h3,
.page-body.page-template-directory h4 {
  margin-top: 1.15rem;
  letter-spacing: 0.02em;
}

.page-body.page-template-directory ul,
.page-body.page-template-directory ol {
  margin-bottom: 0.8rem;
}

.page-body.page-template-video {
  line-height: 1.72;
}

.page-body.page-template-video h1,
.page-body.page-template-video h2 {
  margin-top: 1.85rem;
  line-height: 1.2;
}

.page-body.page-template-video p {
  margin-bottom: 1.15rem;
}

.page-body.page-template-tool {
  line-height: 1.55;
}

.page-body.page-template-tool h1,
.page-body.page-template-tool h2,
.page-body.page-template-tool h3,
.page-body.page-template-tool h4 {
  font-family: var(--font-shell);
  margin-top: 1.1rem;
}

.page-body.page-template-tool code {
  font-size: 0.92em;
}

.page-body > :first-child {
  margin-top: 0;
}

.page-body > :last-child {
  margin-bottom: 0;
}

.page-body h1,
.page-body h2,
.page-body h3,
.page-body h4,
.page-body h5,
.page-body h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.page-body p,
.page-body ul,
.page-body ol,
.page-body blockquote,
.page-body pre,
.page-body table,
.agent-skills-table {
  margin: 0 0 1rem;
}

.page-body blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--color-blockquote-border);
  color: var(--color-blockquote-text);
}

.page-body code {
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  background: var(--color-inline-code-bg);
  padding: 0.1rem 0.25rem;
  border-radius: 0.25rem;
}

.page-body pre {
  overflow-x: auto;
  padding: 0.9rem;
  border-radius: 0.5rem;
}

.page-body pre code {
  background: transparent;
  padding: 0;
}

.page-body table,
.agent-skills-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.6rem;
  background: var(--color-surface);
  overflow: hidden;
}

.page-body th,
.page-body td,
.agent-skills-table th,
.agent-skills-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: left;
  vertical-align: top;
}

.page-body thead th,
.agent-skills-table thead th {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-sidebar-muted);
  background: var(--color-toolbar-bg);
}

.page-body tbody tr:last-child td,
.agent-skills-table tbody tr:last-child td {
  border-bottom: none;
}

.page-body tbody tr:hover td,
.agent-skills-table tbody tr:hover td {
  background: var(--color-toolbar-button-hover);
}

.page-body ul:has(input[type="checkbox"]) {
  padding-left: 1.25rem;
}

.page-body input[type="checkbox"] {
  margin-right: 0.4rem;
}

.page-body img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
}

.page-learn-more {
  margin-top: 2rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--color-border-subtle);
  font-family: var(--font-content);
}

.page-learn-more-title {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
}

.page-learn-more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.page-learn-more-column {
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.6rem;
  background: var(--color-surface);
  padding: 0.7rem 0.78rem;
}

.page-learn-more-column-title {
  margin: 0 0 0.5rem;
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-sidebar-muted);
}

.page-learn-more-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
}

.page-learn-more-link-item > :first-child {
  margin-top: 0;
}

.page-learn-more-link-item > :last-child {
  margin-bottom: 0;
}

.page-learn-more-prompt {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.45rem;
  padding: 0.4rem 0.46rem;
  background: var(--color-toolbar-bg);
}

.page-learn-more-prompt-text {
  flex: 1;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.83rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.page-learn-more-copy-button {
  flex-shrink: 0;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.35rem;
  background: var(--color-surface);
  color: var(--color-page-text);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.18rem 0.45rem;
  cursor: pointer;
}

.page-learn-more-copy-button:hover:enabled {
  background: var(--color-toolbar-button-hover);
}

.page-learn-more-copy-button:disabled {
  cursor: default;
  opacity: 0.7;
}

.agent-skills-directory,
.agent-skill-detail {
  max-width: 92ch;
}

.agent-skills-header {
  margin-bottom: 0.4rem;
}

.agent-skills-title,
.agent-skill-detail-title {
  margin: 0;
}

.agent-skills-copy,
.agent-skill-detail-description {
  margin: 0.5rem 0 0;
}

.agent-skills-table-shell {
  margin-top: 0.8rem;
  overflow-x: auto;
}

.agent-skills-table th,
.agent-skills-table td {
  text-align: left;
}

.agent-skill-card,
.agent-skill-detail-card {
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.6rem;
  background: var(--color-surface);
  padding: 0.82rem 0.9rem;
}

.agent-skills-empty {
  margin: 0.15rem 0 0;
  color: var(--color-sidebar-muted);
}

.agent-skill-back-link {
  margin: 0 0 0.7rem;
}

.agent-skill-detail-header {
  margin-bottom: 1rem;
}

.agent-skill-detail-external-link {
  margin: 0.7rem 0 0;
}

.agent-skill-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.agent-skill-detail-card-title {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-sidebar-muted);
}

.agent-skill-detail-list {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lab-updates-directory,
.lab-update-detail {
  max-width: 112ch;
}

.lab-updates-header {
  margin-bottom: 0.8rem;
}

.lab-updates-title,
.lab-update-title {
  margin: 0;
}

.lab-updates-copy {
  margin: 0.45rem 0 0;
}

.lab-updates-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lab-update-preview-card {
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.6rem;
  background: var(--color-surface);
  padding: 0.9rem 1rem;
}

.lab-update-preview-title {
  margin: 0;
  font-size: 1.2rem;
}

.lab-update-preview-meta,
.lab-update-meta {
  margin: 0.45rem 0 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  color: var(--color-sidebar-muted);
  font-size: 0.9rem;
}

.lab-update-preview-content > :first-child,
.lab-update-body-content > :first-child {
  margin-top: 0;
}

.lab-update-preview-content > :last-child,
.lab-update-body-content > :last-child {
  margin-bottom: 0;
}

.lab-update-back-link {
  margin: 0 0 0.75rem;
}

.lab-update-header {
  margin-bottom: 0.85rem;
}

.lab-update-admin-markdown-block {
  margin-top: 1rem;
}

.lab-update-admin-rendered {
  margin-top: 1.1rem;
}

.lab-update-admin-rendered h2 {
  margin: 0 0 0.55rem;
}

@media (max-width: 900px) {
  .page-learn-more-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .agent-skill-detail-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

.md-grid {
  display: grid;
  grid-template-columns: repeat(var(--md-grid-columns, 3), minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.25rem;
}

.md-card {
  border: 1px solid var(--color-card-border);
  border-radius: 0.7rem;
  background: var(--color-card-bg);
  box-shadow: 0 4px 14px var(--color-card-shadow);
  padding: 1rem;
}

.md-card-clickable {
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.md-card-clickable:hover {
  background: var(--color-card-hover-bg);
  border-color: var(--color-card-hover-border);
  box-shadow: 0 10px 20px var(--color-card-shadow-hover);
  transform: translateY(-1px);
}

.md-card-clickable:focus-visible {
  outline: 2px solid var(--color-drop-outline);
  outline-offset: 2px;
}

.md-card-body > :first-child {
  margin-top: 0;
}

.md-card-body > :last-child {
  margin-bottom: 0;
}

.md-card-body h1,
.md-card-body h2,
.md-card-body h3,
.md-card-body h4,
.md-card-body h5,
.md-card-body h6 {
  margin-top: 0.95rem;
}

@media (max-width: 1100px) {
  .md-grid {
    grid-template-columns: repeat(var(--md-grid-columns-tablet, 2), minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .md-grid {
    grid-template-columns: repeat(var(--md-grid-columns-mobile, 1), minmax(0, 1fr));
  }
}

.markdown-editor {
  margin-top: 0.75rem;
}

.admin-page-meta-grid {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr;
  gap: 0.9rem;
  margin-top: 1rem;
  margin-bottom: 0.65rem;
  align-items: start;
}

.admin-page-presentation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.8rem;
}

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

.admin-page-field-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-sidebar-muted);
}

.admin-page-field-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.45rem;
  padding: 0.55rem 0.65rem;
  font: inherit;
  color: var(--color-page-text);
  background: var(--color-surface);
  min-height: 2.4rem;
}

.admin-page-select-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--color-sidebar-muted) 50%), linear-gradient(135deg, var(--color-sidebar-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.admin-page-field-input:focus {
  outline: 2px solid var(--color-drop-outline);
  outline-offset: 1px;
  border-color: transparent;
}

.admin-page-visible-field {
  display: flex;
  flex-direction: column;
}

.admin-page-visible-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.4rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.45rem;
  padding: 0.45rem 0.6rem;
  background: var(--color-surface);
  box-sizing: border-box;
}

.admin-page-visible-toggle input[type="checkbox"] {
  margin: 0;
  width: 1rem;
  height: 1rem;
}

.admin-page-visible-toggle-text {
  font-size: 0.86rem;
}

.admin-learn-more {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.6rem;
  background: var(--color-surface);
}

.admin-learn-more-header {
  margin-bottom: 0.85rem;
}

.admin-learn-more-title {
  margin: 0;
  font-size: 1rem;
}

.admin-learn-more-copy {
  margin: 0.35rem 0 0;
  color: var(--color-sidebar-muted);
  font-size: 0.9rem;
}

.admin-learn-more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.admin-learn-more-grid-two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-learn-more-column {
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.55rem;
  padding: 0.7rem;
  background: var(--color-toolbar-bg);
}

.admin-learn-more-column-title {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-sidebar-muted);
}

.admin-learn-more-column-hint {
  margin: 0.4rem 0 0.55rem;
  font-size: 0.82rem;
  color: var(--color-sidebar-muted);
}

.admin-learn-more-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 1.4rem;
}

.admin-learn-more-list:empty {
  border: 1px dashed var(--color-empty-border);
  border-radius: 0.45rem;
  background: var(--color-empty-bg);
}

.admin-learn-more-item {
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.45rem;
  padding: 0.45rem;
  background: var(--color-surface);
}

.admin-learn-more-input {
  min-height: 3.5rem;
  resize: vertical;
}

.admin-learn-more-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.42rem;
}

.admin-learn-more-item-button,
.admin-learn-more-add-button {
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.35rem;
  background: var(--color-surface);
  color: var(--color-page-text);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.18rem 0.48rem;
  cursor: pointer;
}

.admin-learn-more-item-button:hover:enabled,
.admin-learn-more-add-button:hover:enabled {
  background: var(--color-toolbar-button-hover);
}

.admin-learn-more-item-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.admin-learn-more-item-button.is-danger {
  color: var(--color-flash-alert-text);
}

.admin-learn-more-add-button {
  margin-top: 0.6rem;
}

@media (max-width: 900px) {
  .admin-page-meta-grid {
    grid-template-columns: 1fr;
  }

  .admin-page-presentation-grid {
    grid-template-columns: 1fr;
  }

  .admin-learn-more-grid {
    grid-template-columns: 1fr;
  }
}

.markdown-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.5rem;
  background: var(--color-toolbar-bg);
  border: 1px solid var(--color-border-subtle);
  border-bottom: none;
  border-radius: 0.5rem 0.5rem 0 0;
}

.markdown-toolbar-button {
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
  color: var(--color-page-text);
  border-radius: 0.35rem;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
}

.markdown-toolbar-button:hover {
  background: var(--color-toolbar-button-hover);
}

.markdown-editor-field {
  border: 1px solid var(--color-border-subtle);
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 0.6rem;
  background: var(--color-surface);
}

.markdown-editor-input {
  width: 100%;
  min-height: 65vh;
  resize: vertical;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.93rem;
  line-height: 1.45;
  padding: 0.7rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.35rem;
  box-sizing: border-box;
  color: var(--color-page-text);
  background: var(--color-surface);
}

@media (max-width: 900px) {
  .markdown-editor-input {
    min-height: 50vh;
  }
}

.admin-section-list,
.admin-page-list {
  list-style: none;
  margin: 0.5rem 0;
  padding-left: 1rem;
  position: relative;
  border-radius: 0.5rem;
}

.admin-section-list.is-drop-target,
.admin-page-list.is-drop-target {
  background: var(--color-drop-bg);
  outline: 2px dashed var(--color-drop-outline);
  outline-offset: 2px;
}

.admin-node-row.is-drop-target {
  background: var(--color-drop-bg);
  border-color: var(--color-drop-outline);
  box-shadow: 0 0 0 2px var(--color-drop-shadow);
}

.admin-section-node,
.admin-page-node {
  margin-bottom: 0.5rem;
}

.admin-page-list:empty {
  min-height: 1.75rem;
  border: 1px dashed var(--color-empty-border);
  background: var(--color-empty-bg);
}

.admin-section-node.is-dragging > .admin-node-row,
.admin-page-node.is-dragging > .admin-node-row {
  opacity: 0.5;
  border-style: dashed;
}

.admin-node-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  background: var(--color-admin-node-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.375rem;
  padding: 0.4rem 0.6rem;
}

.admin-path {
  color: var(--color-admin-path);
  margin-left: 0.4rem;
}

.inline-form {
  display: inline;
}

.inline-button {
  background: transparent;
  border: none;
  color: var(--color-link);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.admin-inline-link {
  font-size: 0.9rem;
}

.admin-drop-indicator {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  border-top: 2px solid var(--color-drop-outline);
  pointer-events: none;
  z-index: 2;
}

.account-form-shell {
  max-width: 40rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.6rem;
  padding: 1rem;
  background: var(--color-surface);
}

.account-form-copy {
  margin: 0 0 0.35rem;
  color: var(--color-sidebar-muted);
}

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

@media (max-width: 700px) {
  .app-shell .main-content {
    margin-left: 0;
    padding: 4.25rem 1rem 1rem;
  }

  .auth-main {
    padding: 1rem;
  }

  .auth-main h1 {
    margin-top: 0;
  }

  html:not(.sidebar-collapsed-preload) .app-shell:not(.sidebar-collapsed) .sidebar {
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: none;
    padding: 1rem;
    gap: 0.85rem;
    z-index: 45;
    box-shadow: none;
    overflow-y: auto;
  }

  html:not(.sidebar-collapsed-preload) .app-shell:not(.sidebar-collapsed) + .admin-toolbar {
    display: none;
  }

  html:not(.sidebar-collapsed-preload) .app-shell:not(.sidebar-collapsed) .sidebar-nav-shell {
    display: block;
  }

  html:not(.sidebar-collapsed-preload) .app-shell:not(.sidebar-collapsed) .sidebar-toggle-button {
    min-width: 2.4rem;
    height: 2.1rem;
    padding: 0 0.58rem;
  }

  html:not(.sidebar-collapsed-preload) .app-shell:not(.sidebar-collapsed) .sidebar-toggle-text {
    font-size: 0.78rem;
  }

  html:not(.sidebar-collapsed-preload) .app-shell:not(.sidebar-collapsed) .sidebar-nav {
    gap: 0.62rem;
  }

  html:not(.sidebar-collapsed-preload) .app-shell:not(.sidebar-collapsed) .sidebar-link {
    font-size: 1.05rem;
    line-height: 1.35;
  }

  html:not(.sidebar-collapsed-preload) .app-shell:not(.sidebar-collapsed) .sidebar-subnav {
    margin-left: 0.35rem;
    padding-left: 0.6rem;
  }

  .app-shell.sidebar-collapsed .main-content,
  html.sidebar-collapsed-preload .app-shell .main-content {
    padding-top: 4.4rem;
  }

  .admin-toolbar {
    top: 0.75rem;
    right: 0.75rem;
  }

  .admin-subnav {
    gap: 0.38rem;
    padding: 0.52rem;
    margin-bottom: 0.85rem;
  }

  .admin-subnav-link {
    font-size: 0.8rem;
    padding: 0.28rem 0.46rem;
  }

  .admin-table {
    min-width: 560px;
  }

  .admin-node-row {
    gap: 0.58rem;
    padding: 0.35rem 0.45rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-node-row > span {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .admin-section-list,
  .admin-page-list {
    padding-left: 0.7rem;
  }

  .admin-path {
    margin-left: 0;
    margin-top: 0.2rem;
    display: block;
    overflow-wrap: anywhere;
  }

  .page-body.page-width-narrow,
  .page-body.page-width-regular,
  .page-body.page-width-wide,
  .page-body.page-width-xl,
  .page-body.page-width-full,
  .page-learn-more.page-width-narrow,
  .page-learn-more.page-width-regular,
  .page-learn-more.page-width-wide,
  .page-learn-more.page-width-xl,
  .page-learn-more.page-width-full {
    max-width: 100%;
    width: 100%;
  }

  .page-body table,
  .agent-skills-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-body pre {
    max-width: 100%;
  }

  .page-body h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
    line-height: 1.1;
  }

  .page-body h2 {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
  }

  .page-body h3 {
    font-size: clamp(1.1rem, 5vw, 1.4rem);
  }

  .page-learn-more-prompt {
    flex-direction: column;
    align-items: stretch;
  }

  .page-learn-more-copy-button {
    align-self: flex-start;
  }

  .auth-main form,
  .account-form {
    max-width: 100%;
  }

  .auth-main form br {
    display: none;
  }

  .auth-main form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
  .auth-main form select,
  .auth-main form textarea,
  .account-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
  .account-form select,
  .account-form textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 2.45rem;
    padding: 0.52rem 0.62rem;
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.45rem;
    background: var(--color-surface);
    color: var(--color-page-text);
  }

  .auth-main form input[type="submit"],
  .auth-main form button[type="submit"],
  .account-form input[type="submit"],
  .account-form button[type="submit"] {
    min-height: 2.5rem;
    width: 100%;
    box-sizing: border-box;
  }

  .main-content form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
  .main-content form select,
  .main-content form textarea {
    max-width: 100%;
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .admin-page-field-input,
  .markdown-editor-input {
    font-size: 16px;
  }

  .markdown-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .markdown-toolbar-button {
    white-space: nowrap;
  }

  .agent-skills-table-shell,
  .admin-table-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .lab-update-preview-card {
    padding: 0.75rem 0.8rem;
  }

  .lab-update-preview-title {
    font-size: 1.06rem;
  }

  .lab-update-preview-meta,
  .lab-update-meta {
    gap: 0.45rem;
    font-size: 0.84rem;
  }
}
