.risk-alert-panel {
  --ra-red: #b93831;
  --ra-red-deep: #8f241f;
  --ra-red-soft: #fff2f0;
  --ra-amber: #b3751e;
  --ra-amber-soft: #fdf6e8;
  --ra-green: #0b7350;
  --ra-green-soft: #edf8f2;
  --ra-ink: #16212b;
  --ra-muted: #6a7883;
  --ra-line: #e2e8ec;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e4eaee;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdfe 46%, #f8fafb 100%);
  box-shadow: 0 22px 60px rgba(24, 41, 52, 0.07);
}

.ra-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.7fr);
  gap: 28px;
  padding: 32px 34px 28px;
  overflow: hidden;
  border-bottom: 1px solid var(--ra-line);
  background:
    radial-gradient(520px 260px at 90% 4%, rgba(185, 56, 49, 0.12), transparent 64%),
    radial-gradient(420px 260px at 4% 100%, rgba(11, 115, 80, 0.06), transparent 68%),
    linear-gradient(122deg, #fffdfb 0%, #fdf8f2 52%, #f7fbf9 100%);
}

.ra-hero::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(120, 138, 148, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 138, 148, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 46%, #000 100%);
}

.ra-hero > * {
  position: relative;
  z-index: 1;
}

.ra-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.ra-hero-copy h2 {
  margin: 2px 0 8px;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.02em;
}

.ra-hero-copy > p {
  max-width: 70ch;
  margin: 0;
  color: var(--ra-muted);
  line-height: 1.75;
}

.ra-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-top: 20px;
}

.ra-field {
  display: grid;
  gap: 5px;
  min-width: 136px;
  color: var(--ra-muted);
  font-size: 12px;
  font-weight: 700;
}

.ra-field input,
.ra-field select,
.ra-toolbar-right input,
.ra-toolbar-right select {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #d7e0e6;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ra-ink);
}

.ra-check {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 0 4px;
  color: var(--ra-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ra-check input {
  flex: 0 0 auto;
  width: auto;
  accent-color: var(--ra-red);
}

.ra-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.ra-actions .primary {
  border-color: #a32d27;
  background: linear-gradient(180deg, #c0433b, #a32d27);
  box-shadow: 0 8px 18px rgba(163, 45, 39, 0.18);
}

.ra-actions .ghost {
  border-color: #d8e1e6;
  background: rgba(255, 255, 255, 0.72);
}

.ra-hero .message {
  min-height: 20px;
  margin: 12px 0 0;
}

.ra-pressure {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 22px;
  border: 1px solid rgba(185, 56, 49, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(255, 244, 241, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ra-pressure > span {
  color: var(--ra-red-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ra-pressure > strong {
  color: var(--ra-red-deep);
  font-family: var(--font-number);
  font-size: clamp(46px, 5vw, 64px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ra-pressure > small {
  color: var(--ra-red);
  font-size: 14px;
  font-weight: 800;
}

.ra-pressure-track {
  height: 8px;
  overflow: hidden;
  margin: 8px 0 2px;
  border-radius: 999px;
  background: #f0e1df;
}

.ra-pressure-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d9a35a, #c4493f);
  transition: width 0.35s ease;
}

.ra-pressure-track i.is-low {
  background: linear-gradient(90deg, #82b79f, #0b7350);
}

.ra-pressure-track i.is-medium {
  background: linear-gradient(90deg, #d9a35a, #b3751e);
}

.ra-pressure-track i.is-high {
  background: linear-gradient(90deg, #d76358, #9c2721);
}

.ra-pressure-meta {
  color: var(--ra-muted);
  font-size: 12px;
  line-height: 1.5;
}

.ra-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--ra-line);
  background: rgba(250, 252, 253, 0.8);
}

.ra-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid #e7edf0;
  border-radius: 12px;
  background: #fff;
}

.ra-metric span {
  color: var(--ra-muted);
  font-size: 12px;
  font-weight: 700;
}

.ra-metric strong {
  color: var(--ra-ink);
  font-family: var(--font-number);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.ra-metric small {
  color: #8a959d;
  font-size: 11px;
  line-height: 1.35;
}

.ra-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--ra-line);
  background: #fff;
}

.ra-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ra-tabs button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #dfe6ea;
  border-radius: 999px;
  background: #f7f9fa;
  color: #5e6b75;
  font-size: 12px;
  font-weight: 700;
}

.ra-tabs button:hover {
  border-color: #c8d3d9;
  background: #eef3f5;
}

.ra-tabs button.is-active {
  border-color: #c4493f;
  background: var(--ra-red-soft);
  color: var(--ra-red-deep);
}

.ra-toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ra-toolbar-right input {
  width: min(260px, 42vw);
}

.ra-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  padding: 22px 32px 30px;
}

.ra-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e2e8ec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(22, 33, 43, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.ra-card:hover {
  transform: translateY(-2px);
  border-color: #cfd9df;
  box-shadow: 0 18px 42px rgba(22, 33, 43, 0.09);
}

.ra-card.is-high {
  border-top: 3px solid #b93831;
}

.ra-card.is-medium {
  border-top: 3px solid #b3751e;
}

.ra-card.is-low {
  border-top: 3px solid #7b9aa8;
}

.ra-card.is-unknown {
  border-top: 3px solid #c7d2d8;
}

.ra-card.is-acknowledged {
  opacity: 0.72;
}

.ra-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 15px 16px 10px;
}

.ra-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.ra-identity strong {
  overflow: hidden;
  max-width: 13em;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.ra-identity code {
  color: #7c8993;
  font-size: 12px;
}

.ra-level {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.ra-level.is-high {
  background: var(--ra-red-soft);
  color: var(--ra-red-deep);
}

.ra-level.is-medium {
  background: var(--ra-amber-soft);
  color: #85540f;
}

.ra-level.is-low,
.ra-level.is-unknown {
  background: #eef3f5;
  color: #526571;
}

.ra-level.is-resolved {
  background: var(--ra-green-soft);
  color: var(--ra-green);
}

.ra-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex: 0 0 auto;
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
}

.ra-price strong {
  font-size: 20px;
  line-height: 1.05;
}

.ra-price small {
  color: var(--ra-muted);
  font-size: 12px;
  font-weight: 700;
}

.ra-price.is-fall strong,
.ra-price.is-fall small {
  color: var(--ra-green);
}

.ra-price.is-rise strong,
.ra-price.is-rise small {
  color: var(--ra-red);
}

.ra-score-line {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 16px 10px;
}

.ra-score-track {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0f3f4;
}

.ra-score-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d9a35a, #b93831);
}

.ra-score-track i.is-low {
  background: linear-gradient(90deg, #a9c8bb, #6e9889);
}

.ra-score-track i.is-medium {
  background: linear-gradient(90deg, #e0b364, #b3751e);
}

.ra-score-line b {
  min-width: 2.1em;
  color: var(--ra-ink);
  font-family: var(--font-number);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ra-state {
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef3f5;
  color: #576a76;
  font-size: 10px;
  font-weight: 800;
}

.ra-state.is-new {
  background: #fff1ef;
  color: var(--ra-red-deep);
}

.ra-state.is-escalated {
  background: #fff4e3;
  color: #8b570d;
}

.ra-signals {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 16px 12px;
  list-style: none;
}

.ra-signal {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border-left: 3px solid #c8d4da;
  border-radius: 0 8px 8px 0;
  background: #f8fafb;
}

.ra-signal.is-high {
  border-left-color: #b93831;
  background: #fff5f3;
}

.ra-signal.is-medium {
  border-left-color: #b3751e;
  background: #fffaf1;
}

.ra-signal.is-low,
.ra-signal.is-info {
  border-left-color: #9bb6c2;
  background: #f5f9fa;
}

.ra-signal-label {
  color: var(--ra-ink);
  font-size: 12px;
  font-weight: 800;
}

.ra-signal small {
  color: #677985;
  font-size: 11px;
  line-height: 1.5;
}

.ra-signal-more {
  padding-left: 4px;
  color: #7a8a94;
  font-size: 11px;
}

.ra-st-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 0 16px 10px;
}

.ra-st-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.ra-st-badge.is-high {
  background: var(--ra-red);
  color: #fff;
}

.ra-st-badge.is-medium {
  background: #fff0d4;
  color: #85540f;
}

.ra-st-tag {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 7px;
  border: 1px solid #e4d6c4;
  border-radius: 999px;
  background: #fffaf4;
  color: #7a5520;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.ra-st-unknown {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 7px;
  border: 1px dashed #c7d2d8;
  border-radius: 999px;
  color: #6a7883;
  font-size: 10px;
  font-weight: 700;
}

.ra-st-details {
  margin: 0 16px 12px;
  border: 1px solid #e8eef1;
  border-radius: 10px;
  background: #fbfcfd;
}

.ra-st-details summary {
  padding: 8px 10px;
  color: #4d616d;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.ra-st-details ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 9px 9px;
  list-style: none;
}

.ra-st-finding {
  padding: 7px 9px;
  border-left: 3px solid #c8d4da;
  border-radius: 0 8px 8px 0;
  background: #f6f9fa;
}

.ra-st-finding.is-high {
  border-left-color: #b93831;
  background: #fff6f4;
}

.ra-st-finding.is-medium {
  border-left-color: #b3751e;
  background: #fffbf3;
}

.ra-st-finding.is-low,
.ra-st-finding.is-info {
  border-left-color: #9bb6c2;
  background: #f7fafb;
}

.ra-st-finding-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.ra-st-finding-head b {
  color: var(--ra-ink);
  font-size: 11px;
}

.ra-st-confirmed {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.ra-st-confirmed.is-confirmed {
  background: #fff0ed;
  color: var(--ra-red-deep);
}

.ra-st-confirmed.is-watch {
  background: #fff5e2;
  color: #85540f;
}

.ra-st-finding p {
  margin: 4px 0;
  color: #5f717c;
  font-size: 11px;
  line-height: 1.5;
}

.ra-st-finding small {
  display: block;
  color: #82909a;
  font-size: 10px;
  line-height: 1.5;
}

.ra-st-finding a {
  display: inline-block;
  margin-top: 3px;
  color: #2f6c88;
  font-size: 10px;
  font-weight: 700;
}

.ra-st-note {
  margin: 0;
  padding: 0 10px 9px;
  color: #8a979f;
  font-size: 10px;
  line-height: 1.5;
}

.ra-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 10px 16px 13px;
  border-top: 1px dashed #e8eef1;
}

.ra-meta {
  color: #8a979f;
  font-size: 11px;
}

.ra-card-actions {
  display: flex;
  gap: 6px;
}

.ra-card-actions button,
.ra-resolved-row button {
  min-height: 30px;
  padding: 0 10px;
  border-color: #dfe6ea;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}

.ra-empty {
  grid-column: 1 / -1;
  padding: 52px 24px;
  border: 1px dashed #d9e2e7;
  border-radius: 16px;
  background: #fafcfd;
  text-align: center;
}

.ra-empty strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.ra-empty p {
  margin: 0;
  color: var(--ra-muted);
  font-size: 12px;
}

.ra-resolved {
  padding: 20px 32px 30px;
}

.ra-resolved-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border: 1px solid #e3ebee;
  border-radius: 12px;
  background: #fbfdfc;
}

.ra-resolved-row + .ra-resolved-row {
  margin-top: 8px;
}

.ra-resolved-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ra-resolved-row code {
  color: #84939c;
  font-size: 12px;
}

.ra-resolved-row p {
  flex: 1 1 280px;
  margin: 0;
  color: var(--ra-muted);
  font-size: 12px;
}

.ra-rules {
  margin: 0 32px 26px;
  border: 1px solid #e4ebee;
  border-radius: 12px;
  background: #fbfcfd;
}

.ra-rules summary {
  padding: 13px 16px;
  cursor: pointer;
  color: #52636f;
  font-size: 12px;
  font-weight: 800;
}

.ra-rules-body {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
  color: #687983;
  font-size: 12px;
  line-height: 1.7;
}

.ra-rules-body p {
  margin: 0;
}

.ra-rules-body strong {
  color: #42545f;
}

.ra-dialog {
  width: min(620px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid #dbe4e9;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 30, 40, 0.28);
}

.ra-dialog::backdrop {
  background: rgba(18, 30, 38, 0.42);
  backdrop-filter: blur(3px);
}

.ra-dialog form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.ra-dialog-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.ra-dialog-head h3 {
  margin: 2px 0 0;
  font-size: 22px;
}

.ra-dialog-head button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

.ra-dialog form > p {
  margin: 0;
  color: var(--ra-muted);
  font-size: 12px;
  line-height: 1.65;
}

.ra-dialog textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d7e1e6;
  border-radius: 12px;
  background: #fbfcfd;
  color: var(--ra-ink);
  font-family: var(--font-number);
  font-size: 14px;
  line-height: 1.8;
  resize: vertical;
}

.ra-threshold-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ra-threshold-grid .ra-field {
  min-width: 0;
}

.ra-dialog-note {
  color: #82909a !important;
  font-size: 11px !important;
}

.ra-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
}

.ra-dialog-actions span {
  margin-right: auto;
  color: var(--ra-muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .ra-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .ra-hero {
    grid-template-columns: 1fr;
    padding: 24px 20px;
  }
  .ra-pressure {
    max-width: 360px;
  }
  .ra-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px 20px;
  }
  .ra-toolbar {
    padding: 14px 20px;
  }
  .ra-list {
    grid-template-columns: 1fr;
    padding: 16px 20px 24px;
  }
  .ra-resolved {
    padding: 16px 20px 24px;
  }
  .ra-rules {
    margin: 0 20px 22px;
  }
  .ra-toolbar-right {
    width: 100%;
  }
  .ra-toolbar-right input {
    flex: 1;
    width: auto;
  }
}

@media (max-width: 560px) {
  .ra-threshold-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ra-controls,
  .ra-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .ra-field {
    min-width: 0;
  }
  .ra-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .ra-card-head {
    align-items: flex-start;
  }
}
