.fticon {
  display: inline-block;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  flex-shrink: 0;
}

/* ==========================================================================
   OPENFISHTOOLS STUDIO - MODULAR POPOVER COMPONENT (macOS-STYLE BUBBLE)
   100% Flat Design Tokens | Dynamic Sharp Tail | Anchor Origin Scaling
   Fast Spring Bounce Animation (0 -> 1 -> 0) | Auto Screen Flip & Clamping
   ========================================================================== */

/* Popover Floating Surface Card */
.popover-card {
  position: fixed;
  z-index: 2000;
  background-color: var(--bg-panel);
  color: var(--text-primary);
  border-radius: 12px;
  box-sizing: border-box;
  padding: 14px 16px;
  min-width: 180px;
  max-width: calc(100vw - 24px);
  outline: none;
  border: 1px solid var(--color-primary);
  box-shadow: none;
  pointer-events: none;
  opacity: 0;
  transform: scale(0);
  will-change: transform, opacity;
  transition: transform 0.16s ease-in, opacity 0.14s ease-in;
  -webkit-user-select: none;
  user-select: none;
}

/* Open Active State with High-Speed Tactile Spring Bounce */
.popover-card.is-open {
  pointer-events: auto;
  opacity: 1;
  transform: scale(1);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.18s ease-out;
}

/* Sharp Pointy Arrow Tail (Placed behind card so inner half is masked seamlessly) */
.popover-tail {
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: inherit;
  border-style: solid;
  border-color: inherit;
  border-width: 0;
  pointer-events: none;
  box-sizing: border-box;
  z-index: -1;
  -webkit-transform-origin: 50% 50%;
  transform-origin: 50% 50%;
}

/* Tail Placements & Rotation */
.popover-card[data-placement^="bottom"] > .popover-tail {
  top: -6px;
  bottom: auto !important;
  -webkit-transform: translateX(-50%) rotate(45deg);
  transform: translateX(-50%) rotate(45deg);
  border-top-width: 1px;
  border-left-width: 1px;
  border-bottom-width: 0;
  border-right-width: 0;
}

.popover-card[data-placement^="top"] > .popover-tail {
  bottom: -6px;
  top: auto !important;
  -webkit-transform: translateX(-50%) rotate(45deg);
  transform: translateX(-50%) rotate(45deg);
  border-bottom-width: 1px;
  border-right-width: 1px;
  border-top-width: 0;
  border-left-width: 0;
}

.popover-card[data-placement^="right"] > .popover-tail {
  left: -6px;
  -webkit-transform: translateY(-50%) rotate(45deg);
  transform: translateY(-50%) rotate(45deg);
  border-bottom-width: 1px;
  border-left-width: 1px;
}

.popover-card[data-placement^="left"] > .popover-tail {
  right: -6px;
  -webkit-transform: translateY(-50%) rotate(45deg);
  transform: translateY(-50%) rotate(45deg);
  border-top-width: 1px;
  border-right-width: 1px;
}

/* Popover Content Typography & Sections */
.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--bg-panel-hover);
}

.popover-title {
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--color-primary);
  margin: 0;
  line-height: 1.2;
}

.popover-body {
  font-family: var(--font-brand);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.popover-menu-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.popover-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--font-brand);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  background-color: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.popover-menu-item:hover {
  background-color: var(--color-primary);
  color: var(--bg-canvas);
}

.popover-menu-item:active {
  background-color: var(--color-primary-hover);
  color: var(--bg-canvas);
}

.popover-menu-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: currentColor;
  font-size: 16px;}

.popover-menu-item i.fticon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: currentColor;
  font-size: 16px;}

.popover-menu-item .fticon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  font-size: 16px;}

.popover-menu-item:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.popover-menu-item.is-danger {
  color: var(--color-danger);
}

.popover-menu-item.is-danger svg {
  fill: currentColor;
}

.popover-menu-item.is-danger:hover {
  background-color: var(--color-danger);
  color: var(--color-danger-text);
}

.popover-menu-item.is-danger:active {
  background-color: var(--color-danger-hover);
  color: var(--color-danger-text);
}

.popover-menu-divider {
  height: 1px;
  background-color: var(--bg-panel-hover);
  margin: 4px 6px;
}

/* Dedicated Context / Actions Menu Popover Card */
.popover-card.is-menu-popover {
  padding: 6px;
  min-width: 168px;
  border-radius: 10px;
  background-color: var(--bg-panel);
  border: 1px solid var(--color-primary);
  box-shadow: none;
}

.popover-card.is-menu-popover .popover-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ==========================================================================
   DESKTOP RIGHT-CLICK CONTEXT MENU (AFTER EFFECTS / NATIVE OS STYLE)
   Clean flat rectangular surface, no tail, crisp border, instant response.
   ========================================================================== */
.popover-card.is-context-menu {
  border-radius: 8px !important;
  border: 1px solid var(--border-panel) !important;
  background-color: var(--bg-panel-inner) !important;
  padding: 4px !important;
  min-width: 172px !important;
  max-width: 260px !important;
  box-shadow: none !important;
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.1s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.08s ease-out !important;
}

.popover-card.is-context-menu.is-open {
  transform: scale(1) !important;
  opacity: 1 !important;
}

.popover-card.is-context-menu > .popover-tail {
  display: none !important;
}

.popover-card.is-context-menu .popover-menu-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.popover-card.is-context-menu .popover-menu-item {
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 4px;
  color: var(--text-primary);
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  transition: background-color 0.08s ease, color 0.08s ease;
}

.popover-card.is-context-menu .popover-menu-item:hover:not(:disabled) {
  background-color: var(--color-primary);
  color: var(--bg-canvas);
}

.popover-card.is-context-menu .popover-menu-item:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background-color: transparent !important;
  color: var(--text-muted) !important;
}

.popover-card.is-context-menu .popover-menu-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: 3px 0;
  border: none;
}

/* Context Menu Keyboard Shortcut Hint */
.context-menu-shortcut {
  margin-left: auto;
  padding-left: 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.8;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.popover-menu-item:hover:not(:disabled) .context-menu-shortcut {
  color: var(--bg-canvas);
  opacity: 0.9;
}

@media (max-width: 600px) {
  .context-menu-shortcut {
    display: none;
  }
}


/* ==========================================================================
   VERTICAL MORE SETTINGS POPOVER MODULES
   ========================================================================== */
.popover-settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 4px 0 2px;
}

.popover-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 28px;
}

.popover-setting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.popover-setting-label {
  font-family: var(--font-brand);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.popover-setting-desc {
  font-family: var(--font-brand);
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Flat Pure Toggle Switch */
.popover-toggle-switch {
  width: 36px;
  height: 20px;
  background-color: var(--bg-panel-inner);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  border: none;
  padding: 0;
  outline: none;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.popover-toggle-switch .toggle-thumb {
  width: 14px;
  height: 14px;
  background-color: var(--text-muted);
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease;
  pointer-events: none;
}

.popover-toggle-switch.is-active {
  background-color: var(--color-primary);
}

.popover-toggle-switch.is-active .toggle-thumb {
  transform: translateX(16px);
  background-color: var(--bg-canvas);
}

/* Horizontal Stepper Group (+, Value, -) */
.popover-stepper-group {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-panel-inner);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.stepper-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background-color: transparent;
  color: var(--text-primary);
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  outline: none;
  line-height: 1;
  transition: background-color 0.12s ease, color 0.12s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.stepper-btn:hover {
  background-color: var(--color-primary);
  color: var(--bg-canvas);
}

.stepper-btn:active {
  background-color: var(--color-primary-hover);
  color: var(--bg-canvas);
  transform: scale(0.92);
}

.stepper-value {
  min-width: 44px;
  text-align: center;
  font-family: var(--font-brand);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
  padding: 4px 6px;
  user-select: none;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  transition: background-color 0.12s ease;
}

.stepper-value:hover {
  background-color: var(--bg-panel-hover);
}

/* ==========================================================================
   COMPACT VERTICAL ICON DOCK POPOVER
   ========================================================================== */
.popover-card.is-icon-dock {
  padding: 6px;
  min-width: auto;
  width: 44px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
}

.popover-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background-color: transparent;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: background-color 0.12s ease, color 0.12s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  font-size: 32px;}

.popover-icon-btn:hover {
  background-color: var(--bg-panel-hover);
  color: var(--color-primary-hover);
}

.popover-icon-btn:active {
  background-color: var(--bg-panel-active);
  transform: scale(0.92);
}

.popover-icon-btn.is-active {
  background-color: var(--color-primary);
  color: var(--bg-canvas);
}

.popover-icon-btn.is-active:hover {
  background-color: var(--color-primary-hover);
  color: var(--bg-canvas);
}

.popover-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  font-size: 18px;}

.popover-icon-btn i.fticon {
  width: 18px;
  height: 18px;
  display: block;
  font-size: 18px;}

.popover-icon-divider {
  width: 20px;
  height: 1px;
  background-color: var(--bg-panel-hover);
  margin: 2px 0;
  flex-shrink: 0;
  font-size: 1px;}

/* Vertical Zoom Stepper Container (+ on top, 100% in middle, - on bottom) */
.popover-v-stepper {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--bg-panel-inner);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
  width: 32px;
  box-sizing: border-box;
}

.popover-v-stepper .stepper-btn-v {
  width: 28px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background-color: transparent;
  color: var(--text-primary);
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  outline: none;
  line-height: 1;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.popover-v-stepper .stepper-btn-v:hover {
  background-color: var(--color-primary);
  color: var(--bg-canvas);
}

.popover-v-stepper .stepper-btn-v:active {
  background-color: var(--color-primary-hover);
  color: var(--bg-canvas);
}

.popover-v-stepper .stepper-val-v {
  font-family: var(--font-brand);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 3px 0;
  user-select: none;
  cursor: pointer;
  border-radius: 3px;
  width: 100%;
  line-height: 1;
  transition: background-color 0.12s ease;
}

.popover-v-stepper .stepper-val-v:hover {
  background-color: var(--bg-panel-hover);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE TOUCH SCALING (<= 1100px or Touch Pointer)
   ========================================================================== */
@media (max-width: 1100px), (hover: none) and (pointer: coarse) {
  /* Mobile & Tablet Grid Icon Dock: Space-saving multi-column wrap layout with horizontal zoom stepper */
  .popover-card.is-icon-dock {
    width: 154px;
    padding: 8px;
    border-radius: 14px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
  }

  .popover-card.is-icon-dock .popover-icon-btn,
  .popover-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
  font-size: 40px;}

  .popover-card.is-icon-dock .popover-icon-btn svg,
  .popover-icon-btn svg {
    width: 22px;
    height: 22px;
  font-size: 22px;}

  .popover-card.is-icon-dock .popover-icon-btn i.fticon,
  .popover-icon-btn i.fticon {
    width: 22px;
    height: 22px;
  font-size: 22px;}

  .popover-card.is-icon-dock .popover-icon-btn i.fticon,
  .popover-icon-btn i.fticon {
    width: 22px;
    height: 22px;
  font-size: 22px;
  font-size: 22px;}

  .popover-card.is-icon-dock .popover-icon-divider {
    width: 100%;
    flex-basis: 100%;
    height: 1px;
    background-color: var(--bg-panel-hover);
    margin: 3px 0;
    flex-shrink: 0;
  font-size: 1px;}

  .popover-icon-divider {
    width: 26px;
    margin: 3px 0;
  }

  .popover-card.is-icon-dock .popover-v-stepper,
  .popover-v-stepper {
    width: 100%;
    flex-basis: 100%;
    height: 36px;
    border-radius: 8px;
    padding: 3px 4px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    box-sizing: border-box;
    background-color: var(--bg-canvas);
  font-size: 36px;}

  .popover-card.is-icon-dock .popover-v-stepper .stepper-btn-v,
  .popover-v-stepper .stepper-btn-v {
    width: 36px;
    height: 30px;
    font-size: 18px;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .popover-card.is-icon-dock .popover-v-stepper .stepper-btn-v:last-of-type,
  .popover-v-stepper .stepper-btn-v:last-of-type {
    order: 1; /* '-' on left */
  }

  .popover-card.is-icon-dock .popover-v-stepper .stepper-val-v,
  .popover-v-stepper .stepper-val-v {
    order: 2; /* '100%' in middle */
    font-size: 11px;
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
  }

  .popover-card.is-icon-dock .popover-v-stepper .stepper-btn-v:first-of-type,
  .popover-v-stepper .stepper-btn-v:first-of-type {
    order: 3; /* '+' on right */
  }

  .popover-card[data-placement^="top"] > .popover-tail {
    bottom: -7px;
    width: 14px;
    height: 14px;
  }

  .popover-card[data-placement^="bottom"] > .popover-tail {
    top: -7px;
    width: 14px;
    height: 14px;
  }
}

/* ==========================================================================
   DYNAMIC EMBEDDED TOOL PANEL POPOVER (.is-embed-panel)
   ========================================================================== */
.popover-card.is-embed-panel {
  width: min(390px, calc(100vw - 20px));
  height: min(460px, 68vh);
  padding: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: visible;
  border-radius: 12px;
  background-color: var(--bg-panel);
  border: 1px solid var(--color-primary);
}

.popover-card.is-embed-panel > .popover-tail {
  background-color: var(--bg-panel);
  border-color: var(--color-primary);
}

.popover-embed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--bg-panel-hover);
  flex-shrink: 0;
}

.popover-embed-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.popover-embed-title-group img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.popover-embed-title {
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
  line-height: 1;
}

.popover-embed-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.popover-embed-close-btn:hover {
  background-color: var(--bg-panel-hover);
  color: var(--color-primary);
}

.popover-embed-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: inherit;
  overflow: hidden;
}

/* Minimalist Flat Loading Box */
.popover-loader-box {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--color-primary);
  font-family: var(--font-brand);
  font-size: 12.5px;
  font-weight: 700;
  user-select: none;
}

.popover-flat-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--bg-panel-inner);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: popoverSpin 0.7s linear infinite;
}

@keyframes popoverSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Iframe Container */
.popover-embed-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: inherit;
  background-color: var(--bg-canvas);
  display: none;
  flex: 1;
  min-height: 0;
}

.popover-embed-frame.is-loaded {
  display: block;
}

@media (max-width: 600px) {
  .popover-card.is-embed-panel {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    border-radius: 12px;
  }
}

/* ==========================================================================
   MODULAR LAYER LINK / PARENTING POPOVER COMPONENT
   ========================================================================== */
.popover-card.is-layer-link-popover {
  min-width: 220px;
  max-width: 280px;
  padding: 8px;
  border-radius: 10px;
  background-color: var(--bg-panel);
  border: 1px solid var(--color-primary);
  box-shadow: none;
}

.popover-card.is-layer-link-popover .popover-header {
  padding: 4px 8px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.layer-link-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
}

.layer-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  background-color: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  cursor: pointer;
  outline: none !important;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.layer-link-item:hover:not(.is-disabled),
.layer-link-item.is-drag-hover:not(.is-disabled) {
  background-color: var(--color-primary);
  color: var(--bg-canvas);
}

.layer-link-item.is-selected {
  background-color: var(--bg-dashboard);
  color: var(--color-primary);
}

.layer-link-item.is-selected:hover:not(.is-disabled),
.layer-link-item.is-selected.is-drag-hover:not(.is-disabled) {
  background-color: var(--color-primary);
  color: var(--bg-canvas);
}

.layer-link-item.is-disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Layer Preview Box */
.layer-link-preview-box {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--bg-dashboard);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
  pointer-events: none;
}

.layer-link-item.is-selected .layer-link-preview-box {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.layer-link-item:hover:not(.is-disabled) .layer-link-preview-box,
.layer-link-item.is-drag-hover:not(.is-disabled) .layer-link-preview-box {
  border-color: var(--bg-canvas);
  color: var(--bg-canvas);
  background-color: transparent;
}

.layer-link-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.layer-link-preview-box svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  font-size: 16px;}

.layer-link-preview-box i.fticon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  font-size: 16px;}

.layer-link-preview-box.is-none svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  font-size: 15px;}

.layer-link-preview-box.is-none i.fticon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  font-size: 15px;}

.layer-link-item-name {
  font-family: var(--font-brand);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  color: inherit;
  pointer-events: none;
}

.layer-link-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-left: auto;
  pointer-events: none;
}

.layer-link-check svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  font-size: 16px;}

.layer-link-check i.fticon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  font-size: 16px;}

.layer-link-item:hover:not(.is-disabled) .layer-link-check,
.layer-link-item.is-drag-hover:not(.is-disabled) .layer-link-check {
  color: var(--bg-canvas);
}

/* ==========================================================================
   MODULAR CONFIRMATION POPOVER COMPONENT (.is-confirm-popover)
   ========================================================================== */
.popover-card.is-confirm-popover {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-sizing: border-box;
  box-shadow: none;
}

.popover-confirm-title {
  font-family: var(--font-brand);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.popover-confirm-desc {
  font-family: var(--font-brand);
  font-size: 10.5px;
  color: var(--text-muted);
}

.popover-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.popover-confirm-btn {
  height: 28px;
  padding: 0 12px;
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  outline: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.popover-confirm-btn.is-cancel {
  background-color: var(--bg-panel-hover);
  color: var(--text-primary);
}

.popover-confirm-btn.is-cancel:hover {
  background-color: var(--border-subtle);
}

.popover-confirm-btn.is-danger {
  background-color: var(--color-danger);
  color: var(--bg-canvas);
}

.popover-confirm-btn.is-danger:hover {
  background-color: var(--color-danger-hover);
}

/* ==========================================================================
   MODULAR VALUE INPUT POPOVER (.is-value-input-popover)
   Direct keyboard numeric input for effect & controller value badges
   ========================================================================== */
.popover-card.is-value-input-popover {
  padding: 4px;
  min-width: unset;
  width: auto;
  background-color: var(--bg-panel);
  border: 1px solid var(--color-primary);
  border-radius: 8px;
  box-shadow: none;
}

.popover-value-form {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.popover-value-field {
  width: 80px;
  height: 28px;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0 6px;
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.12s ease;
  -moz-appearance: textfield;
}

.popover-value-field::-webkit-inner-spin-button,
.popover-value-field::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.popover-value-field:focus {
  border-color: var(--color-primary);
}

/* ==========================================================================
   TRANSFORM EXPRESSION POPOVER (.is-expression-popover)
   Pure Flat & Fast | 100% Theme Tokens | No Blur | No Shadow
   ========================================================================== */
.popover-card.is-expression-popover {
  width: 290px;
  max-width: calc(100vw - 32px);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 10px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-subtle);
}

.expression-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.expression-popover-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.expression-clear-btn {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.12s, background-color 0.12s;
  outline: none;
}

.expression-clear-btn:hover {
  color: var(--color-danger);
  background-color: var(--bg-panel-hover);
}

.expression-popover-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.expression-textarea {
  width: 100%;
  min-height: 80px;
  max-height: 180px;
  resize: vertical;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.4;
  outline: none;
  box-sizing: border-box;
}

.expression-textarea:focus {
  border-color: var(--color-primary);
}

.expression-error-msg {
  font-size: 10px;
  color: var(--color-danger);
  line-height: 1.3;
}

/* ==========================================================================
   PLAYBACK SETTINGS POPOVER (.is-play-settings-popover)
   ========================================================================== */
.popover-card.is-play-settings-popover {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--bg-panel);
  border: 1px solid var(--color-primary);
  border-radius: 10px;
  box-shadow: none;
}

.play-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.play-settings-label {
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.play-settings-segmented {
  display: flex;
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.play-settings-segmented .effects-segmented-btn {
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.play-settings-segmented .effects-segmented-btn:hover {
  color: var(--text-primary);
}

.play-settings-segmented .effects-segmented-btn.is-active {
  background-color: var(--color-primary);
  color: var(--bg-canvas);
  font-weight: 700;
}

/* ==========================================================================
   MODULAR LAYER ATTRIBUTES POPOVER (COPY & PASTE TOGGLE MATRIX)
   100% Flat Design Tokens | Fast Tactile Selection | Zero Hyperbole
   ========================================================================== */
.popover-card.is-attributes-popover {
  width: 270px;
  padding: 8px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-sizing: border-box;
}

.attributes-popover-header {
  display: none !important;
}

.attributes-popover-title {
  display: none !important;
}

.attributes-popover-subtitle {
  display: none !important;
}

/* Speed & Audio Top Row (Cut buttons removed, stretched 50%/50% to fill space) */
.attributes-speed-audio-row {
  display: flex;
  gap: 6px;
  width: 100%;
  margin: 0 0 6px 0;
  box-sizing: border-box;
}

.attributes-speed-audio-row:empty {
  display: none !important;
  margin: 0 !important;
}

.attributes-speed-audio-row .attr-toggle-btn {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  height: 44px;
  padding: 6px 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.attributes-speed-audio-row .attr-toggle-btn .attr-toggle-icon {
  width: 18px;
  height: 18px;
  font-size: 18px;
}

.attributes-speed-audio-row .attr-toggle-btn .attr-toggle-label {
  font-size: 11.5px;
  white-space: nowrap;
}

.attributes-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.attributes-toggle-grid:empty {
  display: none !important;
  margin: 0 !important;
}

.attributes-toggle-grid:has(> :first-child:nth-last-child(1)) {
  grid-template-columns: 1fr;
}

.attributes-toggle-grid:has(> :first-child:nth-last-child(4)),
.attributes-toggle-grid:has(> :first-child:nth-last-child(2)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 5 items: 3 on top row, 2 on bottom row (spanning edge-to-edge) */
.attributes-toggle-grid:has(> :first-child:nth-last-child(5)) {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.attributes-toggle-grid:has(> :first-child:nth-last-child(5)) > :nth-child(1),
.attributes-toggle-grid:has(> :first-child:nth-last-child(5)) > :nth-child(2),
.attributes-toggle-grid:has(> :first-child:nth-last-child(5)) > :nth-child(3) {
  grid-column: span 2;
}

.attributes-toggle-grid:has(> :first-child:nth-last-child(5)) > :nth-child(4),
.attributes-toggle-grid:has(> :first-child:nth-last-child(5)) > :nth-child(5) {
  grid-column: span 3;
}

.attr-toggle-btn {
  background-color: var(--bg-dashboard);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  min-height: 62px;
  height: 64px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.attr-toggle-btn:hover {
  background-color: var(--bg-panel-hover);
  color: var(--color-primary);
  border-color: var(--border-subtle);
}

.attr-toggle-btn.is-active {
  background-color: var(--color-primary) !important;
  color: var(--bg-canvas) !important;
  border-color: var(--color-primary) !important;
}

.attr-toggle-btn.is-active .attr-toggle-icon,
.attr-toggle-btn.is-active .attr-toggle-label {
  color: var(--bg-canvas) !important;
}

.attr-toggle-btn.is-disabled {
  opacity: 0.28;
  pointer-events: none;
  cursor: not-allowed;
  border-style: dashed;
}

.attr-toggle-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  pointer-events: none;
  font-size: 22px;}

.attr-toggle-icon svg,
.attr-toggle-icon .fticon {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.attr-toggle-label {
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  color: inherit;
  pointer-events: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attributes-popover-footer {
  display: flex;
  width: 100%;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
  box-sizing: border-box;
}

.attr-action-btn {
  width: 100%;
  background-color: var(--color-primary);
  color: var(--bg-canvas);
  font-family: var(--font-brand);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 0;
  border-radius: 8px;
  border: none;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color 0.12s ease, transform 0.08s ease;
  text-align: center;
  box-sizing: border-box;
}

.attr-action-btn:hover {
  background-color: var(--color-primary-hover);
}

.attr-action-btn:active {
  background-color: var(--color-primary-hover);
  transform: scale(0.98);
}








