/* Pavo Pricing Table guide. No web fonts, no external files. Light and dark themes (system + manual), print. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --bg-sunk: #eef0f7;
  --text: #1b2033;
  --muted: #555d75;
  --border: #e2e5ef;
  --border-strong: #cdd2e1;
  --accent: #4f46e5;
  --accent-hover: #3b33c4;
  --accent-soft: #eef0ff;
  --on-accent: #ffffff;
  --focus: #4f46e5;
  --header-bg: rgba(255, 255, 255, 0.94);
  --code-bg: #f0f2f8;
  --mark: #ffe9a3;
  --tip-bg: #ebf8f2;
  --tip-border: #16b47e;
  --tip-text: #0a6646;
  --note-bg: #eaf5fd;
  --note-border: #12a8f0;
  --note-text: #0a5783;
  --warn-bg: #fff6dc;
  --warn-border: #d99d00;
  --warn-text: #6b4a00;
  --shadow: 0 1px 2px rgba(20, 24, 50, 0.06), 0 6px 20px rgba(20, 24, 50, 0.07);
  --placeholder: rgba(79, 70, 229, 0.06);
  --radius: 10px;
  --header-h: 60px;
  --sidebar-w: 270px;
  --toc-w: 220px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1222;
    --bg-soft: #151a2e;
    --bg-sunk: #1b2139;
    --text: #e6e8f2;
    --muted: #a7aec7;
    --border: #262c48;
    --border-strong: #363e60;
    --accent: #a5b4fc;
    --accent-hover: #c7d0fe;
    --accent-soft: #1f2452;
    --on-accent: #0f1222;
    --focus: #a5b4fc;
    --header-bg: rgba(15, 18, 34, 0.92);
    --code-bg: #1b2139;
    --mark: #6b5600;
    --tip-bg: #0f2a22;
    --tip-border: #16b47e;
    --tip-text: #84e2c0;
    --note-bg: #0e2536;
    --note-border: #12a8f0;
    --note-text: #95d5fb;
    --warn-bg: #2d2309;
    --warn-border: #d99d00;
    --warn-text: #f2d27c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.35);
    --placeholder: rgba(165, 180, 252, 0.07);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1222;
  --bg-soft: #151a2e;
  --bg-sunk: #1b2139;
  --text: #e6e8f2;
  --muted: #a7aec7;
  --border: #262c48;
  --border-strong: #363e60;
  --accent: #a5b4fc;
  --accent-hover: #c7d0fe;
  --accent-soft: #1f2452;
  --on-accent: #0f1222;
  --focus: #a5b4fc;
  --header-bg: rgba(15, 18, 34, 0.92);
  --code-bg: #1b2139;
  --mark: #6b5600;
  --tip-bg: #0f2a22;
  --tip-border: #16b47e;
  --tip-text: #84e2c0;
  --note-bg: #0e2536;
  --note-border: #12a8f0;
  --note-text: #95d5fb;
  --warn-bg: #2d2309;
  --warn-border: #d99d00;
  --warn-text: #f2d27c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.35);
  --placeholder: rgba(165, 180, 252, 0.07);
  color-scheme: dark;
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.65 var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 599px) { body { font-size: 16px; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

img, svg { max-width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 10px; color: var(--on-accent); }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
}
.header-inner {
  max-width: 1440px; margin: 0 auto; min-height: var(--header-h);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  color: var(--text); text-decoration: none; font-weight: 650; font-size: 16px; white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; }
.brand-sub { color: var(--muted); font-weight: 500; padding-left: 10px; border-left: 1px solid var(--border-strong); }

.icon-button, .menu-button, .theme-toggle, .drawer-close {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 38px; height: 38px; padding: 0; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer;
}
.menu-button:hover, .theme-toggle:hover, .drawer-close:hover { background: var(--bg-soft); }
.menu-button { display: none; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle[aria-pressed="true"] .icon-sun { display: block; }
.theme-toggle[aria-pressed="true"] .icon-moon { display: none; }

.search { position: relative; flex: 1 1 auto; max-width: 460px; margin-left: auto; }
.search-input {
  width: 100%; height: 38px; padding: 0 38px 0 36px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg-soft); color: var(--text); font: inherit; font-size: 15px;
  -webkit-appearance: none; appearance: none;
}
.search-input::placeholder { color: var(--muted); opacity: 1; }
.search-input:focus-visible { outline-offset: 0; background: var(--bg); }
.search-input::-webkit-search-cancel-button { cursor: pointer; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); display: flex; color: var(--muted); pointer-events: none; }
.search-key {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font: 12px/1.4 var(--mono); color: var(--muted); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 6px; pointer-events: none;
}
.search-input:focus ~ .search-key, .search-input:not(:placeholder-shown) ~ .search-key { display: none; }
.search-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 70;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  max-height: min(70vh, 540px); overflow-y: auto; padding: 6px;
}
.search-results { list-style: none; margin: 0; padding: 0; }
.search-results li { margin: 0; }
.search-results a {
  display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none;
}
.search-results li[aria-selected="true"] a, .search-results a:hover { background: var(--accent-soft); }
.sr-page { display: block; font-size: 12.5px; color: var(--muted); }
.sr-title { display: block; font-weight: 600; font-size: 15px; line-height: 1.35; }
.sr-excerpt {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-size: 13.5px; line-height: 1.45; color: var(--muted); margin-top: 2px;
}
.search-status { margin: 0; padding: 8px 12px; font-size: 13.5px; color: var(--muted); }
.search-status:empty { display: none; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }

.open-app {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 38px; padding: 0 14px; border-radius: 8px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 15px;
  text-decoration: none; white-space: nowrap;
}
.open-app:hover { background: var(--accent-hover); color: var(--on-accent); }

/* Without JavaScript: no search, no theme switch, no drawer (the chapters show as a list). */
html:not(.js) .search, html:not(.js) .theme-toggle, html:not(.js) .menu-button { display: none !important; }

/* ---- layout ---- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 0 40px; max-width: 1440px; margin: 0 auto; padding: 0 24px;
}
.main { min-width: 0; padding: 36px 0 72px; }
.main:focus { outline: none; }
.content { max-width: 72ch; margin: 0 auto; }

/* ---- sidebar ---- */
.sidebar {
  position: sticky; top: var(--header-h); align-self: start;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 28px 6px 32px 0; overscroll-behavior: contain;
}
.drawer-head { display: none; }
.chapters, .sections, .toc ul { list-style: none; margin: 0; padding: 0; }
.chapter { margin: 1px 0; }
.chapter > a {
  display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 15px; line-height: 1.35;
}
.chapter > a:hover { background: var(--bg-soft); color: var(--text); }
.chapter > a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chapter .num { min-width: 1.4em; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.chapter > a[aria-current="page"] .num { color: var(--accent); }
.sections { margin: 4px 0 10px 21px; padding-left: 12px; border-left: 1px solid var(--border); }
.sections a {
  display: block; padding: 4px 8px; border-radius: 6px; font-size: 14px; line-height: 1.4;
  color: var(--muted); text-decoration: none;
}
.sections a:hover { color: var(--text); background: var(--bg-soft); }
.sections a.is-active { color: var(--accent); font-weight: 600; }
.sidebar-foot {
  display: flex; flex-direction: column; gap: 8px; margin-top: 22px; padding: 16px 10px 0;
  border-top: 1px solid var(--border); font-size: 14px;
}

/* ---- on this page ---- */
.toc {
  position: sticky; top: var(--header-h); align-self: start;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 36px 0 32px;
}
.toc-title {
  margin: 0 0 10px; font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.toc ul { border-left: 1px solid var(--border); }
.toc li ul { border-left: 0; }
.toc a {
  display: block; margin-left: -1px; padding: 4px 0 4px 14px; border-left: 2px solid transparent;
  font-size: 14px; line-height: 1.4; color: var(--muted); text-decoration: none;
}
.toc .sub a { padding-left: 26px; font-size: 13.5px; }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); }

/* ---- content ---- */
.content h1 {
  font-size: clamp(1.85rem, 1.35rem + 1.6vw, 2.4rem); line-height: 1.2; letter-spacing: -0.015em;
  margin: 0 0 0.45em;
}
.content h2 {
  font-size: 1.5rem; line-height: 1.3; letter-spacing: -0.01em;
  margin: 2.3em 0 0.6em; padding-top: 0.9em; border-top: 1px solid var(--border);
}
.content h3 { font-size: 1.17rem; line-height: 1.35; margin: 1.8em 0 0.5em; }
.content h2, .content h3 { scroll-margin-top: calc(var(--header-h) + 16px); }
.content p, .content ul, .content ol, .content dl { margin: 0 0 1em; }
.content ul, .content ol { padding-left: 1.4em; }
.content li { margin: 0.3em 0; }
.content li > ul, .content li > ol { margin: 0.3em 0 0.4em; }
.content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.content a:hover { text-decoration-thickness: 2px; }
.content strong { font-weight: 650; }
.content hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.lead { font-size: 1.14em; color: var(--muted); }
.content .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.9em; color: var(--muted); margin: 0 0 1.4em; padding: 0; list-style: none; }
.meta li { margin: 0; }

code { font: 0.86em var(--mono); background: var(--code-bg); padding: 0.12em 0.38em; border-radius: 5px; overflow-wrap: anywhere; }
kbd {
  font: 0.82em var(--mono); background: var(--bg-soft); border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 5px; padding: 0.05em 0.4em; white-space: nowrap;
}
pre {
  overflow-x: auto; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; font-size: 0.86em; line-height: 1.55; margin: 0 0 1.2em;
}
pre code { background: none; padding: 0; font-size: 1em; overflow-wrap: normal; }

.anchor {
  display: inline-flex; vertical-align: middle; margin-left: 0.35em; padding: 4px; border-radius: 6px;
  color: var(--muted); opacity: 0; text-decoration: none;
}
.content h2:hover .anchor, .content h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--accent); background: var(--bg-soft); }
@media (hover: none) { .anchor { opacity: 0.5; } }
@media (prefers-reduced-motion: no-preference) {
  .anchor { transition: opacity 0.15s; }
  .content :target { animation: zpt-target 1.8s ease-out; }
}
@keyframes zpt-target { from { background: var(--accent-soft); } to { background: transparent; } }

/* Numbered steps */
ol.steps { list-style: none; counter-reset: step; padding-left: 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 2.4em; margin: 0 0 0.75em; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.12em;
  width: 1.65em; height: 1.65em; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.88em; line-height: 1;
}
.expected {
  border-left: 3px solid var(--tip-border); background: var(--tip-bg); color: var(--text);
  padding: 10px 14px; border-radius: 0 8px 8px 0;
}

/* Callouts */
.callout {
  margin: 1.4em 0; padding: 12px 16px 12px 16px; border: 1px solid var(--note-border); border-left-width: 4px;
  border-radius: 8px; background: var(--note-bg);
}
.callout-label { margin: 0 0 3px; font-size: 0.78em; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--note-text); }
.callout > :last-child { margin-bottom: 0; }
.callout.tip { border-color: var(--tip-border); background: var(--tip-bg); }
.callout.tip .callout-label { color: var(--tip-text); }
.callout.warning { border-color: var(--warn-border); background: var(--warn-bg); }
.callout.warning .callout-label { color: var(--warn-text); }

/* Tables scroll inside their box */
.table-wrap {
  max-width: 100%; overflow-x: auto; margin: 1.2em 0 1.6em;
  border: 1px solid var(--border); border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: 0.93em; line-height: 1.5; }
caption { text-align: left; padding: 10px 14px 0; font-weight: 600; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); min-width: 7.5em; }
thead th { background: var(--bg-soft); font-weight: 650; font-size: 0.95em; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 600; }

/* Figures: a missing screenshot shows a neat box with its alt text (img::after renders for broken images only). */
figure.shot { margin: 1.6em 0 1.8em; }
.shot img {
  position: relative; display: block; width: 100%; height: auto; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  background: var(--bg-soft) repeating-linear-gradient(135deg, transparent 0 14px, var(--placeholder) 14px 28px);
  color: var(--muted); font-size: 0.9rem; object-fit: contain;
}
.shot img::before { content: ""; }
.shot img::after {
  content: "Screenshot: " attr(alt);
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem 2rem; text-align: center; font: 500 0.95rem/1.55 var(--font); color: var(--muted);
  background: var(--bg-soft) repeating-linear-gradient(135deg, transparent 0 14px, var(--placeholder) 14px 28px);
}
figcaption { margin-top: 0.6em; font-size: 0.88em; color: var(--muted); text-align: center; }

/* Chapter cards, glossary, checklist */
.content .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 1.2em 0 1.6em; }
.cards li { margin: 0; }
.cards a {
  display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; background: var(--bg);
}
.cards a:hover { border-color: var(--accent); background: var(--bg-soft); color: var(--text); }
.cards b { display: block; color: var(--accent); margin-bottom: 2px; font-weight: 650; }
.cards span { display: block; font-size: 0.92em; color: var(--muted); line-height: 1.5; }
dl.glossary dt { font-weight: 650; margin-top: 0.8em; }
dl.glossary dd { margin: 0.15em 0 0 0; color: var(--text); }
ul.checklist { list-style: none; padding-left: 0; }
ul.checklist li { position: relative; padding-left: 1.9em; }
ul.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.3em; width: 1.05em; height: 1.05em;
  border: 2px solid var(--border-strong); border-radius: 4px;
}
.kbd-list kbd { margin: 0 0.1em; }

/* Prev / next */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 3.5em; padding-top: 1.5em; border-top: 1px solid var(--border);
}
.pager a {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text);
}
.pager a:hover { border-color: var(--accent); background: var(--bg-soft); }
.pager-next { grid-column: 2; text-align: right; }
.pager-dir { font-size: 0.78em; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.pager-title { font-weight: 600; color: var(--accent); }

/* Footer, toast */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); }
.footer-inner {
  max-width: 1440px; margin: 0 auto; padding: 22px 24px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 14px; color: var(--muted);
}
.footer-inner p { margin: 0; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 12px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px;
  opacity: 0; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: no-preference) { .toast { transition: opacity 0.2s, transform 0.2s; } }
.drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(10, 12, 25, 0.5); }

/* ---- responsive ---- */
@media (max-width: 1199px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 0 36px; }
  .toc { display: none; }
}

@media (max-width: 899px) {
  :root { --header-h: 104px; }
  .header-inner { flex-wrap: wrap; row-gap: 8px; padding: 10px 16px; min-height: 0; }
  .menu-button { display: inline-flex; }
  .brand { margin-right: auto; }
  .search { order: 10; flex: 1 1 0; max-width: none; margin: 0; }
  .open-app { order: 11; padding: 0 12px; font-size: 14px; }
  .search-key { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .main { padding-top: 24px; }
  html.js .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
    width: min(86vw, 330px); max-height: none; height: 100%;
    padding: 0 14px 28px; background: var(--bg); box-shadow: var(--shadow);
    transform: translateX(-105%); visibility: hidden;
  }
  html.js .sidebar.is-open { transform: none; visibility: visible; }
  html.js .drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1; padding: 12px 0 10px; margin-bottom: 6px;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .drawer-title { font-weight: 650; }
  html:not(.js) .sidebar { position: static; max-height: none; padding: 20px 0 0; }
  body.drawer-open { overflow: hidden; }
}
@media (max-width: 899px) and (prefers-reduced-motion: no-preference) {
  html.js .sidebar { transition: transform 0.22s ease, visibility 0.22s; }
}
@media (max-width: 479px) {
  .brand-sub { display: none; }
  .brand { font-size: 15px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: auto; }
  .content h2 { font-size: 1.32rem; }
  th, td { padding: 9px 11px; }
}

/* ---- print ---- */
@media print {
  :root, :root[data-theme="dark"] {
    --bg: #fff; --bg-soft: #f4f4f4; --text: #000; --muted: #333; --border: #ccc; --border-strong: #999;
    --accent: #000; --accent-soft: #eee; --code-bg: #f4f4f4; --tip-bg: #fff; --note-bg: #fff; --warn-bg: #fff;
    --tip-text: #000; --note-text: #000; --warn-text: #000; color-scheme: light;
  }
  body { font-size: 11pt; background: #fff; color: #000; }
  .site-header, .sidebar, .toc, .pager, .drawer-backdrop, .toast, .anchor, .skip-link, .to-top { display: none !important; }
  .layout { display: block; max-width: none; padding: 0; }
  .main { padding: 0; }
  .content { max-width: none; }
  .content a { color: #000; }
  .content a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #444; }
  .content h2 { border-top: 0; }
  h2, h3 { break-after: avoid; }
  figure, .callout, pre, tr, .cards li { break-inside: avoid; }
  .table-wrap { overflow: visible; }
  .shot img { box-shadow: none; }
  .site-footer { background: none; }
}
