/* RANKHOUSE Ultra Foundation v17.0.0 */
:root {
  --rh-ultra-surface: color-mix(in srgb, #11151d 94%, var(--rh-accent, #e8752b) 6%);
  --rh-ultra-surface-2: color-mix(in srgb, #171b24 92%, var(--rh-accent, #e8752b) 8%);
  --rh-ultra-border: color-mix(in srgb, #667085 36%, var(--rh-accent, #e8752b) 18%);
  --rh-ultra-glow: color-mix(in srgb, var(--rh-accent, #e8752b) 24%, transparent);
}

[data-rh-ultra-module] {
  --rh-ultra-preview-width: clamp(330px, 30vw, 470px);
}

[data-rh-ultra-module] .topbar,
[data-rh-ultra-module] .rh-module-command-header {
  isolation: isolate;
}

.rh-ultra-foundation-badge {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  width: fit-content;
  margin-top: .55rem;
  padding: .34rem .62rem;
  border: 1px solid color-mix(in srgb, var(--rh-accent, #e8752b) 50%, #5b6473);
  border-radius: 999px;
  background: color-mix(in srgb, var(--rh-accent, #e8752b) 11%, #10141c);
  color: #f4f7fb;
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 0 24px var(--rh-ultra-glow);
}

.rh-ultra-foundation-badge::before {
  content: '';
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: #45e39a;
  box-shadow: 0 0 12px rgba(69, 227, 154, .72);
}

[data-rh-ultra-module] .rh-module-tabs,
[data-rh-ultra-module] .gw-studio-nav,
[data-rh-ultra-module] .lfg-dashboard-nav {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  backdrop-filter: none;
}

.rh-ultra-canonical-preview {
  display: grid;
  gap: .8rem;
  min-width: 0;
  color: #e9edf5;
}

.rh-ultra-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .8rem;
  border: 1px solid var(--rh-ultra-border);
  border-radius: 12px;
  background: rgba(9, 12, 18, .78);
}

.rh-ultra-preview-meta strong {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rh-ultra-preview-meta span {
  color: #45e39a;
  font-size: .7rem;
  font-weight: 800;
}

.rh-ultra-discord-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: .72rem;
  padding: .9rem;
  border: 1px solid rgba(122, 132, 151, .26);
  border-radius: 15px;
  background: #191b20;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.rh-ultra-discord-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--rh-accent, #e8752b), #8a4218);
  color: #fff;
  font-weight: 900;
}

.rh-ultra-discord-body { min-width: 0; }
.rh-ultra-discord-author { display: flex; align-items: center; gap: .4rem; margin-bottom: .32rem; font-size: .75rem; font-weight: 900; }
.rh-ultra-discord-author em { padding: .1rem .28rem; border-radius: 4px; background: #5865f2; color: #fff; font-size: .55rem; font-style: normal; }
.rh-ultra-discord-content { margin: 0 0 .55rem; white-space: pre-wrap; overflow-wrap: anywhere; color: #dbdee1; font-size: .82rem; line-height: 1.45; }
.rh-ultra-discord-embeds { display: grid; gap: .55rem; }
.rh-ultra-discord-embed { position: relative; overflow: hidden; padding: .82rem .9rem .78rem 1rem; border-radius: 4px; background: #232428; }
.rh-ultra-discord-embed::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--embed-color, #e31b2b); }
.rh-ultra-discord-embed h4 { margin: 0 0 .42rem; font-size: .9rem; }
.rh-ultra-discord-embed > p { margin: 0 0 .58rem; color: #dbdee1; white-space: pre-wrap; font-size: .76rem; line-height: 1.45; }
.rh-ultra-discord-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .42rem; }
.rh-ultra-discord-field { min-width: 0; padding: .48rem; border-radius: 6px; background: rgba(255, 255, 255, .025); }
.rh-ultra-discord-field:not(.is-inline) { grid-column: 1 / -1; }
.rh-ultra-discord-field strong { display: block; margin-bottom: .18rem; font-size: .67rem; }
.rh-ultra-discord-field span { display: block; overflow-wrap: anywhere; white-space: pre-wrap; color: #c9cdd3; font-size: .67rem; line-height: 1.36; }
.rh-ultra-discord-embed img { display: block; max-width: 100%; max-height: 280px; margin-top: .62rem; border-radius: 7px; object-fit: cover; }
.rh-ultra-discord-embed footer { margin-top: .6rem; color: #9da3ad; font-size: .62rem; }
.rh-ultra-discord-components { display: flex; flex-wrap: wrap; gap: .38rem; margin-top: .55rem; }
.rh-ultra-discord-button { border: 0; border-radius: 4px; padding: .42rem .62rem; background: #4e5058; color: #fff; font: inherit; font-size: .67rem; font-weight: 800; }
.rh-ultra-discord-button[data-style="1"] { background: #5865f2; }
.rh-ultra-discord-button[data-style="3"] { background: #248046; }
.rh-ultra-discord-button[data-style="4"] { background: #da373c; }
.rh-ultra-discord-button[data-style="5"] { background: #4e5058; }
.rh-ultra-discord-button:disabled { opacity: .62; }

.rh-ultra-preview-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px solid rgba(117, 126, 144, .22);
}
.rh-ultra-preview-status { color: #9ca5b4; font-size: .68rem; }
.rh-ultra-preview-status.is-ok { color: #45e39a; }
.rh-ultra-preview-status.is-error { color: #ff7479; }
.rh-ultra-test-button { white-space: nowrap; }

.rh-ultra-contract-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}
.rh-ultra-contract-card {
  padding: 1rem;
  border: 1px solid var(--rh-ultra-border);
  border-radius: 16px;
  background: linear-gradient(155deg, var(--rh-ultra-surface-2), var(--rh-ultra-surface));
}
.rh-ultra-contract-card strong { display: block; margin-bottom: .25rem; }
.rh-ultra-contract-card small { color: #98a2b3; }
.rh-ultra-contract-card.is-reference { border-color: color-mix(in srgb, #45e39a 52%, var(--rh-ultra-border)); box-shadow: 0 0 28px rgba(69, 227, 154, .08); }

@media (max-width: 1180px) {
  .rh-ultra-contract-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rh-ultra-discord-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .rh-ultra-contract-grid { grid-template-columns: 1fr; }
  .rh-ultra-discord-fields { grid-template-columns: 1fr; }
  .rh-ultra-discord-field.is-inline { grid-column: 1 / -1; }
  .rh-ultra-preview-tools { align-items: stretch; flex-direction: column; }
}

[data-rh-canonical-preview-target] {
  min-width: 0;
}
[data-rh-canonical-preview-target] > .rh-ultra-canonical-content {
  min-width: 0;
}
.rh-ultra-lfg-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rh-ultra-preview-width);
  gap: 1rem;
  min-height: 0;
  padding: 1rem;
  overflow: auto;
}
.rh-ultra-lfg-editor-grid > .lfg-modal-content {
  min-width: 0;
  padding: 0;
  overflow: visible;
}
.rh-ultra-lfg-preview {
  align-self: start;
  position: sticky;
  top: 0;
  min-width: 0;
  padding: .85rem;
  border: 1px solid var(--rh-ultra-border);
  border-radius: 16px;
  background: var(--rh-ultra-surface);
}
@media (max-width: 1080px) {
  .rh-ultra-lfg-editor-grid { grid-template-columns: 1fr; }
  .rh-ultra-lfg-preview { position: static; }
}
