/* aaoo — Calls & People history (history.html). Shared tokens from app.css.
   RTL-safe: logical properties. */

.history-page {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-head { display: flex; align-items: center; gap: 8px; }
.history-title { font-size: 15px; font-weight: 700; margin: 0; flex: 1; }

/* --- Segmented tabs --------------------------------------------------------- */
.segmented {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  gap: 3px;
}
.segmented.small { padding: 2px; flex: 0 0 auto; }
.segment {
  flex: 1;
  min-height: 30px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  padding: 0 8px;
}
.segment.active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 700;
}

.history-panel { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.history-panel[hidden] { display: none; }
.empty { color: var(--muted-2); font-size: 13px; text-align: center; padding: 24px 0; }

/* --- Rows ------------------------------------------------------------------- */
.row-list { display: flex; flex-direction: column; gap: 4px; }
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.row.unlabeled { border-style: dashed; }
.row-main { flex: 1; min-width: 0; }
.row-name { font-size: 13px; font-weight: 600; color: var(--text); }
.row-name.code { color: var(--accent); font-family: var(--font-mono); font-weight: 400; }
.row-sub { font-size: 10px; color: var(--muted-2); font-family: var(--font-mono); }

/* Quality toggles */
.qtoggle {
  width: 24px; height: 24px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
  opacity: 0.45;
  padding: 0;
}
.qtoggle.on { background: var(--surface); opacity: 1; }

/* Name / link affordance on unlabeled rows */
.row-afford {
  height: 26px; padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

/* People controls */
.people-controls { display: flex; gap: 6px; align-items: center; }
.people-controls .field { flex: 1; min-height: 32px; padding: 6px 10px; font-size: 13px; }
.row-call {
  height: 28px; padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

/* --- Bottom sheet (H2 naming) ----------------------------------------------- */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10, 13, 43, 0.55);
}
.sheet-scrim[hidden] { display: none; }
.sheet-card {
  width: 100%; max-width: var(--maxw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 28px; padding: 0 10px;
  background: var(--surface);
  border: none; border-radius: 14px;
  color: var(--text); font-size: 11px; cursor: pointer;
}
.sheet-card .row .btn, .detail-card .row .btn { flex: 1; }

/* --- Person detail (H4) ----------------------------------------------------- */
.detail-scrim {
  position: fixed; inset: 0; z-index: 15;
  background: var(--bg);
  overflow-y: auto;
}
.detail-scrim[hidden] { display: none; }
.detail-card {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100dvh;
  padding: var(--gap);
  display: flex; flex-direction: column; gap: 12px;
}
.detail-head { display: flex; align-items: center; gap: 10px; }
.avatar-sm {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); font-size: 16px; font-weight: 700;
}
.detail-name { font-size: 17px; font-weight: 700; color: var(--text); }
