body.of-overlay-open{
  overflow: hidden;
}

.of-overlay{
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.of-overlay.is-open{
  opacity: 1;
  pointer-events: auto;
}

.of-overlay__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(15, 19, 32, .22);
}

.of-overlay__dialog{
  position: relative;
  width: min(1080px, calc(100vw - 32px));
  height: min(820px, calc(100vh - 32px));
  padding: 28px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(8px);
  transition: transform .18s ease;
}

.of-overlay.is-open .of-overlay__dialog{
  transform: translateY(0);
}

.of-overlay__header,
.of-overlay__sectionHead{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  margin: 0 0 12px;
}

.of-overlay__header{
  margin-bottom: 14px;
}

.of-overlay__headerCopy{
  min-width: 0;
}

.of-overlay__sectionTitle{
  margin: 0;
  color: var(--text);
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.3;
}

.of-overlay__close{
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: var(--r-sm);
  background: rgba(15, 19, 32, .06);
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}

.of-overlay__close:focus{
  outline: none;
  box-shadow: var(--focus);
}

.of-overlay__body{
  display: grid;
  grid-template-rows: minmax(0, 300px) minmax(0, 236px) auto;
  gap: 14px;
  height: calc(100% - 52px);
  min-height: 0;
}

.of-overlay__top{
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.of-overlay__panel{
  min-width: 0;
  min-height: 0;
  border-radius: var(--r-sm);
}

.of-overlay__videoPanel{
  min-width: 0;
}

.of-overlay__player{
  position: relative;
  aspect-ratio: 16 / 9;
  height: 100%;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: rgba(15, 19, 32, .06);
}

.of-overlay__iframe{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  opacity: 0;
  transition: opacity .18s ease;
}

.of-overlay__player.is-ready .of-overlay__iframe{
  opacity: 1;
}

.of-overlay__fallback{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(15, 19, 32, .04), rgba(15, 19, 32, .12));
}

.of-overlay__fallback[hidden]{
  display: none !important;
}

.of-overlay__fallbackThumb{
  position: absolute;
  inset: 0;
}

.of-overlay__fallbackThumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.of-overlay__fallbackCard{
  position: relative;
  display: grid;
  gap: 10px;
  justify-items: start;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-sm);
}

.of-overlay__fallbackTitle{
  color: var(--text);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.3;
}

.of-overlay__fallbackLink{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(34, 108, 224, .1);
  color: var(--blue-700);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}

.of-overlay__fallbackLink:focus{
  outline: none;
  box-shadow: var(--focus);
}

.of-overlay__metricsPanel{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
  min-height: 0;
}

.of-overlay__metricCard{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--bg);
}

.of-overlay__metricIcon,
.of-overlay__actionIcon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.of-overlay__metricIcon img,
.of-overlay__actionIcon img{
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
}

.of-overlay__metricCopy{
  margin-top: auto;
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.of-overlay__metricValue{
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.08;
}

.of-overlay__metricLabel{
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.3;
}

.of-overlay__section{
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.of-overlay__chart{
  margin-top: 0;
  min-width: 0;
  min-height: 0;
}

.of-overlay__actionsWrap{
  display: grid;
  gap: 12px;
  min-width: 0;
}

.of-overlay__actions{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
  min-width: 0;
}

.of-overlay__actionCard{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 96px;
  padding: 14px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.of-overlay__actionCard.is-busy{
  opacity: .72;
  cursor: progress;
}

.of-overlay__actionCard:not([disabled]):hover{
  transform: translateY(-1px);
}

.of-overlay__actionCard[disabled]{
  opacity: .62;
  cursor: not-allowed;
}

.of-overlay__actionCard:focus{
  outline: none;
  box-shadow: var(--focus);
}

.of-overlay__actionLabel{
  color: var(--text);
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.28;
}

.of-overlay__toast{
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 3;
  min-width: min(340px, calc(100% - 48px));
  max-width: calc(100% - 48px);
  padding: 12px 16px;
  border-radius: 16px;
  color: #fff;
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 18px 42px rgba(15, 19, 32, .22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity .18s ease, transform .22s cubic-bezier(.22, 1, .36, 1);
}

.of-overlay__toast[hidden]{
  display: none !important;
}

.of-overlay__toast.is-visible{
  opacity: 1;
  transform: translate(-50%, 0);
}

.of-overlay__toast.is-loading{
  background: linear-gradient(180deg, #2d74e3, #1f61ca);
}

.of-overlay__toast.is-success{
  background: linear-gradient(180deg, #169a77, #0f7e61);
}

.of-overlay__toast.is-error{
  background: linear-gradient(180deg, #d85757, #b93f3f);
}

.rhc{
  display:grid;
  gap: 8px;
}

.rhc__toolbar{
  display:grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items:start;
  gap: 8px;
}

.rhc__toolbarSide{
  display:grid;
  gap: 8px;
}

.rhc__ranges{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
}

.rhc__range{
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(15,19,32,.06);
  color: var(--muted);
  font: inherit;
  font-size: .76rem;
  font-weight: 600;
  cursor:pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.rhc__range:hover{
  transform: translateY(-1px);
}

.rhc__range.is-active{
  background: rgb(255 0 0 / 21%);
  color: var(--yt-red-500);
}

.rhc__custom{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  align-items:end;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: max-height .24s cubic-bezier(.22,1,.36,1), opacity .18s ease, transform .18s ease;
}

.rhc__custom.is-open{
  max-height: 180px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.rhc__dateField{
  display:grid;
  gap: 4px;
}

.rhc__dateField span{
  color: var(--muted-2);
  font-size: .74rem;
  font-weight: 600;
}

.rhc__dateField input{
  min-width: 142px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-sm);
  font-size: .8rem;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.rhc__customBtn{
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: rgb(255 0 0 / 21%);
  color: var(--yt-red-500);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}

.rhc__customBtn--ghost{
  background: rgba(15,19,32,.06);
  color: var(--muted);
}

.rhc__frame{
  position:relative;
  overflow:hidden;
  min-height: 170px;
}

.rhc__canvas{
  display:block;
  width:100%;
}

.rhc__tooltip{
  position:absolute;
  min-width: 186px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15,19,32,.96);
  color: #fff;
  box-shadow: var(--shadow-sm);
  pointer-events:none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
}

.rhc__tooltip:not([hidden]){
  opacity: 1;
  transform: translateY(0);
}

.rhc__tooltipDate{
  color: rgba(255,255,255,.72);
  font-size: .75rem;
  font-weight: 600;
}

.rhc__tooltipValue{
  margin-top: 6px;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  font-size: .84rem;
  font-weight: 700;
}

.rhc__tooltipDot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--rhc-color, var(--blue-500));
}

.rhc__empty{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  text-align:center;
  padding: 24px;
  pointer-events: none;
}

.rhc__empty[hidden]{
  display:none !important;
}

.rhc__emptyTitle{
  color: var(--text);
  font-size: .96rem;
  font-weight: 700;
}

.rhc__emptyText{
  margin-top: 6px;
  color: var(--muted-2);
  font-size: .84rem;
  line-height: 1.5;
  max-width: 320px;
}

.cthc__toolbarRow{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.cthc__metrics{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
}

.cthc__metric{
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(15,19,32,.06);
  color: var(--muted);
  font: inherit;
  font-size: .76rem;
  font-weight: 600;
  cursor:pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.cthc__metric:hover{
  transform: translateY(-1px);
}

.cthc__metric.is-active{
  background: rgb(255 0 0 / 21%);
  color: var(--yt-red-500);
}

.cthc__tooltipMeta{
  color: var(--muted-2);
  font-size: .76rem;
  font-weight: 700;
}

.cthc__tooltipDelta--up{
  color: #86efac;
}

.cthc__tooltipDelta--down{
  color: #fca5a5;
}

.cthc__tooltipDelta--neutral{
  color: var(--muted-2);
}

.ilc{
  display: grid;
  gap: 8px;
}

.ilc__toolbar{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 30px;
}

.ilc__summary.is-hidden{
  display: none;
}

.ilc__title{
  color: var(--text);
  font-size: .9rem;
  font-weight: 700;
}

.ilc__subtitle{
  margin-top: 4px;
  color: var(--muted-2);
  font-size: .8rem;
}

.ilc__ranges{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ilc__range{
  min-width: 46px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 19, 32, .06);
  color: var(--muted);
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
}

.ilc__range:disabled,
.ilc__range.is-disabled{
  opacity: .42;
  cursor: not-allowed;
}

.ilc__range.is-active{
  background: rgb(255 0 0 / 21%);
  color: var(--yt-red-500);
}

.ilc__frame{
  position: relative;
  overflow: hidden;
  min-height: 162px;
}

.ilc__canvas{
  display: block;
  width: 100%;
}

.ilc__tooltip{
  position: absolute;
  min-width: 116px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(15, 19, 32, .94);
  color: #fff;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

.ilc__tooltipDate{
  color: rgba(255, 255, 255, .72);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.35;
}

.ilc__tooltipValue{
  margin-top: 2px;
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.2;
}

.ilc__empty{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  pointer-events: none;
}

.ilc__emptyTitle{
  color: var(--text);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.3;
}

.ilc__emptyText{
  margin-top: 6px;
  color: var(--muted-2);
  font-size: .82rem;
  line-height: 1.45;
  max-width: 300px;
}

@media (max-width: 980px){
  .of-overlay__dialog{
    width: min(100vw - 24px, 980px);
    height: min(860px, calc(100vh - 24px));
    padding: 16px;
  }

  .of-overlay__body{
    grid-template-rows: auto auto auto;
    height: auto;
    min-height: 0;
  }

  .of-overlay__top{
    grid-template-columns: 1fr;
  }

  .of-overlay__videoPanel{
    min-height: 220px;
  }

  .rhc__toolbar{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px){
  .of-overlay{
    padding: 0;
  }

  .of-overlay__dialog{
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    overflow: auto;
  }

  .of-overlay__metricsPanel{
    grid-template-columns: 1fr 1fr;
  }

  .of-overlay__actions{
    grid-template-columns: 1fr;
  }

  .of-overlay__toast{
    min-width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce){
  .of-overlay,
  .of-overlay__dialog,
  .of-overlay__iframe{
    transition: none;
  }

  .rhc__dateField{
    width: 100%;
  }

  .rhc__dateField input{
    width: 100%;
    min-width: 0;
  }

  .rhc__tooltip{
    min-width: 164px;
  }
}
