/* Komms docs: Ditto-style layout (dark guide sidebar, light reading panel) in the Komms site styling.
   Loaded after home.css, so it reuses its tokens, header, footer and buttons. */

.docs-body { background: var(--ink); }
.docs-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh; }

/* ---------- Sidebar ---------- */
.docs-side { position: sticky; top: 68px; align-self: start; height: calc(100vh - 68px); overflow-y: auto; background: var(--ink); border-right: 1px solid var(--line-dark); padding: 26px 18px 40px; overscroll-behavior: contain; }
.docs-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 20px; margin-bottom: 18px; border-bottom: 1px solid var(--line-dark); }
.docs-side-head a { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--on-dark); text-decoration: none; }
.docs-side-close { display: none; background: none; border: 1px solid var(--line-dark); color: var(--on-dark); border-radius: 10px; width: 36px; height: 36px; font-size: 22px; line-height: 1; cursor: pointer; }
.docs-group { margin-bottom: 22px; }
.docs-group p { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); padding: 0 12px 8px; }
.docs-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.docs-group a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--on-dark-soft); text-decoration: none; font-size: 15px; font-weight: 600; line-height: 1.35; transition: background .15s, color .15s; }
.docs-group a:hover { background: rgba(255,255,255,.05); color: var(--on-dark); }
.docs-group a.on { background: rgba(63,220,124,.12); color: #6ff2d4; box-shadow: inset 2px 0 0 #3fdc7c; }

/* ---------- Main panel ---------- */
.docs-main { background: var(--paper); color: var(--on-light); padding: 30px clamp(20px, 5vw, 80px) 80px; min-width: 0; border-top-left-radius: 22px; }
.docs-top { display: flex; align-items: center; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line-light); max-width: 980px; }
.docs-crumb { font-weight: 700; font-size: 15px; color: var(--on-light-soft); display: flex; gap: 8px; flex-wrap: wrap; }
.docs-crumb a { color: var(--on-light); text-decoration: none; }
.docs-crumb a:hover { text-decoration: underline; }
.docs-browse { display: none; align-items: center; gap: 8px; font: 700 15px var(--body); color: var(--on-light); background: #fff; border: 1px solid var(--line-light); border-radius: 12px; padding: 11px 14px; cursor: pointer; white-space: nowrap; }

.docs-search { position: relative; margin-left: auto; width: min(320px, 100%); }
.docs-search input { width: 100%; font: 500 15px var(--body); color: var(--on-light); background: #fff; border: 1px solid rgba(10,20,24,.22); border-radius: 12px; padding: 12px 52px 12px 42px; outline: none; -webkit-appearance: none; appearance: none; }
.docs-search input:focus { border-color: var(--teal-ink); box-shadow: 0 0 0 3px rgba(23,196,236,.18); }
.docs-search input::-webkit-search-cancel-button { display: none; }
.docs-search-ic { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--on-light-soft); pointer-events: none; }
.docs-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 600 11px var(--mono); color: var(--on-light-soft); background: #eef2f4; border: 1px solid var(--line-light); border-radius: 6px; padding: 3px 6px; }
.docs-results { position: absolute; top: calc(100% + 8px); right: 0; width: min(460px, 92vw); background: #fff; border: 1px solid var(--line-light); border-radius: 14px; box-shadow: 0 24px 60px -24px rgba(10,40,70,.45); padding: 6px; z-index: 40; max-height: 70vh; overflow-y: auto; }
.docs-results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--on-light); }
.docs-results a:hover, .docs-results a.on { background: #eef6f4; }
.docs-results b { display: block; font-size: 15px; }
.docs-results small { display: block; color: var(--on-light-soft); font-size: 13px; margin-top: 2px; }
.docs-results .empty { padding: 12px; color: var(--on-light-soft); font-size: 14px; }

.docs-beta { max-width: 980px; margin-top: 18px; font-size: 14px; color: #0b5d66; background: #e3f6ef; border-radius: 12px; padding: 10px 14px; line-height: 1.5; }

/* ---------- Article ---------- */
.docs-article { max-width: 780px; padding-top: 34px; }
.docs-updated { font-size: 14px; color: var(--on-light-soft); }
.docs-article h1 { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 4.4vw, 50px); line-height: 1.08; letter-spacing: -.02em; margin-top: 8px; }
.docs-lede { font-size: 20px; line-height: 1.55; color: #24343c; margin-top: 16px; max-width: 720px; }
.docs-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; padding-bottom: 26px; border-bottom: 1px solid var(--line-light); }
.docs-copy { display: inline-flex; align-items: center; gap: 8px; font: 700 14px var(--body); color: var(--on-light); background: #fff; border: 1px solid rgba(10,20,24,.18); border-radius: 10px; padding: 9px 14px; cursor: pointer; }
.docs-copy svg { width: 16px; height: 16px; }
.docs-copy.done { border-color: var(--save-ink); color: var(--save-ink); }
.docs-md { font-size: 14px; font-weight: 600; color: var(--on-light-soft); }

.docs-prose { font-size: 17px; line-height: 1.75; color: #1b2a31; padding-top: 10px; }
.docs-prose > * + * { margin-top: 16px; }
.docs-prose h2 { font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1.2; letter-spacing: -.01em; margin-top: 44px; color: var(--on-light); }
.docs-prose h3 { font-weight: 800; font-size: 19px; margin-top: 30px; color: var(--on-light); }
.docs-prose .anchor { margin-left: 10px; color: #b7c3c9; text-decoration: none; font-weight: 500; opacity: 0; transition: opacity .15s; }
.docs-prose h2:hover .anchor, .docs-prose h3:hover .anchor, .docs-prose .anchor:focus { opacity: 1; }
.docs-prose a { color: var(--teal-ink); font-weight: 600; text-underline-offset: 3px; }
.docs-prose ul, .docs-prose ol { padding-left: 22px; display: grid; gap: 8px; }
.docs-prose li::marker { color: var(--teal-ink); }
.docs-prose strong { color: var(--on-light); }
.docs-prose code { font-family: var(--mono); font-size: .86em; background: #e8eef1; border-radius: 6px; padding: 2px 6px; }
.docs-prose pre { background: var(--ink); color: var(--on-dark); border-radius: 14px; padding: 18px 20px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.docs-prose pre code { background: none; padding: 0; color: inherit; }
.docs-prose hr { border: 0; border-top: 1px solid var(--line-light); margin: 32px 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line-light); border-radius: 14px; background: #fff; }
.docs-prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.docs-prose th { text-align: left; font-weight: 800; background: #e9eff1; padding: 12px 16px; white-space: nowrap; }
.docs-prose td { padding: 12px 16px; border-top: 1px solid var(--line-light); vertical-align: top; }

.callout { border-radius: 14px; padding: 16px 18px; border: 1px solid; margin-inline: 0; margin-bottom: 0; }
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout-title { font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.callout-note { background: #eaf4fb; border-color: #c9e3f3; }
.callout-note .callout-title { color: #0b6f99; }
.callout-launch { background: #e6f6ee; border-color: #c2e8d3; }
.callout-launch .callout-title { color: var(--save-ink); }
.callout-soon { background: #fdf4e3; border-color: #f2dcb0; }
.callout-soon .callout-title { color: #9a6406; }
.callout-warning { background: #fdecec; border-color: #f4caca; }
.callout-warning .callout-title { color: #a3222f; }
.docs-prose .li-soon { background: #fdf0d8; color: #8a5a04; }
.li-launch { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: #dff3e8; color: var(--save-ink); vertical-align: 1px; white-space: nowrap; }
.docs-beta .li-soon { background: #fdf0d8; color: #8a5a04; margin-left: 2px; }

/* ---------- Previous / next ---------- */
.docs-pager { max-width: 780px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line-light); }
.docs-pager a { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line-light); border-radius: 14px; background: #fff; text-decoration: none; color: var(--on-light); transition: border-color .15s, transform .15s; }
.docs-pager a:hover { border-color: var(--teal-ink); transform: translateY(-1px); }
.docs-pager .next { text-align: right; }
.docs-pager small { font-size: 13px; color: var(--on-light-soft); font-weight: 600; }
.docs-pager b { font-size: 16px; }

/* ---------- Docs home ---------- */
.docs-home { max-width: 980px; padding-top: 44px; }
.docs-home h1 { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 5vw, 58px); line-height: 1.06; letter-spacing: -.02em; max-width: 760px; }
.docs-home .grad-text { background: linear-gradient(120deg, #0b8fb0, #16a07a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.docs-start-h, .docs-home-group h2 { font-family: var(--display); font-weight: 600; font-size: 28px; margin: 56px 0 18px; }
.docs-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.docs-cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.docs-card { position: relative; display: grid; gap: 8px; align-content: start; padding: 22px 48px 22px 22px; background: #fff; border: 1px solid var(--line-light); border-radius: 16px; text-decoration: none; color: var(--on-light); transition: border-color .15s, transform .15s, box-shadow .15s; }
.docs-card::after { content: "→"; position: absolute; top: 20px; right: 20px; color: var(--on-light-soft); font-size: 18px; transition: transform .15s, color .15s; }
.docs-card:hover { border-color: var(--teal-ink); transform: translateY(-2px); box-shadow: 0 18px 40px -28px rgba(10,40,70,.45); }
.docs-card:hover::after { color: var(--teal-ink); transform: translateX(3px); }
.docs-card b { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.25; }
.docs-card span { font-size: 15px; line-height: 1.55; color: var(--on-light-soft); }

/* ---------- Footer sits below the panel ---------- */
.docs-body footer { position: relative; }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 960px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); }
  .docs-main { border-top-left-radius: 0; padding-top: 20px; }
  .docs-browse { display: inline-flex; }
  .docs-crumb { display: none; }
  .docs-top { flex-wrap: nowrap; }
  .docs-search { width: auto; flex: 1; }
  .docs-search kbd { display: none; }
  .docs-search input { padding-right: 14px; }
  .docs-side { position: fixed; top: 0; left: 0; bottom: 0; width: min(330px, 86vw); height: 100%; z-index: 120; transform: translateX(-102%); transition: transform .25s ease, visibility 0s linear .25s; visibility: hidden; }
  .docs-side.open { transform: none; visibility: visible; transition: transform .25s ease; box-shadow: 30px 0 60px -30px rgba(0,0,0,.6); }
  .docs-side-close { display: grid; place-items: center; }
  .docs-scrim { position: fixed; inset: 0; background: rgba(2,8,12,.55); z-index: 110; }
  .docs-cards, .docs-cards.three { grid-template-columns: minmax(0, 1fr); }
  .docs-pager { grid-template-columns: minmax(0, 1fr); }
  .docs-results { right: auto; left: 0; width: 100%; }
}
@media (max-width: 520px) {
  .docs-browse span, .docs-browse { padding: 11px 12px; }
  .docs-lede { font-size: 18px; }
  .docs-prose { font-size: 16.5px; }
  .docs-prose h2 { font-size: 24px; }
}
