.docs-page { background: var(--bg); }
.docs-shell { min-height: 100vh; }
.docs-footer[hidden] { display: none; }
.docs-container { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }
.docs-header-actions { margin-left: 0; }
.docs-console-link { min-width: 112px; gap: 7px; text-decoration: none; }
.docs-console-link svg { width: 15px; height: 15px; }
.docs-main { min-height: calc(100vh - 68px); }

.docs-intro { border-bottom: 1px solid var(--line-soft); background: var(--bg-deep); }
.docs-intro-inner { min-height: 188px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding-top: 35px; padding-bottom: 35px; }
.docs-eyebrow { margin: 0 0 9px; color: var(--blue); font: 800 12px Consolas, monospace; }
.docs-intro h1 { margin: 0; font-size: 36px; line-height: 1.2; letter-spacing: 0; }
.docs-intro h1 + p { max-width: 670px; margin: 13px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.docs-managed-note { max-width: 670px; margin: 8px 0 0; color: var(--green); font-size: 12px; line-height: 1.6; }
.docs-service-state { min-width: 184px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; }
.docs-service-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(5, 185, 131, .1); }
.docs-service-state span { font-weight: 750; }
.docs-service-state code { color: var(--muted); font: 700 12px Consolas, monospace; }

.docs-workspace { display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: 16px; align-items: start; padding-top: 24px; padding-bottom: 72px; }
.docs-sidebar { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: rgba(29, 29, 29, .68); scrollbar-width: thin; }
body.light .docs-sidebar { background: rgba(255, 255, 255, .82); }
.docs-search { height: 42px; display: flex; align-items: center; gap: 9px; margin: 12px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.docs-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 157, 235, .1); }
.docs-search svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--muted); }
.docs-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }
.docs-search input::placeholder { color: var(--muted-2); }
.docs-nav { padding: 0 9px 12px; }
.docs-nav section + section { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.docs-nav section > .docs-menu-toggle { width: 100%; min-height: 25px; display: flex; align-items: center; gap: 6px; margin: 0 0 7px; padding: 0 9px; border: 0; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; line-height: 1.2; text-align: left; text-transform: uppercase; cursor: pointer; }
.docs-nav section > .docs-menu-toggle:hover { color: var(--text); }
.docs-nav section > .docs-menu-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.docs-menu-chevron { width: 13px; height: 13px; flex: 0 0 13px; transition: transform .16s ease; }
.docs-menu-toggle-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-menu-count { min-width: 22px; margin-left: auto; color: var(--muted-2); font: 700 11px Consolas, monospace; text-align: right; }
.docs-menu-section.is-collapsed > .docs-menu-children { display: none; }
.docs-nav-item { width: 100%; min-height: 38px; display: grid; grid-template-columns: 37px minmax(0, 1fr); align-items: center; gap: 7px; padding: 5px 8px; border: 0; border-radius: 6px; color: #b4b9b7; background: transparent; text-align: left; }
body.light .docs-nav-item { color: #5f6a66; }
.docs-nav-item:hover { color: var(--text); background: var(--surface-soft); }
.docs-nav-item.active { color: #fff; background: #2d3334; }
body.light .docs-nav-item.active { color: #fff; background: #27383b; }
.docs-nav-item > svg { width: 15px; height: 15px; justify-self: center; }
.docs-nav-item > span:last-child { min-width: 0; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.nav-method { width: 36px; height: 20px; display: grid; place-items: center; border-radius: 4px; font: 800 9px Consolas, monospace; }
.nav-method.post { color: #79c6f8; background: rgba(47, 157, 235, .12); }
.nav-method.get { color: #55d6ad; background: rgba(5, 185, 131, .12); }
.nav-method.delete { color: #f0a28f; background: rgba(189, 75, 70, .12); }
.docs-nav-item.active .nav-method { color: #fff; background: rgba(255, 255, 255, .1); }
.docs-nav-empty { padding: 16px 8px; color: var(--muted); font-size: 12px; text-align: center; }
.docs-menu-children { display: grid; gap: 2px; }
.docs-menu-section .docs-menu-section { margin: 5px 0 0 9px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.docs-menu-section .docs-menu-section > .docs-menu-toggle { margin-left: 6px; font-size: 10px; }
.docs-menu-section .docs-menu-depth-1 { padding-left: 10px; }
.docs-menu-section .docs-menu-depth-2 { padding-left: 20px; }
.docs-sidebar-foot { display: flex; align-items: flex-start; gap: 9px; padding: 13px 14px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.55; }
.docs-sidebar-foot svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; color: var(--green); }

.docs-content-shell { min-width: 0; }
.docs-connection { min-height: 58px; display: flex; align-items: stretch; margin-bottom: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: rgba(29, 29, 29, .6); }
body.light .docs-connection { background: rgba(255, 255, 255, .8); }
.connection-item { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 11px 14px; }
.connection-item + .connection-item { border-left: 1px solid var(--line); }
.connection-item.connection-base { flex: 1 1 60%; grid-template-columns: auto minmax(0, 1fr) 30px; }
.connection-item > span { color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.connection-item code { min-width: 0; overflow: hidden; color: #cfd5d3; font: 700 12px Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
body.light .connection-item code { color: #38423f; }
.copy-icon { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
.copy-icon:hover { color: var(--text); background: var(--surface-raised); }
.copy-icon svg { width: 14px; height: 14px; }

.docs-content { min-height: 680px; padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: rgba(29, 29, 29, .52); }
body.light .docs-content { background: rgba(255, 255, 255, .76); }
.doc-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.doc-heading-main { min-width: 0; display: flex; gap: 14px; }
.doc-kind-mark { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--blue); background: rgba(47, 157, 235, .09); }
.doc-kind-mark.video { color: var(--green); background: rgba(5, 185, 131, .09); }
.doc-kind-mark.material { color: #d99a4a; background: rgba(217, 154, 74, .1); }
.doc-kind-mark svg { width: 20px; height: 20px; }
.doc-heading small { color: var(--blue); font: 800 11px Consolas, monospace; }
.doc-heading h2 { margin: 5px 0 0; font-size: 24px; line-height: 1.3; letter-spacing: 0; }
.doc-model-id { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: var(--muted); }
.doc-model-id code { font: 700 12px Consolas, monospace; }
.doc-model-id button { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
.doc-model-id button:hover { color: var(--text); background: var(--surface-raised); }
.doc-model-id svg { width: 12px; height: 12px; }
.doc-category { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface-soft); font-size: 11px; font-weight: 750; white-space: nowrap; }
.doc-summary { margin: 22px 0 0; color: #b7bcba; font-size: 14px; line-height: 1.75; }
body.light .doc-summary { color: #5f6966; }
.doc-route { min-height: 50px; display: grid; grid-template-columns: 58px minmax(0, 1fr) 34px; align-items: center; gap: 9px; margin-top: 19px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.doc-route-method { height: 100%; display: grid; place-items: center; color: #74c8ff; background: rgba(47, 157, 235, .09); font: 850 11px Consolas, monospace; }
.doc-route-method.get { color: #50d3a8; background: rgba(5, 185, 131, .09); }
.doc-route-method.delete { color: #ef9b8d; background: rgba(189, 75, 70, .09); }
.doc-route code { min-width: 0; overflow: hidden; font: 750 13px Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.doc-section { margin-top: 30px; }
.doc-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.doc-section-heading h3 { margin: 0; font-size: 15px; }
.doc-section-heading span { color: var(--muted); font-size: 11px; }
.doc-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.doc-table th, .doc-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.doc-table th { color: var(--muted); background: var(--surface-soft); font-size: 11px; white-space: nowrap; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table td:first-child code { color: #70bdf2; font: 700 12px Consolas, monospace; white-space: nowrap; }
.doc-table td:nth-child(2), .doc-table td:nth-child(3), .doc-table td:nth-child(4) { color: var(--muted); white-space: nowrap; }
.required-yes { color: #f0a28f; font-weight: 750; }
.optional-label { color: var(--muted); font-weight: 750; }
.code-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #131718; }
body.light .code-shell { background: #18201f; }
.code-toolbar { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 7px 5px 12px; border-bottom: 1px solid #2b3131; }
.code-tabs { display: flex; align-items: center; gap: 2px; }
.code-tabs button { height: 29px; padding: 0 10px; border: 0; border-radius: 5px; color: #89908e; background: transparent; font: 700 11px Consolas, monospace; }
.code-tabs button.active { color: #fff; background: #2b3232; }
.code-toolbar .copy-icon { color: #aeb5b2; }
.code-shell pre { min-height: 180px; max-height: 480px; margin: 0; overflow: auto; padding: 18px; color: #d9dfdc; font: 12px/1.7 Consolas, monospace; white-space: pre; }
.doc-note-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.doc-note-list li { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.doc-note-list svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 3px; color: var(--green); }
.flow-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.flow-step { min-width: 0; padding: 14px; background: var(--surface-soft); }
.flow-step span { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--blue); font: 800 11px Consolas, monospace; }
.flow-step strong { display: block; margin-top: 10px; font-size: 13px; }
.flow-step code { display: block; margin-top: 6px; overflow: hidden; color: var(--muted); font: 11px Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.response-block { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.response-block pre { margin: 0; overflow: auto; padding: 16px; color: #cbd3d0; font: 12px/1.7 Consolas, monospace; }
.material-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.material-guide-step { min-width: 0; display: grid; gap: 5px; padding: 13px 14px; background: var(--surface-soft); }
.material-guide-step b { color: var(--muted); font-size: 11px; }
.material-guide-step span { color: var(--muted); font-size: 12px; }
.material-guide-step code { overflow: hidden; color: #76bce9; font: 700 12px Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.material-operation-section { margin-top: 30px; }
.material-operation-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.material-operation-card { min-width: 0; min-height: 86px; display: grid; align-content: start; gap: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: var(--surface-soft); text-align: left; cursor: pointer; }
.material-operation-card:hover { border-color: var(--blue); background: var(--surface-raised); }
.material-operation-card.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(47, 157, 235, .14); background: rgba(47, 157, 235, .09); }
.material-operation-card strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.material-operation-card small { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.material-operation-method { width: max-content; padding: 3px 5px; border-radius: 4px; font: 800 9px Consolas, monospace; }
.material-operation-method.post { color: #79c6f8; background: rgba(47, 157, 235, .12); }
.material-operation-method.delete { color: #f0a28f; background: rgba(189, 75, 70, .12); }
.material-operation-card.active .material-operation-method { color: #fff; background: rgba(47, 157, 235, .5); }
.material-operation-card.active .material-operation-method.delete { background: rgba(189, 75, 70, .65); }
.material-operation-tip { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--blue); color: var(--muted); background: var(--surface-soft); font-size: 12px; line-height: 1.6; }
.material-operation-tip svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 2px; color: var(--blue); }
.material-wrapper-section { margin-top: 24px; }
.material-wrapper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.material-wrapper > div { min-width: 0; display: grid; gap: 5px; padding: 11px 12px; background: var(--surface-soft); }
.material-wrapper code { color: #70bdf2; font: 700 11px Consolas, monospace; }
.material-wrapper span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.material-wrapper b { color: var(--text); font-weight: 700; }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.overview-item { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.overview-item svg { width: 20px; height: 20px; color: var(--blue); }
.overview-item h3 { margin: 13px 0 0; font-size: 14px; }
.overview-item p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.overview-item code { color: #76bce9; font: 700 11px Consolas, monospace; }
.docs-footer { margin-top: 0; }

/* Keep documentation controls and surfaces aligned with the console design. */
.docs-service-state, .docs-sidebar, .docs-connection, .docs-content, .doc-table-wrap, .code-shell, .response-block, .material-operation-card, .overview-item { border-radius: var(--console-radius-md, 10px); }
.docs-search { border-radius: var(--console-radius-md, 10px); }
.docs-search:focus-within { border-color: var(--console-primary, #4f46e5); box-shadow: 0 0 0 3px var(--console-primary-soft, rgba(79,70,229,.08)); }
.docs-nav-item { border-radius: var(--console-radius-sm, 8px); }
.docs-nav-item:hover { color: var(--console-primary, #4f46e5); background: var(--console-primary-soft, rgba(79,70,229,.08)); }
.docs-nav-item.active, body.light .docs-nav-item.active { color: var(--console-primary, #4f46e5); background: var(--console-primary-soft, rgba(79,70,229,.08)); }
.docs-nav-item.active .nav-method { color: var(--console-primary, #4f46e5); background: rgba(79,70,229,.12); }
.doc-route, .material-operation-tip { border-radius: var(--console-radius-sm, 8px); }
.material-operation-card:hover, .material-operation-card.active { border-color: var(--console-primary, #4f46e5); }
.copy-icon:focus-visible, .docs-menu-toggle:focus-visible, .docs-nav-item:focus-visible, .material-operation-card:focus-visible, .code-tabs button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--console-primary-soft, rgba(79,70,229,.08)); }
.docs-console-link { border-radius: var(--console-radius-md, 10px); }

@media (max-width: 1100px) {
  .docs-container { width: min(100% - 36px, 1440px); }
  .docs-workspace { grid-template-columns: 250px minmax(0, 1fr); }
  .docs-content { padding: 24px; }
  .docs-connection { display: grid; }
  .connection-item + .connection-item { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 820px) {
  .docs-intro-inner { min-height: 210px; align-items: flex-start; flex-direction: column; justify-content: center; }
  .docs-service-state { width: 100%; }
  .docs-workspace { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; max-height: none; }
  .docs-nav { max-height: 360px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow-y: auto; scrollbar-width: thin; }
  .docs-nav section + section { margin-top: 0; padding-top: 0; border-top: 0; }
  .docs-sidebar-foot { display: none; }
  .flow-grid { grid-template-columns: 1fr; }
  .material-operation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .material-guide, .material-wrapper { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .docs-container { width: min(100% - 24px, 1440px); }
  .docs-intro h1 { font-size: 29px; }
  .docs-intro-inner { padding-top: 30px; padding-bottom: 30px; }
  .docs-console-link { width: 34px; min-width: 34px; padding: 0; border-radius: 50%; }
  .docs-console-link span { display: none; }
  .docs-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-content { min-height: 600px; padding: 18px 14px; }
  .doc-heading { display: block; }
  .doc-heading h2 { font-size: 20px; }
  .doc-category { display: inline-flex; margin: 14px 0 0 56px; }
  .doc-route { grid-template-columns: 54px minmax(0, 1fr) 32px; }
  .doc-table th, .doc-table td { padding: 10px; }
  .overview-grid { grid-template-columns: 1fr; }
  .material-operation-grid { grid-template-columns: 1fr; }
  .connection-item, .connection-item.connection-base { grid-template-columns: 1fr 30px; gap: 5px; }
  .connection-item > span { grid-column: 1 / -1; }
  .connection-item:not(.connection-base) { grid-template-columns: 1fr; }
}
