/* References app — uses design-kit tokens from lib/design-kit/src/tokens.css */

/* ── Token aliases (map legacy names to design-kit) ── */
:root {
  --bg-1: var(--surface);     /* white panels/cards */
  --bg-2: var(--bg);          /* page background */
  --border: var(--line);      /* borders/dividers */
  --r8: var(--r1);            /* design-kit uses r0/r1/r2 */
  --r4: var(--r1);
}

/* ── Metric cards ── */
.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: var(--s12);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.metric-card-label {
  font-size: var(--t-12);
  color: var(--ink-3);
  font-weight: 500;
}

.metric-card-value {
  font-size: var(--t-17);
  font-weight: 700;
}

/* ── Clickable table rows ── */
.table-row-clickable:hover td {
  background: var(--bg);
}

/* ── Heatmap ── */
.heatmap-container {
  padding: var(--s8) var(--s12);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r1);
}

.heatmap-tooltip {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r1);
  padding: 6px var(--s8);
  font-size: var(--t-11);
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  max-width: 220px;
}

/* ── Badge variants ── */
.badge-direction {
  background-color: var(--accent-dim);
  color: var(--accent);
}

.badge-clickable {
  cursor: pointer;
}

.badge-clickable:hover {
  opacity: 0.85;
}

.badge-sm {
  font-size: var(--t-11);
  padding: 2px 6px;
}

/* ── Stat pills (inline KPI tags next to section titles) ── */
.stat-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--t-11);
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r2);
  white-space: nowrap;
}

/* ── Sort select — fully overrides native OS chrome ── */
.sort-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: var(--font);
  font-size: var(--t-11);
  font-weight: 500;
  color: var(--ink-1);
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: 4px 24px 4px 8px;
  cursor: pointer;
  outline: none;
  min-width: 130px;
  line-height: 1.4;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L4 4L7 1' stroke='%239a9a96' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--dt-fast);
}

.sort-select:focus {
  border-color: var(--accent);
}

.sort-select:hover {
  border-color: var(--line-strong);
}

.sort-btn {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font);
  font-size: var(--t-11);
  font-weight: 700;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: 4px 7px;
  cursor: pointer;
  line-height: 1;
  transition: border-color var(--dt-fast);
}

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

/* ── Truncated cell with hover-to-expand overlay ── */
.cell-trunc {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  cursor: default;
}
.cell-trunc:hover::after {
  content: attr(data-full);
  position: absolute;
  left: -6px;
  top: -3px;
  padding: 3px 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  z-index: 50;
  color: var(--ink-1);
  font: inherit;
  pointer-events: none;
}

/* ── AI Panel ── */
.ai-panel {
  transition: border-color var(--dt-mid) var(--ease);
}

.ai-panel:hover {
  border-color: var(--accent);
}

/* AI rendered markdown */
.ai-result {
  font-size: var(--t-13);
  line-height: 1.6;
  color: var(--ink-2);
}

.ai-result h2, .ai-result h3, .ai-result h4 {
  font-weight: 600;
  color: var(--ink-1);
  margin: var(--s8) 0 var(--s4);
}

.ai-result h2 { font-size: var(--t-15); }
.ai-result h3 { font-size: var(--t-14); }
.ai-result h4 { font-size: var(--t-13); }

.ai-result p {
  margin: 0 0 var(--s4);
}

.ai-result strong {
  font-weight: 600;
  color: var(--ink-1);
}

.ai-result ul, .ai-result ol {
  margin: var(--s4) 0;
  padding-left: var(--s16);
}

.ai-result li {
  margin-bottom: 2px;
}

.ai-result li::marker {
  color: var(--ink-3);
}

/* ── Detail rows ── */
.detail-row {
  display: flex;
  gap: var(--s8);
  font-size: var(--t-13);
  padding: var(--s4) 0;
}

.detail-row-label {
  color: var(--ink-3);
  min-width: 120px;
  font-weight: 500;
}

/* ── BSP section cards ── */
.bsp-section-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: var(--s12) var(--s16);
}

/* ── Monthly summary — visual month grouping ── */
.month-group-first td {
  padding-top: var(--s8);
}

.month-separator td {
  border-top: 1px solid var(--line);
}

/* ── Timeline ── */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--line);
  margin-left: var(--s8);
  padding-left: var(--s16);
}

.timeline-event {
  display: flex;
  gap: var(--s12);
  padding: var(--s8) 0;
  position: relative;
}

.timeline-event::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--s16) - 5px);
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--line);
}

.timeline-event-icon {
  font-size: var(--t-14);
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.timeline-event-body {
  flex: 1;
  min-width: 0;
}

.timeline-event-header {
  display: flex;
  align-items: center;
  gap: var(--s8);
  margin-bottom: 2px;
}

.timeline-event-date {
  font-size: var(--t-12);
  color: var(--ink-3);
  font-weight: 500;
}

.timeline-event-title {
  font-size: var(--t-13);
  font-weight: 500;
}

.timeline-event-desc {
  font-size: var(--t-12);
  color: var(--ink-3);
  margin-top: 2px;
  line-height: 1.4;
}

/* ── Clickable metric cards ── */
.metric-card--clickable {
  cursor: pointer;
  transition: border-color var(--dt-fast) var(--ease);
}

.metric-card--clickable:hover {
  border-color: var(--accent);
}

.metric-card--expanded {
  border-color: var(--accent);
}

.metric-card__title {
  font-size: var(--t-13);
  font-weight: 600;
  color: var(--ink-1);
}

.metric-card__desc {
  font-size: var(--t-11);
  color: var(--ink-3);
}

.metric-card__values {
  display: flex;
  align-items: baseline;
  gap: var(--s16);
}

.metric-card__primary {
  font-size: var(--t-17);
  font-weight: 700;
  color: var(--ink-1);
}

.metric-card__secondary {
  font-size: var(--t-14);
  font-weight: 600;
  color: var(--ink-2);
}

.metric-card__secondary-label {
  display: block;
  font-size: var(--t-11);
  font-weight: 400;
  color: var(--ink-3);
}

/* ── Absence card rows ── */
.absence-row {
  display: flex;
  align-items: center;
  gap: var(--s8);
  font-size: var(--t-13);
  padding: 2px 0;
}

.absence-row__label {
  min-width: 90px;
  font-weight: 500;
  color: var(--ink-2);
}

.absence-row__count {
  font-weight: 600;
  color: var(--ink-1);
  min-width: 40px;
}

.absence-row__remaining {
  font-size: var(--t-11);
  font-weight: 500;
}

/* ── Trend card ── */
.trend-points {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--s4);
}

.trend-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.trend-point__label {
  font-size: var(--t-10);
  color: var(--ink-3);
  font-weight: 500;
}

.trend-point__value {
  font-size: var(--t-14);
  font-weight: 600;
  color: var(--ink-1);
}

.trend-line {
  position: relative;
  height: 24px;
  margin: var(--s4) 0;
}

.trend-line__svg {
  width: 100%;
  height: 100%;
}

/* ── Expanded detail panel ── */
.metric-detail-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: var(--s16);
  display: flex;
  flex-direction: column;
  gap: var(--s8);
}

.metric-detail-panel__title {
  font-size: var(--t-14);
  font-weight: 600;
  color: var(--ink-1);
}

/* ── Weekly bars chart ── */
.weekly-bars {
  padding-top: var(--s4);
  position: relative;
}

.weekly-bars__tooltip {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r1);
  padding: var(--s8) var(--s12);
  font-size: var(--t-11);
  color: var(--ink-2);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  z-index: 50;
  line-height: 1.5;
}

.weekly-bars__tooltip strong {
  color: var(--ink-1);
  font-weight: 600;
}

.weekly-bars__tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s16);
}

.weekly-bars__tooltip-label {
  color: var(--ink-3);
}

[data-theme="dark"] .weekly-bars__tooltip {
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.weekly-bars__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s12);
  margin-top: var(--s8);
  padding-top: var(--s4);
  font-size: var(--t-11);
  color: var(--ink-2);
}

.weekly-bars__legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--s4);
}

.weekly-bars__legend-swatch {
  display: inline-block;
  width: 12px;
  height: 10px;
  border-radius: 2px;
}

.weekly-bars__legend-tick {
  display: inline-block;
  width: 14px;
  height: 0;
  border-top: 2px solid var(--ink-1);
  margin: 4px 0;
}

.weekly-bars__legend-target {
  margin-left: auto;
  color: var(--ink-3);
  font-style: italic;
}

/* ── Participant header ── */
.participant-header {
  margin-bottom: var(--s16);
  display: flex;
  flex-direction: column;
  gap: var(--s12);
}

.participant-header__name {
  font-size: var(--t-20);
  font-weight: 700;
  color: var(--ink-1);
  margin: 0;
  line-height: 1.2;
}

/* ── Overview layout (single column, full width) ── */
.overview-layout {
  display: flex;
  flex-direction: column;
  gap: var(--s16);
}

/* ── Measure banner (spanning top block) ── */
.measure-banner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: var(--s12) var(--s16);
  display: flex;
  flex-direction: column;
  gap: var(--s8);
}

.measure-banner__info {
  display: flex;
  align-items: center;
  gap: var(--s8);
  flex-wrap: wrap;
}

.measure-banner__type {
  font-size: var(--t-14);
  font-weight: 600;
  color: var(--ink-1);
}

.measure-banner__mandant {
  font-size: var(--t-12);
  color: var(--ink-2);
}

.measure-banner__contract {
  font-size: var(--t-11);
  color: var(--ink-3);
  font-family: var(--font-mono);
}

.measure-banner__progress {
  width: 100%;
}

/* ── Overview body (details left, BSP right) ── */
.overview-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--s16);
  align-items: start;
}

.overview-body__left {
  display: flex;
  flex-direction: column;
  gap: var(--s12);
}

.overview-body--single {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .overview-body { grid-template-columns: 1fr; }
  .measure-banner { flex-direction: column; align-items: stretch; }
}

/* ── KPI Row ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--surface);
}

.kpi-card {
  padding: var(--s12) var(--s16);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  border-right: 1px solid var(--line);
  transition: background-color var(--dt-fast) var(--ease);
}

.kpi-card:last-child {
  border-right: none;
}

.kpi-card:hover {
  background-color: var(--bg);
}

.kpi-card--expanded {
  background-color: var(--accent-dim);
}

.kpi-card__label {
  font-size: var(--t-10);
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.kpi-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s8);
  flex: 1;
}

.kpi-card__value {
  font-size: var(--t-20);
  font-weight: 700;
  color: var(--ink-1);
  line-height: 1.1;
}

.kpi-card__value--lg {
  font-size: 1.375rem;
}

.kpi-card__suffix {
  font-size: var(--t-13);
  color: var(--ink-3);
  font-weight: 400;
  margin-left: var(--s8);
}

.kpi-card__delta {
  font-size: var(--t-11);
  font-weight: 500;
  margin-top: 2px;
}

.kpi-card__delta--up { color: var(--ok); }
.kpi-card__delta--down { color: var(--err); }
.kpi-card__delta--stable { color: var(--ink-3); }

.kpi-card__sub {
  font-size: var(--t-11);
  color: var(--ink-3);
  margin-top: 2px;
}

/* ── Absence KPI (compact rows inside KPI card) ── */
.absence-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: var(--s4);
}

.absence-kpi__row {
  display: flex;
  align-items: baseline;
  gap: var(--s4);
  font-size: var(--t-11);
}

.absence-kpi__label {
  color: var(--ink-3);
  font-weight: 500;
  min-width: 56px;
}

.absence-kpi__val {
  font-weight: 700;
  color: var(--ink-1);
  min-width: 24px;
}

.absence-kpi__val--alert {
  color: var(--err);
}

.absence-kpi__detail {
  color: var(--ink-3);
  font-size: var(--t-10);
}

/* ── Sidebar cards ── */
.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: var(--s12) var(--s16);
  display: flex;
  flex-direction: column;
  gap: var(--s8);
}

.sidebar-card__header {
  font-size: var(--t-10);
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: var(--s8);
}

/* ── BSP card (always visible) ── */
.bsp-card {
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
  overflow: hidden;
}

.bsp-card__header {
  padding: var(--s12) var(--s16);
  font-size: var(--t-14);
  font-weight: 600;
  color: var(--ink-1);
  border-bottom: 1px solid var(--line);
}

.bsp-card__body {
  padding: 0;
}

.bsp-field-row {
  display: grid;
  grid-template-columns: 24px 120px 1fr;
  gap: var(--s8);
  align-items: baseline;
  font-size: var(--t-13);
  padding: var(--s8) var(--s16);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 40%, transparent);
}

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

.bsp-field-row__icon {
  font-size: var(--t-13);
  text-align: center;
  color: var(--ink-3);
  opacity: 0.5;
}

.bsp-field-row__label {
  font-size: var(--t-12);
  font-weight: 500;
  color: var(--ink-3);
}

.bsp-field-row__value {
  color: var(--ink-1);
  min-width: 0;
}

.bsp-field-row--warn {
  background: var(--warn-dim);
  margin: 0;
  padding: var(--s8) var(--s16);
}

/* ── Measure progress bar ── */
.measure-progress {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.measure-progress__bar {
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  overflow: hidden;
}

.measure-progress__fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r1);
  transition: width 0.4s ease;
}

.measure-progress__labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--t-10);
  color: var(--ink-3);
}

.measure-progress__elapsed {
  font-size: var(--t-11);
  color: var(--ink-3);
  text-align: center;
}

/* ── Contact avatar ── */
.contact-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-11);
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: var(--s8);
  padding: var(--s4) 0;
}

.contact-row__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-row__name {
  font-size: var(--t-13);
  font-weight: 500;
  color: var(--ink-1);
}

.contact-row__role {
  font-size: var(--t-11);
  color: var(--ink-3);
}

/* ── Objective pills ── */
.objective-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) var(--s8);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  font-size: var(--t-12);
  color: var(--ink-2);
  font-weight: 500;
}

/* ── Personal info rows ── */
.info-row {
  display: flex;
  align-items: baseline;
  gap: var(--s8);
  font-size: var(--t-13);
  padding: var(--s4) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}

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

.info-row__label {
  min-width: 80px;
  color: var(--ink-3);
  font-weight: 500;
  font-size: var(--t-12);
  flex-shrink: 0;
}

.info-row__value {
  color: var(--ink-1);
}

.info-row__value a {
  color: var(--accent);
  text-decoration: none;
}

.info-row__value a:hover {
  text-decoration: underline;
}

/* ── Goal entries ── */
.goal-entry {
  font-size: var(--t-12);
  color: var(--ink-2);
  padding: var(--s4) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}

.goal-entry:last-child { border-bottom: none; }

.goal-entry__date {
  font-weight: 600;
  color: var(--ink-1);
  font-size: var(--t-11);
}

.goal-entry__author {
  color: var(--ink-3);
  font-size: var(--t-11);
}

.goal-entry__content {
  margin-top: 2px;
  line-height: 1.4;
}

/* ── Evaluation bars ── */
.eval-section {
  margin-top: var(--s8);
  padding-top: var(--s8);
  border-top: 1px solid var(--line);
}

.eval-section__count {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.eval-bar {
  display: flex;
  align-items: center;
  gap: var(--s8);
}

.eval-bar__label {
  width: 80px;
  flex-shrink: 0;
  font-size: var(--t-11);
  font-weight: 500;
  color: var(--ink-3);
}

.eval-bar__track {
  flex: 1;
  height: 6px;
  background: var(--bg-inset);
  border-radius: var(--r1);
  overflow: hidden;
}

.eval-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r1);
}

.eval-bar__score {
  width: 24px;
  flex-shrink: 0;
  font-size: var(--t-11);
  font-weight: 600;
  color: var(--ink-1);
  text-align: right;
}

/* ── Info tooltip ── */
.infotip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-3);
  cursor: help;
  position: relative;
  flex-shrink: 0;
  user-select: none;
  text-transform: none;
  letter-spacing: 0;
  transition: border-color var(--dt-fast), color var(--dt-fast);
}

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

.infotip__popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 300px;
  padding: var(--s12);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  font-size: var(--t-12);
  font-weight: 400;
  color: var(--ink-2);
  line-height: 1.55;
  white-space: pre-line;
  text-transform: none;
  letter-spacing: 0;
  z-index: 200;
}

.infotip__popup--left {
  left: auto;
  right: 0;
}

[data-theme="dark"] .infotip__popup {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* ── Empty text placeholder ── */
.empty-text {
  font-size: var(--t-12);
  color: var(--ink-3);
  margin: 0;
}

/* ── Weekly bars empty state ── */
.weekly-bars__empty {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: var(--t-12);
}

/* ── Contact avatar role variants ── */
.contact-avatar--ok {
  background: var(--ok-dim);
  color: var(--ok);
}

.contact-avatar--neutral {
  background: var(--bg-inset);
  color: var(--ink-3);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .kpi-row { grid-template-columns: 1fr; }
}

/* ── Notification bell (notification-kit) ── */
/* ── Role toggle (iPhone-style square switch) ────────────────────────
   Used as the Admin/Responsable activator next to the bell. ON =
   admin/responsable scope (full domain view), OFF = RM scope (own
   portfolio only). Square knob slides between the two rails. Inner
   shadow + knob shadow give it tactile depth.
   ─────────────────────────────────────────────────────────────────── */

.role-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.role-toggle-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.role-toggle-label--clickable {
  cursor: pointer;
  transition: color var(--dt-fast);
}
.role-toggle-label--clickable:hover {
  color: var(--accent);
}

/* ── Lens picker (topbar dropdown that scopes the user's view) ───────── */
.lens-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lens-picker__label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.lens-picker__label--clickable {
  cursor: pointer;
  transition: color var(--dt-fast);
}
.lens-picker__label--clickable:hover {
  color: var(--accent);
}
.lens-picker__select {
  height: 24px;
  padding: 0 22px 0 8px;
  font: inherit;
  font-size: var(--t-12);
  color: var(--ink-1);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r1);
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 11px) 50%, calc(100% - 7px) 50%;
  background-size: 4px 4px;
  background-repeat: no-repeat;
  transition: border-color var(--dt-fast), box-shadow var(--dt-fast);
}
.lens-picker__select:hover {
  border-color: var(--ink-3);
}
.lens-picker__select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.role-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r1);
  background: var(--bg-inset);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dt-fast), border-color var(--dt-fast);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}
.role-toggle:hover {
  border-color: var(--ink-3);
}
.role-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Knob — uniform 2px gap on all three sides (top, bottom, and active side).
   Slide travel = inner_width(36) − knob_width(16) − 2 (left gap) − 2 (right gap) = 16px. */
.role-toggle::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f4f1 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--r1);
  box-sizing: border-box;
  transition: transform 180ms cubic-bezier(0.4, 0.0, 0.2, 1),
              background var(--dt-fast),
              border-color var(--dt-fast);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .role-toggle::before {
  background: linear-gradient(180deg, #4a4a47 0%, #2e2e2b 100%);
}

/* ON: accent-tinted track, knob slid right */
.role-toggle--on {
  background: var(--accent);
  border-color: var(--accent-hover);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.role-toggle--on::before {
  transform: translateX(16px);
  border-color: var(--accent-hover);
}

/* OFF: knob on the left, track dim */
.role-toggle--off::before {
  transform: translateX(0);
}

.notification-bell {
  position: relative;
}

.notification-bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--ink-2);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r1);
  transition: color 0.15s;
}
.notification-bell-btn:hover {
  color: var(--ink-1);
  background: var(--bg-inset);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--err);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 200;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .notification-dropdown {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.notification-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s12) var(--s16);
  border-bottom: 1px solid var(--line);
}

.notification-dropdown-title {
  font-weight: 600;
  font-size: var(--t-13);
  color: var(--ink-1);
}

.notification-dropdown-list {
  overflow-y: auto;
  flex: 1;
}

.notification-empty {
  padding: var(--s32) var(--s16);
  text-align: center;
  color: var(--ink-3);
  font-size: var(--t-13);
}

.notification-item {
  padding: var(--s12) var(--s16);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.1s;
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: var(--bg-inset); }

.notification-item--unread {
  background: var(--accent-dim);
}
.notification-item--unread:hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}

.notification-item-title {
  font-weight: 600;
  font-size: var(--t-13);
  color: var(--ink-1);
  margin-bottom: 2px;
}

.notification-item-body {
  font-size: var(--t-12);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-item-time {
  font-size: var(--t-11);
  color: var(--ink-3);
  margin-top: 4px;
}
