@media screen {
  html:root {
    background-color: #092d43;
    background-image: linear-gradient(145deg, #061c2e55, #09283b9e 60%, #061c2ed9),
      url("sp-economia-circular-3d.webp?v=eco-bi");
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
  }

  html:root body.institutional-page { background: transparent; }

  html:root::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at 76% 26%, #64c7d444, transparent 56%);
  }

  html:root[data-theme] #market-main > nav button[data-tab] {
    color: #f4faff !important;
    background: transparent !important;
  }

  html:root[data-theme] #market-main > nav button[data-tab]:is(:hover, :active, :focus-visible) {
    background: #24495e !important;
  }

  html:root[data-theme] #market-main > nav button[data-tab][aria-selected="true"] {
    background: linear-gradient(140deg, #24605d, #24495e) !important;
  }

  html:root[data-theme] #market-main > nav button[data-tab]:focus-visible {
    outline: 2px solid #8de2ff !important;
    outline-offset: -3px;
  }

  #market-main #history {
    --history-accent: #4b48c7;
    --history-accent-ink: #3936a5;
    --history-filter-bg: linear-gradient(145deg, #eef3ff, #f8fbff 62%, #edf8ff);
    --history-insight-bg: linear-gradient(115deg, #e5f7f3, #f2fbfa 68%, #edf2ff);
    --history-edge: #b8c9f0;
    font-family: "DM Sans", system-ui, sans-serif;
  }

  :root[data-theme="dark"] #market-main #history {
    --history-accent: #a7abff;
    --history-accent-ink: #c6d0ff;
    --history-filter-bg: linear-gradient(145deg, #1a2747, #172c42);
    --history-insight-bg: linear-gradient(115deg, #103b3e, #192d49);
    --history-edge: #526789;
  }

  #market-main #history :is(h2, h3, label, button, input, select, .history-chart text) {
    font-family: inherit;
  }

  #market-main #history h2 {
    font-size: clamp(1.45rem, 2.5vw, 1.95rem);
    letter-spacing: -.035em;
    font-weight: 700;
  }

  #market-main #history h3 {
    font-size: 1.125rem;
    letter-spacing: -.015em;
    font-weight: 700;
  }

  #market-main #history :is(.panel-head p, #market-history-status, #market-history-insight-list) {
    font-size: .9375rem;
    line-height: 1.55;
  }

  #market-main #history .history-controls {
    background: var(--history-filter-bg);
    border-color: var(--history-edge);
  }

  #market-main #history .history-controls .market-filter-heading {
    background: linear-gradient(105deg, #4448c4, #224aaa 65%, #135771);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
  }

  #market-main #history .history-controls :is(label, button, select, input) {
    font-size: .9375rem;
  }

  #market-main #history .history-controls :is(label, button) {
    font-weight: 700;
  }

  #market-main #history #market-history-search {
    background: linear-gradient(110deg, #5146ca, #2957ba);
    color: #fff;
  }

  #market-main #history #market-history-search:not(:disabled):hover {
    background: linear-gradient(110deg, #3e34ab, #17449f);
  }

  #market-main #history #market-history-insights {
    background: var(--history-insight-bg);
    border-inline-start: 4px solid var(--history-accent);
    padding: .9rem 1rem;
  }

  #market-main #history #market-history-insight-list strong {
    font-variant-numeric: tabular-nums;
    color: var(--ink);
  }

  #market-main #history #market-history-insight-list :is(a, button) {
    color: var(--history-accent-ink);
    font-weight: 700;
  }

  #market-main :is(.indicator-row strong, .history-kpi strong) {
    font-variant-numeric: tabular-nums;
    letter-spacing: -.025em;
  }

  #market-main .indicator-row strong { font-size: clamp(1rem, 1.65vw, 1.6rem); }

  #market-main :is(.track > .bar, .comparison-change-track > i) {
    border-radius: 999px;
    background-image: linear-gradient(180deg, #fff9, transparent 36%, #081b2f15 62%, #081b2f9c),
      url("industrial-residue-texture.webp") !important;
    background-size: 100% 100%, auto 1.5rem;
    background-blend-mode: normal, soft-light;
    box-shadow: inset 0 1px #ffffff9e, inset 0 -2px #09173155;
  }

  #market-main .row:is(:focus-visible, :hover) .track > .bar { filter: brightness(1.17) saturate(1.16); }

  #market-main :is(.history-chart, .monthly-chart) circle[role="button"] {
    filter: drop-shadow(0 2px 2px #0b2b5266);
  }

  #market-main :is(.market-history-line > path[stroke], .history-chart > polyline[stroke]) {
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 4;
    filter: saturate(1.55) contrast(1.08) drop-shadow(0 2px 2px #283da048);
  }

  #market-main :is(.market-history-line, .history-chart:has(> polyline)) circle[role="button"] {
    stroke-width: 3;
    filter: saturate(1.5) drop-shadow(0 1px 3px #233da35c);
  }

  #market-main :is(.market-history-line, .history-chart:has(> polyline)) circle[role="button"]:is(:hover, :focus-visible) {
    opacity: 1;
    stroke-width: 4;
    filter: saturate(1.65) drop-shadow(0 0 4px #5277eb8c);
  }

  #market-main .market-history-line :is(.history-point-mass, .history-growth, .history-decline) {
    font-weight: 750;
  }

  html:root[data-theme="light"] #market-main .market-history-line .history-growth { fill: #137247; }
  html:root[data-theme="light"] #market-main .market-history-line .history-decline { fill: #a32e48; }
  html:root[data-theme="dark"] #market-main .market-history-line .history-growth { fill: #80deb0; }
  html:root[data-theme="dark"] #market-main .market-history-line .history-decline { fill: #ffa5b2; }

  #market-main .market-history-line {
    border-radius: 1rem;
    background: radial-gradient(ellipse at 82% 8%, #5d6cf00e, transparent 60%);
  }

  #market-main .history-point-guide { stroke-dasharray: 3 4; opacity: .55; }
  #market-main .history-badge rect { filter: drop-shadow(0 2px 2px #172b5952); }
  #market-main .history-badge text { fill: #fff; }
  #market-main .history-badge-year rect { fill: #303b98; }
  #market-main .history-badge-up rect { fill: #227044; }
  #market-main .history-badge-down rect { fill: #a32e48; }
  #market-main .history-badge-neutral rect { fill: #52617c; }
  #market-main .history-badge-mass rect { fill: var(--surface); stroke-width: 1.25; }
  #market-main .history-badge-mass text { fill: var(--ink); }

  #market-main .pie-slice { stroke: #ffffff55; stroke-width: 1px; }

  #market-main :is(.pie-slice, .destination-mind-node, .destination-mind-branch):is(:hover, :focus-visible) {
    filter: brightness(1.17);
  }

  #market-main .destination-mind-branch:focus-visible .destination-mind-stroke { stroke-width: 5; }

  @media (prefers-reduced-motion: no-preference) {
    html:root::before {
      animation: market-scene-light 2.2s ease-out both;
    }

    #market-main :is(.track > .bar, .comparison-change-track > i) {
      animation: market-bar-grow .44s cubic-bezier(.2,.7,.3,1) both;
      transform-origin: left center;
    }

    #market-main :is(.market-history-line > path[stroke], .history-chart > polyline[stroke]) {
      animation: market-series-in .48s ease-out both;
      transform-box: fill-box;
      transform-origin: center bottom;
    }

    #market-main .indicator-row:hover {
      translate: 0 -2px;
    }

    #market-main .indicator-row {
      transition: translate .16s ease-out, box-shadow .16s ease-out;
    }
  }

  @keyframes market-scene-light { from { opacity: 0; } to { opacity: .72; } }
  @keyframes market-bar-grow { from { scale: .03 1; } }
  @keyframes market-series-in { from { opacity: 0; translate: 0 3px; } }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation: none !important;
      transition: none !important;
      scroll-behavior: auto !important;
    }
  }

  @media (forced-colors: active) {
    html:root[data-theme] #market-main > nav button[data-tab] {
      color: ButtonText !important;
      background: ButtonFace !important;
    }

    html:root[data-theme] #market-main > nav button[data-tab]:is(:hover, :active, [aria-selected="true"]) {
      color: HighlightText !important;
      background: Highlight !important;
    }

    html:root[data-theme] #market-main > nav button[data-tab]:focus-visible {
      outline-color: Highlight !important;
      outline-offset: 2px;
    }

    html:root { background-image: none; }
    html:root::before { display: none; }
    #market-main :is(.track > .bar, .comparison-change-track > i) { background: Highlight !important; }
  }
}

@media screen {
  #market-main .profile-waste-table {
    min-width: 60rem;
    font: .875rem/1.45 var(--market-font, system-ui), sans-serif;
  }

  #market-main .profile-waste-table :is(th, td) {
    padding: .65rem .75rem;
    font: inherit;
    vertical-align: top;
    overflow-wrap: break-word;
  }

  #market-main .profile-waste-table th,
  #market-main .profile-waste-table .profile-link { font-weight: 700; }

  #market-main .profile-waste-table .profile-link {
    font-family: inherit;
    font-size: inherit;
    text-align: start;
  }

  #market-main .profile-waste-table small { font: .8125rem/1.45 var(--market-font, system-ui), sans-serif; }
  #market-main .profile-waste-table .waste-col-code { width: 7.25rem; }
  #market-main .profile-waste-table .waste-col-year { width: 4rem; }
  #market-main .profile-waste-table .waste-col-company { width: 25%; }
  #market-main .profile-waste-table .waste-col-class { width: 6.5rem; }
  #market-main .profile-waste-table .waste-col-technology { width: 9rem; }
  #market-main .profile-waste-table .waste-col-unit { width: 6rem; }
  #market-main .profile-waste-table .waste-col-quantity { width: 8rem; }
  #market-main .profile-waste-table td:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
}
