:root {
  --bg:        #f4f6f9;
  --surface:   #ffffff;
  --surface2:  #f0f3f7;
  --border:    #d8e0ea;
  --accent:    #1a5fd4;
  --text:      #1a2233;
  --muted:     #6b7a92;
  --dim:       #9aaabf;
  --green:     #16a34a;
  --green-bg:  #dcfce7;
  --red:       #dc2626;
  --red-bg:    #fee2e2;
  --yellow:    #ca8a04;
  --yellow-bg: #fef9c3;
  --green-l:   #22c55e;
  --red-l:     #ef4444;
  --yellow-l:  #eab308;
  --shadow:    0 2px 12px rgba(26,34,51,0.08);
  --shadow2:   0 4px 24px rgba(26,34,51,0.13);
}

* { margin:0; padding:0; box-sizing:border-box; }

/* Accessibilità: helper screen-reader only */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Focus visibile uniforme */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  min-height: 100vh;
  padding: 28px 20px 48px;
}

/* ── Header ── */
header {
  max-width: 1560px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 18px;
}

.logo-wrap { display:flex; align-items:center; gap:14px; }

.logo-icon {
  height: 52px;
  display: flex; align-items: center;
  flex-shrink: 0;
}
.logo-icon img {
  height: 100%;
  width: auto;
  display: block;
  border-radius: 6px;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.76rem;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 2px;
}

/* ── Global controls bar ── */
.global-bar {
  max-width: 1560px;
  margin: 0 auto 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.bar-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

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

input.interval-in {
  width: 62px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface2);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88rem;
  padding: 7px 8px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}
input.interval-in:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(26,95,212,0.12); }

.vsep { width:1px; height:30px; background:var(--border); }

.btn {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 9px 22px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-start { background:var(--green); color:#fff; box-shadow:0 2px 8px rgba(22,163,74,0.28); }
.btn-start:hover:not(:disabled) { background:#15803d; transform:translateY(-1px); }
.btn-stop  { background:var(--red);   color:#fff; box-shadow:0 2px 8px rgba(220,38,38,0.28); }
.btn-stop:hover:not(:disabled)  { background:#b91c1c; transform:translateY(-1px); }
.btn:disabled { opacity:0.36; cursor:not-allowed; transform:none !important; box-shadow:none; }

.btn-ghost {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-ghost:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-bg);
}

.btn-cfg {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-cfg:hover:not(:disabled) {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  transform: translateY(-1px);
}
.btn-cfg:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.cfg-hint {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cfg-hint.saved { color: var(--green); }

.global-status {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
}
.global-status.running { color:var(--green); border-color:#86efac; background:var(--green-bg); }

/* ── Notifiche desktop toggle ── */
.notif-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.notif-toggle input { cursor: pointer; }
.notif-toggle.granted { color: var(--green); }
.notif-toggle.denied  { color: var(--red); }

/* ── Monitors grid ── */
.monitors-grid {
  max-width: 1560px;
  margin: 0 auto 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1180px) {
  .monitors-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .monitors-grid { grid-template-columns: 1fr; }
}

/* ── Monitor Card ── */
.monitor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.monitor-card:hover { box-shadow: var(--shadow2); }
.monitor-card.state-ok   { border-color: #86efac; }
.monitor-card.state-warn { border-color: #fca5a5; }

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.card-idx {
  width: 26px; height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  font-size: 0.73rem;
  font-weight: 700;
  display: flex; align-items:center; justify-content:center;
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
}

/* ── Target on/off toggle ── */
.target-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}
.target-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 22px;
  transition: background 0.22s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.22s;
}
.target-toggle input:checked + .toggle-slider { background: var(--green); }
.target-toggle input:checked + .toggle-slider::before { transform: translateX(16px); }
.target-toggle input:focus + .toggle-slider { box-shadow: 0 0 0 2px rgba(26,95,212,0.18); }
.target-toggle input:disabled + .toggle-slider { cursor: not-allowed; opacity: 0.5; }

/* Disabled card state */
.monitor-card.card-disabled .card-idx,
.monitor-card.card-disabled .host-input,
.monitor-card.card-disabled .card-body {
  opacity: 0.45;
  filter: grayscale(0.7);
  transition: opacity 0.22s, filter 0.22s;
}
.monitor-card.card-disabled {
  background: var(--surface2);
}

.host-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  padding: 7px 11px;
  outline: none;
  transition: border-color 0.2s;
}
.host-input:focus { border-color:var(--accent); box-shadow:0 0 0 2px rgba(26,95,212,0.1); }
.host-input::placeholder { color: var(--dim); }
.host-input:disabled { background:var(--surface2); color:var(--muted); }

/* ── Card body ── */
.card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tl-row { display:flex; align-items:center; gap:14px; }

.status-bar {
  width: 100%;
  height: 22px;
  background: linear-gradient(90deg, #2d2d2d, #1c1c1c);
  border-radius: 11px;
  padding: 4px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5), 0 3px 8px rgba(0,0,0,0.18);
  margin: 8px 0 10px;
}

.status-bar-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  background: #181818;
  border: 1px solid #383838;
  overflow: hidden;
}

.status-bar-track::before {
  content:'';
  position:absolute;
  inset:0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(25% - 1px),
    rgba(255,255,255,0.07) calc(25% - 1px),
    rgba(255,255,255,0.07) 25%
  );
  pointer-events:none;
  z-index:1;
}

.status-bar-fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 0;
  background: #2a2a2a;
  border-radius: 6px;
  transition: width 0.45s cubic-bezier(.4,0,.2,1), background 0.35s, box-shadow 0.35s, opacity 0.3s;
}

.status-bar-fill.fill-green  { background: linear-gradient(90deg,#16a34a,#4ade80); box-shadow:0 0 14px #22c55e88; }
.status-bar-fill.fill-yellow { background: linear-gradient(90deg,#ca8a04,#fde047); box-shadow:0 0 14px #eab30888; }
.status-bar-fill.fill-red    { background: linear-gradient(90deg,#dc2626,#f87171); box-shadow:0 0 14px #ef444488; }

@keyframes bar-pulse-g {
  0%,100%{ box-shadow:0 0 12px #22c55e88; }
  50%    { box-shadow:0 0 24px #22c55ecc; }
}
.status-bar-fill.fill-green.pulsing { animation: bar-pulse-g 2s ease-in-out infinite; }

@keyframes bar-blink-r {
  0%,100%{ opacity:1; }
  50%    { opacity:0.4; }
}
.status-bar-fill.fill-red.blinking { animation: bar-blink-r 0.8s ease-in-out infinite; }

/* Threshold row */
.thresh-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.thresh-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.thresh-input {
  width: 66px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 7px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.thresh-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(26,95,212,0.1);
}
.thresh-unit {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}
.thresh-hint {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid #86efac;
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
  margin-left: 2px;
}

/* Target name */
.target-name-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.target-name-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(26,95,212,0.1);
}
.target-name-input::placeholder { color: var(--dim); font-weight: 400; }

/* Latency */
.latency-block { flex:1; min-width:0; }

.latency-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
}
.latency-value .unit { font-size:0.85rem; color:var(--muted); font-weight:400; }

/* Status tag con icona testuale per accessibilità daltonica */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: all 0.3s;
}
.status-tag::before {
  content: '';
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
}
.status-tag.ok::before   { content: '✓ '; }
.status-tag.warn::before { content: '⚠ '; }
.status-tag.err::before  { content: '✕ '; }
.status-tag.meas::before { content: '… '; }

.status-tag.ok   { background:var(--green-bg);  color:var(--green);  border-color:#86efac; }
.status-tag.warn { background:var(--red-bg);    color:var(--red);    border-color:#fca5a5; }
.status-tag.err  { background:var(--red-bg);    color:var(--red);    border-color:#fca5a5; }
.status-tag.meas { background:var(--yellow-bg); color:var(--yellow); border-color:#fde047; }

/* ── Mini chart container + tooltip ── */
.chart-wrap {
  position: relative;
}

canvas.mini-chart {
  display: block;
  width: 100%;
  height: 85px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(26,34,51,0.92);
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  line-height: 1.4;
  padding: 4px 8px;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 5;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.chart-tooltip strong { color: #fff; font-weight: 700; }

.chart-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.18s;
  z-index: 6;
}
.chart-wrap:hover .chart-actions { opacity: 1; }

.btn-chart-png {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
}
.btn-chart-png:hover { background: var(--accent); color: #fff; }

/* ── Stats ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.stat-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 5px;
  text-align: center;
}
.stat-label {
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 3px;
}
.stat-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.su { font-size:0.62rem; color:var(--muted); }

/* ── Summary Panel ── */
.summary-panel {
  max-width: 1560px;
  margin: 0 auto 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.summary-head {
  padding: 10px 18px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.summary-ts {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--dim);
  letter-spacing: 0;
  text-transform: none;
}

.summary-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 700px) {
  .summary-kpi-row { grid-template-columns: repeat(3, 1fr); }
}

.kpi-box {
  padding: 14px 16px;
  text-align: center;
  border-right: 1px solid var(--border);
  transition: background 0.2s;
}
.kpi-box:last-child { border-right: none; }

.kpi-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 5px;
  color: var(--text);
}
.kpi-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.kpi-ok   .kpi-num { color: var(--green); }
.kpi-warn .kpi-num { color: var(--red); }
.kpi-idle .kpi-num { color: var(--dim); }
.kpi-avg  .kpi-num { color: var(--accent); }
.kpi-loss .kpi-num { color: var(--yellow); }

.kpi-ok.active   { background: var(--green-bg); }
.kpi-warn.active { background: var(--red-bg); }

/* Table */
.summary-table-wrap {
  overflow-x: auto;
}
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.summary-table thead tr {
  background: var(--surface2);
}
.summary-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.summary-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  white-space: nowrap;
  vertical-align: middle;
  color: var(--text);
}
.summary-table tbody tr:last-child td { border-bottom: none; }
.summary-table tbody tr:hover { background: var(--surface2); }

.summary-table .td-name {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
}
.summary-table .td-host { color: var(--muted); }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill-ok      { background: var(--green-bg); color: var(--green); border: 1px solid #86efac; }
.pill-warn    { background: var(--red-bg);   color: var(--red);   border: 1px solid #fca5a5; }
.pill-err     { background: var(--red-bg);   color: var(--red);   border: 1px solid #fca5a5; }
.pill-idle    { background: var(--surface2); color: var(--dim);   border: 1px solid var(--border); }
.pill-meas    { background: var(--yellow-bg);color: var(--yellow);border: 1px solid #fde047; }
.pill-off     { background: var(--surface2); color: var(--muted); border: 1px dashed var(--border); }

.td-lat-ok   { color: var(--green); font-weight: 700; }
.td-lat-warn { color: var(--red);   font-weight: 700; }
.td-lat-idle { color: var(--dim); }

.bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.uptime-bar {
  width: 60px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.uptime-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--green);
  transition: width 0.4s;
}
.uptime-fill.low { background: var(--red); }

.log-panel {
  max-width: 1560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.log-head {
  padding: 10px 18px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.log-head-dot { width:8px;height:8px;background:var(--accent);border-radius:50%; }

.log-area {
  height: 148px;
  overflow-y: auto;
  padding: 10px 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.71rem;
  line-height: 1.85;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.log-entry { display:flex; gap:14px; }
.log-time  { color:var(--dim); flex-shrink:0; }
.log-ok    { color:var(--green); }
.log-warn  { color:var(--red); }
.log-info  { color:var(--accent); }
.log-err   { color:#b45309; }

/* ── Export buttons (summary head) ── */
.summary-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.summary-actions .summary-ts { margin-left: 0; }

.btn-export {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-export:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}
.btn-export:disabled {
  opacity: 0.36;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Notice ── */
.notice {
  max-width: 1560px;
  margin: 14px auto 0;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.72rem;
  color: #1e40af;
  line-height: 1.6;
}

/* Marker per warmup nel grafico */
.warmup-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--yellow-bg);
  color: var(--yellow);
  border: 1px solid #fde047;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Password gate ── */
#gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
#gate .box {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 36px 32px;
  box-shadow: var(--shadow2);
}
#gate h1 {
  font-size: 1.15rem; color: var(--text); margin: 0 0 6px;
  font-family: 'IBM Plex Sans', sans-serif;
}
#gate p {
  margin: 0 0 22px; color: var(--muted); font-size: 0.85rem;
}
#gate .field { display: flex; gap: 8px; }
#gate input {
  flex: 1; min-width: 0; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface2); color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif; font-size: 0.92rem;
  outline: none; transition: border-color 0.18s;
}
#gate input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(26,95,212,0.12); }
#gate input.err { border-color: var(--red); animation: gshake 0.3s; }
@keyframes gshake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
#gate button {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 11px 18px; font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700; font-size: 0.88rem; cursor: pointer;
  transition: background 0.18s;
}
#gate button:hover { background: #154db5; }
#gate .msg {
  color: var(--red); font-size: 0.78rem;
  min-height: 1.1em; margin-top: 12px;
}
body.locked { overflow: hidden; }
