/* 5UP5 theme layer — dark-first with day/night/auto toggle */
html[data-theme="dark"] {
  color-scheme: dark;
  --paper:#0B1420;
  --paper-2:#101C2A;
  --line:#26384C;
  --text:#EEF2F7;
  --text-soft:#A8B3C2;
  --green:#69C98F;
  --slate:#93A1B5;
}
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] body { background:var(--paper); }
html[data-theme="dark"] nav.primary a,
html[data-theme="dark"] details.mobile-nav summary,
html[data-theme="dark"] .mobile-nav-panel a,
html[data-theme="dark"] .board-row,
html[data-theme="dark"] .tag-new,
html[data-theme="dark"] .site-footer { color:#FAF7F1; }
html[data-theme="dark"] .budget-widget,
html[data-theme="dark"] .disclosure,
html[data-theme="dark"] .notice { box-shadow:none; }
html[data-theme="dark"] .budget-out a.brow:hover,
html[data-theme="dark"] .budget-out a.brow:focus-visible { background:rgba(255,255,255,.04); }
html[data-theme="dark"] .page-hero,
html[data-theme="dark"] .gates,
html[data-theme="dark"] .how { border-color:var(--line); }

.header-tools{display:flex;align-items:center;gap:10px}
.theme-toggle{
  border:1px solid var(--ink-line);background:rgba(255,255,255,.04);color:#FAF7F1;
  height:34px;min-width:74px;padding:0 10px;border-radius:2px;cursor:pointer;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,'Liberation Mono',monospace;
  font-size:11px;letter-spacing:.05em;text-transform:uppercase;
}
.theme-toggle:hover{border-color:var(--amber);color:var(--amber)}
.theme-toggle .theme-icon{color:var(--amber);margin-right:6px}
@media (max-width: 820px){
  .header-tools{gap:8px}
  .theme-toggle{min-width:40px;width:40px;padding:0;font-size:0}
  .theme-toggle .theme-icon{font-size:15px;margin:0}
}

/* Small product polish */
.board-row{transition:background .15s ease,transform .15s ease}
a.board-row:hover{transform:translateX(2px)}
.board-foot{letter-spacing:.01em}
.notice{border-radius:2px}


/* Header layout fix: logo left, navigation + tools grouped on the right */
.site-header .wrap{justify-content:flex-start!important;gap:24px}
nav.primary{margin-left:auto}
.header-tools{margin-left:0}
@media (max-width:860px){
  .site-header .wrap{gap:10px}
  .header-tools{margin-left:auto}
  details.mobile-nav{order:3}
}

/* Affiliate service deck */
.service-deck{padding:48px 0;border-top:1px solid var(--line)}
.service-deck-head{display:flex;align-items:end;justify-content:space-between;gap:24px;margin-bottom:22px}
.service-deck-head p{margin:0}
.service-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}
.service-card{display:flex;flex-direction:column;min-height:150px;padding:16px;border:1px solid var(--line);background:var(--paper-2);text-decoration:none;border-radius:2px;transition:transform .15s ease,border-color .15s ease,background .15s ease}
.service-card:hover,.service-card:focus-visible{transform:translateY(-2px);border-color:var(--amber)}
.service-card .svc-code{font:11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.06em;color:var(--coral);margin-bottom:16px}
.service-card strong{font-size:16px;line-height:1.25;color:var(--text);margin-bottom:6px}
.service-card small{color:var(--text-soft);line-height:1.4;margin-bottom:14px}
.service-card .svc-cta{margin-top:auto;font:11px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--amber);letter-spacing:.04em}
.service-note{font-size:12px;color:var(--text-soft);margin-top:12px}
@media(max-width:900px){.service-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:520px){.service-grid{grid-template-columns:1fr}.service-deck-head{display:block}.service-deck-head p{margin-top:8px}}
