/* ============================================================
   NEXQUK — Industrial Design System
   ============================================================ */

:root {
  --bg:        #080808;
  --surface:   #111111;
  --surface2:  #181818;
  --surface3:  #202020;
  --border:    #242424;
  --border2:   #2e2e2e;
  --led:       #ff8800;
  --led-dim:   #4a2800;
  --led-bg:    #060300;
  --boost:     #ff0000;
  --green:     #00dd66;
  --red:       #ff3333;
  --blue:      #4a9eff;
  --text:      #cccccc;
  --text2:     #666666;
  --text3:     #333333;
  --r:         10px;
  --r-sm:      6px;
  --hdr:       48px;
  --nav:       64px;
  --t:         .2s ease;
  /* Aliases for backward compat */
  --primary:       var(--led);
  --primary-glow:  rgba(255,136,0,.35);
  --danger:        var(--red);
  --success:       var(--green);
  --warning:       #ffb833;
  --secondary:     var(--blue);
  --radius:        var(--r);
  --radius-sm:     var(--r-sm);
  --header-h:      var(--hdr);
  --nav-h:         var(--nav);
  --transition:    var(--t);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
input, button, select, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

/* ── Screens ── */
.screen { display: flex; flex-direction: column; min-height: 100dvh; }

/* ── Auth ── */
#screen-auth {
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at top, #1f1008 0%, var(--bg) 60%);
  padding: 32px 24px; gap: 48px;
}
.auth-logo { text-align: center; }
.auth-logo .flame { font-size: 64px; display: block; margin-bottom: 12px; filter: drop-shadow(0 0 24px var(--led)); }
.auth-logo h1 {
  font-size: 2.4rem; font-weight: 800; letter-spacing: -1px;
  font-family: ui-monospace, monospace; color: var(--text);
}
.auth-logo p { color: var(--text2); margin-top: 6px; font-size: .95rem; }
.auth-buttons { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 340px; }

/* ── Header ── */
#app-header {
  display: none; align-items: center; justify-content: space-between;
  height: var(--hdr); padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100; flex-shrink: 0;
}
.header-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1rem; letter-spacing: -.3px;
  font-family: ui-monospace, monospace;
}
.header-logo span { font-size: 1.1rem; filter: drop-shadow(0 0 6px #ff6b35); }
.header-right { display: flex; align-items: center; gap: 10px; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text3); transition: background var(--t); }
.conn-dot.online  { background: var(--green); box-shadow: 0 0 8px var(--green); }
.conn-dot.offline { background: var(--red); }
.conn-dot.syncing { background: var(--warning); }
.btn-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface3); border: 1px solid var(--border2);
  font-size: .8rem; font-weight: 800; color: var(--led);
  display: flex; align-items: center; justify-content: center;
  font-family: ui-monospace, monospace;
}
.device-selector {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 5px 10px;
  font-size: .78rem; color: var(--text2); cursor: pointer;
  font-family: ui-monospace, monospace;
}
.device-selector span { font-weight: 700; color: var(--text); }

/* ── App container ── */
#app { display: none; flex-direction: column; flex: 1; }
#views-container { flex: 1; overflow: hidden; position: relative; }
.view {
  display: none; flex-direction: column;
  height: calc(100dvh - var(--hdr) - var(--nav));
  overflow-y: auto; overflow-x: hidden;
}
.view.active { display: flex; }

/* ── Bottom nav ── */
#bottom-nav {
  display: flex; height: var(--nav);
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
  flex-shrink: 0; z-index: 100;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--text3);
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  cursor: pointer; transition: color var(--t); min-height: 48px;
}
.nav-btn.active { color: var(--led); }
.nav-icon { font-size: 1.3rem; line-height: 1; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px; border-radius: var(--r);
  font-weight: 800; font-size: .88rem;
  border: none; cursor: pointer; transition: all var(--t);
  letter-spacing: .3px; min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn-primary  { background: var(--led); color: #000; }
.btn-primary:hover { box-shadow: 0 0 20px rgba(255,136,0,.4); }
.btn-secondary { background: var(--surface3); color: var(--text); border: 1.5px solid var(--border2); }
.btn-danger   { background: rgba(255,51,51,.15); color: var(--red); border: 1.5px solid rgba(255,51,51,.25); }
.btn-ghost    { background: transparent; color: var(--text2); border: 1.5px solid var(--border2); }
.btn-xl { padding: 16px 20px; font-size: .92rem; flex: 1; }
.btn-lg { padding: 14px 20px; }
.btn-sm { padding: 7px 12px; font-size: .78rem; min-height: 34px; }
.btn-full { width: 100%; }
.btn-icon {
  width: 42px; height: 42px; border-radius: var(--r-sm);
  color: var(--text2); display: flex; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer; transition: all var(--t);
}
.btn-icon:hover { background: var(--surface3); color: var(--text); }

/* ============================================================
   CONTROL VIEW
   ============================================================ */
#view-control { gap: 0; }

.status-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.device-tag {
  font-family: ui-monospace, monospace; font-size: .72rem; color: var(--text2);
}
.device-tag b { color: var(--text); }
.conn-badge {
  display: flex; align-items: center; gap: 5px;
  font-family: ui-monospace, monospace; font-size: .68rem;
  color: var(--text3); letter-spacing: .5px;
}
.conn-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--text3);
}
.conn-badge.online  { color: var(--green); }
.conn-badge.online::before  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.conn-badge.offline { color: var(--red); }
.conn-badge.offline::before { background: var(--red); }
.conn-badge.syncing { color: var(--warning); }
.conn-badge.syncing::before { background: var(--warning); }

/* ── HOB ── */
.hob-wrap { padding: 14px 14px 0; flex-shrink: 0; }
.hob {
  position: relative; width: 100%;
  aspect-ratio: 592 / 522;
  background: #0d0d0d; border-radius: 10px;
  border: 1.5px solid #1e1e1e; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), inset 0 -1px 0 rgba(0,0,0,.5), 0 8px 32px rgba(0,0,0,.7);
}
.hob::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 30%, rgba(255,255,255,.025) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(255,255,255,.01) 0%, transparent 60%);
  pointer-events: none; z-index: 5;
}

/* ── Zones ── */
.zone {
  position: absolute; border-radius: 50%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: box-shadow .3s ease; z-index: 2;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.zone-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #282828; transition: border-color .4s, box-shadow .4s; pointer-events: none;
}
.zone-ring-inner {
  position: absolute; border-radius: 50%;
  border: 1.5px solid #1e1e1e; transition: border-color .4s, box-shadow .4s;
  pointer-events: none; inset: 20%;
}
.zone-ring-core {
  position: absolute; border-radius: 50%;
  border: 1px solid #181818; pointer-events: none; transition: border-color .4s; inset: 42%;
}
.zone-core {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; pointer-events: none;
}
.z-num {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-weight: 900; line-height: 1; color: var(--text3);
  transition: color .3s, text-shadow .3s; letter-spacing: -1px;
}
.z-lbl {
  font-family: ui-monospace, monospace; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text3); transition: color .3s;
}
.zone-lg { left: 26.2%; top: 44.1%; width: 46.6%; aspect-ratio: 1; }
.zone-lg .z-num  { font-size: 2.2rem; }
.zone-lg .z-lbl  { font-size: .6rem; }
.zone-sm { left: 76.0%; top: 22.6%; width: 24.3%; aspect-ratio: 1; }
.zone-sm .z-num  { font-size: 1.1rem; }
.zone-sm .z-lbl  { font-size: .5rem; }
.zone-md { left: 76.0%; top: 69.0%; width: 29.7%; aspect-ratio: 1; }
.zone-md .z-num  { font-size: 1.4rem; }
.zone-md .z-lbl  { font-size: .55rem; }

.zone.on .zone-ring       { border-color: var(--zc, var(--led)); box-shadow: 0 0 12px var(--zc, var(--led)), inset 0 0 20px rgba(255,107,53,.06); }
.zone.on .zone-ring-inner { border-color: var(--zc, var(--led)); opacity: .6; }
.zone.on .zone-ring-core  { border-color: var(--zc, var(--led)); opacity: .4; }
.zone.on .z-num           { color: var(--zc, var(--led)); text-shadow: 0 0 12px var(--zc, var(--led)); }
.zone.on .z-lbl           { color: var(--zc, var(--led)); opacity: .7; }

.zone.selected::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25);
  animation: sel-pulse 1.8s ease infinite; pointer-events: none;
}
@keyframes sel-pulse {
  0%,100% { opacity: .6; transform: scale(1); }
  50%      { opacity: .2; transform: scale(1.04); }
}
.zone.boost .zone-ring {
  border-color: var(--boost) !important;
  box-shadow: 0 0 20px var(--boost), 0 0 40px rgba(255,0,0,.3) !important;
  animation: boost-pulse .4s ease infinite alternate;
}
@keyframes boost-pulse {
  from { box-shadow: 0 0 16px var(--boost); }
  to   { box-shadow: 0 0 30px var(--boost), 0 0 50px rgba(255,0,0,.4); }
}

/* ── HOB panel strip ── */
.hob-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 9.6%; background: #0a0a0a; border-top: 1px solid #1a1a1a;
  display: flex; align-items: center; padding: 0 12px; gap: 8px; z-index: 4;
}
.panel-brand { font-family: -apple-system, sans-serif; font-size: .7rem; font-weight: 300; letter-spacing: 2px; color: #2a2a2a; margin-right: 4px; }
.panel-led-group { display: flex; gap: 5px; align-items: center; }
.panel-led { width: 5px; height: 5px; border-radius: 50%; background: #151515; border: 1px solid #1e1e1e; }
.panel-led.on { background: var(--led); box-shadow: 0 0 5px var(--led); }
.panel-display {
  background: var(--led-bg); border: 1px solid #1a1a1a; border-radius: 3px;
  padding: 1px 5px; font-family: ui-monospace, monospace; font-size: .65rem;
  font-weight: 700; color: var(--led-dim); letter-spacing: 1px;
}

/* ── Zone control panel ── */
.zone-ctrl-panel {
  margin: 12px 14px 0;
  background: var(--surface); border: 1.5px solid var(--border2);
  border-radius: var(--r); overflow: hidden; flex-shrink: 0;
  transition: border-color var(--t);
}
.zone-ctrl-panel.has-selection {
  border-color: var(--sel-color, var(--border2));
  box-shadow: 0 0 0 1px var(--sel-color, transparent);
}
.zcp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--surface2); border-bottom: 1px solid var(--border);
}
.zcp-name {
  font-family: ui-monospace, monospace; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--sel-color, var(--text3)); transition: color var(--t);
}
.zcp-state { display: flex; align-items: center; gap: 10px; }
.zcp-pwr-display {
  font-family: ui-monospace, monospace; font-size: 1.1rem; font-weight: 900;
  color: var(--sel-color, var(--text3)); min-width: 28px; text-align: right;
  text-shadow: 0 0 8px var(--sel-color, transparent);
  transition: color var(--t), text-shadow var(--t);
}
.pwr-btn {
  width: 44px; height: 28px; border-radius: 14px;
  background: var(--surface3); border: 1.5px solid var(--border2);
  position: relative; cursor: pointer; transition: background var(--t), border-color var(--t);
}
.pwr-btn::after {
  content: ''; width: 20px; height: 20px; border-radius: 50%;
  background: var(--text3); position: absolute; top: 2px; left: 2px;
  transition: transform var(--t), background var(--t);
}
.pwr-btn.on { background: var(--sel-color, var(--led)); border-color: var(--sel-color, var(--led)); }
.pwr-btn.on::after { transform: translateX(16px); background: #fff; }

.zcp-slider-row { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.ind-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 3px;
  background: var(--surface3); outline: none; cursor: pointer; border: 1px solid var(--border);
}
.ind-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface3); border: 2px solid var(--sel-color, var(--text3));
  box-shadow: 0 0 8px var(--sel-color, transparent), 0 2px 6px rgba(0,0,0,.6);
  cursor: pointer; transition: border-color var(--t), box-shadow var(--t);
}
.ind-slider::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface3); border: 2px solid var(--sel-color, var(--text3)); cursor: pointer;
}
.slider-ticks { display: flex; justify-content: space-between; padding: 0 13px; }
.tick { width: 1px; height: 4px; background: var(--border2); flex-shrink: 0; }
.tick.major { height: 6px; }

.zcp-actions { display: flex; border-top: 1px solid var(--border); }
.zcp-act-btn {
  flex: 1; padding: 10px 8px;
  font-size: .75rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  font-family: ui-monospace, monospace; color: var(--text3);
  cursor: pointer; transition: all var(--t);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.zcp-act-btn:last-child { border-right: none; }
.zcp-act-btn:hover { background: var(--surface2); }
.zcp-act-btn.active { color: var(--sel-color, var(--led)); background: rgba(255,136,0,.06); }
.zcp-act-btn.boost-active { color: var(--boost); background: rgba(255,0,0,.06); }
.act-icon { font-size: 1rem; }
.timer-val { font-size: .7rem; color: var(--led); font-variant-numeric: tabular-nums; min-height: 12px; }

.zcp-empty {
  padding: 16px; text-align: center;
  font-family: ui-monospace, monospace; font-size: .75rem; color: var(--text3);
  letter-spacing: 1px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.zcp-empty::before { content: '↑'; font-size: 1rem; opacity: .4; }

/* ── Global controls ── */
.global-row { display: flex; gap: 10px; padding: 10px 14px 14px; flex-shrink: 0; }
.btn-alloff {
  flex: 1; padding: 13px 16px;
  background: rgba(255,51,51,.08); border: 1.5px solid rgba(255,51,51,.2);
  border-radius: var(--r); color: var(--red); font-weight: 800; font-size: .88rem;
  letter-spacing: .5px; text-transform: uppercase; font-family: ui-monospace, monospace;
  cursor: pointer; transition: all var(--t);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-alloff:hover, .btn-alloff:active { background: rgba(255,51,51,.15); border-color: rgba(255,51,51,.4); }
.btn-lock {
  width: 52px; height: 52px; border-radius: var(--r);
  background: var(--surface); border: 1.5px solid var(--border2);
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--t); flex-shrink: 0; color: var(--text2);
}
.btn-lock.locked {
  background: rgba(255,184,51,.1); border-color: rgba(255,184,51,.3);
  color: #ffb833; box-shadow: 0 0 8px rgba(255,184,51,.2);
}

/* ============================================================
   RECIPES VIEW
   ============================================================ */
#view-recetas { gap: 0; }
.view-header { display: flex; align-items: center; justify-content: space-between; }
.view-header h2 { font-size: 1.05rem; font-weight: 800; font-family: ui-monospace, monospace; letter-spacing: -.3px; }

.recipes-list { display: flex; flex-direction: column; gap: 8px; }
.recipe-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: border-color var(--t), background var(--t);
  -webkit-tap-highlight-color: transparent;
}
.recipe-card:hover { border-color: var(--led); background: var(--surface2); }
.recipe-thumb {
  width: 48px; height: 48px; border-radius: var(--r-sm);
  background: var(--surface3); display: flex; align-items: center;
  justify-content: center; font-size: 1.5rem; flex-shrink: 0;
  border: 1px solid var(--border); overflow: hidden;
}
.recipe-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recipe-info { flex: 1; min-width: 0; }
.recipe-title { font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipe-meta { font-size: .72rem; color: var(--text2); margin-top: 2px; font-family: ui-monospace, monospace; }
.recipe-actions { display: flex; gap: 0; flex-shrink: 0; }

.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: var(--text3); text-align: center; padding: 40px 24px;
}
.empty-state .empty-icon { font-size: 3rem; }
.empty-state p { font-size: .85rem; max-width: 240px; line-height: 1.5; }
.demo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(74,158,255,.15); color: var(--blue);
  border: 1px solid rgba(74,158,255,.3); border-radius: 6px;
  padding: 6px 12px; font-size: .82rem; font-weight: 600; margin-top: 8px;
}

/* ============================================================
   EDITOR VIEW
   ============================================================ */
#view-editor { padding: 0; }
.editor-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.editor-header h2 { flex: 1; font-size: 1rem; font-weight: 800; }
.editor-body { padding: 14px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; flex: 1; }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: .72rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .8px; font-family: ui-monospace, monospace; }
.field-input {
  background: var(--surface); border: 1.5px solid var(--border2);
  border-radius: var(--r-sm); color: var(--text);
  padding: 11px 13px; font-size: .9rem; outline: none;
  transition: border-color var(--t); width: 100%;
}
.field-input:focus { border-color: var(--led); }
.field-input::placeholder { color: var(--text3); }
textarea.field-input { resize: vertical; min-height: 70px; }

.section-header { display: flex; align-items: center; justify-content: space-between; }
.section-header h3 { font-size: .88rem; font-weight: 700; }
.divider { height: 1px; background: var(--border); }

.steps-list { display: flex; flex-direction: column; gap: 7px; }
.step-item {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r); padding: 11px 12px;
  display: flex; align-items: center; gap: 10px; cursor: grab;
  transition: border-color var(--t), opacity var(--t);
}
.step-item:active { cursor: grabbing; }
.step-item.dragging { opacity: .4; border-style: dashed; border-color: var(--led); }
.step-item.drag-over { border-color: var(--led); box-shadow: 0 0 0 2px rgba(255,136,0,.2); }
.step-drag-handle { color: var(--text3); font-size: 1rem; user-select: none; cursor: grab; }
.step-item-body { flex: 1; min-width: 0; }
.step-item-name { font-weight: 700; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-item-meta { font-size: .72rem; color: var(--text2); margin-top: 2px; font-family: ui-monospace, monospace; }
.step-item-actions { display: flex; gap: 2px; }

/* ============================================================
   COOKING VIEW
   ============================================================ */
#view-cooking {
  background: var(--bg); display: flex; flex-direction: column;
  position: fixed; inset: 0; z-index: 200; height: 100dvh; overflow: hidden;
}
.cooking-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.cooking-title { font-weight: 800; font-size: .9rem; font-family: ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.3px; }
.cooking-progress-track { height: 3px; background: var(--surface2); flex-shrink: 0; }
.cooking-progress-fill { height: 100%; background: var(--led); transition: width .5s ease; box-shadow: 0 0 8px var(--led); }
.cooking-body { flex: 1; display: flex; flex-direction: column; padding: 16px; gap: 14px; overflow: hidden; }
.cooking-step-meta { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.step-badge {
  background: var(--surface2); border: 1px solid var(--border2); border-radius: 20px;
  padding: 4px 12px; font-family: ui-monospace, monospace;
  font-size: .75rem; font-weight: 700; color: var(--text2);
}
.step-badge b { color: var(--led); }
.cooking-main { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; text-align: center; }
.cooking-step-name { font-size: 1.5rem; font-weight: 900; line-height: 1.2; }
.cooking-countdown {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 4rem; font-weight: 900; letter-spacing: -4px;
  color: var(--led); line-height: 1; text-shadow: 0 0 20px rgba(255,136,0,.5);
}
.cooking-countdown.urgent { color: var(--red); text-shadow: 0 0 20px rgba(255,51,51,.5); animation: urg .6s ease infinite alternate; }
@keyframes urg { from { opacity: 1; } to { opacity: .6; } }
.cooking-instruction { font-size: .95rem; color: var(--text2); line-height: 1.5; max-width: 280px; }

.cooking-burners-mini { display: flex; gap: 8px; justify-content: center; flex-shrink: 0; }
.mini-burner {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: 7px 10px; min-width: 50px;
  transition: border-color var(--t); font-family: ui-monospace, monospace;
}
.mini-burner.active { border-color: var(--burner-color, var(--led)); box-shadow: 0 0 8px rgba(255,136,0,.2); }
.mini-burner-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; color: var(--text3); letter-spacing: .3px; }
.mini-burner-power { font-size: .9rem; font-weight: 900; color: var(--text3); }
.mini-burner.active .mini-burner-power { color: var(--burner-color, var(--led)); text-shadow: 0 0 6px var(--burner-color, var(--led)); }

.next-step-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 12px;
  font-size: .8rem; color: var(--text2);
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-family: ui-monospace, monospace;
}
.next-step-label { color: var(--text3); flex-shrink: 0; }
.next-step-name  { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cooking-controls {
  display: flex; gap: 10px; flex-shrink: 0;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.8);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 500; backdrop-filter: blur(6px);
  animation: fade-in .15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  background: var(--surface); border-radius: var(--r) var(--r) 0 0;
  width: 100%; max-width: 480px;
  padding: 0 0 max(20px, env(safe-area-inset-bottom));
  animation: slide-up .2s ease; max-height: 90dvh; overflow-y: auto;
}
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-handle { width: 36px; height: 4px; background: var(--border2); border-radius: 2px; margin: 12px auto 16px; }
.modal-header { display: flex; align-items: center; padding: 0 18px 14px; border-bottom: 1px solid var(--border); }
.modal-header h3 { flex: 1; font-size: 1rem; font-weight: 800; font-family: ui-monospace, monospace; letter-spacing: -.3px; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 10px 18px 0; display: flex; gap: 10px; align-items: center; }

.duration-inputs { display: flex; gap: 8px; align-items: center; }
.duration-inputs .field-input { text-align: center; font-size: 1.1rem; font-weight: 900; max-width: 70px; font-family: ui-monospace, monospace; }
.duration-sep { font-size: 1rem; font-weight: 700; color: var(--text2); flex-shrink: 0; font-family: ui-monospace, monospace; }

.step-burner-section {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.step-burner-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.step-burner-name { font-size: .8rem; font-weight: 700; min-width: 68px; flex-shrink: 0; font-family: ui-monospace, monospace; }
.step-burner-power-display { font-size: .85rem; font-weight: 700; color: var(--led); min-width: 20px; text-align: right; flex-shrink: 0; }

.toggle-switch { display: flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.toggle-track {
  width: 40px; height: 24px; border-radius: 12px;
  background: var(--surface3); border: 1.5px solid var(--border2);
  position: relative; transition: background var(--t), border-color var(--t); flex-shrink: 0;
}
.toggle-track.on { background: var(--led); border-color: var(--led); }
.toggle-thumb {
  width: 17px; height: 17px; border-radius: 50%; background: var(--text3);
  position: absolute; top: 2px; left: 2px;
  transition: transform var(--t), background var(--t);
}
.toggle-track.on .toggle-thumb { transform: translateX(16px); background: #000; }

.power-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 3px;
  background: var(--surface3); outline: none; cursor: pointer; border: 1px solid var(--border);
}
.power-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface3); border: 2px solid var(--led);
  box-shadow: 0 0 6px rgba(255,136,0,.4), 0 2px 6px rgba(0,0,0,.6); cursor: pointer;
}
.power-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface3); border: 2px solid var(--led); cursor: pointer;
}

/* ============================================================
   TOAST
   ============================================================ */
#toast {
  position: fixed; bottom: calc(var(--nav) + 10px); left: 50%;
  transform: translateX(-50%);
  background: var(--surface3); color: var(--text);
  border: 1px solid var(--border2); border-radius: 20px;
  padding: 8px 16px; font-size: .82rem; font-weight: 700;
  z-index: 2000; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  transition: opacity .3s, transform .3s;
  pointer-events: none; font-family: ui-monospace, monospace; letter-spacing: .3px;
}
#toast.hidden { opacity: 0; transform: translateX(-50%) translateY(8px); }
#toast.in-cooking { bottom: 120px; }

/* ============================================================
   MISC
   ============================================================ */
.text-muted  { color: var(--text2); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
