:root {
  --scc-chart-card-bg: #ffffff;
  --scc-chart-plot-bg: rgba(30, 120, 255, 0.03); /* very subtle blue */
  --scc-chart-border: rgba(0, 0, 0, 0.08);
  --scc-chart-text: rgba(0, 0, 0, 0.85);
  --scc-chart-muted: rgba(0, 0, 0, 0.55);
}

.scc-rose {
  background: var(--scc-chart-card-bg);
  border: 1px solid var(--scc-chart-border);
  border-radius: 18px;
  padding: 14px 14px 10px 14px;
  margin: 14px auto;
  max-width: 780px; /* keep it narrower than full-width sections */
  box-sizing: border-box;
}

.scc-rose__header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.scc-rose__title {
  font-weight: 700;
  font-size: 18px;
  color: var(--scc-chart-text);
  line-height: 1.2;
}

.scc-rose__legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--scc-chart-muted);
  align-items: flex-end;
}

.scc-rose__legend-item {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.scc-rose__swatch {
  width: 18px;
  height: 0;
  border-top: 3px solid;
  border-radius: 2px;
  display: inline-block;
}

.scc-rose__swatch--stormglass { border-top-color: #2563eb; }
.scc-rose__swatch--meteoblue { border-top-color: #16a34a; }
.scc-rose__swatch--noaa { border-top-color: #dc2626; border-top-style: dashed; }

.scc-rose__legend-item.is-missing {
  opacity: 0.45;
}

.scc-rose__chart {
  position: absolute;
  inset: 0;
  margin: 0;
  height: 100%;
  max-width: none;
  background: transparent;
  border: 0;
  border-radius: 16px;
}

.scc-rose__chartwrap{
  position: relative;
  max-width: 560px;
  margin: 12px auto 10px auto;
  height: 260px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  background: var(--scc-chart-plot-bg);
}

.scc-rose__mapbg{
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #e9eef3;
  background-image: var(--scc-rose-mapbg);
  background-size: cover;
  background-position: center;
  filter: saturate(.9) contrast(1.02);
  opacity: .35;
}

.scc-rose__mapbg::after{
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.0) 0%, rgba(255,255,255,0.35) 55%, rgba(255,255,255,0.6) 100%);
}

.scc-rose__chartwrap .scc-rose__chart{
  margin: 0;
  height: 100%;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.scc-rose__chartwrap .scc-rose__chart > *{
  position: relative;
  z-index: 1;
}

.scc-rose__readout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 8px 2px 10px 2px;
  padding: 10px 10px;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 14px;
  background: rgba(255,255,255,0.72);
}

.scc-rose__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--scc-chart-text);
}

.scc-rose__row-left {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.scc-rose__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.scc-rose__src {
  font-weight: 700;
  text-transform: capitalize;
}

.scc-rose__vals {
  color: var(--scc-chart-muted);
  white-space: nowrap;
}

.scc-rose__sub {
  font-size: 12px;
  color: var(--scc-chart-muted);
  margin-left: 18px;
}

.scc-rose__controls {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.scc-rose__btn {
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  color: var(--scc-chart-text);
  border-radius: 14px;
  height: 44px;
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

/* Native range remains for state/keyboard but is visually hidden; blocks are clickable. */
.scc-rose__range {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.scc-rose__timeline {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.02);
  min-height: 44px;
  overflow-x: auto;
  scrollbar-width: thin;
}

  .scc-rose__day{
    min-width: 92px;
    text-align: center;
    font-weight: 600;
    opacity: 0.85;
  }

  .scc-rose__blocks{
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    width: max-content;
    min-width: max-content;
  }

  .scc-rose__marks{
    position: relative;
    height: 16px;
    min-width: 520px;
  }

  .scc-rose__mark{
    position: absolute;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--scc-chart-muted);
  }

  .scc-rose__block {
    flex: 0 0 22px;
    width: 22px;
    height: 16px;
    border-radius: 6px;
    border: 2px solid rgba(0,0,0,0.12);
    background: rgba(0,0,0,0.04);
    cursor: pointer;
  }

  .scc-rose__block[data-active="1"],
  .scc-rose__block.is-active{
    outline: 3px solid rgba(0,0,0,0.75);
    outline-offset: 2px;
  }

/* Quality color classes for future rules-engine integration. */
.scc-rose__block.is-poor{ background: rgba(235, 87, 87, 0.50); border-color: rgba(235, 87, 87, 0.85); }
.scc-rose__block.is-moderate{ background: rgba(242, 201, 76, 0.55); border-color: rgba(242, 201, 76, 0.90); }
.scc-rose__block.is-good{ background: rgba(39, 174, 96, 0.45); border-color: rgba(39, 174, 96, 0.85); }
.scc-rose__block.is-excellent{ background: rgba(45, 156, 219, 0.45); border-color: rgba(45, 156, 219, 0.85); }

.scc-rose__time {
  min-width: 74px;
  text-align: right;
  font-size: 13px;
  color: var(--scc-chart-muted);
}

@media (max-width: 560px) {
  .scc-rose { padding: 12px; border-radius: 16px; }
  .scc-rose__title { font-size: 16px; }
  .scc-rose__chart { height: 240px; max-width: 100%; }
  .scc-rose__legend { font-size: 12px; }
  .scc-rose__block{ width: 18px; height: 30px; border-radius: 9px; }
}
