/* CoSell docs: the console's navy and AWS-orange palette, set for long-form reading. */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #18202f;
  --muted: #566176;
  --line: #d8dee8;
  --navy: #1f3864;
  --navy-soft: #e8eef7;
  --accent: #c96f05;
  --link: #2462a6;
  --code-bg: #eef2f8;
  --focus: rgba(46, 117, 182, 0.35);
  --sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1522; --surface: #151d2d; --ink: #e4e9f2; --muted: #9aa6ba; --line: #2a3448;
    --navy: #9db8e6; --navy-soft: #1c2840; --accent: #ffa733; --link: #8fb6f0; --code-bg: #1b2436;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1522; --surface: #151d2d; --ink: #e4e9f2; --muted: #9aa6ba; --line: #2a3448;
  --navy: #9db8e6; --navy-soft: #1c2840; --accent: #ffa733; --link: #8fb6f0; --code-bg: #1b2436;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--sans); }
a { color: var(--link); }
a:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; }
.brand em { font-style: normal; font-weight: 500; color: var(--accent); }
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input { width: 100%; font: inherit; font-size: 15px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
#search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14); max-height: 60vh; overflow: auto; }
#search-results a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
#search-results a:hover, #search-results a:focus { background: var(--navy-soft); }
#search-results small { display: block; color: var(--muted); font-size: 13px; }
.console { padding: 7px 14px; border-radius: 8px; background: #1f3864; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }

.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 32px; max-width: 1320px; margin: 0 auto; padding: 24px 20px 48px; }
.side { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 90px); overflow: auto; font-size: 15px; }
.side ul { list-style: none; margin: 0 0 12px; padding: 0; }
.side a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.side a:hover { background: var(--navy-soft); }
.side a[aria-current="page"] { background: var(--navy-soft); color: var(--navy); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav-details > summary { display: none; }
.nav-section { margin: 14px 10px 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

main { min-width: 0; }
article { max-width: 72ch; }
article h1 { font-size: 34px; line-height: 1.2; margin: 4px 0 18px; text-wrap: balance; }
article h2 { font-size: 23px; margin: 36px 0 10px; padding-top: 8px; border-top: 1px solid var(--line); text-wrap: balance; }
article h3 { font-size: 18px; margin: 26px 0 8px; }
article h2, article h3 { scroll-margin-top: 80px; position: relative; }
.anchor { position: absolute; left: -1.1em; color: var(--muted); text-decoration: none; opacity: 0; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
article p, article li { color: var(--ink); }
article ul, article ol { padding-left: 1.3em; }
article li { margin: 4px 0; }
article img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--code-bg); padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
pre code { background: none; padding: 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 12px 0 18px; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; background: var(--navy-soft); }
blockquote { margin: 16px 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; }
blockquote p:last-child { margin-bottom: 0; }

.toc { position: sticky; top: 72px; align-self: start; font-size: 14px; }
.toc p { margin: 0 0 6px; font-weight: 600; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 3px 12px; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--link); }
.pager { display: flex; justify-content: space-between; gap: 16px; max-width: 72ch; margin-top: 48px; }
.pager a { flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; }
.pager a span { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.pager .next { text-align: right; }
.foot { border-top: 1px solid var(--line); padding: 20px; text-align: center; color: var(--muted); font-size: 14px; background: var(--surface); }
.foot p { margin: 0; }

@media (max-width: 1100px) { .shell { grid-template-columns: 230px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .side { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .nav-details > summary { display: list-item; cursor: pointer; font-weight: 600; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
  .nav-details[open] > summary { margin-bottom: 4px; }
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  article h1 { font-size: 28px; }
  .anchor { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
html { scroll-behavior: smooth; }
