/* index.css — user-facing pages only (my devices, device config, wizard, tada).
   StoryBox / TaleLight design system; tokens live in shared.css. */

/* ── Main ───────────────────────────────── */
#main { display: none; max-width: 520px; margin: 0 auto; padding: 24px 16px 48px; }

/* ── My Devices (TaleLight .device-card) ── */
#my-devices-pane h2 { font-size: 1.2rem; color: var(--gold); margin-bottom: 16px; }
.activate-clock-btn { margin: -4px 0 16px; }
#devices-loading { color: var(--ink-2); font-size: 0.9rem; padding: 20px 0; }
#devices-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.6;
}
#devices-empty a { color: var(--gold); font-weight: 600; }
.device-card {
  background: var(--item);
  border: 1px solid var(--item-border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background 0.2s, border-color 0.2s;
}
.device-card:hover { background: rgba(255,255,255,0.09); border-color: rgba(244,201,122,0.35); }
.device-card-icon { font-size: 1.6rem; }
.device-card-name { font-size: 0.95rem; font-weight: 500; color: var(--ink-1); }
.device-card-meta { font-size: 0.75rem; color: var(--ink-hint); margin-top: 2px; overflow-wrap: anywhere; }

/* ── Device Config pane ─────────────────── */
#device-config-pane { display: none; }

/* "← Back" pills: TaleLight #back-to-devices / StoryBox .back-link */
#config-back-btn, #slot-back-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  padding: 6px 14px;
  margin-bottom: 14px;
  width: fit-content;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
#config-back-btn { display: none; }   /* render() in app.js shows it per view */
#config-back-btn:hover, #slot-back-btn:hover { background: var(--bg-2); color: var(--gold); border-color: var(--gold-line); }

/* ── Setup step ─────────────────────────── */
#setup-step { display: none; }
#setup-step h2 { font-size: 1.2rem; color: var(--gold); margin-bottom: 8px; }
#setup-step > p { color: var(--ink-2); margin-bottom: 24px; font-size: 0.95rem; }

/* Two distinct panes (Device Setup / Recordings): TaleLight .dash-section
   glass panels, separated by spacing rather than colour. */
.config-pane {
  border-radius: 12px;
  padding: 22px 20px;
  border: 1px solid var(--card-border);
  background: var(--card);
}
.config-pane-device { margin-bottom: 20px; }
.device-name-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.device-name-row .setup-label { margin-bottom: 0; }
/* Device id inside the label: case-sensitive, so no uppercase transform. */
.setup-label .label-id {
  text-transform: none;
  letter-spacing: normal;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-hint);
  overflow-wrap: anywhere;
}
#device-name-error { font-size: 0.75rem; color: var(--danger-text); display: none; }
#device-name-input::placeholder, #wizard-name-input::placeholder { color: var(--ink-hint); opacity: 1; }
#device-name-input:focus::placeholder { color: transparent; }
/* TaleLight .form-group label */
.setup-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.setup-field {
  width: 100%;
  font-size: 0.95rem;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 18px;
  color: var(--ink-1);
  background: var(--field);
  transition: border-color 0.2s;
}
.setup-field:hover { border-color: rgba(255,255,255,0.25); }
.setup-field:focus { border-color: var(--gold); }
#device-name-input.input-error, #wizard-name-input.input-error { border-color: var(--danger); }

/* ── Primary (gold) actions: TaleLight button.primary ── */
#start-wizard-btn, #wizard-name-next-btn, #wizard-lang-next-btn, #wizard-next-btn, #tada-reconfigure-btn {
  background: var(--gold);
  color: var(--accent-ink);
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}
#start-wizard-btn:hover:not(:disabled), #wizard-name-next-btn:hover:not(:disabled),
#wizard-lang-next-btn:hover:not(:disabled), #wizard-next-btn:hover:not(:disabled),
#tada-reconfigure-btn:hover { opacity: 0.9; }
#start-wizard-btn:disabled, #wizard-name-next-btn:disabled,
#wizard-lang-next-btn:disabled, #wizard-next-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Neutral (outline) actions: TaleLight button ── */
#wizard-lang-back-btn, #wizard-back-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}
#wizard-lang-back-btn:hover, #wizard-back-btn:hover { background: var(--bg-2); }

#setup-nav { display: flex; gap: 10px; margin: 4px 0 20px; }
#start-wizard-btn { flex: 1; padding: 14px; font-size: 1rem; }

/* ── Volume / Brightness sliders + Save Changes ── */
/* The thumb/track colour is value-encoded green->red by updateSliderColor()
   in app.js (inline accent-color + --slider-color), as in TaleLight and
   StoryBox; --gold is only the fallback before it runs. */
.setup-slider { width: 100%; margin: 2px 0 18px; accent-color: var(--slider-color, var(--gold)); }
.setup-slider-value { float: right; font-weight: 600; color: var(--gold); text-transform: none; letter-spacing: normal; }
/* Chrome/WebKit darkens the accent-coloured thumb+track on :active (press)
   via an internal color-mix on the accent colour; override on the thumb
   pseudo-elements with the exact colour, !important to beat the UA sheet. */
.setup-slider::-webkit-slider-thumb:active,
.setup-slider:active::-webkit-slider-thumb {
  background-color: var(--slider-color, var(--gold)) !important;
}
.setup-slider::-moz-range-thumb:active,
.setup-slider:active::-moz-range-thumb {
  background-color: var(--slider-color, var(--gold)) !important;
}
/* Rounded frame around the track on hover only (not focus/active), held
   2px off the track and fading in/out. Track pseudo-elements per engine. */
.setup-slider::-webkit-slider-runnable-track {
  border-radius: 8px;
  outline: 1.25px solid rgba(255,255,255,0);
  outline-offset: 2px;
  transition: outline-color 0.2s ease;
}
.setup-slider:hover::-webkit-slider-runnable-track { outline-color: rgba(255,255,255,0.65); }
.setup-slider::-moz-range-track {
  border-radius: 8px;
  outline: 1.25px solid rgba(255,255,255,0);
  outline-offset: 2px;
  transition: outline-color 0.2s ease;
}
.setup-slider:hover::-moz-range-track { outline-color: rgba(255,255,255,0.65); }

#setup-save-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
/* Secondary buttons (Save Changes, Export, Test, Download): gold outline,
   StoryBox .edit-btn treatment. */
.secondary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  background: transparent;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.secondary-btn:hover:not(:disabled) { background: var(--gold-soft); border-color: rgba(244,201,122,0.6); }
.secondary-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* Test button icon slot: ONE element whose shape/animation swaps with the
   button's state class, after the label (icon to the RIGHT of "Test"/
   "Stop"), centred together with the label by the button's flex.
   Deliberately does NOT recolour the button on .playing -- the icon shape
   (▶ / ■ / spinner) is the state indicator. */
.btn-icon {
  display: inline-block;
  width: 12px; height: 12px;
  flex-shrink: 0;
  position: relative;
}
.btn-icon-play {
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid currentColor;
}
.btn-icon-stop {
  width: 11px; height: 11px;
  background: currentColor;
  border-radius: 2px;
}
.btn-icon-spinner {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(244,201,122,0.25);
  border-top-color: var(--gold);
  animation: btn-spinner-spin 0.7s linear infinite;
}
.secondary-btn.loading { cursor: wait; }
@keyframes btn-spinner-spin { to { transform: rotate(360deg); } }
/* Standalone variant of the same spinner (export modal's "Generating…" row). */
#export-generating-row {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 0; color: var(--ink-soft); font-size: 0.9rem;
}
.standalone-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(244,201,122,0.25);
  border-top-color: var(--gold);
  animation: btn-spinner-spin 0.7s linear infinite;
  flex-shrink: 0;
}
/* While a test is composing/playing the button is disabled only to stop a
   double-tap, not because the action is unavailable -- keep it looking live. */
#test-announcement-btn.loading:disabled,
#test-announcement-btn.playing:disabled {
  opacity: 1;
  cursor: pointer;
}
.save-status { font-size: 0.82rem; color: var(--success); }
.save-status.error { color: var(--danger-text); }

#export-recordings-row {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--card-border);
  display: flex; gap: 12px; flex-wrap: wrap;
}
/* "Test" pushed to the far right of the row, "Export" stays left. */
#test-announcement-btn { margin-left: auto; }

/* ── Slot list on the configuration screen (TaleLight .track-item) ── */
#slot-list-title {
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 6px;
}
.slot-list-hint { font-size: 0.8rem; color: var(--ink-2); margin-bottom: 12px; }
.slot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--item-border);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.slot-row:hover { border-color: rgba(244,201,122,0.35); background: rgba(255,255,255,0.04); }
.slot-row-phrase { flex: 1; font-size: 0.9rem; color: var(--ink-1); }
.slot-row-status { font-size: 0.72rem; color: var(--success); flex-shrink: 0; }
.slot-row.empty .slot-row-status { color: var(--ink-hint); }
.slot-row.empty .slot-row-phrase { color: var(--ink-soft); }
.slot-row-play {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: transparent;
  color: var(--gold);
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.slot-row-play:hover { background: var(--gold-soft); border-color: var(--gold); }
.slot-row-play.playing { background: var(--gold); color: var(--accent-ink); border-color: var(--gold); }

/* ── Slot editor ───────────────────────────────── */
#slot-editor { display: none; }

#slot-controls { display: flex; gap: 8px; margin-bottom: 12px; }
.slot-ctl {
  flex: 1;
  padding: 11px 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink-1);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}
.slot-ctl:hover:not(:disabled) { background: rgba(255,255,255,0.14); }
.slot-ctl:disabled { opacity: 0.4; cursor: not-allowed; }
/* Record = TaleLight #record-btn (red) */
#slot-record-btn:not(:disabled) { background: var(--danger-fill); color: #fff; border-color: transparent; font-weight: 600; }
#slot-record-btn:not(:disabled):hover { opacity: 0.9; }

/* Visualizers: TaleLight #visualizer (the trace is drawn in gold by app.js) */
#slot-visualizer, #wizard-visualizer {
  width: 100%;
  display: block;
  border-radius: 8px;
  background: rgba(0,0,0,0.25);
}
#slot-visualizer   { height: 72px; margin-bottom: 8px; }
#wizard-visualizer { height: 64px; margin-bottom: 10px; }
#slot-timer, #wizard-timer {
  text-align: center;
  font-weight: 300;
  color: var(--gold);
  min-height: 1.4em;
  font-variant-numeric: tabular-nums;
}
#slot-timer   { font-size: 1.1rem; margin-bottom: 12px; }
#wizard-timer { font-size: 1.2rem; margin-bottom: 16px; }
#slot-timer.recording, #wizard-timer.recording { color: var(--danger-text); }

#slot-preview-row, #slot-existing-row { display: none; gap: 8px; }
#slot-preview-row button, #slot-existing-row button {
  flex: 1;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink-1);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
#slot-preview-row button:hover, #slot-existing-row button:hover { background: rgba(255,255,255,0.14); }
#slot-preview-row .slot-save {
  background: var(--gold); color: var(--accent-ink); border-color: transparent; font-weight: 600;
}
#slot-preview-row .slot-save:hover:not(:disabled) { background: var(--gold); opacity: 0.9; }
#slot-preview-row .slot-save:disabled { opacity: 0.5; cursor: not-allowed; }

#slot-status, #wizard-status {
  font-size: 0.85rem;
  color: var(--success);
  text-align: center;
  min-height: 1.2em;
}
#slot-status   { margin-top: 12px; }
#wizard-status { margin-top: 8px; }
#slot-status.error, #wizard-status.error         { color: var(--danger-text); }
#slot-status.uploading, #wizard-status.uploading { color: var(--accent-2); }

/* ── Wizard name page (first configuration) ───── */
#wizard-name-screen { display: none; }
#wizard-name-screen h2, #wizard-lang-screen h2 { font-size: 1.4rem; color: var(--gold); margin-bottom: 8px; }
#wizard-name-screen > p, #wizard-lang-screen > p { color: var(--ink-2); margin-bottom: 24px; font-size: 0.95rem; line-height: 1.5; }
#wizard-name-error { font-size: 0.75rem; color: var(--danger-text); display: none; }
#wizard-name-input:focus::placeholder { color: transparent; }
#wizard-name-nav { display: flex; margin-top: 4px; }
#wizard-name-next-btn { flex: 1; padding: 14px; font-size: 1rem; }

/* ── Wizard language page ─────────────────────── */
#wizard-lang-screen { display: none; }
#wizard-lang-nav { display: flex; gap: 10px; margin-top: 4px; }
#wizard-lang-back-btn { padding: 14px 20px; }
#wizard-lang-next-btn { flex: 1; padding: 14px; font-size: 1rem; }

/* ── Wizard upload-file button ────────────────── */
#wizard-upload-row { text-align: center; margin: 10px 0 4px; }
#wizard-upload-btn {
  background: transparent;
  border: none;
  color: var(--accent-2);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 8px;
  border-radius: 6px;
}
#wizard-upload-btn:hover { color: var(--gold); }

/* ── Wizard ─────────────────────────────── */
#wizard { display: none; }

.wizard-header { text-align: center; margin-bottom: 20px; }
.wizard-progress-bar {
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  height: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}
.wizard-progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.wizard-step-label { font-size: 0.8rem; color: var(--ink-2); letter-spacing: 0.05em; }

/* Phrase card (wizard + slot editor): TaleLight .dash-section */
.wizard-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 16px;
}
.wizard-phrase-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 6px;
}
.wizard-phrase-text {
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink-1);
  margin-bottom: 6px;
  line-height: 1.2;
}
.wizard-phrase-hint { font-size: 0.82rem; color: var(--ink-2); margin-bottom: 20px; }

/* Big record button: TaleLight #record-btn (red); recording = red outline. */
#wizard-record-btn {
  width: 100%;
  padding: 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s, transform 0.1s;
  margin-bottom: 10px;
}
#wizard-record-btn.idle       { background: var(--danger-fill); color: #fff; }
#wizard-record-btn.idle:hover { opacity: 0.9; }
#wizard-record-btn.recording  {
  background: rgba(224,112,112,0.12); color: var(--danger-text); border-color: var(--danger);
  animation: rec-pulse 1.4s ease-in-out infinite;
}
#wizard-record-btn:active     { transform: scale(0.98); }
#wizard-record-btn:disabled   { background: #4a3030; color: #c9a3a3; cursor: not-allowed; animation: none; }
@keyframes rec-pulse { 50% { box-shadow: 0 0 0 4px rgba(224,112,112,0.18); } }

#wizard-playback-section { margin-bottom: 14px; display: none; }
#wizard-playback-row { display: flex; align-items: center; gap: 10px; }
#wizard-play-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--field);
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink-1);
  transition: background 0.2s;
}
#wizard-play-btn:hover   { background: rgba(255,255,255,0.14); }
#wizard-play-btn.playing { background: var(--gold-soft); color: var(--gold); border-color: rgba(244,201,122,0.55); }

.wizard-nav { display: flex; gap: 10px; }
#wizard-back-btn { flex: 1; padding: 14px; }
#wizard-next-btn { flex: 2; padding: 14px; font-size: 0.95rem; }

/* ── Tada screen ─────────────────────────── */
#tada-screen { display: none; text-align: center; padding: 60px 20px; }
#tada-screen .tada-emoji { font-size: 4rem; animation: tadaAnim 1s infinite; display: block; margin-bottom: 16px; }
#tada-screen h2 { font-size: 1.6rem; color: var(--gold); margin-bottom: 10px; }
#tada-screen p  { color: var(--ink-soft); margin-bottom: 24px; line-height: 1.6; }
.tada-btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
#tada-reconfigure-btn { padding: 12px 28px; font-size: 1rem; }
#tada-export-btn { padding: 12px 24px; border-radius: 10px; font-size: 1rem; }

@keyframes tadaAnim {
  0%                 { transform: scale(1); }
  10%, 20%           { transform: scale(0.9) rotate(-3deg); }
  30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
  40%, 60%, 80%      { transform: scale(1.1) rotate(-3deg); }
  100%               { transform: scale(1) rotate(0); }
}

/* ── Export-recordings overlay (TaleLight share-device overlay) ── */
#export-overlay .modal-box { max-width: 400px; }
.share-sub { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 14px; line-height: 1.4; }
.share-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.share-foot .modal-cancel { padding: 9px 20px; border-radius: 8px; font-size: 0.88rem; cursor: pointer; }

/* ── Device error banner ────────────────── */
#device-error-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(224,112,112,0.12);
  border-bottom: 1px solid rgba(224,112,112,0.4);
  color: var(--danger-text);
  padding: 12px 20px;
  font-size: 0.9rem;
}
#device-error-banner button {
  background: none; border: none; color: var(--danger-text);
  font-size: 1.2rem; cursor: pointer; line-height: 1; flex-shrink: 0;
  padding: 2px 6px; border-radius: 6px;
}

/* "Last synced: 3 h ago" under the Device Setup heading (and on device cards) */
.device-last-synced { font-size: 0.78rem; color: var(--ink-2); margin: -4px 0 14px; }

/* ── Scheduled messages (t_4b859ea9): one rounded pane per message; the
   open one's row turns into its edit form in place (#sched-form);
   "+ Add message" after the last pane ── */
.config-pane-schedules { margin-top: 20px; }
.sched-title { font-size: 1.2rem; color: var(--gold); margin-bottom: 0; white-space: nowrap; }
.sched-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sched-i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; font-size: 0.85rem; line-height: 1;
  color: var(--ink-2); cursor: help;
}
.sched-i:hover, .sched-i:focus-visible { color: var(--gold); }
.sched-i:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sched-usage { font-size: 0.78rem; margin-bottom: 6px; }
.sched-usage:empty { display: none; }
.sched-error { color: var(--danger-text); }

/* space meter: a thin bar + "2:40 left" */
.sched-space { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; cursor: default; }
.sched-space-bar { flex: 1; height: 4px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
#sched-space-fill { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.3s; }
#sched-space-fill.low { background: var(--danger); }
.sched-space-text { font-size: 0.72rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.sched-btn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink-1);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.sched-btn:hover:not(:disabled) { background: rgba(255,255,255,0.14); }
.sched-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sched-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sched-delete { color: var(--danger-text); border-color: rgba(224,112,112,0.45); }
.sched-delete:hover:not(:disabled) { border-color: var(--danger); background: rgba(224,112,112,0.12); }

/* the panes */
.sched-list { display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; }
.sched-item {
  background: var(--item); border: 1px solid var(--item-border); border-radius: 10px;
  padding: 7px 10px; cursor: pointer; text-align: left;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.sched-item:hover { background: rgba(255,255,255,0.075); }
.sched-item.sel { border-color: var(--gold-line); }
.sched-item:focus { outline: none; }
.sched-item:focus-visible { box-shadow: 0 0 0 2px var(--focus-ring); }
.sched-item.open {
  cursor: default; background: rgba(255,255,255,0.07);
  border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-line);
  padding: 9px 10px 10px;
}
.sched-item.open:focus-visible { box-shadow: 0 0 0 1px var(--gold-line), 0 0 0 3px var(--focus-ring); }
.sched-item.open .sched-row:not(.sched-row-edit) { cursor: pointer; }
.sched-empty { color: var(--ink-hint); font-size: 0.82rem; text-align: center; padding: 14px 6px; }

/* "+ Add message": a full-width subtle row after the last pane */
.sched-add {
  display: block; width: 100%; margin-top: 6px; padding: 9px 10px;
  border: 1px dashed var(--gold-line); border-radius: 10px; background: transparent;
  color: var(--gold); font-size: 0.86rem; font-weight: 600; cursor: pointer; text-align: center;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.sched-add:hover:not(:disabled) { background: var(--gold-soft); border-color: var(--gold); }
.sched-add:disabled { opacity: 0.35; cursor: not-allowed; }
.sched-add:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* the row: status · label · time · days · on (read-only); the same grid
   holds the inputs when the pane is open, days going to a line of their own */
.sched-row {
  display: grid; align-items: center; column-gap: 8px;
  grid-template-columns: 18px minmax(0, 1fr) 46px 150px 36px;
  grid-template-areas: "st label time days on";
}
.sched-c-st { grid-area: st; display: flex; }
.sched-c-label { grid-area: label; min-width: 0; display: flex; align-items: center; gap: 6px; }
.sched-c-time { grid-area: time; color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sched-c-days { grid-area: days; display: flex; justify-content: flex-start; }
.sched-c-on { grid-area: on; display: flex; justify-content: flex-end; }
.sched-label-t { flex: 0 1 auto; color: var(--ink-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sched-item.off .sched-label-t, .sched-item.off .sched-days { opacity: 0.45; }
.sched-item.off .sched-c-time { color: rgba(244,201,122,0.45); }
.sched-item.locked .sched-toggle { opacity: 0.5; cursor: not-allowed; }
.sched-days { display: inline-flex; flex-wrap: wrap; gap: 3px; max-width: 150px; }
.sched-day {
  font-size: 0.66rem; color: var(--ink-soft); line-height: 1.5; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; padding: 0 6px;
}
/* "A": the message is Advanced (hollow: advanced settings, read-only in Basic) */
.sched-badge {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 4px; font-size: 0.62rem; font-weight: 700; line-height: 1;
  color: var(--accent-ink); background: var(--gold); cursor: help;
}
.sched-badge.hollow { color: var(--gold); background: transparent; border: 1px solid var(--gold-line); }

/* the open row = the edit form, in place */
.sched-row-edit {
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
  grid-template-areas: "st label time on" ". days days days";
  row-gap: 8px;
}
.sched-in.setup-field { margin: 0; height: 36px; padding: 6px 10px; box-sizing: border-box; font-size: 0.88rem; }
.sched-c-time .sched-in { width: 112px; color: var(--gold); font-weight: 600; }
.sched-row-edit .sched-c-days { justify-content: flex-start; }

/* status icons ⏳ / ✓ */
.sched-st {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 0.68rem; line-height: 1; flex-shrink: 0; cursor: help;
}
.sched-st.on      { color: var(--success); background: var(--success-soft); }
.sched-st.waiting { color: var(--gold); background: var(--gold-soft); }
.sched-st.none    { color: var(--danger-text); background: rgba(224,112,112,0.14); font-weight: 700; }
.sched-st.new     { color: var(--accent-ink); background: var(--gold); font-weight: 700; cursor: default; }

/* on/off switch (rows and the form) */
.sched-toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; cursor: pointer; vertical-align: middle; }
.sched-toggle input { position: absolute; top: 0; left: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.sched-toggle-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}
.sched-toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--ink-soft); transition: transform 0.2s, background 0.2s;
}
.sched-toggle input:checked + .sched-toggle-track { background: var(--gold-soft); border-color: var(--gold); }
.sched-toggle input:checked + .sched-toggle-track::after { transform: translateX(16px); background: var(--gold); }
.sched-toggle input:focus-visible + .sched-toggle-track { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Basic ◯— Advanced: one sliding switch per message */
.sched-f-mode { margin: 12px 0 8px; padding-top: 10px; border-top: 1px solid var(--card-border); }
.sched-mode { display: inline-flex; align-items: center; gap: 7px; }
.sched-mode-lbl { font-size: 0.75rem; color: var(--ink-3); transition: color 0.2s; user-select: none; }
.sched-mode-lbl.on { color: var(--gold); font-weight: 600; }
.sched-mode-sw {
  position: relative; width: 46px; height: 24px; padding: 0; flex-shrink: 0;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-2);
  cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.sched-mode-knob {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink-soft); transition: transform 0.22s ease, background 0.2s;
}
.sched-mode-sw.on { background: var(--gold-soft); border-color: var(--gold); }
.sched-mode-sw.on .sched-mode-knob { transform: translateX(22px); background: var(--gold); }
.sched-mode-sw:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sched-mode-sw:disabled { opacity: 0.5; cursor: not-allowed; }

/* the form's other fields */
#sched-form .setup-label { margin-top: 0; }
.sched-f-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.sched-f { display: flex; flex-direction: column; min-width: 0; }
.sched-f-prob { flex: 1 1 180px; }
.sched-day-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.sched-chip {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink-soft);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.sched-chip:hover { border-color: var(--gold-line); }
.sched-chip.on { background: var(--gold); border-color: var(--gold); color: var(--accent-ink); font-weight: 600; }
.sched-chip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* the recorder, moved in from the phrase editor (into the recording sub-pane) */
.sched-rec #slot-controls { margin-bottom: 6px; }
.sched-rec .slot-ctl { padding: 8px 10px; font-size: 0.85rem; }
.sched-rec #slot-visualizer { height: 40px; margin-bottom: 4px; }
.sched-rec.idle #slot-visualizer { display: none; }
.sched-rec #slot-timer { font-size: 0.9rem; margin-bottom: 6px; }
.sched-rec #slot-timer:empty { display: none; }
.sched-rec #slot-preview-row button, .sched-rec #slot-existing-row button { padding: 8px; font-size: 0.82rem; }
.sched-rec #slot-preview-row, .sched-rec #slot-existing-row { margin-bottom: 0; }
.sched-clips #slot-status { margin-top: 6px; font-size: 0.8rem; text-align: left; }
.sched-clips #slot-status:empty { display: none; }

/* Delete · · · Cancel Save, and the small delete confirm above them */
.sched-f-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.sched-f-actions .sched-btn { padding: 8px 14px; font-size: 0.85rem; }
.sched-f-actions #sched-cancel-btn { margin-left: auto; }
#sched-save-btn {
  padding: 8px 20px; border: none; border-radius: 8px;
  background: var(--gold); color: var(--accent-ink);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
#sched-save-btn:hover:not(:disabled) { opacity: 0.9; }
#sched-save-btn:disabled { opacity: 0.5; cursor: not-allowed; }
#sched-save-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* Two-step delete ("Really Delete?", confirm-arm.js). Text buttons stack
   both captions in one grid cell, so the button is always as wide as the
   longer one and arming never moves anything. */
.arm-btn { display: inline-grid; }
.arm-btn > .arm-cap-off, .arm-btn > .arm-cap-on { grid-area: 1 / 1; text-align: center; white-space: nowrap; }
.arm-btn > .arm-cap-on { visibility: hidden; }
.arm-btn.armed > .arm-cap-off { visibility: hidden; }
.arm-btn.armed > .arm-cap-on { visibility: visible; }
.sched-delete.armed, .sched-delete.armed:hover:not(:disabled) {
  background: var(--danger); border-color: var(--danger); color: #1a1010;
}
/* Icon delete (a clip's ✕): the button keeps its 28px slot and the caption
   opens leftward over its neighbours while armed. */
.sched-clip-del { position: relative; }
.sched-clip-del > .arm-cap-on { display: none; }
.sched-clip-del.armed > .arm-cap-on {
  display: flex; align-items: center; position: absolute; top: -1px; right: -1px; height: 28px;
  padding: 0 10px; border-radius: 7px; white-space: nowrap; z-index: 2;
  background: var(--danger); color: #1a1010; font-size: 0.75rem; font-weight: 600;
  box-shadow: 0 0 0 1px var(--danger);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* open read-only pane (advanced settings, switch on Basic) */
.sched-ro {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--card-border); cursor: default;
}
.sched-summary { font-size: 0.78rem; color: var(--ink-soft); flex: 1 1 150px; }
.sched-ro-btns { display: flex; gap: 6px; margin-left: auto; }
.sched-ro-btns .sched-btn { padding: 7px 12px; font-size: 0.82rem; }

/* under a collapsed Advanced message: its recordings, then Play Probability on its own line */
.sched-sub { margin: 6px 0 0 26px; font-size: 0.75rem; color: var(--ink-2); cursor: pointer; }
.sched-sub-clips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sched-sub-clip {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 7px;
  border: 1px solid var(--item-border); border-radius: 999px; background: var(--field);
  font-variant-numeric: tabular-nums;
}
.sched-sub-clip b { color: var(--gold); font-weight: 600; }
.sched-sub-pick { margin-left: 2px; color: var(--ink-3); }
.sched-sub-prob {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--card-border);
}
.sched-sub-k { color: var(--ink-3); }
.sched-sub-v { color: var(--ink-1); font-weight: 600; font-variant-numeric: tabular-nums; }

/* recordings (t_82bcb0f4): rows, "+ Add Recording", the recording sub-pane */
#sched-adv2 { display: none; }
.sched-clips { margin: 2px 0 10px; }
.sched-clips-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sched-clips-head .setup-label { margin: 0; }
.sched-clips-head .sched-seg button { padding: 5px 10px; font-size: 0.75rem; }
#sched-clip-list { margin: 0 0 4px; }
.sched-clip {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--item-border); background: var(--field); border-radius: 8px;
  padding: 4px 6px 4px 8px; margin-bottom: 4px;
}
.sched-clip.target { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-line) inset; }
.sched-clip-n { font-weight: 600; color: var(--gold); min-width: 1.2em; max-width: 7em; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-dur { font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sched-clip-btns { margin-left: auto; display: flex; align-items: center; gap: 3px; }
.sched-clip-btns .slot-row-play { width: 28px; height: 28px; }
.sched-ib {
  width: 28px; height: 28px; padding: 0; line-height: 1;
  border: 1px solid var(--border); border-radius: 7px; background: transparent;
  color: var(--ink-soft); font-size: 0.85rem; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.sched-ib:hover:not(:disabled) { background: rgba(255,255,255,0.1); color: var(--ink-1); }
.sched-ib:disabled { opacity: 0.3; cursor: not-allowed; }
.sched-ib:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sched-ib.on { border-color: var(--gold); color: var(--gold); }
.sched-ib-del:hover:not(:disabled) { color: var(--danger-text); border-color: var(--danger); }
.sched-clip-rerec { color: var(--danger-text); }
.sched-clip-add { color: var(--gold); border-color: var(--gold-line); margin-top: 2px; }
.sched-clip-add:disabled { opacity: 0.5; cursor: not-allowed; }
/* the sub-pane: a subtle pane of its own inside the message pane */
.sched-rec {
  margin: 4px 0 0; padding: 8px 10px 10px;
  border: 1px solid var(--gold-line); border-radius: 10px; background: rgba(255,255,255,0.03);
}
.sched-rec[hidden] { display: none; }
.sched-rec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sched-rec-head .sched-ib { width: 24px; height: 24px; font-size: 0.75rem; }
.sched-rec-cap { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold); }
/* Play Probability: its own line after the last recording */
.sched-f-probline { margin: 0 0 10px; padding-top: 10px; border-top: 1px solid var(--card-border); }
.sched-f-probline .setup-label { display: block; margin: 0 0 6px; }
.sched-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.sched-seg button {
  padding: 7px 11px; border: none; background: var(--field); color: var(--ink-soft);
  font-size: 0.8rem; cursor: pointer;
}
.sched-seg button + button { border-left: 1px solid var(--border); }
.sched-seg button.on { background: var(--gold); color: var(--accent-ink); font-weight: 600; }
.sched-seg.dim { opacity: 0.6; }
.sched-prob-row { display: flex; align-items: center; gap: 8px; }
#sched-prob-range { flex: 1; min-width: 80px; accent-color: var(--gold); }
#sched-prob-num { width: 62px; margin: 0; text-align: right; padding: 6px 8px; }
.sched-prob-unit { color: var(--ink-soft); font-size: 0.85rem; }

/* Phones: panes a bit tighter; the row keeps status + label + time + days + on. */
@media (max-width: 420px) {
  .config-pane { padding: 18px 14px; }
  .wizard-card { padding: 20px 16px; }
  .wizard-phrase-text { font-size: 1.7rem; }
  .sched-title { font-size: 1.05rem; }
  .sched-item { padding: 7px 8px; }
  .sched-item.open { padding: 8px 8px 9px; }
  .sched-row { column-gap: 6px; }
  .sched-row:not(.sched-row-edit) { grid-template-columns: 18px minmax(0, 1fr) 40px 74px 36px; }
  .sched-days { max-width: 74px; }
  .sched-list { font-size: 0.84rem; }
  .sched-c-time .sched-in { width: 100px; padding: 6px 6px; }
  .sched-f-actions .sched-btn { padding: 8px 11px; }
  #sched-save-btn { padding: 8px 16px; }
}

/* ── Clock activation card (t_50f78e16, activation.js) ──────────────────
   8 slot-machine reels (lights 1-8, left to right; see the reels block below),
   each with its colour name underneath, so the
   code never depends on telling colours apart alone. The little CSS clock
   (arched mantel case, brass knob on top, the LED row under the photo frame)
   lights up with the colours entered, to compare with the real one. */
.device-activation-state { margin-top: -10px; }
.device-activation-state.ok { color: var(--success); }
.activation-card { margin-bottom: 20px; border-color: var(--gold-line); background: linear-gradient(160deg, rgba(244,201,122,0.09), var(--card) 60%); }
.activation-card.activated { border-color: rgba(92,184,122,0.45); background: var(--success-soft); }
.activation-card.activated #act-title { color: var(--success); }
.act-body { display: flex; gap: 18px; align-items: center; margin: 4px 0 14px; }
.act-help { font-size: 0.92rem; line-height: 1.5; color: var(--ink-1); flex: 1 1 auto; min-width: 0; }
.act-illu { flex: 0 0 150px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.act-illu-cap { font-size: 0.68rem; color: var(--ink-hint); text-align: center; }
.act-clock { position: relative; width: 150px; height: 128px; }
.act-knob {
  position: absolute; left: 50%; top: 0; width: 34px; height: 10px; transform: translateX(-50%);
  border-radius: 50% 50% 6px 6px; background: linear-gradient(#e8c56b, #a87f2c); z-index: 2;
}
.act-tap {
  position: absolute; left: 50%; top: -6px; transform: translate(26px, 0);
  font-size: 0.62rem; font-weight: 600; color: var(--gold); letter-spacing: 0.04em;
  animation: act-tap-pulse 1.6s ease-in-out infinite;
}
.act-tap::before { content: '← '; }
@keyframes act-tap-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.act-arch {
  position: absolute; left: 14px; right: 14px; top: 6px; height: 40px;
  border-radius: 60px 60px 0 0; background: linear-gradient(#8a5530, #6b3f22);
  border: 1px solid rgba(0,0,0,0.25); border-bottom: none;
}
.act-case {
  position: absolute; left: 8px; right: 8px; top: 38px; height: 74px;
  background: linear-gradient(#7a4a29, #5c351c); border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.3);
}
.act-frame {
  position: absolute; left: 50%; top: -20px; width: 54px; height: 54px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle at 40% 35%, #e9d8b8, #b99d70);
  border: 3px solid #c9a24a;
}
.act-leds { position: absolute; left: 14px; right: 14px; bottom: 9px; display: flex; justify-content: space-between; }
.act-leds span {
  width: 11px; height: 9px; border-radius: 2px; background: rgba(255,255,255,0.14);
  border: 1px solid rgba(0,0,0,0.35); transition: background 0.15s, box-shadow 0.15s;
}
.act-base {
  position: absolute; left: 0; right: 0; bottom: 0; height: 16px;
  background: linear-gradient(#6b3f22, #4a2a15); border-radius: 3px;
}
#act-picker .act-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin: 8px 0 6px; }
/* Slot-machine reels (t_c4f6506a): 8 drums side by side in a gold-trimmed
   cabinet, one per light. Faces are laid out by activation.js (translateY +
   scaleY + fade on a 40°-per-face drum); the shading overlay makes it read
   as curved. The payline window is the centre face; the colour name sits
   under each reel for colour-blind users. */
.act-machine {
  position: relative; margin: 2px 0 0; padding: 6px 12px;
  border: 1px solid var(--gold-line); border-radius: 14px;
  background: linear-gradient(180deg, #24385c, #132238 70%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 6px 18px rgba(0,0,0,0.25);
}
/* payline arrows at the window's height (16 px number row + half the 120 px reel) */
.act-machine::before, .act-machine::after {
  content: ''; position: absolute; top: calc(16px + 16px + 60px); transform: translateY(-50%);
  border: 6px solid transparent; pointer-events: none;
}
.act-machine::before { left: 1px; border-left: 8px solid var(--gold); }
.act-machine::after { right: 1px; border-right: 8px solid var(--gold); }
.act-bulbs { display: flex; justify-content: space-between; padding: 0 4px; height: 10px; align-items: center; }
.act-bulbs span { width: 5px; height: 5px; border-radius: 50%; background: rgba(244,201,122,0.35); }
.act-reels { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; padding: 0; }
.act-reel-wrap { display: flex; flex-direction: column; align-items: center; min-width: 0; gap: 3px; }
.act-reel-n { height: 13px; font-size: 0.66rem; font-weight: 600; line-height: 13px; color: var(--ink-2); }
.act-reel {
  position: relative; width: 100%; max-width: 50px; height: 120px; border-radius: 8px;
  overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(90deg, #b9b09c, #f1eadb 30%, #f6f0e2 50%, #f1eadb 70%, #b9b09c);
  border: 1px solid rgba(0,0,0,0.45);
}
.act-reel:active { cursor: grabbing; }
.act-reel:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.act-reel::before { /* drum curvature: dark towards the top and bottom edges */
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(rgba(10,18,32,0.78), rgba(10,18,32,0.15) 32%, rgba(10,18,32,0) 42%, rgba(10,18,32,0) 58%, rgba(10,18,32,0.15) 68%, rgba(10,18,32,0.78));
}
.act-reel::after { /* payline window */
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 34px; transform: translateY(-50%);
  z-index: 3; pointer-events: none;
  border-top: 2px solid rgba(168,127,44,0.95); border-bottom: 2px solid rgba(168,127,44,0.95);
  transition: box-shadow 0.2s;
}
.act-face {
  position: absolute; left: 4px; right: 4px; top: 50%; height: 26px; margin-top: -13px; z-index: 1;
  border-radius: 6px; border: 1.5px solid rgba(0,0,0,0.45);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), inset 0 -3px 0 rgba(0,0,0,0.18);
  will-change: transform, opacity;
}
.act-face.blank {
  background: repeating-linear-gradient(135deg, #8b93a0 0 4px, #7b8390 4px 8px);
  color: #1d2738; font-weight: 700; font-size: 0.95rem; line-height: 23px; text-align: center;
}
.act-reel-hint {
  position: absolute; left: 0; right: 0; z-index: 4; text-align: center; pointer-events: none;
  font-size: 8px; line-height: 1; color: rgba(255,255,255,0.75);
}
.act-reel-hint.up { top: 3px; }
.act-reel-hint.dn { bottom: 3px; }
.act-reel-name {
  max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap;
  font-size: 0.64rem; line-height: 1.2; color: var(--ink-hint);
}
.act-reel-wrap.set .act-reel-name { color: var(--ink-1); font-weight: 500; }
.act-spin-btn { white-space: nowrap; }

/* jackpot: bulbs chase, the payline glows, gold confetti falls */
.act-machine.jackpot { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft), 0 0 22px rgba(244,201,122,0.35); }
.act-machine.jackpot .act-bulbs span { animation: act-bulb 0.36s steps(1) infinite; }
.act-machine.jackpot .act-bulbs span:nth-child(odd) { animation-delay: 0.18s; }
@keyframes act-bulb { 0% { background: #fff1c9; box-shadow: 0 0 6px 2px rgba(244,201,122,0.9); } 50% { background: rgba(244,201,122,0.3); box-shadow: none; } }
.act-machine.jackpot .act-reel::after { box-shadow: 0 0 0 999px rgba(244,201,122,0.0), inset 0 0 10px 2px rgba(244,201,122,0.9); border-color: var(--gold); animation: act-pay 0.5s ease-in-out infinite alternate; }
@keyframes act-pay { from { background: rgba(244,201,122,0.05); } to { background: rgba(244,201,122,0.3); } }
.act-confetti { position: absolute; left: 0; right: 0; top: 0; height: 0; pointer-events: none; z-index: 5; }
.act-confetti i {
  position: absolute; top: -14px; width: 7px; height: 12px; border-radius: 1px; opacity: 0;
  box-shadow: 0 0 4px rgba(244,201,122,0.6);
  animation: act-confetti 1.25s cubic-bezier(.25,.55,.45,1) forwards;
}
.act-confetti i.round { width: 8px; height: 8px; border-radius: 50%; }
@keyframes act-confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), 200px) rotate(var(--rot)); }
}
.act-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.act-actions-gap { flex: 1 1 auto; }
.act-small-btn {
  background: transparent; border: 1px solid rgba(255,255,255,0.2); border-radius: 20px;
  color: var(--ink-soft); font-size: 0.82rem; padding: 7px 14px; cursor: pointer;
}
.act-small-btn:hover:not(:disabled) { background: var(--bg-2); color: var(--gold); border-color: var(--gold-line); }
.act-small-btn:disabled { opacity: 0.4; cursor: default; }
.act-submit {
  background: var(--gold); color: var(--accent-ink); border: none; border-radius: 8px;
  padding: 10px 22px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.act-submit:hover:not(:disabled) { opacity: 0.92; }
.act-submit:disabled { opacity: 0.4; cursor: default; }
#act-status { position: relative; margin-top: 10px; font-size: 0.86rem; min-height: 1.2em; color: var(--ink-soft); }
/* t_671ae4b7: each status message (activation.js actSetStatus) fades + slides
   in, and fades + slides out before it is removed; a leaving message is taken
   out of the flow so the next one takes its place without a jump. Reduced
   motion: fade only. */
.act-msg { display: block; animation: act-msg-in 300ms cubic-bezier(.2,.7,.3,1) both; }
.act-msg.ok { color: var(--gold); font-weight: 600; }
.act-msg.error { color: var(--danger-text); }
.act-msg.leaving { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; animation: act-msg-out 240ms ease-in both; }
@keyframes act-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes act-msg-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-6px); } }
/* the card itself: in when it appears, out before display:none */
.activation-card.card-in { animation: act-msg-in 320ms cubic-bezier(.2,.7,.3,1) both; }
.activation-card.card-leaving { pointer-events: none; animation: act-msg-out 260ms ease-in both; }
@keyframes act-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes act-fade-out { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .act-msg, .activation-card.card-in { animation-name: act-fade-in; }
  .act-msg.leaving, .activation-card.card-leaving { animation-name: act-fade-out; }
}
@media (max-width: 420px) {
  .act-body { flex-direction: column; align-items: stretch; gap: 10px; }
  .act-illu { align-self: center; flex-basis: auto; }
  /* 390 px: 8 reels of ~36 px; the side payline arrows give way to width */
  .activation-card { padding-left: 12px; padding-right: 12px; }
  .act-machine { padding: 6px 5px; }
  .act-machine::before, .act-machine::after { display: none; }
  .act-reels { gap: 4px; }
  .act-face { left: 3px; right: 3px; }
  .act-reel-name { font-size: 0.58rem; }
}
@media (prefers-reduced-motion: reduce) {
  .act-tap { animation: none; opacity: 1; }
  .act-face { will-change: auto; }
}
.activation-card.activated .act-tap { display: none; }
.activation-card.activated .act-leds span { background: var(--success); box-shadow: 0 0 7px 1px rgba(92,184,122,0.8); }
@media (max-width: 420px) { .act-submit { flex: 1 0 100%; order: 9; padding: 12px; margin-top: 2px; } }
