/* Sadeh Docs. Monochrome, like the app (apps/web/app/globals.css). */
@font-face {
  font-family: 'Inter';
  src: url('/assets/Inter.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #FFFFFF;
  --bg-soft: #F6F6F7;
  --bg-card: #FFFFFF;
  --text: #1D1D1F;
  --muted: #6E6E73;
  --faint: #9A9AA0;
  --line: #E6E6E9;
  --accent: #111113;
  --accent-text: #FFFFFF;
  --code-bg: #F3F3F5;
  --tip-bg: #EDF7F0; --tip-line: #BFE3CB; --tip-text: #17693E;
  --note-bg: #F3F3F5; --note-line: #E0E0E4; --note-text: #3A3A3F;
  --warn-bg: #FDF5DF; --warn-line: #F0DDA4; --warn-text: #7A5A00;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 12px 32px -18px rgba(20,20,30,0.28);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0E10; --bg-soft: #151518; --bg-card: #17171B; --text: #F2F2F4; --muted: #A1A1AA; --faint: #6E6E76;
    --line: #26262C; --accent: #F2F2F4; --accent-text: #0E0E10; --code-bg: #1B1B20;
    --tip-bg: #10231A; --tip-line: #1F4A33; --tip-text: #7BD3A2;
    --note-bg: #1A1A1F; --note-line: #2C2C33; --note-text: #D4D4D8;
    --warn-bg: #2A2210; --warn-line: #54431A; --warn-text: #F2CD6B;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 16px 40px -20px rgba(0,0,0,0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0E10; --bg-soft: #151518; --bg-card: #17171B; --text: #F2F2F4; --muted: #A1A1AA; --faint: #6E6E76;
  --line: #26262C; --accent: #F2F2F4; --accent-text: #0E0E10; --code-bg: #1B1B20;
  --tip-bg: #10231A; --tip-line: #1F4A33; --tip-text: #7BD3A2;
  --note-bg: #1A1A1F; --note-line: #2C2C33; --note-text: #D4D4D8;
  --warn-bg: #2A2210; --warn-line: #54431A; --warn-text: #F2CD6B;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 16px 40px -20px rgba(0,0,0,0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16.5px; line-height: 1.7; letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01';
}
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-text); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ------------------------------------------------------------ header */
.top {
  position: sticky; top: 0; z-index: 40; height: 60px;
  display: flex; align-items: center; gap: 18px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: 0 0 auto; }
.logo-mark { width: 26px; height: 27px; }
.logo-mark path { fill: var(--text); }
.brand-name { font-weight: 650; font-size: 19px; letter-spacing: -0.03em; }
.brand-docs { font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; letter-spacing: 0.01em; }
.menu { display: none; width: 38px; height: 38px; border: 0; background: none; padding: 9px; margin-left: -8px; color: var(--text); cursor: pointer; }
.menu span, .menu span::before, .menu span::after { display: block; width: 20px; height: 1.8px; background: currentColor; border-radius: 1px; position: relative; content: ''; }
.menu span::before { position: absolute; top: -6px; }
.menu span::after { position: absolute; top: 6px; }
.search { position: relative; flex: 1 1 auto; max-width: 420px; }
.search input {
  width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--text); font: inherit; font-size: 14.5px; padding: 0 36px 0 14px; outline: none;
}
.search input:focus { border-color: var(--muted); background: var(--bg); }
.search kbd { position: absolute; right: 10px; top: 9px; font: 12px/18px inherit; font-family: inherit; color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; }
.results {
  position: absolute; left: 0; right: 0; top: 44px; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px; max-height: 60vh; overflow: auto;
}
.results a { display: block; padding: 9px 11px; border-radius: 8px; text-decoration: none; line-height: 1.35; }
.results a:hover, .results a[aria-selected="true"] { background: var(--bg-soft); }
.results b { font-weight: 600; font-size: 14.5px; }
.results small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.results .empty { padding: 10px 12px; color: var(--muted); font-size: 14px; }
.top-links { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14.5px; }
.top-links a { text-decoration: none; color: var(--muted); }
.top-links a:hover { color: var(--text); }
.top-links .open-app { color: var(--accent-text); background: var(--accent); padding: 8px 14px; border-radius: 999px; font-weight: 600; }
.top-links .open-app:hover { color: var(--accent-text); opacity: 0.9; }
.theme { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); cursor: pointer; position: relative; }
.theme::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: linear-gradient(90deg, var(--text) 50%, transparent 50%); border: 1.5px solid var(--text); }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr) 232px; max-width: 1480px; margin: 0 auto; }
.side {
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow: auto; padding: 26px 16px 40px 22px;
  border-right: 1px solid var(--line);
}
.nav-section { margin-bottom: 22px; }
.nav-title { margin: 0 0 6px 10px; font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 5px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.side a:hover { color: var(--text); background: var(--bg-soft); }
.side a[aria-current="page"] { color: var(--text); background: var(--bg-soft); font-weight: 600; }
main { min-width: 0; padding: 44px 56px 30px; }
.doc { max-width: 780px; margin: 0 auto; }
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.doc h1 { font-size: 42px; line-height: 1.08; letter-spacing: -0.035em; font-weight: 650; margin: 0 0 14px; }
.lead { font-size: 19.5px; line-height: 1.55; color: var(--muted); margin: 0 0 30px; letter-spacing: -0.012em; }
.doc h2 { font-size: 27px; line-height: 1.2; letter-spacing: -0.028em; font-weight: 650; margin: 48px 0 12px; }
.doc h3 { font-size: 19.5px; line-height: 1.3; letter-spacing: -0.018em; font-weight: 640; margin: 32px 0 8px; }
.doc h2, .doc h3 { position: relative; }
.anchor { position: absolute; left: -22px; opacity: 0; text-decoration: none; color: var(--faint); font-weight: 400; }
.doc h2:hover .anchor, .doc h3:hover .anchor { opacity: 1; }
.doc p, .doc ul, .doc ol { margin: 0 0 16px; }
.doc li { margin: 4px 0; }
.doc strong { font-weight: 640; }
.doc code { font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace; font-size: 0.86em; background: var(--code-bg); padding: 2px 6px; border-radius: 6px; }
.doc pre { background: var(--code-bg); border-radius: 12px; padding: 14px 16px; overflow: auto; font-size: 14px; line-height: 1.55; }
.doc pre code { background: none; padding: 0; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.doc img { max-width: 100%; border-radius: 12px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 22px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font-weight: 640; color: var(--muted); font-size: 13.5px; }
.doc blockquote { margin: 0 0 16px; padding: 2px 18px; border-left: 3px solid var(--line); color: var(--muted); }

/* steps */
.steps > ol { list-style: none; counter-reset: step; padding: 0; margin: 8px 0 24px; }
.steps > ol > li { counter-increment: step; position: relative; padding: 0 0 18px 50px; margin: 0; }
.steps > ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text); font-size: 14px; font-weight: 650; display: grid; place-items: center; line-height: 1;
}
.steps > ol > li::after { content: ''; position: absolute; left: 14.5px; top: 36px; bottom: 6px; width: 1px; background: var(--line); }
.steps > ol > li:last-child::after { display: none; }
.steps > ol > li > p:first-child { margin-top: 2px; }

/* callouts */
.callout { border: 1px solid var(--note-line); background: var(--note-bg); color: var(--note-text); border-radius: 12px; padding: 12px 16px 2px; margin: 0 0 20px; font-size: 15.5px; }
.callout.tip { border-color: var(--tip-line); background: var(--tip-bg); }
.callout.tip .callout-title { color: var(--tip-text); }
.callout.warning { border-color: var(--warn-line); background: var(--warn-bg); }
.callout.warning .callout-title { color: var(--warn-text); }
.callout-title { font-weight: 650; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 4px !important; }

/* demo: interactive walkthrough + video */
.demo { margin: 8px 0 34px; }
.demo-tabs { display: flex; gap: 6px; margin: 0 0 10px; }
.demo-tab {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.demo-tab[aria-pressed="true"] { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.demo-stage {
  position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--bg-soft) center / cover no-repeat;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.demo-stage iframe, .demo-stage video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #F5F5F7; }
.demo-start {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 12px; padding: 14px 22px 14px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(17, 17, 19, 0.88); color: #fff; font: inherit; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,0.45); backdrop-filter: blur(6px);
}
.demo-start:hover { background: rgba(17, 17, 19, 0.96); }
.demo-play { width: 34px; height: 34px; border-radius: 50%; background: #fff; position: relative; flex: 0 0 auto; }
.demo-play::after { content: ''; position: absolute; left: 13px; top: 10px; border-left: 12px solid #111; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.demo figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.demo-hint { color: var(--faint); }

/* pager, toc, footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 56px 0 10px; }
.pager a { display: block; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-decoration: none; font-weight: 600; font-size: 15.5px; }
.pager a:hover { border-color: var(--muted); }
.pager span { display: block; font-size: 12.5px; font-weight: 500; color: var(--faint); margin-bottom: 2px; }
.pager .next { text-align: right; grid-column: 2; }
.toc { position: sticky; top: 60px; height: calc(100vh - 60px); overflow: auto; padding: 48px 20px 30px 10px; font-size: 13.5px; }
.toc-title { margin: 0 0 8px; font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 1px solid transparent; text-decoration: none; color: var(--muted); line-height: 1.4; }
.toc li.d3 a { padding-left: 24px; }
.toc li a:hover { color: var(--text); }
.toc li a.active { color: var(--text); border-left-color: var(--text); }
.foot { max-width: 780px; margin: 60px auto 0; padding: 22px 0 10px; border-top: 1px solid var(--line); display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--faint); }
.foot a { color: var(--faint); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* home */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 10px 0 30px; }
.card { display: block; border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 16px; text-decoration: none; background: var(--bg-card); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--muted); transform: translateY(-1px); }
.card b { display: block; font-size: 16.5px; font-weight: 650; letter-spacing: -0.015em; margin-bottom: 4px; }
.card span { display: block; color: var(--muted); font-size: 14.5px; line-height: 1.5; }

@media (max-width: 1180px) {
  .shell { grid-template-columns: 256px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .menu { display: block; }
  .shell { display: block; }
  .side {
    position: fixed; z-index: 50; top: 60px; left: 0; bottom: 0; height: auto; width: min(320px, 86vw);
    background: var(--bg); transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  body.nav-open .side { transform: none; }
  main { padding: 28px 16px 20px; }
  .doc h1 { font-size: 32px; }
  .lead { font-size: 17.5px; }
  .top { gap: 10px; padding: 0 12px; }
  .top-links a:not(.open-app), .brand-docs, .search kbd { display: none; }
  .top-links .open-app { padding: 7px 11px; font-size: 13.5px; }
  .cards { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .demo-start { font-size: 14px; padding: 10px 16px 10px 10px; }
}

/* Sample WhatsApp message (:::wacard) */
.wa-sample { margin: 24px 0 28px; }
.wa-chat {
  --wa-bg: #EFEAE2; --wa-bubble: #FFFFFF; --wa-text: #111B21; --wa-meta: #667781; --wa-link: #027EB5; --wa-btn: #0B8A7C;
  background: var(--wa-bg); border-radius: 14px; padding: 22px 20px; border: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wa-chat { --wa-bg: #0B141A; --wa-bubble: #202C33; --wa-text: #E9EDEF; --wa-meta: #8696A0; --wa-link: #53BDEB; --wa-btn: #00A884; }
}
:root[data-theme="dark"] .wa-chat { --wa-bg: #0B141A; --wa-bubble: #202C33; --wa-text: #E9EDEF; --wa-meta: #8696A0; --wa-link: #53BDEB; --wa-btn: #00A884; }
.wa-msg { max-width: 460px; }
.wa-bubble {
  position: relative; background: var(--wa-bubble); color: var(--wa-text); border-radius: 0 10px 10px 10px;
  padding: 8px 10px 22px; font-size: 14.5px; line-height: 1.45; box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
}
.wa-bubble p { margin: 0; }
.wa-title { font-weight: 700; margin-bottom: 6px !important; }
.wa-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-link { color: var(--wa-link); }
.wa-time { position: absolute; right: 10px; bottom: 5px; font-size: 11px; color: var(--wa-meta); }
.wa-btns { display: grid; gap: 3px; margin-top: 3px; }
.wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--wa-bubble); color: var(--wa-btn);
  border-radius: 10px; padding: 9px 10px; font-size: 14.5px; font-weight: 500; box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
}
.wa-btn svg { width: 15px; height: 15px; }
.wa-sample figcaption { margin-top: 8px; font-size: 13px; color: var(--faint); }
