/* style.css — EdgeRoulette v2
   Design tokens identical to v1. New components: mode-selector,
   page-nav, ch-task-card, ch-edge-block, ch-orgasm-card, stats-pb,
   preset fields, dual duration inputs. */

@font-face {
  font-family: "Figtree";
  src: url("../fonts/Figtree/Figtree-VariableFont_wght.1bb7463418dc.ttf") format("truetype");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("../fonts/Figtree/Figtree-Italic-VariableFont_wght.7f7ee45b2a15.ttf") format("truetype");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0e0e12;
  --surface: #17171f;
  --border: #2a2a36;
  --accent: #a78bfa;
  --accent2: #f472b6;
  --accent-k: #f9a8d4;
  --text: #e2e2f0;
  --muted: #6b6b8a;
  --radius: 10px;
  --danger: #f43f5e;
  --success: #34d399;
  --warn: #f59e0b;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Figtree", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

body.dashboard-body {
  background:
    linear-gradient(rgba(14, 14, 18, .58), rgba(14, 14, 18, .78)),
    url("../img/itto.092132f53c06.png") -6% center / contain no-repeat fixed,
    var(--bg);
}

body.dashboard-body header {
  background: rgba(23, 23, 31, .88);
  backdrop-filter: blur(12px);
}

.dashboard-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
}

.dashboard-layout > .t-pun-total {
  width: 224px;
  min-height: 90px;
}

.dashboard-card-stack {
  width: 224px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.dashboard-task-card {
  width: 224px;
  height: 90px;
  min-height: 90px;
  text-align: left;
  transform-origin: right center;
  color: var(--text);
  font-family: inherit;
}

.dashboard-task-card .t-task-title,
.dashboard-task-card .dashboard-card-detail-title {
  color: var(--text);
}

.dashboard-task-card.active {
  border-color: rgba(249, 168, 212, .7);
  box-shadow: 0 0 0 1px rgba(249, 168, 212, .18);
}

.dashboard-drawer {
  position: fixed;
  top: 54px;
  right: 0;
  bottom: 0;
  z-index: 40;
  width: min(84vw, 860px);
  padding: 18px;
  border-left: 1px solid var(--border);
  background: rgba(23, 23, 31, .96);
  backdrop-filter: blur(16px);
  box-shadow: -24px 0 70px rgba(0, 0, 0, .42);
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(.17,.67,.2,1);
  display: flex;
  flex-direction: column;
}

.dashboard-drawer.open {
  transform: translateX(0);
}

.dashboard-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.dashboard-drawer-title {
  color: var(--text);
  font-size: 20px;
  font-weight: 850;
}

.dashboard-drawer-sub,
.dashboard-drawer-copy {
  color: var(--muted);
}

.dashboard-drawer-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-top: 18px;
  padding-right: 4px;
}

.dashboard-drawer-count {
  color: var(--accent-k);
  font-size: 48px;
  line-height: 1;
  font-weight: 900;
  margin-bottom: 12px;
}

.dashboard-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.dashboard-drawer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(14, 14, 18, .72);
}

.dashboard-drawer-row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.dashboard-complete-btn {
  width: fit-content;
  min-width: 96px;
  white-space: nowrap;
}

.dashboard-proof {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .68);
}

.dashboard-proof.open {
  display: flex;
}

.dashboard-proof-dialog {
  width: min(380px, 100%);
  padding: 18px;
  border: 1px solid rgba(249, 168, 212, .35);
  border-radius: 8px;
  background: rgba(23, 23, 31, .98);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .52);
}

.dashboard-confirm-kicker {
  color: var(--accent-k);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.dashboard-confirm-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  margin-bottom: 8px;
}

.dashboard-confirm-copy {
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.dashboard-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-confirm-actions .btn {
  width: fit-content;
  min-width: 96px;
  white-space: nowrap;
}

.dashboard-proof-preview {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  overflow: hidden;
}

.dashboard-proof-preview img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  display: block;
}

.dashboard-proof-upload {
  width: fit-content;
  min-width: 44px;
  min-height: 40px;
  justify-content: center;
  align-items: center;
  display: flex;
  margin-bottom: 10px;
}

.dashboard-proof-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
  margin-bottom: 8px;
}

.dashboard-drawer-row-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.dashboard-drawer-row-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 4px;
  max-width: 560px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dashboard-drawer-empty {
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(14, 14, 18, .45);
}

.dashboard-drawer-action {
  display: inline-flex;
  margin-top: 18px;
  text-decoration: none;
}

@media (max-width: 680px) {
  .dashboard-drawer {
    width: min(88vw, 520px);
  }
}

/* ── Header ───────────────────────────────────────────────────────────────── */
header {
  position: relative;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  gap: 8px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

header h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  background: linear-gradient(120deg, var(--accent) 15%, var(--accent-k) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-menu {
  position: relative;
  display: inline-flex;
  z-index: 120;
}

.header-menu-toggle {
  width: 42px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 130;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(23, 23, 31, .98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .38);
}

.header-menu-panel[hidden] {
  display: none;
}

.header-menu-status {
  padding: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.header-menu-status .status-pill,
.header-menu-status .t-points-pill {
  width: 100%;
  justify-content: center;
}

.js-kelsie-settings-row {
  cursor: pointer;
}

.header-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.header-menu-item:hover {
  background: var(--bg);
}

.header-menu-form {
  margin: 0;
}

.header-menu-submit {
  color: rgba(255, 116, 136, .9);
}

.k-proof-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .72);
}

.k-proof-modal.open {
  display: flex;
}

.k-proof-dialog {
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}

.k-proof-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 6px;
}

.k-proof-copy {
  color: var(--muted);
  margin-bottom: 12px;
}

.k-proof-preview {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  overflow: hidden;
}

.k-lovense-url {
  padding: 10px 12px;
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.k-lovense-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.k-lovense-actions .btn {
  width: auto;
  min-width: 96px;
  height: auto;
  display: inline-flex;
}

.k-proof-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  display: block;
}

.k-proof-upload {
  width: 100%;
  justify-content: center;
  display: flex;
  margin-bottom: 10px;
}

.k-proof-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
  margin-bottom: 8px;
}

/* ── Page navigation (Roulette / Challenge tabs) ──────────────────────────── */
.page-nav {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.page-nav-link {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, background .15s;
}

.page-nav-link+.page-nav-link {
  border-left: 1px solid var(--border);
}

.page-nav-link.active {
  background: var(--surface);
  color: var(--accent);
}

/* ── Status pill ──────────────────────────────────────────────────────────── */
.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 11px;
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 5px var(--success);
}

/* ── Panels ───────────────────────────────────────────────────────────────── */
.panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 4px;
  gap: 12px;
}

.panel.active {
  display: flex;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  padding: 11px 16px;
  transition: opacity .15s, transform .1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #0e0e12;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#btn-settings-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.btn-danger-ghost {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-danger.punishment {
  background: var(--warn);
  animation: pulse-warn 1s ease-in-out infinite;
}

@keyframes pulse-warn {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .65
  }
}

/* ── Roll display ─────────────────────────────────────────────────────────── */
.r-roll-display {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  position: relative;
  transition: border-color .3s, box-shadow .3s;
}

@keyframes r-display-flash {
  0% {
    border-color: var(--border);
    box-shadow: none;
  }

  40% {
    border-color: var(--accent);
    box-shadow: 0 0 18px rgba(167, 139, 250, .35);
  }

  100% {
    border-color: var(--border);
    box-shadow: none;
  }
}

.r-roll-display.flash {
  animation: r-display-flash .55s ease forwards;
}

.r-status-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--accent2);
  height: 13px;
  line-height: 13px;
  margin-bottom: 3px;
  opacity: 0;
  transition: opacity .2s;
  text-align: center;
}

.r-roll-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

@keyframes r-slot-in {
  from {
    opacity: 0;
    transform: translateX(22px) scale(.88);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.r-roll-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 14px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  opacity: 0;
  animation: r-slot-in .3s cubic-bezier(.17, .67, .35, 1.1) forwards;
  min-width: 148px;
}

.r-roll-slot.idle {
  opacity: .35;
  animation: none;
}

.r-slot-label {
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}

.slot-window {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 32px;
}

.slot-reel {
  position: absolute;
  top: 0;
  width: 100%;
  transition: top 0.55s cubic-bezier(.17, .67, .12, .99);
}

.slot-item {
  height: 32px;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}

/* ── Countdown overlay ────────────────────────────────────────────────────── */
@keyframes cd-pop {
  0% {
    transform: scale(1.4);
    opacity: 0;
  }

  18% {
    opacity: 1;
  }

  28% {
    transform: scale(1.0);
    opacity: 1;
  }

  68% {
    transform: scale(1.0);
    opacity: 1;
  }

  100% {
    transform: scale(.55);
    opacity: 0;
  }
}

.r-countdown-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(14, 14, 18, .9);
  border-radius: var(--radius);
  z-index: 5;
}

.r-countdown-overlay.active {
  display: flex;
}

.r-countdown-overlay.active .r-cd-num {
  animation: cd-pop .82s ease forwards;
}

.r-cd-num {
  font-size: 54px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 30px rgba(167, 139, 250, .4);
  line-height: 1;
}

/* ── Chips (breaks/tease) ─────────────────────────────────────────────────── */
.r-slot-chips {
  display: flex;
  gap: 6px;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
}

.r-slot-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  opacity: .4;
  transition: opacity .3s, border-color .3s;
}

.r-slot-chip.active {
  opacity: 1;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.r-slot-chip.zero {
  opacity: .2;
}

.rchip-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  line-height: 1;
}

.rchip-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ── Roll chips strip ─────────────────────────────────────────────────────── */
.roulette-rolls {
  flex-shrink: 0;
}

.rolls-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.rolls-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 24px;
}

.roll-chip {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all .2s;
}

.roll-chip.current {
  border-color: var(--accent);
  color: var(--accent);
  background: #1e1430;
}

.roll-chip.jackpot {
  border-color: var(--accent2);
  color: var(--accent2);
  background: #200d1a;
}

.roll-chip.denied {
  border-color: var(--danger);
  color: var(--danger);
  background: #1a080c;
}

/* ── Mode selector (Roll / Loop / Alarm) ──────────────────────────────────── */
.r-opt-mode {
  flex: 2;
}

.mode-selector {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.mode-btn {
  flex: 1;
  padding: 6px 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.mode-btn+.mode-btn {
  border-left: 1px solid var(--border);
}

.mode-btn.active {
  background: var(--surface);
  color: var(--accent);
}

/* ── Options strip ────────────────────────────────────────────────────────── */
.r-options-strip {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

.r-opt-group {
  display: flex;
  flex: 1;
  align-self: center;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  min-width: 60px;
}

.r-opt-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Toggle switch ────────────────────────────────────────────────────────── */
.switch {
  --button-width: 2.8em;
  --button-height: 1.6em;
  --toggle-diameter: 1.2em;
  --button-toggle-offset: calc((var(--button-height) - var(--toggle-diameter)) / 2);
  --toggle-shadow-offset: 8px;
  --toggle-wider: 2.2em;
  --color-on: var(--accent);
  cursor: pointer;
  display: inline-block;
}

.switch-danger {
  --color-on: var(--danger);
}

.switch-alarm {
  --color-on: var(--accent2);
}

.switch .slider {
  display: inline-block;
  width: var(--button-width);
  height: var(--button-height);
  background-color: var(--border);
  border-radius: calc(var(--button-height) / 2);
  position: relative;
  transition: 0.3s all ease-in-out;
}

.switch .slider::after {
  content: "";
  display: inline-block;
  width: var(--toggle-diameter);
  height: var(--toggle-diameter);
  background-color: var(--muted);
  border-radius: calc(var(--toggle-diameter) / 2);
  position: absolute;
  top: var(--button-toggle-offset);
  transform: translateX(var(--button-toggle-offset));
  box-shadow: var(--toggle-shadow-offset) 0 calc(var(--toggle-shadow-offset) * 4) rgba(0, 0, 0, .25);
  transition: 0.3s all ease-in-out;
}

.switch input[type="checkbox"]:checked+.slider {
  background-color: var(--color-on);
}

.switch input[type="checkbox"]:checked+.slider::after {
  background-color: #fff;
  transform: translateX(calc(var(--button-width) - var(--toggle-diameter) - var(--button-toggle-offset)));
  box-shadow: calc(var(--toggle-shadow-offset) * -1) 0 calc(var(--toggle-shadow-offset) * 4) rgba(0, 0, 0, .25);
}

.switch input[type="checkbox"] {
  display: none;
}

.switch input[type="checkbox"]:active+.slider::after {
  width: var(--toggle-wider);
}

.switch input[type="checkbox"]:checked:active+.slider::after {
  transform: translateX(calc(var(--button-width) - var(--toggle-wider) - var(--button-toggle-offset)));
}

.r-opt-alarm {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--accent2);
  font-weight: 600;
  align-self: flex-end;
  padding-bottom: 2px;
  width: 100%;
  justify-content: center;
}

.r-opt-alarm.visible {
  display: flex;
}

.r-opt-alarm input[type=time] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
  width: 92px;
}

.r-opt-alarm input[type=time]:focus {
  border-color: var(--accent2);
}

/* ── Timer bar ────────────────────────────────────────────────────────────── */
.r-timer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.r-timer-bar-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.r-timer-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 100%;
  transition: width .1s linear, background .5s;
}

.r-timer-bar.low {
  background: var(--accent2);
}

.r-timer-bar.break {
  background: var(--success);
}

.r-timer-bar.denied {
  background: var(--danger);
}

.r-timer-text {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  width: 42px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Endured bar ──────────────────────────────────────────────────────────── */
.r-endured-bar {
  display: none;
  gap: 8px;
  padding: 2px 0;
  flex-shrink: 0;
}

.r-endured-bar.visible {
  display: flex;
}

.endured-chip {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.endured-chip-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  transition: color .3s;
}

.endured-chip-val.warn {
  color: var(--warn);
}

.endured-chip-val.danger {
  color: var(--danger);
  animation: pulse-warn 1.4s ease-in-out infinite;
}

.endured-chip-label {
  font-size: 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* ── Log ──────────────────────────────────────────────────────────────────── */
.r-embedded-log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
}

.r-log-entries {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 110px;
}

.r-log-ph {
  font-size: 11px;
  color: var(--muted);
}

.r-log-entry {
  padding: 4px 8px;
  border-radius: 5px;
  border-left: 2px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.r-log-entry.ok {
  border-left-color: var(--accent);
}

.r-log-entry.err {
  border-left-color: var(--danger);
}

.r-log-action {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.r-log-detail {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.r-log-time {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}

/* ── Roulette buttons ─────────────────────────────────────────────────────── */
.roulette-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  padding-bottom: 8px;
  margin-top: auto;
}

.roulette-btns .btn {
  flex: 1 1 104px;
  padding: 13px;
  font-size: 14px;
  white-space: nowrap;
}

/* ── Jackpot fly-card ─────────────────────────────────────────────────────── */
.jp-flycard {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 22px 36px;
  border-radius: 18px;
  border: 2px solid var(--accent2);
  background: #160812;
  color: var(--accent2);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: .03em;
  box-shadow: 0 0 60px rgba(244, 114, 182, .35);
  transition: transform .45s cubic-bezier(.17, .67, .35, 1.15), opacity .35s ease;
  transform-origin: center center;
}

.jp-flycard .jp-sub {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--muted);
}

@keyframes jp-pulse {

  0%,
  100% {
    box-shadow: 0 0 40px rgba(244, 114, 182, .3);
  }

  50% {
    box-shadow: 0 0 90px rgba(244, 114, 182, .75), 0 0 160px rgba(244, 114, 182, .25);
  }
}

.jp-flycard.pulsing {
  animation: jp-pulse .65s ease-in-out infinite;
}

/* ── Settings overlay ─────────────────────────────────────────────────────── */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.settings-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Settings panel (slide-in) ────────────────────────────────────────────── */
#panel-settings {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  z-index: 500;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
  padding: 0;
  gap: 0;
  overflow: hidden;
  display: flex !important;
}

#panel-settings.active {
  transform: translateX(0);
}

.subtab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.subtab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

.subtab.active {
  color: var(--accent-k);
  border-bottom-color: var(--accent-k);
}

.subpanel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  gap: 12px;
}

.subpanel>* {
  flex-shrink: 0;
}

.subpanel.active {
  display: flex;
}

/* ── Toy card ─────────────────────────────────────────────────────────────── */
.toy-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.toy-card-icon {
  flex-shrink: 0;
}

.toy-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.toy-card-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toy-card-battery {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.battery-bar-track {
  width: 36px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.battery-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--success);
  transition: width .3s ease;
}

.battery-bar-fill.low {
  background: var(--warn);
}

.battery-bar-fill.danger {
  background: var(--danger);
}

/* ── Settings sections ────────────────────────────────────────────────────── */
.settings-divider {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(249, 168, 212, .6);
  margin-top: 4px;
  font-weight: 700;
}

.settings-fields {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.settings-field-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  position: relative;
}

.settings-field-row:last-child {
  border-bottom: none;
}

.settings-field-row label:not(.switch) {
  position: absolute;
  left: 14px;
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}

.settings-field-row input[type=number],
.settings-field-row input[type=text] {
  width: 84px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  outline: none;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: border-color .15s;
}

.settings-field-row input[type=text] {
  width: 120px;
  text-align: left;
}

.settings-field-row input[type=number]::-webkit-inner-spin-button,
.settings-field-row input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
}

.settings-field-row input:focus {
  border-color: var(--accent);
}

.settings-field-row select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  outline: none;
  flex: 1;
  min-width: 0;
}

.unit {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.unit-sep {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ── yn-btns ──────────────────────────────────────────────────────────────── */
.yn-btns {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.yn-btn {
  flex: 1;
  padding: 8px 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  min-width: 40px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}

.yn-btn+.yn-btn {
  border-left: 1px solid var(--border);
}

.yn-btn.active {
  background: var(--surface);
  color: var(--text);
}

.yn-btn.active[data-val="yes"] {
  background: #200d1a;
  color: var(--accent2);
}

.yn-btn.esc-yes.active[data-val="yes"] {
  background: #1e1430;
  color: var(--accent);
}

.yn-small .yn-btn {
  padding: 6px 4px;
  font-size: 11px;
}

/* ── Preset rows ──────────────────────────────────────────────────────────── */
.preset-load-row {
  flex-wrap: wrap;
  gap: 6px;
}

.preset-save-row {
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Stats panel ──────────────────────────────────────────────────────────── */
.stats-kpis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stats-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-kpi-val {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stats-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.stats-pb {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding: 4px 0;
}

.stats-pb strong {
  color: var(--accent);
}

.stats-ibar-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stats-ibar-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.stats-ibar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  transition: width .4s ease;
}

.stats-ibar-label {
  font-size: 11px;
  color: var(--muted);
}

.stats-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sess-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
}

.sess-item.incomplete {
  opacity: .55;
}

.sess-date {
  color: var(--muted);
  font-size: 11px;
}

.sess-rounds {
  font-weight: 700;
  color: var(--accent);
  justify-self: end;
}

.sess-intensity {
  color: var(--muted);
}

.sess-extras {
  color: var(--accent2);
  font-size: 11px;
}

.stats-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
}

.btn-clear-stats {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  font-size: 12px;
  padding: 8px;
}

/* ── Modals ───────────────────────────────────────────────────────────────── */
.conf-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}

.conf-modal.open {
  display: flex;
}

.conf-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  max-width: 320px;
  width: 90%;
}

.conf-title {
  font-size: 17px;
  font-weight: 700;
}

.conf-desc {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.summary-rows {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row-label {
  color: var(--muted);
}

.summary-row-val {
  font-weight: 600;
}

.conf-btns {
  display: flex;
  gap: 10px;
  width: 100%;
}

.conf-btns .btn {
  flex: 1;
}

/* ── Challenge Mode specific ──────────────────────────────────────────────── */
#panel-challenge {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.ch-task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.ch-task-category {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: var(--accent2);
  font-weight: 700;
}

.ch-task-main {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.ch-task-restraint {
  font-size: 13px;
  color: var(--accent2);
  font-weight: 600;
  min-height: 0;
}

.ch-task-restraint:empty {
  display: none;
}

.ch-task-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ch-meta-item {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
}

.ch-meta-item:empty {
  display: none;
}

.ch-edge-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ch-edge-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}

.ch-edge-count {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent2);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ch-hold-timer {
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

.ch-orgasm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-align: center;
}

/* ── Kelsie page ──────────────────────────────────────────────────────────── */
#panel-kelsie {
  position: relative;
  overflow: hidden;
}

/* Slideshow layers sit behind panel content */
.k-bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
  z-index: 0;
}

.k-bg-layer.active {
  opacity: 1;
}

/* Dim gradient on top of whichever photo is showing */
#panel-kelsie::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      rgba(10, 8, 14, .46) 0%,
      rgba(10, 8, 14, .60) 60%,
      rgba(10, 8, 14, .82) 100%);
  z-index: 1;
  pointer-events: none;
}

/* All direct panel children must sit above the bg layers (exclude the layers themselves) */
#panel-kelsie>*:not(.k-bg-layer) {
  position: relative;
  z-index: 2;
}

.k-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-content: start;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 1px;
}

.k-card-full {
  grid-column: 1 / -1;
}

.k-fields::-webkit-scrollbar {
  width: 3px;
}

.k-fields::-webkit-scrollbar-track {
  background: transparent;
}

.k-fields::-webkit-scrollbar-thumb {
  background: rgba(249, 168, 212, .2);
  border-radius: 2px;
}

.k-card {
  background: rgba(18, 15, 26, .70);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 12px;
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  transition: border-color .3s, background .3s, box-shadow .3s;
}

.k-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1px;
}

.k-card-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: rgba(107, 107, 138, .9);
}

.k-card-actions {
  display: flex;
  gap: 2px;
  align-items: center;
}

.k-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 5px;
  line-height: 1;
  border-radius: 5px;
  color: rgba(107, 107, 138, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}

.k-btn:hover {
  color: rgba(226, 226, 240, .9);
  background: rgba(255, 255, 255, .06);
}

.k-btn-lock.locked {
  color: var(--accent-k);
}

.k-card-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  min-height: 20px;
  letter-spacing: -.01em;
}

.k-card-value.empty {
  color: rgba(255, 255, 255, .15);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0;
}

/* Bondage photo slot */
.k-card-photo {
  width: 240px;
  height: 240px;
  border-radius: 24px;
  overflow: hidden;
  margin: 8px auto 0;
  flex-shrink: 0;
  transition: opacity .4s ease;
}

.k-card-photo.hidden {
  display: none;
}

.k-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 24px;
}

/* Locked state */
.k-card-locked {
  border-color: rgba(192, 132, 252, .35);
  background: rgba(26, 16, 46, .78);
}

/* Verdict colouring */
.k-verdict-yes {
  border-color: rgba(52, 211, 153, .45);
  background: rgba(6, 28, 20, .80);
  box-shadow: 0 0 20px rgba(52, 211, 153, .1), inset 0 0 24px rgba(52, 211, 153, .04);
}

.k-verdict-yes .k-card-value {
  color: var(--success);
  text-shadow: 0 0 22px rgba(52, 211, 153, .45);
}

.k-verdict-no {
  border-color: rgba(244, 63, 94, .45);
  background: rgba(30, 6, 12, .80);
  box-shadow: 0 0 20px rgba(244, 63, 94, .1), inset 0 0 24px rgba(244, 63, 94, .04);
}

.k-verdict-no .k-card-value {
  color: var(--danger);
  text-shadow: 0 0 22px rgba(244, 63, 94, .45);
}

/* Start button — rose-to-purple gradient */
#btn-k-start {
  transition: opacity .2s, transform .1s, box-shadow .3s;
}

#btn-k-start:not(:disabled) {
  background: linear-gradient(125deg, var(--accent) 0%, var(--accent-k) 100%);
  color: #0e0e12;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 22px rgba(249, 168, 212, .28);
}

#btn-k-start:not(:disabled):hover {
  box-shadow: 0 6px 30px rgba(249, 168, 212, .45);
  transform: translateY(-1px);
}

/* Timer bar — rose gradient */
#k-timer .r-timer-bar {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-k) 100%);
}

/* Status pill subtle glow when connected */
.status-pill:has(.status-dot.ok) {
  border-color: rgba(52, 211, 153, .25);
}

/* Pop animation on re-roll */
@keyframes k-pop {
  0% {
    transform: scale(1);
  }

  38% {
    transform: scale(1.028);
  }

  68% {
    transform: scale(.992);
  }

  100% {
    transform: scale(1);
  }
}

.k-card-pop {
  animation: k-pop .38s cubic-bezier(.17, .67, .35, 1.15);
}

/* Pulse glow on session end */
@keyframes k-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 rgba(249, 168, 212, 0);
  }

  50% {
    box-shadow: 0 0 26px rgba(249, 168, 212, .5);
  }
}

.k-card-pulse {
  animation: k-pulse .72s ease-in-out 3;
}

/* ── Collapsed k-fields (during active session) ───────────────────────────── */
.k-fields-collapsed {
  display: none !important;
}

.k-fields-toggle-btn {
  flex-shrink: 0;
  margin-left: 2px;
  color: rgba(107, 107, 138, .7);
}

.k-fields-toggle-btn:hover {
  color: var(--accent-k);
}

/* ── Session / pattern log ────────────────────────────────────────────────── */
.k-session-log {
  display: none;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.k-session-log-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(107, 107, 138, .75);
}

.k-session-log-entries {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}

.k-log-entry {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  background: rgba(18, 15, 26, .68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 8px;
  font-size: 11px;
  flex-shrink: 0;
  animation: k-log-in .25s ease forwards;
}

@keyframes k-log-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.k-log-icon {
  font-size: 11px;
  text-align: center;
  color: var(--accent-k);
}

.k-log-info {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.k-log-intensity {
  font-weight: 700;
  color: var(--accent);
}

.k-log-time {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Preset section (settings panel) ─────────────────────────────────────── */
.k-preset-save-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.k-preset-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
  transition: border-color .15s;
}

.k-preset-input::placeholder { color: var(--muted); }

.k-preset-input:focus { border-color: var(--accent-k); }

.k-preset-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.k-preset-empty {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 6px 0;
}

.k-preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .15s;
}

.k-preset-item:hover { border-color: rgba(249, 168, 212, .3); }

.k-preset-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.k-preset-fields {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

.k-preset-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.ch-orgasm-verdict {
  font-size: 26px;
  font-weight: 700;
}

.ch-orgasm-verdict.yes {
  color: var(--success);
}

.ch-orgasm-verdict.no {
  color: var(--danger);
}

.ch-orgasm-instruction {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ── Settings page ───────────────────────────────────────────────────────── */
.settings-page {
  min-height: calc(100vh - 62px);
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
  background: radial-gradient(ellipse at 28% 0%, #1c0d24 0%, #0d0a14 52%, #0a0a12 100%);
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(18,14,28,.84);
  box-shadow: 0 16px 42px rgba(0,0,0,.22);
}

.settings-card h2 {
  margin: 2px 0 6px;
  font-size: 22px;
  line-height: 1.15;
}

.settings-card p,
.settings-option-copy,
.settings-message {
  color: rgba(255,255,255,.52);
  font-size: 13px;
  line-height: 1.45;
}

.settings-kicker {
  color: var(--accent-k);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.settings-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  background: rgba(255,255,255,.03);
}

.settings-option-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.settings-url-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-url-box code {
  display: block;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(0,0,0,.24);
  color: rgba(255,255,255,.76);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.settings-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-actions .btn {
  min-width: 140px;
  text-align: center;
  text-decoration: none;
}

.settings-message[data-tone="ok"] { color: rgb(74,222,128); }
.settings-message[data-tone="error"] { color: rgba(255,130,120,.95); }

.settings-qr {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-qr img {
  width: 132px;
  height: 132px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.settings-qr a {
  color: var(--accent-k);
  font-size: 13px;
  font-weight: 700;
}

.settings-card-muted {
  background: rgba(14,11,22,.62);
}

.settings-steps {
  margin: 0;
  padding-left: 20px;
  color: rgba(255,255,255,.58);
  font-size: 13px;
  line-height: 1.6;
}

.settings-steps code {
  color: rgba(255,255,255,.82);
}
