/* Approved Granat — the single palette source for the ordinary app and local preview */
:root {
  --er-bg: #100e0f;
  --er-burgundy: #b5213b;
  --er-ice: #b7dfff;
  --er-paper: #211b1d;
  --er-field: #2b2327;
  --er-raised: #372b30;
  --er-nav: #1b1719;
  --er-line: #51363d;
  --er-ink: #fff3ef;
  --er-muted: #c4b4b5;
  --er-recess: #100e10;
  --er-wine: #6d192b;
  --er-hot: #bd2942;
  --er-logo-e: #f95669;
  --er-blue-well: #263b48;
  --er-on-ice: #142a39;
  --er-hero:
    radial-gradient(
      ellipse 80% 102% at 110% 109%,
      #b7dfffd6 0%,
      #78b3d5a6 28%,
      #3b687b59 52%,
      transparent 79%
    ),
    linear-gradient(122deg, #39151d 1%, #581a26 70%, #681c2b);
  --er-badge: #b7dfff;
  --er-badge-ink: #142a39;
  --er-panel-glow: inset 0 1px 0 #f99ca817, 0 5px 15px #08030522;
  --er-disc: radial-gradient(
    ellipse at 51% 47%,
    #39121d 14%,
    #64182a 65%,
    #a2273d 100%
  );
  --er-disc-edge: #cc4659;
  --er-disc-glow: 0 6px 21px #8f16363d;

  --er-logo-r: #9de8ef;
  --er-ice-ink: var(--er-ice);
  --er-selected-bg: var(--er-ice);
  --er-selected-ink: var(--er-on-ice);
  --er-on-cta: #fff7f5;
  --er-cta: linear-gradient(
    104deg,
    var(--er-hot),
    var(--er-burgundy) 57%,
    var(--er-wine)
  );
}

:root[data-theme="light"] {
  --er-bg: #f7f3f1;
  --er-paper: #fffaf7;
  --er-field: #eee5e6;
  --er-raised: #e5d7dc;
  --er-nav: #fff8f5;
  --er-line: #dac7ce;
  --er-ink: #2b2026;
  --er-muted: #725f68;
  --er-recess: #151116;
  --er-blue-well: #dceef6;
  --er-ice-ink: #245771;
  --er-panel-glow: inset 0 1px 0 #ffffffa6, 0 6px 22px #4e25360b;
  --er-hero:
    radial-gradient(
      ellipse 72% 95% at 107% 104%,
      #a6dcf8 0%,
      #c2e2f09e 38%,
      transparent 80%
    ),
    linear-gradient(122deg, #f3dbe1, #e8d8df 74%, #e0e6ea);
  --er-badge: var(--er-ice);
  --er-badge-ink: #142a39;
}

:root {
  --lab-bg: var(--er-bg);
  --lab-burgundy: var(--er-burgundy);
  --lab-ice: var(--er-ice-ink);
  --lab-paper: var(--er-paper);
  --lab-field: var(--er-field);
  --lab-raised: var(--er-raised);
  --lab-nav: var(--er-nav);
  --lab-line: var(--er-line);
  --lab-ink: var(--er-ink);
  --lab-muted: var(--er-muted);
  --lab-recess: var(--er-recess);
  --lab-wine: var(--er-wine);
  --lab-hot: var(--er-hot);
  --lab-logo-e: var(--er-logo-e);
  --lab-blue-well: var(--er-blue-well);
  --lab-on-ice: var(--er-on-ice);
  --lab-hero: var(--er-hero);
  --lab-badge: var(--er-badge);
  --lab-badge-ink: var(--er-badge-ink);
  --lab-panel-glow: var(--er-panel-glow);
  --lab-disc: var(--er-disc);
  --lab-disc-edge: var(--er-disc-edge);
  --lab-disc-glow: var(--er-disc-glow);
  --lab-cta: var(--er-cta);
  --lab-on-cta: var(--er-on-cta);
}
html:root[data-variant][data-theme] {
  color-scheme: inherit;
  --bg: var(--lab-bg);
  --paper: var(--lab-paper);
  --ink: var(--lab-ink);
  --muted: var(--lab-muted);
  --line: var(--lab-line);
  --surface-2: var(--lab-field);
  --surface-3: var(--lab-raised);
  --input-bg: var(--lab-field);
  --selected-bg: var(--lab-burgundy);
  --selected-ink: #fff6f5;
  --focus-bg: var(--lab-blue-well);
  --focus-ink: var(--lab-ice);
  --menu-bg: var(--lab-paper);
  --panel-bg: var(--lab-paper);
  --error-bg: var(--lab-wine);
  --error-ink: #ffe4e3;
  --auto-cut-bg: var(--lab-blue-well);
  --auto-cut-badge: var(--lab-raised);
  --word-badge-bg: var(--lab-wine);
  --ref-quiet: var(--lab-muted);
  --ref-nav-ink: var(--lab-muted);
  --ref-tile: var(--lab-field);
  --ref-nav: var(--lab-nav);
  --ref-hairline: color-mix(in srgb, var(--lab-muted) 13%, transparent);
  --ref-shadow: var(--lab-panel-glow);
  --ref-spectrum: linear-gradient(115deg, var(--lab-burgundy), var(--lab-wine));
  --ref-badge: var(--lab-badge);
  --lab-cta: var(--er-cta);
  --lab-on-cta: var(--er-on-cta);
  /* These are the two original paths, including the cut through the R.
     The tighter viewBox keeps their crossing legible at 25 px. */
  --lab-mark-e: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='152 152 720 720'%3E%3Cpath d='M204 216H618V310H300V476H644V570H300V714H522V808H204V216Z'/%3E%3C/svg%3E");
  --lab-mark-r: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='152 152 720 720'%3E%3Cdefs%3E%3Cmask id='cross'%3E%3Crect width='1024' height='1024' fill='white'/%3E%3Cpath d='M440 442H584V474H440zM440 570H584V602H440z'/%3E%3C/mask%3E%3C/defs%3E%3Cpath fill-rule='evenodd' mask='url(%23cross)' d='M464 216H652C749 216 810 269 810 360C810 441 762 492 689 510L820 808H704L582 530H560V570H464V216ZM560 310V436H643C690 436 714 412 714 373C714 333 690 310 643 310H560Z'/%3E%3C/svg%3E");
}

html:root[data-variant][data-theme]
  :is(
    #project-view,
    .canvas-editor,
    .caption-controls,
    .insert-details,
    .er-select-popup
  ) {
  --eb-bg: var(--lab-bg);
  --eb-paper: var(--lab-paper);
  --eb-ink: var(--lab-ink);
  --eb-muted: var(--lab-muted);
  --eb-control: var(--lab-field);
  --eb-control-hover: var(--lab-raised);
  --eb-selected: var(--lab-burgundy);
  --eb-on-selected: var(--lab-on-cta);
  --eb-stage: var(--lab-recess);
  --eb-stage-muted: var(--lab-muted);
  --eb-pink: var(--lab-ice);
  --eb-soft-pink: var(--lab-wine);
  --eb-on-pink: var(--lab-on-cta);
  --eb-focus: var(--lab-blue-well);
  --eb-on-focus: var(--lab-ice);
  --eb-danger: #ffbdbf;
  --eb-gradient: var(--lab-cta);
  --eb-shadow: var(--lab-panel-glow);
}
html:root[data-variant][data-theme] .caption-studio {
  --cs-surface: var(--lab-field);
  --cs-ink: var(--lab-ink);
  --cs-muted: var(--lab-muted);
  --cs-accent: var(--lab-ice);
}
html:root[data-variant][data-theme] #er-profile {
  --account-surface: var(--lab-paper);
  --account-fill: var(--lab-field);
  --account-divider: var(--ref-hairline);
  --account-action: var(--lab-cta);
  --account-action-ink: var(--lab-on-cta);
  --account-shadow: var(--lab-panel-glow);
}

html:root[data-variant][data-theme] .topbar .brand-mark {
  background: var(--lab-recess);
  box-shadow: inset 0 0 0 1px var(--lab-line);
}
html:root[data-variant][data-theme] .workspace-tabs .ref-create-disc {
  background: var(--lab-disc);
  box-shadow:
    inset 0 0 0 1px var(--lab-disc-edge),
    var(--lab-disc-glow);
}
html:root[data-variant][data-theme] :is(.brand-mark img, .ref-create-disc svg) {
  opacity: 0;
}
html:root[data-variant][data-theme] :is(.brand-mark, .ref-create-disc)::before,
html:root[data-variant][data-theme] :is(.brand-mark, .ref-create-disc)::after {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
  background: var(--lab-ice);
  -webkit-mask: var(--lab-mark-r) center / contain no-repeat;
  mask: var(--lab-mark-r) center / contain no-repeat;
}
html:root[data-variant][data-theme] :is(.brand-mark, .ref-create-disc)::after {
  background: var(--lab-logo-e);
  -webkit-mask-image: var(--lab-mark-e);
  mask-image: var(--lab-mark-e);
}
html:root[data-variant][data-theme] .ref-create-disc::before,
html:root[data-variant][data-theme] .ref-create-disc::after {
  inset: 19%;
}
html:root[data-variant][data-theme] .ref-hero {
  background: var(--lab-hero);
  box-shadow: var(--lab-panel-glow);
  color: var(--lab-ink);
}
html:root[data-variant][data-theme] .ref-hero h1 {
  color: var(--lab-ink);
}
html:root[data-variant][data-theme] :is(.ref-hero > p, .ref-drop-hint) {
  color: color-mix(in srgb, var(--lab-ink) 76%, var(--lab-muted));
}
html:root[data-variant][data-theme] .ref-hero-badge {
  background: var(--lab-badge);
  color: var(--lab-badge-ink);
}
html:root[data-variant][data-theme] .ref-upload,
html:root[data-variant][data-theme]
  :is(.compose-panel #create, .editor-save .primary, .account-primary),
html:root[data-variant][data-theme]
  #project-view
  .player-wrap
  :is(#download, #open-canvas-editor),
html:root[data-variant][data-theme] .canvas-editor #ce-save {
  background: var(--lab-cta);
  color: var(--lab-on-cta) !important;
  box-shadow:
    inset 0 1px 0 #ffffff1a,
    0 2px 6px #0002;
}
html:root[data-variant][data-theme] .ref-upload-arrow,
html:root[data-variant][data-theme] #project-view .player-wrap #download > span,
html:root[data-variant][data-theme] .canvas-editor #ce-save::after {
  background: var(--lab-recess);
  color: var(--lab-ice);
}
html:root[data-variant][data-theme] .ref-upload-arrow::before {
  box-shadow: inset 0 0 0 1px #ffffff12;
  background: none;
}
html:root[data-variant][data-theme] .ref-hero.is-dragging {
  box-shadow: inset 0 0 0 2px var(--lab-ice);
}
html:root[data-variant][data-theme] .ref-invite-icon,
html:root[data-variant][data-theme] #create-view #choose-file > .upload-icon {
  background: var(--lab-wine);
  color: var(--lab-on-cta);
}
html:root[data-variant][data-theme]
  :is(#studio-recent-list, #projects)
  [data-status="ready"]
  .status-pill,
html:root[data-variant][data-theme]
  #project-view
  .project-heading
  .status-pill {
  color: var(--lab-ice);
  background: var(--lab-blue-well);
}
html:root[data-variant][data-theme] .workspace-tabs button.active,
html:root[data-variant][data-theme] .workspace-tabs button.active svg {
  color: var(--lab-ice);
}
html:root[data-variant][data-theme] .workspace-tabs {
  background: var(--lab-nav);
  box-shadow: inset 0 1px 0 var(--ref-hairline);
}
html:root[data-variant][data-theme] .account-choice[aria-pressed="true"] {
  color: var(--lab-ice);
}
html:root[data-variant][data-theme]
  .account-choice[aria-pressed="true"]::before {
  background: var(--lab-blue-well);
}
html:root[data-variant][data-theme] .account-avatar {
  background-color: var(--lab-field);
  color: var(--lab-ice);
}
html:root[data-variant][data-theme]
  .account-switch[aria-checked="true"]::after {
  background: var(--lab-ice);
}
html:root[data-variant][data-theme]
  .account-card
  :is(button, summary, a):focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lab-ice) 70%, transparent);
}

html:root[data-variant][data-theme]
  :is(#project-view .player-wrap, .canvas-editor .ce-view) {
  background: var(--lab-recess);
}
html:root[data-variant][data-theme]
  #project-view
  .player-wrap
  #open-canvas-editor::after,
html:root[data-variant][data-theme] #project-view .editor-save .primary > span {
  background: var(--lab-recess);
  color: var(--lab-ice);
}
html:root[data-variant][data-theme] .canvas-editor #ce-play,
html:root[data-variant][data-theme] .caption-studio .cs-play {
  color: var(--lab-ice) !important;
  background: var(--lab-blue-well) !important;
}
html:root[data-variant][data-theme] .canvas-editor .ce-transport input,
html:root[data-variant][data-theme] .compose-panel #upload-progress,
html:root[data-variant][data-theme]
  :is(.caption-studio, .caption-controls, .canvas-editor)
  input[type="range"] {
  accent-color: var(--lab-ice);
}
html:root[data-variant][data-theme] .canvas-editor .ce-view .ce-track::after {
  background: var(--lab-ice);
}
html:root[data-variant][data-theme] .canvas-editor .ce-view .ce-block {
  background: var(--lab-raised);
  color: var(--lab-ink);
}
html:root[data-variant][data-theme]
  .canvas-editor
  .ce-view
  .ce-block[data-ce-key="caption"] {
  background: var(--lab-blue-well);
  color: var(--lab-ice);
}
html:root[data-variant][data-theme]
  .canvas-editor
  .ce-view
  .ce-block[data-ce-key^="card-"] {
  background: var(--lab-wine);
  color: var(--lab-on-cta);
}
html:root[data-variant][data-theme]
  .canvas-editor
  .ce-view
  .ce-block:is([aria-pressed="true"], :focus-visible) {
  background: var(--lab-ice);
  color: var(--lab-on-ice);
}
html:root[data-variant][data-theme] #project-view .project-card-moments button {
  background: var(--lab-field);
  color: var(--lab-ink);
}
html:root[data-variant][data-theme]
  .caption-studio
  :is(
    .caption-style-choice,
    .caption-font-choice,
    .caption-positions button,
    .caption-motions button,
    .cs-segments button,
    .cs-language-list button
  )[aria-pressed="true"] {
  background: var(--lab-burgundy);
  color: var(--lab-on-cta);
}
html:root[data-variant][data-theme]
  .caption-studio
  .cs-toggle[aria-checked="true"]
  i,
html:root[data-variant][data-theme]
  #project-view
  :is(.effect-switch, .switch-row)
  input:checked
  + .switch {
  background: var(--lab-burgundy);
}
html:root[data-variant][data-theme]
  .caption-studio
  .cs-toggle[aria-checked="true"]
  i::after,
html:root[data-variant][data-theme]
  #project-view
  :is(.effect-switch, .switch-row)
  input:checked
  + .switch::after {
  background: var(--lab-ice);
}
html:root[data-variant][data-theme]
  .caption-studio
  .caption-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--lab-ice);
}
html:root[data-variant][data-theme]
  :is(.workspace-tabs, .topbar, #create-view, #project-view, .canvas-editor)
  :is(button, a):focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lab-ice) 70%, transparent);
}
html:root[data-variant][data-theme] #project-view #download:focus-visible,
html:root[data-variant][data-theme] .canvas-editor #ce-play:focus-visible {
  background: var(--lab-blue-well);
  color: var(--lab-ice) !important;
}
html:root[data-variant][data-theme]
  :is(.er-select-trigger, .er-select-option).is-active,
html:root[data-variant][data-theme] :is(#word-dialog, #login-dialog) .primary {
  background: var(--lab-burgundy);
  color: var(--lab-on-cta);
}
@media (hover: hover) {
  html:root[data-variant][data-theme]
    :is(.ref-upload, .account-primary, .compose-panel #create):hover,
  html:root[data-variant][data-theme]
    #project-view
    .player-wrap
    :is(#open-canvas-editor, #download):hover {
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--lab-ice) 42%, transparent),
      var(--lab-panel-glow);
  }
}

html:root[data-variant][data-theme] #library-view #ref-library-upload,
html:root[data-variant][data-theme] #editor-empty-view #editor-choose-project {
  background: var(--lab-cta);
  color: var(--lab-on-cta);
}
html:root[data-variant][data-theme] .workspace-tabs button.active svg,
html:root[data-variant][data-theme] .caption-studio .cs-play svg {
  filter: drop-shadow(
    0 0 3px color-mix(in srgb, var(--lab-ice) 19%, transparent)
  );
}
html:root[data-palette="orbit"][data-variant] .workspace-tabs button.active svg,
html:root[data-palette="orbit"][data-variant] .caption-studio .cs-play svg {
  filter: drop-shadow(0 0 5px #8fd9ff47);
}

/* The full-screen editor has no top bar. The existing little medallion on
   Save carries the same two letterforms while its text retains the arrow. */
html:root[data-variant][data-theme] .canvas-editor #ce-save {
  background:
    radial-gradient(
      circle 18px at calc(100% - 27.5px) 50%,
      var(--lab-recess) 95%,
      transparent 100%
    ),
    var(--lab-cta);
}
html:root[data-variant][data-theme] .canvas-editor #ce-save::before,
html:root[data-variant][data-theme] .canvas-editor #ce-save::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 25px;
  height: 25px;
  transform: translateY(-50%);
  border-radius: 0;
  background: var(--lab-ice);
  pointer-events: none;
  -webkit-mask: var(--lab-mark-r) center / contain no-repeat;
  mask: var(--lab-mark-r) center / contain no-repeat;
}
html:root[data-variant][data-theme] .canvas-editor #ce-save::after {
  background: var(--lab-logo-e);
  -webkit-mask-image: var(--lab-mark-e);
  mask-image: var(--lab-mark-e);
}

html:root[data-variant][data-theme]:not([data-palette="velvet"]):not(
    [data-palette="orbit"]
  )
  :is(.brand-mark, .ref-create-disc)::before {
  background: var(--er-logo-r);
}
html:root[data-variant][data-theme]:not([data-palette="velvet"]):not(
    [data-palette="orbit"]
  )
  .caption-studio
  :is(
    .caption-style-choice,
    .caption-font-choice,
    .caption-positions button,
    .caption-motions button,
    .cs-segments button,
    .cs-language-list button
  )[aria-pressed="true"] {
  background: var(--er-selected-bg);
  color: var(--er-selected-ink);
}
html:root[data-variant][data-theme]:not([data-palette="velvet"]):not(
    [data-palette="orbit"]
  )
  :is(.er-select-trigger, .er-select-option).is-active {
  background: var(--er-blue-well);
  color: var(--er-ice-ink);
}
html:root[data-variant][data-theme] .account-setting:has(.account-design) {
  display: none;
}
html:root[data-variant][data-theme] :is(button, a, input):focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--er-ice) 70%, transparent);
}
html:root[data-variant][data-theme]
  .account-card
  :is(button, summary, a):focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--er-ice) 70%, transparent);
}
html:root[data-variant][data-theme]
  .compose-panel
  #upload-progress::-webkit-progress-value {
  background: var(--er-ice);
}
html:root[data-variant][data-theme]
  .compose-panel
  #upload-progress::-moz-progress-bar {
  background: var(--er-ice);
}
html:root[data-variant][data-theme]
  :is(.er-progress-track > span, [data-task-progress]) {
  background: var(--er-ice);
}
html:root[data-variant][data-theme][data-theme="light"] .ref-invite-icon {
  background: var(--er-blue-well);
  color: var(--er-ice-ink);
}
html:root[data-variant][data-theme]:not([data-palette="velvet"]):not(
    [data-palette="orbit"]
  ) {
  --selected-bg: var(--er-selected-bg);
  --selected-ink: var(--er-selected-ink);
}
html:root[data-variant][data-theme]:not([data-palette="velvet"]):not(
    [data-palette="orbit"]
  )
  :is(#project-view, .caption-controls, .er-select-popup) {
  --eb-selected: var(--er-selected-bg);
  --eb-on-selected: var(--er-selected-ink);
}

html:root[data-variant][data-theme]
  :is(.ref-upload-arrow, #project-view .player-wrap #download > span) {
  color: var(--er-ice);
}
html:root[data-variant][data-theme]
  .caption-studio
  .cs-toggle[aria-checked="true"]
  i::after,
html:root[data-variant][data-theme]
  #project-view
  :is(.effect-switch, .switch-row)
  input:checked
  + .switch::after {
  background: var(--er-ice);
}

/* Fields signal keyboard focus with a filled surface, never a perimeter */
html:root[data-variant][data-theme]
  :is(input, textarea, select, .er-select-trigger, .cs-language-button):is(
    :focus,
    :focus-visible
  ) {
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
  text-decoration: none !important;
  caret-color: var(--er-ice-ink);
}
html:root[data-variant][data-theme]
  :is(
    input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
    textarea,
    select,
    .er-select-trigger,
    .cs-language-button
  ):focus-visible {
  background: var(--er-blue-well);
  color: var(--er-ice-ink);
}
