/* ------- ДЕСКТОПНА ВЕРСИЯ ------- */
    html {
      scroll-behavior: smooth;
    }

    body {
      background-color: #0b0d10;
      font-family: 'Segoe UI', sans-serif;
      margin: 0;
      padding: 40px 20px;
      display: flex;
      justify-content: center;

    }

    .parallax-bg {
      background: radial-gradient(circle at 18% 18%, rgba(0, 247, 255, 0.12), transparent 24%), radial-gradient(circle at 82% 12%, rgba(0, 184, 153, 0.10), transparent 22%), repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 72px), linear-gradient(135deg, #001826 0%, #002b3f 46%, #03111d 100%);
      background-size: cover;
      background-repeat: no-repeat;
      background-position: center;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 120%;
      z-index: -10;
      opacity: 0.9;
      transform: translateY(0px);
      will-change: transform;
    }

    .quotes-wrapper {
      /*background-color: #002B40;
       същият цвят като футъра */
      padding: 20px;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      justify-items: center;
      max-width: 960px;
      margin: 0 auto;
      gap: 22px;
    }

    .homepage-data-status {
      width: fit-content;
      max-width: calc(100%);
      max-height: 10px;
      margin: 4px auto;
      padding: 3px 6px;
      gap: 3px;
      border: 1px solid rgba(0, 247, 255, 0.28);
      border-radius: 999px;
      font-size: 7px;
      line-height: 1.2;
    }

    .homepage-data-status .site-data-status__spinner {
      width: 6px;
      height: 6px;
      border-width: 1px;
    }

    .homepage-data-status .site-data-status__retry {
      margin-left: 1px;
      padding: 2px 4px;
      border-radius: 4px;
    }

    .market-back-to-menu {
      position: fixed;
      right: max(16px, env(safe-area-inset-right));
      bottom: max(16px, env(safe-area-inset-bottom));
      z-index: 100;
      display: grid;
      place-items: center;
      width: 48px;
      height: 48px;
      padding: 0;
      border: 1px solid var(--site-border);
      border-radius: 12px;
      background: rgba(2, 45, 59, 0.96);
      color: var(--site-accent);
      box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
      font: 28px/1 'Segoe UI', sans-serif;
      cursor: pointer;
      transition: transform 180ms ease, background-color 180ms ease;
    }

    .market-back-to-menu[hidden] { display: none; }

    .market-back-to-menu:hover {
      transform: translateY(-3px);
      background: #064558;
    }

    .market-back-to-menu:focus-visible {
      outline: 2px solid var(--site-accent);
      outline-offset: 3px;
    }

    .market-category {
      margin: 0 auto 36px;
      border-top: 1px solid rgba(0, 247, 255, 0.4);
      scroll-margin-top: 20px;
    }

    .market-category .quotes-wrapper {
      /* Match the cards' outer width so both visible gaps stay at 22px. */
      grid-template-columns: repeat(auto-fill, 194px);
      justify-content: center;
      max-width: 1058px; /* Five 194px cards plus four 22px gaps. */
    }

    @media (max-width: 768px) and (orientation: portrait) {
      .market-category .quotes-wrapper {
        grid-template-columns: 194px;
      }
    }

    .market-category h2 {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 12px;
      max-width: 800px;
      margin: 0 auto;
      padding: 20px 20px 4px;
      color: var(--site-accent);
      font-size: 20px;
    }

    .market-category h2 span {
      color: #c8d0d9;
      font-size: 12px;
      font-weight: 400;
    }

    #quotes-box > .quote-time { text-align: center; }

    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      .market-back-to-menu { transition: none; }
    }

    .market-summary-row {
      padding: 0 0 6px;
      margin: 0 auto;
      width: min(100%, 660px);
      max-width: 660px;
    }

    .main-content > [data-site-header] > .shared-site-header {
      margin-bottom: 12px;
    }

    .market-summary-row .quotes-wrapper {
      max-width: 660px;
      padding: 0;
      gap: clamp(8px, 3.5vw, 38px);
      align-items: stretch;
    }

    .market-summary-row .quote-card {
      min-width: 160px;
    }

    .quote-card-wrap {
      width: fit-content;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0;
      cursor: pointer;
    }

    .quote-card-wrap .quote-card {
      width: auto;
      flex: 0 0 auto;
      box-sizing: content-box;
    }

    .quote-indicator-slot {
      width: 192px;
      flex: 0 0 auto;
      margin-top: 0;
      padding-top: 0;
      box-sizing: border-box;
      border: 1px solid rgba(0, 213, 255, 0.28);
      background: #10212f;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.45);
      display: flex;
      align-items: stretch;
      cursor: pointer;
    }

    .quote-card-wrap .quote-card {
      border-bottom-color: rgba(0, 213, 255, 0.28);
    }

    .quote-card-wrap.quote-wrap-bullish .quote-indicator-slot {
      background: #14532d;
      border-color: rgba(34, 197, 94, 0.7);
      box-shadow: 0 0 18px rgba(34, 197, 94, 0.35);
    }

    .quote-card-wrap.quote-wrap-bearish .quote-indicator-slot {
      background: #7f1d1d;
      border-color: rgba(248, 113, 113, 0.7);
      box-shadow: 0 0 18px rgba(248, 113, 113, 0.35);
    }

    .quote-card-wrap.quote-wrap-neutral .quote-indicator-slot {
      background: #10212f;
      border-color: #00d5ff44;
    }

    .quote-card {
      background-color: #10212f;
      border: 1px solid #00d5ff44;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.45);
      border-radius: 0;
      color: #e5f7ff;
      padding: 10px 16px 64px;        /* reserve bottom exactly for spark chart */
      min-width: 160px;
      min-height: 140px;              /* keep card compact so chart doesn't dominate */
      text-align: center;
      font-family: 'Segoe UI', sans-serif;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;    /* keep text in top area */
      position: relative; /* allow corner badges + absolute sparkline */
      transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    }

    .quote-direction {
      position: absolute;
      top: 6px;
      left: 8px;
      font-size: 11px;                /* smaller label text */
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .quote-direction .trend-arrow {
      font-weight: 900; /* extra bold arrow */
      font-size: 14px;                /* slightly smaller arrow */
      line-height: 1;
    }

    .quote-card.trend-up .quote-direction {
      color: #bbf7d0; /* light green */
    }

    .quote-card.trend-down .quote-direction {
      color: #fecaca; /* light red */
    }

    .quote-card.trend-neutral .quote-direction {
      color: #e5e7eb; /* light gray */
    }

    .quote-bar-dir {
      position: absolute;
      top: 6px;
      right: 8px;
      font-size: 11px;                /* smaller bar direction text */
      font-weight: 600;
      opacity: 0.9;
    }
    .quote-card.quote-bullish .quote-bar-dir { color: #bbf7d0; }
    .quote-card.quote-bearish .quote-bar-dir { color: #fecaca; }
    .quote-card.quote-neutral .quote-bar-dir { color: #e5e7eb; }

    .quote-card:hover {
      transform: translateY(-2px) scale(1.02);
      box-shadow: 0 0 14px rgba(0, 0, 0, 0.7);
    }

    .quote-card-wrap:hover .quote-card {
      transform: translateY(-2px) scale(1.02);
      box-shadow: 0 0 14px rgba(0, 0, 0, 0.7);
    }

    .quote-card-wrap:hover .quote-indicator-slot {
      box-shadow: 0 0 14px rgba(0, 0, 0, 0.7);
      filter: brightness(1.06);
    }

    /* Color states based on last D1 bar (sign) */
    .quote-card.quote-bullish {
      background: #14532d;
      border-color: rgba(34, 197, 94, 0.9);
      box-shadow: 0 0 18px rgba(34, 197, 94, 0.65);
    }

    .quote-card.quote-bearish {
      background: #7f1d1d;
      border-color: rgba(248, 113, 113, 0.9);
      box-shadow: 0 0 18px rgba(248, 113, 113, 0.65);
    }

    .quote-card.quote-neutral {
      background: #10212f;
      border-color: #00d5ff44;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.45);
    }

    /* Intensity levels based on absolute % change
       strong   = |%| >= 2.0
       medium   = 0.5 <= |%| < 2.0
       weak     = 0   < |%| < 0.5 */
    .quote-card.quote-bullish-strong { background: #16a34a; }
    .quote-card.quote-bullish-medium { background: #15803d; }
    .quote-card.quote-bullish-weak   { background: #14532d; }

    .quote-card.quote-bearish-strong { background: #de2121; }
    .quote-card.quote-bearish-medium { background: #a91414; }
    .quote-card.quote-bearish-weak   { background: #7f1d1d; }

    .quote-card span {
      display: block;
      color: #f9fafb;
    }

    .quote-spark {
      position: absolute;
      left: 0px;                      /* inset so chart is a bit narrower than card */
      right: 0px;
      bottom: 0;                      /* flush with bottom of the card */
      height: 133px;    
      width:  192px;                /* matches reserved bottom padding of card */
      border-radius: 0;
      overflow: hidden;
      opacity: 0.9;
      box-sizing: border-box;
      display: block;
    }

    .quote-card .quote-symbol {
      font-size: 14px;                /* smaller symbol text */
      font-weight: 700;
      letter-spacing: 0.04em;
      margin-bottom: 4px;
    }

    .quote-card .quote-price {
      font-size: 18px;                /* smaller price text */
      font-weight: 600;
      margin-bottom: 2px;
      border-radius: 4px;
      padding: 1px 4px;
      transition: color 0.18s ease, background-color 0.18s ease, text-shadow 0.18s ease, transform 0.18s ease;
    }

    .quote-card .quote-price.price-tick-up {
      animation: priceTickUp 1.1s ease-out;
    }

    .quote-card .quote-price.price-tick-down {
      animation: priceTickDown 1.1s ease-out;
    }

    @keyframes priceTickUp {
      0% {
        color: #ffffff;
        background: rgba(34, 197, 94, 0.0);
        text-shadow: none;
        transform: scale(1);
      }
      25% {
        color: #dcfce7;
        background: rgba(34, 197, 94, 0.28);
        text-shadow: 0 0 12px rgba(34, 197, 94, 0.9);
        transform: scale(1.08);
      }
      100% {
        color: #f9fafb;
        background: transparent;
        text-shadow: none;
        transform: scale(1);
      }
    }

    @keyframes priceTickDown {
      0% {
        color: #ffffff;
        background: rgba(248, 113, 113, 0.0);
        text-shadow: none;
        transform: scale(1);
      }
      25% {
        color: #fee2e2;
        background: rgba(248, 113, 113, 0.28);
        text-shadow: 0 0 12px rgba(248, 113, 113, 0.9);
        transform: scale(1.08);
      }
      100% {
        color: #f9fafb;
        background: transparent;
        text-shadow: none;
        transform: scale(1);
      }
    }

    .quote-card .quote-change {
      font-size: 11px;                /* smaller change text */
      font-weight: 600;
      opacity: 0.9;
    }

    .quote-indicators {
      position: static;
      z-index: 2;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 3px;
      width: 100%;
      margin-top: 0;
      pointer-events: auto;
    }

    .quote-indicator-slot .quote-indicators {
      grid-template-columns: 1fr;
      align-content: stretch;
      gap: 2px;
      padding: 4px;
      box-sizing: border-box;
      height: auto;
    }

    .quote-indicator {
      border: 1px solid rgba(255, 255, 255, 0.18);
      background: rgba(2, 6, 23, 0.74);
      color: #e5f7ff;
      font-size: 8px;
      line-height: 1;
      font-weight: 700;
      letter-spacing: 0.02em;
      padding: 3px 2px;
      text-transform: uppercase;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: clip;
      box-sizing: border-box;
    }

    .quote-indicator-slot .quote-indicator {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      min-height: 0;
      font-size: 11px;
      padding: 3px 2px;
    }

    .quote-indicator.indicator-signal-changed {
      animation: indicatorSignalPulse 1.2s ease-out;
    }

    .indicator-arrow {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 13px;
      font-size: 13px;
      font-weight: 900;
      line-height: 1;
    }

    @keyframes indicatorSignalPulse {
      0% {
        transform: scale(1);
        text-shadow: none;
        filter: brightness(1);
      }
      25% {
        transform: scale(1.06);
        text-shadow: 0 0 12px rgba(255, 255, 255, 0.75);
        filter: brightness(1.22);
      }
      100% {
        transform: scale(1);
        text-shadow: none;
        filter: brightness(1);
      }
    }

    .quote-indicator-buy {
      color: #bbf7d0;
      border-color: rgba(34, 197, 94, 0.5);
      background: rgba(20, 83, 45, 0.78);
    }

    .quote-indicator-sell {
      color: #fecaca;
      border-color: rgba(248, 113, 113, 0.55);
      background: rgba(127, 29, 29, 0.78);
    }

    .quote-indicator-watch {
      color: #fde68a;
      border-color: rgba(245, 158, 11, 0.5);
      background: rgba(120, 53, 15, 0.78);
    }

    .quote-indicator-neutral {
      color: #e5e7eb;
      border-color: rgba(229, 231, 235, 0.25);
    }

    .quote-card.quote-card-no-spark {
      min-height: 40px;
      padding: 9px 7px 7px;
      justify-content: center;
      overflow: hidden;
    }

    .quote-card.quote-card-no-spark .quote-symbol {
      font-size: 12px;
      line-height: 1.1;
      margin: 0 0 5px;
    }

    .quote-card.quote-card-no-spark .quote-price {
      font-size: 15px;
      line-height: 1.08;
      font-weight: 700;
      margin: 0 0 4px;
    }

    .quote-card.quote-card-no-spark .quote-change {
      font-size: 9px;
      line-height: 1;
    }

    .quote-card.quote-card-no-spark .quote-direction,
    .quote-card.quote-card-no-spark .quote-bar-dir {
      font-size: 8px;
      top: 6px;
    }

    .quote-card.quote-card-no-spark .quote-direction {
      left: 7px;
      flex-direction: column;
      gap: 1px;
    }

    .quote-card.quote-card-no-spark .quote-direction .trend-arrow {
      font-size: 11px;
    }

    .quote-card.quote-card-no-spark .quote-bar-dir {
      right: 7px;
    }

    .quote-time {
      margin-top: 10px;
      font-size: 8px;                 /* slightly smaller timestamp */
      color: #ffffff;
    }

    .led-clock-bar {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      justify-items: center;
      gap: 0;
      background-color: rgba(2, 40, 58, 0.3);
      padding: 0.45rem 1.25rem;
      width: min(100%, 860px);
      box-sizing: border-box;
      margin: 0 auto;

      font-family: 'DS-Digital', sans-serif;
    }

    .led-clock {
      text-align: center;
    }

    .clock-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      min-width: 0;
    }

    .clock-item svg {
      width: 128px;
      height: 128px;
      margin-bottom: 12px;
    }

    .led-label {
      font-family: 'Segoe UI', sans-serif;
      font-size: 17px;
      color: #ccc;
      margin-bottom: 6px;
      line-height: 1.1;
    }

    .led-time {
      font-size: 20px;
      color: #00eaff;
      letter-spacing: 0.1rem;
      text-shadow: 0 0 6px #00eaff;
      transition: opacity 0.2s;
      font-variant-numeric: tabular-nums;
    }

    .led-ticker-bar {
      overflow: hidden;
      background-color: rgba(2, 40, 58, 0.3);
      height: 40px;
      width: 100%;
      padding: 0rem 0rem;
      margin: 8px auto 0;
      font-family: 'Segoe UI', sans-serif;
      position: relative;
    }

    main > .led-ticker-bar:first-child {
      margin-bottom: 12px;
    }

    .led-ticker-bar + .led-ticker-bar {
      margin-top: 0;
      border-top: 1px solid rgba(0, 247, 255, 0.12);
    }

    .led-ticker {
      display: flex;
      width: max-content;
      white-space: nowrap;
      /* ВАЖНО: пази всички интервали и табулации */
      color: #ffffff;

      font-size: 18px;
      line-height: 40px;
      will-change: transform;
      animation: scrollTicker var(--ticker-duration, 30s) linear infinite;

    }
    .led-ticker-rates {
      display: flex;
      width: max-content;
      white-space: nowrap;
      /* ВАЖНО: пази всички интервали и табулации */
      color: #ffffff;

      font-size: 18px;
      line-height: 40px;
      will-change: transform;
      animation: scrollTicker var(--ticker-duration, 60s) linear infinite;

    }

    .led-ticker__segment {
      flex: 0 0 auto;
      padding-right: 28px;
    }

    .led-ticker__separator {
      display: inline-block;
      margin-inline: 22px;
      color: rgba(0, 247, 255, 0.7);
      font-size: 0.55em;
      vertical-align: 0.2em;
      text-shadow: 0 0 6px rgba(0, 247, 255, 0.65);
    }

    .led-ticker__measure {
      position: absolute;
      visibility: hidden;
      white-space: nowrap;
      font: inherit;
      pointer-events: none;
    }

    @keyframes scrollTicker {
      to { transform: translate3d(calc(-1 * var(--ticker-distance, 1000px)), 0, 0); }
    }

    .main-content {
      position: relative;
      z-index: 1;
      width: 100%;
      max-width: 800px;
      margin: 0 auto;
    }
    svg {
      width: 100px;
      height: 100px;

    }

    .clock-container {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 144px));
      justify-content: center;
      gap: 24px;
      width: 100%;
      margin: 18px auto 0;
      padding: 18px 24px 16px;
      box-sizing: border-box;
      background-color: rgba(2, 40, 58, 0.3);
      align-items: center;
      justify-items: center;
    }

    .clock-face {
      fill: #fbfcfd;
      stroke: #26313a;
      stroke-width: 3.2;
      filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.28));

    }

    .clock-ring {
      fill: none;
      stroke: rgba(0, 234, 255, 0.42);
      stroke-width: 1.1;
    }

    .hand line {
      stroke-linecap: round;
      stroke: #26313a;
    }

    .hand.hour line {
      stroke-width: 4.8;
    }

    .hand.minute line {
      stroke-width: 3.4;
    }

    .hand.second line {
      stroke: #f20d32;
      stroke-width: 1.7;
    }

    .hand-tail {
      opacity: 0.52;
    }

    .clock-hub {
      fill: #26313a;
      stroke: #fbfcfd;
      stroke-width: 1.4;
    }

    .clock-hub-dot {
      fill: #f20d32;
    }

    .number {
      font-size: 6.5px;
      font-weight: 600;
      fill: #1f2933;
      text-anchor: middle;
      dominant-baseline: middle;
    }

    .marker {
      stroke: #8a96a3;
      stroke-width: 0.45;
    }

    .marker-hour {
      stroke: #26313a;
      stroke-width: 1.7;
    }

    /* ------- МОБИЛНА ВЕРСИЯ ------- */
    /* Скрий отстрани при мобилни устройства */
    @media (max-width: 768px) {
      body {
        padding: 20px 12px;
        flex-direction: column;
      }

      /* stack logo and main nav on mobile */

      /* tighten analog + digital clocks on mobile */
      .clock-container {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 100px));
        gap: 12px;
        margin-top: 12px;
        padding: 12px 10px;
        background-color: rgba(2, 40, 58, 0.3);
      }

      .clock-item svg {
        width: 80px;
        height: 80px;
        margin-bottom: 8px;
      }

      .led-clock-bar {
        gap: 0;
        width: 100%;
        max-width: 360px;
        margin: 8px auto 0 auto;
      }

      .led-ticker-bar {
        width: 100%;
        background-color: rgba(2, 40, 58, 0.3);
      }

      .led-label {
        font-size: 14px;
        margin-bottom: 4px;
      }

      .led-time {
        font-size: 15px;
        letter-spacing: 0.07rem;
      }

      .led-ticker,
      .led-ticker-rates {
        font-size: 15px;
      }

      /* Portrait: use same card look as desktop, but single column */
      .quotes-wrapper {
        grid-template-columns: minmax(0, 1fr);
      }

      .market-summary-row {
        max-width: 260px;
        padding: 0;
      }

      .market-summary-row .quotes-wrapper {
        gap: 6px;
      }

      .market-summary-row .quote-card {
        width: 100%;
      }

      .market-summary-row .quote-card-wrap .quote-card {
        width: auto;
      }

      .quote-card.quote-card-no-spark {
        min-height: 38px;
        padding: 9px 7px 7px;
      }

      .quote-card.quote-card-no-spark .quote-symbol {
        font-size: 12px;
      }

      .quote-card.quote-card-no-spark .quote-price {
        font-size: 15px;
      }

      .quote-card.quote-card-no-spark .quote-change {
        font-size: 9px;
      }

      .quote-card.quote-card-no-spark .quote-direction,
      .quote-card.quote-card-no-spark .quote-bar-dir {
        font-size: 8px;
        top: 6px;
      }
    }
