/* Smart Parking documentation site. Plain CSS, no web fonts, no CDN: it must work offline.
   Layout after MkDocs Material: top bar, section sidebar, article, "on this page" contents. */
:root {
  --bg: #ffffff; --bg-2: #f4f7f5; --bg-3: #e8eeea; --line: #dbe3de;
  --text: #13261f; --text-2: #4a5f57; --accent: #0b6e78; --accent-ink: #ffffff; --accent-soft: #e3f1f2;
  --resin: #c47f12; --ok: #17874d; --warn: #a86400; --stop: #c23b2b;
  --code-bg: #f2f5f3; --shadow: 0 1px 2px rgb(16 48 42 / 0.06), 0 6px 18px rgb(16 48 42 / 0.06);
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --top: 3.5rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1714; --bg-2: #15201c; --bg-3: #1d2a25; --line: #2a3a34;
    --text: #e4ece8; --text-2: #a3b5ad; --accent: #4fc0ca; --accent-ink: #0b1a17; --accent-soft: #15302f;
    --resin: #e3a23b; --ok: #4cc283; --warn: #e0a040; --stop: #f07a6a; --code-bg: #15201c; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f1714; --bg-2: #15201c; --bg-3: #1d2a25; --line: #2a3a34;
  --text: #e4ece8; --text-2: #a3b5ad; --accent: #4fc0ca; --accent-ink: #0b1a17; --accent-soft: #15302f;
  --resin: #e3a23b; --ok: #4cc283; --warn: #e0a040; --stop: #f07a6a; --code-bg: #15201c; --shadow: none;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 1rem); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.7 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--resin); outline-offset: 2px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 1rem; top: 0.5rem; z-index: 99; background: var(--bg); padding: 0.4rem 0.8rem; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 0.75rem; padding: 0 1rem; background: var(--accent); color: var(--accent-ink); }
.logo { display: flex; align-items: center; gap: 0.6rem; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.05rem; }
.mark { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 7px; background: var(--accent-ink); color: var(--accent); font-weight: 900; }
.tag { font-weight: 500; opacity: 0.8; }
.ver { margin-inline-start: auto; font: 600 0.8rem/1 var(--mono); padding: 0.3rem 0.5rem; border-radius: 4px; background: rgb(255 255 255 / 0.16); }
.menu, .theme { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.menu:hover, .theme:hover { background: rgb(255 255 255 / 0.15); }
.menu svg, .theme svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu { display: none; }

/* three columns */
.layout { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr) 13rem; max-width: 92rem; margin: 0 auto; }
.sidebar { position: sticky; top: var(--top); align-self: start; height: calc(100vh - var(--top)); overflow-y: auto; padding: 1.75rem 1rem 2rem 1.5rem; }
.sidebar h4 { margin: 1.4rem 0 0.4rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.sidebar h4:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: block; padding: 0.32rem 0.7rem; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 0.94rem; }
.sidebar a:hover { background: var(--bg-2); color: var(--accent); }
.sidebar a[aria-current='page'] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.content { min-width: 0; padding: 2.25rem 2.5rem 3rem; border-inline: 1px solid var(--line); }
article { max-width: 48rem; }
.toc { position: sticky; top: var(--top); align-self: start; padding: 2rem 1rem; font-size: 0.86rem; }
.toc-title { margin: 0 0 0.5rem; font-weight: 700; color: var(--text-2); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.toc ul { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--line); }
.toc a { display: block; padding: 0.22rem 0.75rem; margin-inline-start: -2px; border-inline-start: 2px solid transparent; color: var(--text-2); text-decoration: none; }
.toc a:hover, .toc a.on { color: var(--accent); border-color: var(--accent); }
@media (max-width: 1180px) { .layout { grid-template-columns: 14.5rem minmax(0, 1fr); } .toc { display: none; } .content { border-inline-end: 0; } }
@media (max-width: 820px) {
  .menu { display: grid; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 15; inset: var(--top) auto 0 0; width: 17rem; background: var(--bg); border-inline-end: 1px solid var(--line); transform: translateX(-100%); transition: transform 200ms ease; height: auto; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgb(0 0 0 / 0.25); }
  .content { padding: 1.5rem 1rem 2.5rem; border: 0; }
}

/* article typography */
article h1 { margin: 0 0 0.6rem; font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; }
article h2 { margin: 2.6rem 0 0.8rem; padding-top: 0.4rem; font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.01em; border-top: 1px solid var(--line); padding-top: 1.6rem; }
article h3 { margin: 1.8rem 0 0.5rem; font-size: 1.1rem; }
article p, article ul, article ol, article table, article pre, article figure, .admonition { margin: 0 0 1rem; }
article ul, article ol { padding-inline-start: 1.4rem; }
article li + li { margin-top: 0.25rem; }
.lead { font-size: 1.15rem; color: var(--text-2); }
code { font: 0.88em/1.5 var(--mono); background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; }
pre { position: relative; background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem 1rem; overflow-x: auto; }
pre code { background: none; padding: 0; font-size: 0.86rem; }
.copy { position: absolute; top: 0.45rem; right: 0.45rem; font: 600 0.72rem/1 var(--font); padding: 0.35rem 0.55rem; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--text-2); cursor: pointer; opacity: 0; transition: opacity 120ms; }
pre:hover .copy, .copy:focus { opacity: 1; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; display: block; overflow-x: auto; }
th, td { text-align: start; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--bg-2); font-weight: 700; white-space: nowrap; }
figcaption { margin-top: 0.45rem; font-size: 0.86rem; color: var(--text-2); }
figure img { border-radius: 8px; border: 1px solid var(--line); }
kbd { font: 600 0.8em var(--mono); padding: 0.1em 0.4em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--bg-2); }

/* admonitions */
.admonition { border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); border-radius: 6px; background: var(--bg-2); padding: 0.75rem 1rem; }
.admonition > p:last-child, .admonition > ul:last-child { margin-bottom: 0; }
.admonition .adm-title { display: block; font-weight: 800; margin-bottom: 0.25rem; color: var(--accent); }
.admonition.warning { border-inline-start-color: var(--warn); } .admonition.warning .adm-title { color: var(--warn); }
.admonition.success { border-inline-start-color: var(--ok); } .admonition.success .adm-title { color: var(--ok); }
.admonition.danger { border-inline-start-color: var(--stop); } .admonition.danger .adm-title { color: var(--stop); }

/* badges and status */
.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 1.4rem; }
.badge { display: inline-flex; font: 600 0.76rem/1 var(--mono); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.badge b, .badge i { padding: 0.32rem 0.5rem; font-style: normal; }
.badge b { background: var(--bg-3); color: var(--text-2); font-weight: 600; }
.badge i { color: #fff; background: var(--accent); }
.badge.ok i { background: #17874d; } .badge.warn i { background: #a86400; } .badge.stop i { background: #c23b2b; }
.state { font-weight: 700; white-space: nowrap; }
.state.ok { color: var(--ok); } .state.warn { color: var(--warn); } .state.stop { color: var(--stop); }

/* cards and galleries */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin: 0 0 1.2rem; }
.card { display: block; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; box-shadow: var(--shadow); background: var(--bg); }
.card:hover { border-color: var(--accent); }
.card b { display: block; color: var(--accent); }
.card span { font-size: 0.9rem; color: var(--text-2); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin: 0 0 1rem; }
.gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.gallery.tall img { aspect-ratio: 410 / 720; }
.gallery figure { margin: 0; }
@media (max-width: 640px) { .cards, .gallery { grid-template-columns: minmax(0, 1fr); } }
.frame { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 0 0 1rem; }
.frame-bar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 0.5rem 0.8rem; font-size: 0.85rem; color: var(--text-2); background: var(--bg-2); border-bottom: 1px solid var(--line); }
.frame iframe { display: block; width: 100%; height: min(78vh, 50rem); border: 0; background: #f1f4f0; }
.wide-frame { max-width: none; }
ol.timeline { list-style: none; padding: 0; border-inline-start: 2px solid var(--line); margin-inline-start: 0.4rem; }
ol.timeline li { position: relative; padding: 0 0 1rem 1.3rem; margin: 0; }
ol.timeline li::before { content: ''; position: absolute; inset-inline-start: -0.45rem; top: 0.45rem; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
ol.timeline li.next::before { background: var(--bg); border-color: var(--resin); }
ol.timeline time { font-weight: 700; color: var(--text-2); font-size: 0.88rem; }

/* pager and footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; max-width: 48rem; margin-top: 3rem; }
.pager a { display: block; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--text-2); font-size: 0.78rem; }
.pager .next { text-align: end; grid-column: 2; }
.foot { max-width: 48rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--text-2); }
svg.diagram { width: 100%; height: auto; display: block; margin: 0 0 1rem; }
svg.diagram text { font: 600 13px var(--font); fill: var(--text); }
svg.diagram .sub { font-weight: 400; font-size: 11.5px; fill: var(--text-2); }
svg.diagram .box { fill: var(--bg-2); stroke: var(--line); stroke-width: 1.5; }
svg.diagram .hub { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
svg.diagram .link { stroke: var(--accent); stroke-width: 2; fill: none; }
svg.diagram .lbl { font: 500 11px var(--mono); fill: var(--accent); }
