/* NotifyHook Docs — palette mirrors the app (ui/theme/Color.kt), with a light theme for reading. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --lime: #C8FF3D;
  --lime-ink: #10160A;
  --topbar-h: 60px;
  --sidebar-w: 264px;
  --toc-w: 220px;
  --content-w: 760px;
  --radius: 12px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0D0C;
  --bg-elev: #111513;
  --panel: #14181A;
  --surface: #1B2124;
  --line: #242C2F;
  --line-strong: #2C3438;
  --text: #EEF2F0;
  --text-2: #C3CCC8;
  --muted: #8A9691;
  --accent: #C8FF3D;
  --accent-text: #C8FF3D;
  --accent-soft: rgba(200, 255, 61, 0.1);
  --accent-line: rgba(200, 255, 61, 0.35);
  --code-bg: #0F1311;
  --inline-code-bg: #1B2124;
  --green: #3DDC97;
  --red: #FF6B6B;
  --amber: #FFC94D;
  --blue: #6DB3FF;
  --t-key: #8FD3FF;
  --t-str: #C8FF3D;
  --t-num: #FFB86B;
  --t-kw: #FF8FB1;
  --t-com: #6B7772;
  --t-fn: #B9A7FF;
  --t-ph-bg: rgba(200, 255, 61, 0.16);
  --t-ph: #E6FFA8;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #FBFCFA;
  --bg-elev: #FFFFFF;
  --panel: #F3F6F1;
  --surface: #EEF2EC;
  --line: #E3E8E2;
  --line-strong: #D3DAD2;
  --text: #0F1412;
  --text-2: #36403B;
  --muted: #5D6963;
  --accent: #C8FF3D;
  --accent-text: #3F6B00;
  --accent-soft: #F1FBD9;
  --accent-line: #B6DE5A;
  --code-bg: #0F1311;
  --inline-code-bg: #EEF2EC;
  --green: #12865A;
  --red: #C93636;
  --amber: #9A6500;
  --blue: #1F6FCC;
  --t-key: #8FD3FF;
  --t-str: #C8FF3D;
  --t-num: #FFB86B;
  --t-kw: #FF8FB1;
  --t-com: #6B7772;
  --t-fn: #B9A7FF;
  --t-ph-bg: rgba(200, 255, 61, 0.16);
  --t-ph: #E6FFA8;
  --shadow: 0 20px 60px rgba(15, 20, 18, 0.18);
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar-h) + 20px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--accent); color: var(--lime-ink); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1440px; height: 100%; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px 0 30px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { border-radius: 7px; }
.brand-tag {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 1px 7px; border-radius: 999px;
}
.search-btn {
  margin-left: 24px; flex: 0 1 340px; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 10px 0 12px;
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.search-btn:hover { border-color: var(--line-strong); color: var(--text-2); }
.search-label { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd {
  font: 600 11px/1 var(--mono); color: var(--muted);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; background: var(--bg);
}
.top-links { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 600; }
.top-links a { text-decoration: none; color: var(--text-2); }
.top-links a:hover { color: var(--text); }
.top-links .get { background: var(--accent); color: var(--lime-ink); padding: 7px 14px; border-radius: 999px; }
.top-links .get:hover { color: var(--lime-ink); filter: brightness(1.05); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  background: transparent; color: var(--text-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.menu-btn { display: none; }
[data-theme="dark"] .theme-btn .moon, [data-theme="light"] .theme-btn .sun { display: none; }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  max-width: 1440px; margin: 0 auto;
}
.sidebar, .toc {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sidebar { padding: 28px 16px 40px 20px; border-right: 1px solid var(--line); }
.nav-group + .nav-group { margin-top: 26px; }
.nav-title { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); margin: 0 0 8px 10px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block; padding: 5px 10px; margin: 1px 0;
  font-size: 14.5px; color: var(--muted); text-decoration: none; border-radius: 8px;
}
.sidebar li a:hover { color: var(--text); background: var(--panel); }
.sidebar li a[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); font-weight: 650; }

.content { padding: 40px 56px 32px; min-width: 0; }
.prose, .pager, .doc-footer { max-width: var(--content-w); margin-left: auto; margin-right: auto; }

.toc { padding: 36px 20px 40px 8px; font-size: 13.5px; }
.toc-title { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; line-height: 1.45; }
.toc li.lvl-3 a { padding-left: 26px; font-size: 13px; }
.toc li a:hover { color: var(--text); }
.toc li a.active { color: var(--accent-text); border-left-color: var(--accent-text); }

/* ---------- Prose ---------- */
.crumbs { font-size: 13px; font-weight: 700; color: var(--accent-text); margin-bottom: 6px; }
.prose h1 { font-size: 2.35rem; line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 12px; font-weight: 800; }
.prose .lead { font-size: 1.15rem; color: var(--text-2); margin: 0 0 32px; line-height: 1.6; }
.prose h2 { font-size: 1.5rem; letter-spacing: -0.015em; margin: 48px 0 12px; line-height: 1.3; padding-top: 4px; }
.prose h3 { font-size: 1.15rem; margin: 32px 0 8px; line-height: 1.35; }
.prose h2, .prose h3 { position: relative; scroll-margin-top: calc(var(--topbar-h) + 20px); }
.prose .anchor { margin-left: 8px; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 500; transition: opacity 0.15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; color: var(--text-2); }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--muted); }
.prose strong { color: var(--text); }
.prose a:not(.card):not(.anchor) { color: var(--accent-text); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.prose a:not(.card):not(.anchor):hover { text-decoration-color: currentColor; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.prose code {
  font: 0.86em var(--mono); background: var(--inline-code-bg); border: 1px solid var(--line);
  padding: 0.1em 0.4em; border-radius: 6px; color: var(--text); overflow-wrap: anywhere;
}
.prose code.ph { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }

/* Code blocks: always dark, like most docs sites. */
.code { margin: 0 0 20px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--code-bg); }
[data-theme="light"] .code { border-color: #1F2624; }
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 14px; height: 38px;
  font-size: 12.5px; font-weight: 600; color: #8A9691;
  border-bottom: 1px solid #1F2624; background: #121715;
}
.copy {
  font: 600 12px var(--font); color: #A9B4AF; background: transparent; border: 1px solid transparent;
  padding: 4px 9px; border-radius: 7px; cursor: pointer;
}
.copy:hover { color: #EEF2F0; border-color: #2C3438; }
.copy.done { color: var(--lime); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 13.5px/1.65 var(--mono); color: #DCE3DF; tab-size: 2; }
.code pre code { font: inherit; background: none; border: 0; padding: 0; color: inherit; overflow-wrap: normal; }
.t-key { color: var(--t-key); }
.t-str { color: var(--t-str); }
.t-num { color: var(--t-num); }
.t-kw, .t-flag { color: var(--t-kw); }
.t-com { color: var(--t-com); font-style: italic; }
.t-fn, .t-dec { color: var(--t-fn); }
.t-var, .t-tpl { color: #FFC94D; }
.t-ph { color: var(--t-ph); background: var(--t-ph-bg); border-radius: 4px; padding: 0 2px; }

.tabs { margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--code-bg); }
[data-theme="light"] .tabs { border-color: #1F2624; }
.tab-list { display: flex; gap: 2px; padding: 6px 6px 0; background: #121715; border-bottom: 1px solid #1F2624; overflow-x: auto; }
.tab-list button {
  font: 600 13px var(--font); color: #8A9691; background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 12px 9px; cursor: pointer; white-space: nowrap;
}
.tab-list button:hover { color: #EEF2F0; }
.tab-list button[aria-selected="true"] { color: var(--lime); border-bottom-color: var(--lime); }
.tabs .code { margin: 0; border: 0; border-radius: 0; }
.tabs .code-head { height: 0; padding: 0; border: 0; overflow: visible; position: relative; }
.tabs .code-head span { display: none; }
.tabs .copy { position: absolute; right: 8px; top: 8px; z-index: 1; background: #121715; }

/* Callouts */
.callout {
  display: flex; gap: 12px; margin: 0 0 20px; padding: 14px 16px;
  border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px; background: var(--panel);
}
.callout-icon {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 2px;
  border-radius: 50%; font: 800 12px var(--font); color: var(--bg);
}
.callout-title { font-weight: 700; color: var(--text); margin-bottom: 2px; font-size: 15px; }
.callout-body { min-width: 0; font-size: 15px; }
.callout-body p:last-child, .callout-body ul:last-child { margin-bottom: 0; }
.callout.note { border-left-color: var(--blue); } .callout.note .callout-icon { background: var(--blue); }
.callout.tip { border-left-color: var(--green); } .callout.tip .callout-icon { background: var(--green); }
.callout.warning { border-left-color: var(--amber); } .callout.warning .callout-icon { background: var(--amber); }
.callout.pro { border-left-color: var(--accent-text); background: var(--accent-soft); } .callout.pro .callout-icon { background: var(--accent); color: var(--lime-ink); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--panel); font-weight: 700; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { white-space: nowrap; }
.vars td:first-child { width: 36%; }

.badge { display: inline-block; vertical-align: middle; font: 700 11px/1 var(--font); letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; margin-left: 6px; position: relative; top: -2px; }
.badge.free { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.badge.pro { color: var(--lime-ink); background: var(--accent); }

/* Cards (docs home, recipes) */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 28px; }
.card {
  display: block; padding: 18px 18px 16px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 14px; background: var(--bg-elev);
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.card .card-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: 17px; margin-bottom: 10px; border: 1px solid var(--accent-line); }
.card strong { display: block; font-size: 15.5px; margin-bottom: 2px; color: var(--text); }
.card span { display: block; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 24px; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 8px 46px; margin: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 2px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 800 13px var(--font); color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.steps > li::after { content: ""; position: absolute; left: 14px; top: 36px; bottom: 4px; width: 1px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps > li > h3 { margin: 4px 0 6px; font-size: 1.08rem; }

/* Flow diagram */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 8px 0 28px; }
.flow-step { position: relative; padding: 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev); text-align: center; }
.flow-step:not(:last-child)::after { content: "→"; position: absolute; right: -13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; z-index: 1; }
.flow-step b { display: block; font-size: 13.5px; color: var(--text); }
.flow-step small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 4px; }
.flow-step.hl { border-color: var(--accent-line); background: var(--accent-soft); }

.status { display: inline-block; font: 700 11.5px/1 var(--font); letter-spacing: 0.04em; padding: 4px 8px; border-radius: 999px; }
.status.success { color: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); }
.status.failed { color: var(--red); background: color-mix(in srgb, var(--red) 15%, transparent); }
.status.queued { color: var(--amber); background: color-mix(in srgb, var(--amber) 15%, transparent); }
.status.skipped { color: var(--muted); background: color-mix(in srgb, var(--muted) 15%, transparent); }

/* Pager + footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-weight: 650; color: var(--text); }
.pager a:hover { border-color: var(--accent-line); }
.pager a span { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.pager .next { text-align: right; }
.doc-footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.doc-footer a { color: var(--muted); }
.doc-footer a:hover { color: var(--text); }

/* ---------- Search dialog ---------- */
.search-dialog {
  width: min(640px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 120px));
  margin: 10vh auto 0; padding: 0; border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); overflow: hidden;
}
.search-dialog[open] { display: flex; flex-direction: column; }
.search-dialog::backdrop { background: rgba(5, 7, 6, 0.55); backdrop-filter: blur(3px); }
.search-input-row { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-input-row input { flex: 1; height: 56px; border: 0; outline: 0; background: transparent; color: var(--text); font: 17px var(--font); }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.search-results .r-path { font-size: 12px; color: var(--muted); }
.search-results .r-title { font-weight: 650; font-size: 15px; }
.search-results .r-snip { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results mark { background: var(--accent-soft); color: var(--accent-text); border-radius: 3px; padding: 0 1px; }
.search-results li[aria-selected="true"] a { background: var(--panel); outline: 1px solid var(--accent-line); }
.search-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.search-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .menu-btn { display: inline-grid; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 45; top: var(--topbar-h); left: 0; bottom: 0; height: auto;
    width: min(300px, 86vw); background: var(--bg); transform: translateX(-102%); transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 44; background: rgba(5, 7, 6, 0.5); }
  .topbar-inner { padding: 0 20px; }
  .content { padding: 28px 20px 24px; }
  .top-links a:not(.get) { display: none; }
  .search-btn { margin-left: auto; flex: 0 1 auto; }
  .search-label, .search-btn kbd { display: none; }
  .search-btn { width: 38px; padding: 0; justify-content: center; }
  .top-links { margin-left: 0; }
  .flow { grid-template-columns: 1fr; }
  .flow-step:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -17px; transform: translateX(50%); }
}
@media (max-width: 560px) {
  .brand > span:not(.brand-tag) { display: none; }
  .top-links .get { display: none; }
  .cards, .pager { grid-template-columns: 1fr; }
  .prose h1 { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
