:root {
  --bg: #090b0e;
  --surface: #11151a;
  --surface-raised: #171c22;
  --surface-soft: #1d232b;
  --line: #29313b;
  --line-soft: #20262e;
  --text: #f5f7fa;
  --muted: #929daa;
  --purple: #9b7aff;
  --purple-strong: #7c4dff;
  --green: #b9ff66;
  --blue: #72bcff;
  --red: #ff7188;
  --amber: #ffcc66;
  --sidebar: 256px;
  --radius: 18px;
  --shadow: 0 24px 70px rgb(0 0 0 / 35%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgb(255 255 255 / 1.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 1.5%) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img,
video {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #080a0d;
  background: var(--green);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  pointer-events: none;
}

.ambient-one {
  top: -200px;
  right: -80px;
  background: var(--purple);
}

.ambient-two {
  bottom: -240px;
  left: 15%;
  background: var(--green);
  opacity: 0.05;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  padding: 24px 16px 18px;
  flex-direction: column;
  background: rgb(12 15 19 / 94%);
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 11px;
  box-shadow: 0 8px 28px rgb(0 0 0 / 24%);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.35);
}

.brand-mark.large {
  width: 54px;
  height: 54px;
  border-radius: 16px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-brand {
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--line-soft);
}

.primary-nav {
  display: flex;
  min-height: 0;
  padding: 18px 0;
  gap: 4px;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
}

.primary-nav > a {
  display: flex;
  min-height: 42px;
  padding: 9px 11px;
  align-items: center;
  gap: 11px;
  color: #b7c0ca;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
  transition: 150ms ease;
}

.primary-nav > a > span {
  display: grid;
  width: 22px;
  color: #7e8995;
  place-items: center;
  font-size: 16px;
}

.primary-nav > a:hover {
  color: var(--text);
  background: var(--surface);
}

.primary-nav > a.active {
  color: var(--text);
  background: linear-gradient(90deg, rgb(155 122 255 / 16%), rgb(155 122 255 / 4%));
  border-color: rgb(155 122 255 / 25%);
}

.primary-nav > a.active > span {
  color: var(--purple);
}

.nav-label {
  padding: 16px 11px 6px;
  color: #697480;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.user-card {
  display: grid;
  padding: 12px;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
}

.user-card img,
.avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.avatar-fallback {
  display: grid;
  color: #101318;
  background: var(--purple);
  place-items: center;
  font-weight: 800;
}

.user-copy {
  min-width: 0;
}

.user-copy strong,
.user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  font-size: 13px;
}

.user-copy small {
  color: var(--muted);
  font-size: 11px;
}

.user-card form {
  grid-column: 2;
}

.user-card-version {
  display: flex;
  padding-top: 10px;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
}

.user-card-version a {
  color: var(--purple);
  font-weight: 800;
  text-decoration: none;
}

.user-card-version a:hover,
.user-card-version a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button {
  min-height: 28px;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--text);
}

.danger-text {
  color: var(--red);
}

.mobile-header,
.nav-scrim {
  display: none;
}

.app-main {
  width: calc(100% - var(--sidebar));
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: 44px clamp(24px, 4vw, 64px) 80px;
}

.page-header {
  display: flex;
  max-width: 1440px;
  margin: 0 auto 28px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.release-list {
  display: grid;
  max-width: 1000px;
  margin: 0 auto;
  gap: 18px;
}

.release-card {
  padding: 26px;
}

.release-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.release-heading h2 {
  margin: 5px 0 0;
}

.release-heading time {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.change-list {
  margin: 20px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

.change-list li + li {
  margin-top: 9px;
}

.page-header h1 {
  margin: 5px 0 6px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.page-header p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.eyebrow {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 17px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button.primary {
  color: #0b0e11;
  background: var(--green);
  box-shadow: 0 12px 35px rgb(185 255 102 / 12%);
}

.button.primary:hover {
  background: #c9ff88;
}

.button.secondary {
  color: var(--text);
  background: var(--surface-raised);
  border-color: var(--line);
}

.button.secondary:hover {
  background: var(--surface-soft);
  border-color: #3a4551;
}

.button.small {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 13px;
}

.button.full {
  width: 100%;
}

.panel {
  background: linear-gradient(145deg, rgb(23 28 34 / 94%), rgb(15 19 24 / 96%));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  padding-bottom: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-header > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.panel-header p {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
}

.step-number {
  display: grid;
  width: 34px;
  height: 34px;
  color: var(--purple);
  background: rgb(155 122 255 / 10%);
  border: 1px solid rgb(155 122 255 / 24%);
  border-radius: 9px;
  place-items: center;
  font-size: 11px;
  font-weight: 850;
}

.status-banner {
  display: flex;
  max-width: 1440px;
  min-height: 70px;
  padding: 16px 20px;
  margin: 0 auto 20px;
  align-items: center;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.status-banner.healthy {
  background: linear-gradient(90deg, rgb(185 255 102 / 7%), var(--surface) 45%);
  border-color: rgb(185 255 102 / 18%);
}

.status-banner.warning {
  background: linear-gradient(90deg, rgb(255 204 102 / 8%), var(--surface) 45%);
  border-color: rgb(255 204 102 / 20%);
}

.status-banner strong,
.status-banner small {
  display: block;
}

.status-banner small {
  margin-top: 2px;
  color: var(--muted);
}

.pulse,
.status-dot {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgb(185 255 102 / 9%), 0 0 20px var(--green);
}

.warning .pulse {
  background: var(--amber);
  box-shadow: 0 0 0 6px rgb(255 204 102 / 9%), 0 0 20px var(--amber);
}

.metric-grid {
  display: grid;
  max-width: 1440px;
  margin: 0 auto 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-card {
  position: relative;
  min-height: 178px;
  padding: 22px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric-card::after {
  position: absolute;
  right: -34px;
  bottom: -60px;
  width: 145px;
  height: 145px;
  background: currentColor;
  border-radius: 50%;
  content: "";
  filter: blur(50px);
  opacity: 0.13;
}

.metric-card.accent-purple { color: var(--purple); }
.metric-card.accent-green { color: var(--green); }
.metric-card.accent-blue { color: var(--blue); }
.metric-card.accent-red { color: var(--red); }

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-card > strong {
  display: block;
  margin: 12px 0 18px;
  color: var(--text);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.metric-card a,
.metric-foot {
  position: relative;
  z-index: 1;
  color: currentColor;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.metric-card a:hover {
  text-decoration: underline;
}

.content-grid {
  display: grid;
  max-width: 1440px;
  margin: 0 auto;
  gap: 20px;
}

.overview-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
}

.overview-grid > .panel {
  padding: 24px;
}

.subtle-link,
.back-link,
.row-link {
  color: var(--purple);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.subtle-link:hover,
.back-link:hover,
.row-link:hover {
  text-decoration: underline;
}

.activity-list {
  padding: 5px 0 0;
  margin: 0;
  list-style: none;
}

.activity-list li {
  display: grid;
  padding: 15px 0;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.activity-list li:last-child {
  border-bottom: 0;
}

.activity-icon {
  display: grid;
  width: 36px;
  height: 36px;
  color: var(--purple);
  background: rgb(155 122 255 / 10%);
  border-radius: 9px;
  place-items: center;
  font-weight: 850;
}

.activity-list strong,
.activity-list small {
  display: block;
}

.activity-list small {
  color: var(--muted);
  font-size: 12px;
}

.quick-actions {
  display: flex;
  flex-direction: column;
}

.quick-actions > a {
  display: grid;
  padding: 16px 0;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
}

.quick-actions > a:last-child {
  border-bottom: 0;
}

.quick-actions > a > span {
  display: grid;
  width: 36px;
  height: 36px;
  color: var(--green);
  background: rgb(185 255 102 / 8%);
  border-radius: 9px;
  place-items: center;
}

.quick-actions > a strong,
.quick-actions > a small {
  display: block;
}

.quick-actions > a small {
  color: var(--muted);
  font-size: 12px;
}

.quick-actions > a b {
  color: var(--muted);
}

.status-chip,
.secure-label,
.count-badge {
  display: inline-flex;
  min-height: 26px;
  padding: 4px 9px;
  align-items: center;
  justify-content: center;
  color: #aeb7c1;
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-chip.success,
.status-chip.succeeded,
.status-chip.verified,
.status-chip.bound,
 .status-chip.active,
.status-chip.closed,
.status-chip.published {
  color: var(--green);
  background: rgb(185 255 102 / 8%);
  border-color: rgb(185 255 102 / 17%);
}

.status-chip.generated,
.status-chip.open,
.status-chip.queued,
.status-chip.running {
  color: var(--blue);
  background: rgb(114 188 255 / 8%);
  border-color: rgb(114 188 255 / 17%);
}

.status-chip.revoked,
.status-chip.failed {
  color: var(--red);
  background: rgb(255 113 136 / 8%);
  border-color: rgb(255 113 136 / 17%);
}

.status-chip.expired,
.status-chip.closing,
 .status-chip.disabled,
.status-chip.draft {
  color: var(--amber);
  background: rgb(255 204 102 / 8%);
  border-color: rgb(255 204 102 / 17%);
}

.status-chip.large {
  min-height: 34px;
  padding: 6px 13px;
}

.secure-label {
  color: var(--green);
  border-color: rgb(185 255 102 / 17%);
}

.toast {
  position: fixed;
  z-index: 60;
  top: 20px;
  right: 24px;
  padding: 13px 16px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.toast.success {
  color: var(--green);
  border-color: rgb(185 255 102 / 25%);
}

.settings-form {
  display: grid;
  max-width: 1120px;
  margin: 0 auto;
  gap: 20px;
}

.form-section {
  padding: 26px;
}

.form-section .panel-header {
  margin-bottom: 24px;
}

.category-directory {
  max-width: 1280px;
  padding: 24px;
  margin: 0 auto;
}

.category-editor-form {
  max-width: 1180px;
}

.category-enabled {
  min-height: 62px;
  padding: 12px 14px;
  background: rgb(185 255 102 / 4%);
  border: 1px solid rgb(185 255 102 / 12%);
  border-radius: 11px;
}

.category-enabled span,
.category-enabled strong,
.category-enabled small {
  display: block;
}

.category-enabled small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.modal-title-field {
  max-width: 560px;
  margin-bottom: 22px;
}

.question-list {
  display: grid;
  gap: 14px;
}

.question-card {
  min-width: 0;
  padding: 18px;
  margin: 0;
  background: rgb(255 255 255 / 2%);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
}

.question-card legend {
  padding: 0 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.question-card legend span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-hint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.danger-zone {
  max-width: 1180px;
  margin: 22px auto 0;
  border-color: rgb(255 113 136 / 28%);
}

.danger-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.danger-button {
  color: #fff;
  background: rgb(255 113 136 / 14%);
  border-color: rgb(255 113 136 / 35%);
}

.danger-button:hover:not(:disabled) {
  background: rgb(255 113 136 / 24%);
}

.field-grid {
  display: grid;
  gap: 18px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-two {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  min-width: 0;
  gap: 7px;
  flex-direction: column;
}

.field > span,
.secret-card > label {
  color: #cbd2d9;
  font-size: 12px;
  font-weight: 750;
}

.field small,
.secret-card small {
  color: var(--muted);
  font-size: 11px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: #0d1116;
  border: 1px solid #303945;
  border-radius: 9px;
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

select[multiple] {
  min-height: 130px;
}

input::placeholder,
textarea::placeholder {
  color: #5e6974;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgb(155 122 255 / 12%);
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.input-suffix,
.color-control,
.copy-control {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-suffix {
  position: relative;
}

.input-suffix input {
  padding-right: 62px;
}

.input-suffix span {
  position: absolute;
  right: 12px;
  color: var(--muted);
  font-size: 11px;
}

.color-control input[type="color"] {
  width: 54px;
  padding: 5px;
  flex: 0 0 auto;
}

.sticky-actions {
  position: sticky;
  z-index: 10;
  bottom: 18px;
  display: flex;
  padding: 12px 14px 12px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  background: rgb(18 22 27 / 91%);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.editor-layout {
  display: grid;
  max-width: 1440px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.editor-form {
  padding: 26px;
}

.editor-form > .panel-header {
  margin-bottom: 24px;
}

.revision {
  color: var(--muted);
  font-size: 11px;
}

.field-builder {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.section-row {
  display: flex;
  margin-bottom: 15px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-row h3 {
  margin: 2px 0 0;
}

.embed-field-row {
  display: grid;
  padding: 16px;
  margin: 10px 0;
  grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1.2fr) auto auto;
  gap: 12px;
  align-items: end;
  background: rgb(255 255 255 / 2%);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

.check {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.check input {
  width: 17px;
  min-height: 17px;
}

.icon-button {
  min-height: 40px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.icon-button.danger {
  color: var(--red);
}

.form-actions {
  display: flex;
  padding-top: 24px;
  justify-content: flex-end;
}

.preview-column {
  position: sticky;
  top: 24px;
}

.preview-heading {
  display: flex;
  margin-bottom: 10px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.discord-canvas {
  min-height: 410px;
  padding: 30px 22px;
  background:
    radial-gradient(circle at 100% 0, rgb(114 137 218 / 7%), transparent 35%),
    #313338;
  border: 1px solid #41434a;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.discord-message {
  display: flex;
  gap: 15px;
  color: #dbdee1;
  font-family: Arial, sans-serif;
}

.bot-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  color: #111318;
  background: var(--green);
  border-radius: 50%;
  place-items: center;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
}

.discord-body {
  min-width: 0;
  flex: 1;
}

.discord-author {
  margin-bottom: 5px;
  color: #f2f3f5;
  font-size: 14px;
  font-weight: 700;
}

.discord-author > span,
.bot-tag {
  padding: 1px 4px;
  margin-left: 4px;
  color: #fff;
  background: #5865f2;
  border-radius: 3px;
  font-size: 9px;
}

.discord-author small {
  margin-left: 5px;
  color: #949ba4;
  font-size: 11px;
  font-weight: 400;
}

.discord-embed {
  position: relative;
  display: flex;
  max-width: 520px;
  min-height: 120px;
  padding: 16px;
  gap: 14px;
  background: #2b2d31;
  border-left: 4px solid var(--purple);
  border-radius: 4px;
}

.embed-copy {
  min-width: 0;
  flex: 1;
}

.discord-embed h3 {
  margin: 0 0 8px;
  color: #f2f3f5;
  font-size: 16px;
}

.discord-embed p {
  margin: 0 0 10px;
  color: #dbdee1;
  font-size: 14px;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.discord-embed small {
  display: block;
  padding-top: 10px;
  color: #949ba4;
  font-size: 11px;
}

.preview-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preview-field {
  min-width: 0;
}

.preview-field.block {
  grid-column: 1 / -1;
}

.preview-field strong,
.preview-field span {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.preview-field span {
  color: #dbdee1;
}

.preview-image {
  width: 100%;
  max-height: 240px;
  margin-top: 12px;
  object-fit: cover;
  border-radius: 4px;
}

.preview-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.hidden {
  display: none !important;
}

.discord-button {
  min-height: 32px;
  padding: 5px 14px;
  margin-top: 8px;
  color: #fff;
  background: #5865f2;
  border: 0;
  border-radius: 3px;
  opacity: 1;
  font-size: 13px;
  font-weight: 600;
}

.publish-card {
  display: flex;
  padding: 17px;
  margin-top: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.publish-card strong,
.publish-card small {
  display: block;
}

.publish-card small {
  max-width: 280px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.invitation-flow {
  display: flex;
  max-width: 1440px;
  padding: 17px 22px;
  margin: 0 auto 20px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.invitation-flow > div {
  display: grid;
  grid-template-columns: 30px auto;
  align-items: center;
  column-gap: 10px;
}

.invitation-flow > div > span {
  display: grid;
  width: 30px;
  height: 30px;
  grid-row: 1 / 3;
  color: var(--green);
  background: rgb(185 255 102 / 8%);
  border: 1px solid rgb(185 255 102 / 16%);
  border-radius: 50%;
  place-items: center;
  font-size: 11px;
  font-weight: 850;
}

.invitation-flow strong,
.invitation-flow small {
  display: block;
}

.invitation-flow small {
  color: var(--muted);
  font-size: 11px;
}

.invitation-flow > b {
  color: #4e5965;
}

.invitations-grid {
  grid-template-columns: minmax(320px, 0.72fr) minmax(520px, 1.45fr);
  align-items: start;
}

.invitations-grid > .panel {
  padding: 24px;
}

.stack-form {
  display: grid;
  margin-top: 22px;
  gap: 17px;
}

.filter-bar {
  display: flex;
  padding: 18px 0;
  gap: 10px;
  align-items: center;
}

.filter-bar label,
.filter-bar .grow {
  flex: 1;
}

.filter-bar select {
  width: auto;
  min-width: 150px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #737f8b;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

td {
  color: #c9d0d7;
  font-size: 13px;
}

td strong,
td small {
  display: block;
}

td small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

tr:last-child td {
  border-bottom: 0;
}

.muted {
  color: var(--muted);
}

.empty-state {
  display: grid;
  min-height: 220px;
  padding: 30px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state.compact {
  min-height: 160px;
}

.empty-state strong {
  font-size: 17px;
}

.empty-state p {
  max-width: 370px;
  margin: 5px 0 0;
  color: var(--muted);
}

.success-stage,
.error-stage {
  display: flex;
  max-width: 720px;
  min-height: calc(100vh - 124px);
  padding: 50px 0;
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.success-mark {
  display: grid;
  width: 68px;
  height: 68px;
  margin-bottom: 20px;
  color: #0a0d10;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 12px rgb(185 255 102 / 7%), 0 24px 60px rgb(185 255 102 / 15%);
  place-items: center;
  font-size: 28px;
  font-weight: 900;
}

.success-stage h1,
.error-stage h1 {
  margin: 7px 0 9px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.success-stage > p,
.error-stage > p {
  max-width: 560px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 16px;
}

.secret-card {
  width: 100%;
  padding: 24px;
  margin: 12px 0 18px;
  background: var(--surface);
  border: 1px solid rgb(185 255 102 / 20%);
  border-radius: var(--radius);
  text-align: left;
}

.secret-card label {
  display: block;
  margin-bottom: 8px;
}

.secret-card small {
  display: block;
  margin-top: 10px;
}

.copy-control input {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.identity-summary {
  display: grid;
  width: 100%;
  padding: 0;
  margin: 0 0 24px;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.identity-summary div {
  padding: 15px;
  border-right: 1px solid var(--line-soft);
}

.identity-summary div:last-child {
  border-right: 0;
}

.identity-summary dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity-summary dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.detail-header {
  align-items: center;
}

.back-link {
  display: block;
  margin-bottom: 15px;
}

.detail-grid {
  display: grid;
  max-width: 1100px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 20px;
}

.detail-grid > .panel {
  padding: 25px;
}

.detail-list {
  margin: 8px 0 0;
}

.detail-list > div {
  display: flex;
  padding: 14px 0;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  text-align: right;
}

.transcript-callout {
  display: flex;
  min-height: 330px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.transcript-glyph {
  display: grid;
  width: 58px;
  height: 58px;
  color: var(--purple);
  background: rgb(155 122 255 / 10%);
  border: 1px solid rgb(155 122 255 / 20%);
  border-radius: 16px;
  place-items: center;
  font-size: 22px;
}

.transcript-callout h2 {
  margin: 18px 0 5px;
}

.transcript-callout p {
  max-width: 320px;
  margin: 0 0 20px;
  color: var(--muted);
}

.transcript-header {
  align-items: center;
}

.transcript-shell {
  max-width: 1050px;
  margin: 0 auto;
  overflow: hidden;
  background: #313338;
  border: 1px solid #41444a;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: Arial, sans-serif;
}

.transcript-shell > header {
  display: flex;
  min-height: 58px;
  padding: 12px 20px;
  align-items: center;
  justify-content: space-between;
  color: #f2f3f5;
  background: #2b2d31;
  border-bottom: 1px solid #1e1f22;
}

.transcript-shell > header small {
  color: #949ba4;
}

.channel-hash {
  margin-right: 7px;
  color: #949ba4;
  font-size: 22px;
}

.transcript-messages {
  padding: 18px 0 26px;
  margin: 0;
  list-style: none;
}

.transcript-message {
  display: grid;
  padding: 9px 20px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
}

.transcript-message:hover {
  background: rgb(0 0 0 / 6%);
}

.transcript-message > img,
.transcript-message > .avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.message-meta {
  display: flex;
  margin-bottom: 2px;
  align-items: baseline;
  gap: 6px;
}

.message-meta strong {
  color: #f2f3f5;
  font-size: 15px;
}

.message-meta time {
  color: #949ba4;
  font-size: 10px;
}

.message-content {
  color: #dbdee1;
  font-size: 14px;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.attachment-grid {
  display: grid;
  max-width: 650px;
  margin-top: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.image-attachment,
.video-attachment,
.file-attachment {
  overflow: hidden;
  background: #2b2d31;
  border: 1px solid #202225;
  border-radius: 7px;
}

.image-attachment {
  display: block;
  color: #b5bac1;
  text-decoration: none;
}

.image-attachment img,
.video-attachment video {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #1e1f22;
}

.image-attachment span,
.video-attachment span {
  display: block;
  padding: 7px 9px;
  font-size: 11px;
}

.file-attachment {
  display: flex;
  padding: 11px;
  align-items: center;
  gap: 11px;
  color: #00a8fc;
  text-decoration: none;
}

.file-attachment > span {
  display: grid;
  width: 34px;
  height: 34px;
  color: #dbdee1;
  background: #383a40;
  border-radius: 7px;
  place-items: center;
}

.file-attachment strong,
.file-attachment small {
  display: block;
}

.file-attachment small {
  color: #949ba4;
  font-size: 10px;
}

.transcript-embed {
  max-width: 520px;
  padding: 10px 13px;
  margin-top: 8px;
  background: #2b2d31;
  border-left: 4px solid #5865f2;
  border-radius: 4px;
}

.transcript-embed strong {
  color: #f2f3f5;
}

.transcript-embed p {
  margin: 4px 0 0;
  color: #dbdee1;
  white-space: pre-wrap;
}

.auth-shell {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 72% 50%, rgb(155 122 255 / 12%), transparent 28%),
    radial-gradient(circle at 100% 0%, rgb(185 255 102 / 6%), transparent 22%),
    var(--bg);
}

.auth-main {
  display: grid;
  width: 100%;
  min-height: 100vh;
  padding: clamp(24px, 5vw, 76px);
  grid-template-columns: minmax(350px, 0.85fr) minmax(400px, 1.15fr);
  gap: clamp(40px, 8vw, 120px);
  align-items: center;
}

.login-card {
  max-width: 590px;
}

.login-brand {
  display: flex;
  margin-bottom: 42px;
  align-items: center;
  gap: 15px;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(48px, 6vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.login-card h1 span {
  color: var(--purple);
}

.login-card > p {
  max-width: 540px;
  margin: 25px 0 30px;
  color: #a9b2bc;
  font-size: 18px;
  line-height: 1.65;
}

.login-actions {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.discord-login {
  min-height: 52px;
  padding: 12px 21px;
}

.discord-login span {
  font-size: 18px;
}

.access-note {
  display: flex;
  margin-top: 22px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.access-note .status-dot {
  width: 7px;
  height: 7px;
}

.login-visual {
  position: relative;
  width: min(100%, 660px);
  min-height: clamp(560px, 76vh, 820px);
  justify-self: end;
  overflow: hidden;
  border-radius: 34px;
  box-shadow: 0 34px 100px rgb(0 0 0 / 45%);
  isolation: isolate;
}

.login-lifestyle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.login-visual::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      var(--bg) 0%,
      rgb(9 11 14 / 88%) 10%,
      rgb(9 11 14 / 38%) 31%,
      transparent 56%
    ),
    linear-gradient(180deg, rgb(9 11 14 / 12%), transparent 45%, rgb(9 11 14 / 62%));
  content: "";
  pointer-events: none;
}

.login-visual::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: inherit;
  box-shadow: inset 0 0 80px rgb(9 11 14 / 24%);
  content: "";
  pointer-events: none;
}

.error-code {
  color: var(--purple);
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .preview-column {
    position: static;
  }

  .invitations-grid {
    grid-template-columns: 1fr;
  }

  .auth-main {
    gap: 30px;
  }
}

@media (max-width: 900px) {
  .mobile-header {
    position: sticky;
    z-index: 25;
    top: 0;
    display: flex;
    min-height: 66px;
    padding: 12px 18px;
    align-items: center;
    justify-content: space-between;
    background: rgb(9 11 14 / 88%);
    border-bottom: 1px solid var(--line-soft);
    backdrop-filter: blur(16px);
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .nav-scrim {
    position: fixed;
    z-index: 29;
    inset: 0;
    display: block;
    padding: 0;
    background: rgb(0 0 0 / 62%);
    border: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .nav-scrim.open {
    opacity: 1;
    pointer-events: auto;
  }

  .app-main {
    width: 100%;
    margin-left: 0;
    padding: 30px 20px 70px;
  }

  .overview-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .field-grid.three {
    grid-template-columns: 1fr;
  }

  .auth-main {
    display: flex;
    max-width: 700px;
    margin: 0 auto;
    flex-direction: column;
    justify-content: center;
  }

  .login-visual {
    display: none;
  }
}

@media (max-width: 700px) {
  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header > .button {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 155px;
  }

  .field-grid.two {
    grid-template-columns: 1fr;
  }

  .danger-form {
    align-items: stretch;
    flex-direction: column;
  }

  .embed-field-row {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-section,
  .editor-form,
  .invitations-grid > .panel,
  .overview-grid > .panel {
    padding: 19px;
  }

  .invitation-flow {
    align-items: stretch;
    flex-direction: column;
  }

  .invitation-flow > b {
    display: none;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar select {
    width: 100%;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  td {
    display: flex;
    padding: 7px 4px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border: 0;
    text-align: right;
  }

  td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }

  .identity-summary {
    grid-template-columns: 1fr;
  }

  .identity-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .identity-summary div:last-child {
    border-bottom: 0;
  }

  .copy-control {
    align-items: stretch;
    flex-direction: column;
  }

  .publish-card {
    align-items: stretch;
    flex-direction: column;
  }

  .publish-card .button {
    width: 100%;
  }

  .discord-canvas {
    padding: 20px 13px;
  }

  .discord-embed {
    flex-direction: column-reverse;
  }

  .preview-thumbnail {
    width: 64px;
    height: 64px;
  }

  .attachment-grid {
    grid-template-columns: 1fr;
  }

  .transcript-message {
    padding: 9px 12px;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
  }

  .transcript-message > img,
  .transcript-message > .avatar-fallback {
    width: 36px;
    height: 36px;
  }

  .message-meta {
    flex-wrap: wrap;
  }

  .auth-main {
    padding: 28px 22px;
  }

  .login-card h1 {
    font-size: clamp(44px, 14vw, 68px);
  }

  .login-brand {
    margin-bottom: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
