/* market-signals.css — the Redding Market Signals dashboard.
   All rules namespaced under .ms and class-prefixed `ms-` so they never collide
   with the site's generic .card/.stat/.tab/.grid. Brand tokens are scoped here
   (distinct names from design-system.css). */

.ms {
  --ms-coral: #d97757;
  --ms-coral-dark: #c0492b;
  --ms-coral-tint: rgba(217, 119, 87, 0.1);
  --ms-ink: #141413;
  --ms-cream: #faf9f5;
  --ms-line: #e7e1d6;
  --ms-muted: #8a7e72;
  --ms-green: #3d7a4f;
  --ms-blue: #3a6ea5;
  --ms-blue-tint: rgba(58, 110, 165, 0.09);
  --ms-shadow: 0 1px 2px rgba(20, 20, 19, 0.04), 0 16px 34px -18px rgba(20, 20, 19, 0.16);
  --ms-shadow-lift: 0 2px 6px rgba(20, 20, 19, 0.06), 0 22px 44px -20px rgba(192, 73, 43, 0.3);
  --ms-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  position: relative;
  background: radial-gradient(1100px 560px at 50% -4%, #fcf8f1 0%, #f4efe6 60%, #ece4d7 100%);
  padding: 40px 16px 64px;
  color: var(--ms-ink);
  font-family: "Poppins", system-ui, sans-serif;
  overflow: hidden;
}
.ms::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/></svg>");
}
.ms-wrap {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.ms .ms-tnum {
  font-variant-numeric: tabular-nums lining-nums;
}

.ms-head {
  text-align: center;
  margin-bottom: 26px;
}
.ms-kicker {
  font-family: "Lora", Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ms-coral-dark);
  margin: 0 0 8px;
}
.ms-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin: 0 auto 8px;
  max-width: 16ch;
}
.ms-sub {
  font-family: "Lora", Georgia, serif;
  font-size: 16px;
  color: #5b5044;
  line-height: 1.55;
  margin: 0 auto 18px;
  max-width: 48ch;
}
.ms-legend {
  display: inline-flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  background: #fffdfa;
  border: 1px solid var(--ms-line);
  border-radius: 12px;
  padding: 9px 16px;
  font-size: 11.5px;
}
.ms-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #5b5044;
}
.ms-legend b {
  font-weight: 600;
}
.ms-legend .ms-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.ms-lg-live {
  background: var(--ms-green);
}
.ms-lg-samp {
  background: var(--ms-muted);
}

.ms-block {
  opacity: 0;
  transform: translateY(12px);
  animation: ms-rise 0.7s var(--ms-ease) forwards;
}
.ms-block:nth-of-type(1) {
  animation-delay: 0.04s;
}
.ms-block:nth-of-type(2) {
  animation-delay: 0.16s;
}
.ms-block:nth-of-type(3) {
  animation-delay: 0.28s;
}
@keyframes ms-rise {
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ms-block {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.ms-sec {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 12px;
}
.ms-sec-num {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ms-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ms-sec-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ms-coral-dark);
}

.ms-card {
  background: #fffdfa;
  border: 1px solid var(--ms-line);
  border-radius: 18px;
  box-shadow: var(--ms-shadow);
  margin-bottom: 26px;
  overflow: hidden;
}
.ms-pad {
  padding: 24px 26px;
}
@media (max-width: 560px) {
  .ms-pad {
    padding: 18px 16px;
  }
}

.ms-dash-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.ms-dash-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.ms-stamp {
  font-size: 11px;
  color: var(--ms-muted);
  background: var(--ms-cream);
  border: 1px solid var(--ms-line);
  border-radius: 99px;
  padding: 5px 13px;
  white-space: nowrap;
}
.ms-stamp b {
  color: var(--ms-coral-dark);
  font-weight: 600;
}

.ms-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.ms-tab {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: 99px;
  border: 1px solid var(--ms-line);
  color: #5b5044;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s var(--ms-ease);
}
.ms-tab:hover {
  border-color: var(--ms-coral);
  color: var(--ms-coral-dark);
  transform: translateY(-1px);
}
.ms-tab:focus-visible {
  outline: 2px solid var(--ms-coral);
  outline-offset: 2px;
}
.ms-tab.is-active {
  background: var(--ms-ink);
  color: #fff;
  border-color: var(--ms-ink);
  box-shadow: 0 6px 16px -8px rgba(20, 20, 19, 0.5);
}

.ms-mblock {
  margin-bottom: 18px;
}
.ms-mblock:last-child {
  margin-bottom: 0;
}
.ms-mhead {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
}
.ms-mtitle {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ms-ink);
}
.ms-mtitle.is-pending {
  color: var(--ms-blue);
}
.ms-tag {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ms-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.ms-tag-live {
  color: var(--ms-green);
  background: rgba(61, 122, 79, 0.1);
}
.ms-tag-live::before {
  background: var(--ms-green);
}
.ms-tag-samp {
  color: var(--ms-muted);
  background: rgba(138, 126, 114, 0.12);
}
.ms-tag-samp::before {
  background: var(--ms-muted);
}

.ms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
}
.ms-grid.is-three {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 560px) {
  .ms-grid,
  .ms-grid.is-three {
    grid-template-columns: repeat(2, 1fr);
  }
}
.ms-stat {
  background: linear-gradient(180deg, #fffdfa, var(--ms-cream));
  border: 1px solid var(--ms-line);
  border-radius: 13px;
  padding: 14px 15px;
}
.ms-stat.is-pend {
  background: linear-gradient(180deg, #fbfdff, #eef4fa);
  border-color: #d4e2ee;
}
.ms-stat-l {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ms-muted);
}
.ms-stat-v {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.04;
  margin-top: 5px;
  letter-spacing: -0.02em;
}
.ms-stat-v.is-blue {
  color: var(--ms-blue);
}
.ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 99px;
}
.ms-chip-down {
  color: var(--ms-coral-dark);
  background: var(--ms-coral-tint);
}
.ms-chip-up {
  color: var(--ms-green);
  background: rgba(61, 122, 79, 0.1);
}
.ms-chip-flat {
  color: var(--ms-muted);
  background: rgba(138, 126, 114, 0.1);
}
.ms-chip-blue {
  color: var(--ms-blue);
  background: var(--ms-blue-tint);
}
.ms-stat-s {
  font-size: 10.5px;
  margin-top: 6px;
  font-weight: 500;
  color: var(--ms-muted);
}
.ms-note {
  font-size: 11px;
  color: var(--ms-muted);
  font-style: italic;
  font-family: "Lora", Georgia, serif;
  margin: 11px 2px 0;
  line-height: 1.5;
}
.ms-pend-note {
  font-size: 11.5px;
  color: var(--ms-blue);
  font-style: italic;
  font-family: "Lora", Georgia, serif;
  margin: 9px 2px 0;
}
.ms-pend-note b {
  font-weight: 600;
}

.ms-chart {
  margin-top: 18px;
  background: linear-gradient(180deg, #fffdfa, var(--ms-cream));
  border: 1px solid var(--ms-line);
  border-radius: 14px;
  padding: 16px 18px 8px;
}
.ms-chart-head {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ms-muted);
  margin-bottom: 6px;
}
.ms-svg {
  width: 100%;
  height: auto;
  display: block;
}
.ms-svg .ms-axis {
  stroke: var(--ms-line);
  stroke-width: 1;
}
.ms-svg .ms-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ms-draw 1.05s var(--ms-ease) forwards;
}
@keyframes ms-draw {
  to {
    stroke-dashoffset: 0;
  }
}
.ms-svg .ms-area {
  opacity: 0;
  animation: ms-fade 0.9s ease 0.25s forwards;
}
@keyframes ms-fade {
  to {
    opacity: 1;
  }
}
.ms-empty {
  font-size: 12px;
  color: var(--ms-muted);
  font-style: italic;
  font-family: "Lora", Georgia, serif;
  padding: 22px 0;
  text-align: center;
}

.ms-strip {
  margin-top: 18px;
  background: var(--ms-ink);
  color: #f4f1ea;
  border-radius: 12px;
  padding: 13px 17px;
  font-size: 12px;
  display: flex;
  gap: 11px;
  align-items: center;
  line-height: 1.45;
}
.ms-strip b {
  color: #f0a988;
  font-weight: 600;
}

.ms-ct-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.ms-ct-head h3 {
  font-size: 21px;
  margin: 0;
  letter-spacing: -0.025em;
}
.ms-ct-sub {
  font-family: "Lora", Georgia, serif;
  font-size: 14px;
  color: #5b5044;
  margin: 0 0 16px;
  line-height: 1.55;
}
.ms-read {
  margin-top: 14px;
  background: linear-gradient(180deg, #fff8f4, #fffdfb);
  border: 1px solid #f2cdbb;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #5b5044;
}
.ms-read b {
  color: var(--ms-coral-dark);
}
