/* iCount API docs - layout glue only.
 * Brand colors, typography, and most component styling come from /style/icount.css.
 * Inline overrides here are limited to:
 *   - the two-pane layout (sidebar + main)
 *   - code blocks (highlight.js wrapper tweaks)
 *   - small alignment fixes that don't have a brand utility class.
 */

html, body, .api-docs-body {
	height: 100%;
	margin: 0;
	padding: 0;
	background: #ffffff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #1f2937;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
	font-weight: 600;
	color: #111827;
	margin-top: 0;
}
h1 { font-size: 22px; margin-bottom: 8px; }
h2 { font-size: 18px; margin-bottom: 6px; }
h3 { font-size: 15px; margin-bottom: 6px; }

a { color: #0d6efd; text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .docs-mono {
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
code:not(pre code) {
	background: #f1f3f5;
	padding: 1px 6px;
	border-radius: 3px;
	font-size: 90%;
	color: #d6336c;
}
.card-header code:not(pre code),
.docs-method .card-header code:not(pre code) {
	background: transparent;
	color: inherit;
	padding: 0;
	font-size: inherit;
}
pre { margin: 0; }

* { box-sizing: border-box; }

/* ---------- Utility shims (icount-bootstrap.css ships only a subset) ---------- */

.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-wrap { flex-wrap: wrap !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.position-relative { position: relative !important; }

.mr-auto { margin-right: auto !important; }
.mr-2 { margin-right: 0.5rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.p-0 { padding: 0 !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }

.text-center { text-align: center !important; }
.text-muted { color: #6b7280 !important; }
.text-danger { color: #dc3545 !important; }
.text-success { color: #198754 !important; }
.bg-white { background-color: #ffffff !important; }
.border-left-0 { border-left: 0 !important; }
.border-right-0 { border-right: 0 !important; }
.list-unstyled { list-style: none; padding-left: 0; margin: 0; }
.small { font-size: 85%; }
.rounded { border-radius: 4px !important; }

/* Inputs */
.form-control {
	display: block;
	width: 100%;
	padding: 6px 10px;
	font-size: 14px;
	line-height: 1.5;
	color: #1f2937;
	background: #ffffff;
	border: 1px solid #ced4da;
	border-radius: 4px;
	outline: none;
}
.form-control:focus {
	border-color: #80bdff;
	box-shadow: 0 0 0 0.15rem rgba(13,110,253,0.18);
}

.input-group {
	position: relative;
	display: flex;
	align-items: stretch;
	width: 100%;
}
.input-group > .form-control,
.input-group > .input-group-prepend,
.input-group > .input-group-append { display: flex; }
.input-group > .form-control { flex: 1 1 auto; width: 1%; }
.input-group-text {
	display: flex;
	align-items: center;
	padding: 6px 10px;
	font-size: 14px;
	color: #6b7280;
	background: #f8f9fa;
	border: 1px solid #ced4da;
}
.input-group-prepend .input-group-text { border-right: 0; border-radius: 4px 0 0 4px; }
.input-group-append .input-group-text,
.input-group-append .btn { border-radius: 0 4px 4px 0; margin-left: -1px; }
.input-group > .form-control:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > .form-control:not(:last-child)  { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* Buttons */
.btn {
	display: inline-block;
	padding: 6px 12px;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
	border: 1px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	text-decoration: none;
	background: #e5e7eb;
	color: #1f2937;
}
.btn:hover { filter: brightness(0.95); text-decoration: none; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn-primary   { background: #0d6efd; color: #fff; border-color: #0d6efd; }
.btn-secondary { background: #6c757d; color: #fff; border-color: #6c757d; }
.btn-success   { background: #198754; color: #fff; border-color: #198754; }

/* Card */
.card {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	overflow: hidden;
}
.card-header {
	padding: 12px 16px;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
}
.card-title { font-size: 16px; font-weight: 600; margin: 0; }
.card-body { padding: 16px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 12px; }
.alert-info    { background: #cfe2ff; color: #084298; border: 1px solid #b6d4fe; }
.alert-warning { background: #fff3cd; color: #664d03; border: 1px solid #ffecb5; }
.alert-danger  { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }

/* Tables */
.table-responsive { overflow-x: auto; }
.table {
	width: 100%;
	margin-bottom: 0;
	border-collapse: collapse;
}
.table th, .table td {
	padding: 8px 10px;
	border-bottom: 1px solid #e5e7eb;
	text-align: left;
	vertical-align: top;
}
.table thead th { border-bottom: 2px solid #d1d5db; }

/* Nav tabs */
.nav { display: flex; padding: 0; margin: 0; list-style: none; }
.nav-tabs { border-bottom: 1px solid #dee2e6; }
.nav-item { list-style: none; }
.nav-link {
	display: block;
	padding: 8px 14px;
	color: #495057;
	text-decoration: none;
	border: 1px solid transparent;
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
}
.nav-link:hover { color: #0d6efd; text-decoration: none; }
.nav-tabs .nav-link.active {
	color: #1f2937;
	background: #fff;
	border-color: #dee2e6 #dee2e6 #fff;
}

/* List group */
.list-group { display: flex; flex-direction: column; padding-left: 0; margin-bottom: 0; }
.list-group-flush .list-group-item { border-radius: 0; border-left: 0; border-right: 0; }
.list-group-item {
	display: block;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-top: 0;
}
.list-group-item:first-child { border-top: 1px solid #e5e7eb; }

#api_docs {
	height: 100vh;
	display: flex;
}

/* ---------- Sidebar ---------- */

.docs-sidebar {
	width: 300px;
	min-width: 300px;
	max-width: 300px;
	height: 100vh;
	overflow-y: auto;
	border-right: 1px solid #e5e7eb;
	background: #f8f9fa;
	display: flex;
	flex-direction: column;
}

.docs-sidebar-header {
	padding: 16px 20px;
	border-bottom: 1px solid #e5e7eb;
}

.docs-brand {
	color: inherit;
	text-decoration: none;
	font-size: 16px;
}
.docs-brand:hover { text-decoration: none; }
.docs-brand-logo { height: 18px; width: auto; display: block; }
.docs-brand-text { font-weight: 700; color: #1f2937; }

.docs-sidebar-nav {
	flex-grow: 1;
	overflow-y: auto;
	padding-bottom: 24px;
}

.docs-nav-heading {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #6b7280;
	padding: 12px 20px 6px 20px;
}

.docs-nav-link,
.docs-nav-method {
	display: block;
	padding: 7px 20px;
	color: #1f2937;
	text-decoration: none;
	font-size: 14px;
	border-left: 3px solid transparent;
}
.docs-nav-link:hover,
.docs-nav-method:hover {
	background: #eef2f7;
	color: #0d6efd;
	text-decoration: none;
}
.docs-nav-link.active,
.docs-nav-method.active {
	background: #e7f1ff;
	border-left-color: #0d6efd;
	color: #0d6efd;
	font-weight: 600;
}

.docs-method-list {
	display: none;
	margin: 0;
	padding: 0 0 6px 0;
}
.docs-method-list > li > a {
	display: block;
	padding: 5px 20px 5px 44px;
	color: #4b5563;
	text-decoration: none;
	font-size: 13px;
	border-left: 3px solid transparent;
}
.docs-method-list > li > a:hover {
	background: #eef2f7;
	color: #0d6efd;
	text-decoration: none;
}
.docs-method-list > li > a.active {
	background: #e7f1ff;
	border-left-color: #0d6efd;
	color: #0d6efd;
	font-weight: 600;
}

.docs-module-item.expanded .docs-method-list { display: block; }
.docs-module-item.expanded .docs-nav-caret { transform: rotate(90deg); }
.docs-nav-caret { transition: transform 0.15s ease; font-size: 10px; }

/* ---------- Main pane ---------- */

.docs-main {
	height: 100vh;
	overflow-y: auto;
	background: #ffffff;
}

.docs-content {
	max-width: none;
	margin: 0;
}

.docs-card { border: 1px solid #e5e7eb; }
.docs-card > .card-header { background: #f9fafb; }

.docs-section-title {
	font-size: 16px;
	font-weight: 600;
	margin-top: 8px;
	margin-bottom: 8px;
	color: #1f2937;
}

.docs-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.docs-kind-tag {
	display: inline-block;
	padding: 1px 8px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: #ffffff;
	border-radius: 10px;
	text-transform: uppercase;
}
.docs-kind-type { background: #6f42c1; }

.docs-type-link {
	color: #6f42c1;
	border-bottom: 1px dotted #6f42c1;
}
.docs-type-link:hover { text-decoration: none; color: #5a32a3; border-bottom-style: solid; }

.docs-http-method {
	display: inline-block;
	padding: 2px 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: #ffffff;
	background: #198754;
	border-radius: 3px;
	text-transform: uppercase;
}

.docs-method-highlight {
	animation: docs-flash 1.5s ease;
}
@keyframes docs-flash {
	0%   { box-shadow: 0 0 0 4px rgba(13,110,253,0.35); }
	100% { box-shadow: 0 0 0 0   rgba(13,110,253,0);    }
}

/* ---------- Params tables ---------- */

.docs-params-table th,
.docs-params-table td {
	vertical-align: top;
	font-size: 13px;
}
.docs-params-table th {
	background: #f9fafb;
	font-weight: 600;
	color: #374151;
	white-space: nowrap;
}
.docs-params-table code { font-size: 12.5px; }

/* ---------- Samples ---------- */

.docs-samples-card { background: #0f172a; }
.docs-samples-card .card-header { background: #1e293b; border-bottom: 1px solid #334155; }

.docs-samples-tabs.nav-tabs { border-bottom: none; padding: 0 8px; flex-wrap: wrap; }
.docs-samples-tabs .nav-link {
	color: #e2e8f0;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 10px 14px;
	background: transparent;
}
.docs-samples-tabs .nav-link:hover { color: #ffffff; }
.docs-samples-tabs .nav-link.active {
	color: #ffffff;
	background: transparent;
	border-bottom-color: #60a5fa;
	font-weight: 600;
}

.docs-sample-pre,
.docs-sample-pre * {
	color: #ffffff;
}
.docs-sample-pre {
	margin: 0;
	padding: 16px 18px;
	background: #0f172a;
	font-size: 13px;
	line-height: 1.5;
	overflow-x: auto;
	max-height: 520px;
}
.docs-sample-pre code {
	background: transparent;
	color: inherit;
	padding: 0;
	border: 0;
}

.docs-copy-code-btn {
	position: absolute;
	top: 8px;
	right: 12px;
	z-index: 2;
	opacity: 0.85;
}
.docs-copy-code-btn:hover { opacity: 1; }

.docs-toggle-optional input { vertical-align: middle; margin-right: 4px; }

/* ---------- Example blocks ---------- */

.docs-example-title {
	font-weight: 600;
	margin-bottom: 6px;
	color: #374151;
}
.docs-example pre {
	background: #f8f9fa;
	border: 1px solid #e5e7eb;
	padding: 12px 14px;
	border-radius: 4px;
	font-size: 13px;
	margin: 0;
}

/* ---------- Markdown (welcome page) ---------- */

.docs-markdown h1 { font-size: 24px; }
.docs-markdown h2 { font-size: 20px; margin-top: 24px; }
.docs-markdown h3 { font-size: 16px; margin-top: 20px; }
.docs-markdown p, .docs-markdown li { line-height: 1.6; }
.docs-markdown code:not(pre code) {
	background: #f1f3f5;
	padding: 1px 6px;
	border-radius: 3px;
	font-size: 90%;
}
.docs-markdown pre,
.docs-markdown pre * {
	color: #ffffff;
}
.docs-markdown pre {
	background: #0f172a;
	padding: 14px 16px;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.5;
	overflow-x: auto;
	margin: 10px 0 16px;
}
.docs-markdown pre code {
	background: transparent;
	color: inherit;
	padding: 0;
	font-size: inherit;
}
.docs-markdown hr {
	border: 0;
	border-top: 1px solid #e5e7eb;
	margin: 28px 0;
}
.docs-markdown blockquote {
	border-left: 3px solid #d1d5db;
	margin: 12px 0;
	padding: 6px 14px;
	color: #4b5563;
	background: #f9fafb;
}

/* ---------- Method info grid (welcome page) ---------- */

.method-info {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin: 16px 0 18px;
}
.method-info-card {
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	background: #fff;
	padding: 12px 14px;
	border-top: 3px solid #9ca3af;
}
.method-info-when { border-top-color: #2563eb; }
.method-info-pros { border-top-color: #059669; }
.method-info-cons { border-top-color: #d97706; }
.method-info-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #374151;
	margin-bottom: 8px;
}
.method-info-when .method-info-title { color: #2563eb; }
.method-info-pros .method-info-title { color: #059669; }
.method-info-cons .method-info-title { color: #b45309; }
.method-info-card ul {
	list-style: disc;
	padding-left: 18px;
	margin: 0;
}
.method-info-card li {
	font-size: 13px;
	line-height: 1.5;
	margin-bottom: 4px;
}
.method-info-card li:last-child { margin-bottom: 0; }

@media (max-width: 768px) {
	.method-info { grid-template-columns: 1fr; }
}

/* ---------- Auth comparison cards (welcome page) ---------- */

.auth-compare {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	margin: 16px 0 24px;
}
.auth-card {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.auth-card-recommended {
	border-color: #2563eb;
	box-shadow: 0 2px 6px rgba(37,99,235,0.12);
	background: linear-gradient(180deg, #f5f9ff 0%, #ffffff 60%);
}
.auth-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid #f1f3f5;
}
.auth-card-title {
	font-weight: 600;
	font-size: 15px;
	color: #111827;
}
.auth-card-badge {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #fff;
	background: #2563eb;
	padding: 2px 8px;
	border-radius: 999px;
}
.auth-card ul {
	list-style: none;
	padding: 0;
	margin: 0;
}
.auth-card li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 6px 0;
	border-bottom: 1px dashed #f1f3f5;
	font-size: 13px;
	line-height: 1.4;
}
.auth-card li:last-child { border-bottom: 0; }
.auth-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #6b7280;
	font-weight: 600;
}
.auth-sec-best { color: #059669; font-weight: 500; }
.auth-sec-good { color: #2563eb; font-weight: 500; }
.auth-sec-low  { color: #b45309; font-weight: 500; }

@media (max-width: 768px) {
	.auth-compare { grid-template-columns: 1fr; }
}

/* ---------- Notes ---------- */

.docs-notes {
	list-style: none;
	padding-left: 0;
}
.docs-notes li {
	padding: 6px 12px;
	border-left: 3px solid #e5e7eb;
	margin-bottom: 6px;
	background: #f9fafb;
	font-size: 13px;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
	#api_docs { flex-direction: column; height: auto; }
	.docs-sidebar {
		width: 100%;
		min-width: 0;
		max-width: none;
		height: auto;
		max-height: 60vh;
		border-right: 0;
		border-bottom: 1px solid #e5e7eb;
	}
	.docs-main { height: auto; }
}
