/* A11y helper */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------
   Audit base
   ------------------------------------------------------------ */
.audit-skin {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans",
    "Helvetica Neue", Arial, sans-serif;
  color: #e6e8ef;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.35;
}

.audit-skin table {
  border-collapse: collapse;
  width: 100%;
}

.audit-skin th,
.audit-skin td {
  padding: 8px 10px;
  border-bottom: 1px solid #23283a;
  text-align: left;
}

.audit-skin th {
  background: #151926;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: pre-line;
}

.audit-skin td {
  font-size: 14px;
  line-height: 1.35;
}

.audit-skin tr:hover {
  background: #141a2a;
}

.audit-skin .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.audit-skin .num {
  text-align: left;
  font-variant-numeric: tabular-nums;
}

/* Ratio colors */
.ratio-na {
  color: #9aa3b2;
}

.ratio-good {
  color: #00e676;
}

.ratio-warn {
  color: #f4e900;
}

.ratio-bad {
  color: #ff5252;
}

.col-last {
  white-space: nowrap;
  min-width: 120px;
  width: 1%;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------
   Risk pill
   ------------------------------------------------------------ */
.risk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 82, 82, 0.35);
  background: rgba(255, 82, 82, 0.10);
  color: #ff5252;
  margin-left: 8px;
  vertical-align: middle;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.risk-pill:hover {
  filter: brightness(1.08);
}

.risk-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5252;
  box-shadow: 0 0 0 2px rgba(255, 82, 82, 0.15);
}

/* ------------------------------------------------------------
   Impact icon
   ------------------------------------------------------------ */
.impact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  cursor: pointer;
  color: rgba(226, 232, 240, 0.65);
  flex: 0 0 auto;
}

.impact-icon:hover {
  color: rgba(226, 232, 240, 0.95);
}

.impact-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Controls */
.audit-compact-select {
  height: 34px;
  padding: 4px 28px 4px 8px;
  font-size: 13px;
}

/* ------------------------------------------------------------
   Topbar layout
   ------------------------------------------------------------ */
.audit-topbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
}

.audit-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  min-width: 0;
}

.audit-mid {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
  min-width: 0;
}

.audit-right {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
  min-width: 0;
}

@media (min-width: 768px) {
  .audit-topbar {
    grid-template-columns: auto auto 1fr;
    gap: 18px;
  }

  .audit-right {
    justify-content: flex-end;
    justify-self: end;
    text-align: right;
  }
}

/* Listed */
.audit-listed {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.audit-listed-kicker {
  font-size: 11px;
  color: #9aa3b2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.audit-listed-num {
  font-size: 22px;
  font-weight: 800;
  color: #e6e8ef;
  font-variant-numeric: tabular-nums;
}

.audit-listed-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ------------------------------------------------------------
   Kebab actions (Listed area)
   ------------------------------------------------------------ */
.audit-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.audit-kebab {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(43, 50, 71, 0.9);
  background: rgba(21, 25, 38, 0.45);
  color: rgba(230, 232, 239, 0.85);
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.10) inset;
}

.audit-kebab:hover {
  filter: brightness(1.06);
}

.audit-kebab svg {
  width: 18px;
  height: 18px;
  display: block;
}

.audit-menu {
  position: absolute;
  top: 38px;
  right: 0;
  min-width: 180px;
  border-radius: 14px;
  border: 1px solid #2b3247;
  background: rgba(12, 14, 22, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  padding: 6px;
  z-index: 60;
}

.audit-menu.hidden {
  display: none;
}

.audit-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #e6e8ef;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}

.audit-menu-item:hover {
  background: rgba(230, 232, 239, 0.08);
}

.audit-menu-item.is-muted {
  color: rgba(154, 163, 178, 0.92);
}

.audit-menu-sep {
  height: 1px;
  background: rgba(43, 50, 71, 0.9);
  margin: 6px;
}

/* ------------------------------------------------------------
   Mini 24h listener curve (button)
   ------------------------------------------------------------ */
.lc24h-mini {
  width: 220px;
  border: 1px solid #23283a;
  background: rgba(21, 25, 38, 0.40);
  border-radius: 14px;
  padding: 9px 9px 7px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.10) inset;
}

.lc24h-mini:hover {
  filter: brightness(1.05);
}

.lc24h-mini-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  min-width: 0;
}

.lc24h-mini-title {
  font-size: 11px;
  color: #9aa3b2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 900;
  white-space: nowrap;
  line-height: 1;
}

.lc24h-mini-mode {
  font-size: 11px;
  color: rgba(230, 232, 239, 0.78);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

.lc24h-mini-open {
  margin-left: auto;
  margin-right: 2px;
  transform: translateX(-1px);
  color: rgba(154, 163, 178, 0.85);
  flex: 0 0 auto;
}

.lc24h-mini-open svg {
  width: 16px;
  height: 16px;
  display: block;
}

.lc24h-mini-canvas {
  position: relative;
  height: 44px;
  width: 100%;
}

#lc24hMiniCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ------------------------------------------------------------
   Modal header: title first, station + PROFILE pill second
   ------------------------------------------------------------ */
.lc24h-prof-pill {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 6px 10px;
  border: 1px solid #2b3247;
  background: rgba(21, 25, 38, 0.35);
  border-radius: 999px;
  user-select: none;
  white-space: nowrap;
}

.lc24h-prof-pill.is-on {
  display: inline-flex;
}

.lc24h-prof-pill .t {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e6e8ef;
}

/* canvas in modal */
#lc24hCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Toggle pills in modal */
.lc24h-toggle {
  display: inline-flex;
  border: 1px solid #2b3247;
  background: rgba(21, 25, 38, 0.45);
  border-radius: 999px;
  overflow: hidden;
}

.lc24h-toggle-btn {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa3b2;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.lc24h-toggle-btn.is-active {
  color: #e6e8ef;
  background: rgba(230, 232, 239, 0.08);
}

/* --- lc24h legend (KISS) --- */
.lc24h-legend {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-left: 6px;
}

@media (max-width: 640px) {
  .lc24h-legend {
    display: none; /* keep header clean on mobile */
  }
}

.lc24h-legend-box {
  border: 1px solid rgba(43, 50, 71, 0.9);
  background: rgba(10, 12, 18, 0.55);
  border-radius: 12px;
  padding: 8px 10px;
  min-width: 170px;
  line-height: 1.15;
}

.lc24h-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lc24h-legend-sub {
  margin-top: 6px;
  font-size: 10px;
  color: rgba(154, 163, 178, 0.78);
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

#lc24hRefSubtitle.is-error {
  color: rgba(248, 113, 113, 0.95);
}

.lc24h-legend-avg .lc24h-toggle {
  max-width: 100%;
}

.lc24h-ref-row {
  gap: 6px;
}

/* Overlay close button + legend bits */
.lc24h-close-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  padding: 6px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(17, 24, 39, 0.65);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.lc24h-close-overlay:hover {
  background: rgba(17, 24, 39, 0.82);
}

.lc24h-legend-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.lc24h-legend-title-text {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: rgba(209, 213, 219, 0.85);
}

.lc24h-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  display: inline-block;
}

.lc24h-dot-avg {
  background: #4fc3f7;
}

.lc24h-dot-ref {
  background: #ff8a65;
}

.lc24h-ref-sub {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(156, 163, 175, 0.9);
}

/* ------------------------------------------------------------
   Date nav controls (single source of truth)
   ------------------------------------------------------------ */
.lc24h-ref-nav {
  height: 32px;
  width: 32px;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(15, 23, 42, 0.35);
  color: rgba(230, 232, 239, 0.92);
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lc24h-ref-nav:hover {
  background: rgba(15, 23, 42, 0.55);
}

.lc24h-ref-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.lc24h-ref-date {
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(2, 6, 23, 0.35);
  color: rgba(230, 232, 239, 0.92);
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

.lc24h-ref-date::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.75;
}

.ap-new-play {
  outline: 1px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12) inset;
  background: rgba(56, 189, 248, 0.06) !important;
  transition: background 320ms ease;
}
