
.cns-root { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.cns-root > * { pointer-events: auto; }

.cns-banner {
  position: fixed;
  z-index: 90;
  display: none;
  left: 16px; right: 16px; bottom: 16px;
  max-width: 1088px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-drawer);
  padding: 18px 20px 16px;
  display: grid; gap: 14px;
}
html:not([data-consent]) .cns-banner { display: grid !important; }
.cns-banner[hidden] { display: none; }

.cns-brow { display: flex; gap: 12px; align-items: flex-start; }
.cns-ic {
  flex: 0 0 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--brand-tint); color: var(--brand-600);
  display: grid; place-items: center;
}
.cns-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cns-icw { flex: 1; min-width: 0; }
.cns-title { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--ink); }
.cns-text { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.cns-text a { color: var(--brand-600); text-decoration: underline; text-underline-offset: 2px; }
.cns-text a:hover { color: var(--brand-800); }
.cns-text a:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; border-radius: 3px; }

.cns-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cns-btn {
  flex: 1 1 180px; height: 44px; padding: 0 16px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  border-radius: var(--r-md); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--t-micro), border-color var(--t-micro), color var(--t-micro);
  min-width: 0;
}
.cns-btn:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.cns-btn:active { transform: scale(.985); }

.cns-btn-accept { background: var(--brand-solid); border: 1px solid var(--brand-solid); color: #fff; }
.cns-btn-accept:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.cns-btn-reject { background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink); }
.cns-btn-reject:hover { background: var(--surface-2); border-color: var(--ink-3); }
.cns-btn-ghost { background: transparent; border: 1px solid transparent; color: var(--brand-600); }
.cns-btn-ghost:hover { background: var(--brand-tint); }

.cns-hint { margin: -2px 0 0; font-size: 12px; color: var(--ink-3); }

.cns-modal {
  position: fixed;
  z-index: 120;
  left: 0; right: 0; top: 0; bottom: 0;
  display: grid; place-items: center; padding: 20px;
}
.cns-modal[hidden] { display: none; }
.cns-scrim {
  position: absolute; inset: 0;
  background: rgba(44, 44, 42, .48);
}
[data-theme="dark"] .cns-scrim { background: rgba(0, 0, 0, .62); }

.cns-panel {
  position: relative; width: 100%; max-width: 560px; max-height: 86vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-drawer);
  padding: 22px 24px 20px;
}
.cns-panel h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; color: var(--ink); }
.cns-panel .cns-sub { margin: 0 0 16px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.cns-panel .cns-sub a { color: var(--brand-600); }

.cns-list { list-style: none; margin: 0 0 18px; padding: 0; border-top: 1px solid var(--border); }
.cns-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.cns-item:last-child { border-bottom: 0; }
.cns-item-top { display: flex; align-items: center; gap: 12px; }
.cns-item-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--ink); }
.cns-item-desc { margin: 4px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-3); }
.cns-item-desc code { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); }

.cns-lock {
  flex: 0 0 auto; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 500; color: var(--ink-3);
  display: inline-flex; align-items: center;
}

.cns-switch { position: relative; flex: 0 0 auto; width: 52px; height: 30px; }
.cns-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cns-switch .cns-track {
  position: absolute; inset: 0; border-radius: var(--r-pill);
  background: var(--border-strong); transition: background var(--t-micro);
  pointer-events: none;
}
.cns-switch .cns-knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border-strong);
  transition: transform var(--t-micro); pointer-events: none;
}
.cns-switch input:checked ~ .cns-track { background: var(--brand-600); }
.cns-switch input:checked ~ .cns-knob { transform: translateX(22px); border-color: var(--brand-600); }
.cns-switch input:focus-visible ~ .cns-track { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.cns-switch input:disabled ~ .cns-track { opacity: .6; }

.cns-fab {
  position: fixed; left: 16px; bottom: 16px; z-index: 92;
  width: 44px; height: 44px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-hover); cursor: pointer;
  display: grid; place-items: center; color: var(--ink-2);
}
.cns-fab:hover { color: var(--brand-600); border-color: var(--brand-600); }
.cns-fab:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.cns-fab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cns-fab[hidden] { display: none; }
@media (max-width: 720px) {
  .cns-fab { display: none; }
}

@media (max-width: 720px) {
  .cns-banner {
    left: 0; right: 0; bottom: 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    max-width: none;
  }
  .cns-actions { flex-direction: column; }
  .cns-btn { flex: 1 1 auto; width: 100%; }
  .cns-fab { bottom: calc(16px + env(safe-area-inset-bottom)); }
  html:not([data-consent]) .cns-fab { display: none !important; }
  .cns-panel { padding: 18px 16px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .cns-btn, .cns-switch .cns-track, .cns-switch .cns-knob { transition: none; }
  .cns-btn:active { transform: none; }
}

.legal { padding: 26px 28px 30px; }
.legal h1 { margin: 0 0 6px; font-size: 26px; font-weight: 600; color: var(--ink); }
.legal h2 {
  margin: 30px 0 10px; font-size: 17px; font-weight: 600; color: var(--ink);
  scroll-margin-top: 76px;
}
.legal h2:focus { outline: none; }
.legal h3 { margin: 18px 0 6px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.legal p { margin: 0 0 12px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.legal code {
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 1px 5px; color: var(--ink);
}
.legal .rail-item { margin: 0 0 8px; font-size: 13.5px; }
.legal .rail-item a { color: var(--ink-2); text-decoration: none; }
.legal .rail-item a:hover { color: var(--brand-600); text-decoration: underline; }

