/* ── Variables ──────────────────────────────────────────────── */
:root {
  --bg:        #0d0d0d;
  --surface:   #161616;
  --raised:    #1e1e1e;
  --border:    #2a2a2a;
  --accent:    #e8ff47;
  --accent2:   #ff6b35;
  --text:      #f0f0f0;
  --muted:     #666;
  --danger:    #ff4444;
  --radius:    12px;
  --font-head: 'Bebas Neue', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --font-body: 'DM Sans', sans-serif;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom, 24px);
  overflow-x: hidden;
}

/* ── Header ─────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-head);
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  line-height: 1;
}

.watch-btn {
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
}
.watch-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.watch-btn.audio-active { border-color: var(--accent); color: var(--accent); }

.lock-btn {
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.lock-btn.unlocked {
  border-color: var(--accent);
  color: var(--accent);
}
.lock-btn:active { transform: scale(0.92); }

/* ── Audio strip ─────────────────────────────────────────────── */
.audio-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.audio-strip-label {
  font-size: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: opacity 0.15s;
}
.audio-strip-label:active { opacity: 0.6; }
.audio-strip input[type="range"] { flex: 1; }
.audio-strip-val {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}

/* ── Now Playing ─────────────────────────────────────────────── */
.now-playing {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.np-art {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  position: relative;
}

/* Vinyl disc */
.vinyl {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    #1a1a1a 0px,
    #111 2px,
    #1c1c1c 4px
  );
  border: 2px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.5s;
}
.vinyl.has-art {
  background-size: cover;
  background-position: center;
}
.vinyl-label {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent2);
  border: 2px solid #111;
}
.vinyl.spinning {
  animation: spin 4s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.np-info {
  flex: 1;
  min-width: 0;
}
.np-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 4px;
}
.np-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.np-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
  font-family: var(--font-mono);
}
.np-remaining {
  font-size: 0.72rem;
  color: var(--accent);
  margin-top: 5px;
  font-family: var(--font-mono);
  min-height: 1em;
}

/* ── Progress Bar ────────────────────────────────────────────── */
.progress-bar {
  height: 3px;
  background: var(--border);
}
.progress-bar[hidden] { display: none; }
.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.5s linear;
}

/* ── Add Section ─────────────────────────────────────────────── */
.add-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.input-row {
  display: flex;
  gap: 10px;
}

input[type="text"] {
  flex: 1;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
input[type="text"]:focus {
  border-color: var(--accent);
}
input[type="text"]::placeholder { color: var(--muted); }

button#searchBtn {
  background: var(--accent);
  color: #0d0d0d;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 1rem;
  letter-spacing: 0.05em;
  padding: 12px 20px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
button#searchBtn:active { opacity: 0.85; transform: scale(0.96); }

/* Search results */
.results {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.result-card:active { border-color: var(--accent); transform: scale(0.98); }
.result-card img {
  width: 52px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--border);
}
.result-info { flex: 1; min-width: 0; }
.result-title {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-meta {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}
.result-add {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.result-badges {
  display: flex;
  gap: 5px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.result-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 500;
}
.badge-fav {
  background: rgba(232, 200, 0, 0.15);
  color: #e8c800;
  border: 1px solid rgba(232, 200, 0, 0.3);
}
.badge-played {
  background: rgba(100, 180, 255, 0.12);
  color: #64b4ff;
  border: 1px solid rgba(100, 180, 255, 0.25);
}
.result-card.is-fav {
  border-color: rgba(232, 200, 0, 0.35);
}
.result-card.is-played {
  border-color: rgba(100, 180, 255, 0.25);
}

/* ── Admin Panel ─────────────────────────────────────────────── */
.admin-panel {
  padding: 14px 20px;
  background: #111;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-panel[hidden] { display: none; }

.admin-row {
  display: flex;
  gap: 10px;
}

.admin-btn {
  flex: 1;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.admin-btn:active { opacity: 0.8; transform: scale(0.97); }
.admin-btn.danger { border-color: var(--danger); color: var(--danger); }
.admin-btn.danger:active { background: #2a0000; }

.volume-row {
  align-items: center;
  gap: 10px;
}
.vol-label { font-size: 1rem; }
.vol-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}
.seek-row {
  align-items: center;
  gap: 10px;
}
.seek-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}

input[type="range"] {
  -webkit-appearance: none;
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

.admin-search-btn {
  display: none;
  font-size: 0.72rem;
  padding: 10px 10px;
  flex: 0 0 auto;
  white-space: nowrap;
}
body.admin-unlocked .admin-search-btn { display: block; }

/* ── Bluetooth ───────────────────────────────────────────────── */
.bt-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.bt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bt-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.bt-scan-btn {
  flex: 0 0 auto;
  padding: 6px 14px;
}
.bt-subtitle {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}
.bt-discovered { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.bt-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bt-empty {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.bt-device {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.bt-device.connected { border-color: var(--accent); }
.bt-device-name {
  flex: 1;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bt-device.connected .bt-device-name { color: var(--accent); }
.bt-device-btn {
  flex: 0 0 auto;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.bt-device.connected .bt-device-btn { border-color: var(--danger); color: var(--danger); }

/* ── Queue ───────────────────────────────────────────────────── */
.queue-section {
  padding: 16px 20px;
}

.queue-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.queue-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.queue-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.queue-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.auto-continue-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.auto-continue-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}
.ac-bias-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.35;
  transition: opacity 0.2s;
}
.ac-bias-wrap.active {
  opacity: 1;
}
.ac-bias-label {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1;
}
input[type="range"].ac-bias-slider {
  width: 64px;
  flex: none;
  height: 3px;
}

.queue-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Cap height and scroll internally once a list grows past 30 items, instead
   of letting the whole page grow and forcing a long scroll back to the
   controls at the top. */
.queue-list:has(> :nth-child(31)) {
  max-height: 65vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}
.queue-list::-webkit-scrollbar { width: 6px; }
.queue-list::-webkit-scrollbar-track { background: transparent; }
.queue-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.queue-pos {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 20px;
  text-align: center;
}
.queue-info { flex: 1; min-width: 0; }
.queue-track-title {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-track-meta {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}
.queue-eta {
  font-size: 0.68rem;
  color: var(--accent2);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.queue-remove-btn {
  display: none;
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--danger);
  border-radius: 6px;
  color: var(--danger);
  font-size: 0.7rem;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.queue-remove-btn:active { opacity: 1; }
body.admin-unlocked .queue-remove-btn { display: block; }

.queue-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 32px 0;
  font-family: var(--font-mono);
}

/* ── Now-playing favourite button ───────────────────────────── */
.np-fav-btn {
  display: none;
  margin-top: 7px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.15s;
}
.np-fav-btn:active { opacity: 0.7; }
.np-fav-btn.is-fav { border-color: var(--accent); color: var(--accent); }
body.admin-unlocked .np-fav-btn { display: inline-block; }

/* ── Favourites section ──────────────────────────────────────── */
.favourites-section {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.fav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}

.fav-readd-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.fav-readd-btn:active { opacity: 1; }

.fav-remove-btn {
  display: none;
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--danger);
  border-radius: 6px;
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.fav-remove-btn:active { opacity: 1; }
body.admin-unlocked .fav-remove-btn { display: block; }

/* ── History favourite button ────────────────────────────────── */
.history-fav-btn {
  display: none;
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.history-fav-btn.is-fav { border-color: var(--accent); color: var(--accent); }
.history-fav-btn:active { opacity: 0.7; }
body.admin-unlocked .history-fav-btn { display: block; }

/* ── History ─────────────────────────────────────────────────── */
.history-section {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  opacity: 0.7;
}

.history-thumb {
  flex-shrink: 0;
  width: 42px;
  height: 30px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--raised);
}
.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-played-at {
  font-size: 0.72rem;
  color: #999;
  font-family: var(--font-mono);
  margin-top: 3px;
}

.history-readd-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.history-readd-btn:active { opacity: 1; }

.history-remove-btn {
  display: none;
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--danger);
  border-radius: 6px;
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.history-remove-btn:active { opacity: 1; }
body.admin-unlocked .history-remove-btn { display: block; }

/* ── Admin-only queue header buttons ────────────────────────── */
.admin-queue-btn {
  display: none;
}
body.admin-unlocked .admin-queue-btn { display: block; }

/* ── Tabs ─────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232, 255, 71, 0.08);
}
.tab-btn:active { transform: scale(0.96); }

.tab-panel { display: none; }
.tab-panel.tab-active { display: block; }

/* ── Log ──────────────────────────────────────────────────────── */
.log-section {
  padding: 16px 20px;
}
.log-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.log-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}
.log-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.log-progress-bar {
  flex: 0 0 auto;
  width: 80px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.log-progress-fill {
  height: 100%;
  background: var(--accent2);
}
.log-progress-text {
  font-size: 0.65rem;
  color: var(--accent2);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* ── Recommendations ─────────────────────────────────────────── */
.rec-section {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.rec-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}

.rec-info { flex: 1; min-width: 0; }
.rec-title {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-meta {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}
.rec-score {
  font-size: 0.62rem;
  color: var(--accent2);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.rec-add-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.rec-add-btn:active { opacity: 1; }

.rec-next-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--accent2);
  border-radius: 6px;
  color: var(--accent2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.rec-next-btn:active { opacity: 1; }

/* ── PIN Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  width: 280px;
  text-align: center;
}

.modal-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 24px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}
.pin-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.15s;
}
.pin-dots span.filled {
  background: var(--accent);
  border-color: var(--accent);
}
.pin-dots.error span { border-color: var(--danger); background: var(--danger); }

.pin-error {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--danger);
  height: 18px;
  margin-bottom: 16px;
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.num {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  padding: 14px 0;
  cursor: pointer;
  transition: all 0.1s;
}
.num:active { background: #2a2a2a; transform: scale(0.93); }
.clear-btn { color: var(--accent2); }
.cancel-btn { color: var(--muted); }

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 10px 18px;
  border-radius: 20px;
  opacity: 0;
  transition: all 0.25s ease;
  white-space: nowrap;
  pointer-events: none;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: var(--accent); color: var(--accent); }
.toast.error   { border-color: var(--danger); color: var(--danger); }

/* ── Connection indicator ────────────────────────────────────── */
.conn-dot {
  position: fixed;
  top: 18px;
  right: 72px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s;
}
.conn-dot.connected { background: var(--accent); }
.conn-dot.error     { background: var(--danger); }

/* ── Requests / Tickets tab ─────────────────────────────────── */
.notes-section { padding: 0 0 16px; }
.notes-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.notes-area {
  display: block;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 0;
}
.notes-area:focus { border-color: var(--accent); }
.ticket-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 16px;
}
.ticket-submit-btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.ticket-submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ticket-list { margin-top: 8px; }
.ticket-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.ticket-item:last-child { border-bottom: none; }
.ticket-body { flex: 1; min-width: 0; }
.ticket-text {
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 4px;
}
.ticket-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.ticket-delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.ticket-delete-btn:hover { color: var(--danger); }
