/* ============================================================================
   ATLAS REDESIGN — Voice Inbox screen styles  ·  Phase 2 (Wave 2E)
   Branch: atlas-redesign-2026-06-29

   Prefix: .rd-voice. Tokens only (--r-*) so Calm (almanac) + Operator themes
   both work automatically. No hardcoded hex. Theme-specific selectors
   (html[data-rtheme="operator"] …) only where a token can't express the tweak.
   ========================================================================== */

.rd-voice {
  font-family: var(--r-font-body);
  color: var(--r-body);
  padding: var(--r-gutter);
  max-width: var(--r-page-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---- header row ---------------------------------------------------------- */
.rd-voice-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.rd-voice-head-l {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rd-voice-eyebrow {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--r-clay);
}
.rd-voice-h1 {
  font-family: var(--r-font-display);
  font-size: var(--r-fs-h1);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--r-ink);
  margin: 0;
}

/* filter pill group (All / Needs callback / Handled) */
.rd-voice-filter {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--r-well);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-control);
  padding: 3px;
}
.rd-voice-pill {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--r-faint);
  font-family: var(--r-font-body);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  padding: 7px 13px;
  border-radius: calc(var(--r-radius-control) - 3px);
  cursor: pointer;
  transition: color var(--r-dur) var(--r-ease),
              background var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease);
}
.rd-voice-pill:hover { color: var(--r-body); }
.rd-voice-pill.is-active {
  background: var(--r-surface);
  color: var(--r-primary);
  font-weight: 600;
  box-shadow: var(--r-shadow-card);
}
.rd-voice-pill:focus-visible { outline: var(--r-focus); outline-offset: 2px; }

/* ---- main grid (list | side) --------------------------------------------- */
.rd-voice-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: start;
  min-height: 0;
}

/* ---- list card (left) ---------------------------------------------------- */
.rd-voice-list {
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-card);
  box-shadow: var(--r-shadow-card);
  padding: 4px 20px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  max-height: calc(100vh - 200px);
}

/* one voice item */
.rd-voice-item {
  display: flex;
  gap: 13px;
  padding: 15px 4px;
  border-top: 1px solid var(--r-hairline);
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease),
              transform var(--r-dur) var(--r-ease);
}
.rd-voice-item:first-child { border-top: none; }
.rd-voice-item:hover {
  background: var(--r-canvas-raised);
  box-shadow: var(--r-shadow-hover);
  transform: translateY(-2px);
}
.rd-voice-item:focus-visible { outline: var(--r-focus); outline-offset: 2px; }

/* round status icon */
.rd-voice-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--r-well);
  color: var(--r-muted);
}
.rd-voice-icon i { font-size: 18px; }
.rd-voice-icon[data-kind="call"] {
  background: color-mix(in srgb, var(--r-clay) 18%, transparent);
  color: var(--r-clay-2);
}
.rd-voice-icon[data-kind="voicemail"] {
  background: var(--r-mint-surface);
  color: var(--r-mint-ink);
}
.rd-voice-icon[data-kind="handled"] {
  background: var(--r-mint-surface);
  color: var(--r-primary);
}
.rd-voice-icon[data-kind="handled"] i { font-size: 17px; }

/* item body */
.rd-voice-body {
  flex: 1 1 auto;
  min-width: 0;
}
.rd-voice-toprow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.rd-voice-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--r-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rd-voice-meta {
  flex: 0 0 auto;
  font-family: var(--r-font-mono);
  font-size: 12px;
  color: var(--r-faint);
  white-space: nowrap;
}
.rd-voice-summary {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--r-body);
  margin-top: 3px;
}
.rd-voice-summary--empty {
  font-family: var(--r-font-mono);
  color: var(--r-faint);
}

/* actions row (status pill + text actions) */
.rd-voice-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
}
.rd-voice-status {
  font-family: var(--r-font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .04em;
  border-radius: var(--r-radius-pill);
  padding: 2px 8px;
  background: var(--r-well);
  color: var(--r-muted);
}
.rd-voice-status[data-tone="alert"] {
  background: color-mix(in srgb, var(--r-alert) 16%, transparent);
  color: var(--r-alert);
}
.rd-voice-status[data-tone="mint"] {
  background: var(--r-mint-surface);
  color: var(--r-mint-ink);
}
.rd-voice-status[data-tone="good"] {
  background: color-mix(in srgb, var(--r-good) 16%, transparent);
  color: var(--r-good);
}

/* N0b (2026-07-03): transcript text is selectable inside the clickable row */
.rd-voice-summary,
.rd-voice-name,
.rd-voice-tx-empty {
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}

/* N0b (2026-07-03): per-row copy button — reads like a text action */
.rd-voice-copy {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  font-family: var(--r-font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--r-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--r-dur) var(--r-ease);
}
.rd-voice-copy:hover { color: var(--r-ink); }
.rd-voice-copy:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-voice-copy i { font-size: 12px; vertical-align: -1px; }
.rd-voice-copy.is-copied { color: var(--r-good); }

/* text actions */
.rd-voice-act {
  font-size: 12px;
  font-weight: 600;
  color: var(--r-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--r-dur) var(--r-ease);
}
.rd-voice-act:hover { color: var(--r-ink); }
.rd-voice-act--primary { color: var(--r-primary); }
.rd-voice-act--primary:hover { color: var(--r-primary-2); }
.rd-voice-act i { font-size: 12px; vertical-align: -1px; }

/* list empty state (honest, dashed) */
.rd-voice-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-meta);
  letter-spacing: .03em;
  color: var(--r-faint);
  text-align: center;
  padding: 44px 16px;
  border: 1px dashed var(--r-border);
  border-radius: var(--r-radius-control);
  margin: 12px 2px;
}
.rd-voice-empty i { font-size: 26px; opacity: .8; }

/* ---- side column --------------------------------------------------------- */
.rd-voice-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* overnight stat card */
.rd-voice-overnight {
  background: var(--r-surface);
  border: 1px solid color-mix(in srgb, var(--r-primary) 24%, var(--r-border));
  border-radius: var(--r-radius-card);
  box-shadow: var(--r-shadow-card);
  padding: 18px 22px;
}
.rd-voice-overnight-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.rd-voice-overnight-head i { color: var(--r-primary); font-size: 15px; }
.rd-voice-overnight-head h2 {
  margin: 0;
  font-family: var(--r-font-display);
  font-size: var(--r-fs-h2);
  font-weight: 600;
  color: var(--r-ink);
}
.rd-voice-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--r-hairline);
  font-size: 13px;
}
.rd-voice-stat:first-of-type { margin-top: 8px; }
.rd-voice-stat-label { color: var(--r-body); }
.rd-voice-stat-value {
  font-family: var(--r-font-mono);
  font-weight: 600;
  color: var(--r-ink);
}
.rd-voice-stat-value[data-tone="good"]  { color: var(--r-good); }
.rd-voice-stat-value[data-tone="alert"] { color: var(--r-clay-2); }

/* transcript card */
.rd-voice-transcript {
  background: var(--r-surface-2);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-card);
  padding: 18px 20px;
}
.rd-voice-tx-eyebrow {
  font-family: var(--r-font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--r-faint);
  margin-bottom: 10px;
}
.rd-voice-tx-empty {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--r-muted);
}

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 980px) {
  .rd-voice-grid { grid-template-columns: 1fr; }
  .rd-voice-list { max-height: 52vh; }
}
@media (max-width: 720px) {
  .rd-voice-meta { display: none; }
}
