/* ===========================================================================
   PiShock Controller — stylesheet
   Aesthetic: a dark electrical control panel. Signature: violet "current"
   accent, monospace instrumentation readouts, tactile dial-like controls.
   No inline styles are used anywhere (strict CSP). All visual state is here.
   =========================================================================== */

/* ----------------------------- Design tokens ----------------------------- */
:root {
  /* Palette */
  --bg-0: #0b0d12;        /* page base */
  --bg-1: #11141c;        /* card base */
  --bg-2: #171b25;        /* raised surface */
  --bg-3: #1f2530;        /* input / track */
  --line: #2a313f;        /* hairline borders */
  --line-soft: #222936;

  --text: #e8ebf2;        /* primary text */
  --text-dim: #9aa3b4;    /* secondary text */
  --text-faint: #6b7384;  /* tertiary / labels */

  --violet: #8b5cff;      /* signature accent (current) */
  --violet-bright: #a47bff;
  --violet-deep: #5b3ad6;
  --magenta: #ff4d8d;     /* shock energy */
  --cyan: #3ad6c7;        /* vibrate */
  --amber: #ffb13d;       /* beep / caution */

  --online: #34d399;      /* status online */
  --offline: #f0556e;     /* status offline */
  --unknown: #7a8499;     /* status unknown */

  /* Type */
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Menlo",
    "Consolas", monospace;

  /* Geometry */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.45);
  --glow-violet: 0 0 0 1px rgba(139, 92, 255, 0.4),
    0 8px 28px rgba(91, 58, 214, 0.35);

  --maxw: 980px;
}

/* ------------------------------- Reset ----------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(139, 92, 255, 0.12), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(255, 77, 141, 0.06), transparent 55%),
    var(--bg-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--violet-bright);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* ------------------------------- Layout ---------------------------------- */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 22px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand .mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--violet), var(--violet-deep));
  box-shadow: var(--glow-violet);
  flex: 0 0 auto;
}
.brand .mark svg {
  width: 20px;
  height: 20px;
  display: block;
}

.brand .title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand .subtitle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 7px 12px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
}
.nav-link:hover {
  color: var(--text);
  background: var(--bg-2);
  text-decoration: none;
}
.nav-link.active {
  color: var(--text);
  border-color: var(--line);
  background: var(--bg-2);
}

/* ------------------------------- Cards ----------------------------------- */
.grid {
  display: grid;
  gap: 18px;
}
.grid.cols-2 {
  grid-template-columns: 1.25fr 1fr;
}

.card {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-1)) padding-box;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.card .card-head h2 {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.card .card-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}
.card .card-body {
  padding: 18px;
}

/* ----------------------------- Status badge ------------------------------ */
.status-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-dim);
}
.badge .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--unknown);
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
}
.badge.is-online {
  color: var(--online);
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
}
.badge.is-online .dot {
  background: var(--online);
  animation: pulse-dot 2s ease-out infinite;
}
.badge.is-offline {
  color: var(--offline);
  border-color: rgba(240, 85, 110, 0.35);
  background: rgba(240, 85, 110, 0.08);
}
.badge.is-offline .dot {
  background: var(--offline);
}
.badge.is-unknown .dot {
  background: var(--unknown);
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Device info as an instrumentation readout grid */
.readout {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: hidden;
}
.readout .cell {
  background: var(--bg-1);
  padding: 12px 14px;
}
.readout .k {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.readout .v {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text);
  word-break: break-word;
}
.readout .v.muted {
  color: var(--text-faint);
}

.status-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ------------------------------ Controls --------------------------------- */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.mode-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 10px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mode-tab svg { width: 16px; height: 16px; }
.mode-tab:hover {
  color: var(--text);
  background: var(--bg-3);
}
.mode-tab[aria-selected="true"][data-mode="shock"] {
  color: #fff;
  background: linear-gradient(160deg, rgba(255,77,141,0.22), rgba(255,77,141,0.08));
  border-color: rgba(255, 77, 141, 0.5);
}
.mode-tab[aria-selected="true"][data-mode="vibrate"] {
  color: #fff;
  background: linear-gradient(160deg, rgba(58,214,199,0.22), rgba(58,214,199,0.08));
  border-color: rgba(58, 214, 199, 0.5);
}
.mode-tab[aria-selected="true"][data-mode="beep"] {
  color: #fff;
  background: linear-gradient(160deg, rgba(255,177,61,0.22), rgba(255,177,61,0.08));
  border-color: rgba(255, 177, 61, 0.5);
}

/* Sliders */
.control-block { margin-top: 20px; }
.control-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.control-label .name {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.control-label .value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.control-label .value .unit {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-left: 3px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 36px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
/* track */
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--bg-3);
  border: 1px solid var(--line);
}
input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--bg-3);
  border: 1px solid var(--line);
}
input[type="range"]::-moz-range-progress {
  height: 8px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--violet-deep), var(--violet));
}
/* thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--violet-bright), var(--violet-deep));
  border: 2px solid #0b0d12;
  box-shadow: var(--glow-violet);
}
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--violet-bright), var(--violet-deep));
  border: 2px solid #0b0d12;
  box-shadow: var(--glow-violet);
}
input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--violet-bright);
  outline-offset: 2px;
}
input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--text-faint);
  margin-top: 2px;
}

/* The big fire button */
.fire {
  margin-top: 26px;
}
.fire-btn {
  position: relative;
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(139,92,255,0.18), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
  color: var(--text);
  padding: 22px 20px;
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.08s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.fire-btn .glyph {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 10px;
}
.fire-btn .glyph svg { width: 22px; height: 22px; }
.fire-btn:hover:not(:disabled) {
  border-color: var(--violet);
  box-shadow: var(--glow-violet);
}
.fire-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.997);
}
.fire-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.fire-btn[data-mode="shock"]:hover:not(:disabled) {
  border-color: var(--magenta);
  box-shadow: 0 0 0 1px rgba(255,77,141,0.4), 0 10px 30px rgba(255,77,141,0.28);
}
.fire-btn[data-mode="vibrate"]:hover:not(:disabled) {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(58,214,199,0.4), 0 10px 30px rgba(58,214,199,0.25);
}
.fire-btn[data-mode="beep"]:hover:not(:disabled) {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px rgba(255,177,61,0.4), 0 10px 30px rgba(255,177,61,0.25);
}

/* ripple/pulse emitted on send */
.fire-btn .ring {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--violet-bright);
  opacity: 0;
  pointer-events: none;
}
.fire-btn.is-firing .ring {
  animation: ring-out 0.7s ease-out;
}
@keyframes ring-out {
  0% { opacity: 0.7; width: 10px; height: 10px; }
  100% { opacity: 0; width: 320px; height: 320px; }
}

/* spinner shown inside button while sending */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fire-hint {
  margin-top: 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

/* ------------------------------- Buttons --------------------------------- */
.btn {
  appearance: none;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn:hover:not(:disabled) {
  background: var(--bg-3);
  border-color: var(--violet);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.primary {
  background: linear-gradient(160deg, var(--violet), var(--violet-deep));
  border-color: transparent;
  color: #fff;
}
.btn.primary:hover:not(:disabled) {
  box-shadow: var(--glow-violet);
}
.btn.ghost {
  background: transparent;
}
.btn.danger {
  border-color: rgba(240, 85, 110, 0.4);
  color: var(--offline);
}
.btn.danger:hover:not(:disabled) {
  background: rgba(240, 85, 110, 0.1);
  border-color: var(--offline);
}
.btn.small { padding: 6px 10px; font-size: 0.78rem; }

/* ------------------------------- Toasts ---------------------------------- */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
  max-width: min(92vw, 380px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-2);
  box-shadow: var(--shadow-2);
  color: var(--text);
  font-size: 0.86rem;
  animation: toast-in 0.22s ease-out;
}
.toast.is-out { animation: toast-out 0.2s ease-in forwards; }
.toast .ticon {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 1px;
}
.toast.success { border-color: rgba(52,211,153,0.45); }
.toast.success .ticon { color: var(--online); }
.toast.error { border-color: rgba(240,85,110,0.45); }
.toast.error .ticon { color: var(--offline); }
.toast.info .ticon { color: var(--violet-bright); }
.toast .tbody .ttitle { font-weight: 650; }
.toast .tbody .tmsg { color: var(--text-dim); margin-top: 2px; font-family: var(--font-mono); font-size: 0.78rem; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

/* ------------------------------- Forms ----------------------------------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.field .hint {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 5px;
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"] {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus {
  outline: 2px solid var(--violet);
  outline-offset: 0;
  border-color: var(--violet);
}

/* toggle switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 42px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--bg-3);
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
  flex: 0 0 auto;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.15s ease, background 0.15s ease;
}
.switch input:checked + .track {
  background: rgba(139, 92, 255, 0.25);
  border-color: var(--violet);
}
.switch input:checked + .track::after {
  transform: translateX(18px);
  background: var(--violet-bright);
}
.switch input:focus-visible + .track {
  outline: 2px solid var(--violet-bright);
  outline-offset: 2px;
}
.switch .swlabel { font-size: 0.85rem; color: var(--text); }

/* settings grids */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.section-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 22px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
.section-title:first-child { border-top: none; padding-top: 0; margin-top: 0; }

/* credentials notice */
.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(139, 92, 255, 0.08);
  border: 1px solid rgba(139, 92, 255, 0.3);
  font-size: 0.82rem;
  color: var(--text-dim);
}
.notice svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--violet-bright); }
.notice.warn {
  background: rgba(255, 177, 61, 0.08);
  border-color: rgba(255, 177, 61, 0.32);
}
.notice.warn svg { color: var(--amber); }

.cred-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.flag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.flag.ok { color: var(--online); border-color: rgba(52,211,153,0.35); }
.flag.missing { color: var(--offline); border-color: rgba(240,85,110,0.35); }

/* ------------------------------- Logs table ------------------------------ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
table.logs {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
table.logs th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding: 10px 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.logs td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  color: var(--text-dim);
  white-space: nowrap;
}
table.logs tr:last-child td { border-bottom: none; }
table.logs .mode-pill {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  color: var(--text);
}
.mode-pill.shock { color: var(--magenta); border-color: rgba(255,77,141,0.4); }
.mode-pill.vibrate { color: var(--cyan); border-color: rgba(58,214,199,0.4); }
.mode-pill.beep { color: var(--amber); border-color: rgba(255,177,61,0.4); }
.mode-pill.test, .mode-pill.login { color: var(--violet-bright); border-color: rgba(139,92,255,0.4); }
.ok-yes { color: var(--online); }
.ok-no { color: var(--offline); }

.logs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.logs-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  appearance: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-dim);
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--violet);
  background: rgba(139, 92, 255, 0.12);
}
.empty {
  padding: 28px;
  text-align: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ------------------------------ Login view ------------------------------- */
.login-wrap {
  min-height: 60vh;
  display: grid;
  place-items: center;
}
.login-card {
  width: min(420px, 100%);
}
.login-card .card-body { padding: 24px; }
.login-title {
  font-size: 1.15rem;
  margin-bottom: 4px;
}
.login-sub {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

/* ------------------------------- Footer ---------------------------------- */
.foot {
  margin-top: 30px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

.hidden { display: none !important; }

.safety {
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--text-faint);
  line-height: 1.55;
}

/* ----------------------------- Responsive -------------------------------- */
@media (max-width: 820px) {
  .grid.cols-2 { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .shell { padding: 18px 14px 48px; }
  .readout { grid-template-columns: 1fr; }
  .toggle-grid { grid-template-columns: 1fr; }
  .control-label .value { font-size: 1.15rem; }
  .brand .subtitle { display: none; }
  .toast-stack { right: 10px; left: 10px; bottom: 10px; max-width: none; }
}

/* ---------------------------- Reduced motion ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
