/* QRIL Header Actions — Activities button + combined sound mute/unmute (Unbenannt 14).
 * Monochrome shell; color only for status semantics (matches the bell/LIVE header buttons).
 * Injected globally via HeaderActionsMiddleware.
 */

.qrl-ha-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* ACTIVITY pill button (mirrors the LIVE indicator's metrics) */
.qrl-ha-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  margin-right: 8px;
  border: 1px solid var(--color-border-subtle, #262C33);
  border-radius: var(--radius-control, 6px);
  background: transparent;
  color: var(--color-text-secondary, #8b949e);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.qrl-ha-btn svg { display: block; }
.qrl-ha-btn:hover {
  color: var(--color-text-primary, #e6edf3);
  border-color: var(--color-accent, #C9CDD3);
  background: var(--color-surface-hover, #21262d);
}
.qrl-ha-btn:focus-visible { outline: none; border-color: var(--color-accent, #C9CDD3); }

.qrl-ha-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--status-error, #C56B70);
  color: #0B0D0F;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  display: none;
}

/* Sound mute/unmute button (one button for all three voice categories) */
.qrl-ha-sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 8px;
  border: 1px solid var(--color-border-subtle, #262C33);
  border-radius: var(--radius-control, 6px);
  background: transparent;
  color: var(--color-text-secondary, #8b949e);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.qrl-ha-sound svg { display: block; }
.qrl-ha-sound:hover {
  color: var(--color-text-primary, #e6edf3);
  border-color: var(--color-accent, #C9CDD3);
  background: var(--color-surface-hover, #21262d);
}
.qrl-ha-sound:focus-visible { outline: none; border-color: var(--color-accent, #C9CDD3); }
.qrl-ha-sound.on {
  color: var(--color-accent-positive, #62A67B);
  border-color: rgba(98, 166, 123, 0.5);
}

/* Activities dropdown */
.qrl-ha-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 24px);
  background: var(--color-surface-secondary, var(--bg2, #171B20));
  border: 1px solid var(--color-border-strong, var(--border, #39414A));
  border-radius: var(--radius-modal, 8px);
  box-shadow: var(--shadow-modal, 0 4px 16px rgba(0, 0, 0, 0.5));
  display: none;
  z-index: 9999;
  overflow: hidden;
}
.qrl-ha-pop.open { display: block; }

.qrl-ha-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border-subtle, var(--border, #262C33));
}
.qrl-ha-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary, var(--text2, #B3BAC2));
}

.qrl-ha-list {
  max-height: 360px;
  overflow-y: auto;
}

.qrl-ha-row {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 9px 14px;
  border: none;
  border-bottom: 1px solid var(--color-border-subtle, var(--border, #262C33));
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.qrl-ha-row:hover { background: var(--color-surface-hover, var(--bg3, #242A31)); }
.qrl-ha-row:last-child { border-bottom: none; }

.qrl-ha-row-top { display: flex; align-items: center; gap: 8px; }
.qrl-ha-type {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary, var(--text, #F2F4F6));
  text-transform: capitalize;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qrl-ha-status {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}
.qrl-ha-status.completed, .qrl-ha-status.done { color: var(--status-success, #62A67B); background: rgba(98, 166, 123, 0.14); }
.qrl-ha-status.pending, .qrl-ha-status.open, .qrl-ha-status.review { color: var(--status-warning, #C2A25C); background: rgba(194, 162, 92, 0.14); }
.qrl-ha-status.in_progress, .qrl-ha-status.in-progress { color: var(--color-accent-info, #9AA2AB); background: rgba(154, 162, 171, 0.14); }
.qrl-ha-status.failed, .qrl-ha-status.blocked { color: var(--status-error, #C56B70); background: rgba(197, 107, 112, 0.16); }

.qrl-ha-msg {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted, var(--text2, #7F8892));
  line-height: 1.35;
  margin-top: 3px;
}
.qrl-ha-time {
  display: block;
  font-size: 10px;
  color: var(--color-text-disabled, #59616A);
  margin-top: 2px;
}

.qrl-ha-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--color-border-subtle, var(--border, #262C33));
}
.qrl-ha-viewall {
  font-size: 11px;
  color: var(--color-accent, #C9CDD3);
  text-decoration: none;
}
.qrl-ha-viewall:hover { text-decoration: underline; }

.qrl-ha-state {
  padding: 20px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted, var(--text2, #7F8892));
}

/* ── Enge/schmale Kopfzeile: BEIDE Header-Popover auf denselben Platz ─────────
 * Unter 520 px sitzen die beiden Panels rechtsbuendig neben zwei Buttons, die
 * nur noch ~100 px auseinander liegen — und die Glocke schob ihr Panel bisher
 * mit `right:-160px` ueber den rechten Rand hinaus (gemessen: Panel-Rechtskante
 * 1253 px bei 460 px Fensterbreite). Diese Regel gibt der Activity-Liste UND der
 * Glocke denselben, am Fenster ausgerichteten Platz: sie koennen sich dadurch
 * weder gegenseitig ueberdecken noch aus dem Bild laufen. (Das Gegenstueck fuer
 * die Glocke steht in notification-bell.css — dort ohne eigenes `right`.) */
@media (max-width: 520px) {
  .qrl-ha-pop,
  .qrl-nb-pop {
    position: fixed;
    /* Unter den Buttons der Kopfzeile (die dort bei y≈49–81 px stehen), NICHT
     * unter dem ganzen Band: das Band ist auf schmalen Fenstern bis 220 px hoch
     * (Carousel + Radar) und ein Popover an seiner Unterkante haette 130 px
     * Luft. */
    top: 92px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
  }
}
