* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f3f6fb;
  color: #0f172a;
}

button,
input,
select {
  font-family: inherit;
}

button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.hero {
  background: radial-gradient(circle at top left, #243b6b 0, #0f172a 42%, #090f1f 100%);
  color: #fff;
  padding: 34px 0 88px;
}

.hero-inner {
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.hero-copy {
  max-width: 860px;
}

.eyebrow {
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

h1 {
  margin: 0;
  font-size: 54px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.hero p {
  color: #cbd5e1;
  font-size: 18px;
  max-width: 760px;
  margin: 16px 0 0;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page {
  width: min(1440px, calc(100% - 64px));
  margin: -58px auto 64px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.summary-card,
.card {
  background: #fff;
  border: 1px solid #dde6f2;
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .07);
}

.summary-card {
  padding: 22px;
}

.summary-card span {
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 36px;
  line-height: 1;
}

.card {
  padding: 26px;
  margin-bottom: 24px;
}

.compact-card {
  margin-bottom: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  align-items: flex-start;
}

h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

p {
  color: #64748b;
  margin: 8px 0 0;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 180px;
  gap: 14px;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

input {
  height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
}

input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}

button {
  height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
}

.primary-btn {
  background: #4f46e5;
  color: #fff;
}

.primary-btn:hover {
  background: #4338ca;
}

.secondary-btn {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, .18);
}

.scan-btn {
  background: #0f172a;
  color: #fff;
  min-width: 112px;
}

.scan-btn:hover {
  background: #1e293b;
}

.history-btn {
  background: #eef2ff;
  color: #3730a3;
  min-width: 96px;
}

.history-btn:hover {
  background: #e0e7ff;
}

.message {
  margin-top: 14px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 12px;
  font-weight: 900;
}

td strong {
  font-weight: 900;
}

.rating-good {
  color: #15803d;
  font-weight: 900;
}

.rating-mid {
  color: #b45309;
  font-weight: 900;
}

.rating-low {
  color: #b91c1c;
  font-weight: 900;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-success {
  background: #dcfce7;
  color: #166534;
}

.status-no_changes {
  background: #e0f2fe;
  color: #075985;
}

.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

.app-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-name-cell span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.app-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex: 0 0 auto;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .14);
}

.app-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 900;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-row {
  cursor: pointer;
}

.app-row:hover {
  background: #f8fafc;
}

.updates-list {
  display: grid;
  gap: 14px;
}

.update-card {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 18px;
  background: #fbfdff;
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 20px;
}

.update-title {
  font-weight: 900;
  font-size: 17px;
  margin-bottom: 8px;
}

.update-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.update-notes {
  color: #334155;
  line-height: 1.5;
  max-width: 900px;
}

.update-score {
  text-align: right;
}

.update-score strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.update-score span {
  display: block;
  color: #64748b;
  margin-top: 6px;
  font-size: 13px;
}

.small-action {
  margin-top: 14px;
  min-width: 120px;
}

.update-name {
  align-items: flex-start;
  margin-bottom: 12px;
}

.mobile-card-list {
  display: none;
}

.mobile-app-card,
.mobile-rating-card {
  border: 1px solid #e2e8f0;
  background: #fbfdff;
  border-radius: 18px;
}

.mobile-app-card {
  padding: 16px;
}

.mobile-app-top {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
}

.mobile-app-title strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.mobile-app-title span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-top: 4px;
}

.mobile-rating {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.mobile-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.mobile-metrics div {
  background: #f1f5f9;
  border-radius: 14px;
  padding: 10px;
  min-width: 0;
}

.mobile-metrics span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 4px;
}

.mobile-metrics strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.mobile-actions button {
  width: 100%;
}

.mobile-rating-card {
  position: relative;
  display: grid;
  grid-template-columns: 34px 42px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
}

.mobile-rating-card:hover {
  background: #f8fafc;
}

.rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
}

.mobile-rating-info strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.mobile-rating-info span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-top: 4px;
}

.empty-state {
  color: #64748b;
  font-weight: 800;
  background: #f8fafc;
  border-radius: 16px;
  padding: 16px;
}

.admin-collapsed form,
.admin-collapsed .message {
  display: none;
}

.admin-token-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 18px;
}

.admin-token-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-token-status {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.admin-collapsed .admin-token-box {
  display: none;
}

.collapsed-section .collapsible-content {
  display: none;
}

.small-eyebrow {
  font-size: 10px;
  margin-bottom: 6px;
}

.history-drawer.hidden {
  display: none;
}

.history-drawer {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.history-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(3px);
}

.history-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, 96vw);
  height: 100%;
  background: #f8fafc;
  border-left: 1px solid #dbe3ef;
  box-shadow: -24px 0 80px rgba(15, 23, 42, .24);
  overflow-y: auto;
  animation: drawerIn .18s ease-out;
}

@keyframes drawerIn {
  from {
    transform: translateX(24px);
    opacity: .7;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.history-drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  background: rgba(248, 250, 252, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
}

.history-drawer-head h2 {
  margin: 0;
}

.drawer-close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  padding: 0;
  flex: 0 0 auto;
}

.history-drawer-body {
  padding: 22px 26px 32px;
}

.history-loading {
  color: #64748b;
  font-weight: 700;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.history-summary div {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
}

.history-summary span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
}

.history-summary strong {
  font-size: 20px;
}

.history-section-title {
  font-size: 16px;
  font-weight: 900;
  margin: 22px 0 12px;
}

.rating-history-list,
.history-list {
  display: grid;
  gap: 12px;
}

.rating-history-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 16px;
  padding: 14px;
}

.rating-history-card span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-top: 3px;
}

.rating-history-card strong {
  font-size: 15px;
}

.rating-history-card > div:first-child strong {
  font-size: 22px;
}

.history-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.history-card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.history-card-top strong {
  display: block;
  font-size: 16px;
}

.history-card-top span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.history-rating {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.history-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.history-metrics div {
  border-radius: 14px;
  background: #f1f5f9;
  padding: 12px;
}

.history-metrics span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}

.history-metrics strong {
  font-size: 14px;
}

.history-notes {
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  .hero-inner,
  .page {
    width: min(100% - 32px, 1440px);
  }

  .hero-inner {
    flex-direction: column;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 42px;
  }

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

  .update-score {
    text-align: left;
  }

  .history-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .history-metrics {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 760px) {
  .hero {
    padding: 24px 0 76px;
  }

  .hero-inner,
  .page {
    width: min(100% - 24px, 1440px);
  }

  h1 {
    font-size: 38px;
  }

  .hero p {
    font-size: 16px;
  }

  .hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions button {
    width: 100%;
  }

  .page {
    margin-top: -46px;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .summary-card {
    border-radius: 18px;
    padding: 16px;
  }

  .summary-card span {
    font-size: 12px;
  }

  .summary-card strong {
    font-size: 28px;
  }

  .card {
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 18px;
  }

  .section-head {
    flex-direction: column;
    gap: 12px;
  }

  h2 {
    font-size: 21px;
  }

  .desktop-table {
    display: none;
  }

  .mobile-card-list {
    display: grid;
    gap: 12px;
  }

  .update-card {
    padding: 16px;
  }

  .update-score strong {
    font-size: 24px;
  }

  .history-drawer-panel {
    width: 100vw;
  }

  .history-drawer-head {
    padding: 18px;
  }

  .history-drawer-body {
    padding: 18px;
  }

  .history-summary,
  .history-metrics,
  .rating-history-card {
    grid-template-columns: 1fr;
  }

  .mobile-metrics {
    grid-template-columns: 1fr;
  }

  .mobile-actions {
    grid-template-columns: 1fr;
  }

  .admin-token-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-token-actions button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .mobile-rating-card {
    grid-template-columns: 30px 38px 1fr;
  }

  .mobile-rating-card .mobile-rating {
    grid-column: 3;
    justify-self: start;
    margin-top: 8px;
  }

  .app-icon {
    width: 36px;
    height: 36px;
  }
}

/* Period analytics */

.period-card {

  overflow: hidden;

}

.period-tabs {

  display: inline-flex;

  align-items: center;

  gap: 8px;

  padding: 5px;

  border-radius: 16px;

  background: #f1f5f9;

}

.period-tab {

  height: 38px;

  min-width: 92px;

  padding: 0 14px;

  border-radius: 12px;

  background: transparent;

  color: #475569;

  font-weight: 900;

}

.period-tab.active {

  background: #4f46e5;

  color: #ffffff;

  box-shadow: 0 10px 24px rgba(79, 70, 229, .22);

}

.period-summary-grid {

  display: grid;

  grid-template-columns: repeat(5, 1fr);

  gap: 12px;

  margin-bottom: 18px;

}

.period-summary-card {

  border: 1px solid #e2e8f0;

  background: #f8fafc;

  border-radius: 18px;

  padding: 14px;

}

.period-summary-card span {

  display: block;

  color: #64748b;

  font-size: 12px;

  font-weight: 900;

  margin-bottom: 8px;

}

.period-summary-card strong {

  display: block;

  color: #0f172a;

  font-size: 24px;

  line-height: 1;

}

.period-columns {

  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 14px;

  margin-top: 14px;

}

.period-columns-two {

  grid-template-columns: 1fr 1fr;

}

.period-panel {

  border: 1px solid #e2e8f0;

  background: #fbfdff;

  border-radius: 20px;

  padding: 16px;

  min-width: 0;

}

.period-danger-panel {

  background: #fffafa;

  border-color: #fee2e2;

}

.period-panel h3 {

  margin: 0 0 12px;

  font-size: 16px;

  letter-spacing: -0.01em;

}

.period-list {

  display: grid;

  gap: 10px;

}

.period-item {

  display: grid;

  grid-template-columns: 1fr auto;

  gap: 8px 12px;

  padding: 12px;

  border: 1px solid #e7edf5;

  border-radius: 16px;

  background: #ffffff;

}

.period-app-name {

  min-width: 0;

}

.period-app-name strong {

  display: block;

  font-size: 14px;

  line-height: 1.25;

  word-break: break-word;

}

.period-app-name span {

  display: block;

  margin-top: 3px;

  color: #64748b;

  font-size: 12px;

  font-weight: 800;

}

.period-delta {

  align-self: start;

  white-space: nowrap;

  font-size: 17px;

  font-weight: 950;

}

.period-delta.positive {

  color: #15803d;

}

.period-delta.negative {

  color: #b91c1c;

}

.period-delta.neutral {

  color: #3730a3;

  font-size: 13px;

  padding: 6px 10px;

  background: #eef2ff;

  border-radius: 999px;

}

.period-item-meta {

  grid-column: 1 / -1;

  color: #64748b;

  font-size: 12px;

  font-weight: 800;

}

.period-empty {

  padding: 14px;

  border-radius: 14px;

  background: #f8fafc;

  color: #64748b;

  font-size: 13px;

  font-weight: 800;

}

@media (max-width: 1100px) {

  .period-summary-grid {

    grid-template-columns: repeat(2, 1fr);

  }

  .period-columns,

  .period-columns-two {

    grid-template-columns: 1fr;

  }

  .period-tabs {

    width: 100%;

    justify-content: space-between;

  }

  .period-tab {

    flex: 1;

    min-width: 0;

  }

}

@media (max-width: 640px) {

  .period-summary-grid {

    grid-template-columns: 1fr;

  }

  .period-card .section-head {

    flex-direction: column;

  }

  .period-panel {

    padding: 12px;

  }

  .period-item {

    grid-template-columns: 1fr;

  }

  .period-delta {

    justify-self: start;

  }

  .period-tabs {

    display: grid;

    grid-template-columns: 1fr;

  }

}


/* Analytics period section */

.analytics-card {
  border-color: #dbeafe;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.analytics-head {
  align-items: flex-start;
}

.period-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  background: #eef2ff;
  border-radius: 16px;
  flex: 0 0 auto;
}

.period-tab {
  height: 38px;
  min-width: 88px;
  border-radius: 12px;
  background: transparent;
  color: #3730a3;
  padding: 0 14px;
}

.period-tab.active {
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 10px 24px rgba(79, 70, 229, .24);
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.analytics-summary-item {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 18px;
  padding: 14px;
}

.analytics-summary-item span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
}

.analytics-summary-item strong {
  font-size: 22px;
  line-height: 1;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.analytics-box {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 20px;
  padding: 16px;
  min-width: 0;
}

.analytics-box-wide {
  grid-column: 1 / -1;
}

.analytics-box h3 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.analytics-list {
  display: grid;
  gap: 10px;
}

.analytics-empty {
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
  padding: 14px;
  font-size: 13px;
  font-weight: 800;
}

.analytics-item,
.analytics-release {
  border: 1px solid #eef2f7;
  border-radius: 16px;
  background: #fbfdff;
  padding: 12px;
}

.analytics-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.analytics-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.analytics-item-main strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.analytics-item-main span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.analytics-delta {
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 950;
  border-radius: 999px;
  padding: 6px 10px;
}

.analytics-delta-up {
  background: #dcfce7;
  color: #166534;
}

.analytics-delta-down {
  background: #fee2e2;
  color: #991b1b;
}

.analytics-release p {
  margin: 10px 0 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.analytics-release-warning {
  background: #fff7ed;
  border-color: #fed7aa;
}

@media (max-width: 1000px) {
  .analytics-head {
    flex-direction: column;
  }

  .period-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .period-tab {
    flex: 1 0 auto;
  }

  .analytics-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .analytics-summary {
    grid-template-columns: 1fr;
  }

  .analytics-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .analytics-delta {
    align-self: flex-start;
  }
}

/* Analytics layout improvement */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.analytics-box {
  min-height: auto;
}

.analytics-box:has(#releasesList) {
  grid-column: span 2;
  grid-row: span 2;
}

.analytics-box:has(#releaseWithRatingDropList) {
  grid-column: span 2;
}

.analytics-list {
  display: grid;
  gap: 10px;
}

.analytics-empty,
.analytics-list:empty::before {
  display: block;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.analytics-item {
  padding: 14px 16px;
  border-radius: 16px;
}

.analytics-item .app-name-cell {
  align-items: flex-start;
}

.analytics-item .app-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.analytics-box h3 {
  margin-bottom: 12px;
}

@media (max-width: 1200px) {
  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-box:has(#releasesList),
  .analytics-box:has(#releaseWithRatingDropList) {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-box:has(#releasesList),
  .analytics-box:has(#releaseWithRatingDropList) {
    grid-column: span 1;
  }

  .analytics-summary {
    grid-template-columns: 1fr 1fr;
  }

  .period-tabs {
    width: 100%;
    justify-content: stretch;
  }

  .period-tab {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .analytics-summary {
    grid-template-columns: 1fr;
  }
}


/* Final analytics layout tuning */
.analytics-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(520px, 1.6fr);
  gap: 16px;
  align-items: start;
}

.analytics-box {
  min-height: auto;
}

.analytics-box:has(#ratingUpList),
.analytics-box:has(#ratingDownList),
.analytics-box:has(#ratingCountUpList) {
  min-height: 120px;
}

.analytics-box:has(#releasesList) {
  grid-row: span 3;
}

.analytics-box:has(#releaseWithRatingDropList) {
  grid-column: 1 / -1;
}

.analytics-list {
  display: grid;
  gap: 10px;
}

.analytics-empty {
  padding: 14px 16px;
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}

.analytics-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #e2e8f0;
}

.analytics-item .app-name-cell {
  align-items: flex-start;
}

.analytics-item .app-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.analytics-box h3 {
  margin-bottom: 12px;
}

@media (max-width: 1100px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-box:has(#releasesList),
  .analytics-box:has(#releaseWithRatingDropList) {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .analytics-summary {
    grid-template-columns: 1fr 1fr;
  }

  .period-tabs {
    width: 100%;
    justify-content: stretch;
  }

  .period-tab {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .analytics-summary {
    grid-template-columns: 1fr;
  }

  .analytics-box {
    padding: 14px;
  }

  .analytics-item {
    padding: 12px;
  }
}


.global-status {
  min-height: 0;
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 800;
}

.global-status-info,
.global-status-success,
.global-status-error {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
}

.global-status-info {
  color: #3730a3;
  background: #eef2ff;
  border-color: #c7d2fe;
}

.global-status-success {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.global-status-error {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

@media (max-width: 760px) {
  .global-status-info,
  .global-status-success,
  .global-status-error {
    font-size: 13px;
    min-height: 38px;
  }
}

.rating-delta-cell {
  display: grid;
  gap: 3px;
}

.rating-delta-cell strong {
  font-size: 14px;
  font-weight: 900;
}

.rating-delta-cell span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.rating-delta-up {
  color: #15803d;
}

.rating-delta-down {
  color: #b91c1c;
}

.rating-delta-neutral {
  color: #64748b;
}

@media (max-width: 760px) {
  .rating-delta-cell strong {
    font-size: 13px;
  }
}

.analytics-details-control {
  display: flex;
  justify-content: flex-end;
  margin: 14px 0 0;
}

.analytics-details {
  margin-top: 16px;
}

.analytics-details.collapsed {
  display: none;
}

.analytics-summary {
  margin-top: 18px;
}

@media (max-width: 760px) {
  .analytics-details-control {
    justify-content: stretch;
  }

  .analytics-details-control button {
    width: 100%;
  }
}

.rating-chart-card {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #ffffff;
  padding: 16px;
  margin-bottom: 18px;
}

.rating-chart-head {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.rating-chart-head div {
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
}

.rating-chart-head span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}

.rating-chart-head strong {
  font-size: 15px;
  font-weight: 900;
}

.rating-chart-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
  border: 1px solid #eef2f7;
}

.rating-chart-svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
}

.rating-chart-axis {
  stroke: #cbd5e1;
  stroke-width: 1.5;
}

.rating-chart-grid {
  stroke: #e2e8f0;
  stroke-width: 1;
  stroke-dasharray: 5 6;
}

.rating-chart-line {
  fill: none;
  stroke: #4f46e5;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rating-chart-point {
  fill: #ffffff;
  stroke: #4f46e5;
  stroke-width: 4;
}

.rating-chart-label {
  fill: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.rating-chart-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .rating-chart-head {
    grid-template-columns: 1fr 1fr;
  }

  .rating-chart-card {
    padding: 14px;
  }
}

@media (max-width: 520px) {
  .rating-chart-head {
    grid-template-columns: 1fr;
  }
}

.rating-chart-note {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.rating-chart-point-label {
  fill: #334155;
  font-size: 12px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.segment-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 18px;
}

.segment-tab {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.2s ease;
}

.segment-tab:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.segment-tab.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(79, 70, 229, 0.2);
}

.segment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
}

.segment-grocery {
  background: #ecfdf5;
  color: #166534;
  border-color: #bbf7d0;
}

.segment-food_delivery {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.segment-wine_retail {
  background: #fff1f2;
  color: #9f1239;
  border-color: #fecdd3;
}

.segment-loyalty {
  background: #fefce8;
  color: #854d0e;
  border-color: #fde68a;
}

@media (max-width: 760px) {
  .segment-filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .segment-tab {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .segment-filter {
    grid-template-columns: 1fr;
  }
}

.sort-header {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  letter-spacing: .04em;
  padding: 0;
  text-transform: uppercase;
}

.sort-header::after {
  content: "↕";
  display: inline-block;
  margin-left: 6px;
  color: #94a3b8;
  font-size: 11px;
}

.sort-header.active[data-direction="asc"]::after {
  content: "↑";
  color: #4f46e5;
}

.sort-header.active[data-direction="desc"]::after {
  content: "↓";
  color: #4f46e5;
}

.attention-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 112px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 900;
  white-space: nowrap;
}

.attention-badge strong {
  font-size: 12px;
  font-weight: 900;
}

.attention-badge small {
  font-size: 10px;
  font-weight: 800;
  opacity: .78;
}

.attention-risk {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.attention-growth {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.attention-fresh {
  color: #3730a3;
  background: #eef2ff;
  border-color: #c7d2fe;
}

.attention-stable {
  color: #475569;
  background: #f8fafc;
  border-color: #e2e8f0;
}

@media (max-width: 760px) {
  .attention-badge {
    min-width: auto;
    border-radius: 14px;
  }
}

/* ===== Table UX polish: sorting, density, actions ===== */

.apps-card .table-wrap {
  overflow-x: auto;
}

.apps-card table {
  border-collapse: separate;
  border-spacing: 0;
}

.apps-card thead th {
  vertical-align: middle;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.15;
  color: #475569;
  background: #f8fafc;
}

.apps-card tbody td {
  vertical-align: middle;
  padding-top: 12px;
  padding-bottom: 12px;
}

.apps-card .app-row {
  min-height: 72px;
}

.apps-card .app-name-cell strong {
  line-height: 1.15;
}

.apps-card .app-name-cell span {
  line-height: 1.2;
}

.sort-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.sort-header:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.sort-header::after {
  content: "↕";
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0;
  border-radius: 999px;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1;
  background: #f1f5f9;
}

.sort-header.active {
  color: #ffffff;
  background: #4f46e5;
  border-color: #4f46e5;
  box-shadow: 0 8px 18px rgba(79, 70, 229, .22);
}

.sort-header.active::after {
  color: #4f46e5;
  background: #ffffff;
}

.sort-header.active[data-direction="asc"]::after {
  content: "↑";
}

.sort-header.active[data-direction="desc"]::after {
  content: "↓";
}

.table-date {
  display: inline-grid;
  gap: 2px;
  min-width: 92px;
  line-height: 1.1;
}

.table-date strong {
  font-size: 13px;
  font-weight: 850;
  color: #0f172a;
  white-space: nowrap;
}

.table-date small {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}

.apps-card .rating-delta-cell {
  min-width: 110px;
}

.apps-card .rating-delta-cell strong {
  display: block;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}

.apps-card .rating-delta-cell span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

.apps-card .segment-badge {
  min-width: 116px;
  justify-content: center;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1;
}

.apps-card .attention-badge {
  min-width: 108px;
  padding: 6px 10px;
  border-radius: 14px;
}

.apps-card .attention-badge strong {
  font-size: 11px;
}

.apps-card .attention-badge small {
  font-size: 10px;
}

.apps-card .row-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.apps-card .scan-btn,
.apps-card .history-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
}

.apps-card .history-btn {
  background: #eef2ff;
  color: #3730a3;
}

.apps-card .history-btn:hover {
  background: #e0e7ff;
}

@media (max-width: 1180px) {
  .apps-card .row-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .apps-card .scan-btn,
  .apps-card .history-btn {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .sort-header {
    min-height: 30px;
    font-size: 10px;
  }

  .apps-card tbody td {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

/* ===== Compact app table metadata and segment icons ===== */

.app-subtitle-clean {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.apps-card .segment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-width: 132px;
}

.segment-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.apps-card .app-name-cell {
  gap: 12px;
}

.apps-card .app-name-cell > div {
  min-width: 0;
}

.apps-card .app-name-cell strong {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apps-card .table-date {
  min-width: 74px;
}

@media (max-width: 760px) {
  .apps-card .app-name-cell strong {
    max-width: 160px;
  }

  .apps-card .segment-badge {
    min-width: auto;
  }
}

/* ===== Segment icon-only mode ===== */
.segment-icon-only {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.segment-icon-only .segment-icon {
  font-size: 16px;
  line-height: 1;
}

/* ===== Clean segment icon in apps table ===== */
.apps-card td .segment-badge.segment-icon-only {
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.apps-card td .segment-badge.segment-icon-only .segment-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.apps-card td .segment-grocery,
.apps-card td .segment-wine_retail,
.apps-card td .segment-loyalty {
  background: transparent;
  border-color: transparent;
  color: inherit;
}

/* ===== Compact actions in apps table ===== */
.apps-card .row-actions-compact {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row;
  gap: 8px;
  white-space: nowrap;
}

.apps-card .row-actions-compact .action-icon-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 12px;
  font-size: 17px;
  line-height: 1;
  font-weight: 900;
}

.apps-card .row-actions-compact .action-history-btn {
  width: auto;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .apps-card .row-actions-compact {
    flex-direction: row;
    align-items: center;
  }

  .apps-card .row-actions-compact .action-icon-btn {
    width: 36px;
    min-width: 36px;
  }

  .apps-card .row-actions-compact .action-history-btn {
    width: auto;
  }
}

@media (max-width: 760px) {
  .apps-card .row-actions-compact {
    width: 100%;
    justify-content: stretch;
  }

  .apps-card .row-actions-compact .action-history-btn {
    flex: 1;
  }
}

/* ===== Apps table compact visual polish ===== */

/* Больше воздуха между последним релизом, статусом и действиями */
.apps-card table th:nth-child(8),
.apps-card table td:nth-child(8) {
  padding-right: 26px;
}

.apps-card table th:nth-child(9),
.apps-card table td:nth-child(9) {
  padding-left: 18px;
  padding-right: 24px;
}

.apps-card table th:nth-child(10),
.apps-card table td:nth-child(10) {
  padding-left: 18px;
}

/* Рейтинг и дельта — визуально разные зоны */
.apps-card table th:nth-child(6),
.apps-card table td:nth-child(6) {
  padding-right: 22px;
}

.apps-card table th:nth-child(7),
.apps-card table td:nth-child(7) {
  padding-left: 18px;
}

/* Компактнее дата релиза */
.apps-card .release-date-cell,
.apps-card td:nth-child(8) {
  line-height: 1.18;
}

.apps-card td:nth-child(8) strong,
.apps-card td:nth-child(8) {
  font-size: 13px;
}

.apps-card td:nth-child(8) small,
.apps-card td:nth-child(8) span {
  font-size: 11px;
  color: #64748b;
}

/* Статус — легче, без ощущения тяжелой кнопки */
.apps-card .release-status,
.apps-card .fresh-release-badge,
.apps-card .stable-badge,
.apps-card .attention-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 92px;
  max-width: 118px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.08;
  font-weight: 800;
  box-shadow: none;
}

.apps-card .release-status small,
.apps-card .fresh-release-badge small,
.apps-card .stable-badge small,
.apps-card .attention-badge small {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  opacity: .72;
}

/* Кнопка проверки — не черная, а легкая служебная */
.apps-card .row-actions-compact .action-icon-btn {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #dbe3ef;
  box-shadow: none;
}

.apps-card .row-actions-compact .action-icon-btn:hover {
  background: #e0e7ff;
  color: #3730a3;
  border-color: #c7d2fe;
  transform: none;
}

/* История тоже чуть легче */
.apps-card .row-actions-compact .action-history-btn {
  background: #f4f6ff;
  color: #3730a3;
  border: 1px solid #e0e7ff;
  box-shadow: none;
}

.apps-card .row-actions-compact .action-history-btn:hover {
  background: #e8edff;
  border-color: #c7d2fe;
}

/* Заголовки таблицы: компактнее и ровнее */
.apps-card thead th {
  white-space: nowrap;
  vertical-align: middle;
}

.apps-card .sort-header {
  gap: 4px;
}

/* Чуть уменьшаем высоту строки без потери читаемости */
.apps-card tbody td {
  padding-top: 14px;
  padding-bottom: 14px;
}

.apps-card .app-name-cell {
  gap: 12px;
}

.apps-card .app-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
}

/* Узкие экраны — не ломаем адаптив */
@media (max-width: 1180px) {
  .apps-card table th:nth-child(8),
  .apps-card table td:nth-child(8),
  .apps-card table th:nth-child(9),
  .apps-card table td:nth-child(9),
  .apps-card table th:nth-child(10),
  .apps-card table td:nth-child(10) {
    padding-left: 12px;
    padding-right: 12px;
  }

  .apps-card .release-status,
  .apps-card .fresh-release-badge,
  .apps-card .stable-badge,
  .apps-card .attention-badge {
    min-width: 86px;
    max-width: 108px;
  }
}

/* ===== Final compact status and actions override ===== */

.apps-card .row-actions,
.apps-card .row-actions-compact {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  white-space: nowrap !important;
}

.apps-card .row-actions-compact .action-icon-btn,
.apps-card .row-actions .action-icon-btn {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #dbe3ef !important;
  box-shadow: none !important;
  font-size: 15px !important;
}

.apps-card .row-actions-compact .action-history-btn,
.apps-card .row-actions .action-history-btn {
  width: auto !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  background: #f4f6ff !important;
  color: #3730a3 !important;
  border: 1px solid #e0e7ff !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.apps-card .status-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 28px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

.apps-card .status-release {
  color: #3730a3 !important;
  background: #eef2ff !important;
  border: 1px solid #c7d2fe !important;
}

.apps-card .status-stable {
  color: #475569 !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

.apps-card .status-attention {
  color: #9f1239 !important;
  background: #fff1f2 !important;
  border: 1px solid #fecdd3 !important;
}

@media (max-width: 1180px) {
  .apps-card .row-actions,
  .apps-card .row-actions-compact {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  .apps-card .row-actions .scan-btn,
  .apps-card .row-actions .history-btn,
  .apps-card .row-actions-compact .scan-btn,
  .apps-card .row-actions-compact .history-btn {
    width: auto !important;
  }
}

/* ===== Final compact attention status ===== */
.apps-card .attention-badge.compact-attention-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 28px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

.apps-card .attention-badge.compact-attention-badge strong,
.apps-card .attention-badge.compact-attention-badge small {
  display: none !important;
}

.apps-card .attention-fresh.compact-attention-badge {
  color: #3730a3 !important;
  background: #eef2ff !important;
  border: 1px solid #c7d2fe !important;
}

.apps-card .attention-stable.compact-attention-badge {
  color: #475569 !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

.apps-card .attention-risk.compact-attention-badge {
  color: #9f1239 !important;
  background: #fff1f2 !important;
  border: 1px solid #fecdd3 !important;
}

.apps-card .attention-growth.compact-attention-badge {
  color: #166534 !important;
  background: #dcfce7 !important;
  border: 1px solid #bbf7d0 !important;
}

/* ===== Final table compact layout: release/status/actions ===== */

/* Делаем таблицу визуально плотнее без изменения данных */
.apps-card table {
  table-layout: auto !important;
}

/* Последний релиз */
.apps-card table th:nth-child(8),
.apps-card table td:nth-child(8) {
  width: 108px !important;
  min-width: 108px !important;
  max-width: 108px !important;
  padding-right: 8px !important;
}

/* Статус */
.apps-card table th:nth-child(9),
.apps-card table td:nth-child(9) {
  width: 118px !important;
  min-width: 118px !important;
  max-width: 118px !important;
  padding-left: 6px !important;
  padding-right: 8px !important;
}

/* Действие */
.apps-card table th:nth-child(10),
.apps-card table td:nth-child(10) {
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
  padding-left: 8px !important;
}

/* Кнопки действий строго в одну строку */
.apps-card td:nth-child(10) .row-actions,
.apps-card .row-actions {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  width: auto !important;
}

/* Кнопка проверки — компактная светлая */
.apps-card td:nth-child(10) .scan-btn {
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
  color: #334155 !important;
  border: 1px solid #dbe3ef !important;
  box-shadow: none !important;
  font-size: 14px !important;
  line-height: 1 !important;
}

/* История — компактная рядом */
.apps-card td:nth-child(10) .history-btn {
  width: auto !important;
  min-width: 76px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  background: #f4f6ff !important;
  color: #3730a3 !important;
  border: 1px solid #e0e7ff !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

/* Убираем старое поведение, где кнопки складывались вертикально */
@media (max-width: 1180px) {
  .apps-card td:nth-child(10) .row-actions,
  .apps-card .row-actions {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  .apps-card td:nth-child(10) .scan-btn,
  .apps-card td:nth-child(10) .history-btn {
    width: auto;
  }

  .apps-card td:nth-child(10) .scan-btn {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
  }
}

/* ===== Fix table header columns alignment ===== */

/* Таблица не должна сжиматься до поломки заголовков */
.apps-card .desktop-table {
  overflow-x: auto !important;
}

.apps-card .desktop-table table {
  width: 100% !important;
  min-width: 1180px !important;
  table-layout: fixed !important;
}

/* Заголовки держим аккуратно */
.apps-card table th {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  vertical-align: middle !important;
}

/* № */
.apps-card table th:nth-child(1),
.apps-card table td:nth-child(1) {
  width: 42px !important;
}

/* Приложение */
.apps-card table th:nth-child(2),
.apps-card table td:nth-child(2) {
  width: 210px !important;
}

/* Сегмент */
.apps-card table th:nth-child(3),
.apps-card table td:nth-child(3) {
  width: 70px !important;
  text-align: center !important;
}

/* Версия */
.apps-card table th:nth-child(4),
.apps-card table td:nth-child(4) {
  width: 88px !important;
}

/* Рейтинг */
.apps-card table th:nth-child(5),
.apps-card table td:nth-child(5) {
  width: 92px !important;
}

/* Δ рейтинга */
.apps-card table th:nth-child(6),
.apps-card table td:nth-child(6) {
  width: 150px !important;
}

/* Оценок */
.apps-card table th:nth-child(7),
.apps-card table td:nth-child(7) {
  width: 118px !important;
}

/* Последний релиз */
.apps-card table th:nth-child(8),
.apps-card table td:nth-child(8) {
  width: 130px !important;
  min-width: 130px !important;
  max-width: 130px !important;
}

/* Статус */
.apps-card table th:nth-child(9),
.apps-card table td:nth-child(9) {
  width: 122px !important;
  min-width: 122px !important;
  max-width: 122px !important;
}

/* Действие */
.apps-card table th:nth-child(10),
.apps-card table td:nth-child(10) {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
}

/* Кнопки действий рядом */
.apps-card table td:nth-child(10) .row-actions {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

/* Компактные кнопки без вертикального складывания */
.apps-card table td:nth-child(10) .scan-btn {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
}

.apps-card table td:nth-child(10) .history-btn {
  width: auto !important;
  min-width: 78px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 12px !important;
}

/* Статус компактный, но не ломает колонку */
.apps-card .attention-badge.compact-attention-badge {
  max-width: 108px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ===== Clean sortable table headers ===== */

/* Заголовки с сортировкой не должны обрезать активную кнопку */
.apps-card table th {
  overflow: visible !important;
}

/* Сами кнопки сортировки делаем спокойными, без огромной плашки */
.apps-card .sort-header {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  width: auto !important;
  max-width: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #475569 !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  white-space: normal !important;
  text-align: left !important;
}

/* Наведение — без страшной синей плашки */
.apps-card .sort-header:hover {
  background: transparent !important;
  color: #3730a3 !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Активная сортировка — подчёркиваем текстом и маленькой точкой, а не большой кнопкой */
.apps-card .sort-header.active {
  background: transparent !important;
  color: #3730a3 !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Иконка направления сортировки */
.apps-card .sort-header .sort-indicator {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 999px !important;
  background: #eef2ff !important;
  color: #4f46e5 !important;
  font-size: 10px !important;
  line-height: 1 !important;
  flex: 0 0 16px !important;
}

/* Если внутри кнопки есть старая info-иконка — не даём ей раздувать заголовок */
.apps-card .sort-header svg,
.apps-card .sort-header .info-icon {
  width: 12px !important;
  height: 12px !important;
  flex: 0 0 12px !important;
}

/* Для длинного заголовка Δ рейтинга разрешаем две строки аккуратно */
.apps-card table th:nth-child(6) .sort-header {
  max-width: 130px !important;
}

/* Последний релиз — не обрезать и не наезжать на статус */
.apps-card table th:nth-child(8) .sort-header {
  max-width: 120px !important;
}

/* Статус и действие без сжатия */
.apps-card table th:nth-child(9),
.apps-card table th:nth-child(10) {
  white-space: nowrap !important;
}

/* ===== Market signals ===== */

.market-signals-card {
  padding-bottom: 24px;
}

.market-signals-head {
  margin-bottom: 14px;
}

.market-signals-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.market-signal {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  min-height: 138px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.market-signal-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.market-signal-body {
  min-width: 0;
}

.market-signal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.market-signal-title-row strong {
  font-size: 13px;
  font-weight: 950;
  color: #0f172a;
}

.market-signal-title-row span {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 950;
  color: #4338ca;
}

.market-signal-app {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 8px;
}

.market-signal-app .app-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  flex: 0 0 24px;
}

.market-signal-app b {
  display: block;
  min-width: 0;
  font-size: 12px;
  font-weight: 900;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-signal p {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 700;
}

.market-signal-action {
  position: absolute;
  right: 10px;
  bottom: 10px;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 10px !important;
  font-size: 11px !important;
  border-radius: 9px !important;
}

.market-signal-risk {
  border-color: #fecdd3;
  background: linear-gradient(180deg, #fff8f8 0%, #ffffff 100%);
}

.market-signal-risk .market-signal-icon {
  color: #be123c;
  background: #fff1f2;
  border-color: #fecdd3;
}

.market-signal-release-risk {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
}

.market-signal-release-risk .market-signal-icon {
  color: #c2410c;
  background: #fff7ed;
  border-color: #fed7aa;
}

.market-signal-volume {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f7fff9 0%, #ffffff 100%);
}

.market-signal-volume .market-signal-icon {
  color: #15803d;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.market-signal-release {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #f8f9ff 0%, #ffffff 100%);
}

.market-signal-release .market-signal-icon {
  color: #4338ca;
  background: #eef2ff;
  border-color: #c7d2fe;
}

.market-signals-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  background: #f8fafc;
}

@media (max-width: 1180px) {
  .market-signals-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .market-signals-list {
    grid-template-columns: 1fr;
  }

  .market-signal {
    min-height: 0;
  }

  .market-signal-action {
    position: static;
    grid-column: 2;
    margin-top: 10px;
    justify-self: flex-start;
  }
}

/* ===== Market signal: release + growth ===== */
.market-signal-release-growth {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.92), rgba(255, 255, 255, 0.98));
}

.market-signal-release-growth .market-signal-icon {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.24);
}

/* ===== Market signals final compact layout ===== */
.market-signals-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.market-signal {
  min-height: 150px;
  padding: 16px;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto 1fr auto;
  column-gap: 12px;
  row-gap: 8px;
  align-items: start;
  overflow: hidden;
}

.market-signal-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 14px;
}

.market-signal-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.market-signal-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.market-signal-title-row strong,
.market-signal-app b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-signal-title-row span {
  white-space: nowrap;
}

.market-signal-app {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.market-signal-app .app-icon,
.market-signal-app img {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 7px;
}

.market-signal p {
  margin: 0;
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.market-signal-action {
  grid-column: 2;
  justify-self: end;
  align-self: end;
  min-height: 32px;
  padding: 0 18px;
  border-radius: 10px;
}

@media (max-width: 1280px) {
  .market-signals-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .market-signals-list {
    grid-template-columns: 1fr;
  }

  .market-signal {
    min-height: auto;
  }
}

/* ===== Market signals compact stable override ===== */
.market-signals-card {
  overflow: hidden;
}

.market-signals-list {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: stretch !important;
}

.market-signal {
  min-height: 136px !important;
  padding: 14px 14px 12px !important;
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr) !important;
  grid-template-rows: auto auto 1fr auto !important;
  gap: 8px 12px !important;
  align-items: start !important;
  overflow: hidden !important;
}

.market-signal-icon {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  font-size: 14px !important;
}

.market-signal-body {
  grid-column: 2 !important;
  grid-row: 1 / span 3 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
}

.market-signal-title-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
  align-items: center !important;
  min-width: 0 !important;
}

.market-signal-title-row strong {
  font-size: 14px !important;
  line-height: 1.2 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.market-signal-title-row span {
  font-size: 12px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
}

.market-signal-app {
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.market-signal-app .app-icon,
.market-signal-app img {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  border-radius: 7px !important;
}

.market-signal-app b {
  font-size: 13px !important;
  line-height: 1.2 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.market-signal p {
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  color: #536179 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.market-signal-action {
  grid-column: 2 !important;
  grid-row: 4 !important;
  justify-self: end !important;
  align-self: end !important;
  min-height: 30px !important;
  height: 30px !important;
  padding: 0 18px !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  line-height: 30px !important;
}

@media (max-width: 1280px) {
  .market-signals-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .market-signals-list {
    grid-template-columns: 1fr !important;
  }

  .market-signal {
    min-height: auto !important;
  }
}

/* ===== Market signals final visual polish ===== */
.market-signals-list {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.market-signal {
  min-height: 124px !important;
  padding: 13px 14px !important;
  border-radius: 18px !important;
}

.market-signal-title-row strong {
  font-size: 13px !important;
  letter-spacing: -0.01em !important;
}

.market-signal-title-row span {
  font-size: 11px !important;
}

.market-signal-app {
  gap: 7px !important;
}

.market-signal-app .app-icon,
.market-signal-app img {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
}

.market-signal-app b {
  font-size: 12.5px !important;
}

.market-signal p {
  font-size: 11.5px !important;
  line-height: 1.32 !important;
  -webkit-line-clamp: 2 !important;
}

.market-signal-action {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 16px !important;
  font-size: 11.5px !important;
  line-height: 28px !important;
}

.market-signal-icon {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  font-size: 13px !important;
}

.market-signal-release-growth {
  border-color: rgba(34, 197, 94, 0.32) !important;
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.88), rgba(255, 255, 255, 0.98)) !important;
}

.market-signal-risk {
  border-color: rgba(244, 63, 94, 0.26) !important;
}

.market-signal-release-risk {
  border-color: rgba(249, 115, 22, 0.34) !important;
}

/* ===== Market signals height fix ===== */
.market-signal {
  min-height: 150px !important;
  padding: 15px 15px 13px !important;
}

.market-signal p {
  min-height: 46px !important;
  -webkit-line-clamp: 3 !important;
  line-height: 1.35 !important;
}

.market-signal-body {
  gap: 8px !important;
}

.market-signal-action {
  margin-top: 2px !important;
}

@media (max-width: 1280px) {
  .market-signal {
    min-height: 150px !important;
  }
}

@media (max-width: 760px) {
  .market-signal {
    min-height: auto !important;
  }

  .market-signal p {
    min-height: auto !important;
    -webkit-line-clamp: 4 !important;
  }
}

/* ===== Market signals hover and action polish ===== */
.market-signal {
  cursor: default !important;
  position: relative !important;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease !important;
}

.market-signal:hover {
  transform: translateY(-3px) !important;
  box-shadow:
    0 18px 38px rgba(15, 23, 42, 0.08),
    0 6px 14px rgba(15, 23, 42, 0.05) !important;
}

.market-signal-release-risk:hover {
  border-color: rgba(249, 115, 22, 0.58) !important;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.99)) !important;
}

.market-signal-release-growth:hover,
.market-signal-volume:hover {
  border-color: rgba(34, 197, 94, 0.52) !important;
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.96), rgba(255, 255, 255, 0.99)) !important;
}

.market-signal-risk:hover {
  border-color: rgba(244, 63, 94, 0.48) !important;
  background: linear-gradient(180deg, rgba(255, 241, 242, 0.92), rgba(255, 255, 255, 0.99)) !important;
}

.market-signal-release:hover {
  border-color: rgba(99, 102, 241, 0.46) !important;
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.9), rgba(255, 255, 255, 0.99)) !important;
}

.market-signal-action {
  width: auto !important;
  min-width: 0 !important;
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  background: transparent !important;
  border: 1px solid rgba(99, 102, 241, 0.18) !important;
  color: #4338ca !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 24px !important;
  box-shadow: none !important;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease !important;
}

.market-signal-action:hover {
  background: #eef2ff !important;
  border-color: rgba(99, 102, 241, 0.34) !important;
  color: #312e81 !important;
  transform: translateY(-1px) !important;
}

.market-signal:hover .market-signal-action {
  background: rgba(238, 242, 255, 0.72) !important;
  border-color: rgba(99, 102, 241, 0.28) !important;
}

.market-signal:hover .market-signal-icon {
  transform: scale(1.04) !important;
}

.market-signal-icon {
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease !important;
}

/* ===== Signal detail drawer ===== */
.market-signal {
  cursor: pointer !important;
}

.signal-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.signal-detail-hero {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, #f8fafc, #ffffff);
}

.signal-detail-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  background: #eef2ff;
  color: #4338ca;
}

.signal-detail-hero span,
.signal-detail-card span {
  display: block;
  font-size: 11px;
  font-weight: 850;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.signal-detail-hero h3 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.2;
  color: #0f172a;
}

.signal-detail-hero p {
  margin: 0;
  color: #475569;
  line-height: 1.5;
}

.signal-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.signal-detail-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.signal-detail-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  color: #0f172a;
}

.signal-detail-card small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  line-height: 1.35;
}

.signal-detail-conclusion {
  grid-column: 1 / -1;
  background: #f8fafc;
}

.signal-detail-release-risk .signal-detail-icon {
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
}

.signal-detail-release-growth .signal-detail-icon {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.signal-detail-risk .signal-detail-icon {
  background: rgba(244, 63, 94, 0.12);
  color: #be123c;
}

.signal-detail-volume .signal-detail-icon {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.signal-detail-release .signal-detail-icon {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
}

@media (max-width: 760px) {
  .signal-detail-grid {
    grid-template-columns: 1fr;
  }

  .signal-detail-hero {
    grid-template-columns: 1fr;
  }
}

/* ===== Market signal dual actions ===== */
.market-signal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  align-self: flex-end;
}

.market-signal-actions .market-signal-action {
  min-width: auto;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.market-signal-why {
  background: #4f46e5 !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.18);
}

.market-signal-why:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.24);
}

@media (max-width: 760px) {
  .market-signal-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ===== Market signal buttons layout fix ===== */
.market-signals-list .market-signal {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) auto !important;
  align-items: start !important;
  column-gap: 12px !important;
  row-gap: 10px !important;
  min-height: 146px !important;
  padding: 16px !important;
}

.market-signals-list .market-signal-icon {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  flex: 0 0 auto !important;
}

.market-signals-list .market-signal-body {
  grid-column: 2 / 4 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  padding-right: 0 !important;
}

.market-signals-list .market-signal-actions {
  grid-column: 2 / 4 !important;
  grid-row: 2 !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 !important;
  align-self: end !important;
  position: static !important;
}

.market-signals-list .market-signal-action {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 78px !important;
  max-width: none !important;
  height: 30px !important;
  padding: 0 13px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
}

.market-signals-list .market-signal-why {
  min-width: 82px !important;
  background: #4f46e5 !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
}

.market-signals-list .market-signal p {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

@media (max-width: 760px) {
  .market-signals-list .market-signal {
    grid-template-columns: 32px minmax(0, 1fr) !important;
  }

  .market-signals-list .market-signal-body {
    grid-column: 2 !important;
  }

  .market-signals-list .market-signal-actions {
    grid-column: 1 / 3 !important;
  }
}

/* ===== Market signal Why button stable states ===== */
.market-signals-list .market-signal-why,
.market-signals-list .market-signal-why:visited,
.market-signals-list .market-signal-why:hover,
.market-signals-list .market-signal-why:active,
.market-signals-list .market-signal-why:focus,
.market-signals-list .market-signal-why:focus-visible {
  background: #4f46e5 !important;
  background-color: #4f46e5 !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
  opacity: 1 !important;
  text-shadow: none !important;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.18) !important;
  outline: none !important;
}

.market-signals-list .market-signal-why:hover {
  background: #4338ca !important;
  background-color: #4338ca !important;
  border-color: #4338ca !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

.market-signals-list .market-signal-why:active {
  background: #3730a3 !important;
  background-color: #3730a3 !important;
  border-color: #3730a3 !important;
  color: #ffffff !important;
  transform: translateY(0) !important;
}

.market-signals-list .market-signal-why:disabled,
.market-signals-list .market-signal-why[disabled] {
  background: #4f46e5 !important;
  background-color: #4f46e5 !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
  opacity: 1 !important;
  cursor: pointer !important;
}

.market-signals-list .market-signal-action:not(.market-signal-why),
.market-signals-list .market-signal-action:not(.market-signal-why):hover,
.market-signals-list .market-signal-action:not(.market-signal-why):active,
.market-signals-list .market-signal-action:not(.market-signal-why):focus,
.market-signals-list .market-signal-action:not(.market-signal-why):focus-visible {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #3730a3 !important;
  border-color: #d9ddff !important;
  opacity: 1 !important;
}

/* ===== Force stable visual state for Why button inside market signals ===== */
.market-signals-card .market-signals-list article.market-signal .market-signal-actions button.market-signal-why,
.market-signals-card .market-signals-list article.market-signal .market-signal-actions button.market-signal-why:hover,
.market-signals-card .market-signals-list article.market-signal .market-signal-actions button.market-signal-why:active,
.market-signals-card .market-signals-list article.market-signal .market-signal-actions button.market-signal-why:focus,
.market-signals-card .market-signals-list article.market-signal .market-signal-actions button.market-signal-why:focus-visible,
.market-signals-card .market-signals-list article.market-signal:hover .market-signal-actions button.market-signal-why,
.market-signals-card .market-signals-list article.market-signal:focus-within .market-signal-actions button.market-signal-why {
  background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
  background-color: #4f46e5 !important;
  color: #ffffff !important;
  border: 1px solid #4f46e5 !important;
  opacity: 1 !important;
  filter: none !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22) !important;
}

.market-signals-card .market-signals-list article.market-signal .market-signal-actions button.market-signal-why * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.market-signals-card .market-signals-list article.market-signal .market-signal-actions button.market-signal-why:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3) !important;
  background-color: #4338ca !important;
  color: #ffffff !important;
  border-color: #4338ca !important;
  transform: translateY(-1px) !important;
}

.market-signals-card .market-signals-list article.market-signal .market-signal-actions button.market-signal-why:active {
  background: linear-gradient(135deg, #3730a3, #312e81) !important;
  background-color: #3730a3 !important;
  color: #ffffff !important;
  border-color: #3730a3 !important;
  transform: translateY(0) !important;
}

.market-signals-card .market-signals-list article.market-signal .market-signal-actions button.market-signal-action:not(.market-signal-why),
.market-signals-card .market-signals-list article.market-signal .market-signal-actions button.market-signal-action:not(.market-signal-why):hover,
.market-signals-card .market-signals-list article.market-signal .market-signal-actions button.market-signal-action:not(.market-signal-why):active,
.market-signals-card .market-signals-list article.market-signal .market-signal-actions button.market-signal-action:not(.market-signal-why):focus,
.market-signals-card .market-signals-list article.market-signal:hover .market-signal-actions button.market-signal-action:not(.market-signal-why) {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #3730a3 !important;
  border: 1px solid #d9ddff !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #3730a3 !important;
  box-shadow: none !important;
}

/* Release history status badges */
.history-version-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.release-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}

.release-status-up {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.release-status-down {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

.release-status-neutral {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

/* =========================================================
   Mobile emergency fix — ConTrend
   Fixes iPhone layout, tables, spacing and horizontal overflow
   ========================================================= */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

@media (max-width: 760px) {
  body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: #f6f7fb;
    color: #111827;
  }

  .container,
  .page,
  main,
  section,
  header,
  footer {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(34px, 11vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.055em;
    word-break: normal;
    overflow-wrap: break-word;
  }

  h2 {
    font-size: clamp(24px, 7vw, 32px);
    line-height: 1.18;
    letter-spacing: -0.035em;
  }

  h3 {
    font-size: 20px;
    line-height: 1.25;
  }

  p {
    max-width: 100%;
    font-size: 16px;
    line-height: 1.55;
  }

  button,
  input,
  select,
  textarea {
    max-width: 100%;
    font-family: inherit;
  }

  .hero,
  .dashboard,
  .card,
  .panel,
  .section-card,
  .summary-card,
  .signal-card,
  .app-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .stats-grid,
  .summary-grid,
  .cards-grid,
  .signals-grid,
  .analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .filters,
  .tabs,
  .chips,
  .segment-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .filters > *,
  .tabs > *,
  .chips > *,
  .segment-filters > * {
    flex: 0 0 auto;
  }

  table {
    width: max-content;
    min-width: 820px;
    border-collapse: separate;
    border-spacing: 0;
  }

  .table-wrap,
  .apps-table-wrap,
  .logs-table-wrap,
  .monitoring-table-wrap,
  .data-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 18px;
  }

  th,
  td {
    white-space: nowrap;
    vertical-align: middle;
  }

  th {
    font-size: 12px;
    line-height: 1.2;
  }

  td {
    font-size: 13px;
    line-height: 1.35;
  }

  .admin-form,
  form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-form input,
  .admin-form button,
  form input,
  form button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .container,
  .page,
  main,
  section,
  header,
  footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  h1 {
    font-size: clamp(32px, 12vw, 44px);
  }

  .button-row,
  .actions,
  .toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .button-row button,
  .actions button,
  .toolbar button {
    width: 100%;
  }
}


/* =========================================================
   Mobile UX polish — ConTrend
   Makes mobile version usable as product dashboard
   ========================================================= */

@media (max-width: 760px) {
  body {
    background: #eef2f8;
  }

  /* Общий мобильный контейнер */
  .container,
  main,
  section {
    max-width: 430px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Первый экран */
  .hero,
  .hero-section,
  .top-section {
    border-radius: 0 0 28px 28px;
    padding-top: 28px;
    padding-bottom: 24px;
  }

  .hero h1,
  .top-section h1,
  h1 {
    font-size: 34px;
    line-height: 1.06;
    letter-spacing: -0.045em;
    margin-bottom: 14px;
  }

  .hero p,
  .top-section p {
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 22px;
  }

  /* Кнопки на первом экране */
  .hero button,
  .top-section button,
  .primary-button,
  .secondary-button {
    min-height: 46px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
  }

  /* KPI-карточки */
  .stats-grid,
  .summary-grid,
  .metrics-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-top: 16px;
  }

  .stat-card,
  .summary-card,
  .metric-card {
    min-height: auto !important;
    padding: 16px !important;
    border-radius: 18px !important;
  }

  .stat-card .value,
  .summary-card .value,
  .metric-card .value {
    font-size: 28px !important;
    line-height: 1.1 !important;
  }

  /* Блоки-секции */
  .section,
  .panel,
  .card,
  .section-card {
    border-radius: 22px !important;
    padding: 18px !important;
  }

  h2 {
    font-size: 25px !important;
    line-height: 1.15 !important;
    letter-spacing: -0.035em;
    margin-bottom: 10px;
  }

  h2 + p {
    font-size: 15px !important;
    line-height: 1.45 !important;
  }

  /* Периоды: 24 часа / 7 дней / 30 дней */
  .period-tabs,
  .tabs,
  .period-buttons {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .period-tabs button,
  .tabs button,
  .period-buttons button {
    width: 100%;
    min-height: 42px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
  }

  /* Сигналы рынка: запрещаем узкие 4 колонки */
  .signals-grid,
  .market-signals-grid,
  .signal-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  .signal-card,
  .market-signal-card,
  .signal-item {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: 42px 1fr auto !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 14px !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }

  .signal-card *,
  .market-signal-card *,
  .signal-item * {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
  }

  .signal-card .signal-icon,
  .market-signal-card .signal-icon,
  .signal-item .signal-icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
  }

  .signal-card .signal-title,
  .market-signal-card .signal-title,
  .signal-item .signal-title {
    font-size: 14px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
  }

  .signal-card .signal-value,
  .market-signal-card .signal-value,
  .signal-item .signal-value {
    font-size: 22px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    text-align: right !important;
  }

  .signal-card button,
  .market-signal-card button,
  .signal-item button {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 38px;
    border-radius: 12px;
    margin-top: 4px;
  }

  /* Фильтры сегментов */
  .segment-filters,
  .filters,
  .chips {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0 10px !important;
    margin: 12px 0 14px !important;
  }

  .segment-filters button,
  .filters button,
  .chips button,
  .chip {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: auto !important;
    min-height: 38px !important;
    padding: 0 16px !important;
    border-radius: 999px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  /* Карточки приложений */
  .apps-list,
  .app-list,
  .monitoring-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .app-card,
  .monitoring-card,
  .app-row {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 16px !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06) !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
  }

  .app-card *,
  .monitoring-card *,
  .app-row * {
    max-width: 100%;
  }

  .app-card-header,
  .app-header,
  .monitoring-card-header {
    display: grid !important;
    grid-template-columns: 44px 1fr auto !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
  }

  .app-icon,
  .app-logo,
  .store-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    object-fit: cover !important;
  }

  .app-name,
  .app-title {
    font-size: 16px !important;
    line-height: 1.2 !important;
    font-weight: 850 !important;
    margin: 0 !important;
  }

  .app-version,
  .app-segment,
  .app-meta {
    font-size: 12px !important;
    line-height: 1.25 !important;
    color: #64748b !important;
    margin-top: 2px !important;
  }

  .app-rating,
  .rating-value {
    font-size: 24px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    color: #15803d !important;
    text-align: right !important;
  }

  .app-card-body,
  .app-metrics,
  .monitoring-card-body {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .app-card-body > *,
  .app-metrics > *,
  .monitoring-card-body > * {
    min-width: 0 !important;
    padding: 11px !important;
    border-radius: 14px !important;
    background: #f1f5f9 !important;
  }

  .app-card-body .full,
  .app-metrics .full,
  .monitoring-card-body .full {
    grid-column: 1 / -1 !important;
  }

  .app-actions,
  .card-actions,
  .monitoring-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-top: 12px !important;
  }

  .app-actions button,
  .card-actions button,
  .monitoring-actions button,
  .app-card button,
  .monitoring-card button {
    width: 100% !important;
    min-height: 44px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
  }

  /* Админка на мобильном ниже — компактнее */
  .admin-section,
  .admin-form,
  .logs-section {
    margin-top: 22px !important;
  }

  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="search"] {
    min-height: 42px;
    border-radius: 12px;
    padding: 0 12px;
    font-size: 14px;
  }
}

@media (max-width: 430px) {
  .container,
  main,
  section {
    max-width: 100%;
  }

  .hero,
  .hero-section,
  .top-section {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .section,
  .panel,
  .card,
  .section-card {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .app-card-body,
  .app-metrics,
  .monitoring-card-body {
    grid-template-columns: 1fr !important;
  }
}


/* =========================================================
   Mobile signal layout — ConTrend
   Final readable mobile list for "Сигналы рынка"
   ========================================================= */

@media (max-width: 760px) {
  .ct-mobile-signal-section {
    overflow: hidden !important;
  }

  .ct-mobile-signal-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .ct-mobile-signal-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: 42px 1fr auto !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 14px !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06) !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    overflow: hidden !important;
  }

  .ct-mobile-signal-card * {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    transform: none !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    line-height: normal !important;
  }

  .ct-mobile-signal-icon {
    width: 38px !important;
    height: 38px !important;
    border-radius: 999px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    background: #eef2ff !important;
    color: #4f46e5 !important;
  }

  .ct-mobile-signal-card.is-up .ct-mobile-signal-icon {
    background: #dcfce7 !important;
    color: #15803d !important;
  }

  .ct-mobile-signal-card.is-down .ct-mobile-signal-icon {
    background: #fee2e2 !important;
    color: #dc2626 !important;
  }

  .ct-mobile-signal-main {
    min-width: 0 !important;
  }

  .ct-mobile-signal-title {
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: 850 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em !important;
  }

  .ct-mobile-signal-subtitle {
    margin-top: 3px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 650 !important;
    color: #64748b !important;
  }

  .ct-mobile-signal-value {
    font-size: 24px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    color: #0f172a !important;
    text-align: right !important;
    min-width: 28px !important;
  }

  .ct-mobile-signal-action {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  .ct-mobile-signal-action button,
  .ct-mobile-signal-action a {
    width: 100% !important;
    min-height: 38px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}


/* =========================================================
   Safe mobile market signals layout — ConTrend
   Keeps original card content, fixes only mobile layout.
   ========================================================= */

@media (max-width: 760px) {
  .ct-safe-market-section {
    overflow: hidden !important;
  }

  .ct-safe-market-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .ct-safe-market-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 14px !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
  }

  .ct-safe-market-card * {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    transform: none !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
  }

  .ct-safe-market-card button,
  .ct-safe-market-card a {
    width: auto !important;
    max-width: 100% !important;
  }
}


/* =========================================================
   Mobile compact cards — ConTrend
   Makes market signals and app cards denser on mobile
   ========================================================= */

@media (max-width: 760px) {
  /* Сигналы рынка: чуть плотнее */
  .ct-safe-market-list {
    gap: 8px !important;
  }

  .ct-safe-market-card {
    padding: 12px 14px !important;
    border-radius: 18px !important;
  }

  .ct-safe-market-card h3,
  .ct-safe-market-card h4,
  .ct-safe-market-card strong {
    font-size: 14px !important;
    line-height: 1.2 !important;
  }

  .ct-safe-market-card p,
  .ct-safe-market-card span,
  .ct-safe-market-card div {
    font-size: 12px;
    line-height: 1.3;
  }

  .ct-safe-market-card button,
  .ct-safe-market-card a {
    min-height: 34px !important;
    padding: 0 14px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
  }

  /* Карточки приложений: компактнее */
  .app-card,
  .monitoring-card,
  .app-row {
    padding: 14px !important;
    border-radius: 20px !important;
    margin-bottom: 12px !important;
  }

  .app-card-header,
  .app-header,
  .monitoring-card-header {
    grid-template-columns: 42px 1fr auto !important;
    gap: 10px !important;
    margin-bottom: 10px !important;
  }

  .app-icon,
  .app-logo,
  .store-icon {
    width: 38px !important;
    height: 38px !important;
    border-radius: 12px !important;
  }

  .app-name,
  .app-title {
    font-size: 15px !important;
    line-height: 1.18 !important;
  }

  .app-version,
  .app-segment,
  .app-meta {
    font-size: 11px !important;
    line-height: 1.2 !important;
  }

  .app-rating,
  .rating-value {
    font-size: 22px !important;
    line-height: 1 !important;
  }

  .app-card-body,
  .app-metrics,
  .monitoring-card-body {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 7px !important;
  }

  .app-card-body > *,
  .app-metrics > *,
  .monitoring-card-body > * {
    padding: 9px 10px !important;
    border-radius: 12px !important;
    min-height: 50px !important;
  }

  .app-card-body small,
  .app-metrics small,
  .monitoring-card-body small,
  .app-card-body span,
  .app-metrics span,
  .monitoring-card-body span {
    font-size: 11px !important;
    line-height: 1.2 !important;
  }

  .app-card-body strong,
  .app-metrics strong,
  .monitoring-card-body strong {
    font-size: 13px !important;
    line-height: 1.2 !important;
  }

  .app-actions,
  .card-actions,
  .monitoring-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 10px !important;
  }

  .app-actions button,
  .card-actions button,
  .monitoring-actions button,
  .app-card button,
  .monitoring-card button {
    min-height: 40px !important;
    border-radius: 13px !important;
    font-size: 13px !important;
    font-weight: 850 !important;
  }

  /* Фильтры сегментов — компактнее */
  .segment-filters,
  .filters,
  .chips {
    gap: 7px !important;
    margin: 10px 0 12px !important;
    padding-bottom: 8px !important;
  }

  .segment-filters button,
  .filters button,
  .chips button,
  .chip {
    min-height: 36px !important;
    padding: 0 14px !important;
    font-size: 13px !important;
  }
}

@media (max-width: 430px) {
  .app-card-body,
  .app-metrics,
  .monitoring-card-body {
    grid-template-columns: 1fr 1fr !important;
  }

  .app-actions,
  .card-actions,
  .monitoring-actions {
    grid-template-columns: 1fr 1fr !important;
  }
}


/* ===== Signal details: review themes in Почему drawer ===== */

.signal-review-themes {
  grid-column: 1 / -1;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.signal-review-themes-head {
  margin-bottom: 14px;
}

.signal-review-themes-head span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.signal-review-themes-head strong {
  display: block;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 950;
}

.signal-review-themes-head p,
.signal-review-themes-empty p {
  margin: 7px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 750;
}

.signal-review-theme-list {
  display: grid;
  gap: 10px;
}

.signal-review-theme {
  border: 1px solid #eef2f7;
  background: #f8fafc;
  border-radius: 16px;
  padding: 13px;
}

.signal-review-theme-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.signal-review-theme-top strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 950;
}

.signal-review-theme-top span {
  flex: 0 0 auto;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
}

.signal-review-theme-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.signal-review-theme-metrics div {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 9px;
}

.signal-review-theme-metrics span {
  display: block;
  color: #64748b;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 900;
  margin-bottom: 5px;
}

.signal-review-theme-metrics strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 950;
}

.signal-review-examples {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.signal-review-example {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 9px 10px;
}

.signal-review-example b {
  display: block;
  color: #111827;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 900;
  margin-bottom: 4px;
}

.signal-review-example span {
  display: block;
  color: #64748b;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
}

@media (max-width: 760px) {
  .signal-review-themes {
    padding: 13px;
    border-radius: 16px;
  }

  .signal-review-themes-head strong {
    font-size: 16px;
  }

  .signal-review-theme {
    padding: 12px;
  }

  .signal-review-theme-top {
    display: grid;
    gap: 8px;
  }

  .signal-review-theme-top span {
    justify-self: flex-start;
  }

  .signal-review-theme-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .signal-review-theme-metrics {
    grid-template-columns: 1fr;
  }
}

/* ===== Signal review themes in Why drawer ===== */

.signal-review-themes {
  grid-column: 1 / -1;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.signal-review-themes-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.signal-review-themes-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.signal-review-themes-head strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.signal-review-themes-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.signal-review-themes-summary div {
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  padding: 12px;
}

.signal-review-themes-summary span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 5px;
}

.signal-review-themes-summary strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.signal-review-theme-list {
  display: grid;
  gap: 10px;
}

.signal-review-theme-item {
  border: 1px solid #e5eaf2;
  border-radius: 16px;
  background: #f8fafc;
  padding: 12px;
}

.signal-review-theme-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.signal-review-theme-top strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}

.signal-review-theme-top span {
  color: #4338ca;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.signal-review-theme-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.signal-review-theme-metrics span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 850;
}

.signal-review-theme-examples {
  display: grid;
  gap: 8px;
}

.signal-review-theme-example {
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 10px;
}

.signal-review-theme-example b {
  display: block;
  color: #111827;
  font-size: 13px;
  font-weight: 950;
  margin-bottom: 5px;
}

.signal-review-theme-example p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
}

.signal-review-themes-empty p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
}

@media (max-width: 760px) {
  .signal-review-themes {
    padding: 14px;
    border-radius: 16px;
  }

  .signal-review-themes-summary {
    grid-template-columns: 1fr;
  }

  .signal-review-theme-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* ===== Expanded Why signal detail ===== */
.signal-detail-explain {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px;
}

.signal-detail-section {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.signal-detail-section-main {
  grid-row: span 2;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
}

.signal-detail-section span,
.signal-detail-observed-head span,
.signal-detail-checklist span {
  display: block;
  font-size: 11px;
  font-weight: 850;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.signal-detail-section h4 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.25;
  color: #0f172a;
}

.signal-detail-section p {
  margin: 0 0 8px;
  color: #334155;
  line-height: 1.55;
}

.signal-detail-section p:last-child {
  margin-bottom: 0;
}

.signal-detail-section small {
  display: block;
  margin-top: 8px;
  color: #64748b;
  line-height: 1.45;
}

.signal-detail-observed {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #f8fafc;
}

.signal-detail-observed-head {
  margin-bottom: 12px;
}

.signal-detail-observed-head strong {
  display: block;
  font-size: 16px;
  color: #0f172a;
}

.signal-detail-observed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.signal-detail-observed-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.signal-detail-observed-row span {
  color: #64748b;
  font-size: 13px;
}

.signal-detail-observed-row strong {
  text-align: right;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
}

.signal-detail-checklist {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(79, 70, 229, 0.16);
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.06), rgba(255, 255, 255, 0.98));
}

.signal-detail-checklist ul {
  margin: 0;
  padding-left: 18px;
  color: #334155;
}

.signal-detail-checklist li {
  margin: 7px 0;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .signal-detail-explain,
  .signal-detail-observed-grid {
    grid-template-columns: 1fr;
  }

  .signal-detail-section-main {
    grid-row: auto;
  }

  .signal-detail-observed-row {
    flex-direction: column;
    gap: 4px;
  }

  .signal-detail-observed-row strong {
    text-align: left;
  }
}

/* ===== Why drawer compact UX fix ===== */
.signal-detail-panel {
  gap: 14px;
}

.signal-detail-explain {
  grid-template-columns: 1fr;
}

.signal-detail-section {
  padding: 14px 16px;
}

.signal-detail-section-main {
  grid-row: auto;
}

.signal-detail-section h4 {
  font-size: 17px;
}

.signal-detail-section p {
  font-size: 15px;
  line-height: 1.5;
}

.signal-detail-observed {
  padding: 14px 16px;
}

.signal-detail-observed-grid {
  grid-template-columns: 1fr;
}

.signal-detail-observed-row {
  align-items: center;
}

.signal-detail-action-summary {
  padding: 15px 16px;
  border-radius: 20px;
  border: 1px solid rgba(79, 70, 229, 0.16);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.signal-detail-action-summary span {
  display: block;
  font-size: 11px;
  font-weight: 850;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.signal-detail-action-summary strong {
  display: block;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.4;
}

.signal-detail-checklist {
  padding: 15px 16px;
}

.signal-detail-checklist li {
  margin: 6px 0;
  line-height: 1.42;
}

.signal-detail-conclusion {
  padding: 16px;
  border-radius: 20px;
}

@media (min-width: 1100px) {
  .history-drawer-panel {
    width: min(760px, 56vw);
  }

  .signal-detail-hero {
    padding: 16px;
  }

  .signal-detail-explain {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .signal-detail-section-main {
    grid-row: span 2;
  }

  .signal-detail-observed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .history-drawer {
    align-items: stretch;
  }

  .history-drawer-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .history-drawer-head {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
  }

  .history-drawer-head h2 {
    font-size: 20px;
    line-height: 1.2;
  }

  .history-drawer-head p {
    font-size: 14px;
    line-height: 1.35;
  }

  .drawer-close {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .history-drawer-body {
    padding: 14px;
  }

  .signal-detail-panel {
    gap: 12px;
  }

  .signal-detail-hero {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
  }

  .signal-detail-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .signal-detail-hero h3 {
    font-size: 18px;
  }

  .signal-detail-hero p,
  .signal-detail-section p,
  .signal-detail-section small,
  .signal-detail-checklist li,
  .signal-detail-card strong,
  .signal-detail-action-summary strong {
    font-size: 14px;
    line-height: 1.42;
  }

  .signal-detail-section,
  .signal-detail-observed,
  .signal-detail-action-summary,
  .signal-detail-checklist,
  .signal-detail-conclusion {
    border-radius: 16px;
    padding: 13px 14px;
  }

  .signal-detail-observed-row {
    padding: 9px 10px;
    border-radius: 12px;
  }

  .signal-detail-observed-row span,
  .signal-detail-observed-row strong {
    font-size: 13px;
  }

  .signal-detail-checklist ul {
    padding-left: 16px;
  }
}

/* ===== Why drawer executive UX step ===== */
.signal-detail-assessment {
  padding: 15px 16px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.035);
}

.signal-detail-assessment span {
  display: block;
  font-size: 11px;
  font-weight: 850;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.signal-detail-assessment strong {
  display: block;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.38;
}

.signal-detail-explain {
  grid-template-columns: 1fr;
}

.signal-detail-section-main {
  grid-row: auto;
}

@media (min-width: 1100px) {
  .history-drawer-panel {
    width: min(820px, 54vw);
  }

  .signal-detail-explain {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signal-detail-section-main {
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .signal-detail-assessment {
    border-radius: 16px;
    padding: 13px 14px;
  }

  .signal-detail-assessment strong {
    font-size: 14px;
    line-height: 1.42;
  }
}



/* ===== Release reviews in signal drawer ===== */
.signal-release-reviews {
  grid-column: 1 / -1;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(79, 70, 229, 0.16);
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.signal-release-reviews-empty {
  border-color: rgba(148, 163, 184, 0.24);
  background: #f8fafc;
}

.signal-release-reviews-head span,
.signal-release-problems span,
.signal-release-review-examples span {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 850;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.signal-release-reviews-head strong {
  display: block;
  font-size: 17px;
  line-height: 1.28;
  color: #0f172a;
}

.signal-release-reviews p {
  margin: 8px 0 0;
  color: #475569;
  line-height: 1.5;
}

.signal-release-reviews-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.signal-release-reviews-summary div {
  padding: 11px;
  border-radius: 15px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.signal-release-reviews-summary span {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}

.signal-release-reviews-summary strong {
  display: block;
  font-size: 18px;
  color: #0f172a;
}

.signal-release-problems {
  margin-top: 14px;
}

.signal-release-problems div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.signal-release-problems b {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 850;
}

.signal-release-review-examples {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.signal-release-review-example {
  padding: 12px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.signal-release-review-example div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.signal-release-review-example strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  color: #0f172a;
}

.signal-release-review-example b {
  white-space: nowrap;
  font-size: 12px;
  color: #64748b;
}

.signal-release-review-example p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #475569;
}

@media (max-width: 760px) {
  .signal-release-reviews {
    padding: 14px;
    border-radius: 18px;
  }

  .signal-release-reviews-head strong {
    font-size: 15px;
  }

  .signal-release-reviews-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signal-release-review-example div {
    display: block;
  }

  .signal-release-review-example b {
    display: block;
    margin-top: 4px;
  }
}


.signal-release-reviews-loading {
  border-style: dashed;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.signal-release-reviews-loading .signal-release-reviews-head strong::after {
  content: "";
  display: inline-block;
  width: 1.1em;
  text-align: left;
  animation: releaseReviewsDots 1.2s steps(4, end) infinite;
}

@keyframes releaseReviewsDots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
  100% { content: ""; }
}


/* ===== Release review summary frontend state ===== */
.signal-release-reviews-skeleton {
  background: #f8fafc;
  border-style: dashed;
}

.signal-release-reviews-ready {
  border-color: rgba(79, 70, 229, 0.18);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.signal-release-reviews-empty {
  background: #f8fafc;
}

.signal-release-reviews-empty .signal-release-reviews-head strong {
  color: #334155;
}

.signal-release-reviews-ready .signal-release-reviews-head strong {
  color: #0f172a;
}

.signal-release-reviews-summary strong {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
  .signal-release-reviews-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Release reviews UX polish */
.signal-release-reviews-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.signal-release-reviews-head > div {
  min-width: 0;
}

.signal-release-reviews-head em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  max-width: 260px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.16);
  color: #4f46e5;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-align: center;
}

.signal-release-sentiment-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #92400e;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 650;
}

.signal-release-review-example b {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .history-drawer,
  .drawer,
  .signal-detail-panel {
    max-width: 100%;
  }

  .signal-detail-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .signal-detail-hero,
  .signal-detail-assessment,
  .signal-detail-action-summary,
  .signal-detail-observed,
  .signal-detail-checklist,
  .signal-detail-explain,
  .signal-detail-card,
  .signal-release-reviews,
  .signal-review-themes {
    border-radius: 18px;
  }

  .signal-detail-observed-grid,
  .signal-release-reviews-summary {
    grid-template-columns: 1fr;
  }

  .signal-detail-explain {
    grid-template-columns: 1fr;
  }

  .signal-release-reviews-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .signal-release-reviews-head em {
    max-width: 100%;
    width: fit-content;
  }

  .signal-release-problems div {
    gap: 8px;
  }

  .signal-release-problems b {
    font-size: 13px;
    line-height: 1.25;
  }

  .signal-release-review-example {
    padding: 14px;
  }

  .signal-release-review-example > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .signal-release-review-example p {
    font-size: 14px;
    line-height: 1.45;
  }

  .signal-release-sentiment-note {
    font-size: 13px;
    border-radius: 14px;
  }
}

@media (max-width: 520px) {
  .signal-detail-panel {
    padding-left: 10px;
    padding-right: 10px;
  }

  .signal-release-reviews-summary > div {
    padding: 12px;
  }

  .signal-release-reviews-summary strong {
    font-size: 20px;
  }

  .signal-release-reviews-head strong {
    font-size: 18px;
    line-height: 1.25;
  }

  .signal-release-review-examples > span,
  .signal-release-problems > span {
    font-size: 12px;
  }
}


/* Release conclusion source label */
.signal-conclusion-source {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: rgba(99, 102, 241, 0.06);
  color: #4f46e5;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .signal-conclusion-source {
    width: 100%;
    justify-content: center;
    text-align: center;
    font-size: 11px;
    padding: 7px 10px;
  }
}

/* Compact release review status badge */
.signal-release-status-badge {
  white-space: nowrap;
  max-width: 260px;
  text-align: center;
}

@media (max-width: 760px) {
  .signal-release-status-badge {
    max-width: 100%;
    white-space: normal;
    align-self: flex-start;
    font-size: 11px;
    line-height: 1.25;
    padding: 9px 12px;
  }
}

@media (max-width: 520px) {
  .signal-release-status-badge {
    width: auto;
  }
}


/* ===== Link buttons fix ===== */
a.primary-btn,
a.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  text-decoration: none;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
}

a.primary-btn {
  color: #ffffff;
}

a.secondary-btn {
  color: #ffffff;
}

.hero-actions a.secondary-btn {
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
  color: #ffffff;
  backdrop-filter: blur(10px);
}

.hero-actions a.secondary-btn:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .34);
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .hero-actions {
    flex-wrap: wrap;
  }

  .hero-actions a.secondary-btn,
  .hero-actions button {
    width: 100%;
  }
}

/* ===== Hero actions inline layout fix ===== */
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
}

.hero-actions .primary-btn,
.hero-actions .secondary-btn,
.hero-actions a.primary-btn,
.hero-actions a.secondary-btn {
  min-height: 52px;
  height: 52px;
  padding: 0 22px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.hero-actions a.secondary-btn {
  min-width: 180px;
}

.hero-actions #runAllBtn {
  min-width: 260px;
}

.hero-actions #refreshBtn {
  min-width: 190px;
}

@media (max-width: 1180px) {
  .hero-actions {
    gap: 10px;
  }

  .hero-actions .primary-btn,
  .hero-actions .secondary-btn,
  .hero-actions a.primary-btn,
  .hero-actions a.secondary-btn {
    padding: 0 18px;
    font-size: 14px;
  }

  .hero-actions #runAllBtn {
    min-width: 230px;
  }

  .hero-actions a.secondary-btn {
    min-width: 160px;
  }

  .hero-actions #refreshBtn {
    min-width: 170px;
  }
}

@media (max-width: 900px) {
  .hero-inner {
    align-items: flex-start;
  }

  .hero-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero-actions .primary-btn,
  .hero-actions .secondary-btn,
  .hero-actions a.primary-btn,
  .hero-actions a.secondary-btn {
    width: auto;
  }
}

@media (max-width: 720px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .primary-btn,
  .hero-actions .secondary-btn,
  .hero-actions a.primary-btn,
  .hero-actions a.secondary-btn {
    width: 100%;
    min-width: 0;
  }
}

/* ===== ConTrend site footer ===== */
.site-footer {
  margin-top: 56px;
  padding: 42px 32px 28px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -20px 60px rgba(15, 23, 42, 0.04);
  color: #64748b;
}

.site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(180px, 0.7fr) minmax(260px, 1fr);
  gap: 48px;
  align-items: start;
}

.site-footer__brand {
  display: grid;
  gap: 14px;
}

.site-footer__logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer__logo-row strong {
  color: #111827;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.site-footer__logo-mark {
  width: 34px;
  height: 34px;
  display: inline-block;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.site-footer__brand p,
.site-footer__contact p {
  margin: 0;
  max-width: 440px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.65;
}

.site-footer__title {
  margin-bottom: 14px;
  color: #111827;
  font-size: 15px;
  font-weight: 800;
}

.site-footer__links {
  display: grid;
  gap: 10px;
}

.site-footer__links a,
.site-footer__contact a {
  color: #475569;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.4;
  transition: color 0.18s ease, transform 0.18s ease;
}

.site-footer__links a:hover,
.site-footer__contact a:hover {
  color: #2563eb;
  transform: translateX(2px);
}

.site-footer__contact {
  display: grid;
  gap: 12px;
}

.site-footer__contact a {
  color: #2563eb;
  font-weight: 700;
}

.site-footer__bottom {
  max-width: 1180px;
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  color: #94a3b8;
  font-size: 14px;
}

@media (max-width: 900px) {
  .site-footer {
    padding: 34px 22px 24px;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .site-footer__bottom {
    margin-top: 26px;
  }
}

/* ===== Install app CTA in hero ===== */
.install-app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 16px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: #ffffff;
  color: #1e3a8a;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.16);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}

.install-app-btn:hover {
  transform: translateY(-1px);
  background: #f8fbff;
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.22);
}

@media (max-width: 760px) {
  .install-app-btn {
    width: 100%;
    min-height: 50px;
  }
}

/* ===== Signal drawer: client review reaction block ===== */
.signal-review-reaction {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.signal-review-reaction h3 {
  margin: 6px 0 18px;
  color: #111827;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 850;
}

.signal-block-label,
.signal-mini-label {
  color: #64748b;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.signal-review-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.signal-review-stat {
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: #f8fafc;
}

.signal-review-stat span {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.signal-review-stat strong {
  color: #111827;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.signal-theme-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.signal-theme-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #312e81;
  font-size: 13px;
  font-weight: 800;
}

.signal-review-examples {
  margin-top: 18px;
}

.signal-review-card {
  margin-top: 10px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: #ffffff;
}

.signal-review-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.signal-review-card__head strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 850;
}

.signal-review-card__head span {
  flex: 0 0 auto;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.signal-review-card p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.55;
}

.signal-review-conclusion {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: #f8fafc;
}

.signal-review-conclusion strong {
  display: block;
  margin-top: 6px;
  color: #111827;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 850;
}

@media (max-width: 640px) {
  .signal-review-reaction {
    margin-top: 16px;
    padding: 16px;
    border-radius: 20px;
  }

  .signal-review-reaction h3 {
    font-size: 19px;
  }

  .signal-review-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .signal-review-card__head {
    display: block;
  }

  .signal-review-card__head span {
    display: block;
    margin-top: 4px;
  }
}
