/* ================= Theme Variables ================= */
/* Light (default)
   NOTE: you can move this :root and .ub-dark block into mainstyles.css later
   if you want all theme tokens in one place. */
:root{
  --ub-bg:#ffffff;
  --ub-text:#0f172a;
  --ub-muted:#475569;
  --ub-border:#e5e7eb;
  --ub-accent:#6366F1;
  --ub-accent-2:#475569;
  --ub-soft:#E0F2FE;

  --ub-search-frame:#0d6efd;
  --ub-search-inner:#ffffff;
  --ub-search-btn:#084298;
  --ub-page-bg:#f9fafb;
  --ub-page-text:#0f172a;
  --ub-panel-bg:#ffffff;
  --ub-radius:14px;
  --ub-gap:14px;
  --ub-pad:14px;
  --ub-shadow:0 6px 24px rgba(0,0,0,0.08);

    --bg: #ffffff;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --brand: #0ea5e9;
    --accent: #111827;
    --card: #f9fafb;
    --code: #0b1020;
    --code-bg: #f3f4f6;
    --radius: 14px;
}

/* Dark theme overrides (applied when <html> has class="ub-dark") */
.ub-dark{
  --ub-bg:#020617;
  --ub-text:#e5e7eb;
  --ub-muted:#94a3b8;
  --ub-border:#1e293b;
  --ub-accent:#38bdf8;
  --ub-accent-2:#6366f1;
  --ub-soft:#0f172a;

  --ub-search-frame:#1d4ed8;
  --ub-search-inner:#020617;
  --ub-search-btn:#0b1120;
  --ub-page-bg:#020617;
  --ub-page-text:#e5e7eb;
  --ub-panel-bg:#020617;
  --ub-shadow:0 10px 30px rgba(0,0,0,0.6);


  --bg: #020617;
    --ink: #e5e7eb;
    --muted: #9ca3af;
    --line: #1f2937;
    --brand: #38bdf8;
    --accent: #e5e7eb;
    --card: #020617;
    --code: #e5e7eb;
    --code-bg: #020617;
}




/* ================= Header Shell ================= */
.ub-header{
  position:sticky;
  top:0;
  z-index:1000;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
  color:var(--ub-text);
  background:var(--ub-bg);
  border-bottom:1px solid var(--ub-border);
}
.ub-wrap{max-width:1200px; margin:auto; padding:0 16px}

/* ================= Main bar (burger / logo / search / theme) ================= */
/* Mobile-first: stack search under burger+logo */
.ub-header-main{
  display:grid;
  grid-template-columns:auto 1fr;
  grid-template-areas:
    "burger logo"
    "search search";
  align-items:center;
  gap:10px 16px;
  padding:10px 0;
}
.ub-logo{
  grid-area:logo;
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--ub-text);
}
.ub-logo img{height:38px; width:auto}

/* Dark mode toggle button */
.ub-theme-toggle{
  grid-area:theme;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:0 10px;
  height:36px;
  border-radius:999px;
  border:1px solid var(--ub-border);
  background:transparent;
  color:var(--ub-text);
  cursor:pointer;
  font-size:13px;
  white-space:nowrap;
}
.ub-theme-toggle:hover{
  background:var(--ub-soft);
}
.ub-theme-toggle-icon{
  display:inline-flex;
}
.ub-theme-toggle-label{
  display:inline-block;
}

/* When dark is active you could tweak label via CSS if desired */
.ub-dark .ub-theme-toggle{border-color:var(--ub-border);}

/* ================= Newegg-style Search ================= */
.ub-search{
  grid-area:search;
  display:flex;
  align-items:center;
  gap:6px;
  background:var(--ub-search-frame);
  border:2px solid var(--ub-search-frame);
  border-radius:999px;
  overflow:hidden;
  padding:4px;
}
.ub-search select{
  height:40px;
  line-height:40px;
  padding:0 12px;
  background:var(--ub-search-frame);
  color:#fff;
  border:none;
  border-radius:999px 0 0 999px;
  appearance:none;
  -webkit-appearance:none;
}
.ub-search input[type="search"]{
  flex:1;
  min-width:0;
  height:40px;
  line-height:40px;
  padding:0 12px;
  background:var(--ub-search-inner);
  color:var(--ub-text);
  border:none;
  border-radius:999px;
}
.ub-search input[type="search"]::placeholder{
  color:#64748b;
  opacity:1;
}
.ub-search button{
  height:40px;
  line-height:40px;
  padding:0 18px;
  background:var(--ub-search-btn);
  color:#fff;
  border:none;
  border-radius:999px;
  white-space:nowrap;
}
.ub-search button:hover{
  background:#052c65;
}
.ub-dark .ub-search button:hover{
  background:#020617;
}
.ub-search select:focus,
.ub-search input[type="search"]:focus,
.ub-search button:focus{
  outline:none;
  box-shadow:0 0 0 2px #cfe2ff;
}
/* Ensure nothing inside turns transparent */
.ub-search *{
  background-image:none !important;
  opacity:1 !important;
  box-shadow:none !important;
}
.ub-search select option{
  background:#ffffff;
  color:#0f172a;
}

/* ================= Primary Nav ================= */
.ub-nav{
  border-top:1px solid var(--ub-border);
  background:var(--ub-bg);
}
.ub-nav .row{
  display:flex;
  gap:12px;
  align-items:center;
  height:46px;
}
.ub-nav a{
  display:inline-flex;
  align-items:center;
  padding:0 10px;
  height:100%;
  text-decoration:none;
  color:var(--ub-text);
  border-bottom:2px solid transparent;
}
.ub-nav a.is-active{
  border-bottom-color:var(--ub-accent);
  color:var(--ub-accent);
}
.ub-nav .fill{flex:1}

/* ================= Mobile ================= */
.ub-burger{
  grid-area:burger;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:40px;
  width:40px;
  border-radius:10px;
  border:1px solid var(--ub-border);
  background:transparent;
  cursor:pointer;
}
.ub-burger:hover{background:var(--ub-soft)}

/* Hide desktop nav on tablet / mobile */
@media (max-width:1024px){
  .ub-nav{
    display:none;
  }
}

/* Desktop layout override */
@media (min-width:1025px){
  .ub-header-main{
    grid-template-columns:200px 1fr auto;
    grid-template-areas:"logo search theme";
    align-items:center;
  }
  .ub-burger{display:none;}
}

/* Mobile slide-over panel */
.ub-mobile-panel{
  position:fixed;
  inset:0 0 0 40%;
  transform:translateX(100%);
  transition:transform .25s ease;
  background:var(--ub-bg);
  box-shadow:-8px 0 24px rgba(0,0,0,.18);
  z-index:1100;
}
.ub-mobile-panel.open{transform:translateX(0);}
@media (max-width:600px){
  /* On very small screens, panel takes more width */
  .ub-mobile-panel{inset:0 0 0 30%;}
}
.ub-mobile-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px;
  border-bottom:1px solid var(--ub-border);
}
.ub-mobile-links{
  display:flex;
  flex-direction:column;
  padding:8px;
}
.ub-mobile-links a{
  padding:12px;
  border-radius:8px;
  text-decoration:none;
  color:var(--ub-text);
}
.ub-mobile-links a:hover{
  background:var(--ub-soft);
}

/* ================= Utilities ================= */
.ub-sronly{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  border:0;
}














/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  margin-top: 2rem;
  padding: 1.25rem 0 1.5rem;
  border-top: 1px solid var(--ub-border);
  font-size: 0.9375rem;
  color: var(--ub-muted);
  background: var(--ub-panel-bg);
}

.ub-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Link columns */
.ub-footer-links {
  margin: 0.5rem 0 0;
}

.ub-footer-links section {
  min-width: 0;
}

.ub-footer-links h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ub-page-text);
}

.ub-footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

/* 3-column grid, collapses on small screens */
.ub-footer-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .ub-footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Bottom row: copyright + legal links */
.ub-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  padding-top: 28px;
}

.ub-footer-copy {
  color: var(--ub-muted);
}

.ub-footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ub-footer-separator {
  color: #9ca3af;
}

/* Global footer / sitemap links */
.ub-link {
  text-decoration: none;
  color: var(--ub-accent);
  display: inline-block;
  padding: 0.1rem 0;
  border-bottom: 1px solid transparent;
}

.ub-link:hover {
  border-bottom-color: #bfdbfe;
}






  html,body {
    margin:0;
    padding:0;
    background:var(--bg);
    color:var(--ink);
    font:16px/1.6 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Arial,"Apple Color Emoji","Segoe UI Emoji";
  }
  .wrap-pp {
    max-width:1040px;
    margin:0 auto;
    padding:24px;
    display:grid;
    grid-template-columns:280px 1fr;
    gap:28px;
  }
  header {
    grid-column:1 / -1;
    margin-bottom:8px;
  }
  header h1 {
    font-size:clamp(28px,4vw,42px);
    margin:0 0 6px;
    letter-spacing:-0.02em;
  }
  header p.meta {
    color:var(--muted);
    margin:0;
  }
  .toc {
    position:sticky;
    top:16px;
    align-self:start;
    background:var(--card);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:16px;
  }
  .toc h2 {
    margin:0 0 8px;
    font-size:14px;
    text-transform:uppercase;
    letter-spacing:.12em;
    color:var(--muted);
  }
  .toc a {
    display:block;
    padding:6px 8px;
    border-radius:10px;
    color:var(--ink);
    text-decoration:none;
  }
  .toc a:hover {
    background:#eef6ff;
    color:var(--accent);
  }

  /* In dark mode, adjust hover bg a bit so it still contrasts */
  .ub-dark .toc a:hover {
    background:#0f172a;
    color:var(--brand);
  }

  main {
    background:var(--bg);
  }
  section {
    padding:18px 0;
    border-bottom:1px solid var(--line);
  }
  section:last-of-type {
    border-bottom:none;
  }
  h2 {
    font-size:clamp(20px,2.6vw,28px);
    margin:0 0 10px;
    letter-spacing:-0.02em;
  }
  h3 {
    font-size:18px;
    margin:14px 0 8px;
  }
  p {
    margin:8px 0 10px;
  }
  ul,ol {
    margin:8px 0 10px 20px;
  }
  .card {
    background:var(--card);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:14px;
  }
  .inline-code {
    font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
    background:var(--code-bg);
    color:var(--code);
    padding:.1em .35em;
    border-radius:6px;
  }
  .note {
    font-size:14px;
    color:var(--muted);
  }
  .kbd {
    font:13px/1 ui-monospace,Menlo,Consolas,monospace;
    border:1px solid var(--line);
    padding:2px 6px;
    border-radius:6px;
    background:#f8fafc;
  }
  .lawtag {
    display:inline-block;
    font-size:12px;
    padding:.2em .55em;
    border-radius:999px;
    border:1px solid var(--line);
    background:#f8fafc;
    color:#334155;
    margin-right:6px;
  }
  .flex {
    display:flex;
    gap:10px;
    flex-wrap:wrap;
  }
  a {
    color:var(--brand);
  }
  footer.page {
    grid-column:1 / -1;
    padding:18px 0 28px;
    color:var(--muted);
  }
  .small {
    font-size:14px;
  }
  @media (max-width:920px) {
    .wrap {
      grid-template-columns:1fr;
    }
    .toc {
      position:static;
    }
  }















