/* Shared chrome for the public developer docs (/api-docs and
   /api-docs/data-dictionary). Colors and fonts mirror the SPA's Naive UI
   theme (THEME_OVERRIDES in utils/constants.ts) so the docs read as part of
   Daisychain rather than a bolted-on tool. */

:root {
  --dc-primary: #0f91c2;
  --dc-primary-hover: #109fd5;
  --dc-primary-strong: #0b7299;
  --dc-primary-soft: rgba(15, 145, 194, 0.08);
  --dc-primary-softer: rgba(15, 145, 194, 0.04);

  --dc-text-1: #1f2225;
  --dc-text-2: #333639;
  --dc-text-3: #6b7280;
  --dc-text-4: #9ca3af;
  --dc-graphite: #4b5563;
  --dc-border: #e0e0e6;
  --dc-border-strong: #d0d0d8;
  --dc-divider: #efeff5;
  --dc-bg: #ffffff;
  --dc-bg-subtle: #fafafc;
  --dc-hover: #f3f3f5;
  --dc-code-bg: #f6f7f9;

  --dc-get: #0b7299;
  --dc-get-bg: rgba(15, 145, 194, 0.1);
  --dc-post: #0e7a43;
  --dc-post-bg: rgba(24, 160, 88, 0.1);
  --dc-put: #9a5b00;
  --dc-put-bg: rgba(240, 160, 32, 0.14);
  --dc-delete: #b4254a;
  --dc-delete-bg: rgba(208, 48, 80, 0.09);

  --dc-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --dc-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --dc-wordmark: Rubik, -apple-system, BlinkMacSystemFont, sans-serif;

  --dc-header-height: 56px;
  --dc-sidebar-width: 272px;
  --dc-content-width: 1280px;
  --dc-radius: 6px;
  --dc-radius-lg: 10px;

  --dc-focus-ring: 0 0 0 2px rgba(15, 145, 194, 0.2);
  --dc-shadow-raised: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.05);
  --dc-shadow-drawer: 8px 0 24px rgba(16, 24, 40, 0.12);
  --dc-shadow-modal: 0 20px 48px rgba(16, 24, 40, 0.16);
  --dc-backdrop: rgba(15, 23, 42, 0.25);
}

html {
  scroll-padding-top: calc(var(--dc-header-height) + 16px);
}

body.dc-docs {
  margin: 0;
  background: var(--dc-bg);
  color: var(--dc-text-2);
  font-family: var(--dc-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Header */

.dc-docs-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--dc-header-height);
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--dc-divider);
  font-family: var(--dc-sans);
}

.dc-docs-header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 100%;
  padding: 0 24px;
}

.dc-docs-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dc-graphite);
  font-family: var(--dc-wordmark);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

.dc-docs-brand:hover {
  color: var(--dc-text-1);
}

.dc-docs-brand svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.dc-docs-brand-label {
  color: var(--dc-text-3);
  font-family: var(--dc-sans);
  font-size: 14px;
  font-weight: 400;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--dc-border);
}

.dc-docs-tabs {
  display: flex;
  align-self: stretch;
  gap: 24px;
}

.dc-docs-tab {
  display: flex;
  align-items: center;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--dc-text-3);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.dc-docs-tab:hover {
  color: var(--dc-text-1);
}

.dc-docs-tab.is-active {
  color: var(--dc-primary-strong);
  border-bottom-color: var(--dc-primary);
}

.dc-docs-header-link {
  margin-left: auto;
  color: var(--dc-primary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.dc-docs-header-link:hover {
  color: var(--dc-primary-hover);
}

@media (max-width: 768px) {
  .dc-docs-header-inner {
    gap: 20px;
    padding: 0 16px;
  }

  .dc-docs-brand-label,
  .dc-docs-header-link {
    display: none;
  }
}

@media (max-width: 480px) {
  .dc-docs-brand span {
    display: none;
  }

  .dc-docs-tabs {
    gap: 16px;
  }
}

/* Layout */

.dc-docs-shell {
  display: flex;
  align-items: flex-start;
}

.dc-docs-main {
  flex: 1 1 auto;
  min-width: 0;
}

/* Sidebar */

.dc-docs-sidebar {
  position: sticky;
  top: var(--dc-header-height);
  flex: 0 0 var(--dc-sidebar-width);
  width: var(--dc-sidebar-width);
  height: calc(100vh - var(--dc-header-height));
  overflow-y: auto;
  box-sizing: border-box;
  padding: 20px 12px 32px;
  background: var(--dc-bg);
  border-right: 1px solid var(--dc-divider);
  font-family: var(--dc-sans);
}

.dc-docs-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dc-docs-sidebar-section + .dc-docs-sidebar-section {
  margin-top: 18px;
}

.dc-docs-sidebar-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0 0 4px;
  padding: 4px 10px;
  background: none;
  border: none;
  color: var(--dc-text-1);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
}

button.dc-docs-sidebar-heading {
  cursor: pointer;
  border-radius: var(--dc-radius);
}

button.dc-docs-sidebar-heading:hover {
  background: var(--dc-hover);
}

.dc-docs-sidebar-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  background: none;
  border: none;
  border-radius: var(--dc-radius);
  color: var(--dc-text-3);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dc-docs-sidebar-link:hover {
  background: var(--dc-hover);
  color: var(--dc-text-1);
}

.dc-docs-sidebar-link.is-active {
  background: var(--dc-primary-soft);
  color: var(--dc-primary-strong);
  font-weight: 500;
}

.dc-docs-sidebar-link-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dc-docs-sidebar-empty {
  padding: 8px 10px;
  color: var(--dc-text-3);
  font-size: 13px;
}
