/* Track E: theme/motion, swipe rows, search, settings additions.
   Link after motion.css in index.html. */

/* ---------- dark theme ---------- */
:root[data-theme="dark"] {
  --bg: #1B1A20;
  --surface: #232228;
  --raised: #2A2931;
  --ink: #F1EDE8;
  --text: #F1EDE8;
  --muted: #A79EA6;
  --faint: #7C747C;
  --divider: #34333B;
  --border: rgba(241, 237, 232, 0.12);
  --border-strong: rgba(241, 237, 232, 0.22);
  --violet: #B9A8F5;
  --violet-deep: #B9A8F5;
  --amber-tint: #3A2E12;
  --bg-grad: linear-gradient(135deg, #26222b 0%, #211e28 48%, #1c2422 100%);
}

/* ---------- reduced motion ---------- */
:root[data-motion="reduced"] *,
:root[data-motion="reduced"] *::before,
:root[data-motion="reduced"] *::after {
  animation: none !important;
  transition: none !important;
}

/* ---------- swipe rows ---------- */
.swipe-row {
  position: relative;
  touch-action: pan-y; /* let the page scroll vertically, we own horizontal */
  user-select: none;
  -webkit-user-select: none;
}
.swipe-row.swiping {
  transition: none;
}
.swipe-row.swiping.swipe-left-hint {
  background: var(--amber-tint);
}
.swipe-row.swiping.swipe-right-hint {
  background: rgba(20, 169, 149, 0.12);
}

/* ---------- search ---------- */
.search-wrap {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-bar .field {
  flex: 1;
  min-width: 0;
}
.search-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-section-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}
.search-row {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}
.search-row:active {
  transform: scale(0.99);
}
.search-row-title {
  display: block;
  font-weight: 600;
  color: var(--text);
}
.search-row-meta {
  display: block;
  margin-top: 2px;
}
.search-row-snippet {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.875rem;
}
.search-empty {
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

/* ---------- settings additions ---------- */
.danger-zone {
  border: 1px solid rgba(217, 74, 145, 0.35);
  border-radius: 12px;
  padding: 12px;
}
.btn-danger {
  background: #D94A91;
  color: #fff;
  border: 1px solid #D94A91;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger:active {
  transform: scale(0.98);
}

/* ---------- capture-bar voice listening state ---------- */
[data-action="cb-voice"].listening {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
}
