.alerts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  gap: 18px;
  align-items: start;
}

.alerts-card {
  display: grid;
  gap: 18px;
  background:
    radial-gradient(circle at 100% 0, #20d3ee22, transparent 34%),
    linear-gradient(145deg, #17141f, #101018);
}

.alerts-master,
.alert-event-basics,
.alert-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.alerts-master {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.switch-row.compact {
  min-height: 58px;
  padding: 10px 12px;
}

.alerts-global,
.alert-event-editor {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid #ffffff10;
  border-radius: 10px;
  background: #0b0a12a8;
}

.alert-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.alert-section-title h3 {
  margin: 2px 0 0;
  color: #f6f2ff;
  font-size: 15px;
}

.alert-section-title small {
  max-width: 280px;
  color: #8f879a;
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
}

.alert-design-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.alert-design-row button {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #ffffff12;
  border-radius: 8px;
  background: #0b0a12;
  color: #d8d2e4;
  cursor: pointer;
  text-align: left;
}

.alert-design-row button:hover:not(:disabled) {
  border-color: #40e0d066;
  transform: translateY(-1px);
}

.alert-design-row button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.alert-design-row span {
  display: block;
  height: 32px;
  border-bottom: 1px solid #ffffff0f;
}

.alert-design-row b {
  display: block;
  padding: 7px 8px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.alert-control-grid .span-2 {
  grid-column: span 2;
}

.alert-control-grid.is-disabled {
  opacity: .55;
}

.alert-control-grid input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 3px;
  border: 1px solid #ffffff14;
  border-radius: 10px;
  background: #0b0a12;
  cursor: pointer;
}

.alert-control-grid input[type="range"],
.alerts-master input[type="range"] {
  width: 100%;
  accent-color: #40e0d0;
}

.alerts-editor {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.alert-event-list {
  display: grid;
  gap: 8px;
  max-height: 880px;
  overflow: auto;
  padding-right: 4px;
}

.alert-event-list button {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 9px;
  gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 9px;
  border: 1px solid #ffffff10;
  border-radius: 8px;
  background: #11101a;
  color: #f4f0fb;
  cursor: pointer;
  text-align: left;
}

.alert-event-list button:hover,
.alert-event-list button.is-active {
  border-color: #40e0d066;
  background: #152025;
}

.alert-event-list .line-icon {
  width: 18px;
  height: 18px;
}

.alert-event-list span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ffffff08;
  color: #40e0d0;
}

.alert-event-list b,
.alert-event-list small {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-event-list b {
  font-size: 12px;
}

.alert-event-list small {
  color: #8f879a;
  font-size: 10.5px;
}

.alert-event-list i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #55515f;
}

.alert-event-list i.on {
  background: #37d39e;
  box-shadow: 0 0 12px #37d39e;
}

.alert-event-style.muted-style {
  opacity: .72;
}

.alert-vars {
  margin-top: 0;
}

.alerts-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.alerts-preview {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  border: 1px solid #282538;
  border-radius: 10px;
  background: #111018;
  overflow: hidden;
  box-shadow: 0 16px 40px #00000045;
}

.alerts-preview-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border-bottom: 1px solid #282538;
  color: #aaa3b5;
  font-size: 12px;
}

.alerts-preview-top span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #40e0d0;
  box-shadow: 0 0 14px #40e0d0;
}

.alerts-stage-preview {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(45deg, #ffffff08 25%, transparent 25%, transparent 75%, #ffffff08 75%),
    linear-gradient(45deg, #ffffff08 25%, transparent 25%, transparent 75%, #ffffff08 75%),
    #0b0d13;
  background-position: 0 0, 14px 14px;
  background-size: 28px 28px;
}

.alert-preview-card,
.fc-alert-card {
  position: relative;
  width: max-content;
  max-width: min(var(--alert-max-width, 720px), calc(100% - 8px));
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 30px 34px;
  border: 1px solid color-mix(in srgb, var(--alert-accent, #40e0d0) 48%, #ffffff18);
  border-radius: var(--alert-radius, 18px);
  background: var(--alert-bg, transparent);
  box-shadow:
    0 24px 70px rgb(0 0 0 / calc(var(--alert-shadow, 0) * 1%)),
    0 0 calc(var(--alert-glow, 48) * 1px) color-mix(in srgb, var(--alert-accent, #40e0d0) 42%, transparent);
  color: var(--alert-text, #fff);
  transform: scale(var(--alert-scale, 1));
  transform-origin: center;
  overflow: visible;
  isolation: isolate;
}

.alert-preview-card.bg-transparent,
.fc-alert-card.bg-transparent {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  padding: 8px;
}

.alert-preview-card h3,
.fc-alert-card h3 {
  position: relative;
  z-index: 5;
  margin: 0;
  color: var(--alert-title, var(--alert-text, #fff));
  font-size: var(--alert-size, 42px);
  font-weight: var(--alert-weight, 900);
  font-style: var(--alert-font-style, normal);
  line-height: 1.05;
  text-decoration: var(--alert-text-decoration, none);
  text-shadow: var(--alert-text-shadow, none);
  text-transform: var(--alert-text-transform, none);
  -webkit-text-stroke: var(--alert-stroke, 0 transparent);
  display: inline-block;
  width: max-content;
  max-width: none;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  transform: translate(var(--alert-title-x, 0px), var(--alert-title-y, 0px));
}

.alert-preview-card p,
.fc-alert-card p {
  position: relative;
  z-index: 5;
  margin: 10px 0 0;
  color: var(--alert-message, color-mix(in srgb, var(--alert-text, #fff) 82%, transparent));
  font-size: var(--alert-message-size, calc(var(--alert-size, 42px) * .42));
  font-weight: 750;
  font-style: var(--alert-font-style, normal);
  line-height: 1.34;
  text-decoration: var(--alert-text-decoration, none);
  text-shadow: var(--alert-text-shadow, none);
  text-transform: var(--alert-text-transform, none);
  -webkit-text-stroke: var(--alert-stroke, 0 transparent);
  display: inline-block;
  width: max-content;
  max-width: min(100%, 42ch);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  transform: translate(var(--alert-message-x, 0px), var(--alert-message-y, 0px));
}

.alert-preview-inner,
.fc-alert-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  min-width: 0;
  text-align: center;
}

.alert-preview-copy,
.fc-alert-copy {
  position: relative;
  z-index: 5;
  min-width: min-content;
  max-width: 100%;
  flex: 0 1 auto;
}

.text-inline .alert-preview-copy,
.text-inline .fc-alert-copy {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .55em;
  overflow: hidden;
  white-space: nowrap;
}

.text-inline .alert-preview-copy h3,
.text-inline .alert-preview-copy p,
.text-inline .fc-alert-copy h3,
.text-inline .fc-alert-copy p {
  min-width: max-content;
  max-width: none;
  margin: 0;
  overflow: visible;
  overflow-wrap: normal;
  white-space: nowrap;
}

.text-inline .alert-preview-copy h3:empty,
.text-inline .alert-preview-copy p:empty,
.text-inline .fc-alert-copy h3:empty,
.text-inline .fc-alert-copy p:empty {
  display: none;
}

.alert-preview-media,
.fc-alert-media {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: var(--alert-media-width, var(--alert-media-size, 220px));
  height: var(--alert-media-height, auto);
  max-width: none;
  max-height: var(--alert-media-max-height, var(--alert-media-size, 220px));
  transform: translate(var(--alert-media-x, 0px), var(--alert-media-y, 0px));
}

.alert-preview-media img,
.alert-preview-media video,
.fc-alert-media img,
.fc-alert-media video {
  width: 100%;
  height: var(--alert-media-height, auto);
  max-height: var(--alert-media-max-height, var(--alert-media-size, 220px));
  object-fit: var(--alert-media-fit, contain);
  border-radius: calc(var(--alert-radius, 18px) * .55);
  filter: drop-shadow(0 18px 34px #0007);
}

.layout-media-top .alert-preview-inner,
.layout-media-top .fc-alert-inner,
.layout-text-only .alert-preview-inner,
.layout-text-only .fc-alert-inner {
  flex-direction: column;
}

.layout-media-right .alert-preview-inner,
.layout-media-right .fc-alert-inner {
  flex-direction: row;
}

.layout-media-left .alert-preview-inner,
.layout-media-left .fc-alert-inner {
  flex-direction: row;
}

.layout-background .alert-preview-media,
.layout-background .fc-alert-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: auto;
  max-height: none;
  opacity: .42;
}

.layout-background .alert-preview-media img,
.layout-background .alert-preview-media video,
.layout-background .fc-alert-media img,
.layout-background .fc-alert-media video {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  object-fit: var(--alert-media-fit, cover);
}

.layout-background::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, #00000022, #00000072);
}

.alert-stage {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 16px;
  box-sizing: border-box;
  pointer-events: none;
  overflow: hidden;
}

.alert-stage > .fc-alert-card {
  position: relative;
  margin: 0;
  pointer-events: none;
}

.alert-stage[data-position="top-left"] { place-items: start start; }
.alert-stage[data-position="top"] { place-items: start center; }
.alert-stage[data-position="top-right"] { place-items: start end; }
.alert-stage[data-position="center-left"] { place-items: center start; }
.alert-stage[data-position="center"] { place-items: center; }
.alert-stage[data-position="center-right"] { place-items: center end; }
.alert-stage[data-position="bottom-left"] { place-items: end start; }
.alert-stage[data-position="bottom"] { place-items: end center; }
.alert-stage[data-position="bottom-right"] { place-items: end end; }

.hype-event,
.goal-event,
.shoutout-event {
  border: 1px solid var(--accent-border);
  background:
    radial-gradient(circle at 22px 18px, var(--accent-soft), transparent 58px),
    linear-gradient(105deg, #17212b, #11151ddc);
}

.hype-event .event-icon,
.goal-event .event-icon,
.shoutout-event .event-icon {
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 78%, white);
  font-size: 10px;
  font-weight: 900;
}

.hype-event .event-kicker,
.goal-event .event-kicker,
.shoutout-event .event-kicker {
  color: color-mix(in srgb, var(--accent) 70%, white);
}

.fc-alert-card {
  opacity: 0;
  transition: opacity .22s ease, transform .36s cubic-bezier(.2,.8,.2,1), filter .36s ease;
}

.fc-alert-card.is-visible {
  opacity: 1;
}

.fc-alert-card.is-leaving {
  pointer-events: none;
}

.fc-alert-card.anim-fade-up { transform: translateY(22px) scale(var(--alert-scale, 1)); }
.fc-alert-card.anim-fade-up.is-visible { transform: translateY(0) scale(var(--alert-scale, 1)); }
.fc-alert-card.anim-fade-up.is-leaving {
  animation: none;
  opacity: 0;
  transform: translateY(22px) scale(var(--alert-scale, 1));
}
.fc-alert-card.anim-slide-from-left { transform: translateX(-90px) scale(var(--alert-scale, 1)); }
.fc-alert-card.anim-slide-from-right,
.fc-alert-card.anim-slide-left { transform: translateX(90px) scale(var(--alert-scale, 1)); }
.fc-alert-card.anim-slide-from-left.is-visible,
.fc-alert-card.anim-slide-from-right.is-visible,
.fc-alert-card.anim-slide-left.is-visible { transform: translateX(0) scale(var(--alert-scale, 1)); }
.fc-alert-card.anim-slide-from-left.is-leaving {
  animation: none;
  opacity: 0;
  transform: translateX(-90px) scale(var(--alert-scale, 1));
}
.fc-alert-card.anim-slide-from-right.is-leaving,
.fc-alert-card.anim-slide-left.is-leaving {
  animation: none;
  opacity: 0;
  transform: translateX(90px) scale(var(--alert-scale, 1));
}
.fc-alert-card.anim-scale-pop.is-visible { animation: fc-scale-pop .54s cubic-bezier(.2,1.4,.2,1) both; }
.fc-alert-card.anim-drop-bounce.is-visible { animation: fc-drop-bounce .72s cubic-bezier(.18,.9,.3,1.2) both; }
.fc-alert-card.anim-flip-in.is-visible { animation: fc-flip-in .6s cubic-bezier(.2,.9,.3,1) both; transform-origin: center top; }
.fc-alert-card.anim-blur-in.is-visible { animation: fc-blur-in .56s ease both; }
.fc-alert-card.anim-swing-in.is-visible { animation: fc-swing-in .7s cubic-bezier(.2,1.1,.3,1.1) both; transform-origin: top center; }

/* Mirror exits — reverse of the matching enter animation */
.fc-alert-card.anim-scale-pop.is-leaving {
  animation: fc-scale-pop-out .42s cubic-bezier(.4,0,.2,1) both;
}
.fc-alert-card.anim-drop-bounce.is-leaving {
  animation: fc-drop-bounce-out .48s cubic-bezier(.4,0,.2,1) both;
}
.fc-alert-card.anim-flip-in.is-leaving {
  animation: fc-flip-out .42s cubic-bezier(.4,0,.2,1) both;
  transform-origin: center top;
}
.fc-alert-card.anim-blur-in.is-leaving {
  animation: fc-blur-out .4s ease both;
}
.fc-alert-card.anim-swing-in.is-leaving {
  animation: fc-swing-out .46s cubic-bezier(.4,0,.2,1) both;
  transform-origin: top center;
}

@keyframes fc-scale-pop {
  0% { opacity: 0; transform: scale(calc(var(--alert-scale, 1) * .74)); }
  70% { opacity: 1; transform: scale(calc(var(--alert-scale, 1) * 1.05)); }
  100% { opacity: 1; transform: scale(var(--alert-scale, 1)); }
}
@keyframes fc-scale-pop-out {
  0% { opacity: 1; transform: scale(var(--alert-scale, 1)); }
  100% { opacity: 0; transform: scale(calc(var(--alert-scale, 1) * .74)); }
}
@keyframes fc-drop-bounce {
  0% { opacity: 0; transform: translateY(-120px) scale(calc(var(--alert-scale, 1) * .96)); }
  60% { opacity: 1; transform: translateY(12px) scale(calc(var(--alert-scale, 1) * 1.02)); }
  80% { transform: translateY(-6px) scale(var(--alert-scale, 1)); }
  100% { transform: translateY(0) scale(var(--alert-scale, 1)); }
}
@keyframes fc-drop-bounce-out {
  0% { opacity: 1; transform: translateY(0) scale(var(--alert-scale, 1)); }
  100% { opacity: 0; transform: translateY(-120px) scale(calc(var(--alert-scale, 1) * .96)); }
}
@keyframes fc-flip-in {
  0% { opacity: 0; transform: perspective(900px) rotateX(-78deg) scale(var(--alert-scale, 1)); }
  100% { opacity: 1; transform: perspective(900px) rotateX(0) scale(var(--alert-scale, 1)); }
}
@keyframes fc-flip-out {
  0% { opacity: 1; transform: perspective(900px) rotateX(0) scale(var(--alert-scale, 1)); }
  100% { opacity: 0; transform: perspective(900px) rotateX(-78deg) scale(var(--alert-scale, 1)); }
}
@keyframes fc-blur-in {
  0% { opacity: 0; filter: blur(18px); transform: scale(calc(var(--alert-scale, 1) * 1.08)); }
  100% { opacity: 1; filter: blur(0); transform: scale(var(--alert-scale, 1)); }
}
@keyframes fc-blur-out {
  0% { opacity: 1; filter: blur(0); transform: scale(var(--alert-scale, 1)); }
  100% { opacity: 0; filter: blur(18px); transform: scale(calc(var(--alert-scale, 1) * 1.08)); }
}
@keyframes fc-swing-in {
  0% { opacity: 0; transform: rotate(-7deg) translateY(-24px) scale(var(--alert-scale, 1)); }
  55% { opacity: 1; transform: rotate(3deg) translateY(0) scale(var(--alert-scale, 1)); }
  75% { transform: rotate(-1.5deg) scale(var(--alert-scale, 1)); }
  100% { transform: rotate(0) scale(var(--alert-scale, 1)); }
}
@keyframes fc-swing-out {
  0% { opacity: 1; transform: rotate(0) translateY(0) scale(var(--alert-scale, 1)); }
  100% { opacity: 0; transform: rotate(-7deg) translateY(-24px) scale(var(--alert-scale, 1)); }
}

@media (max-width: 960px) {
  .alerts-layout,
  .alerts-editor,
  .alerts-master,
  .alert-event-basics,
  .alert-template-grid {
    grid-template-columns: 1fr;
  }
  .alert-design-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .alert-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .alerts-preview {
    position: static;
  }
}

@media (max-width: 560px) {
  .alert-control-grid,
  .alert-control-grid .span-2 {
    grid-template-columns: 1fr;
    grid-column: auto;
  }
  .alert-design-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .alert-preview-card,
  .fc-alert-card {
    padding: 22px;
  }
}

/* Standalone OBS alerts source (alerts-overlay.html) */
body.alerts-only {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: transparent;
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
}

body.alerts-only *,
body.alerts-only *::before,
body.alerts-only *::after {
  box-sizing: border-box;
}

body.alerts-only .alert-stage {
  position: fixed;
  inset: 0;
}

.alerts-obs-links,
.obs-link-groups {
  display: grid;
  gap: 12px;
}

.obs-link-groups {
  margin-bottom: 4px;
}

.obs-link-group {
  display: grid;
  gap: 8px;
}

.alerts-live-preview iframe {
  min-height: 420px;
}

/* Alerts editor rebuild */
.alerts-panel-section {
  --alerts-line: #242735;
  --alerts-line-strong: #3a4054;
  --alerts-panel: #0d0f17;
  --alerts-panel-2: #11131d;
  --alerts-text: #f7f7fb;
  --alerts-muted: #9aa1b4;
  --alerts-accent: #8b5cf6;
  --alerts-cyan: #20d3ee;
}

.dashboard-shell[data-section="alerts"] > .dashboard-summary {
  display: none;
}

.alerts-layout.alerts-studio {
  display: block;
  max-width: 1580px;
  margin: 0 auto;
}

.alerts-studio .alerts-card {
  display: grid;
  width: 100%;
  max-width: none;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--alerts-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
    var(--alerts-panel);
  box-shadow: 0 18px 46px rgba(0,0,0,.32);
}

.alerts-studio .alerts-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--alerts-line);
}

.alerts-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.alerts-studio .alerts-heading h2 {
  margin-top: 3px;
  font-size: clamp(24px, 2vw, 34px);
  letter-spacing: 0;
}

.alerts-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.alerts-test-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 209, 102, .5);
  border-radius: 999px;
  color: #ffe2a1;
  background: linear-gradient(135deg, rgba(255, 209, 102, .18), rgba(255, 92, 160, .1));
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 18px rgba(255, 179, 71, .16);
}

.alerts-test-badge.mini {
  min-height: 19px;
  margin-left: 6px;
  padding: 3px 7px;
  font-size: 9px;
  vertical-align: 1px;
}

.alerts-studio .alerts-heading .card-sub {
  max-width: 780px;
  color: var(--alerts-muted);
  font-size: 14px;
  line-height: 1.55;
}

.alerts-studio .alerts-obs-links {
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--alerts-line);
  border-radius: 8px;
  background: #090b12;
}

.alert-workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.alert-workflow-strip span {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: #090b12;
  color: #dfe8f7;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.alert-workflow-strip b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #061014;
  background: #40e0d0;
  font-size: 12px;
}

.alert-test-identity {
  display: grid;
  grid-template-columns: minmax(220px, .72fr) minmax(0, 1.8fr);
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid rgba(64,224,208,.22);
  border-radius: 10px;
  background:
    radial-gradient(circle at 0 0, rgba(64,224,208,.1), transparent 34%),
    linear-gradient(135deg, rgba(139,92,246,.08), rgba(9,11,18,.96) 48%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.025) inset;
}

.alert-test-identity-copy,
.alert-test-identity-controls {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.alert-test-identity-copy strong {
  color: #f4f7ff;
  font-size: 15px;
}

.alert-test-identity-copy small,
.alert-test-current-name {
  color: #969fb2;
  font-size: 11px;
  line-height: 1.45;
}

.alert-test-current-name {
  color: #8fded7;
  font-weight: 750;
}

.alert-test-nickname-entry {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
}

.alert-test-nickname-entry .input {
  min-width: 0;
  min-height: 38px;
  border-color: rgba(64,224,208,.26);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
}

.alert-test-nickname-entry .input::placeholder {
  color: #a9b2c5;
  opacity: .72;
}

.alert-test-nickname-entry .button {
  min-height: 38px;
  white-space: nowrap;
}

.alert-test-nickname-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alert-test-nickname-presets button {
  min-width: 0;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 999px;
  color: #b9c1d1;
  background: rgba(17,19,29,.9);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease, transform .16s ease;
}

.alert-test-nickname-presets button:hover,
.alert-test-nickname-presets button.is-active {
  border-color: rgba(64,224,208,.48);
  color: #f4ffff;
  background: linear-gradient(135deg, rgba(64,224,208,.16), rgba(139,92,246,.16));
  transform: translateY(-1px);
}

.alert-test-identity.is-compact {
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
}

.alert-test-identity.is-compact .alert-test-identity-copy {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.alert-test-identity.is-compact .alert-test-identity-copy small {
  grid-column: 1 / -1;
}

.alerts-studio .alerts-obs-links .link-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.alerts-studio .alerts-master {
  grid-template-columns: minmax(190px, 1.05fr) minmax(160px, .9fr) minmax(180px, 1fr) minmax(190px, 1fr) minmax(190px, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--alerts-line);
  border-radius: 8px;
  background: var(--alerts-panel-2);
}

.alerts-page-preview {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--alerts-line);
  border-radius: 8px;
  background: #090b12;
}

.alerts-page-preview > div:first-child {
  align-self: start;
  padding: 10px;
}

.alerts-page-preview h3 {
  margin: 4px 0 0;
  color: #fff;
  font-size: 18px;
}

.alerts-page-preview p {
  margin: 8px 0 0;
  color: var(--alerts-muted);
  font-size: 12px;
  line-height: 1.45;
}

.alerts-page-preview .alerts-preview {
  position: static;
  min-width: 0;
  border-color: rgba(255,255,255,.1);
  box-shadow: none;
}

.alerts-studio .switch-row.compact {
  min-height: 54px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #0a0c13;
}

.alerts-studio .switch-row.compact strong {
  font-size: 13px;
}

.alerts-studio .switch-row.compact small {
  margin-top: 3px;
  font-size: 11px;
}

.alerts-studio .alerts-editor {
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.alerts-studio .alert-event-list {
  align-content: start;
  max-height: none;
  overflow: visible;
  padding: 8px;
  border: 1px solid var(--alerts-line);
  border-radius: 8px;
  background: #090b12;
}

.alerts-studio .alert-event-list button {
  grid-template-columns: 34px 28px minmax(0, 1fr) 10px;
  min-height: 48px;
  padding: 7px 8px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.alerts-studio .alert-event-list button:hover,
.alerts-studio .alert-event-list button.is-active {
  border-color: rgba(139,92,246,.55);
  background: linear-gradient(90deg, rgba(139,92,246,.28), rgba(32,211,238,.12));
}

.alerts-studio .alert-event-list em {
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border: 1px solid var(--alerts-line-strong);
  border-radius: 8px;
  color: #fff;
  font-style: normal;
  font-weight: 800;
  font-size: 13px;
  background: #151724;
}

.alerts-studio .alert-event-list span {
  grid-column: 2;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(32,211,238,.1);
}

.alerts-studio .alert-event-list b,
.alerts-studio .alert-event-list small {
  grid-column: 3;
}

.alerts-studio .alert-event-list b {
  font-size: 13px;
  line-height: 1.1;
}

.alerts-studio .alert-event-list i {
  grid-column: 4;
}

.alerts-studio .alert-event-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  gap: 14px;
  padding: 14px;
  border-color: var(--alerts-line);
  border-radius: 8px;
  background: #090b12;
}

.alerts-studio .alert-event-title,
.alerts-studio .alert-event-basics,
.alerts-studio .alert-template-grid,
.alerts-studio .alert-vars,
.alerts-studio .alert-event-style,
.alerts-studio .alerts-actions {
  grid-column: 1;
}

.alerts-studio .alerts-preview {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  position: static;
  border-color: var(--alerts-line);
  border-radius: 8px;
  background: #0b0d14;
  box-shadow: none;
}

.alerts-studio .alert-section-title {
  align-items: center;
  min-width: 0;
}

.alerts-studio .alert-section-title h3 {
  font-size: 18px;
  line-height: 1.2;
}

.alerts-studio .alert-section-title small {
  display: none;
}

.alerts-studio .alert-event-basics {
  grid-row: 3;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1fr);
}

.alerts-studio .alert-template-grid {
  grid-row: 4;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alerts-studio .alert-vars {
  grid-row: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.alerts-studio .alert-vars button {
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid var(--alerts-line);
  background: #11131d;
  color: #dce3f4;
  font-size: 11px;
  font-weight: 800;
}

.alerts-studio .alert-event-style {
  grid-row: 6;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--alerts-line);
  border-radius: 8px;
  background: var(--alerts-panel-2);
}

.alerts-studio .alert-design-row {
  grid-template-columns: repeat(6, minmax(88px, 1fr));
}

.alerts-studio .alert-design-row button {
  border-radius: 8px;
  background: #090b12;
}

.alerts-studio .alert-design-row span {
  height: 34px;
}

.alerts-studio .alert-control-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.alerts-studio .alert-control-grid .span-2 {
  grid-column: span 2;
}

.alerts-studio .alert-control-grid label,
.alerts-studio .alerts-master label {
  min-width: 0;
}

.alerts-studio .alert-control-grid label {
  display: grid;
  gap: 7px;
  align-content: start;
}

.alerts-studio .alert-control-grid .field-label {
  min-height: 18px;
  line-height: 1.2;
}

.alerts-studio .alert-control-grid .input,
.alerts-studio .alert-control-grid .select {
  min-height: 42px;
}

.alerts-studio .alert-control-grid input[type="color"] {
  height: 38px;
  border-radius: 8px;
}

.alerts-studio .alerts-stage-preview {
  min-height: 330px;
  overflow: auto;
  padding: 18px;
  background-color: #080a10;
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
}

.alerts-studio .alert-preview-card {
  width: max-content;
  max-width: min(var(--alert-max-width, 720px), 100%);
  max-width: 100%;
  padding: 24px 26px;
}

.alerts-studio .alert-preview-card h3 {
  font-size: clamp(22px, calc(var(--alert-size, 42px) * .72), 40px);
}

.alerts-studio .alert-preview-card p {
  font-size: clamp(13px, calc(var(--alert-size, 42px) * .31), 19px);
}

.alerts-studio .alerts-actions {
  grid-row: 7;
  justify-content: flex-start;
  padding-top: 2px;
}

.alerts-live-preview,
.alerts-global {
  display: none !important;
}

@media (max-width: 1280px) {
  .alerts-studio .alerts-master,
  .alerts-studio .alerts-editor,
  .alerts-studio .alert-event-editor {
    grid-template-columns: 1fr;
  }
  .alerts-studio .alerts-preview {
    grid-column: 1;
    grid-row: auto;
    position: static;
  }
  .alerts-studio .alert-event-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .alerts-studio .alerts-card {
    padding: 12px;
  }
  .alerts-studio .alerts-heading,
  .alerts-page-preview {
    grid-template-columns: 1fr;
  }
  .alerts-heading-actions {
    justify-content: stretch;
  }
  .alerts-heading-actions .button {
    flex: 1 1 160px;
  }
  .alerts-studio .alerts-obs-links,
  .alert-test-identity,
  .alert-workflow-strip,
  .alerts-studio .alerts-obs-links .link-rows,
  .alerts-studio .alert-event-list,
  .alerts-studio .alert-event-basics,
  .alerts-studio .alert-template-grid,
  .alerts-studio .alert-control-grid,
  .alerts-studio .alert-control-grid .span-2 {
    grid-template-columns: 1fr;
    grid-column: auto;
  }
  .alerts-studio .alert-design-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .alerts-studio .alert-control-grid {
    grid-template-columns: 1fr;
  }
  .alert-test-nickname-entry {
    grid-template-columns: 1fr;
  }
  .alert-test-nickname-entry .button {
    width: 100%;
    justify-content: center;
  }
}

/* Responsive 800×600 authoring canvas. The UI grows with 1080p/2K viewports,
   while the alert itself is measured in stable OBS pixels. */
.alerts-preview-top small {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid rgba(64,224,208,.2);
  border-radius: 999px;
  color: #8fded7;
  background: rgba(64,224,208,.07);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.alert-preview-canvas {
  --alert-canvas-scale: .75;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 800px;
  height: 600px;
  display: grid;
  place-items: center;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
  transform: translate(-50%, -50%) scale(var(--alert-canvas-scale));
  transform-origin: center;
}

.alert-preview-canvas > .alert-preview-card {
  position: relative;
  margin: 0;
}

.alerts-preview[data-position="top-left"] .alert-preview-canvas { place-items: start start; }
.alerts-preview[data-position="top"] .alert-preview-canvas { place-items: start center; }
.alerts-preview[data-position="top-right"] .alert-preview-canvas { place-items: start end; }
.alerts-preview[data-position="center-left"] .alert-preview-canvas { place-items: center start; }
.alerts-preview[data-position="center"] .alert-preview-canvas { place-items: center; }
.alerts-preview[data-position="center-right"] .alert-preview-canvas { place-items: center end; }
.alerts-preview[data-position="bottom-left"] .alert-preview-canvas { place-items: end start; }
.alerts-preview[data-position="bottom"] .alert-preview-canvas { place-items: end center; }
.alerts-preview[data-position="bottom-right"] .alert-preview-canvas { place-items: end end; }

.alert-stage {
  padding: clamp(16px, 1.8vmin, 34px);
}

.alerts-studio .alerts-master .alert-canvas-guide {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid rgba(64,224,208,.16);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(64,224,208,.09), rgba(139,92,246,.055));
}

.alert-canvas-guide > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #64e8dc;
  background: rgba(64,224,208,.1);
}

.alert-canvas-guide strong,
.alert-canvas-guide small {
  display: block;
}

.alert-canvas-guide strong {
  color: #eefcfb;
  font-size: 12px;
}

.alert-canvas-guide small,
.alert-master-range > small {
  margin-top: 3px;
  color: #8f98aa;
  font-size: 10px;
  line-height: 1.35;
}

.alert-master-range {
  display: grid;
  align-content: center;
  gap: 7px;
}

@media (max-width: 680px) {
  .alerts-preview-top small {
    display: none;
  }

  .alert-preview-canvas {
    padding: 12px;
  }
}

.alerts-editor .alerts-preview {
  margin-top: 14px;
}

.alerts-studio .alerts-editor {
  grid-template-columns: 1fr;
}

.alerts-studio .alert-event-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.alerts-studio .alert-event-list button {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-height: 196px;
  padding: 12px;
  border: 1px solid var(--alerts-line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)), #090b12;
  color: #f6f2ff;
}

.alerts-studio .alert-event-list button:hover,
.alerts-studio .alert-event-list button.is-active {
  border-color: rgba(139,92,246,.75);
  background: linear-gradient(180deg, rgba(139,92,246,.18), rgba(32,211,238,.055)), #0b0d15;
  transform: translateY(-1px);
}

.alerts-studio .alert-event-list button > * {
  grid-column: auto;
}

.alert-event-card-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.alerts-studio .alert-event-card-head > span {
  grid-column: auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(32,211,238,.1);
  color: #40e0d0;
}

.alerts-studio .alert-event-card-head b,
.alerts-studio .alert-event-card-head small {
  grid-column: auto;
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alerts-studio .alert-event-card-head b {
  font-size: 14px;
}

.alerts-studio .alert-event-card-head small {
  margin-top: 3px;
  color: var(--alerts-muted);
  font-size: 11px;
}

.alerts-studio .alert-event-card-head em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--alerts-line);
  border-radius: 999px;
  color: #a9a2b7;
  background: #11131d;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.alerts-studio .alert-event-card-head em.on {
  border-color: rgba(55,211,158,.3);
  color: #c6ffe9;
  background: rgba(55,211,158,.12);
}

.alert-event-mini-preview {
  position: relative;
  display: grid;
  align-content: center;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  min-height: 96px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--alert-accent) 45%, transparent);
  border-radius: 8px;
  background: var(--alert-bg);
  color: var(--alert-text);
  box-shadow: inset 0 0 24px color-mix(in srgb, var(--alert-accent) 18%, transparent);
}

.alert-event-mini-preview strong,
.alert-event-mini-preview small {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alerts-studio .alert-event-list .alert-event-mini-preview strong,
.alerts-studio .alert-event-list .alert-event-mini-preview small {
  grid-column: 2;
  display: block;
  white-space: nowrap;
}

.alert-event-mini-preview strong {
  grid-column: 1 / -1;
  color: var(--alert-title, var(--alert-text));
  font-size: 13px;
  font-style: var(--alert-font-style, normal);
  line-height: 1.15;
  text-decoration: var(--alert-text-decoration, none);
  text-shadow: var(--alert-text-shadow, none);
  text-transform: var(--alert-text-transform, none);
  -webkit-text-stroke: var(--alert-stroke, 0 transparent);
}

.alert-event-mini-preview small {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: var(--alert-message, color-mix(in srgb, var(--alert-text) 78%, transparent));
  font-size: 10px;
  font-style: var(--alert-font-style, normal);
  text-decoration: var(--alert-text-decoration, none);
  text-shadow: var(--alert-text-shadow, none);
  text-transform: var(--alert-text-transform, none);
}

.alert-event-mini-media {
  grid-row: 1 / span 2;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 7px;
  background: color-mix(in srgb, var(--alert-accent) 22%, #080a10);
  box-shadow: 0 0 18px color-mix(in srgb, var(--alert-accent) 35%, transparent);
}

.alerts-studio .alert-event-list .alert-event-mini-media {
  grid-column: auto;
  display: grid;
  width: 34px;
  height: 34px;
}

.alert-event-mini-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alert-event-mini-media i {
  color: var(--alert-accent);
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.alert-event-edit-label {
  justify-self: start;
  color: #cfc7dc;
  font-size: 11px;
}

.alerts-studio .alert-event-style {
  gap: 14px;
}

.alert-builder-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.alert-builder-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--alerts-line);
  border-radius: 8px;
  background: #090b12;
}

.alert-builder-panel:first-child,
.alert-builder-panel:last-child {
  grid-column: 1 / -1;
}

.alert-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-panel-head > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(139,92,246,.14);
  color: #8b6cff;
}

.alert-panel-head h4 {
  margin: 0;
  color: #fff;
  font-size: 15px;
}

.alert-panel-head p {
  margin: 3px 0 0;
  color: var(--alerts-muted);
  font-size: 11px;
  line-height: 1.35;
}

.alert-background-row,
.alert-choice-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 9px;
}

.alert-background-row button,
.alert-choice-row button {
  min-width: 0;
  min-height: 62px;
  padding: 8px;
  border: 1px solid var(--alerts-line);
  border-radius: 8px;
  background: #11131d;
  color: #e8e1f4;
  cursor: pointer;
  text-align: left;
}

.alert-background-row button:hover,
.alert-background-row button.is-active,
.alert-choice-row button:hover,
.alert-choice-row button.is-active {
  border-color: rgba(139,92,246,.75);
  background: rgba(139,92,246,.14);
}

.alert-background-row span {
  display: block;
  height: 34px;
  margin-bottom: 7px;
  border-radius: 7px;
}

.alert-choice-row span {
  display: block;
  height: 28px;
  margin-bottom: 7px;
  border-radius: 7px;
  background:
    linear-gradient(90deg, #8b6cff 0 30%, transparent 30% 100%),
    linear-gradient(#40e0d0 0 0) 52% 50% / 34% 4px no-repeat,
    #0a0c13;
  border: 1px solid var(--alerts-line);
}

.alert-choice-row.is-animation span {
  background:
    radial-gradient(circle at 30% 50%, #40e0d0 0 5px, transparent 6px),
    linear-gradient(90deg, #8b6cff33, transparent),
    #0a0c13;
}

.alert-background-row b,
.alert-choice-row b {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-timing-grid,
.alert-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.alert-upload-box {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px dashed rgba(139,92,246,.45);
  border-radius: 8px;
  background: rgba(139,92,246,.07);
}

.alert-upload-box.has-file {
  border-style: solid;
  border-color: rgba(55,211,158,.35);
  background: rgba(55,211,158,.06);
}

.alert-file-input {
  display: none;
}

.alert-upload-preview {
  position: relative;
  grid-row: span 2;
  display: grid;
  place-items: center;
  min-height: 104px;
  overflow: hidden;
  border-radius: 8px;
  background: #0a0c13;
  color: #8b6cff;
}

.alert-upload-preview img,
.alert-upload-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alert-upload-preview audio {
  width: 100%;
  padding: 0 8px;
}

.alert-upload-preview .line-icon {
  width: 28px;
  height: 28px;
}

.alert-upload-copy {
  min-width: 0;
}

.alert-upload-copy strong,
.alert-upload-copy span,
.alert-upload-copy small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-upload-copy strong {
  color: #fff;
  font-size: 14px;
}

.alert-upload-copy span {
  margin-top: 4px;
  color: var(--alerts-muted);
  font-size: 11px;
  line-height: 1.35;
}

.alert-upload-copy small {
  margin-top: 8px;
  color: #d9d2e8;
  font-size: 11px;
  white-space: nowrap;
}

.alert-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
}

.alert-fit-control {
  min-width: 0;
}

@media (max-width: 1180px) {
  .alerts-studio .alert-event-list,
  .alert-builder-panels,
  .alert-timing-grid,
  .alert-media-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .alerts-studio .alert-event-list {
    grid-template-columns: 1fr;
  }
  .alert-upload-box {
    grid-template-columns: 1fr;
  }
  .alert-upload-preview {
    grid-row: auto;
  }
}

.alerts-layout.alerts-studio {
  grid-template-columns: minmax(0, 1fr);
}

.alerts-studio .alerts-card {
  width: min(100%, 1240px);
}

.alerts-studio .alert-event-list button.is-empty {
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.008)), #080a10;
}

.alerts-studio .alert-event-list button.is-empty .alert-event-card-head > span {
  color: #9f96ae;
  background: rgba(255,255,255,.055);
}

.alert-event-mini-preview.is-clear {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.alert-event-mini-preview.is-empty {
  border-style: dashed;
  border-color: rgba(255,255,255,.13);
  background:
    linear-gradient(135deg, rgba(139,108,255,.09), transparent 54%),
    #0a0c13;
  color: #d8d2e4;
  box-shadow: none;
}

.alert-event-mini-preview.is-empty strong {
  color: #f4efff;
}

.alert-event-mini-preview.is-empty small {
  color: #938ba0;
}

.alert-preview-card.is-empty {
  min-height: 132px;
  border-style: dashed;
  border-color: rgba(255,255,255,.18);
  background:
    linear-gradient(135deg, rgba(139,108,255,.12), rgba(64,224,208,.06)),
    #10131d;
  box-shadow: none;
}

.alert-preview-empty {
  color: #afa7bd;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.alert-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 5, 10, .72);
  backdrop-filter: blur(18px);
}

.alert-editor-modal {
  width: min(1180px, 100%);
  max-height: min(860px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 100% 0, rgba(64,224,208,.12), transparent 32%),
    linear-gradient(180deg, #13151f, #080a10 62%);
  box-shadow: 0 28px 90px rgba(0,0,0,.62);
}

.alert-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.alert-modal-header h3 {
  margin: 3px 0 0;
  color: #fff;
  font-size: 24px;
  line-height: 1.1;
}

.alert-modal-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(9,11,18,.74);
}

.alert-modal-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 54px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #aaa3b5;
  font-weight: 850;
  cursor: pointer;
}

.alert-modal-tabs button:hover,
.alert-modal-tabs button.is-active {
  color: #fff;
  border-bottom-color: #40e0d0;
}

.alert-modal-tabs .line-icon {
  width: 16px;
  height: 16px;
}

.alert-modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(390px, 1.05fr);
  gap: 0;
}

.alert-modal-preview,
.alert-modal-fields {
  min-width: 0;
  min-height: 0;
}

.alert-modal-preview {
  padding: 18px;
  border-right: 1px solid rgba(255,255,255,.08);
  background: rgba(4,6,11,.42);
}

.alert-modal-preview .alerts-preview {
  height: 100%;
  min-height: 430px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: #090b12;
  box-shadow: none;
}

.alert-modal-preview .alerts-stage-preview {
  min-height: 388px;
  height: calc(100% - 42px);
  overflow: auto;
}

.alert-modal-preview .alert-preview-card {
  width: max-content;
  max-width: min(var(--alert-max-width, 720px), 100%);
  padding: 24px 26px;
}

.alert-modal-preview .alert-preview-card h3 {
  font-size: var(--alert-size, 42px);
}

.alert-modal-preview .alert-preview-card p {
  font-size: var(--alert-message-size, calc(var(--alert-size, 42px) * .42));
}

.alert-modal-fields {
  overflow: auto;
  padding: 18px;
}

.alert-modal-panel {
  display: grid;
  gap: 16px;
}

.alert-modal-panel h4 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1.2;
}

.alert-modal-panel p {
  max-width: 680px;
  margin: -8px 0 2px;
  color: #9f97ab;
  font-size: 13px;
  line-height: 1.45;
}

.alert-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.alert-modal-grid label,
.alert-template-grid label,
.alert-modal-panel label {
  min-width: 0;
}

.alert-modal-grid .switch-row {
  grid-column: span 2;
}

.alert-modal-panel input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background: #070910;
}

.alert-modal-panel .input,
.alert-modal-panel .select {
  min-height: 44px;
}

.alert-modal-panel input[type="range"] {
  width: 100%;
}

.alert-modal-panel .alert-upload-box {
  grid-template-columns: 146px minmax(0, 1fr);
  padding: 14px;
  background: rgba(139,108,255,.07);
}

.alert-modal-panel .alert-upload-preview {
  min-height: 136px;
}

.alert-modal-panel .alert-choice-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alert-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(11,13,22,.95);
}

.alert-modal-actions .button:first-child {
  margin-right: auto;
}

.alert-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alert-vars button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  background: #11131d;
  color: #dce3f4;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.alert-vars button:hover {
  border-color: rgba(64,224,208,.5);
  color: #fff;
}

.alert-empty-library {
  display: grid;
  min-height: 360px;
  place-items: center;
  border: 1px dashed rgba(255,255,255,.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0, rgba(139,108,255,.13), transparent 38%),
    #080a10;
  text-align: center;
}

.alert-empty-library > div {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 430px;
  padding: 30px;
}

.alert-empty-library .settings-icon {
  margin: 0;
}

.alert-empty-library h3 {
  margin: 0;
  color: #fff;
  font-size: 22px;
}

.alert-empty-library p {
  margin: 0;
  color: #9f97ab;
  line-height: 1.45;
}

.alert-type-modal {
  width: min(980px, 100%);
  max-height: min(780px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 100% 0, rgba(64,224,208,.13), transparent 32%),
    #0a0c13;
  box-shadow: 0 28px 90px rgba(0,0,0,.62);
}

.alert-type-modal .alert-modal-header p {
  max-width: 620px;
  margin: 7px 0 0;
  color: #9f97ab;
  font-size: 13px;
  line-height: 1.45;
}

.alert-type-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.alert-type-grid button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 4px 12px;
  min-height: 104px;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.014)), #090b12;
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.alert-type-grid button:hover:not(:disabled) {
  border-color: rgba(64,224,208,.45);
  background: linear-gradient(180deg, rgba(64,224,208,.12), rgba(139,108,255,.08)), #090b12;
  transform: translateY(-1px);
}

.alert-type-grid button:disabled {
  opacity: .52;
  cursor: not-allowed;
}

.alert-type-grid span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(64,224,208,.1);
  color: #40e0d0;
}

.alert-type-grid b,
.alert-type-grid small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-type-grid b {
  align-self: end;
  font-size: 15px;
}

.alert-type-grid small {
  color: #9f97ab;
  font-size: 12px;
}

.alert-text-style-grid,
.alert-sound-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.alert-media-controls {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: 14px;
  align-items: end;
}

.alert-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.alert-text-style-grid .span-2 {
  grid-column: span 2;
}

.alert-panel-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.alert-helper {
  color: #8f879a;
  font-size: 12px;
}

.alert-sound-timeline {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)), #090b12;
}

.alert-sound-timeline b,
.alert-sound-timeline small {
  display: block;
}

.alert-sound-timeline b {
  color: #fff;
  font-size: 14px;
}

.alert-sound-timeline small {
  margin-top: 3px;
  color: #9f97ab;
  font-size: 12px;
}

.sound-track {
  position: relative;
  height: 44px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background:
    linear-gradient(90deg, #ffffff10 1px, transparent 1px) 0 0 / 12.5% 100%,
    #060810;
}

.sound-track i {
  position: absolute;
  top: 9px;
  bottom: 9px;
  border-radius: 999px;
}

.sound-wait {
  left: 0;
  width: var(--sound-start);
  background: rgba(255,255,255,.08);
}

.sound-play {
  left: var(--sound-start);
  width: var(--sound-play);
  background: linear-gradient(90deg, #40e0d0, #8b6cff);
  box-shadow: 0 0 22px rgba(64,224,208,.22);
}

.sound-fade-in {
  left: var(--sound-start);
  width: var(--sound-fade-in);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.58));
}

.sound-fade-out {
  right: max(0%, calc(100% - var(--sound-start) - var(--sound-play)));
  width: var(--sound-fade-out);
  background: linear-gradient(90deg, rgba(255,255,255,.58), transparent);
}

.alert-time-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: #090b12;
}

.alert-time-field > span:last-of-type {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background: #060810;
}

.alert-time-field input[type="number"] {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 850;
  outline: 0;
  padding: 0 12px;
}

.alert-time-field em {
  padding-right: 12px;
  color: #9f97ab;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.alert-time-field small {
  color: #8f879a;
  font-size: 11px;
  line-height: 1.3;
}

.alert-text-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.alert-text-toolbar input {
  display: none;
}

.alert-text-toolbar button {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 58px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 8px;
  background: #090b12;
  color: #dcd6ea;
  cursor: pointer;
  font-weight: 900;
}

.alert-text-toolbar button:hover,
.alert-text-toolbar button.is-active {
  border-color: rgba(139,92,246,.75);
  background: rgba(139,92,246,.18);
  color: #fff;
}

.alert-text-toolbar small {
  color: #9f97ab;
  font-size: 10px;
  font-weight: 850;
}

.alert-range-field {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: #090b12;
}

.alert-range-field input[type="range"],
.alert-modal-panel input[type="range"],
.alerts-master input[type="range"] {
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #40e0d0, #8b6cff) 0 0 / var(--range-fill, 55%) 100% no-repeat,
    rgba(255,255,255,.16);
  outline: 0;
}

.alert-range-field input[type="range"]::-webkit-slider-thumb,
.alert-modal-panel input[type="range"]::-webkit-slider-thumb,
.alerts-master input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 3px solid #11131d;
  border-radius: 50%;
  background: #40e0d0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.3), 0 0 18px rgba(64,224,208,.45);
}

.alert-choice-row.is-compact,
.alert-choice-row.is-layout,
.alert-choice-row.is-animation {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.alert-choice-row.is-compact button {
  min-height: 46px;
}

.alert-choice-row.is-layout button,
.alert-choice-row.is-animation button {
  min-height: 86px;
}

.alert-choice-row.is-layout span,
.alert-choice-row.is-animation span {
  height: 38px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, #8b6cff 0 28%, transparent 28% 100%),
    linear-gradient(#40e0d0 0 0) 55% 45% / 38% 5px no-repeat,
    linear-gradient(#ffffff22 0 0) 55% 62% / 48% 4px no-repeat,
    #0a0c13;
}

.alert-choice-row.is-layout .choice-text-only span {
  background:
    linear-gradient(#40e0d0 0 0) 50% 42% / 58% 5px no-repeat,
    linear-gradient(#ffffff22 0 0) 50% 60% / 46% 4px no-repeat,
    #0a0c13;
}

.alert-choice-row.is-layout .choice-media-top span {
  background:
    linear-gradient(90deg, #8b6cff 0 100%) 50% 18% / 42% 14px no-repeat,
    linear-gradient(#40e0d0 0 0) 50% 60% / 52% 4px no-repeat,
    #0a0c13;
}

.alert-choice-row.is-layout .choice-media-left span {
  background:
    linear-gradient(90deg, #8b6cff 0 28%, transparent 28% 100%),
    linear-gradient(#40e0d0 0 0) 64% 40% / 36% 4px no-repeat,
    linear-gradient(#ffffff22 0 0) 64% 58% / 28% 4px no-repeat,
    #0a0c13;
}

.alert-choice-row.is-layout .choice-media-right span {
  background:
    linear-gradient(90deg, transparent 0 70%, #8b6cff 70% 100%),
    linear-gradient(#40e0d0 0 0) 34% 40% / 36% 4px no-repeat,
    linear-gradient(#ffffff22 0 0) 34% 58% / 28% 4px no-repeat,
    #0a0c13;
}

.alert-choice-row.is-layout .choice-background span {
  background:
    radial-gradient(circle at 72% 32%, #8b6cff 0 11px, transparent 12px),
    linear-gradient(135deg, rgba(139,108,255,.55), rgba(64,224,208,.18)),
    #0a0c13;
}

.alert-choice-row.is-animation span {
  background:
    radial-gradient(circle at 28% 50%, #40e0d0 0 6px, transparent 7px),
    linear-gradient(90deg, rgba(139,108,255,.35), transparent),
    #0a0c13;
}

.alert-choice-row.is-animation span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
}

.alert-choice-row.is-animation .choice-fade-up span::after {
  transform: translateY(10px);
}

.alert-choice-row.is-animation .choice-scale-pop span::after {
  inset: 8px 42%;
  border-radius: 999px;
  background: #40e0d0;
  box-shadow: 0 0 0 8px rgba(64,224,208,.12);
}

.alert-choice-row.is-animation .choice-slide-from-right span::after,
.alert-choice-row.is-animation .choice-slide-left span::after {
  inset: 10px 14px 10px auto;
  width: 42px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #40e0d0);
}

.alert-choice-row.is-animation .choice-slide-from-left span::after {
  inset: 10px auto 10px 14px;
  width: 42px;
  border-radius: 999px;
  background: linear-gradient(90deg, #40e0d0, transparent);
}

.alert-choice-row.is-animation .choice-drop-bounce span::after {
  inset: auto 42% 7px;
  height: 10px;
  border-radius: 999px;
  background: #40e0d0;
  box-shadow: 0 -15px 0 -3px rgba(64,224,208,.6);
}

.alert-choice-row.is-animation .choice-flip-in span::after {
  inset: 8px 42%;
  border: 2px solid #40e0d0;
  border-radius: 4px;
  background: transparent;
  transform: skewY(-18deg);
}

.alert-choice-row.is-animation .choice-blur-in span::after {
  inset: 11px 32%;
  border-radius: 999px;
  background: #40e0d0;
  filter: blur(4px);
}

.alert-choice-row.is-animation .choice-swing-in span::after {
  inset: 8px 42%;
  border-radius: 8px;
  background: #40e0d0;
  transform: rotate(-12deg);
  transform-origin: top center;
}

.alert-choice-row.is-case span {
  display: none;
}

.alert-choice-row.is-media-size span {
  display: none;
}

.alert-choice-row.is-case button,
.alert-choice-row.is-media-size button {
  min-height: 46px;
  display: grid;
  place-items: center;
  text-align: center;
}

.alert-choice-row .transparent-swatch {
  background:
    linear-gradient(45deg, #ffffff18 25%, transparent 25%, transparent 75%, #ffffff18 75%),
    linear-gradient(45deg, #ffffff18 25%, transparent 25%, transparent 75%, #ffffff18 75%),
    #0a0c13;
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
}

.alert-bg-control {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
}

.alert-dim-toggle {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, #e6b35a 40%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, #e6b35a 10%, var(--surface-2));
  cursor: pointer;
}

.alert-dim-toggle.is-compact {
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  border-color: var(--line);
}

.alert-dim-toggle input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #e6b35a;
}

.alert-dim-toggle.is-compact input {
  margin-top: 0;
}

.alert-dim-toggle strong {
  display: block;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 800;
}

.alert-dim-toggle small {
  display: block;
  margin-top: 3px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.35;
}

.alert-dim-toggle.is-compact small {
  display: none;
}

.alert-bg-control input[type="color"]:disabled,
.alert-bg-control .alert-range-field.is-disabled {
  opacity: .45;
  pointer-events: none;
}

.alert-bg-color-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.alert-bg-hex .input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.alert-bg-opacity-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alert-bg-opacity-presets button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.alert-bg-opacity-presets button.is-active {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--line));
  background: color-mix(in srgb, var(--primary) 18%, var(--surface-2));
  color: var(--text);
}

.alert-bg-opacity-presets button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.alert-bg-grid {
  align-items: start;
}

.alert-size-board {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
}

.alert-size-board-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.alert-dual-size {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.alert-dual-size .alert-size-board {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .alert-dual-size {
    grid-template-columns: 1fr;
  }
}

.alert-modal-preview .alerts-stage-preview.is-flip-up .alert-preview-card {
  animation: alert-preview-flip-up .42s cubic-bezier(.2,.85,.2,1) both;
}

@keyframes alert-preview-flip-up {
  from {
    opacity: .2;
    transform: translateY(36px) scale(.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Photoshop-like layer editor in modal preview */
.alert-modal-preview .alert-preview-card.is-editing:not(.is-preview-playing),
.alert-modal-preview .alert-preview-card.is-editing:not(.is-preview-playing) * {
  animation: none !important;
}

.alert-modal-preview .alert-preview-card.is-preview-playing {
  opacity: 0;
}

.alert-modal-preview .alert-preview-card.is-preview-playing.is-visible {
  opacity: 1;
}

.alert-modal-preview .alert-preview-card.is-editing {
  overflow: visible;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.alert-modal-preview .alerts-stage-preview {
  overflow: hidden;
}

.alert-modal-preview .alert-preview-canvas {
  overflow: hidden;
}

.alert-modal-preview .alert-preview-card.is-editing .alert-layer {
  cursor: grab;
  outline: 1px solid transparent;
}

.alert-modal-preview .alert-preview-card.is-editing .alert-layer[data-alert-layer="media"] {
  z-index: 1;
}

.alert-modal-preview .alert-preview-card.is-editing .alert-layer[data-alert-layer="media"].is-selected {
  z-index: 2;
  outline: 1px solid #5cc8ff;
  outline-offset: 3px;
}

.alert-modal-preview .alert-preview-card.is-editing .alert-layer[data-alert-layer="title"],
.alert-modal-preview .alert-preview-card.is-editing .alert-layer[data-alert-layer="message"] {
  z-index: 6;
  display: inline-block;
  width: max-content;
  max-width: none;
  vertical-align: top;
}

.alert-modal-preview .alert-preview-card.is-editing .alert-layer[data-alert-layer="title"] {
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.alert-modal-preview .alert-preview-card.is-editing .alert-layer[data-alert-layer="message"] {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: normal;
}

.alert-modal-preview .alert-preview-card.is-editing .alert-layer:hover {
  outline-color: color-mix(in srgb, #5cc8ff 55%, transparent);
}

.alert-modal-preview .alert-preview-card.is-editing .alert-layer[data-alert-layer="title"].is-selected,
.alert-modal-preview .alert-preview-card.is-editing .alert-layer[data-alert-layer="message"].is-selected {
  outline: 1px solid #5cc8ff;
  outline-offset: 3px;
  z-index: 7;
}

.alert-modal-preview .alert-preview-card.is-dragging,
.alert-modal-preview .alert-preview-card.is-dragging .alert-layer {
  cursor: grabbing;
}

.alert-modal-preview .alert-preview-card.is-editing .alert-layer img,
.alert-modal-preview .alert-preview-card.is-editing .alert-layer video {
  pointer-events: none;
  user-select: none;
}

.alert-layer-chrome {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 8;
  pointer-events: none;
  box-sizing: border-box;
}

.alert-layer-chrome .alert-layer-box,
.alert-layer-chrome .alert-layer-handle {
  pointer-events: auto;
}

.alert-layer-chrome .alert-layer-box {
  cursor: grab;
}

.alert-preview-card.is-dragging .alert-layer-chrome .alert-layer-box {
  cursor: grabbing;
}

.alert-layer-chrome .alert-layer-box {
  display: block;
  width: 100%;
  height: 100%;
  border: 1.5px solid #5cc8ff;
  box-shadow: 0 0 0 1px #0006;
  border-radius: 2px;
}

.alert-layer-handle {
  pointer-events: auto;
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1.5px solid #0b0d14;
  border-radius: 2px;
  background: #5cc8ff;
  padding: 0;
  cursor: nwse-resize;
}

.alert-layer-handle[data-alert-resize-handle="se"] { right: -5px; bottom: -5px; }
.alert-layer-handle.is-sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.alert-layer-handle.is-ne { right: -5px; top: -5px; cursor: nesw-resize; }
.alert-layer-handle.is-nw { left: -5px; top: -5px; cursor: nwse-resize; }
.alert-layer-handle.is-e,
.alert-layer-handle.is-w {
  top: 50%;
  margin-top: -5px;
  cursor: ew-resize;
}
.alert-layer-handle.is-e { right: -5px; }
.alert-layer-handle.is-w { left: -5px; }
.alert-layer-handle.is-n,
.alert-layer-handle.is-s {
  left: 50%;
  margin-left: -5px;
  cursor: ns-resize;
}
.alert-layer-handle.is-n { top: -5px; }
.alert-layer-handle.is-s { bottom: -5px; }

.alert-layer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
}

.alert-layer-toolbar-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alert-layer-toolbar-tabs button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.alert-layer-toolbar-tabs button.is-active {
  border-color: color-mix(in srgb, #5cc8ff 60%, var(--line));
  background: color-mix(in srgb, #5cc8ff 16%, var(--surface));
  color: var(--text);
}

.alert-layer-toolbar small {
  flex: 1 1 180px;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.35;
}

/* Client-facing alert editor polish */
.alerts-studio .alerts-master {
  grid-template-columns: minmax(180px, .9fr) minmax(170px, .85fr) minmax(190px, 1fr) minmax(190px, 1fr) minmax(190px, 1fr);
  align-items: stretch;
}

.alerts-studio .alerts-master .switch-row.compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: center;
  gap: 12px;
  transform: none;
}

.alerts-studio .alerts-master .switch-row.compact:hover {
  transform: none;
}

.alert-editor-modal {
  width: min(1320px, calc(100vw - 32px));
}

.alert-modal-body {
  grid-template-columns: minmax(460px, .96fr) minmax(480px, 1fr);
}

.alert-modal-preview {
  display: grid;
  min-height: 0;
}

.alert-modal-preview .alerts-preview {
  min-height: 0;
  height: 100%;
}

.alert-modal-preview .alerts-stage-preview {
  min-height: 0;
  height: calc(100% - 42px);
  overflow: hidden;
  padding: 22px;
}

.alert-modal-preview .alert-preview-card {
  width: max-content;
  max-width: min(var(--alert-max-width, 720px), 100%);
  max-width: 100%;
  transform: none;
}

.alert-modal-preview .alert-preview-card h3 {
  font-size: clamp(24px, calc(var(--alert-size, 42px) * .7), 48px);
}

.alert-modal-preview .alert-preview-card p {
  font-size: clamp(13px, calc(var(--alert-size, 42px) * .32), 21px);
}

.alert-upload-box {
  align-items: center;
}

.alert-modal-panel .alert-upload-box {
  grid-template-columns: 112px minmax(0, 1fr);
}

.alert-modal-panel .alert-upload-preview {
  min-height: 104px;
}

.alert-sound-file-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(64,224,208,.2), rgba(139,108,255,.24));
  color: #40e0d0;
}

.alert-sound-file-icon .line-icon {
  width: 28px;
  height: 28px;
}

.alert-upload-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.alert-upload-actions .button.sm {
  min-height: 36px;
}

.alert-sound-timeline {
  gap: 14px;
}

.sound-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sound-summary span {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: #060810;
}

.sound-summary strong,
.sound-summary small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sound-summary strong {
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.sound-summary small {
  margin-top: 3px;
  color: #8f879a;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.sound-lane {
  position: relative;
  min-height: 58px;
  padding: 24px 0 18px;
}

.sound-lane::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 27px;
  height: 8px;
  border-radius: 999px;
  background: #ffffff14;
}

.sound-lane i {
  position: absolute;
  top: 27px;
  height: 8px;
  border-radius: 999px;
}

.sound-lane-alert {
  left: 0;
  width: var(--alert-end);
  background: #ffffff24;
}

.sound-lane-play {
  left: var(--sound-start);
  width: max(2%, calc(var(--sound-end) - var(--sound-start)));
  background: linear-gradient(90deg, #40e0d0, #8b6cff);
  box-shadow: 0 0 18px rgba(64,224,208,.22);
}

.sound-lane-fade-in {
  left: var(--sound-start);
  width: max(0%, calc(var(--sound-fade-in) - var(--sound-start)));
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7));
}

.sound-lane-fade-out {
  left: var(--sound-fade-out);
  width: max(0%, calc(var(--sound-end) - var(--sound-fade-out)));
  background: linear-gradient(90deg, rgba(255,255,255,.65), transparent);
}

.sound-lane-label {
  position: absolute;
  top: 0;
  color: #9f97ab;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.sound-lane-label.start {
  left: var(--sound-start);
  transform: translateX(-10%);
}

.sound-lane-label.end {
  right: max(0%, calc(100% - var(--sound-end)));
  transform: translateX(30%);
}

.sound-track,
.sound-track i {
  display: none;
}

.alert-time-field input[type="number"]::-webkit-outer-spin-button,
.alert-time-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.alert-time-field input[type="number"] {
  appearance: textfield;
}

.alert-text-style-grid {
  align-items: start;
}

.alert-font-preview {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(139,92,246,.16), rgba(64,224,208,.08)),
    #070910;
}

.alert-font-preview span,
.alert-font-preview small {
  color: #9f97ab;
  font-family: Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 850;
}

.alert-font-preview span {
  text-transform: uppercase;
  letter-spacing: .06em;
}

.alert-font-preview strong {
  color: #fff;
  font-size: 24px;
  line-height: 1.05;
  font-weight: 900;
}

.alert-font-preview small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-text-style-grid .alert-choice-row.is-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: #060810;
}

.alert-text-style-grid .alert-choice-row.is-compact span {
  display: none;
}

.alert-text-style-grid .alert-choice-row.is-compact button {
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
}

.alert-text-style-grid .alert-choice-row.is-compact button:hover,
.alert-text-style-grid .alert-choice-row.is-compact button.is-active {
  background: rgba(139,92,246,.28);
  box-shadow: inset 0 0 0 1px rgba(139,92,246,.62);
}

.alert-text-style-grid .alert-choice-row.is-compact b {
  font-size: 12px;
  text-align: center;
}

.alert-text-toolbar {
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: #060810;
}

.alert-text-toolbar button {
  min-height: 42px;
  border: 0;
  background: transparent;
}

.alert-text-toolbar button:hover,
.alert-text-toolbar button.is-active {
  background: rgba(139,92,246,.28);
  box-shadow: inset 0 0 0 1px rgba(139,92,246,.62);
}

.alert-range-field input[type="range"],
.alert-modal-panel input[type="range"],
.alerts-master input[type="range"] {
  background:
    linear-gradient(90deg, #40e0d0, #8b6cff) 0 0 / var(--range-fill, 0%) 100% no-repeat,
    rgba(255,255,255,.17);
}

.alert-audio-editor {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
    #080b13;
}

.alert-audio-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.alert-audio-head b,
.alert-audio-head small {
  display: block;
}

.alert-audio-head b {
  color: #fff;
  font-size: 14px;
}

.alert-audio-head small {
  margin-top: 3px;
  color: #9fa8bb;
  font-size: 12px;
  line-height: 1.35;
}

.alert-audio-head > span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(64,224,208,.28);
  border-radius: 999px;
  color: #dffefb;
  background: rgba(64,224,208,.1);
  font-size: 11px;
  font-weight: 900;
}

.audio-ruler {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  color: #8993a7;
  font-size: 11px;
  font-weight: 850;
}

.audio-ruler span:nth-child(2) {
  text-align: center;
}

.audio-workspace {
  position: relative;
  min-height: 154px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 12.5% 100%,
    linear-gradient(180deg, rgba(139,92,246,.11), rgba(64,224,208,.055)),
    #05070d;
  touch-action: none;
}

.audio-workspace::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 88px;
  height: 1px;
  background: rgba(255,255,255,.14);
}

.audio-waveform {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 66px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: .5;
  pointer-events: none;
}

.audio-waveform i {
  width: 100%;
  height: var(--bar);
  min-height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #c6fbff, #6f6cf6);
}

.audio-clip {
  position: absolute;
  left: var(--audio-start);
  width: max(24px, calc(var(--audio-end) - var(--audio-start)));
  top: 62px;
  height: 58px;
  border: 1px solid rgba(64,224,208,.48);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(64,224,208,.32), rgba(139,92,246,.36)),
    rgba(11,17,28,.9);
  box-shadow: 0 0 28px rgba(64,224,208,.16);
  pointer-events: none;
}

.audio-clip span {
  position: absolute;
  left: 10px;
  top: 8px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-fade {
  position: absolute;
  top: 24px;
  height: 32px;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 7px;
  pointer-events: none;
}

.audio-fade-in {
  left: var(--audio-start);
  width: max(0px, calc(var(--audio-fade-in) - var(--audio-start)));
  background: linear-gradient(90deg, rgba(64,224,208,.08), rgba(64,224,208,.42));
}

.audio-fade-out {
  left: var(--audio-fade-out);
  width: max(0px, calc(var(--audio-end) - var(--audio-fade-out)));
  background: linear-gradient(90deg, rgba(236,72,153,.42), rgba(236,72,153,.08));
}

.audio-fade span {
  position: absolute;
  top: -20px;
  left: 0;
  color: #aeb8cb;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.audio-fade-out span {
  left: auto;
  right: 0;
}

.audio-fade b {
  color: #fff;
}

.audio-handle {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: ew-resize;
  touch-action: none;
}

.audio-handle::before {
  content: "";
  display: block;
  width: 16px;
  border: 2px solid #071015;
  background: #40e0d0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.34), 0 0 18px rgba(64,224,208,.32);
}

.audio-handle:focus-visible::before {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.audio-handle-start,
.audio-handle-end {
  top: 56px;
  height: 72px;
}

.audio-handle-start {
  left: var(--audio-start);
  transform: translateX(-14px);
}

.audio-handle-end {
  left: var(--audio-end);
  transform: translateX(-14px);
}

.audio-handle-start::before,
.audio-handle-end::before {
  height: 62px;
  border-radius: 6px;
}

.audio-handle-fade-in,
.audio-handle-fade-out {
  top: 16px;
  height: 46px;
}

.audio-handle-fade-in {
  left: var(--audio-fade-in);
  transform: translateX(-14px);
}

.audio-handle-fade-out {
  left: var(--audio-fade-out);
  transform: translateX(-14px);
}

.audio-handle-fade-in::before,
.audio-handle-fade-out::before {
  height: 18px;
  border-radius: 999px;
}

.audio-handle-fade-out::before {
  background: #ec4899;
  box-shadow: 0 0 0 1px rgba(255,255,255,.34), 0 0 18px rgba(236,72,153,.26);
}

.audio-handle span {
  position: absolute;
  bottom: -17px;
  max-width: 76px;
  overflow: hidden;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #9fa8bb;
  font-size: 11px;
  font-weight: 850;
}

.audio-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.audio-legend i {
  width: 18px;
  height: 8px;
  border-radius: 999px;
}

.audio-legend .clip {
  background: linear-gradient(90deg, #40e0d0, #8b6cff);
}

.audio-legend .fade {
  background: linear-gradient(90deg, #40e0d0, #ec4899);
}

.audio-legend .edge {
  width: 8px;
  height: 18px;
  background: #40e0d0;
}

.alert-exact-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: -4px;
}

.alert-exact-head b {
  color: #fff;
  font-size: 14px;
}

.alert-exact-head small {
  color: #9fa8bb;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .alert-modal-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .alert-modal-preview {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .alert-modal-preview .alerts-preview {
    min-height: 360px;
  }
  .alert-modal-preview .alerts-stage-preview {
    min-height: 318px;
  }
  .alert-modal-fields {
    overflow: visible;
  }
}

@media (max-width: 820px) {
  .alert-modal-backdrop {
    padding: 8px;
  }
  .alert-editor-modal {
    max-height: calc(100vh - 16px);
  }
  .alert-modal-header {
    padding: 16px;
  }
  .alert-modal-header h3 {
    font-size: 19px;
  }
  .alert-modal-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0 8px;
  }
  .alert-modal-tabs button {
    min-height: 46px;
    font-size: 12px;
  }
  .alert-modal-preview,
  .alert-modal-fields {
    padding: 12px;
  }
  .alert-modal-grid,
  .alert-template-grid,
  .alert-text-style-grid,
  .alert-sound-grid,
  .alert-media-controls,
  .alert-time-grid,
  .alert-text-toolbar,
  .alert-modal-panel .alert-upload-box,
  .alert-modal-panel .alert-choice-row {
    grid-template-columns: 1fr;
  }
  .alert-text-style-grid .span-2 {
    grid-column: auto;
  }
  .alert-modal-grid .switch-row {
    grid-column: auto;
  }
  .alert-modal-actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .alert-modal-actions .button,
  .alert-modal-actions .button:first-child {
    width: 100%;
    margin-right: 0;
  }
  .alert-type-grid {
    grid-template-columns: 1fr;
  }

  .alert-audio-head,
  .alert-exact-head {
    display: grid;
  }

  .audio-workspace {
    min-height: 174px;
  }

  .audio-handle span {
    max-width: 56px;
  }
}

/* Alerts editor UX pass: constrained modal, readable steps, no horizontal bleed. */
.alert-editor-modal {
  width: min(1320px, calc(100vw - 32px));
  height: min(900px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
}

.alert-modal-header {
  min-width: 0;
}

.alert-modal-header > div {
  min-width: 0;
}

.alert-modal-header p {
  max-width: 760px;
  margin: 8px 0 0;
  color: #aeb6c8;
  font-size: 13px;
  line-height: 1.45;
}

.alert-modal-tabs {
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.alert-modal-tabs button {
  position: relative;
  min-width: 132px;
  gap: 7px;
  padding: 0 10px;
}

.alert-modal-tabs button small {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(255,255,255,.06);
  font-size: 11px;
  font-weight: 900;
}

.alert-modal-tabs button.is-active small {
  border-color: rgba(64,224,208,.6);
  color: #061014;
  background: #40e0d0;
}

.alert-modal-tabs button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-modal-body {
  overflow: hidden;
  grid-template-columns: minmax(360px, .9fr) minmax(430px, 1.1fr);
}

.alert-modal-preview {
  overflow: hidden;
}

.alert-modal-preview .alerts-preview {
  min-height: 0;
}

.alert-modal-preview .alerts-stage-preview {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
}

.alert-modal-preview .alert-preview-card {
  width: max-content;
  max-width: min(var(--alert-max-width, 720px), 100%);
  max-width: 100%;
}

.alert-modal-fields {
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 24px;
  scrollbar-width: thin;
}

.alert-modal-panel {
  max-width: 760px;
  margin: 0 auto;
}

.alert-modal-hint {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(64,224,208,.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(64,224,208,.12), rgba(124,58,237,.08)),
    #081018;
}

.alert-modal-hint b {
  color: #effcff;
  font-size: 13px;
}

.alert-modal-hint span {
  color: #aeb6c8;
  font-size: 12px;
  line-height: 1.45;
}

.alert-setup-list {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: #090b12;
}

.alert-setup-list span {
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.alert-setup-list ol {
  margin: 0;
  padding-left: 20px;
  color: #aeb6c8;
  font-size: 12px;
  line-height: 1.55;
}

.alert-modal-panel .alert-choice-row b {
  white-space: normal;
  line-height: 1.2;
}

.alert-modal-panel .alert-choice-row.is-compact b,
.alert-modal-panel .alert-choice-row.is-case b {
  white-space: nowrap;
}

.alert-text-style-grid .alert-font-preview {
  grid-column: span 2;
  margin-top: 0;
}

.alert-upload-box,
.alert-upload-copy,
.alert-upload-actions,
.alert-sound-timeline,
.sound-lane,
.sound-summary,
.alert-time-grid,
.alert-time-field {
  min-width: 0;
}

.sound-lane {
  overflow: hidden;
}

.sound-lane-label {
  max-width: 44%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sound-lane-label.end {
  transform: none;
  text-align: right;
}

@media (max-width: 1180px) {
  .alert-editor-modal {
    height: min(900px, calc(100dvh - 20px));
    width: min(980px, calc(100vw - 20px));
  }

  .alert-modal-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .alert-modal-preview .alerts-preview {
    min-height: 340px;
  }

  .alert-modal-preview .alerts-stage-preview {
    min-height: 298px;
  }

  .alert-modal-fields {
    overflow: visible;
  }
}

@media (max-width: 820px) {
  .alert-editor-modal {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .alert-modal-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow-x: visible;
    padding: 0 8px;
  }

  .alert-modal-tabs button {
    min-width: 0;
  }

  .alert-modal-preview .alert-preview-card h3 {
    font-size: clamp(22px, calc(var(--alert-size, 42px) * .72), 36px);
  }

  .alert-modal-preview .alert-preview-card p {
    font-size: clamp(13px, calc(var(--alert-size, 42px) * .34), 18px);
  }

  .alert-modal-panel {
    max-width: none;
  }

  .alert-text-style-grid .alert-font-preview {
    grid-column: auto;
  }
}

/* Alert library cards: independent switch, test and edit controls. */
.alerts-studio .alert-event-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--alerts-line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0, rgba(64,224,208,.055), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
    #090b12;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.alerts-studio .alert-event-card:hover,
.alerts-studio .alert-event-card:focus-within,
.alerts-studio .alert-event-card.is-active {
  border-color: rgba(139,92,246,.62);
  box-shadow: 0 14px 34px rgba(0,0,0,.2), 0 0 0 1px rgba(64,224,208,.06) inset;
  transform: translateY(-1px);
}

.alerts-studio .alert-event-list .alert-event-open,
.alerts-studio .alert-event-list .alert-event-open:hover,
.alerts-studio .alert-event-list .alert-event-open.is-active {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  transform: none;
  box-shadow: none;
  cursor: pointer;
}

.alerts-studio .alert-event-card-head {
  grid-template-columns: 36px minmax(0, 1fr) auto;
}

.alerts-studio .alert-event-card-head > span {
  width: 36px;
  height: 36px;
}

.alerts-studio .alert-event-list .alert-event-state-dot {
  grid-column: auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #5c6170;
  box-shadow: 0 0 0 4px rgba(92,97,112,.12);
}

.alerts-studio .alert-event-card.is-enabled .alert-event-state-dot {
  background: #3bd39f;
  box-shadow: 0 0 0 4px rgba(59,211,159,.12), 0 0 14px rgba(59,211,159,.45);
}

.alerts-studio .alert-event-card.is-disabled .alert-event-mini-preview {
  opacity: .62;
  filter: saturate(.72);
}

.alert-event-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 11px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.alerts-studio .alert-event-list .alert-event-card-actions .button {
  width: auto;
  min-width: 0;
  min-height: 34px;
  display: inline-flex;
  grid-template-columns: none;
  flex: 0 0 auto;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  transform: none;
}

.alerts-studio .alert-event-list .alert-event-card-actions .button:hover {
  transform: translateY(-1px);
}

.alert-card-switch {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: #969dad;
  cursor: pointer;
  user-select: none;
}

.alert-card-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.alerts-studio .alert-event-list .alert-card-switch > span {
  position: relative;
  grid-column: auto;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid #353a49;
  border-radius: 999px;
  background: #151824;
  transition: .18s ease;
}

.alerts-studio .alert-event-list .alert-card-switch > span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #808797;
  transition: .18s ease;
}

.alerts-studio .alert-event-list .alert-card-switch input:checked + span {
  border-color: rgba(59,211,159,.5);
  background: rgba(59,211,159,.14);
}

.alerts-studio .alert-event-list .alert-card-switch input:checked + span::after {
  transform: translateX(16px);
  background: #59e4b4;
  box-shadow: 0 0 12px rgba(89,228,180,.5);
}

.alerts-studio .alert-event-list .alert-card-switch input:focus-visible + span {
  outline: 2px solid #40e0d0;
  outline-offset: 2px;
}

.alerts-studio .alert-event-list .alert-card-switch b {
  grid-column: auto;
  color: inherit;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.alert-test-main {
  background: linear-gradient(135deg, #5d49d7, #7c3aed);
  box-shadow: 0 9px 24px rgba(109,72,232,.24);
}

.alert-text-layout-control small {
  color: #929bad;
  font-size: 11px;
  line-height: 1.4;
}

.alert-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px;
  background: #090b12;
}

.alert-segmented button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #9ca5b7;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.alert-segmented button:hover,
.alert-segmented button.is-active {
  border-color: rgba(64,224,208,.28);
  color: #f4ffff;
  background: linear-gradient(135deg, rgba(64,224,208,.16), rgba(139,92,246,.14));
}

.alert-upload-box.is-uploading {
  border-color: rgba(64,224,208,.5);
  box-shadow: 0 0 0 1px rgba(64,224,208,.08) inset;
}

.alert-upload-box.is-uploading .alert-upload-preview::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #40e0d0;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@media (max-width: 760px) {
  .alert-event-card-actions {
    flex-wrap: wrap;
  }

  .alert-card-switch {
    width: 100%;
    margin: 0 0 2px;
  }

  .alerts-studio .alert-event-list .alert-event-card-actions .button {
    flex: 1 1 120px;
    justify-content: center;
  }
}

/* Final responsive overrides must stay after the legacy editor passes above. */
.alert-editor-modal {
  width: min(94vw, 2100px);
  height: 92dvh;
  max-height: 92dvh;
}

.alert-modal-header {
  padding: clamp(16px, 1.15vw, 24px) clamp(18px, 1.4vw, 30px);
}

.alert-modal-header h3 {
  font-size: clamp(24px, 1.35vw, 32px);
}

.alert-modal-tabs button {
  min-height: clamp(54px, 3.4vw, 68px);
}

.alert-modal-body {
  grid-template-columns: minmax(520px, .92fr) minmax(560px, 1.08fr);
}

.alert-modal-panel {
  max-width: 900px;
}

.alert-modal-preview {
  padding: clamp(14px, 1vw, 22px);
}

.alert-modal-preview .alerts-preview {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr);
}

.alert-modal-preview .alerts-stage-preview {
  position: relative;
  place-self: center;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
}

.alert-modal-preview .alert-preview-card {
  width: max-content;
  max-width: min(var(--alert-max-width, 720px), 100%);
  padding: 30px 34px;
  transform: scale(var(--alert-scale, 1));
  transform-origin: center;
}

.alert-modal-preview .alert-preview-card h3 {
  font-size: var(--alert-size, 42px);
}

.alert-modal-preview .alert-preview-card p {
  font-size: var(--alert-message-size, calc(var(--alert-size, 42px) * .42));
}

@media (max-width: 1180px) {
  .alert-editor-modal {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .alert-modal-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .alert-modal-preview {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .alert-modal-preview .alerts-preview {
    height: auto;
  }

  .alert-modal-fields {
    overflow: visible;
  }
}

/* Позиция на холсте 800×600 / OBS source — только CSS grid, без абсолютных left/780 */
.alert-stage[data-position="top-left"],
.alerts-preview[data-position="top-left"] .alert-preview-canvas { place-items: start start; }
.alert-stage[data-position="top"],
.alerts-preview[data-position="top"] .alert-preview-canvas { place-items: start center; }
.alert-stage[data-position="top-right"],
.alerts-preview[data-position="top-right"] .alert-preview-canvas { place-items: start end; }
.alert-stage[data-position="center-left"],
.alerts-preview[data-position="center-left"] .alert-preview-canvas { place-items: center start; }
.alert-stage[data-position="center"],
.alerts-preview[data-position="center"] .alert-preview-canvas { place-items: center; }
.alert-stage[data-position="center-right"],
.alerts-preview[data-position="center-right"] .alert-preview-canvas { place-items: center end; }
.alert-stage[data-position="bottom-left"],
.alerts-preview[data-position="bottom-left"] .alert-preview-canvas { place-items: end start; }
.alert-stage[data-position="bottom"],
.alerts-preview[data-position="bottom"] .alert-preview-canvas { place-items: end center; }
.alert-stage[data-position="bottom-right"],
.alerts-preview[data-position="bottom-right"] .alert-preview-canvas { place-items: end end; }

.alert-stage[data-position="top-left"] .fc-alert-card,
.alerts-preview[data-position="top-left"] .alert-preview-card { transform-origin: top left; }
.alert-stage[data-position="top"] .fc-alert-card,
.alerts-preview[data-position="top"] .alert-preview-card { transform-origin: top center; }
.alert-stage[data-position="top-right"] .fc-alert-card,
.alerts-preview[data-position="top-right"] .alert-preview-card { transform-origin: top right; }
.alert-stage[data-position="center-left"] .fc-alert-card,
.alerts-preview[data-position="center-left"] .alert-preview-card { transform-origin: center left; }
.alert-stage[data-position="center"] .fc-alert-card,
.alerts-preview[data-position="center"] .alert-preview-card { transform-origin: center; }
.alert-stage[data-position="center-right"] .fc-alert-card,
.alerts-preview[data-position="center-right"] .alert-preview-card { transform-origin: center right; }
.alert-stage[data-position="bottom-left"] .fc-alert-card,
.alerts-preview[data-position="bottom-left"] .alert-preview-card { transform-origin: bottom left; }
.alert-stage[data-position="bottom"] .fc-alert-card,
.alerts-preview[data-position="bottom"] .alert-preview-card { transform-origin: bottom center; }
.alert-stage[data-position="bottom-right"] .fc-alert-card,
.alerts-preview[data-position="bottom-right"] .alert-preview-card { transform-origin: bottom right; }

/* One geometry contract for the editor preview and the OBS Browser Source. */
.alert-preview-card,
.fc-alert-card {
  max-width: min(var(--alert-max-width, 780px), calc(100% - 8px));
}

/* Legacy modal passes above must not override the OBS card geometry. */
.alert-modal-preview .alert-preview-card {
  max-width: min(var(--alert-max-width, 780px), calc(100% - 8px));
  padding: 30px 34px;
}

.alert-modal-preview .alert-preview-card.bg-transparent {
  padding: 8px;
}

.alert-preview-inner,
.fc-alert-inner {
  width: max-content;
  max-width: 100%;
}

.alert-preview-copy,
.fc-alert-copy {
  width: var(--alert-copy-width, 406px);
  min-width: 0;
  max-width: var(--alert-copy-width, 406px);
  flex: 0 1 var(--alert-copy-width, 406px);
}

.text-stacked .alert-preview-copy,
.text-stacked .fc-alert-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: center;
}

.alert-preview-card h3,
.fc-alert-card h3,
.alert-preview-card p,
.fc-alert-card p {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.text-stacked .alert-preview-copy h3,
.text-stacked .fc-alert-copy h3 {
  width: 100%;
  max-width: 100%;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: var(--alert-title-size, var(--alert-size, 42px));
  max-height: 2.1em;
}

/* Editor chrome used to override -webkit-box with inline-block. Keep the
   exact same two-line title contract in the editor and in OBS. */
.alert-preview-card.is-canvas-card.text-stacked h3,
.fc-alert-card.is-canvas-card.text-stacked h3 {
  display: -webkit-box !important;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  max-height: 2.1em;
}

.text-stacked .alert-preview-copy h3.is-alert-title-measuring,
.text-stacked .fc-alert-copy h3.is-alert-title-measuring {
  display: block;
  max-height: none;
  overflow: visible;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.text-inline .alert-preview-copy h3,
.text-inline .alert-preview-copy p,
.text-inline .fc-alert-copy h3,
.text-inline .fc-alert-copy p {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-modal-preview .alert-preview-card.is-editing .alert-layer[data-alert-layer="title"],
.alert-modal-preview .alert-preview-card.is-editing .alert-layer[data-alert-layer="message"] {
  width: max-content;
  max-width: 100%;
  word-break: normal;
}

.alert-modal-preview .alert-preview-card.is-editing.text-stacked .alert-layer[data-alert-layer="title"] {
  width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  white-space: normal;
}

.alert-modal-preview .alert-preview-card.is-editing .alert-layer[data-alert-layer="message"] {
  overflow-wrap: anywhere;
  white-space: normal;
}

/* Fixed 800×600 layer canvas. Layout choices are initial position presets;
   x/y offsets then move every layer independently without reflow or auto-zoom. */
.alert-preview-card.is-canvas-card,
.fc-alert-card.is-canvas-card {
  --alert-title-left: 50%;
  --alert-title-top: 47%;
  --alert-message-left: 50%;
  --alert-message-top: 58%;
  --alert-media-left: 50%;
  --alert-media-top: 30%;
  position: relative;
  width: 800px !important;
  height: 600px !important;
  min-width: 800px;
  min-height: 600px;
  max-width: none !important;
  max-height: none;
  display: block;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.alert-preview-canvas.is-alert-canvas,
.alert-stage.is-alert-canvas-stage {
  place-items: center !important;
  padding: 0;
}

.alert-preview-card.is-canvas-card.bg-transparent,
.fc-alert-card.is-canvas-card.bg-transparent {
  background: transparent;
  box-shadow: none;
}

.is-canvas-card.layout-media-top {
  --alert-media-left: 50%;
  --alert-media-top: 30%;
  --alert-title-left: 50%;
  --alert-title-top: 66%;
  --alert-message-left: 50%;
  --alert-message-top: 76%;
}

.is-canvas-card.layout-media-left {
  --alert-media-left: 25%;
  --alert-media-top: 50%;
  --alert-title-left: 72%;
  --alert-title-top: 46%;
  --alert-message-left: 72%;
  --alert-message-top: 59%;
}

.is-canvas-card.layout-media-right {
  --alert-media-left: 75%;
  --alert-media-top: 50%;
  --alert-title-left: 28%;
  --alert-title-top: 46%;
  --alert-message-left: 28%;
  --alert-message-top: 59%;
}

.is-canvas-card.layout-background {
  --alert-title-left: 50%;
  --alert-title-top: 48%;
  --alert-message-left: 50%;
  --alert-message-top: 59%;
  overflow: hidden;
}

.alert-preview-card.is-canvas-card .alert-preview-inner,
.fc-alert-card.is-canvas-card .fc-alert-inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: auto;
  max-width: none;
}

.alert-preview-card.is-canvas-card .alert-preview-copy,
.fc-alert-card.is-canvas-card .fc-alert-copy {
  display: contents;
}

.alert-preview-card.is-canvas-card h3,
.fc-alert-card.is-canvas-card h3,
.alert-preview-card.is-canvas-card p,
.fc-alert-card.is-canvas-card p {
  position: absolute;
  z-index: 6;
  margin: 0;
  max-width: calc(100% - 32px);
  text-align: center;
}

.alert-preview-card.is-canvas-card h3,
.fc-alert-card.is-canvas-card h3 {
  width: var(--alert-title-width, var(--alert-copy-width, 680px)) !important;
  left: var(--alert-title-left);
  top: var(--alert-title-top);
  transform: translate(
    calc(-50% + var(--alert-title-x, 0px)),
    calc(-50% + var(--alert-title-y, 0px))
  );
}

.alert-preview-card.is-canvas-card p,
.fc-alert-card.is-canvas-card p {
  width: var(--alert-message-width, var(--alert-copy-width, 680px)) !important;
  left: var(--alert-message-left);
  top: var(--alert-message-top);
  transform: translate(
    calc(-50% + var(--alert-message-x, 0px)),
    calc(-50% + var(--alert-message-y, 0px) + var(--alert-message-flow-y, 0px))
  );
}

.alert-preview-card.is-canvas-card .alert-preview-media,
.fc-alert-card.is-canvas-card .fc-alert-media {
  position: absolute;
  left: var(--alert-media-left);
  top: var(--alert-media-top);
  z-index: 1;
  transform: translate(
    calc(-50% + var(--alert-media-x, 0px)),
    calc(-50% + var(--alert-media-y, 0px))
  );
}

.alert-preview-card.is-canvas-card.layout-background .alert-preview-media,
.fc-alert-card.is-canvas-card.layout-background .fc-alert-media {
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  transform: none;
  pointer-events: none;
}

.alert-preview-card.is-canvas-card.layout-background .alert-preview-media img,
.alert-preview-card.is-canvas-card.layout-background .alert-preview-media video,
.fc-alert-card.is-canvas-card.layout-background .fc-alert-media img,
.fc-alert-card.is-canvas-card.layout-background .fc-alert-media video {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
}

.alert-modal-preview .alert-preview-card.is-canvas-card.is-editing .alert-layer[data-alert-layer="title"],
.alert-modal-preview .alert-preview-card.is-canvas-card.is-editing .alert-layer[data-alert-layer="message"] {
  max-width: calc(100% - 32px);
}

.alert-modal-preview .alert-preview-card.is-canvas-card.is-editing .alert-layer[data-alert-layer="title"] {
  width: var(--alert-title-width, var(--alert-copy-width, 680px)) !important;
}

.alert-modal-preview .alert-preview-card.is-canvas-card.is-editing .alert-layer[data-alert-layer="message"] {
  width: var(--alert-message-width, var(--alert-copy-width, 680px)) !important;
}

.alert-preview-card.is-canvas-card .alert-preview-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
