body.has-app-modal {
  overflow: hidden;
}

.app-modal-root {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  display: grid;
  place-items: center;
  padding: 20px;
  isolation: isolate;
  overscroll-behavior: contain;
}

.app-modal-root[hidden] {
  display: none;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.74);
  opacity: 0;
  transition: opacity 180ms var(--ease);
}

.app-modal-panel {
  --app-modal-bg: #242424;
  --app-modal-bar: #292929;
  --app-modal-border: rgba(255, 255, 255, 0.12);
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: 88vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--app-modal-border);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: var(--app-modal-bg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  opacity: 0;
  overflow: hidden;
  transform: translateY(8px) scale(0.99);
  transition:
    opacity 180ms var(--ease),
    transform 180ms var(--ease);
}

.app-modal-panel.is-small {
  width: min(420px, calc(100vw - 32px));
}

.app-modal-panel.is-wide {
  width: min(90vw, 1080px);
}

.app-modal-panel.is-voice {
  width: min(80vw, 800px);
  max-height: 78vh;
}

.app-modal-root.is-open .app-modal-backdrop {
  opacity: 1;
}

.app-modal-root.is-open .app-modal-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-modal-header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--app-modal-bar);
}

.app-modal-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-modal-symbol {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 4px;
  color: #a7aaa9;
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
}

.app-modal-symbol.is-question,
.app-modal-symbol.is-info {
  border-color: rgba(121, 223, 183, 0.18);
  color: #79dfb7;
  background: rgba(121, 223, 183, 0.08);
}

.app-modal-symbol.is-warning {
  border-color: rgba(255, 191, 63, 0.22);
  color: #ffca62;
  background: rgba(255, 191, 63, 0.08);
}

.app-modal-symbol.is-danger {
  border-color: rgba(255, 112, 112, 0.22);
  color: #ff9999;
  background: rgba(255, 112, 112, 0.08);
}

.app-modal-title {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: #ececed;
  font-size: 14px;
  font-weight: 680;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-modal-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #858585;
  background: transparent;
  font-size: 13px;
  transition: color 140ms var(--ease), background 140ms var(--ease), border-color 140ms var(--ease);
}

.app-modal-close:hover,
.app-modal-close:focus-visible {
  border-color: rgba(255, 255, 255, 0.08);
  color: #e5e5e5;
  background: rgba(255, 255, 255, 0.06);
  outline: 0;
}

.app-modal-body {
  min-height: 0;
  padding: 18px;
  overflow: auto;
  font-size: 15px;
  background: var(--app-modal-bg);
  scrollbar-width: thin;
  scrollbar-color: rgba(119, 125, 138, 0.36) transparent;
}

.asset-preview-modal {
  display: grid;
  place-items: center;
  min-height: min(70vh, 720px);
  border-radius: 6px;
  background: #181818;
  overflow: hidden;
}

.asset-preview-modal img,
.asset-preview-modal video {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 720px);
  object-fit: contain;
}

.asset-preview-empty {
  padding: 28px;
  color: var(--muted);
  font-size: 13px;
}

.app-modal-footer {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 54px;
  padding: 10px 14px;
}

.app-modal-footer[hidden] {
  display: none;
}

.app-modal-panel .app-modal-action {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: #c4c4c4;
  background: #333333;
  font-size: 11px;
  font-weight: 650;
  transition: color 140ms var(--ease), background 140ms var(--ease), border-color 140ms var(--ease);
}

.app-modal-action:hover {
  border-color: rgba(255, 255, 255, 0.16);
  color: #eeeeee;
  background: #3a3a3a;
}

.app-modal-action.is-primary {
  border-color: transparent;
  color: #10231b;
  background: #79dfb7;
}

.app-modal-action.is-primary:hover {
  border-color: transparent;
  color: #0d1d17;
  background: #91e8c4;
}

.app-modal-action.is-danger {
  border-color: rgba(255, 106, 106, 0.18);
  color: #ffb3b3;
  background: rgba(194, 66, 66, 0.18);
}

.app-modal-action.is-danger:hover {
  border-color: rgba(255, 106, 106, 0.28);
  color: #ffd1d1;
  background: rgba(194, 66, 66, 0.28);
}

.app-modal-action.is-ghost {
  border-color: transparent;
  color: #999999;
  background: transparent;
}

.app-modal-action:disabled,
.app-modal-action:disabled:hover {
  border-color: rgba(255, 255, 255, 0.08);
  color: #777777;
  background: #303030;
  cursor: not-allowed;
  opacity: 0.72;
}

@media (max-width: 680px) {
  .app-modal-root {
    padding: 10px;
  }

  .app-modal-panel,
  .app-modal-panel.is-small,
  .app-modal-panel.is-wide,
  .app-modal-panel.is-voice {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .app-modal-header {
    min-height: 48px;
    padding-left: 14px;
  }

}
.auth-login-link { display: inline-block; margin-top: 12px; text-decoration: underline; }
