:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* Header */
.hdr {
  flex: 0 0 auto;
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 18px 22px 14px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
}
.hdr-title { font-size: 26px; font-weight: 700; letter-spacing: 0.3px; }
.hdr-sub { font-size: 14px; color: var(--text-secondary); }
.step-badge {
  font-size: 13px; font-weight: 600; color: var(--accent);
  background: var(--bg-tertiary); padding: 5px 10px; border-radius: 8px;
}

/* ---- HOME ---- */
.home-body { flex: 1; display: flex; flex-direction: column; padding: 16px 22px 18px; gap: 14px; }
.preview {
  flex: 0 0 132px;
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.preview-big { font-size: 52px; font-weight: 700; line-height: 1; }
.preview-small { font-size: 18px; font-weight: 400; }

.ratio-row { display: flex; align-items: baseline; gap: 12px; justify-content: center; }
.ratio-num { font-size: 44px; font-weight: 800; letter-spacing: -1px; }
.ratio-label { font-size: 14px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }

.chips { display: flex; gap: 8px; }
.chip {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 10px;
  background: var(--bg-tertiary);
  border: 1px solid transparent;
}
.chip-name { font-size: 14px; font-weight: 700; }
.chip-sub { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.chip-mark { font-size: 18px; font-weight: 700; line-height: 1; margin-top: 2px; }
.chip.pass { border-color: rgba(0,255,136,0.4); }
.chip.pass .chip-mark { color: var(--accent-secondary); }
.chip.fail { border-color: rgba(255,68,102,0.4); }
.chip.fail .chip-mark { color: var(--danger); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; }
.btn {
  min-height: 64px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 18px; font-weight: 600;
  padding: 0 14px;
}
.btn-txt { white-space: nowrap; }
.sw {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto;
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
}

/* ---- EDITOR ---- */
.ed-body { flex: 1; display: flex; flex-direction: column; padding: 16px 22px 16px; gap: 14px; }
.ed-preview {
  flex: 0 0 96px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.12);
}
.ed-hex { font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.ed-pair { text-align: center; font-size: 15px; color: var(--text-secondary); margin-top: -4px; }

.sliders { display: flex; flex-direction: column; gap: 12px; }
.slider {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 10px 14px 14px;
}
.slider-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.slider-name { font-size: 18px; font-weight: 700; }
.slider-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.slider-track {
  position: relative; height: 14px; border-radius: 7px;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255,255,255,0.1);
}
.slider-thumb {
  position: absolute; top: 50%; left: 100%;
  width: 8px; height: 26px; border-radius: 4px;
  background: #fff; transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(0,0,0,0.6), 0 0 0 2px rgba(0,0,0,0.5);
}
.hint { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: auto; }

/* ---- PRESETS ---- */
.preset-list { flex: 1; overflow-y: auto; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.preset {
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}
.preset-swatch {
  flex: 0 0 auto; width: 54px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
  border: 1px solid rgba(255,255,255,0.18);
}
.preset-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.preset-name { font-size: 17px; font-weight: 600; }
.preset-meta { font-size: 13px; color: var(--text-secondary); }
.preset-ratio { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.preset-ratio.pass { color: var(--accent-secondary); }
.preset-ratio.fail { color: var(--danger); }
