/* Spectra phase 1 — bento, OLED, zero noise. Data in mono. */
:root {
  --bg: #000;
  --panel: #0a0a0a;
  --line: rgba(255, 255, 255, 0.1);
  --txt: #e5e5e5;
  --dim: #7a7a7a;
  --faint: #4a4a4a;
  --acc: #5c9ef5;
  --wave: #8a8a8a;
  --wave-hot: #fff;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: Inter, system-ui, sans-serif;
  min-height: 100dvh;
}
.sp-app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100dvh;
}
h2 {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}
/* bar */
.sp-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 10px 14px;
}
.sp-brand { display: flex; align-items: baseline; gap: 10px; flex: 1; min-width: 0; }
.sp-logo {
  width: 26px; height: 26px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px;
  font-weight: 900; color: #fff;
}
.sp-name { font-weight: 900; letter-spacing: 0.14em; }
.sp-sub { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-decks { display: flex; gap: 6px; }
.sp-deck {
  width: 34px; height: 30px;
  background: transparent; color: var(--dim);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--mono); font-weight: 800; cursor: pointer;
}
.sp-deck.is-on { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.sp-deck:disabled { opacity: 0.4; cursor: not-allowed; }
.sp-load span {
  display: inline-block;
  border: 1px solid rgba(92, 158, 245, 0.4); color: var(--acc);
  border-radius: 8px; padding: 7px 14px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  cursor: pointer; white-space: nowrap;
}
/* north metrics */
.sp-north {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 10px 12px;
  position: relative;
}
.sp-metric {
  border: 1px solid var(--line);
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.sp-k { font-size: 9px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.sp-v { font-family: var(--mono); font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-phase { position: absolute; right: 10px; top: -18px; margin: 0; font-size: 9px; letter-spacing: 0.1em; color: var(--faint); }
/* bento grid */
.sp-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 10px;
  min-height: 0;
}
.sp-west, .sp-east, .sp-center, .sp-south {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px;
}
.sp-meta { margin: 0; display: flex; flex-direction: column; }
.sp-meta div {
  display: grid; grid-template-columns: 86px 1fr; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}
.sp-meta div:last-child { border-bottom: none; }
.sp-meta dt { color: var(--dim); font-size: 9px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; padding-top: 2px; }
.sp-meta dd { margin: 0; font-family: var(--mono); color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* center */
.sp-center { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sp-drop { position: relative; border: 1px solid var(--line); background: #050505; }
.sp-drop.is-over { border-color: var(--acc); }
#wave { display: block; width: 100%; height: 220px; cursor: crosshair; touch-action: none; }
.sp-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  margin: 0; font-size: 11px; letter-spacing: 0.08em; color: var(--dim);
  pointer-events: none;
}
.sp-hint.is-off { display: none; }
.sp-transport { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp-transport button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line); color: var(--txt);
  border-radius: 8px; padding: 8px 18px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer;
}
.sp-transport button:disabled { opacity: 0.35; cursor: not-allowed; }
.sp-transport button:not(:disabled):hover { background: rgba(255, 255, 255, 0.12); }
.sp-time { font-family: var(--mono); font-size: 13px; color: #fff; }
.sp-engine { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--faint); }
.sp-spec, .sp-ph {
  border: 1px dashed rgba(255, 255, 255, 0.14);
  min-height: 120px;
  display: flex; align-items: center; justify-content: center;
}
.sp-spec p, .sp-ph p, .sp-east .sp-ph { margin: 0; font-size: 10px; letter-spacing: 0.12em; color: var(--faint); }
.sp-east { display: flex; flex-direction: column; min-width: 0; }
.sp-east .sp-ph { flex: 1; }
/* south */
.sp-south { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; }
.sp-health { border: 1px solid var(--line); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.sp-foot { font-size: 10px; letter-spacing: 0.06em; color: var(--faint); text-align: center; padding: 4px 0 8px; }
/* mobile: single column */
@media (max-width: 900px) {
  .sp-north { grid-template-columns: repeat(2, 1fr); }
  .sp-grid { grid-template-columns: 1fr; }
  .sp-sub { display: none; }
  #wave { height: 170px; }
  .sp-south { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- Tema W2C (espejo de packages/design-system themes.css: spectra es
   estatica sin bundler y no puede importarlo; misma key w2c-theme) --- */
:root[data-theme='cozy'] {
  --bg: #1b1e23;
  --panel: #22262d;
  --line: rgba(255, 255, 255, 0.13);
  --txt: rgba(255, 255, 255, 0.93);
  --dim: rgba(226, 232, 240, 0.62);
  --faint: rgba(226, 232, 240, 0.34);
  --wave-bg: #1b1e23;
  --wave-grid: #3a4048;
  --wave-played: #ffffff;
  --wave-rest: #8a93a0;
}
:root[data-theme='light'] {
  --bg: #f4f2ec;
  --panel: #ffffff;
  --line: rgba(27, 26, 23, 0.14);
  --txt: #1b1a17;
  --dim: rgba(27, 26, 23, 0.6);
  --faint: rgba(27, 26, 23, 0.35);
  --acc: #0053c0;
  --wave: #9a978e;
  --wave-hot: #1b1a17;
  --wave-bg: #f4f2ec;
  --wave-grid: #d8d4c8;
  --wave-played: #1b1a17;
  --wave-rest: #b3afa2;
}
.w2c-theme-switch {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.w2c-theme-switch button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
  background: transparent;
  cursor: pointer;
}
.w2c-theme-switch button[aria-pressed='true'] {
  background: var(--txt);
  color: var(--bg);
}
.sp-theme { flex: none; }
