/* Kolab Help Center — native port of the Mantine theme used by docs.getkolab.ai */
:root {
	--kolab-coral: #ff6b6b;
	--kolab-teal: #20c997;
	--kolab-amber: #fcc419;

	--teal-0: #e6fcf5; --teal-6: #12b886; --teal-7: #0ca678; --teal-8: #099268;
	--coral-0: #fff5f5; --coral-5: #ff6b6b; --coral-7: #f03e3e;
	--gray-0: #f8f9fa; --gray-1: #f1f3f5; --gray-2: #e9ecef; --gray-3: #dee2e6; --gray-5: #adb5bd; --gray-6: #868e96; --gray-7: #495057;
	--dimmed: #868e96;
	--text: #1a1a2e;

	--radius-xs: 0.5rem; --radius-sm: 0.75rem; --radius-md: 1rem; --radius-lg: 1.5rem;
	--space-xs: 0.625rem; --space-sm: 0.75rem; --space-md: 1rem; --space-lg: 1.25rem; --space-xl: 2rem;

	--shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 10px 15px -5px rgba(0, 0, 0, 0.05), 0 7px 7px -5px rgba(0, 0, 0, 0.04);
	--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);

	--font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { font-family: var(--font); font-size: 1rem; line-height: 1.55; color: var(--text); background: #fff; max-width: 100vw; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal-6); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; left: -9999px; top: 0.5rem; background: #fff; padding: 0.5rem 1rem; border-radius: var(--radius-xs); z-index: 2000; box-shadow: var(--shadow-md); }
.skip-link:focus { left: 0.5rem; }

.container { margin: 0 auto; padding: 0 var(--space-md); }
.container-md { max-width: 960px; }
.container-lg { max-width: 1140px; }

.dimmed { color: var(--dimmed); }
.small { font-size: 0.875rem; }
.xs { font-size: 0.75rem; }
.center { text-align: center; }
.link-teal { color: var(--teal-6); }
.link-coral { color: var(--coral-5); }
.link-blue { color: #228be6; }
.link-teal:hover, .link-coral:hover, .link-blue:hover { text-decoration: underline; }

/* ---------- header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--gray-2); position: relative; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.logo img { display: block; width: 100px; height: 32px; object-fit: contain; }
.nav-desktop { display: flex; align-items: center; gap: var(--space-lg); font-size: 0.875rem; }
.nav-desktop a:hover { color: var(--teal-7); }
[data-nav].active { color: var(--teal-7); font-weight: 600; }
.search-trigger { display: flex; align-items: center; gap: 0.625rem; padding: 6px var(--space-sm); border: 1px solid var(--gray-3); border-radius: var(--radius-md); background: var(--gray-0); color: var(--dimmed); font-size: 0.875rem; }
.search-trigger svg { color: var(--gray-5); }
.search-trigger kbd { margin-left: var(--space-md); }
.nav-mobile-actions { display: none; gap: 0.625rem; align-items: center; }
.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-md); color: var(--gray-7); }
.icon-btn:hover { background: var(--gray-1); }
.burger span, .burger span::before, .burger span::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform 0.2s, background 0.2s; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }
.nav-drawer { display: flex; flex-direction: column; gap: var(--space-lg); padding: var(--space-xl) var(--space-md); background: #fff; position: fixed; inset: 57px 0 0 0; z-index: 1000; font-size: 1.125rem; }
.nav-drawer[hidden] { display: none; }
.nav-drawer hr { border: 0; border-top: 1px solid var(--gray-2); }
.nav-drawer .dimmed { font-size: 0.875rem; }
@media (max-width: 767px) {
	.nav-desktop { display: none; }
	.nav-mobile-actions { display: flex; }
}

/* ---------- typography ---------- */
.page-title { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: var(--space-sm); }
.lede { font-size: 1.125rem; color: var(--dimmed); max-width: 600px; }
.lede-xl { font-size: 1.25rem; }
@media (max-width: 575px) { .page-title { font-size: 2rem; } }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 0.3rem; height: 1.25rem; padding: 0 0.5rem; border-radius: 1000px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.25px; text-transform: uppercase; white-space: nowrap; vertical-align: middle; }
.badge-lg { height: 1.625rem; padding: 0 0.875rem; font-size: 0.8125rem; margin-bottom: var(--space-md); }
.badge-teal { background: rgba(18, 184, 134, 0.1); color: var(--teal-6); }
.badge-coral { background: rgba(255, 107, 107, 0.1); color: var(--coral-5); }
.badge-grape { background: rgba(190, 75, 219, 0.1); color: #be4bdb; }
.badge-blue { background: rgba(34, 139, 230, 0.1); color: #228be6; }
.badge-gray { background: rgba(134, 142, 150, 0.1); color: var(--gray-6); }
.badge-outline { border: 1px solid var(--teal-6); color: var(--teal-6); background: transparent; }
.badge-link:hover { background: rgba(18, 184, 134, 0.18); }
.badges { display: flex; flex-wrap: wrap; gap: 0.625rem; }

/* ---------- cards ---------- */
.card { display: block; background: #fff; border: 1px solid var(--gray-3); border-radius: var(--radius-lg); padding: var(--space-lg); color: inherit; }
a.card { transition: transform 0.15s, box-shadow 0.15s; }
.card-xl { padding: var(--space-xl); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: var(--space-md); }
.card-sm { padding: var(--space-md); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); display: flex; flex-direction: column; }
a.card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
a.interactive:hover, .card-sm:hover, .usecase-card:hover { transform: translateY(-2px); }
.card-head { display: flex; align-items: center; gap: var(--space-md); }
.card-title-lg { display: block; font-weight: 600; font-size: 1.125rem; line-height: 1.4; }
.card-title { display: block; font-weight: 500; font-size: 0.875rem; }
.card-desc { display: block; font-size: 0.875rem; color: var(--dimmed); }
.card-desc.xs { font-size: 0.75rem; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.theme-icon { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-md); flex-shrink: 0; }
.theme-icon-xl { width: 44px; height: 44px; }
.theme-icon-lg { width: 42px; height: 42px; margin-bottom: var(--space-sm); }
.theme-icon-48 { width: 48px; height: 48px; }
.tint-teal { background: rgba(18, 184, 134, 0.1); color: var(--teal-6); }
.tint-coral { background: rgba(255, 107, 107, 0.1); color: var(--coral-5); }
.tint-grape { background: rgba(190, 75, 219, 0.1); color: #be4bdb; }
.tint-amber { background: rgba(250, 176, 5, 0.1); color: #f59f00; }
.tint-gray { background: rgba(134, 142, 150, 0.1); color: var(--gray-6); }
.tint-violet { background: rgba(121, 80, 242, 0.1); color: #7950f2; }
.tint-blue { background: rgba(34, 139, 230, 0.1); color: #228be6; }
.tint-green { background: rgba(64, 192, 87, 0.1); color: #40c057; }
.tint-orange { background: rgba(253, 126, 20, 0.1); color: #fd7e14; }
.tint-cyan { background: rgba(21, 170, 191, 0.1); color: #15aabf; }
.tint-pink { background: rgba(230, 73, 128, 0.1); color: #e64980; }

.grid { display: grid; gap: var(--space-lg); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
@media (max-width: 991px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 575px) { .grid-4 { grid-template-columns: 1fr; } }

/* ---------- home ---------- */
.home-hero { text-align: center; padding-top: 4rem; padding-bottom: 4rem; display: flex; flex-direction: column; align-items: center; gap: var(--space-lg); }
.home-hero h1 { font-size: 3rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.home-popular { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.home-popular h2 { font-size: 1.375rem; font-weight: 600; margin-bottom: var(--space-lg); }

/* ---------- section index ---------- */
.section-page { display: flex; flex-direction: column; gap: var(--space-xl); padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-md); padding: var(--space-lg); border-radius: var(--radius-md); color: #fff; }
.cta-teal { background: linear-gradient(135deg, var(--teal-6) 0%, #15aabf 100%); }
.cta-coral { background: linear-gradient(135deg, #ff922b 0%, #ff6b6b 100%); }
.cta-grape { background: linear-gradient(135deg, #cc5de8 0%, #845ef7 100%); }
.cta-title { font-weight: 600; font-size: 1.125rem; }
.cta-text { font-size: 0.875rem; color: rgba(255, 255, 255, 0.85); }
.cta-btn { background: #fff; padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.cta-teal .cta-btn { color: var(--teal-7); }
.cta-coral .cta-btn { color: #f76707; }
.cta-grape .cta-btn { color: #ae3ec9; }
.cta-btn:hover { box-shadow: var(--shadow-md); }
.group-head { display: flex; align-items: baseline; gap: var(--space-sm); margin-bottom: 4px; }
.group-head h2 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
.count { font-size: 0.75rem; font-weight: 500; color: var(--dimmed); }
.group-desc { font-size: 0.875rem; color: var(--dimmed); margin-bottom: var(--space-md); max-width: 620px; }
.list { display: flex; flex-direction: column; gap: var(--space-sm); }
.list-card { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); }
.list-card .card-title-lg { margin-bottom: var(--space-xs); }
.list-card .badge { margin-left: var(--space-xs); }
.list-card:hover { transform: translateX(4px); }
.chev { color: var(--gray-6); display: inline-flex; padding: 0.5rem; flex-shrink: 0; }
.usecase-card { display: flex; gap: var(--space-md); align-items: flex-start; }
.usecase-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.usecase-body .card-desc { margin-bottom: var(--space-xs); }
.paper { border: 1px solid var(--gray-3); border-radius: var(--radius-lg); padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-xs); font-size: 0.875rem; }
.paper-gray { background: var(--gray-0); font-size: 1rem; }
.paper-title { font-weight: 600; }
.paper .paper-title { font-size: inherit; }
.link-row { display: flex; flex-wrap: wrap; gap: var(--space-md); font-size: 0.875rem; }
.center-row { justify-content: center; align-items: center; }
.btn { background: var(--teal-6); color: #fff; padding: 0.6rem 1.25rem; border-radius: var(--radius-xs); font-weight: 600; }
.btn:hover { background: var(--teal-7); }

/* ---------- article ---------- */
.article-hero { background: var(--gray-0); padding: var(--space-xl) 0; margin-bottom: var(--space-xl); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: var(--space-xs); font-size: 0.875rem; color: var(--dimmed); margin-bottom: var(--space-md); }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--text); }
.article-hero .lede { margin-bottom: var(--space-md); }
.article-footer { display: flex; flex-direction: column; gap: var(--space-lg); padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
@media (max-width: 575px) { .prev-next { grid-template-columns: 1fr; } }
.nav-card { border-radius: var(--radius-md); padding: var(--space-md); }
.nav-card-label { display: flex; align-items: center; gap: var(--space-xs); font-size: 0.75rem; color: var(--dimmed); margin-bottom: var(--space-xs); }
.nav-card-next { text-align: right; }
.nav-card-next .nav-card-label { justify-content: flex-end; }
.nav-card-title { display: block; font-weight: 500; font-size: 0.875rem; }

/* MDX content — matches components/mdx-components.tsx + app/globals.css */
.mdx-content { line-height: 1.7; padding-bottom: var(--space-xl); }
.mdx-content > :first-child { margin-top: 0; }
.mdx-content h2, .mdx-content h3, .mdx-content h4 { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; line-height: 1.35; scroll-margin-top: 80px; }
.mdx-content h2 { font-size: 1.75rem; margin-top: 2.5rem; margin-bottom: 1rem; color: var(--kolab-teal); }
.mdx-content h3 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: 0.75rem; }
.mdx-content h4 { font-size: 1.125rem; margin-top: 1rem; margin-bottom: 0.625rem; }
.anchor-link { opacity: 0; transition: opacity 0.2s; color: var(--gray-6); font-size: 0.9em; font-weight: 500; padding: 0 0.3rem; border-radius: 6px; line-height: 1.4; }
.anchor-link:hover { background: var(--gray-1); }
.anchor-link.copied { color: var(--teal-6); opacity: 1; }
.heading-with-anchor:hover .anchor-link, .anchor-link:focus-visible { opacity: 1; }
.mdx-content p { margin-bottom: 1rem; line-height: 1.7; }
.mdx-content a { color: var(--teal-6); }
.mdx-content a:hover { text-decoration: underline; }
.mdx-content ul, .mdx-content ol { margin-bottom: 1rem; padding-left: 1.5rem; line-height: 1.7; }
.mdx-content li { margin-bottom: 0.25rem; }
.mdx-content li > ul, .mdx-content li > ol { margin-top: 0.25rem; margin-bottom: 0; }
.mdx-content li > p { margin-bottom: 0.25rem; }
.mdx-content code { font-family: var(--mono); background: var(--gray-0); padding: 2px 6px; border-radius: 4px; font-size: 0.8125rem; }
.mdx-content pre { background: #1a1a2e; color: #f8f8f2; padding: 1.5rem; border-radius: 1rem; overflow-x: auto; margin-bottom: 1.5rem; line-height: 1.5; }
.mdx-content pre code { background: none; padding: 0; color: inherit; font-size: 0.8125rem; }
.mdx-content pre { position: relative; white-space: pre-wrap; overflow-wrap: anywhere; padding-right: 5rem; }
.copy-btn { position: absolute; top: 0.75rem; right: 0.75rem; font-family: var(--font); font-size: 0.75rem; font-weight: 600; color: #f8f8f2; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; padding: 0.25rem 0.6rem; opacity: 0.8; }
.copy-btn:hover, .copy-btn:focus-visible { opacity: 1; background: rgba(255, 255, 255, 0.2); }
.mdx-content blockquote { border-left: 4px solid var(--kolab-teal); padding-left: 1rem; margin: 1.5rem 0; color: var(--gray-7); font-style: italic; }
.mdx-content img { max-width: 100%; height: auto; border-radius: 1rem; box-shadow: var(--shadow-md); margin: 1.5rem 0; display: block; }
.mdx-content hr { border: none; border-top: 1px solid var(--gray-3); margin: 2rem 0; }
.table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.mdx-content table { width: 100%; border-collapse: collapse; border: 1px solid var(--gray-3); font-size: 0.875rem; }
.mdx-content thead { background: var(--gray-1); }
.mdx-content tr { border-bottom: 1px solid var(--gray-3); }
.mdx-content th, .mdx-content td { padding: 0.75rem; text-align: left; border-right: 1px solid var(--gray-3); vertical-align: top; }
.mdx-content th { font-weight: 600; }

/* Mantine <Kbd size="sm"> */
kbd { font-family: var(--mono); font-weight: 700; font-size: 0.75rem; line-height: 1.5; padding: 0.12em 0.45em; border: 1px solid var(--gray-3); border-bottom-width: 3px; border-radius: 4px; background: var(--gray-0); color: var(--gray-7); white-space: nowrap; unicode-bidi: embed; }
kbd.kbd-xs { font-size: 0.625rem; padding: 0.1em 0.4em; }

/* ---------- changelog ---------- */
.month-jump { display: flex; flex-wrap: wrap; gap: var(--space-xs); font-size: 0.875rem; color: var(--dimmed); }
.month-jump a:hover { text-decoration: underline; }
.cl-month { display: flex; flex-direction: column; gap: var(--space-md); }
.cl-month hr { border: 0; border-top: 1px solid var(--gray-3); }
.cl-month h2 { font-size: 1.5rem; font-weight: 700; scroll-margin-top: 80px; }
.cl-entry { scroll-margin-top: 80px; }
.cl-entry h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; }
.cl-entry .link-teal { display: inline-block; margin-top: var(--space-xs); }
.cl-highlight { border-left: 4px solid var(--teal-6); }
.cl-meta { display: flex; align-items: center; gap: var(--space-xs); margin-bottom: 6px; }

/* ---------- footer ---------- */
.site-footer { padding: var(--space-xl) 0; text-align: center; font-size: 0.875rem; color: var(--dimmed); border-top: 1px solid var(--gray-2); margin-top: var(--space-xl); }
.site-footer a { color: var(--teal-6); }
.site-footer a:hover { text-decoration: underline; }
.footer-links { margin-top: var(--space-xs); font-size: 0.75rem; }
.footer-links a { color: var(--dimmed); }

/* ---------- search (Spotlight) ---------- */
.spotlight { position: fixed; inset: 0; z-index: 2000; display: flex; justify-content: center; align-items: flex-start; padding: 10vh var(--space-md) var(--space-md); background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); }
.spotlight[hidden] { display: none; }
.spotlight-panel { width: 100%; max-width: 640px; background: #fff; border-radius: var(--radius-md); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); overflow: hidden; display: flex; flex-direction: column; max-height: 75vh; }
.spotlight-input { width: 100%; border: 0; border-bottom: 1px solid var(--gray-2); padding: 1rem 1.25rem; font: inherit; font-size: 1.0625rem; outline: none; }
.spotlight-results { overflow-y: auto; padding: 0.375rem; list-style: none; }
.spotlight-results a { display: flex; gap: var(--space-sm); padding: 0.625rem 0.75rem; border-radius: var(--radius-xs); }
.spotlight-results a[aria-selected="true"] { background: var(--gray-1); }
.sr-coll { flex-shrink: 0; min-width: 5.5rem; font-size: 0.75rem; font-weight: 500; color: var(--dimmed); padding-top: 2px; }
.sr-title { display: block; font-size: 0.9375rem; }
.sr-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.75rem; color: var(--dimmed); }
.spotlight-results mark { background: rgba(252, 196, 25, 0.35); color: inherit; border-radius: 2px; }
.spotlight-empty { padding: 1.25rem; text-align: center; color: var(--dimmed); font-size: 0.875rem; }
.spotlight-foot { display: flex; gap: var(--space-md); padding: 0.5rem 1rem; border-top: 1px solid var(--gray-2); font-size: 0.75rem; color: var(--dimmed); }
