/* v0.2.39 — modular calibration API and rounded Shadow Mode UI */
.security-heading__actions {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
  min-width: min(100%, 310px);
}

.diagnostic-share-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #b9cbd8;
  border-radius: 5px;
  color: #124f79;
  background: #f6fbfe;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.diagnostic-share-button:hover:not(:disabled) {
  border-color: var(--blue);
  background: #edf7fc;
}

.diagnostic-share-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.share-feedback {
  max-width: 310px;
  font-size: 0.65rem;
  line-height: 1.4;
  text-align: right;
}

.share-feedback--success {
  color: var(--green);
}

.share-feedback--error {
  color: var(--red);
}

.diagnostic-share-url {
  width: 310px;
  max-width: 100%;
  min-height: 31px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: #45525d;
  background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.61rem;
}

.shadow-signals-section {
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.shadow-section-title {
  align-items: flex-start;
  gap: 18px;
}

.shadow-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.shadow-mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid #b88718;
  border-radius: 3px;
  color: #715000;
  background: #fff6d9;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.shadow-mode-notice {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.shadow-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #f8fafb;
}

.shadow-signal-card {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  min-width: 0;
  min-height: 150px;
  gap: 5px;
  padding: 15px 16px;
  border: 0;
  border-right: 1px solid var(--border);
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.shadow-signal-card:last-child {
  border-right: 0;
}

.shadow-signal-card:hover,
.shadow-signal-card--active {
  background: #ffffff;
}

.shadow-signal-card--active {
  box-shadow: inset 0 3px 0 var(--blue);
}

.shadow-signal-card > span {
  min-height: 30px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.025em;
}

.shadow-signal-card > strong {
  font-size: 1.65rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.shadow-signal-card > strong small {
  color: var(--muted);
  font-size: 0.68rem;
}

.shadow-signal-card > b {
  overflow: hidden;
  max-width: 100%;
  font-size: 0.71rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shadow-signal-card > div {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  margin-top: auto;
}

.shadow-signal-card > div small {
  color: var(--muted);
  font-size: 0.59rem;
}

.shadow-change--positive {
  color: var(--green) !important;
}

.shadow-change--negative {
  color: var(--red) !important;
}

.shadow-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
}

.shadow-chart-panel,
.shadow-components-panel {
  min-width: 0;
  padding: 18px 20px;
}

.shadow-chart-panel {
  border-right: 1px solid var(--border);
}

.shadow-chart-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.shadow-chart-heading > div span,
.shadow-chart-heading > div strong {
  display: block;
}

.shadow-chart-heading > div span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.shadow-chart-heading > div strong {
  margin-top: 4px;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.shadow-chart-heading p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.45;
  text-align: right;
}

.shadow-history-chart {
  display: block;
  width: 100%;
  height: 220px;
  margin-top: 7px;
  overflow: visible;
}

.shadow-history-chart line {
  stroke: #e5eaee;
  stroke-width: 1;
}

.shadow-history-chart text {
  fill: #71808b;
  font-size: 0.58rem;
  font-weight: 700;
}

.shadow-history-line {
  fill: none;
  stroke: #166aa3;
  stroke-width: 2.7;
  vector-effect: non-scaling-stroke;
}

.shadow-history-point {
  fill: #ffffff;
  stroke: #166aa3;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.shadow-components-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.shadow-components-heading > div span,
.shadow-components-heading > div strong {
  display: block;
}

.shadow-components-heading > div span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.shadow-components-heading > div strong {
  margin-top: 4px;
  font-size: 0.92rem;
}

.shadow-component-list {
  display: grid;
  gap: 7px;
}

.shadow-component-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 14px;
  padding: 9px 10px;
  border-radius: 5px;
  background: var(--surface-muted);
}

.shadow-component-row > div:first-child {
  min-width: 0;
}

.shadow-component-row strong,
.shadow-component-row small,
.shadow-component-row b {
  display: block;
}

.shadow-component-row strong {
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shadow-component-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.59rem;
}

.shadow-component-row > div:last-child {
  flex: 0 0 auto;
  text-align: right;
}

.shadow-component-row b {
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.shadow-regime-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.shadow-regime-flags span {
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  background: #ffffff;
  font-size: 0.58rem;
  font-weight: 700;
}

.shadow-regime-flags span.active {
  border-color: #8ab4ce;
  color: #124f79;
  background: #edf7fc;
}

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

  .shadow-signal-card:nth-child(3) {
    border-right: 0;
  }

  .shadow-signal-card:nth-child(-n + 3) {
    border-bottom: 1px solid var(--border);
  }

  .shadow-detail-layout {
    grid-template-columns: 1fr;
  }

  .shadow-chart-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 720px) {
  .security-heading__actions {
    align-items: flex-start;
  }

  .security-price,
  .share-feedback {
    text-align: left;
  }

  .shadow-section-title {
    flex-direction: column;
  }

  .shadow-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shadow-signal-card,
  .shadow-signal-card:nth-child(3) {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .shadow-signal-card:nth-child(2n) {
    border-right: 0;
  }

  .shadow-signal-card:last-child {
    border-bottom: 0;
  }

  .shadow-chart-heading {
    flex-direction: column;
  }

  .shadow-chart-heading p {
    text-align: left;
  }

  .shadow-history-chart {
    height: 170px;
  }
}

@media (max-width: 440px) {
  .security-heading__actions,
  .diagnostic-share-button,
  .diagnostic-share-url {
    width: 100%;
  }

  .shadow-card-grid {
    grid-template-columns: 1fr;
  }

  .shadow-signal-card,
  .shadow-signal-card:nth-child(2n),
  .shadow-signal-card:nth-child(3) {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .shadow-signal-card:last-child {
    border-bottom: 0;
  }

  .shadow-components-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

.import-integrity-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 7px;
  border-radius: 3px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.59rem;
  font-weight: 800;
  white-space: nowrap;
}

.import-integrity-pill--warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.text-negative {
  color: var(--red) !important;
  font-weight: 800;
}

.qrl-diagnostic-share {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
  min-width: 260px;
}

.qrl-import-integrity-section {
  margin-bottom: 24px;
}

@media (max-width: 720px) {
  .qrl-diagnostic-share {
    align-items: flex-start;
  }
}

@media (max-width: 440px) {
  .qrl-diagnostic-share {
    width: 100%;
    min-width: 0;
  }
}

/* v0.2.39 — compact, rounded and non-overflowing component values */
.shadow-component-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.shadow-component-copy > strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.shadow-component-copy > small {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.shadow-component-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  margin-top: 6px;
}

.shadow-component-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(113, 128, 139, 0.14);
  font-variant-numeric: tabular-nums;
}

.shadow-component-value em,
.shadow-component-value > span {
  min-width: 0;
  font-size: 0.57rem;
  line-height: 1.35;
}

.shadow-component-value em {
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shadow-component-value > span {
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .shadow-component-values {
    grid-template-columns: minmax(0, 1fr);
  }
}
