/* Stash API reference theme for Swagger UI */
:root {
    --stash-accent: #fe4f10;
    --stash-accent-hover: #e04400;
    --stash-bg: #141414;
    --stash-surface: #1f1f1f;
    --stash-surface-2: #2a2a2a;
    --stash-border: #333333;
    --stash-text: #f2f2f2;
    --stash-text-muted: #9a9a9a;
}

/*
 * Swagger UI follows the OS colour scheme by adding `dark-mode` to <html> and restyling everything
 * through `html.dark-mode .swagger-ui …`. The theme is the same in both schemes, so every selector
 * below is prefixed with `html:root` to match that specificity and win by source order.
 */

html:root,
html:root body,
html:root .swagger-ui {
    background: var(--stash-bg);
}

html:root .swagger-ui .topbar {
    display: none;
}

html:root .swagger-ui,
html:root .swagger-ui .info .title,
html:root .swagger-ui .info p,
html:root .swagger-ui .info li,
html:root .swagger-ui .info h2,
html:root .swagger-ui .info h3,
html:root .swagger-ui .opblock-tag,
html:root .swagger-ui .opblock .opblock-summary-description,
html:root .swagger-ui .opblock .opblock-summary-path,
html:root .swagger-ui .opblock-description-wrapper p,
html:root .swagger-ui .opblock-section-header h4,
html:root .swagger-ui .parameter__name,
html:root .swagger-ui .parameter__type,
html:root .swagger-ui .response-col_status,
html:root .swagger-ui .response-col_description,
html:root .swagger-ui table thead tr th,
html:root .swagger-ui table thead tr td,
html:root .swagger-ui .model-title,
html:root .swagger-ui .model,
html:root .swagger-ui .prop-type,
html:root .swagger-ui .model .prop-type,
html:root .swagger-ui .tab li,
html:root .swagger-ui .responses-inner h4,
html:root .swagger-ui .responses-inner h5,
html:root .swagger-ui label,
html:root .swagger-ui .scheme-container .schemes-title,
html:root .swagger-ui .dialog-ux .modal-ux-header h3,
html:root .swagger-ui .dialog-ux .modal-ux-content p,
html:root .swagger-ui .dialog-ux .modal-ux-content h4,
html:root .swagger-ui .auth-container .wrapper,
html:root .swagger-ui section.models h4 {
    color: var(--stash-text);
}

html:root .swagger-ui .info .title small pre,
html:root .swagger-ui .parameter__in,
html:root .swagger-ui .prop-format,
html:root .swagger-ui .model .property.primitive,
html:root .swagger-ui .opblock .opblock-summary-operation-id {
    color: var(--stash-text-muted);
}

html:root .swagger-ui .info .title small,
html:root .swagger-ui .info .title small.version-stamp {
    background: var(--stash-surface-2);
}

html:root .swagger-ui .info a,
html:root .swagger-ui .opblock-tag small,
html:root .swagger-ui .opblock-tag small p,
html:root .swagger-ui .markdown code,
html:root .swagger-ui .renderedMarkdown code {
    color: var(--stash-accent);
}

/* Inline code sits on the text line; Swagger's 5px vertical padding makes lines overlap. */
html:root .swagger-ui .markdown code,
html:root .swagger-ui .renderedMarkdown code {
    background: var(--stash-surface-2);
    font-size: 0.9em;
    font-weight: 500;
    line-height: inherit;
    padding: 1px 5px;
    vertical-align: baseline;
}

html:root .swagger-ui .markdown pre > code,
html:root .swagger-ui .renderedMarkdown pre > code {
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 12px;
}

html:root .swagger-ui .info p,
html:root .swagger-ui .info li,
html:root .swagger-ui .opblock-description-wrapper p,
html:root .swagger-ui .response-col_description p {
    line-height: 1.5;
}

html:root .swagger-ui .scheme-container,
html:root .swagger-ui section.models,
html:root .swagger-ui section.models .model-container,
html:root .swagger-ui .dialog-ux .modal-ux {
    background: var(--stash-surface);
    border-color: var(--stash-border);
    box-shadow: none;
}

html:root .swagger-ui .opblock-tag {
    border-bottom-color: var(--stash-border);
}

html:root .swagger-ui .opblock,
html:root .swagger-ui .opblock.opblock-get,
html:root .swagger-ui .opblock.opblock-post,
html:root .swagger-ui .opblock.opblock-delete,
html:root .swagger-ui .opblock.opblock-put,
html:root .swagger-ui .opblock .opblock-section-header,
html:root .swagger-ui .opblock.opblock-get .opblock-section-header,
html:root .swagger-ui .opblock.opblock-post .opblock-section-header,
html:root .swagger-ui .opblock.opblock-delete .opblock-section-header,
html:root .swagger-ui .opblock.opblock-put .opblock-section-header {
    background: var(--stash-surface);
    border-color: var(--stash-border);
    box-shadow: none;
}

html:root .swagger-ui .opblock .opblock-summary,
html:root .swagger-ui .opblock.opblock-get .opblock-summary,
html:root .swagger-ui .opblock.opblock-post .opblock-summary,
html:root .swagger-ui .opblock.opblock-delete .opblock-summary,
html:root .swagger-ui .opblock.opblock-put .opblock-summary,
html:root .swagger-ui .opblock.opblock-get thead tr td,
html:root .swagger-ui .opblock.opblock-get thead tr th,
html:root .swagger-ui .opblock.opblock-post thead tr td,
html:root .swagger-ui .opblock.opblock-post thead tr th,
html:root .swagger-ui .opblock.opblock-get .opblock-body > .opblock-description-wrapper,
html:root .swagger-ui .opblock.opblock-get .opblock-body > .opblock-external-docs-wrapper,
html:root .swagger-ui .opblock.opblock-get .opblock-body > .opblock-title_normal,
html:root .swagger-ui .opblock.opblock-post .opblock-body > .opblock-description-wrapper,
html:root .swagger-ui .opblock.opblock-post .opblock-body > .opblock-external-docs-wrapper,
html:root .swagger-ui .opblock.opblock-post .opblock-body > .opblock-title_normal {
    border-color: var(--stash-border);
}

html:root .swagger-ui .opblock.opblock-get .opblock-summary-method,
html:root .swagger-ui .opblock.opblock-post .opblock-summary-method,
html:root .swagger-ui .opblock.opblock-delete .opblock-summary-method,
html:root .swagger-ui .opblock.opblock-put .opblock-summary-method {
    background: var(--stash-accent);
    color: #ffffff;
    text-shadow: none;
}

html:root .swagger-ui .opblock.opblock-get .opblock-section-header .tab-header .tab-item .opblock-title span::after,
html:root .swagger-ui .opblock.opblock-post .opblock-section-header .tab-header .tab-item .opblock-title span::after {
    background: var(--stash-accent);
}

html:root .swagger-ui .opblock-body pre.microlight,
html:root .swagger-ui .opblock pre.microlight,
html:root .swagger-ui .opblock .highlight-code pre.microlight,
html:root .swagger-ui .highlight-code > .microlight {
    background: var(--stash-bg) !important;
    color: var(--stash-text);
}

html:root .swagger-ui .model-box,
html:root .swagger-ui .responses-table .response-col_description .response-control-media-type--accept-controlled select,
html:root .swagger-ui select,
html:root .swagger-ui input[type='text'],
html:root .swagger-ui input[type='password'],
html:root .swagger-ui textarea {
    background: var(--stash-surface-2);
    color: var(--stash-text);
    border-color: var(--stash-border);
}

html:root .swagger-ui input:focus:not(.download-url-input),
html:root .swagger-ui select:focus,
html:root .swagger-ui textarea:focus {
    border-color: var(--stash-accent) !important;
    box-shadow: none;
    outline: none;
}

html:root .swagger-ui .btn {
    color: var(--stash-text);
    border-color: var(--stash-border);
    box-shadow: none;
}

html:root .swagger-ui .btn.authorize,
html:root .swagger-ui .scheme-container .btn.authorize,
html:root .swagger-ui .dialog-ux .modal-ux .btn.modal-btn.authorize,
html:root .swagger-ui .btn.execute,
html:root .swagger-ui .opblock .btn.execute {
    background: var(--stash-accent);
    border-color: var(--stash-accent);
    color: #ffffff;
}

html:root .swagger-ui .btn.authorize svg,
html:root .swagger-ui .scheme-container .btn.authorize svg {
    fill: #ffffff;
}

html:root .swagger-ui .btn.authorize:hover,
html:root .swagger-ui .scheme-container .btn.authorize:hover,
html:root .swagger-ui .dialog-ux .modal-ux .btn.modal-btn.authorize:hover,
html:root .swagger-ui .btn.execute:hover,
html:root .swagger-ui .opblock .btn.execute:hover {
    background: var(--stash-accent-hover);
    border-color: var(--stash-accent-hover);
}

html:root .swagger-ui .authorization__btn svg {
    fill: var(--stash-text-muted);
}

html:root .swagger-ui .authorization__btn.locked svg {
    fill: var(--stash-accent);
}

html:root .swagger-ui .tab li button.tablinks {
    color: var(--stash-text-muted);
}

html:root .swagger-ui .tab li.active button.tablinks {
    color: var(--stash-text);
}

html:root .swagger-ui svg.arrow,
html:root .swagger-ui .expand-operation svg,
html:root .swagger-ui .model-toggle::after {
    fill: var(--stash-text-muted);
}

html:root .swagger-ui .model-toggle::after {
    filter: invert(0.8);
}

html:root .swagger-ui .loading-container .loading::before {
    border-color: var(--stash-accent) transparent transparent;
}
