:root {
  --bg: #f6f8fb; --surface: #fff; --ink: #14202e; --muted: #53657a; --line: #dbe3ec;
  --brand: #0b2137; --accent: #0f6fd6; --accent-ink: #fff; --accent-soft: #e6f0fc;
  --good: #1b7f4e; --warn: #8a5a00; --warn-bg: #fff3d9; --note-bg: #e9f2fd; --code-bg: #eef2f7;
  --shadow: 0 1px 2px rgba(11, 33, 55, .06), 0 8px 24px rgba(11, 33, 55, .06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0a1522; --surface: #101d2d; --ink: #e6edf5; --muted: #9db0c5; --line: #223348; --brand: #06101b;
    --accent: #5aa6ff; --accent-ink: #06101b; --accent-soft: #14304f; --good: #4cc38a; --warn: #f2c061; --warn-bg: #2e2410; --note-bg: #12283f; --code-bg: #16273a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .15em; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, .tablewrap:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* header */
.top { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 76rem; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .06em; font-size: 1rem; }
.brand b { font-weight: 500; opacity: .75; letter-spacing: 0; }
.search { position: relative; flex: 1 1 14rem; max-width: 26rem; margin: 0; }
.search input { width: 100%; padding: .55rem .8rem; border-radius: 999px; border: 1px solid #2c4560; background: #0f2c47; color: #fff; font: inherit; font-size: 1rem; }
.search input::placeholder { color: #9fb6cc; }
.search.page input { background: var(--surface); color: var(--ink); border-color: var(--line); font-size: 1.05rem; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + .4rem); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: .75rem; box-shadow: var(--shadow); overflow: hidden; max-height: 70vh; overflow-y: auto; }
.results a, .hit { display: block; padding: .6rem .9rem; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a:focus { background: var(--accent-soft); }
.results small, .hit small { display: block; color: var(--muted); font-size: .85rem; }
.sections { margin: 0 0 0 auto; }
.sections > summary { display: none; cursor: pointer; min-height: 44px; padding: .5rem .7rem; border: 1px solid #4a6a8a; border-radius: .5rem; }
.top-links { display: flex; gap: .25rem; margin-left: auto; }
.top-links a { color: #cfe0f1; text-decoration: none; padding: .45rem .8rem; border-radius: .5rem; font-size: .95rem; }
.top-links a:hover, .top-links a[aria-current] { background: #17385a; color: #fff; }
.top-links a.top-feedback { color: #fff; background: #1c4a75; }
.top-links a.top-feedback:hover { background: #24618f; }

/* layout */
.wrap { max-width: 76rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 2.5rem; }
.side { position: sticky; top: 5rem; align-self: start; font-size: .97rem; }
.side summary { display: none; }
.side ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.side li a { display: block; padding: .4rem .9rem; color: var(--muted); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.side li a:hover { color: var(--ink); }
.side li a[aria-current] { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.side .other { margin: 1rem 0 0 .9rem; font-size: .9rem; color: var(--muted); }
.side .side-cta { margin: 1rem 0 0; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: .7rem; font-size: .88rem; color: var(--muted); }
.side .side-cta a { color: var(--accent); }
.doc { min-width: 0; max-width: 46rem; }
.doc.narrow { margin: 2rem auto; padding: 0 1rem; }
.crumbs { color: var(--muted); font-size: .9rem; margin: 0 0 .5rem; }
.crumbs a { color: var(--muted); }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.15; margin: .2rem 0 .6rem; letter-spacing: -.02em; }
.lede { font-size: 1.2rem; color: var(--muted); margin: 0 0 1.5rem; }
h2 { font-size: 1.5rem; margin: 2.4rem 0 .6rem; line-height: 1.25; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; margin: 1.8rem 0 .4rem; }
p, ul, ol, table, figure, details, .callout { margin: 0 0 1.1rem; }
li { margin: .25rem 0; }
code, kbd { background: var(--code-bg); padding: .1em .35em; border-radius: .3em; font: .9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; }
pre { background: var(--code-bg); padding: .9rem 1rem; border-radius: .6rem; overflow-x: auto; font-size: .9rem; }
pre code { background: none; padding: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 0 2.8rem; margin: 0 0 1rem; min-height: 2rem; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: .05rem; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .95rem; }
.callout { padding: .85rem 1rem; border-radius: .6rem; background: var(--note-bg); border-left: 4px solid var(--accent); }
.callout.warn { background: var(--warn-bg); border-left-color: var(--warn); }
.callout > :last-child { margin-bottom: 0; }
.callout strong:first-child { display: block; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: .6rem; background: var(--surface); }
.tablewrap table { margin: 0; }
table { border-collapse: collapse; width: 100%; font-size: .97rem; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.tick { color: var(--good); font-weight: 700; }
.dash { color: var(--muted); }
.pill { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.good { background: #dff3e8; color: #17653f; } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: #fde3e1; color: #a1281f; } .pill.purple { background: #ece4f9; color: #5b34a3; }
@media (prefers-color-scheme: dark) { .pill.good { background: #12372a; color: #7fdcae; } .pill.bad { background: #3d1815; color: #ff9d94; } .pill.purple { background: #2a1f45; color: #c3a6f5; } }
dl.terms dt { font-weight: 700; margin-top: 1.1rem; }
dl.terms dd { margin: .1rem 0 0; color: var(--muted); }
dl.terms dd, dl.terms dt { scroll-margin-top: 5rem; }

/* screenshots */
.shot { margin: 1.6rem 0; }
.shot a { display: block; line-height: 0; border-radius: .7rem; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.shot img { width: 100%; }
.shot figcaption, .shots figcaption { margin-top: .5rem; font-size: .92rem; color: var(--muted); line-height: 1.45; }
.shots { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 15rem); gap: 1.2rem; align-items: start; margin: 1.6rem 0; }
.shots figure { margin: 0; }
.shots a { display: block; line-height: 0; border-radius: .7rem; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.shots.phones { grid-template-columns: repeat(2, minmax(0, 15rem)); justify-content: start; }
.phone a { border-radius: 1.3rem; border-width: 4px; border-color: #1b2c3f; }

/* pager */
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.pager a { display: block; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; max-width: 48%; }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }
.pager .next { text-align: right; margin-left: auto; }

/* home */
.hero { background: var(--brand); color: #fff; padding: 3.2rem 1rem 3.6rem; }
.hero-in { max-width: 76rem; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2.5rem; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2rem, 6vw, 3.1rem); margin: 0 0 1rem; }
.hero p { color: #c3d4e6; font-size: 1.2rem; margin: 0 0 1.4rem; }
.hero .btns { display: flex; flex-wrap: wrap; gap: .7rem; }
.btn { display: inline-block; padding: .75rem 1.2rem; border-radius: .6rem; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.btn.alt { background: transparent; color: #fff; border: 1px solid #4a6a8a; }
.hero-shots { position: relative; min-height: 18rem; }
.hero-shots .d { border-radius: .8rem; box-shadow: 0 20px 50px rgba(0,0,0,.5); border: 1px solid #28435f; width: 100%; }
.hero-shots .m { position: absolute; right: -.5rem; bottom: -1.8rem; width: 28%; border-radius: 1rem; border: 3px solid #1b2c3f; box-shadow: 0 16px 40px rgba(0,0,0,.55); }
.home-in { max-width: 76rem; margin: 0 auto; padding: 2.5rem 1rem 3rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.2rem; margin: 1rem 0 2.5rem; }
.card { display: block; padding: 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: .9rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.card:hover { border-color: var(--accent); }
.card h2 { margin: 0 0 .3rem; font-size: 1.35rem; color: var(--accent); }
.card p { color: var(--muted); margin: 0 0 .8rem; }
.card ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: .97rem; }
.card .more { list-style: none; margin-left: -1.1rem; margin-top: .5rem; color: var(--accent); font-weight: 600; }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.2rem; }
.three h3 { margin-top: 0; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.foot-in { max-width: 76rem; margin: 0 auto; padding: 1.2rem 1rem 2rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* a link back to the main opsavor.ai site, and the legal pages */
.banner { background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.banner-in { max-width: 76rem; margin: 0 auto; padding: .65rem 1rem; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem .5rem; font-size: .95rem; text-align: center; }
.banner-in a { font-weight: 700; }
.updated { color: var(--muted); font-size: .95rem; margin: .2rem 0 1.6rem; }

/* feedback form */
.feedback { display: grid; gap: 1rem; margin: 1.4rem 0; max-width: 40rem; }
.feedback label { display: block; font-weight: 600; font-size: .95rem; }
.feedback .opt { color: var(--muted); font-weight: 400; font-size: .85rem; }
.feedback input, .feedback select, .feedback textarea { display: block; width: 100%; margin-top: .35rem; font: inherit; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); color: var(--ink); }
.feedback textarea { resize: vertical; }
.feedback button { justify-self: start; font: inherit; font-weight: 600; padding: .65rem 1.2rem; border: 0; border-radius: .5rem; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.feedback button:disabled { opacity: .6; cursor: default; }
.fb-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.fb-note { margin: .5rem 0 1rem; padding: .7rem 1rem; border-radius: .5rem; font-size: .95rem; }
.fb-note.ok { background: #dff3e8; color: #17653f; }
.fb-note.error { background: #fde3e1; color: #a1281f; }
.fine { color: var(--muted); font-size: .9rem; }
@media (prefers-color-scheme: dark) { .fb-note.ok { background: #12372a; color: #7fdcae; } .fb-note.error { background: #3d1815; color: #ff9d94; } }

/* phones and small tablets */
@media (max-width: 62rem) {
  .wrap { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-top: 1rem; }
  .side { position: static; }
  .side details { background: var(--surface); border: 1px solid var(--line); border-radius: .7rem; }
  .side summary { display: block; padding: .75rem 1rem; font-weight: 600; cursor: pointer; }
  .side ul { border-left: 0; padding: 0 .5rem .5rem; }
  .hero-in { grid-template-columns: minmax(0, 1fr); }
  .hero-shots { margin-bottom: 2rem; }
}
@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .top-in { gap: .6rem; }
  html { scroll-padding-top: 9rem; }
  .top-in { position: relative; }
  .brand { font-size: .95rem; min-height: 44px; letter-spacing: .03em; }
  .brand img { width: 28px; height: 28px; }
  .sections { order: 2; }
  .sections > summary { display: block; }
  .top-links { position: absolute; left: 1rem; right: 1rem; top: 3.8rem; padding: .5rem; display: grid; background: var(--brand); border: 1px solid #4a6a8a; border-radius: .6rem; box-shadow: var(--shadow); }
  .top-links a { min-height: 44px; background: #12304d; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  .shots, .shots.phones { grid-template-columns: minmax(0, 1fr); }
  .shots figure.phone { max-width: 15rem; }
  .shots.phones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pager { flex-direction: column; } .pager a { max-width: none; } .pager .next { text-align: left; }
  .hero { padding-top: 2rem; }
}
@media (prefers-reduced-motion: no-preference) { .card, .btn, .pager a { transition: border-color .15s, background .15s; } }
.shots:has(> figure:only-child) { grid-template-columns: minmax(0, 1fr); }

/* Worked examples reuse the existing document card and status palette. */
.savy-example { background: var(--surface); border: 1px solid var(--line); border-radius: .9rem; padding: 1.2rem; margin: 1.5rem 0; }
.savy-example h3 { margin-top: .6rem; }
.savy-example dt { font-weight: 700; margin-top: 1rem; }
.savy-example dd { margin: .2rem 0 0; }
.savy-example .fine { margin-bottom: .5rem; }
