/* ==========================================================================
   Syndicor — site.css
   --------------------------------------------------------------------------
   The whole design system in one file (docs/SPEC.md §3). Dark theme only:
   this is the brand, there is no light mode. No icon fonts, inline SVG only.

   Sections
     1. Tokens                 13. Alerts + flash region
     2. Reset + base           14. Badges
     3. Typography             15. Auth layout
     4. Layout                 16. App shell (dashboard / admin)
     5. Skip link              17. Tables + pager
     6. Site header / nav      18. Footer
     7. Notice bar             19. Misc helpers (.eyebrow, .notice, .page-head …)
     8. Hero                   20. Prose (privacy / terms)
     9. Buttons                21. Utilities
    10. Cards + features       22. Responsive: 900px and 600px
    11. Steps                  23. Reduced motion
    12. FAQ                    24. Print
    (forms are section 12b, between FAQ and alerts)
   ========================================================================== */


/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
  --bg:          #1a0310;
  --bg-2:        #22051a;
  --surface:     #2a0719;
  --surface-2:   #35092a;
  --border:      rgba(255, 255, 255, 0.09);
  --border-2:    rgba(255, 255, 255, 0.16);
  --accent:      #e4173f;
  --accent-2:    #ff2d55;
  --accent-soft: rgba(228, 23, 63, 0.14);
  --text:        #f6e9ee;
  --text-2:      #cfb0bd;
  --text-3:      #9a7a89;
  --ok:          #38d39f;
  --warn:        #f5b84f;
  --danger:      #ff5c7a;
  --radius:      14px;
  --radius-sm:   9px;
  --shadow:      0 20px 60px rgba(0, 0, 0, .45);
  --font-head:   'Outfit', system-ui, sans-serif;
  --font-body:   'Inter', system-ui, sans-serif;

  /* Derived / supporting tokens (not in the spec list, used internally). */
  --font-mono:   ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --ok-soft:     rgba(56, 211, 159, 0.14);
  --warn-soft:   rgba(245, 184, 79, 0.14);
  --danger-soft: rgba(255, 92, 122, 0.14);
  --glow:        0 10px 30px rgba(228, 23, 63, 0.38);
  --highlight:   inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --container:   1140px;
  --gutter:      24px;
  --nav-h:       68px;
  --side-w:      250px;
  --ease:        cubic-bezier(.2, .7, .2, 1);
  --t-fast:      140ms var(--ease);
  --t:           220ms var(--ease);
}


/* ==========================================================================
   2. Reset + base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  background: var(--bg);
}

/* Clip (not hide) horizontal overflow so sticky elements keep working. */
html,
body { overflow-x: clip; }
@supports not (overflow-x: clip) {
  body { overflow-x: hidden; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

/* Sticky footer: the page body grows, the footer sits at the bottom. */
main { flex: 1 0 auto; }

img { max-width: 100%; border: 0; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button { cursor: pointer; }

[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* Sections targeted by in-page anchors keep clear of the sticky header. */
[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }


/* ==========================================================================
   3. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
h5, h6 { font-size: 1rem; }

p { margin: 0 0 1em; }

a {
  color: var(--accent-2);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

ul, ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}
li + li { margin-top: .35em; }

strong, b { font-weight: 600; }
small { font-size: .85em; }

code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-size: .92em;
}
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .1em .4em;
  color: var(--text);
}
pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 1.2em;
  line-height: 1.55;
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: .9em;
}
kbd {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: .1em .45em;
  font-size: .85em;
}

blockquote {
  margin: 0 0 1.2em;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  background: var(--bg-2);
  color: var(--text-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
blockquote p:last-child { margin-bottom: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.accent { color: var(--accent-2); }


/* ==========================================================================
   4. Layout
   ========================================================================== */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-narrow { max-width: calc(760px + var(--gutter) * 2); }

.section { padding: 88px 0; }
.section-alt {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-alt + .section-alt { border-top: 0; }

.section-head {
  max-width: 680px;
  margin: 0 auto 48px;
  text-align: center;
}
.section-head h2 { margin-bottom: .4em; }
.section-head p {
  color: var(--text-2);
  font-size: 1.08rem;
  margin: 0;
}
.section-head-left {
  margin-left: 0;
  text-align: left;
}

.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: 24px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stack { display: grid; gap: 24px; }
.stack-sm { display: grid; gap: 12px; }

/* Grid items are min-content sized by default (min-width:auto); with the
   single column at <=600px one unbreakable string would push a card past
   the viewport, hidden by html { overflow-x: clip }. */
.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.stack > *,
.stack-sm > *,
.steps > *,
.stat-grid > *,
.footer-grid > * { min-width: 0; }


/* ==========================================================================
   5. Skip link
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus {
  top: 12px;
  outline-offset: 0;
  text-decoration: none;
}


/* ==========================================================================
   6. Site header / nav (public layout)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 3, 16, .82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--nav-h);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 8px;
}
.nav-brand img {
  height: 34px;
  width: auto;
}

/* Wrapper around links + actions so the phone dropdown is one block. */
.nav-menu {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 24px;
  min-width: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links li { margin: 0; }
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.nav-links a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.nav-links a.active {
  color: var(--text);
  background: var(--accent-soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.nav-actions form { margin: 0; }

/* Hamburger (phones only; shown in the 900px media query). */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.nav-toggle:hover { background: var(--surface-2); }
.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--t), opacity var(--t);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ==========================================================================
   7. Notice bar (maintenance mode)
   ========================================================================== */
.notice-bar {
  background: var(--warn-soft);
  border-bottom: 1px solid rgba(245, 184, 79, .3);
  color: var(--text);
  font-size: 14px;
}
.notice-bar .container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.notice-bar svg {
  width: 18px;
  height: 18px;
  color: var(--warn);
}
.notice-bar a { color: var(--text); text-decoration: underline; }
.app-main > .notice-bar {
  border: 1px solid rgba(245, 184, 79, .3);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.app-main > .notice-bar .container { padding: 10px 14px; }


/* ==========================================================================
   8. Hero
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--bg);
  background-image: url('../images/hero.jpg');
  background-image: image-set(
    url('../images/hero.webp') type('image/webp'),
    url('../images/hero.jpg') type('image/jpeg')
  );
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
}
/* Overlay: fade the image into --bg on the left (headline side) and bottom. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(26, 3, 16, 0) 52%, rgba(26, 3, 16, .65) 82%, var(--bg) 100%),
    linear-gradient(90deg, var(--bg) 0%, rgba(26, 3, 16, .96) 30%, rgba(26, 3, 16, .72) 52%, rgba(26, 3, 16, .18) 78%, rgba(26, 3, 16, 0) 100%);
}
.hero-inner {
  position: relative;
  max-width: 660px;
  padding: 128px 0 112px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 9px;
  margin-bottom: 22px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: rgba(42, 7, 25, .72);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}
.hero-eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.hero-title em {
  font-style: normal;
  color: var(--accent-2);
}
.hero-sub {
  max-width: 560px;
  margin: 0 0 32px;
  color: var(--text-2);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.55;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.hero-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  color: var(--text-3);
  font-size: 14px;
}
.hero-note span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-note svg {
  width: 16px;
  height: 16px;
  color: var(--ok);
}


/* ==========================================================================
   9. Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast),
              box-shadow var(--t), transform var(--t);
}
.btn:hover { text-decoration: none; }
.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 4px 14px rgba(228, 23, 63, .22);
}
.btn-primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), var(--glow);
}
.btn-primary:active { transform: translateY(1px); box-shadow: none; }

.btn-ghost { color: var(--text-2); }
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-2);
}

.btn-outline {
  border-color: var(--border-2);
  background: rgba(255, 255, 255, .02);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--accent-2);
  background: var(--accent-soft);
  color: var(--accent-2);
}

.btn-danger {
  border-color: rgba(255, 92, 122, .4);
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--bg);
}

.btn-lg {
  min-height: 52px;
  padding: 0 28px;
  font-size: 16px;
  border-radius: 11px;
}
.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13.5px;
  border-radius: 7px;
}
.btn-sm svg { width: 16px; height: 16px; }
.btn-block {
  display: flex;
  width: 100%;
}
.btn-icon {
  width: 40px;
  min-height: 40px;
  padding: 0;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Lift on hover only where hover exists (not on touch screens). */
@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-1px); }
}
/* Small buttons still meet the 44px touch target on touch screens. */
@media (pointer: coarse) {
  .btn-sm { min-height: 44px; }
}


/* ==========================================================================
   10. Cards + features
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--highlight);
}
.card-pad { padding: 28px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-head h2,
.card-head h3 { margin: 0; }
.card-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}
.card-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--highlight);
  transition: border-color var(--t), transform var(--t);
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-2);
}
.feature-icon svg {
  width: 22px;
  height: 22px;
}
.feature-icon img {
  width: 26px;
  height: 26px;
}
.feature-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}
.feature-text {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
}
@media (hover: hover) {
  .feature:hover {
    border-color: var(--border-2);
    transform: translateY(-2px);
  }
}


/* ==========================================================================
   11. Steps
   ========================================================================== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.step {
  position: relative;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--highlight);
}
/* Dashed connector between steps on wide screens. */
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 48px;
  right: -25px;
  width: 26px;
  border-top: 1px dashed var(--border-2);
}
.step-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font: 600 16px/1 var(--font-head);
  box-shadow: 0 6px 18px rgba(228, 23, 63, .35);
}
.step h3 {
  font-size: 1.15rem;
  margin-bottom: .4em;
}
.step p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
}


/* ==========================================================================
   12. FAQ accordion
   ========================================================================== */
.faq {
  max-width: 780px;
  margin: 0 auto;
}
.faq-item {
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--highlight);
}
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--text);
  font: 600 1.02rem/1.4 var(--font-head);
  letter-spacing: -0.01em;
}
.faq-q:hover { color: var(--accent-2); }
.faq-q:focus-visible { outline-offset: -2px; }
.faq-q svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transition: transform var(--t), color var(--t-fast);
}
.faq-q[aria-expanded="true"] svg {
  transform: rotate(180deg);
  color: var(--accent-2);
}
.faq-a {
  padding: 0 20px 18px;
  color: var(--text-2);
  font-size: 15px;
}
.faq-a p:last-child { margin-bottom: 0; }


/* ==========================================================================
   12b. Forms
   ========================================================================== */
.field { margin-bottom: 18px; }
.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.field-label small,
.field-label .optional {
  color: var(--text-3);
  font-weight: 400;
}

.field-input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.field-input::placeholder {
  color: var(--text-3);
  opacity: 1;
}
.field-input:hover { border-color: var(--border-2); }
.field-input:focus {
  border-color: var(--border-2);
  outline: 2px solid var(--accent-2);
  outline-offset: 1px;
}
.field-input:disabled,
.field-input[readonly] {
  background: var(--bg-2);
  color: var(--text-2);
  cursor: default;
}
.field-input.is-invalid,
.field-input[aria-invalid="true"] { border-color: var(--danger); }

textarea.field-input {
  min-height: 140px;
  resize: vertical;
  line-height: 1.55;
}
select.field-input {
  padding-right: 40px;
  cursor: pointer;
}
select.field-input option { background: var(--surface); }

/* Wrap a <select class="field-input"> to draw a chevron (no data: URIs). */
.select-wrap { position: relative; }
.select-wrap::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 17px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.field-hint {
  margin-top: 6px;
  color: var(--text-3);
  font-size: 13px;
}
.field-error {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  color: var(--danger);
  font-size: 13px;
}
.field-error svg {
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
}
.checkbox input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.checkbox a { color: var(--accent-2); }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.form-foot {
  margin-top: 20px;
  color: var(--text-2);
  font-size: 14px;
}

/* Password input with the show / hide button inside it. */
.field-input-wrap { position: relative; }
.field-input-wrap .field-input { padding-right: 72px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  min-height: 34px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
}
.pw-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
}
.pw-toggle[aria-pressed="true"] { color: var(--accent-2); }

/* Password strength meter: site.js sets data-level 0-4 and the bar width. */
.pw-meter {
  height: 6px;
  margin-top: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.pw-meter-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--danger);
  transition: width var(--t), background-color var(--t);
}
.pw-meter[data-level="1"] .pw-meter-bar { background: var(--danger); }
.pw-meter[data-level="2"] .pw-meter-bar { background: var(--warn); }
.pw-meter[data-level="3"] .pw-meter-bar { background: #5cc9a3; }
.pw-meter[data-level="4"] .pw-meter-bar { background: var(--ok); }
.pw-meter-text {
  min-height: 1.3em;
  margin-top: 6px;
  color: var(--text-3);
  font-size: 13px;
}
.pw-meter-text[data-level="1"] { color: var(--danger); }
.pw-meter-text[data-level="2"] { color: var(--warn); }
.pw-meter-text[data-level="3"],
.pw-meter-text[data-level="4"] { color: var(--ok); }

/* Honeypot field: off-screen, not display:none, so bots still fill it. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


/* ==========================================================================
   13. Alerts + flash region
   ========================================================================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14.5px;
}
.alert > svg {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--text-2);
}
.alert-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.alert-body p:last-child { margin: 0; }
.alert a { color: inherit; text-decoration: underline; }

.alert-success {
  border-color: rgba(56, 211, 159, .35);
  border-left-color: var(--ok);
  background: rgba(56, 211, 159, .09);
}
.alert-success > svg { color: var(--ok); }
.alert-error {
  border-color: rgba(255, 92, 122, .4);
  border-left-color: var(--danger);
  background: rgba(255, 92, 122, .09);
}
.alert-error > svg { color: var(--danger); }
.alert-info {
  border-color: rgba(255, 45, 85, .35);
  border-left-color: var(--accent-2);
  background: rgba(228, 23, 63, .09);
}
.alert-info > svg { color: var(--accent-2); }
.alert-warn {
  border-color: rgba(245, 184, 79, .35);
  border-left-color: var(--warn);
  background: rgba(245, 184, 79, .09);
}
.alert-warn > svg { color: var(--warn); }

.alert-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  flex-shrink: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  opacity: .65;
  transition: opacity var(--t-fast), background-color var(--t-fast);
}
.alert-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, .08);
}
.alert-close svg {
  width: 16px;
  height: 16px;
}

/* Session flashes live here (one region per page, rendered by header.php). */
.flash { margin-top: 20px; }
.flash:empty { display: none; }
.app-main .flash { margin-top: 0; }
.auth-page .flash {
  width: 100%;
  max-width: 440px;
  margin: 0;
}
.auth-page .flash .alert:last-child { margin-bottom: 0; }


/* ==========================================================================
   14. Badges
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: rgba(56, 211, 159, .3);
}
.badge-warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: rgba(245, 184, 79, .3);
}
.badge-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(255, 92, 122, .3);
}
.badge-muted {
  color: var(--text-2);
  background: var(--surface-2);
  border-color: var(--border);
}
.badge-accent {
  color: var(--accent-2);
  background: var(--accent-soft);
  border-color: rgba(255, 45, 85, .3);
}


/* ==========================================================================
   15. Auth layout (login / register / verify / reset)
   ========================================================================== */
/* Dimmed hero behind the whole viewport (fixed pseudo-elements avoid the
   iOS background-attachment bug). */
body.layout-auth { position: relative; }
body.layout-auth::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: var(--bg);
  background-image: url('../images/hero.jpg');
  background-image: image-set(
    url('../images/hero.webp') type('image/webp'),
    url('../images/hero.jpg') type('image/jpeg')
  );
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
}
body.layout-auth::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(26, 3, 16, .72) 0%, rgba(26, 3, 16, .9) 100%);
}

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 48px 16px 32px;
}
.auth-logo {
  display: inline-flex;
  flex-shrink: 0;
}
.auth-logo img {
  height: 44px;
  width: auto;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.auth-card-wide { max-width: 560px; }
.auth-title {
  margin: 0 0 6px;
  font-size: 1.6rem;
}
.auth-sub {
  margin: 0 0 24px;
  color: var(--text-2);
  font-size: 15px;
}
.auth-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
}
.auth-foot p { margin: 0 0 6px; }
.auth-foot p:last-child { margin-bottom: 0; }
.auth-footer {
  padding: 20px 16px 28px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.auth-footer a { color: var(--text-2); }
.auth-footer span { margin: 0 6px; }


/* ==========================================================================
   16. App shell (dashboard / account / admin)
   ========================================================================== */
.app-shell {
  display: flex;
  flex: 1 0 auto;
  width: 100%;
  min-height: 100vh;
}

.app-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: var(--side-w);
  height: 100vh;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.app-side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--nav-h);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.app-side-brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font: 600 1.15rem/1 var(--font-head);
  letter-spacing: -0.01em;
}
.app-side-brand a:hover { text-decoration: none; }
.app-side-brand img {
  width: 28px;
  height: 28px;
}

.app-side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  padding: 14px 12px;
}
.app-side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.app-side-nav a svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transition: color var(--t-fast);
}
.app-side-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.app-side-nav a.active {
  background: var(--accent-soft);
  color: var(--text);
}
.app-side-nav a.active svg,
.app-side-nav a:hover svg { color: var(--accent-2); }
.app-side-label {
  padding: 14px 12px 6px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.app-side-divider {
  height: 1px;
  margin: 10px 4px;
  background: var(--border);
}

.app-side-foot {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--border);
}
.app-side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
}
.app-side-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-2);
  font: 600 14px/1 var(--font-head);
  text-transform: uppercase;
}
.app-side-user-meta { min-width: 0; }
.app-side-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
}
.app-side-user-role {
  color: var(--text-3);
  font-size: 12px;
}
.app-side-foot form { margin: 0; }

.app-main {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 48px;
}
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.app-title {
  margin: 0;
  font-size: 1.65rem;
}
.app-topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 14px;
}
.app-topbar-user svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
}
.app-topbar-name { font-weight: 500; color: var(--text); }
.app-section { margin-bottom: 28px; }
.app-section-title {
  margin: 0 0 14px;
  font-size: 1.15rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--highlight);
}
.stat-label {
  margin-bottom: 6px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.stat-value {
  font: 600 1.9rem/1.1 var(--font-head);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.stat-sub {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 13px;
}

/* Account key: monospace value + copy button. */
.key-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}
.key-box > * { min-width: 0; }
.key-box code,
.key-box-value {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: none;
  border: 0;
  color: var(--text);
  font: 500 1.05rem/1.4 var(--font-mono);
  letter-spacing: .06em;
  word-break: break-all;
}
.key-box .btn { flex-shrink: 0; }
.btn.is-copied {
  color: var(--ok);
  border-color: rgba(56, 211, 159, .4);
}


/* ==========================================================================
   17. Tables + pager
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.table td { overflow-wrap: anywhere; }
.table th {
  background: var(--bg-2);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow-wrap: normal;
}
.table tbody tr:nth-child(even) { background: var(--surface-2); }
.table tbody tr:hover { background: rgba(255, 255, 255, .04); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table .nowrap { white-space: nowrap; }
.table-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
}
.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.table-actions form {
  display: inline;
  margin: 0;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}
.table-toolbar .field { margin: 0; }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}
.pager a,
.pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}
.pager a:hover {
  border-color: var(--border-2);
  color: var(--text);
  text-decoration: none;
}
.pager .active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pager .disabled {
  opacity: .45;
  pointer-events: none;
}
.pager .pager-info {
  margin: 0 8px;
  background: none;
  border: 0;
  color: var(--text-3);
  font-size: 13px;
}


/* ==========================================================================
   18. Footer (public layout)
   ========================================================================== */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 56px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand img {
  height: 44px;
  width: auto;
  margin-bottom: 14px;
}
.footer-brand p {
  max-width: 320px;
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}
.footer-links h4 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-links li { margin: 0 0 10px; }
.footer-links a {
  color: var(--text-2);
  font-size: 14px;
}
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 13px;
}
.footer-bottom a { color: var(--text-2); }


/* ==========================================================================
   19. Misc helpers
   ========================================================================== */
.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent-2);
  font: 600 12px/1.4 var(--font-head);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.lead {
  color: var(--text-2);
  font-size: 1.15rem;
}
.mono {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}
.divider-text {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--text-3);
  font-size: 13px;
}
.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* Generic notice box ("coming soon", setup warnings, …). */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14.5px;
  overflow-wrap: anywhere;
}
/* Flex children default to min-width:auto, so an unbreakable string (a
   SHA-256, an account key, a long email) would widen the box past the
   viewport; min-width:0 lets the text wrap instead. */
.notice > * { min-width: 0; }
.notice > svg {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--accent-2);
}
.notice strong { color: var(--text); }
.notice p:last-child { margin-bottom: 0; }
.notice-danger {
  background: rgba(255, 92, 122, .1);
  border-color: rgba(255, 92, 122, .5);
  color: var(--text);
}
.notice-danger > svg { color: var(--danger); }
.notice-warn {
  background: rgba(245, 184, 79, .1);
  border-color: rgba(245, 184, 79, .45);
  color: var(--text);
}
.notice-warn > svg { color: var(--warn); }
.notice-ok {
  background: rgba(56, 211, 159, .1);
  border-color: rgba(56, 211, 159, .4);
  color: var(--text);
}
.notice-ok > svg { color: var(--ok); }

/* Title block for inner public pages (download, contact, privacy, terms). */
.page-head { padding: 72px 0 32px; }
.page-head h1 { margin-bottom: .3em; }
.page-head p {
  max-width: 640px;
  margin: 0;
  color: var(--text-2);
  font-size: 1.08rem;
}
.page-head + .section { padding-top: 16px; }

/* Inline icon in running text. */
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
}
/* Icons dropped into a plain wrapper span (download.php requirement list
   and key heading, contact.php card headings and the success tick) have no
   sizing of their own and would render at 0x0: size them to the text. The
   icon bodies already use stroke="currentColor" / fill="none". */
.accent > svg,
li > span > svg,
.flex > span > svg,
.items-center > span > svg,
.items-start > span > svg {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.15em;
  color: inherit;
}
.accent > svg { color: var(--accent-2); }
.icon-shield {
  width: 20px;
  height: 20px;
  vertical-align: -0.3em;
}

/* Definition list used for release details (version / size / SHA-256). */
.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  margin: 0;
  font-size: 14.5px;
}
.kv dt { color: var(--text-3); }
.kv dd {
  margin: 0;
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}


/* ==========================================================================
   20. Prose (privacy / terms / long-form text)
   ========================================================================== */
.prose {
  max-width: 760px;
  color: var(--text-2);
  font-size: 16.5px;
  line-height: 1.7;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 { color: var(--text); }
.prose h2 {
  margin: 2.2em 0 .6em;
  font-size: 1.5rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  margin: 1.6em 0 .5em;
  font-size: 1.2rem;
}
.prose p { margin: 0 0 1.1em; }
.prose ul,
.prose ol {
  margin: 0 0 1.2em;
  padding-left: 1.5em;
}
.prose li { margin-bottom: .4em; }
.prose a {
  text-decoration: underline;
  text-decoration-color: rgba(255, 45, 85, .5);
}
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: var(--text); }
.prose table {
  margin: 0 0 1.5em;
  font-size: 15px;
}
.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.prose td { overflow-wrap: anywhere; }
.prose th {
  color: var(--text);
  font-weight: 600;
}
.prose hr { margin: 2.5em 0; }
.prose img {
  height: auto;
  border-radius: var(--radius-sm);
}
.prose-meta {
  margin-bottom: 2em;
  color: var(--text-3);
  font-size: 14px;
}


/* ==========================================================================
   21. Utilities
   ========================================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 20px; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 40px; }


/* ==========================================================================
   22. Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .nav { gap: 12px; }
  .nav-toggle { display: inline-flex; }

  /* Links + actions become a dropdown panel under the sticky header. */
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-height: calc(100vh - var(--nav-h));
    padding: 12px 16px 18px;
    overflow-y: auto;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  body.nav-open .nav-menu { display: flex; }
  .nav-links {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-links a {
    min-height: 46px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
  }
  .nav-actions {
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .nav-actions .btn,
  .nav-actions form { width: 100%; }
  .nav-actions form .btn { display: flex; }

  .section { padding: 64px 0; }
  .grid-3,
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; }
  .step:not(:last-child)::after { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .hero { background-position: 68% center; }
  .hero-inner { padding: 96px 0 80px; }

  /* App shell: the sidebar becomes a sticky top bar with a toggle. */
  .app-shell { flex-direction: column; }
  .app-side {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    height: auto;
    max-height: 100vh;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .app-side-brand .nav-toggle { display: inline-flex; }
  .app-side-nav,
  .app-side-foot { display: none; }
  body.nav-open .app-side-nav { display: flex; }
  body.nav-open .app-side-foot { display: block; }
  .app-main { padding: 20px 16px 40px; }
  .app-topbar { flex-wrap: wrap; }
  .app-title { font-size: 1.45rem; }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }

  .section { padding: 52px 0; }
  .section-head { margin-bottom: 32px; }
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .steps { gap: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .card-pad,
  .feature,
  .step { padding: 20px; }

  .hero {
    background-image: url('../images/hero-sm.webp');
    background-position: 72% center;
  }
  .hero-inner { padding: 72px 0 60px; }
  .hero-actions .btn { width: 100%; }

  .page-head { padding: 48px 0 24px; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .site-footer { padding-top: 40px; }

  .auth-page { padding-top: 32px; }
  .auth-card { padding: 26px 20px; }

  .key-box {
    flex-direction: column;
    align-items: stretch;
  }
  .key-box .btn { width: 100%; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }

  .table th,
  .table td { padding: 10px 12px; }
  .pager a,
  .pager span { min-width: 34px; }

  .hide-sm { display: none !important; }
}


/* ==========================================================================
   23. Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .btn-primary:hover,
  .feature:hover { transform: none; }
}


/* ==========================================================================
   24. Print
   ========================================================================== */
@media print {
  html,
  body {
    background: #fff;
    color: #000;
    display: block;
  }
  body.layout-auth::before,
  body.layout-auth::after,
  .site-header,
  .site-footer,
  .auth-footer,
  .app-side,
  .nav-toggle,
  .skip-link,
  .flash,
  .notice-bar,
  .alert-close,
  .btn,
  .hero::before { display: none !important; }
  main,
  .app-main { padding: 0; }
  .container,
  .prose { max-width: none; }
  .hero { background: none; }
  h1, h2, h3, h4, h5, h6,
  .prose,
  .prose h2,
  .prose h3,
  .prose strong { color: #000; }
  a {
    color: #000;
    text-decoration: underline;
  }
  .prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: .85em;
  }
  .card,
  .auth-card,
  .stat,
  .feature,
  .step,
  .faq-item,
  .table-wrap {
    background: #fff;
    border-color: #ccc;
    box-shadow: none;
  }
  .faq-a { display: block !important; }
  .table th { background: #f2f2f2; color: #000; }
  .table tbody tr:nth-child(even) { background: #f7f7f7; }
}


/* ==========================================================================
   25. Dashboard stats (added 2026-10-10 with the API)
   --------------------------------------------------------------------------
   dashboard.php: the 30-day "Blocked" bar strip (.bars, heights set inline
   as a percentage of the busiest day), the per-category rows (.cat-row with
   a .cat-track / .cat-fill meter) and the device name cell. Plain CSS, no
   chart library: the CSP allows only site.js.
   ========================================================================== */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 72px;
  padding: 8px 0 0;
  border-bottom: 1px solid var(--border);
}
.bars-bar {
  flex: 1 1 0;
  min-width: 3px;
  min-height: 2px;
  background: var(--accent-soft);
  border: 1px solid rgba(228, 23, 63, 0.35);
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  transition: background .15s var(--ease);
}
.bars-bar:hover { background: var(--accent-2); }
.bars-bar.is-today { background: var(--accent); border-color: var(--accent); }
.bars-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 11px;
}
.cat-list { display: grid; gap: 6px; }
.cat-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.cat-name { color: var(--text-2); }
.cat-track {
  display: block;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.cat-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.cat-count { color: var(--text); font-variant-numeric: tabular-nums; }
.device-name { font-weight: 500; color: var(--text); }
