:root {
  color-scheme: dark;
  --canvas: #101014;
  --surface-1: #17171c;
  --surface-2: #1d1d23;
  --surface-3: #24242b;
  --line: #303039;
  --line-strong: #42424d;
  --text: #f5f3f4;
  --text-soft: #c8c5ca;
  --text-muted: #99969f;
  --accent: #c53c4d;
  --accent-strong: #ed6473;
  --accent-deep: #8d2b38;
  --success: #6dc39b;
  --warning: #e0b661;
  --danger: #ed6b79;
  --focus: #f58a95;
  --radius-sm: 0.5rem;
  --radius-md: 0.8rem;
  --radius-lg: 1rem;
  --shadow: 0 1.2rem 2.8rem rgb(0 0 0 / 30%);
  --nav-height: 4.6rem;
  --sidebar-width: 15.5rem;
  --control-height: 2.85rem;
  --content-width: 78rem;
  --transition: 150ms ease;
  --motion-ease: cubic-bezier(0.2, 0.75, 0.2, 1);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--text);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
}

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

a {
  color: var(--accent-strong);
  text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-shell,
.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
}

.site-shell {
  max-width: 96rem;
  padding-inline: clamp(1rem, 3vw, 3rem);
}

.public-header {
  position: sticky;
  z-index: 30;
  top: 0;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: rgb(23 23 28 / 94%);
  backdrop-filter: blur(14px);
}

.public-header > .navbar {
  max-width: 96rem;
  min-height: var(--nav-height);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 3rem);
  border-bottom: 0;
  background: transparent;
}

.navbar {
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem clamp(1rem, 2vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: var(--surface-1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  /*border: 1px solid #aa3948;*/
  border-radius: var(--radius-sm);
  color: #fff;
  /*background: var(--accent);*/
  font-size: 0.86rem;
}

.icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: absolute;
  z-index: 50;
  top: -4rem;
  left: 1rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--accent-deep);
}

.skip-link:focus {
  top: 0.75rem;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 2vw, 2rem);
}

.public-nav a,
.navbar-context {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.public-nav a {
  position: relative;
  padding-block: 0.5rem;
  transition: color 220ms ease;
}

.public-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0.2rem;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-strong);
  content: '';
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms var(--motion-ease);
}

.public-nav a:hover::after,
.public-nav a:focus-visible::after {
  transform: scaleX(1);
}

.public-nav a:hover,
.public-nav a:focus-visible {
  color: var(--text);
}

.navbar-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.7rem;
}

.premium-trigger {
  position: relative;
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  padding: 0.45rem 0.7rem;
  border: 1px solid #a54d5a;
  border-radius: var(--radius-sm);
  color: #ffe5e7;
  background: linear-gradient(115deg, #61232e, #892c3b 58%, #60232e);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms var(--motion-ease);
}

.premium-trigger::before {
  position: absolute;
  inset: 0 auto 0 -50%;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 14%), transparent);
  content: '';
  transform: skewX(-18deg);
  transition: left 550ms var(--motion-ease);
}

.premium-trigger:hover {
  border-color: var(--accent-strong);
  box-shadow: 0 0.4rem 1.2rem rgb(197 60 77 / 20%);
  transform: translateY(-2px);
}

.premium-trigger:hover::before {
  left: 120%;
}

.premium-trigger .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.premium-trigger .premium-lock {
  width: 0.7rem;
  height: 0.7rem;
  margin-left: 0.15rem;
  opacity: 0.75;
}

.premium-toast {
  position: fixed;
  z-index: 80;
  top: calc(var(--nav-height) + 0.7rem);
  right: clamp(1rem, 3vw, 3rem);
  width: min(24rem, calc(100vw - 2rem));
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid #85404b;
  border-radius: var(--radius-md);
  color: var(--text);
  background: #281a20;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 220ms ease,
    transform 220ms var(--motion-ease);
}

.premium-toast[hidden] {
  display: none;
}

.premium-toast.is-visible {
  opacity: 1;
  transform: none;
}

.premium-toast > .icon {
  margin-top: 0.1rem;
  color: var(--accent-strong);
}

.premium-toast span {
  display: grid;
  gap: 0.25rem;
}

.premium-toast strong {
  font-size: 0.85rem;
}

.premium-toast small {
  color: var(--text-soft);
  font-size: 0.75rem;
  line-height: 1.5;
}

.premium-toast button {
  margin: -0.25rem -0.3rem 0 auto;
  border: 0;
  color: var(--text-soft);
  background: transparent;
  font-size: 1.35rem;
  cursor: pointer;
}

.account-menu {
  position: relative;
  min-width: 0;
}

.account-trigger {
  display: flex;
  min-height: 2.9rem;
  align-items: center;
  gap: 0.65rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  list-style: none;
}

.account-trigger::-webkit-details-marker {
  display: none;
}

.account-trigger:hover,
.account-menu[open] .account-trigger {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.account-trigger:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.account-avatar-wrap {
  position: relative;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: var(--text-soft);
  background: var(--surface-3);
}

.account-avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-avatar[hidden] {
  display: none;
}

.account-avatar-fallback {
  position: absolute;
}

.account-chevron {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--text-muted);
  transition: transform 150ms ease;
}

.account-menu[open] .account-chevron {
  transform: rotate(180deg);
}

.account-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  right: 0;
  width: min(17rem, calc(100vw - 2rem));
  padding: 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.account-popover-identity {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.account-popover-identity small {
  color: var(--text-muted);
}

.account-popover a,
.account-popover button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.25rem;
  padding: 0.65rem 0.7rem;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: none;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-popover a:hover,
.account-popover button:hover {
  background: var(--surface-3);
}

.account-popover .account-logout {
  color: var(--danger);
}

.card-action {
  align-self: center;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.card-link:hover .card-action {
  border-color: var(--accent);
  background: var(--accent-deep);
}

.install-panel {
  width: min(42rem, 100%);
  display: grid;
  justify-items: start;
  gap: 1rem;
  margin: clamp(2rem, 6vw, 5rem) auto;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}

.install-panel .eyebrow,
.install-panel .page-title,
.install-panel .lede {
  margin: 0;
}

.install-icon {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-deep);
  border-radius: var(--radius-sm);
  color: var(--accent-strong);
  background: rgb(212 61 77 / 10%);
}

.install-icon .icon {
  width: 1.45rem;
  height: 1.45rem;
}

.back-link {
  display: inline-flex;
  margin-top: 1.5rem;
  color: var(--text-soft);
  text-decoration: none;
}

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

.resource-field select[multiple] {
  min-height: 7rem;
}

.resource-field option {
  padding: 0.3rem 0.45rem;
}

.resource-search {
  width: 100%;
  margin-bottom: 0.45rem;
}

.resource-selection-count {
  color: var(--text-muted);
}

.resource-field.is-enhanced > select,
.resource-field.is-enhanced > .resource-search,
.resource-field.is-enhanced > .resource-selection-count {
  display: none;
}

.resource-picker {
  position: relative;
}

.resource-picker-trigger {
  width: 100%;
  min-height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
}

.resource-picker-trigger:hover,
.resource-picker-trigger[aria-expanded='true'] {
  border-color: var(--accent);
  background: var(--surface-3);
}

.resource-picker-chevron {
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
}

.resource-picker-popover:not([hidden]) {
  position: absolute;
  z-index: 12;
  top: calc(100% + 0.35rem);
  right: 0;
  left: 0;
  display: grid;
  gap: 0.45rem;
  padding: 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.resource-picker-search {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-1);
}

.resource-picker-options {
  max-height: 14rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.resource-picker-option {
  width: 100%;
  display: block;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.resource-picker-option:hover,
.resource-picker-option:focus-visible,
.resource-picker-option[aria-pressed='true'] {
  color: var(--text);
  background: var(--surface-3);
}

.resource-picker-option[aria-pressed='true']::after {
  float: right;
  color: var(--success);
  content: 'Selected';
  font-size: 0.72rem;
}

.resource-picker-option-description {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.resource-picker-option[hidden],
.resource-picker-empty[hidden] {
  display: none;
}

.resource-choice-label {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.55rem;
  vertical-align: middle;
}

.resource-choice-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-type-icon {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
}

.resource-role-swatch {
  width: 0.85rem;
  height: 0.85rem;
  flex: none;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 50%;
  background: var(--role-primary);
}

.resource-choice-label.has-role-color .resource-choice-name {
  color: var(--role-primary);
}

.resource-choice-label.has-role-gradient .resource-role-swatch {
  background: linear-gradient(
    110deg,
    var(--role-primary),
    var(--role-secondary),
    var(--role-tertiary, var(--role-secondary))
  );
}

.resource-choice-label.has-role-gradient .resource-choice-name {
  color: var(--role-primary);
  background: linear-gradient(
    110deg,
    var(--role-primary),
    var(--role-secondary),
    var(--role-tertiary, var(--role-secondary))
  );
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.resource-picker-empty {
  margin: 0.35rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.resource-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.resource-pills:empty {
  display: none;
}

.resource-pill {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.25rem 0.2rem 0.55rem;
  border: 1px solid #65343b;
  border-radius: 999px;
  color: var(--text);
  background: #29191d;
  font-size: 0.78rem;
}

.resource-pill > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-pill-remove {
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
  border: 0;
  border-radius: 50%;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
}

.resource-pill-remove:hover {
  color: #fff;
  background: var(--accent-deep);
}

.mapping-row {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.mapping-row legend {
  padding-inline: 0.35rem;
  font-weight: 700;
}

.mapping-row [data-remove-mapping] {
  margin-top: 0.75rem;
}

.actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.account-copy {
  display: grid;
  justify-items: end;
  line-height: 1.2;
}

.account-copy small {
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.account-copy strong {
  max-width: 14rem;
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 720;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

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

.button-compact {
  min-height: 2.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.84rem;
}

.button-primary {
  color: #fff;
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-strong);
}

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

.button-secondary:hover,
.button-quiet:hover {
  border-color: #595864;
  background: var(--surface-3);
}

.button-quiet {
  border-color: var(--line);
  color: var(--text-soft);
  background: transparent;
}

.button-danger {
  color: #fff;
  background: #b83240;
}

.button-danger:hover {
  background: #d4404f;
}

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

form.is-pending {
  cursor: progress;
}

.eyebrow,
.sidebar-label,
.card-eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.page-title {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.lede {
  max-width: 43rem;
  margin: 1.25rem 0 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.6;
}

.actions {
  margin-top: 2rem;
  flex-wrap: wrap;
}

.panel-note,
.card-description,
.field-description,
.modal-description,
.state > p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.panel-note {
  margin: 1rem 0 0;
  line-height: 1.5;
}

.home-hero {
  min-height: min(43rem, calc(100vh - var(--nav-height)));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(19rem, 0.92fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding-block: clamp(4rem, 8vw, 7rem);
  background: radial-gradient(ellipse at 82% 47%, rgb(197 60 77 / 9%), transparent 55%);
}

.home-hero-copy {
  max-width: 43rem;
}

.home-hero h1 span {
  color: var(--accent-strong);
}

.home-hero-copy > * {
  animation: home-enter 620ms var(--motion-ease) both;
}

.home-hero-copy > :nth-child(2) {
  animation-delay: 80ms;
}

.home-hero-copy > :nth-child(3) {
  animation-delay: 160ms;
}

.home-hero-copy > :nth-child(4),
.home-hero-copy > :nth-child(5) {
  animation-delay: 240ms;
}

.home-hero .lede {
  max-width: 38rem;
}

.home-hero-note {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 1.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.79rem;
  line-height: 1.5;
}

.home-hero-note .icon {
  color: var(--success);
}

.home-product {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: var(--shadow);
  animation: home-enter 750ms 160ms var(--motion-ease) both;
  transition:
    border-color 300ms ease,
    box-shadow 300ms ease,
    transform 300ms var(--motion-ease);
}

.home-product::before {
  position: absolute;
  top: 0;
  right: 12%;
  left: 12%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-strong), transparent);
  content: '';
}

.home-product:hover {
  border-color: #6b3b44;
  box-shadow: 0 1.4rem 3.4rem rgb(0 0 0 / 36%);
  transform: translateY(-4px);
}

.home-product-head,
.home-product-row {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 1rem 1.25rem;
}

.home-product-head {
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.home-product-head > span:last-child,
.home-product-row > span {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.home-product strong {
  font-size: 0.91rem;
}

.home-product small,
.home-product-foot {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.home-product-mark {
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  flex: none;
  place-items: center;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--accent);
}

.home-product-row + .home-product-row {
  border-top: 1px solid var(--line);
}

.home-product-row {
  color: var(--text);
  text-decoration: none;
  transition: background 220ms ease;
}

.home-product-row:hover,
.home-product-row:focus-visible {
  background: rgb(197 60 77 / 7%);
}

.home-product-row > .icon:first-child {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent-strong);
}

.home-product-arrow {
  width: 0.85rem;
  height: 0.85rem;
  margin-left: auto;
  color: var(--text-muted);
  transform: rotate(-90deg);
  transition:
    color 220ms ease,
    transform 220ms var(--motion-ease);
}

.home-product-row:hover .home-product-arrow,
.home-product-row:focus-visible .home-product-arrow {
  color: var(--accent-strong);
  transform: translateX(3px) rotate(-90deg);
}

.home-product-foot {
  margin: 0;
  padding: 0.8rem 1.25rem;
  border-top: 1px solid var(--line);
}

.home-section,
.home-workflow,
.home-final {
  padding-block: clamp(3.2rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--nav-height) + 1.5rem);
}

.home-section.is-reveal-pending,
.home-workflow.is-reveal-pending,
.home-final.is-reveal-pending {
  opacity: 0;
  transform: translateY(24px);
}

.home-section.is-revealed,
.home-workflow.is-revealed,
.home-final.is-revealed {
  opacity: 1;
  transform: none;
  transition:
    opacity 650ms var(--motion-ease),
    transform 650ms var(--motion-ease);
}

.home-section-heading {
  max-width: 42rem;
}

.home-section h2,
.home-workflow h2,
.home-final h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.2;
}

.home-section-heading > p:last-child,
.home-workflow > div > p:last-child,
.home-final p:last-child {
  color: var(--text-soft);
  line-height: 1.65;
}

.home-capabilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 2.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  overflow: hidden;
}

.home-capability {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(1.2rem, 2vw, 1.8rem);
  scroll-margin-top: calc(var(--nav-height) + 2rem);
  transition: background 260ms ease;
}

.home-capability:hover {
  background: rgb(197 60 77 / 7%);
}

.home-capability h3 {
  transition: color 220ms ease;
}

.home-capability:hover h3 {
  color: #fff;
}

.home-capability + .home-capability {
  border-left: 1px solid var(--line);
}

.home-capability-number,
.home-capability-tags {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.home-capability h3 {
  margin: 1.5rem 0 0;
  font-size: 1.2rem;
  letter-spacing: -0.025em;
}

.home-capability p {
  margin: 0.65rem 0 1.6rem;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.6;
}

.home-capability-tags {
  margin-top: auto;
  color: var(--accent-strong);
}

.home-workflow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
}

.home-workflow ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: workflow;
}

.home-workflow li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.25rem 0.8rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  counter-increment: workflow;
  transition:
    border-color 240ms ease,
    padding-left 240ms var(--motion-ease);
}

.home-workflow li:hover {
  padding-left: 0.35rem;
  border-color: var(--accent-deep);
}

.home-workflow li::before {
  grid-row: span 2;
  color: var(--accent-strong);
  content: '0' counter(workflow);
  font-size: 0.8rem;
  font-weight: 800;
}

.home-workflow li span {
  color: var(--text-muted);
  font-size: 0.83rem;
}

.home-final {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
  background: radial-gradient(ellipse at 100% 60%, rgb(197 60 77 / 10%), transparent 45%);
}

.home-final > div {
  max-width: 42rem;
}

.home-final .button {
  flex: none;
}

.public-body .button:hover {
  transform: translateY(-3px);
}

.public-body .button:active {
  transform: translateY(0);
}

.public-body .button-primary:hover {
  box-shadow: 0 0.55rem 1.6rem rgb(197 60 77 / 23%);
}

.public-body {
  isolation: isolate;
}

.public-body::before {
  position: fixed;
  z-index: 0;
  inset: -12%;
  background:
    radial-gradient(ellipse at 12% 18%, rgb(165 46 66 / 10%), transparent 32%),
    radial-gradient(ellipse at 88% 72%, rgb(197 60 77 / 8%), transparent 35%);
  content: '';
  pointer-events: none;
  animation: ambient-drift 24s ease-in-out infinite alternate;
}

.public-body .site-shell,
.public-footer {
  position: relative;
  z-index: 1;
}

.home-final-art {
  width: clamp(6rem, 11vw, 11rem);
  height: auto;
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 0.7rem 1.6rem rgb(0 0 0 / 30%));
  animation: art-float 7s ease-in-out infinite;
}

.public-footer {
  border-top: 1px solid var(--line);
  background: #15151a;
}

.public-footer-inner {
  max-width: 96rem;
  margin-inline: auto;
  padding: clamp(2.3rem, 5vw, 4.5rem) clamp(1rem, 3vw, 3rem) 1.3rem;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(16rem, 1.8fr) repeat(3, minmax(8rem, 1fr));
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

.footer-brand p {
  max-width: 17rem;
  margin: 1rem 0 1.2rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.footer-primary-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.footer-primary-link .icon {
  width: 0.8rem;
  height: 0.8rem;
  transform: rotate(-90deg);
  transition: transform 220ms var(--motion-ease);
}

.footer-primary-link:hover .icon {
  transform: translateX(3px) rotate(-90deg);
}

.footer-links {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 0.75rem;
}

.footer-links h2 {
  margin: 0 0 0.3rem;
  color: var(--text);
  font-size: 0.85rem;
}

.footer-links a,
.footer-links button {
  padding: 0;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  font-size: 0.8rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 200ms ease,
    transform 200ms var(--motion-ease);
}

.footer-links a:hover,
.footer-links button:hover {
  color: var(--text);
  transform: translateX(3px);
}

.footer-links button span {
  margin-left: 0.3rem;
  color: var(--accent-strong);
  font-size: 0.65rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 2rem;
  align-items: center;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.74rem;
}

.footer-bottom a {
  margin-left: auto;
  color: var(--text-soft);
  text-decoration: none;
}

.public-page-main {
  max-width: 78rem;
  margin-inline: auto;
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.public-page-hero {
  max-width: 52rem;
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.public-page-hero h1 {
  font-size: clamp(2.7rem, 5vw, 4.3rem);
}

.public-page-hero .button {
  margin-top: 1.6rem;
}

.status-checked {
  margin: 1.6rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.status-card {
  min-width: 0;
  padding: clamp(1.3rem, 2.5vw, 2rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}

.status-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--accent-strong);
  background: rgb(197 60 77 / 11%);
}

.status-card h2 {
  margin-top: 1.3rem;
}

.status-card > p:last-child,
.status-detail p,
.status-note p {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  font-weight: 750;
}

.status-indicator span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.status-indicator-operational {
  color: var(--success);
}

.status-indicator-degraded {
  color: var(--warning);
}

.status-indicator-unknown {
  color: var(--text-muted);
}

.status-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.6rem;
  padding-top: 2.4rem;
  border-top: 1px solid var(--line);
}

.status-detail h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.status-facts {
  display: grid;
  gap: 0.7rem;
}

.status-facts > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.status-facts span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.status-facts strong {
  font-size: 0.86rem;
}

.status-note {
  display: flex;
  gap: 0.9rem;
  margin-top: 2rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
}

.status-note > .icon {
  color: var(--accent-strong);
}

.status-note h2 {
  font-size: 0.95rem;
}

.status-note p {
  margin: 0.35rem 0 0;
}

.wiki-layout {
  display: grid;
  grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.wiki-toc {
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
  display: grid;
  gap: 0.3rem;
  padding: 1.1rem 0.7rem;
  border-top: 1px solid var(--line-strong);
}

.wiki-toc .eyebrow {
  margin: 0 0 0.55rem 0.6rem;
}

.wiki-toc a {
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.83rem;
  text-decoration: none;
  transition:
    color 200ms ease,
    background 200ms ease;
}

.wiki-toc a:hover,
.wiki-toc a:focus-visible {
  color: var(--text);
  background: var(--surface-2);
}

.wiki-content {
  min-width: 0;
}

.wiki-section {
  padding: 0 0 clamp(2.5rem, 5vw, 4rem);
  scroll-margin-top: calc(var(--nav-height) + 2rem);
}

.wiki-section + .wiki-section {
  padding-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}

.wiki-section h2 {
  font-size: clamp(1.65rem, 2.7vw, 2.2rem);
}

.wiki-section > h3 {
  margin: 2rem 0 0.7rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.35;
}

.wiki-section > p:not(.eyebrow),
.wiki-feature-grid p,
.wiki-questions p {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.7;
}

.wiki-section code {
  padding: 0.1rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  color: #ffb3bd;
  background: var(--surface-2);
  font-size: 0.88em;
}

.wiki-callout {
  margin-top: 1.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: var(--surface-2);
  font-size: 0.86rem;
  line-height: 1.6;
}

.wiki-steps {
  display: grid;
  gap: 0.6rem;
  margin: 1.8rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: wiki-step;
}

.wiki-steps li {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.25rem 0.9rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  counter-increment: wiki-step;
}

.wiki-steps li::before {
  grid-row: span 2;
  color: var(--accent-strong);
  content: '0' counter(wiki-step);
  font-size: 0.9rem;
  font-weight: 800;
}

.wiki-steps span {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.wiki-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.wiki-feature-grid article {
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  transition:
    border-color 220ms ease,
    transform 220ms var(--motion-ease);
}

.wiki-feature-grid article:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.wiki-feature-grid h3 {
  margin: 0;
  font-size: 1rem;
}

.wiki-feature-grid p {
  margin: 0.6rem 0 0;
}

.wiki-command-list {
  display: grid;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.wiki-command-list > div {
  display: grid;
  grid-template-columns: minmax(10rem, 0.45fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.wiki-command-list em {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: normal;
}

.wiki-command-list span {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.wiki-questions {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.wiki-questions details {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
}

.wiki-questions summary {
  cursor: pointer;
  font-weight: 700;
}

.wiki-questions p {
  margin-bottom: 0;
}

.dashboard-body {
  background: var(--canvas);
}

.app-shell > .navbar {
  position: sticky;
  z-index: 30;
  top: 0;
}

.dashboard-layout {
  min-height: calc(100vh - var(--nav-height));
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 20;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--line);
  background: var(--surface-1);
}

.sidebar-label {
  margin: 0 0 0.4rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.62rem;
}

.sidebar-server {
  min-width: 0;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.sidebar-server:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.sidebar-server img,
.sidebar-server-fallback {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.sidebar-server-fallback {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent-deep);
  font-weight: 800;
}

.sidebar-server > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.sidebar-server small {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.sidebar-server strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-server > .icon {
  width: 0.85rem;
  height: 0.85rem;
  margin-left: auto;
  color: var(--text-muted);
  transform: rotate(-90deg);
}

.sidebar-navigation {
  min-width: 0;
}

.sidebar-mobile-trigger {
  display: none;
}

.sidebar-navigation nav {
  display: grid;
  gap: 0.9rem;
}

.sidebar-group {
  display: grid;
  gap: 0.1rem;
}

.sidebar-link {
  min-width: 0;
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr);
  gap: 0.68rem;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.46rem 0.72rem;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 0.83rem;
  text-decoration: none;
  transition:
    background var(--transition),
    color var(--transition);
}

.sidebar-link span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--surface-3);
}

.sidebar-link.is-active {
  color: #fff;
  background: #3a2026;
  font-weight: 700;
}

.sidebar-link.is-active .icon {
  color: #ff96a0;
}

.sidebar-note {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: auto;
  padding: 1rem 0.65rem 0;
  border-top: 1px solid var(--line);
}

.sidebar-note > .icon {
  color: var(--success);
}

.sidebar-note span:last-child {
  min-width: 0;
  display: grid;
}

.sidebar-note strong {
  font-size: 0.76rem;
}

.sidebar-note small {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.dashboard-main {
  min-width: 0;
  width: 100%;
  max-width: calc(var(--content-width) + 6rem);
  margin-inline: auto;
  padding: clamp(1.4rem, 3vw, 2.75rem);
}

.page-heading {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.heading-row {
  display: flex;
  gap: 2rem;
  align-items: end;
  justify-content: space-between;
}

.server-selector {
  width: min(18rem, 100%);
  flex: 0 0 auto;
}

.server-selector label,
.field > label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.server-selector label,
.resource-field > label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.server-selector label .icon,
.resource-field > label .icon {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--accent-strong);
}

.select-wrap {
  position: relative;
  min-width: 0;
  flex: 1;
}

.selector-controls {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  color: var(--text-muted);
  content: '▾';
  pointer-events: none;
  transform: translateY(-50%);
}

select,
.field input,
.field textarea {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-2);
  transition:
    border-color var(--transition),
    background var(--transition);
}

select:hover:not(:disabled),
.field input:hover:not(:disabled),
.field textarea:hover:not(:disabled) {
  border-color: #66636e;
}

select:disabled,
.field textarea:disabled {
  color: var(--text-muted);
  background: var(--surface-1);
  cursor: not-allowed;
}

select {
  padding: 0 2.3rem 0 0.8rem;
  appearance: none;
}

.card-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr));
  gap: 0.85rem;
  margin: 1.5rem 0 0;
  padding: 0;
}

.card-grid {
  list-style: none;
}

.server-group {
  margin-top: 2rem;
}

.server-group + .server-group {
  margin-top: 2.5rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--line);
}

.server-group .card-grid {
  margin-top: 1rem;
}

.server-group-empty {
  margin: 1rem 0 0;
  padding: 1.25rem 1.4rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--surface-1);
}

.card {
  min-width: 0;
  min-height: 7.1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 0.9rem;
  align-items: center;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface-1);
  text-decoration: none;
  transition:
    background var(--transition),
    border-color var(--transition);
}

.card-with-leading {
  grid-template-columns: 3rem minmax(0, 1fr) auto auto auto;
}

.card-link:hover {
  border-color: #79515a;
  background: var(--surface-2);
}

.card-image,
.card-mark {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-sm);
}

.card-image {
  object-fit: cover;
}

.card-mark {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent-deep);
  font-weight: 820;
}

.card-body {
  min-width: 0;
  display: grid;
}

.card-eyebrow {
  margin-bottom: 0.25rem;
  font-size: 0.62rem;
}

.card-title,
.card-description {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-description {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.card-arrow {
  color: var(--accent-strong);
}

.card-arrow .icon {
  width: 0.9rem;
  height: 0.9rem;
  transform: rotate(-90deg);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.45rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-2);
  font-size: 0.63rem;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge .icon {
  width: 0.8rem;
  height: 0.8rem;
}

.badge-success {
  border-color: #285d47;
  color: #8bddb5;
  background: #12241d;
}

.badge-warning {
  border-color: #66522c;
  color: #f0cb78;
  background: #282113;
}

.badge-danger,
.badge-accent {
  border-color: #74313a;
  color: #ff8b97;
  background: #28161a;
}

.detail-grid {
  margin-bottom: 1.25rem;
}

.overview-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}

.overview-status > div {
  min-width: 0;
  padding: 1.2rem 1.4rem;
}

.overview-status > div + div {
  border-left: 1px solid var(--line);
}

.overview-status strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 750;
}

.overview-status > div:first-child strong {
  text-transform: capitalize;
}

.overview-status p:last-child {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.overview-modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.overview-module {
  min-width: 0;
  min-height: 4.4rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-1);
  text-decoration: none;
  transition:
    background var(--transition),
    border-color var(--transition);
}

.overview-module:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.overview-module > .icon {
  color: var(--text-soft);
}

.overview-module > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.overview-module strong {
  overflow: hidden;
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-module small {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.overview-module-state {
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  margin-left: auto;
  border-radius: 50%;
  background: var(--line-strong);
}

.overview-module-state.is-enabled {
  background: var(--success);
}

.module-section {
  margin-top: 2rem;
}

.section-heading,
.command-heading,
.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.section-heading {
  margin-bottom: 0.9rem;
}

.section-heading .eyebrow {
  margin-bottom: 0.25rem;
}

.state {
  max-width: 44rem;
  margin-top: 1.5rem;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}

.state-mark {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  margin-bottom: 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--accent-strong);
  background: var(--surface-2);
  font-weight: 800;
}

.state > p {
  margin: 0.65rem 0 1.25rem;
  line-height: 1.6;
}

.state-error {
  border-style: solid;
  border-top: 2px solid var(--accent);
}

.state-error .page-title {
  font-size: clamp(2.2rem, 7vw, 4rem);
}

.reference {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.75rem;
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.loading-indicator {
  width: 2rem;
  height: 2rem;
  display: block;
  margin-bottom: 1rem;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field > label,
.field-description,
.field-error {
  margin: 0;
}

.field input {
  padding: 0.7rem 0.8rem;
}

.field textarea {
  min-height: 5.5rem;
  padding: 0.7rem 0.8rem;
  resize: vertical;
}

.search-bar {
  display: grid;
  grid-template-columns: auto minmax(8rem, 11rem) minmax(12rem, 1fr) auto auto;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}

.search-bar > label {
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.search-bar input {
  width: 100%;
  min-height: 2.25rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-2);
}

.search-bar select {
  min-height: 2.25rem;
}

.settings-panel,
.command-panel {
  display: grid;
  gap: 1.4rem;
  margin-top: 1.5rem;
  padding: clamp(1.1rem, 2.5vw, 1.8rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}

.settings-panel > .toggle {
  min-height: 4.2rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.settings-panel {
  max-width: 54rem;
}

.settings-card {
  gap: 1.25rem;
}

.settings-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.settings-card-heading h2 {
  margin: 0.2rem 0 0;
  font-size: 1.45rem;
}

.settings-card-heading .lede {
  margin: 0.4rem 0 0;
}

.settings-card-separator {
  width: 100%;
  margin: 0.15rem 0 0.2rem;
  border: 0;
  border-top: 1px solid var(--line);
}

.settings-card-icon {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 1px solid #aa3948;
  border-radius: var(--radius-sm);
  background: #7f2636;
  color: #fff;
}

.embed-color-field {
  min-inline-size: 0;
  padding: 0;
  border: 0;
}

.embed-color-field legend {
  margin-bottom: 0.35rem;
  color: var(--text);
  font-weight: 700;
}

.embed-color-palette {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.embed-color-swatch,
.embed-color-custom {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background-color: var(--swatch-color);
  box-shadow:
    inset 0 0 0 1px #ffffff40,
    0 0 0 1px #0008;
  cursor: pointer;
}

.embed-color-swatch.is-selected {
  border-color: var(--text);
  box-shadow:
    0 0 0 2px var(--accent),
    inset 0 0 0 1px #ffffff60;
}

.embed-color-custom {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-color: var(--line-strong);
  background: conic-gradient(#f66, #fd6, #6f6, #6df, #86f, #f6f, #f66);
}

.embed-color-custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.embed-color-custom .icon {
  width: 0.9rem;
  height: 0.9rem;
  color: #fff;
  filter: drop-shadow(0 1px 2px #000);
}

.embed-preview-wrap {
  display: grid;
  gap: 0.55rem;
}

.embed-preview-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.embed-settings-card .auto-message-preview {
  margin-top: 0;
}

.embed-settings-card .embed-preview-footer {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  margin-top: 0.55rem;
  color: #b5bac1;
  font-size: 0.68rem;
  line-height: 1.3;
}

.embed-settings-card .embed-preview-footer-separator {
  color: #949ba4;
}

.embed-settings-card .embed-preview-footer time {
  color: #949ba4;
}

.embed-settings-card > form {
  display: grid;
  gap: 1.25rem;
}

.embed-settings-card > form > .toggle,
.embed-settings-card > form > .rank-color-field,
.embed-settings-card > form > .field,
.embed-settings-card > form > .embed-preview-wrap {
  margin: 0;
}

.embed-settings-card .rank-color-field {
  padding: 0.1rem 0;
}

.premium-locked-setting {
  opacity: 0.86;
}

.premium-feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.45rem;
  padding: 0.18rem 0.45rem;
  border: 1px solid #b997ee65;
  border-radius: 999px;
  background: #a685f230;
  color: #c9a9f4;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.premium-feature-badge .icon {
  width: 0.78rem;
  height: 0.78rem;
}

.premium-locked-control {
  position: relative;
  padding: 0.2rem;
  border: 1px dashed #b997ee65;
  border-radius: calc(var(--radius-sm) + 0.15rem);
  background: linear-gradient(
    135deg,
    var(--surface-2),
    color-mix(in srgb, #a685f2 6%, var(--surface-2))
  );
}

.premium-locked-control input {
  width: 100%;
  padding-right: 3rem;
  border-color: transparent;
  cursor: not-allowed;
  color: var(--text-soft);
  background: transparent;
}

.premium-lock-mark {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  border: 1px solid #b997ee65;
  border-radius: 50%;
  background: #a685f230;
  color: #c9a9f4;
  transform: translateY(-50%);
}

.premium-lock-mark .icon {
  width: 0.85rem;
  height: 0.85rem;
}

.settings-panel-wide {
  max-width: 68rem;
}

.settings-group {
  display: grid;
  gap: 1.2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.settings-group h2 {
  font-size: 1.15rem;
}

.settings-group > div > .field-description {
  max-width: 46rem;
  margin-top: 0.45rem;
  line-height: 1.55;
}

.settings-group > div > .eyebrow {
  margin-bottom: 0.25rem;
}

.leveling-settings {
  gap: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.leveling-settings > .settings-group,
.leveling-settings > .toggle,
.leveling-settings > .form-actions {
  min-width: 0;
  padding: clamp(1.1rem, 2.5vw, 1.7rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  box-shadow: 0 12px 32px #0002;
}

.leveling-settings > .settings-group {
  gap: 1.15rem;
}

.leveling-settings > .settings-group > :first-child {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.leveling-settings > .settings-group > :first-child > .eyebrow,
.leveling-reward-heading .eyebrow {
  margin-bottom: 0.3rem;
}

.leveling-settings .settings-group h2 {
  font-size: 1.25rem;
}

.leveling-settings .settings-group .field-description {
  line-height: 1.5;
}

.leveling-settings > .toggle {
  background: var(--surface-1);
}

.leveling-settings > .form-actions {
  margin: 0;
  border-top: 1px solid var(--line);
}

.leveling-settings .form-grid {
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.leveling-settings .leveling-three-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr));
}

.leveling-three-grid > .field {
  grid-template-rows: minmax(2.2rem, auto) auto auto;
  align-content: start;
}

.leveling-three-grid > .field > label {
  grid-row: 1;
  align-self: end;
}

.leveling-three-grid > .field > input {
  grid-row: 2;
}

.leveling-three-grid > .field > .field-description {
  grid-row: 3;
}

.leveling-two-grid > .resource-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.leveling-two-grid > .resource-field > label,
.leveling-two-grid > .field > label {
  min-height: 1.35rem;
}

.leveling-two-grid > .resource-field > .field-description {
  order: 3;
}

.leveling-reward-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 17rem);
  align-items: start;
  gap: 1.25rem;
}

.leveling-reward-heading > div {
  min-width: 0;
}

.leveling-reward-heading > div:first-child > .field-description {
  max-width: 46rem;
  margin-top: 0.45rem;
}

.leveling-curve-field .field {
  display: flex;
  flex-direction: column;
}

.leveling-curve-field .field input {
  order: 2;
}

.leveling-curve-field .field-description {
  order: 3;
  margin-top: 0.2rem;
}

.leveling-settings [data-level-reward-list] {
  display: grid;
  gap: 0.75rem;
}

.leveling-settings [data-level-reward-row] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
  min-width: 0;
  margin: 0;
  background: var(--surface-2);
}

.leveling-settings [data-level-reward-row] > .form-grid {
  min-width: 0;
}

.leveling-settings [data-level-reward-row] > button {
  margin: 0 0 0.1rem;
}

@media (max-width: 62rem) {
  .leveling-reward-heading,
  .leveling-settings [data-level-reward-row] {
    grid-template-columns: 1fr;
  }

  .leveling-settings [data-level-reward-row] > button {
    justify-self: start;
  }
}

.booster-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 25rem), 1fr));
  gap: 1rem;
}

.booster-group {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.booster-group legend {
  padding-inline: 0.35rem;
  font-weight: 700;
}

.booster-rows {
  display: grid;
  gap: 0.75rem;
}

.booster-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(7rem, 10rem);
  align-items: end;
  gap: 0.75rem;
}

.booster-row-number {
  align-self: center;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.booster-row .field {
  min-width: 0;
}

.autorole-count {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--surface-2);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.reaction-panel-list {
  display: grid;
  gap: 1rem;
}
.reaction-panel-card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface-1);
}
.reaction-panel-card.creation-panel,
.creation-slot {
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  background: linear-gradient(125deg, rgba(197, 60, 77, 0.11), var(--surface-1) 65%);
}
.reaction-panel-card.creation-panel:hover,
.creation-slot:hover {
  border-color: var(--accent-strong);
}
.creation-slot > summary {
  padding: 0.95rem 1.1rem;
  color: var(--accent-strong);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.creation-slot > summary::-webkit-details-marker {
  display: none;
}
.creation-slot > summary::before {
  content: '+';
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.65rem;
  border-radius: 0.4rem;
  background: rgba(197, 60, 77, 0.2);
}
.creation-slot[open] > summary {
  border-bottom: 1px solid var(--line);
}
.creation-slot-content {
  padding: 0.8rem;
}
.creation-slot-content > .reminder-card,
.creation-slot-content > .autorole-row,
.creation-slot-content > .giveaway-booster-row,
.creation-slot-content > .booster-row {
  background: var(--surface-2);
}
[data-managed-slot][hidden],
[data-create-slot][hidden] {
  display: none !important;
}
.reaction-panel-shell {
  display: grid;
  gap: 0.35rem;
}
.slot-remove {
  justify-self: end;
  margin-top: 0.3rem;
}
.autorole-row > .slot-remove,
.giveaway-booster-row > .slot-remove,
.booster-row > .slot-remove {
  grid-column: 1 / -1;
}
.reaction-panel-shell > .slot-remove {
  margin-right: 0.5rem;
}
.reaction-panel-card > summary {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  list-style: none;
}
.reaction-panel-card > summary::-webkit-details-marker {
  display: none;
}
.reaction-panel-card > summary strong,
.reaction-panel-card > summary small {
  display: block;
}
.reaction-panel-card > summary small {
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.reaction-panel-chevron {
  margin-left: auto;
  transition: transform 0.2s ease;
}
.reaction-panel-card[open] .reaction-panel-chevron {
  transform: rotate(180deg);
}
.reaction-panel-number {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  background: rgba(231, 77, 100, 0.13);
  color: var(--accent);
  font-weight: 700;
}
.reaction-panel-content {
  display: grid;
  gap: 1.15rem;
  border-top: 1px solid var(--line);
  padding: 1.25rem;
}
.reaction-embed-editor,
.reaction-options,
.reaction-panel-items {
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
}
.reaction-option-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.4rem;
}
.reaction-option-toggles label,
.reaction-delete-option {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.reaction-panel-item {
  display: flex;
  align-items: start;
  gap: 0.7rem;
  padding-block: 0.8rem;
  border-top: 1px solid var(--line);
}
.reaction-panel-item-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  flex: 1;
}
.reaction-delete-option {
  color: var(--text-muted);
}
@media (max-width: 45rem) {
  .reaction-panel-item-fields {
    grid-template-columns: 1fr;
  }
}
.reaction-panel-settings [hidden] {
  display: none !important;
}
.reaction-panel-item-fields .field {
  position: relative;
}
.reaction-embed-fields {
  display: grid;
  gap: 0.75rem;
}
.reaction-embed-field {
  display: grid;
  gap: 0.6rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.reaction-embed-field > label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.reaction-embed-field > button {
  justify-self: start;
}
.emoji-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.emoji-picker-trigger:hover,
.emoji-picker-trigger[aria-expanded='true'] {
  border-color: var(--accent-strong);
}
.emoji-picker-trigger img,
.emoji-picker-choice img {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
}
.emoji-picker-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  left: 0;
  width: min(18rem, 80vw);
  padding: 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.emoji-picker-popover input {
  width: 100%;
  margin-bottom: 0.5rem;
}
.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.2rem;
  max-height: 14rem;
  overflow: auto;
}
.emoji-picker-choice {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
}
.emoji-picker-choice:hover,
.emoji-picker-choice[aria-pressed='true'] {
  background: var(--surface-3);
  border-color: var(--accent);
}

.autorole-rows {
  display: grid;
  gap: 0.75rem;
}

.reminder-rows {
  display: grid;
  gap: 1rem;
}

.giveaway-booster-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(8rem, 11rem);
  align-items: end;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

@media (max-width: 40rem) {
  .giveaway-booster-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .giveaway-booster-row .field:last-child {
    grid-column: 2;
  }
}

.reminder-card {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.reminder-card-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.reminder-card-heading h3 {
  margin: 0;
}

.reminder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.auto-message-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.auto-message-embed-editor {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.auto-message-embed-field {
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.auto-message-field-button {
  width: fit-content;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  padding: 0.3rem 0;
}

.auto-message-field-button:hover {
  text-decoration: underline;
}

.auto-message-preview {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #2b2d31;
  color: #f2f3f5;
}

.auto-message-avatar {
  display: grid;
  flex: 0 0 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 50%;
  background: #c43b50;
  font-weight: 800;
}

.auto-message-preview-body {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.auto-message-preview-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.auto-message-preview-header > span:last-child {
  color: #aeb1b8;
  font-size: 0.75rem;
}
.auto-message-bot-label {
  padding: 0.1rem 0.25rem;
  border-radius: 0.2rem;
  background: #5865f2;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
}
.auto-message-preview p {
  margin: 0.3rem 0 0;
  white-space: pre-wrap;
}
.auto-message-preview-embed {
  max-width: 34rem;
  margin-top: 0.4rem;
  padding: 0.85rem;
  border-left: 4px solid #d43d4c;
  border-radius: 0.2rem;
  background: #232428;
}
.auto-message-preview-embed > div {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.auto-message-preview-embed small {
  display: block;
  margin-top: 0.6rem;
  color: #b5bac1;
}

.auto-message-card [hidden] {
  display: none !important;
}

@media (max-width: 40rem) {
  .reminder-grid,
  .auto-message-grid {
    grid-template-columns: 1fr;
  }
}

.autorole-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(7rem, 10rem) minmax(8rem, 11rem);
  align-items: end;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.autorole-row-number {
  align-self: center;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.autorole-row .field {
  min-width: 0;
}

@media (max-width: 60rem) {
  .autorole-row {
    grid-template-columns: auto minmax(0, 1fr) minmax(7rem, 10rem);
  }

  .autorole-row .field:last-child {
    grid-column: 2 / -1;
  }
}

@media (max-width: 40rem) {
  .autorole-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .autorole-row .field:not(:first-of-type) {
    grid-column: 2;
  }
}

.leveling-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.5rem;
  border: 1px solid var(--danger);
}

.leveling-danger-zone .field-description {
  max-width: 42rem;
  margin-top: 0.5rem;
  line-height: 1.55;
}

.leveling-danger-zone .button {
  flex-shrink: 0;
}

.leveling-reset-form {
  display: grid;
  gap: 1rem;
}

@media (max-width: 45rem) {
  .booster-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .booster-row .field:last-child {
    grid-column: 2;
  }

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

.rank-card-preview-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 1.1rem;
  background: linear-gradient(135deg, #18222f, #0e1420);
  box-shadow:
    0 20px 55px #0003,
    inset 0 1px #ffffff12;
}

.rank-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
}
.rank-card-heading > div {
  flex: 1 1 28rem;
}
.rank-card-heading .field-description {
  max-width: 46rem;
  margin-top: 0.45rem;
  line-height: 1.55;
}
.rank-card-reset {
  flex: none;
}
.rank-card-reset-note {
  margin: -0.3rem 0 0;
  color: var(--text-soft);
  font-size: 0.74rem;
}
.rank-card-reset-note strong {
  color: var(--text);
}

.leveling-settings .rank-card-control-pair {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 25.5rem), 1fr));
}

.rank-card-separator {
  width: 100%;
  margin: 0.25rem 0 0;
  border: 0;
  border-top: 1px solid var(--line-strong);
}

.rank-card-preview-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 20 / 7;
  object-fit: contain;
}

.rank-card-preview-loading {
  position: absolute;
  right: 0.9rem;
  bottom: 0.85rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid #ffffff25;
  border-radius: 999px;
  background: #101b29e8;
  color: #f3f7fb;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 8px 20px #0005;
}

.rank-color-field {
  min-width: 0;
}
.rank-color-palette {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
  min-height: 3.1rem;
}
.rank-color-swatch,
.rank-color-custom {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 3px solid var(--surface-1);
  border-radius: 50%;
  background: #76e4be;
  box-shadow:
    0 0 0 1px #ffffff35,
    0 3px 10px #0004;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}
.rank-color-swatch:hover,
.rank-color-custom:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow:
    0 0 0 1px #ffffff8a,
    0 8px 15px #0005;
}
.rank-color-swatch-red {
  background: #f06b78;
}
.rank-color-swatch-orange {
  background: #ffa66b;
}
.rank-color-swatch-yellow {
  background: #ffd66e;
}
.rank-color-swatch-green {
  background: #76e4be;
}
.rank-color-swatch-cyan {
  background: #69d6e8;
}
.rank-color-swatch-blue {
  background: #81a9ff;
}
.rank-color-swatch-violet {
  background: #ba8cff;
}
.rank-color-swatch-black {
  background: #000;
}
.rank-color-swatch-white {
  background: #fff;
}
.rank-color-swatch-gray {
  background: #808080;
}
.rank-color-swatch[aria-pressed='true'],
.rank-color-custom.is-selected {
  box-shadow:
    0 0 0 2px var(--surface-1),
    0 0 0 4px var(--accent-strong),
    0 7px 15px #0005;
}
.rank-color-swatch:focus-visible,
.rank-color-custom:focus-within {
  outline: 2px solid #fff;
  outline-offset: 4px;
}
.rank-color-custom {
  overflow: hidden;
  background: conic-gradient(#f27886, #fbd26b, #7ae9bc, #73cbef, #b78dff, #f27886);
}
.rank-color-custom::before {
  position: absolute;
  inset: 0.28rem;
  border-radius: 50%;
  background: var(--surface-2);
  content: '';
}
.field .rank-color-custom input[type='color'] {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.rank-color-custom svg {
  position: relative;
  z-index: 1;
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: #f3f7fb;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  pointer-events: none;
}
.rank-opacity-field {
  align-self: end;
}
.rank-opacity-field label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}
.rank-opacity-field output {
  padding: 0.2rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 0.4rem;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-2));
  font-variant-numeric: tabular-nums;
}
.rank-opacity-field input[type='range'] {
  --range-progress: 73%;
  width: 100%;
  height: 2.4rem;
  margin: 0.25rem 0 0;
  border: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}
.rank-opacity-field input[type='range']::-webkit-slider-runnable-track {
  height: 0.55rem;
  border: 1px solid #ffffff1a;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--accent-strong) 0 var(--range-progress),
    var(--surface-3) var(--range-progress) 100%
  );
  box-shadow: inset 0 2px 4px #0006;
}
.rank-opacity-field input[type='range']::-moz-range-track {
  height: 0.55rem;
  border: 1px solid #ffffff1a;
  border-radius: 999px;
  background: var(--surface-3);
  box-shadow: inset 0 2px 4px #0006;
}
.rank-opacity-field input[type='range']::-moz-range-progress {
  height: 0.55rem;
  border-radius: 999px;
  background: var(--accent-strong);
}
.rank-opacity-field input[type='range']::-webkit-slider-thumb {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: -0.46rem;
  border: 0.25rem solid #f6fbff;
  border-radius: 50%;
  background: var(--accent-strong);
  appearance: none;
  box-shadow:
    0 0 0 1px #101925,
    0 3px 10px #0007,
    0 0 0 0.38rem color-mix(in srgb, var(--accent) 18%, transparent);
  transition:
    box-shadow 150ms ease,
    transform 150ms ease;
}
.rank-opacity-field input[type='range']::-moz-range-thumb {
  width: 0.85rem;
  height: 0.85rem;
  border: 0.25rem solid #f6fbff;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow:
    0 0 0 1px #101925,
    0 3px 10px #0007,
    0 0 0 0.38rem color-mix(in srgb, var(--accent) 18%, transparent);
  transition:
    box-shadow 150ms ease,
    transform 150ms ease;
}
.rank-opacity-field input[type='range']:hover::-webkit-slider-thumb {
  transform: scale(1.08);
}
.rank-opacity-field input[type='range']:hover::-moz-range-thumb {
  transform: scale(1.08);
}
.rank-opacity-field input[type='range']:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 0.4rem;
}
.rank-opacity-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 0.7rem;
}

.rank-card-presets {
  margin: 0;
  padding: 0;
  border: 0;
}
.rank-card-presets legend {
  margin-bottom: 0.75rem;
  font-weight: 750;
}
.rank-card-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}
.rank-card-preset {
  position: relative;
  display: grid;
  gap: 0.6rem;
  padding: 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  color: var(--text);
  background: var(--surface-2);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}
.rank-card-preset input {
  position: absolute;
  opacity: 0;
}
.rank-card-preset:has(input:checked) {
  border-color: var(--accent-strong);
  box-shadow:
    0 0 0 1px var(--accent-strong),
    0 8px 20px #0003;
}
.rank-card-preset:focus-within,
.rank-card-preset:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}
.rank-card-preset:hover {
  border-color: var(--accent-strong);
  transform: translateY(-2px);
}
.rank-card-preset-art {
  height: 4.7rem;
  border: 1px solid #ffffff20;
  border-radius: 0.45rem;
  background-color: #172331;
}
.rank-card-preset-art-aurora {
  background-image:
    radial-gradient(ellipse at 76% 16%, #76e4be85, transparent 57%),
    linear-gradient(150deg, transparent 48%, #76e4be30 50%, transparent 70%);
}
.rank-card-preset-art-horizon {
  background-image:
    radial-gradient(ellipse at 75% 120%, #76e4be85, transparent 66%),
    linear-gradient(160deg, transparent 53%, #76e4be45 54%, transparent 75%);
}
.rank-card-preset-art-grid {
  background-image:
    linear-gradient(#76e4be32 1px, transparent 1px),
    linear-gradient(90deg, #76e4be32 1px, transparent 1px);
  background-size: 1rem 1rem;
}
.rank-card-preset-art-solid {
  border-left: 0.45rem solid #76e4be;
}
.rank-card-preset-locked {
  border-style: dashed;
  background: linear-gradient(
    135deg,
    var(--surface-2),
    color-mix(in srgb, #a685f2 6%, var(--surface-2))
  );
  cursor: pointer;
}
.rank-card-preset-locked:hover {
  border-color: #b997ee;
}
.rank-card-preset-art-custom {
  display: grid;
  place-items: center;
  border: 1px dashed #b997ee65;
  background: radial-gradient(circle at center, #a685f230, transparent 66%), var(--surface-3);
}
.rank-card-preset-art-custom svg {
  width: 1.7rem;
  height: 1.7rem;
  fill: none;
  stroke: #c9a9f4;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rank-card-preset-locked small {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.15rem;
  color: #c9a9f4;
  font-size: 0.66rem;
  font-weight: 700;
}
.rank-card-preset-locked .icon {
  width: 0.8rem;
  height: 0.8rem;
}

@media (max-width: 38rem) {
  .rank-card-preview-image {
    min-height: 9rem;
  }
  .rank-card-preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.event-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.75rem;
}

.check-group {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  margin: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.check-group legend {
  padding-inline: 0.35rem;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 750;
}

.check-option {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.check-option input[type='checkbox'] {
  width: 1.1rem;
  height: 1.1rem;
  display: grid;
  flex: none;
  place-items: center;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0.3rem;
  background: var(--surface-2);
  appearance: none;
  cursor: pointer;
}

.check-option input[type='checkbox']::after {
  width: 0.55rem;
  height: 0.3rem;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  content: '';
  opacity: 0;
  transform: translateY(-0.08rem) rotate(-45deg);
}

.check-option input[type='checkbox']:checked {
  border-color: var(--accent-strong);
  background: var(--accent);
}

.check-option input[type='checkbox']:checked::after {
  opacity: 1;
}

.check-option:hover input[type='checkbox'] {
  border-color: var(--accent-strong);
}

.check-option:has(input:checked) {
  color: var(--text);
}

.field input[type='color'] {
  width: 5.5rem;
  height: 3rem;
  padding: 0.25rem;
  cursor: pointer;
}

.field input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
}

.field input[type='color']::-webkit-color-swatch {
  border: 0;
  border-radius: 0.18rem;
}

.anchor-color-picker-host {
  position: relative;
  display: inline-flex;
  min-width: 0;
  align-items: center;
}

.anchor-color-native-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
}

.anchor-color-trigger {
  display: inline-flex;
  min-width: 9.5rem;
  min-height: var(--control-height);
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-2);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.anchor-color-trigger:hover {
  border-color: var(--accent-strong);
  background: var(--surface-3);
}

.anchor-color-trigger:active {
  transform: translateY(1px);
}

.anchor-color-trigger-swatch {
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
  border: 2px solid #fff8;
  border-radius: 0.38rem;
  box-shadow: 0 2px 6px #0005;
}

.anchor-color-trigger-value {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.76rem;
  text-overflow: ellipsis;
}

.anchor-color-trigger-circle {
  position: absolute;
  inset: 0;
  width: 2.2rem;
  min-width: 2.2rem;
  height: 2.2rem;
  min-height: 2.2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.anchor-color-trigger-circle:hover,
.anchor-color-trigger-circle:focus-visible {
  border-color: transparent;
  background: transparent;
}

.anchor-color-trigger-circle .anchor-color-trigger-swatch {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 50%;
  opacity: 0;
}

.anchor-color-trigger-circle .anchor-color-trigger-value {
  display: none;
}

.rank-color-custom.anchor-color-picker-host > svg {
  position: absolute;
  z-index: 3;
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: #f3f7fb;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px #0008);
}

.rank-color-custom.anchor-color-picker-host {
  display: grid;
  overflow: hidden;
  border: 3px solid var(--surface-1);
  background: conic-gradient(#f27886, #fbd26b, #7ae9bc, #73cbef, #b78dff, #f27886);
  box-shadow:
    0 0 0 1px #ffffff8a,
    0 8px 15px #0005;
}

.rank-color-custom.anchor-color-picker-host::before {
  position: absolute;
  inset: 0.28rem;
  display: block;
  border-radius: 50%;
  background: var(--surface-2);
  content: '';
}

.rank-color-custom.anchor-color-picker-host.is-selected {
  box-shadow:
    0 0 0 2px var(--surface-1),
    0 0 0 4px var(--accent-strong),
    0 7px 15px #0005;
}

.anchor-color-popover {
  position: fixed;
  z-index: 100;
  width: min(19rem, calc(100vw - 1rem));
  padding: 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: 0 1rem 2.6rem #0009;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top left;
  transition:
    opacity 140ms ease,
    transform 160ms var(--motion-ease);
}

.anchor-color-popover.is-open {
  opacity: 1;
  transform: none;
}

.anchor-color-popover[hidden] {
  display: none;
}

.anchor-color-popover-header,
.anchor-color-value-row,
.anchor-color-popover-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.anchor-color-popover-header {
  margin-bottom: 0.75rem;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.anchor-color-close {
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 0.35rem;
  color: var(--text-muted);
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.anchor-color-close:hover {
  color: var(--text);
  background: var(--surface-3);
}

.anchor-color-saturation {
  position: relative;
  height: 10rem;
  overflow: hidden;
  border: 1px solid #ffffff18;
  border-radius: 0.55rem;
  cursor: crosshair;
  touch-action: none;
}

.anchor-color-saturation > span {
  position: absolute;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px #000b,
    0 2px 5px #0008;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.anchor-color-slider-label {
  display: block;
  margin: 0.7rem 0 0.35rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.anchor-color-slider {
  position: relative;
  height: 0.8rem;
  border: 1px solid #ffffff1c;
  border-radius: 999px;
  cursor: pointer;
  touch-action: none;
}

.anchor-color-hue {
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

.anchor-color-alpha {
  background-image:
    linear-gradient(90deg, transparent, var(--alpha-color)),
    conic-gradient(#6e6e75 25%, #404047 0 50%, #6e6e75 0 75%, #404047 0);
  background-size:
    100% 100%,
    0.55rem 0.55rem;
}

.anchor-color-slider::after {
  position: absolute;
  top: 50%;
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow:
    0 0 0 1px #000b,
    0 2px 5px #0008;
  content: '';
  pointer-events: none;
  transform: translate(-50%, -50%);
  left: var(--hue-position, var(--alpha-position, 100%));
}

.anchor-color-value-row {
  gap: 0.65rem;
  justify-content: start;
  margin-top: 0.85rem;
  padding: 0.65rem 0;
  border-block: 1px solid var(--line);
}

.anchor-color-preview {
  position: relative;
  width: 2.4rem;
  height: 2.4rem;
  overflow: hidden;
  flex: none;
  border: 1px solid #ffffff30;
  border-radius: 0.45rem;
  background-image: conic-gradient(#6e6e75 25%, #404047 0 50%, #6e6e75 0 75%, #404047 0);
  background-size: 0.55rem 0.55rem;
  background-blend-mode: normal;
  box-shadow: inset 0 0 0 1px #0004;
}

.anchor-color-preview::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--preview-color);
  content: '';
}

.anchor-color-value-row > div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.anchor-color-value-row strong {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
}

.anchor-color-value-row small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anchor-color-format-tabs {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.8rem;
  padding: 0.2rem;
  border-radius: 0.45rem;
  background: var(--surface-3);
}

.anchor-color-format-tabs button {
  flex: 1;
  padding: 0.35rem;
  border: 0;
  border-radius: 0.3rem;
  color: var(--text-muted);
  background: transparent;
  font-size: 0.67rem;
  font-weight: 800;
  cursor: pointer;
}

.anchor-color-format-tabs button[aria-selected='true'] {
  color: var(--text);
  background: var(--surface-1);
  box-shadow: 0 1px 3px #0006;
}

.anchor-color-format-panel {
  margin-top: 0.7rem;
}

.anchor-color-format-panel[hidden] {
  display: none;
}

.anchor-color-format-panel > label,
.anchor-color-format-panel > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.anchor-color-format-panel > label {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.anchor-color-format-panel input {
  width: 100%;
  min-height: 2.25rem;
  margin-top: 0.25rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.35rem;
  color: var(--text);
  background: var(--surface-1);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.72rem;
}

.anchor-color-format-panel > label {
  display: grid;
  grid-template-columns: 1fr;
}

.anchor-color-format-panel[data-picker-panel='hex'] > label {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.anchor-color-format-panel[data-picker-panel='hex'] input {
  margin-top: 0;
}

.anchor-color-section {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.8rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.anchor-color-section > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.anchor-color-dot {
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 2px solid var(--surface-2);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #ffffff35;
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

.anchor-color-dot:hover,
.anchor-color-dot:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-strong);
  transform: scale(1.12);
}

.anchor-color-dot[aria-pressed='true'] {
  box-shadow:
    0 0 0 2px var(--surface-2),
    0 0 0 4px var(--accent-strong);
}

.anchor-color-popover-actions {
  justify-content: end;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.code-token {
  padding: 0.08rem 0.28rem;
  border: 1px solid var(--line);
  border-radius: 0.2rem;
  color: var(--text-soft);
  background: var(--surface-3);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: nowrap;
}

.form-grid,
.command-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-actions {
  flex-wrap: wrap;
  padding-top: 0.3rem;
  border-top: 1px solid var(--line);
}

.form-dirty-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: auto;
  color: var(--warning);
  font-size: 0.78rem;
  font-weight: 700;
}

.form-dirty-status[hidden] {
  display: none;
}

.form-dirty-status::before {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  content: '';
}

.revision {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.72rem;
}

.feedback {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
}

.feedback > .icon {
  width: 1rem;
  height: 1rem;
}

.feedback-success {
  border-color: #285d47;
  color: #b3efd0;
  background: #12241d;
}

.feedback-error {
  border-color: #74313a;
  color: #ffadb5;
  background: #28161a;
}

.command-list {
  display: grid;
  gap: 0.75rem;
}

.command-panel {
  margin-top: 0;
}

.command-name {
  margin: 0 0 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 780;
}

.command-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(10rem, 0.75fr);
  padding-block: 1rem;
  border-block: 1px solid var(--line);
}

.command-workflow-note {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.command-workflow-note code {
  color: var(--text-soft);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.field input:disabled {
  color: var(--text-muted);
  background: #141418;
  cursor: not-allowed;
}

.field-invalid input {
  border-color: var(--danger);
}

.field-error {
  color: #ff8792;
  font-size: 0.78rem;
}

.toggle {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.toggle-copy {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.toggle-copy small {
  color: var(--text-muted);
}

.toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.toggle-track {
  width: 2.7rem;
  height: 1.5rem;
  flex: 0 0 auto;
  padding: 0.18rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
}

.toggle-track span {
  width: 1rem;
  height: 1rem;
  display: block;
  border-radius: 50%;
  background: var(--text-muted);
  transition:
    transform 140ms ease,
    background 140ms ease;
}

.toggle-input:checked + .toggle-track {
  border-color: var(--accent);
  background: #3c1a20;
}

.toggle-input:checked + .toggle-track span {
  background: #fff;
  transform: translateX(1.15rem);
}

.toggle-input:focus-visible + .toggle-track {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.toggle.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.table-frame {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-1);
}

caption {
  padding: 0.9rem;
  color: var(--text-soft);
  text-align: left;
}

th,
td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

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

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.pagination > :last-child {
  text-align: right;
}

.pagination [aria-disabled='true'] {
  opacity: 0.45;
}

.tabs {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.tab {
  flex: 0 0 auto;
  padding: 0.75rem 0.1rem;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.tab:hover,
.tab.is-active {
  color: var(--text);
}

.tab.is-active {
  border-bottom-color: var(--accent);
}

.modal {
  width: min(30rem, calc(100% - 2rem));
  padding: 1.3rem;
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface-1);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgb(0 0 0 / 72%);
}

.modal-header {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
}

.modal-header form,
.modal-actions form {
  margin: 0;
}

.modal-header .eyebrow {
  margin-bottom: 0.35rem;
}

.icon-button {
  width: 2rem;
  height: 2rem;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-description {
  margin: 1rem 0 1.5rem;
  line-height: 1.6;
}

.modal-actions {
  justify-content: flex-end;
}

.centered-page {
  min-height: calc(100vh - 4.5rem);
  display: grid;
  place-items: center;
  padding-block: 3rem;
}

.centered-page .state {
  width: min(42rem, 100%);
  margin: 0;
}

.centered-page > .modal[open] {
  position: static;
  margin: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes home-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ambient-drift {
  from {
    transform: translate3d(-2%, -1%, 0);
  }

  to {
    transform: translate3d(2%, 1%, 0);
  }
}

@keyframes art-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.automod-headline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.2rem;
  margin: 1.8rem 0 1rem;
}

.automod-headline h2 {
  margin: 0.55rem 0 0.2rem;
  font-size: 1.55rem;
}
.automod-headline p,
.automod-rule-copy p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}
.automod-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.automod-status > span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}
.automod-status.is-active {
  color: var(--success);
}
.automod-migration-note {
  display: flex;
  gap: 0.65rem;
  max-width: 70rem;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: var(--surface-2);
  font-size: 0.82rem;
}
.automod-migration-note p {
  margin: 0;
}
.automod-migration-note .icon {
  flex: none;
  width: 1rem;
  height: 1rem;
  color: var(--accent);
}
.automod-rule-list {
  display: grid;
  gap: 0.8rem;
  max-width: 70rem;
}
.automod-rule-card,
.automod-create,
.automod-global,
.automod-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}
.automod-rule-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1.15rem;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}
.automod-rule-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 28px #0002;
  transform: translateY(-2px);
}
.automod-rule-main {
  display: flex;
  align-items: start;
  gap: 0.9rem;
  min-width: 0;
}
.automod-rule-mark,
.automod-empty-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.75rem;
  color: var(--accent-strong);
  background: var(--accent-subtle, #4b2028);
}
.automod-rule-mark .icon,
.automod-empty-icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}
.automod-rule-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}
.automod-rule-title h3 {
  margin: 0;
  font-size: 1rem;
}
.automod-rule-copy p {
  margin-top: 0.3rem;
  font-size: 0.82rem;
}
.automod-rule-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.automod-rule-tags span {
  padding: 0.24rem 0.48rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  color: var(--text-soft);
  background: var(--surface-2);
  font-size: 0.7rem;
  font-weight: 700;
}
.automod-rule-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: end;
  gap: 0.4rem;
}
.automod-rule-actions form {
  margin: 0;
}
.automod-rule-actions .automod-delete {
  position: relative;
}
.automod-delete > summary {
  padding: 0.58rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.automod-delete > summary::-webkit-details-marker {
  display: none;
}
.automod-delete[open] {
  z-index: 5;
}
.automod-delete[open] > p,
.automod-delete[open] > form {
  position: absolute;
  right: 0;
  z-index: 5;
  width: 14rem;
  margin: 0;
  padding: 0.7rem;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  box-shadow: 0 14px 30px #0008;
}
.automod-delete[open] > p {
  top: 2.35rem;
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 0.8rem;
}
.automod-delete[open] > form {
  top: 5.6rem;
  border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.automod-rule-editor {
  max-width: 70rem;
  margin-top: 1rem;
  padding: 1.2rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  scroll-margin-top: calc(var(--nav-height) + 1rem);
}
.automod-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.automod-editor-heading h2 {
  margin: 0.2rem 0 0;
  font-size: 1.2rem;
}
.automod-create,
.automod-global {
  max-width: 70rem;
  margin-top: 1rem;
  padding: 1.1rem;
}
.automod-create {
  border-color: var(--accent);
  background: linear-gradient(135deg, #431f27 0, var(--surface-1) 35%);
}
.automod-create > summary,
.automod-global > summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.automod-create > summary::-webkit-details-marker,
.automod-global > summary::-webkit-details-marker {
  display: none;
}
.automod-create > summary .icon {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--accent-strong);
}
.automod-create > summary span,
.automod-global > summary span {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}
.automod-empty {
  display: grid;
  justify-items: start;
  gap: 0.65rem;
  padding: 2rem;
  border-style: dashed;
}
.automod-empty h3,
.automod-empty p {
  margin: 0;
}
.automod-empty p {
  max-width: 31rem;
  color: var(--text-soft);
}
.automod-rule-form {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.automod-form-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.automod-form-intro h3 {
  margin: 0.25rem 0 0;
}
.automod-step {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
}
.automod-type-description,
.automod-rule-note {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-soft);
  background: var(--surface-2);
  font-size: 0.82rem;
}
.automod-custom-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.automod-custom-settings > .field:first-child,
.automod-custom-settings > .automod-rule-note {
  grid-column: 1 / -1;
}
.automod-custom-settings > [hidden],
.automod-rule-form > [hidden] {
  display: none !important;
}
.automod-rule-form input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}
.automod-duration-label {
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 700;
}
.automod-duration-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.65rem;
}
.automod-duration-controls > * {
  min-width: 0;
}
.automod-action-error {
  color: var(--danger);
}
.automod-permissions {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.automod-permissions > summary {
  display: flex;
  gap: 0.5rem;
  font-weight: 750;
  cursor: pointer;
}
.automod-permissions > summary span {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.automod-permissions > .field-description {
  margin: 0.7rem 0;
}
.automod-global > .field-description {
  margin: 1rem 0;
}
.automod-global form {
  display: grid;
  gap: 1rem;
}

@media (max-width: 52rem) {
  .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wiki-layout,
  .status-detail {
    grid-template-columns: 1fr;
  }

  .wiki-toc {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wiki-toc .eyebrow {
    grid-column: 1 / -1;
  }

  .home-hero,
  .home-workflow {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: 0;
  }

  .home-capabilities {
    grid-template-columns: 1fr;
  }

  .home-capability + .home-capability {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

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

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

  .sidebar {
    position: sticky;
    z-index: 10;
    top: var(--nav-height);
    height: auto;
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    padding: 0.55rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-server,
  .sidebar-note {
    display: none;
  }

  .sidebar-mobile-trigger {
    display: flex;
    min-height: 2.7rem;
    gap: 0.65rem;
    align-items: center;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }

  .sidebar-mobile-trigger::-webkit-details-marker {
    display: none;
  }

  .sidebar-mobile-trigger > .icon:last-child {
    width: 0.8rem;
    height: 0.8rem;
    margin-left: auto;
    transition: transform var(--transition);
  }

  .sidebar-navigation[open] .sidebar-mobile-trigger > .icon:last-child {
    transform: rotate(180deg);
  }

  .sidebar-navigation nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    padding: 0.8rem 0 0.6rem;
    border-top: 1px solid var(--line);
  }

  .sidebar-link {
    min-height: 2.5rem;
  }

  .heading-row {
    align-items: start;
    flex-direction: column;
  }

  .search-bar {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .search-bar input {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .command-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 36rem) {
  .automod-headline {
    align-items: stretch;
    flex-direction: column;
  }
  .automod-editor-heading {
    align-items: start;
    flex-direction: column;
  }
  .automod-module-toggle .button {
    width: 100%;
  }
  .automod-rule-card {
    grid-template-columns: 1fr;
  }
  .automod-rule-actions {
    justify-content: start;
  }
  .automod-custom-settings {
    grid-template-columns: 1fr;
  }
  .navbar {
    align-items: center;
  }

  .public-header > .navbar {
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    padding-block: 0.5rem;
  }

  .account-copy {
    display: none;
  }

  .public-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: clamp(0.8rem, 5vw, 1.5rem);
    border-top: 1px solid var(--line);
  }

  .public-nav a {
    font-size: 0.78rem;
  }

  .premium-trigger {
    padding-inline: 0.55rem;
  }

  .navbar-context {
    display: none;
  }

  .home-section,
  .home-workflow,
  .home-final,
  .home-capability {
    scroll-margin-top: 7.5rem;
  }

  .home-hero {
    padding-block: 3.5rem;
  }

  .home-final {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-final-art {
    align-self: center;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .status-grid,
  .wiki-feature-grid {
    grid-template-columns: 1fr;
  }

  .wiki-command-list > div {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .home-final .button {
    flex: 0 1 auto;
  }

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

  .overview-status > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  h1 {
    font-size: clamp(2.6rem, 11vw, 3.6rem);
  }

  .dashboard-main {
    padding: 1.25rem 1rem 2rem;
  }

  .card-with-leading {
    grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  }

  .card-with-leading .card-body {
    grid-column: 2;
  }

  .card-with-leading .badge {
    grid-column: 2;
    justify-self: start;
  }

  .card-with-leading .card-action {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .card-with-leading .card-arrow {
    display: none;
  }

  .card-image,
  .card-mark {
    width: 2.6rem;
    height: 2.6rem;
  }

  .sidebar-navigation nav {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-actions form,
  .modal-actions .button {
    width: 100%;
  }

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

  .form-grid,
  .search-bar {
    grid-template-columns: 1fr;
  }

  .search-bar input {
    grid-column: auto;
    grid-row: auto;
  }

  .search-bar .button {
    width: 100%;
  }

  .feedback,
  .form-actions,
  .section-heading,
  .command-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination > :nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }
}

@media (max-width: 28rem) {
  .footer-top,
  .wiki-toc {
    grid-template-columns: 1fr;
  }

  .public-header .navbar-actions {
    order: 2;
    width: 100%;
    justify-content: space-between;
  }

  .home-section,
  .home-workflow,
  .home-final,
  .home-capability {
    scroll-margin-top: 10rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-section.is-reveal-pending,
  .home-workflow.is-reveal-pending,
  .home-final.is-reveal-pending {
    opacity: 1;
    transform: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
