:root {
  --bg:        #0b0f14;
  --panel:     #141b23;
  --panel-2:   #1c252f;
  --line:      #2a3541;
  --text:      #e7eef6;
  --muted:     #8b9cae;
  --accent:    #4c9aff;
  --live:      #2ea043;
  --live-dim:  #1a5e2a;
  --danger:    #e5484d;
  --warn:      #d29922;
  --radius:    14px;
  --tap:       58px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* El atributo hidden se apoya en una regla del navegador (display:none) que
   pierde contra cualquier display propio. Como a los botones les damos
   inline-flex, sin esto hidden no los esconde. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}

h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 13px; margin: 0 0 10px; color: var(--muted);
     text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
p  { margin: 0 0 12px; color: var(--muted); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

/* --- estado --------------------------------------------------------- */
.status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
          font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger); flex: none;
  box-shadow: 0 0 0 0 rgba(46,160,67,.6);
}
.dot.on { background: var(--live); animation: pulse 2.4s infinite; }
.dot.warn { background: var(--warn); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,160,67,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(46,160,67,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,160,67,0); }
}
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.badge.good { color: #6ee787; border-color: #23502f; }
.badge.bad  { color: #ff8b8b; border-color: #5c2426; }

/* --- botones -------------------------------------------------------- */
button, .btn {
  font: inherit; font-weight: 600; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 16px; min-height: var(--tap);
  cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; transition: filter .12s, transform .06s;
  touch-action: manipulation; text-decoration: none;
}
button:active, .btn:active { transform: scale(.985); filter: brightness(1.25); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: transparent; color: #061018; }
button.ghost   { background: transparent; }
button.small   { min-height: 42px; font-size: 14px; padding: 0 12px; }

.grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 130px; }

/* --- formularios ---------------------------------------------------- */
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
input[type=text], input[type=url] {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.out {
  display: flex; gap: 8px; align-items: stretch; margin-top: 6px;
}
.out input {
  flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: 12px;
}
.out button { min-height: 0; padding: 0 14px; flex: none; }

.hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.hint b { color: var(--text); font-weight: 600; }

ol.steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
ol.steps li { margin-bottom: 9px; }
ol.steps b, ol.steps code { color: var(--text); }

.note {
  border-left: 3px solid var(--warn); background: rgba(210,153,34,.07);
  padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 13.5px;
  color: var(--muted); margin: 14px 0 0;
}
.note b { color: var(--text); }
