:root {
  color-scheme: dark;
  --bg: #09090b;
  --bg-raised: #0e0e11;
  --surface: rgba(20, 20, 24, 0.94);
  --surface-solid: #141418;
  --surface-soft: #1a1a20;
  --surface-hover: #222229;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);
  --text: #f7f7f8;
  --text-soft: #c5c5cb;
  --text-muted: #8d8d98;
  --green: #d5b8ff;
  --green-bright: #eee3ff;
  --green-dark: #332845;
  --green-ink: #17101f;
  --amber: #f5be65;
  --red: #ff7d86;
  --blue: #75b8ff;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.3);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --content-width: 1480px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.team-workspace { margin: 28px 0; }
.comanager-overview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; padding: 24px 24px 0; }
.comanager-overview article { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-solid); }
.comanager-overview strong { display: block; font-size: 1.8rem; letter-spacing: -0.04em; }
.comanager-overview span { color: var(--text-muted); font-size: 0.8rem; }
.comanager-panel .delivery-setting { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; background: var(--bg-raised); }
.comanager-panel .mapping-row { border-radius: var(--radius-md); margin: 10px 16px; border: 1px solid var(--border); background: var(--bg-raised); transition: border-color 150ms ease; }
.comanager-panel .mapping-row:hover { border-color: var(--border-strong); }
.comanager-panel .mapping-row.has-error { border-color: var(--amber); }
.comanager-panel .mapping-row.is-disabled { opacity: 0.8; }
.comanager-panel .workspace-toolbar { gap: 20px; }
@media (max-width: 650px) { .comanager-overview { gap: 8px; padding: 16px 14px 0; } .comanager-overview article { padding: 12px; } .comanager-overview strong { font-size: 1.4rem; } .comanager-panel .delivery-setting { padding: 18px; } }
.team-section-nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 24px 24px; }
.team-section-nav a { padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); text-decoration: none; font-size: 0.85rem; }
.team-section-nav a:hover,.team-section-nav a:focus-visible { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }
.team-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.team-card-actions .button-quiet { color: var(--red); }
.team-overview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 0 24px 24px; }
.team-overview article { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-solid); }
.team-overview strong { display: block; font-size: 1.7rem; letter-spacing: -0.04em; }
.team-overview span { color: var(--text-muted); font-size: 0.8rem; }
.team-workspace .team-directory-card { transition: border-color 150ms ease; }
.team-workspace .team-directory-card:hover { border-color: var(--border-strong); }
.team-workspace .team-directory-card .team-card-actions .button { font-size: 0.8rem; min-height: 38px; padding: 9px 12px; }
.team-workspace .team-badge[data-paused="true"] { color: var(--amber); }
.team-workspace #team-league-form[data-editing="true"] { border-color: var(--blue); }
@media (max-width: 550px) { .team-overview { gap: 8px; margin-left: 14px; margin-right: 14px; } .team-overview article { padding: 14px 10px; } .team-overview strong { font-size: 1.4rem; } }
.team-workspace form,.team-workspace section,.team-workspace h3 { scroll-margin-top: 28px; }
.team-workspace .team-config-grid { align-items: start; }
.team-workspace #team-review-queue { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
@media (max-width: 850px) { .team-workspace #team-review-queue { grid-template-columns: 1fr; } }
.team-workspace .workspace-toolbar { align-items: flex-start; gap: 16px; }
.team-workspace .workspace-toolbar p { max-width: 650px; margin-bottom: 0; }
.team-status { padding: 14px 18px; margin: 0 24px 22px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--text-soft); line-height: 1.6; }
.team-status[data-error="true"], .team-warning { color: var(--red); }
.team-config-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; padding: 0 24px; }
.team-config-card { min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-raised); }
.team-config-card h3 { margin-top: 0; }
.team-config-card .muted { line-height: 1.65; }
.team-config-card input:not([type="checkbox"]), .team-config-card select { width: 100%; min-width: 0; min-height: 44px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-solid); color: var(--text); font: inherit; }
.team-config-card fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.team-config-card fieldset:disabled { opacity: 0.55; }
.team-workspace > .team-config-card { margin: 0 24px 20px; }
.team-workspace details summary { cursor: pointer; font-weight: 600; color: var(--text-soft); }
.team-workspace details[open] summary { margin-bottom: 18px; }
.team-league-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 32px; margin-top: 24px; }
.team-config-card .team-form-section { padding-top: 16px; border-top: 1px solid var(--border); }
.team-form-section legend { padding: 0 10px 0 0; color: var(--text-soft); font-size: 0.85rem; font-weight: 600; }
.team-config-card input:focus-visible, .team-config-card select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.team-config-card .field-label { display: block; margin: 0 0 8px; }
.team-section-title { margin: 28px 0 14px; padding-top: 24px; border-top: 1px solid var(--border); }
.team-league-directory { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.team-league-directory .team-directory-card { background: var(--surface-solid); }
.team-league-directory h4 { margin: 0 0 10px; }
.team-league-directory p { overflow-wrap: anywhere; font-size: 0.85rem; line-height: 1.6; }
@media (max-width: 850px) { .team-league-layout,.team-league-directory { grid-template-columns: 1fr; } .team-league-layout { gap: 20px; } }
@media (max-width: 550px) { .team-workspace > .team-config-card { margin-left: 14px; margin-right: 14px; } }
.team-check { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; line-height: 1.6; color: var(--text-soft); font-size: 0.85rem; }
.team-check input { margin-top: 6px; flex-shrink: 0; }
.team-preview { margin: 24px; padding: 24px; border: 1px solid var(--green); border-radius: var(--radius-md); background: var(--bg-raised); }
.team-preview ul { padding-left: 22px; line-height: 1.9; color: var(--text-soft); }
.team-directory-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px 24px 12px; }
.team-directory-heading input { max-width: 260px; }
.team-directory { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; padding: 0 24px 20px; }
.team-directory-card { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; }
.team-card-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.team-card-header h4 { margin: 0; overflow-wrap: anywhere; }
.team-badge { font-size: 0.72rem; color: var(--green); border: 1px solid var(--border-strong); padding: 5px 8px; border-radius: 999px; white-space: nowrap; }
.team-resource-list { display: grid; grid-template-columns: minmax(95px,0.8fr) minmax(0,1fr); gap: 10px; font-size: 0.8rem; }
.team-resource-list dt { color: var(--text-muted); }
.team-resource-list dd { margin: 0; overflow-wrap: anywhere; }
.team-workspace > .field-hint { padding: 0 24px 20px; line-height: 1.7; }
@media (max-width: 850px) { .team-config-grid,.team-directory { grid-template-columns: 1fr; } }
@media (max-width: 550px) { .team-config-grid { padding: 0 14px; } .team-config-card { padding: 16px; } .team-directory-heading { flex-direction: column; align-items: stretch; } .team-directory-heading input { max-width: none; } .team-card-header { flex-wrap: wrap; } }

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(174, 123, 255, 0.12), transparent 34%),
    radial-gradient(circle at 95% 10%, rgba(255, 255, 255, 0.035), transparent 28%),
    linear-gradient(180deg, #0d0d10 0%, var(--bg) 62%, #070708 100%);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline-color: rgba(189, 168, 255, 0.45);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
}

button,
input,
select {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(81, 227, 155, 0.38);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: var(--green-ink);
  background: var(--green-bright);
  border-radius: var(--radius-sm);
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

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

.ambient {
  position: fixed;
  z-index: -1;
  width: 42rem;
  height: 42rem;
  border-radius: 999px;
  filter: blur(120px);
  opacity: 0.11;
  pointer-events: none;
}

.ambient-one {
  top: -24rem;
  right: -10rem;
  background: #ae7bff;
}

.ambient-two {
  bottom: -28rem;
  left: -18rem;
  background: #7355a5;
}

.app-shell {
  min-height: 100vh;
}

.panel {
  background: linear-gradient(145deg, rgba(24, 24, 29, 0.96), rgba(14, 14, 18, 0.96));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.center-stage {
  display: grid;
  min-height: 100vh;
  padding: 32px;
  place-items: center;
}

.loading-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 22px;
  width: min(520px, 100%);
  padding: 30px;
  border-radius: var(--radius-xl);
}

.loading-card h1 {
  margin: 2px 0 5px;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  letter-spacing: -0.035em;
}

.loading-card p {
  margin: 0;
}

.loading-bar {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.loading-bar span {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  animation: loading 1.15s ease-in-out infinite;
}

@keyframes loading {
  0% { transform: translateX(-115%); }
  100% { transform: translateX(365%); }
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  color: #062116;
  background: linear-gradient(145deg, var(--green-bright), #36ca82);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(174, 123, 255, 0.16);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  place-items: center;
}

.brand-mark-large {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  font-size: 0.85rem;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.brand-name {
  margin: 3px 0 0;
  font-size: 0.98rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

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

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  width: min(1010px, 100%);
  min-height: 610px;
  overflow: hidden;
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.login-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(32px, 5vw, 58px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(7, 21, 16, 0.56), rgba(6, 17, 13, 0.92)),
    repeating-linear-gradient(135deg, transparent 0 28px, rgba(82, 227, 155, 0.025) 28px 29px);
}

.login-intro::after {
  content: "";
  position: absolute;
  right: -210px;
  bottom: -240px;
  width: 500px;
  height: 500px;
  border: 1px solid rgba(81, 227, 155, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(81, 227, 155, 0.025),
    0 0 0 104px rgba(81, 227, 155, 0.018);
}

.login-copy {
  z-index: 1;
  max-width: 520px;
  margin: auto 0;
  padding: 70px 0 54px;
}

.secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  color: var(--green-bright);
  background: rgba(81, 227, 155, 0.08);
  border: 1px solid rgba(81, 227, 155, 0.14);
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
}

.secure-pill span {
  font-size: 0.55rem;
}

.login-copy h1 {
  max-width: 480px;
  margin: 22px 0 15px;
  font-size: clamp(2.3rem, 5.2vw, 4.25rem);
  letter-spacing: -0.065em;
  line-height: 0.99;
}

.login-copy p {
  max-width: 470px;
  margin: 0;
  color: var(--text-soft);
  font-size: 1.04rem;
}

.feature-list {
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin: 0;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.feature-list span {
  color: var(--green);
  font-weight: 800;
}

.login-form-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 6vw, 70px);
  background: rgba(17, 31, 27, 0.76);
  border-left: 1px solid var(--border);
}

.password-field:focus-within {
  border-color: rgba(189, 168, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(189, 168, 255, 0.08);
}

.form-heading h2 {
  margin: 11px 0 8px;
  font-size: clamp(1.55rem, 3vw, 2rem);
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.form-heading .muted {
  margin: 0 0 33px;
  font-size: 0.88rem;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 0.79rem;
  font-weight: 720;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  height: 52px;
  padding: 0 53px 0 15px;
  background: #0b1713;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.password-field input:focus {
  border-color: rgba(81, 227, 155, 0.62);
  box-shadow: 0 0 0 4px rgba(81, 227, 155, 0.08);
}

.password-field input[aria-invalid="true"] {
  border-color: rgba(255, 125, 134, 0.72);
}

.icon-button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.eye-icon,
.eye-icon::after {
  position: absolute;
  inset: 0;
  margin: auto;
}

.eye-icon {
  width: 19px;
  height: 12px;
  border: 1.7px solid currentColor;
  border-radius: 50% 50% 48% 48%;
}

.eye-icon::after {
  content: "";
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
}

.icon-button[aria-pressed="true"] .eye-icon::before {
  content: "";
  position: absolute;
  top: 5px;
  left: -3px;
  width: 25px;
  height: 1.7px;
  background: currentColor;
  transform: rotate(-42deg);
}

.field-hint,
.form-message {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 0.78rem;
}

.field-hint {
  color: var(--amber);
}

.form-message {
  color: var(--red);
}

.button {
  display: inline-flex;
  min-height: 41px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease, opacity 150ms ease;
}

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

.button-primary {
  color: var(--green-ink);
  background: linear-gradient(135deg, #f4edff, #cba7ff);
  border-color: rgba(238, 227, 255, 0.55);
  box-shadow: 0 8px 24px rgba(174, 123, 255, 0.15);
}

.button-primary:not(:disabled):hover {
  background: linear-gradient(135deg, #ffffff, #dcc2ff);
}

.button-primary:disabled {
  opacity: 0.38;
}

.button-wide {
  width: 100%;
  min-height: 49px;
  margin-top: 22px;
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong);
}

.button-secondary:hover {
  background: var(--surface-hover);
  border-color: rgba(213, 184, 255, 0.3);
}

.button-quiet {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--border);
}

.button-quiet:not(:disabled):hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
}

.button-quiet:disabled {
  opacity: 0.35;
}

.button-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(5, 34, 23, 0.28);
  border-top-color: var(--green-ink);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.is-loading .button-label {
  opacity: 0.74;
}

.is-loading .button-spinner {
  display: inline-block;
}

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

.dashboard {
  min-height: 100vh;
  padding-bottom: 120px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px max(24px, calc((100vw - var(--content-width)) / 2));
  background: rgba(9, 9, 11, 0.84);
  border-width: 0 0 1px;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 680;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(81, 227, 155, 0.09);
}

.connection-state[data-state="offline"] .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 125, 134, 0.09);
}

.connection-state[data-state="syncing"] .status-dot {
  background: var(--amber);
  animation: pulse 1.25s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.4; }
}

.content-wrap {
  width: min(var(--content-width), calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 52px 2px 26px;
}

.hero h1 {
  margin: 8px 0 6px;
  font-size: clamp(2rem, 4.5vw, 3.45rem);
  letter-spacing: -0.06em;
  line-height: 1.03;
}

.hero-copy {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.server-connect {
  min-width: min(100%, 390px);
}

.server-connect > label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.server-connect > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.server-connect select {
  grid-column: 1 / -1;
  width: 100%;
  height: 41px;
  padding: 0 12px;
}

.server-connect input {
  width: 100%;
  height: 41px;
  padding: 0 13px;
  background: #101014;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: 0;
}

.refresh-icon {
  font-size: 1.05rem;
}

.is-spinning .refresh-icon {
  animation: spin 700ms linear infinite;
}

.notice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 13px;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: rgba(117, 184, 255, 0.07);
  border: 1px solid rgba(117, 184, 255, 0.19);
  border-radius: var(--radius-md);
}

.notice[data-kind="success"] {
  background: rgba(81, 227, 155, 0.07);
  border-color: rgba(81, 227, 155, 0.2);
}

.notice[data-kind="error"] {
  background: rgba(255, 125, 134, 0.07);
  border-color: rgba(255, 125, 134, 0.22);
}

.notice[data-kind="warning"] {
  background: rgba(245, 190, 101, 0.07);
  border-color: rgba(245, 190, 101, 0.22);
}

.notice-icon {
  display: grid;
  width: 24px;
  height: 24px;
  color: var(--blue);
  background: rgba(117, 184, 255, 0.12);
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 850;
  place-items: center;
}

.notice[data-kind="success"] .notice-icon {
  color: var(--green);
  background: rgba(81, 227, 155, 0.12);
}

.notice[data-kind="error"] .notice-icon {
  color: var(--red);
  background: rgba(255, 125, 134, 0.12);
}

.notice[data-kind="warning"] .notice-icon {
  color: var(--amber);
  background: rgba(245, 190, 101, 0.12);
}

.notice strong,
.notice p {
  margin: 0;
}

.notice p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.79rem;
}

.notice-dismiss {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 1.25rem;
  line-height: 1;
}

.notice-dismiss:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 0 0 18px;
  padding: 18px 20px;
  background: linear-gradient(120deg, rgba(81, 227, 155, 0.1), rgba(117, 184, 255, 0.055));
  border-color: rgba(81, 227, 155, 0.25);
}

.demo-banner[hidden] {
  display: none;
}

.demo-banner strong,
.demo-banner p {
  margin: 0;
}

.demo-banner > div > p:last-child {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.demo-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(145px, 0.65fr)) minmax(300px, 1.35fr);
  gap: 12px;
  margin-bottom: 17px;
}

.metric-card {
  min-width: 0;
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.metric-card > p,
.metric-card > div > p {
  margin: 0 0 7px;
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 690;
}

.metric-card > strong,
.metric-card > div > strong {
  display: block;
  margin: 0 0 2px;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric-card > span,
.metric-card > div > span {
  color: var(--text-muted);
  font-size: 0.7rem;
}

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

.guild-chip {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.guild-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  overflow: hidden;
  color: var(--green-ink);
  background: var(--green);
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 900;
  place-items: center;
}

.guild-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guild-chip > span:last-child {
  min-width: 0;
}

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

.guild-chip strong {
  max-width: 175px;
  font-size: 0.77rem;
}

.guild-chip small {
  max-width: 175px;
  color: var(--text-muted);
  font-size: 0.65rem;
}

.workspace {
  overflow: hidden;
  border-radius: var(--radius-xl);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 21px 22px;
  border-bottom: 1px solid var(--border);
}

.workspace-toolbar h2 {
  margin: 5px 0 0;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.role-source-note {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}

.search-field,
.filter-field {
  position: relative;
  display: block;
}

.search-field input,
.filter-field select {
  height: 40px;
  background: #101014;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
}

.search-field input {
  width: 205px;
  padding: 0 13px 0 38px;
}

.filter-field select {
  min-width: 142px;
  padding: 0 33px 0 12px;
}

.search-field input::placeholder,
.role-search input::placeholder {
  color: #696974;
}

.search-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  width: 13px;
  height: 13px;
  border: 1.7px solid var(--text-muted);
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(-58%);
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 6px;
  height: 1.5px;
  background: var(--text-muted);
  border-radius: 2px;
  transform: rotate(45deg);
}

.mapping-head,
.mapping-row {
  display: grid;
  grid-template-columns: minmax(155px, 0.82fr) minmax(245px, 1fr) 35px minmax(245px, 1fr) 92px;
  column-gap: 13px;
}

.delete-row-button {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--text-muted);
  background: rgba(255, 125, 134, 0.06);
  border: 1px solid rgba(255, 125, 134, 0.13);
  border-radius: 7px;
  font-size: 1rem;
  line-height: 1;
  place-items: center;
}

.delete-row-button:hover {
  color: var(--red);
  background: rgba(255, 125, 134, 0.12);
}

.delete-row-button[hidden] {
  display: none;
}

.mapping-head {
  align-items: center;
  min-height: 42px;
  padding: 0 22px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.018);
  border-bottom: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mapping-row {
  position: relative;
  align-items: center;
  padding: 17px 22px;
  border-bottom: 1px solid var(--border);
  transition: background-color 140ms ease, opacity 140ms ease;
}

.mapping-row:last-child {
  border-bottom: 0;
}

.mapping-row:hover {
  background: rgba(213, 184, 255, 0.025);
}

.mapping-row.is-disabled .role-search-input,
.mapping-row.is-disabled .role-meta,
.mapping-row.is-disabled .mapping-arrow {
  opacity: 0.82;
}

.mapping-row.has-error {
  background: rgba(255, 125, 134, 0.025);
}

.mapping-row.is-hidden {
  display: none;
}

.activity-row {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  color: var(--text-muted, #aeb8b4);
  font-size: 0.9rem;
}

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

.league-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.league-badge {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  color: var(--green-bright);
  background: linear-gradient(145deg, rgba(81, 227, 155, 0.13), rgba(81, 227, 155, 0.045));
  border: 1px solid rgba(81, 227, 155, 0.13);
  border-radius: 11px;
  font-size: 0.69rem;
  font-weight: 850;
  place-items: center;
}

.league-name {
  margin: 0;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 760;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-key {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-cell {
  min-width: 0;
}

.role-picker {
  min-width: 0;
}

.role-search,
.role-select-wrap {
  position: relative;
  display: block;
}

.role-search {
  margin-bottom: 6px;
}

.role-search input,
.role-select {
  width: 100%;
  height: 35px;
  background: #0a1512;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: 0;
  font-size: 0.74rem;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.role-search input {
  padding: 0 11px 0 34px;
}

.role-search .search-icon {
  left: 12px;
  width: 11px;
  height: 11px;
}

.role-select {
  appearance: none;
  padding: 0 33px 0 11px;
  text-overflow: ellipsis;
}

.role-search input:focus,
.role-select:focus,
.search-field input:focus,
.filter-field select:focus {
  border-color: rgba(81, 227, 155, 0.5);
  box-shadow: 0 0 0 3px rgba(81, 227, 155, 0.06);
}

.role-select[aria-invalid="true"] {
  border-color: rgba(255, 125, 134, 0.58);
}

.select-chevron {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.role-current {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 5px 2px 0;
  color: var(--text-muted);
  font-size: 0.64rem;
}

.role-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: var(--role-color, #73837c);
  border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--role-color, #73837c) 18%, transparent);
}

.role-current-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-meta {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.role-meta.is-warning {
  color: var(--amber);
}

.role-meta.is-error {
  color: var(--red);
}

.mapping-arrow {
  display: grid;
  width: 27px;
  height: 27px;
  color: var(--green);
  background: rgba(81, 227, 155, 0.075);
  border: 1px solid rgba(81, 227, 155, 0.11);
  border-radius: 999px;
  font-size: 0.75rem;
  place-items: center;
}

/* Final compact layout. */
:root { --content-width: 1040px; }

.content-wrap { padding-top: 22px; }

.hero {
  grid-template-columns: minmax(180px, 0.55fr) minmax(390px, 1.45fr) auto;
  gap: 18px;
  padding: 6px 0 20px;
}

.hero h1 {
  margin: 0 0 5px;
  font-size: 1.65rem;
  letter-spacing: -0.035em;
}

.hero-copy { font-size: 0.82rem; }

.workspace { margin-top: 14px; }

.workspace-toolbar {
  padding: 15px 16px;
  margin-bottom: 0;
}

.workspace-toolbar h2 {
  margin: 0;
  font-size: 1.1rem;
}

.toolbar-controls { gap: 7px; }

.toolbar-controls .button,
.search-field input,
.filter-field select { height: 38px; min-height: 38px; }

.empty-state { padding: 42px 20px 46px; }
.empty-state > div { display: none; }
.empty-state h3 { font-size: 0.9rem; }
.empty-state p { margin-bottom: 0; font-size: 0.75rem; }

.save-bar {
  padding: 9px 18px;
  background: rgba(10, 11, 14, 0.94);
}

.save-status-icon { width: 25px; height: 25px; }
.save-status small { display: none; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
}

.enabled-cell {
  display: flex;
  justify-content: flex-end;
}

.switch {
  display: grid;
  justify-items: center;
  gap: 5px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  display: block;
  width: 39px;
  height: 22px;
  background: #24332e;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.switch-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #899b94;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  transition: background-color 150ms ease, transform 150ms ease;
}

.switch input:checked + .switch-track {
  background: rgba(81, 227, 155, 0.24);
  border-color: rgba(81, 227, 155, 0.32);
}

.switch input:checked + .switch-track span {
  background: var(--green);
  transform: translateX(17px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(81, 227, 155, 0.32);
  outline-offset: 2px;
}

.switch input:disabled + .switch-track {
  opacity: 0.42;
  cursor: not-allowed;
}

.switch-label {
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 690;
}

.switch input:checked ~ .switch-label {
  color: var(--green);
}

.row-error {
  display: none;
  grid-column: 2 / 5;
  margin: 7px 0 0;
  color: var(--red);
  font-size: 0.67rem;
}

.mapping-row.has-error .row-error {
  display: block;
}

.empty-state {
  padding: 65px 24px 72px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state > div {
  margin-bottom: 13px;
  color: var(--green);
  font-size: 2rem;
}

.empty-state h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1rem;
}

.empty-state p {
  margin: 0 0 18px;
  font-size: 0.8rem;
}

.save-bar {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 12px 24px;
  background: rgba(6, 15, 12, 0.9);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.save-bar[data-state="dirty"] {
  background: rgba(23, 29, 16, 0.93);
  border-color: rgba(245, 190, 101, 0.22);
}

.save-bar[data-state="error"] {
  background: rgba(31, 15, 17, 0.94);
  border-color: rgba(255, 125, 134, 0.25);
}

.save-inner {
  display: flex;
  width: min(var(--content-width), 100%);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
}

.save-status {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.save-status-icon {
  display: grid;
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  color: var(--green);
  background: rgba(81, 227, 155, 0.1);
  border-radius: 9px;
  font-size: 0.76rem;
  font-weight: 900;
  place-items: center;
}

.save-bar[data-state="dirty"] .save-status-icon {
  color: var(--amber);
  background: rgba(245, 190, 101, 0.1);
}

.save-bar[data-state="error"] .save-status-icon {
  color: var(--red);
  background: rgba(255, 125, 134, 0.1);
}

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

.save-status strong {
  font-size: 0.77rem;
}

.save-status small {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 0.67rem;
}

.save-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

@media (max-width: 1180px) {
  .overview-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric-wide {
    grid-column: 1 / -1;
  }

  .mapping-head {
    display: none;
  }

  .mapping-row {
    grid-template-columns: 1fr 35px 1fr 80px;
    padding-top: 20px;
  }

  .league-cell {
    grid-column: 1 / -1;
    margin-bottom: 15px;
  }

  .manager-cell {
    grid-column: 1;
  }

  .comanager-cell {
    grid-column: 3;
  }

  .enabled-cell {
    grid-column: 4;
  }

  .role-cell::before {
    display: block;
    margin: 0 0 6px 2px;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 760;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }

  .manager-cell::before {
    content: "Manager role";
  }

  .comanager-cell::before {
    content: "Co-Manager role";
  }

  .mapping-arrow {
    grid-column: 2;
    align-self: center;
    margin-top: 26px;
  }

  .row-error {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .center-stage {
    padding: 16px;
  }

  .login-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .login-intro {
    padding: 30px;
  }

  .login-copy {
    padding: 48px 0 38px;
  }

  .login-copy h1 {
    max-width: 550px;
    font-size: clamp(2.35rem, 10vw, 4rem);
  }

  .login-form-wrap {
    padding: 38px 30px 42px;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .topbar {
    padding: 11px 16px;
  }

  .connection-state {
    display: none;
  }

  .content-wrap {
    width: min(100% - 28px, var(--content-width));
  }

  .hero {
    align-items: start;
    padding-top: 38px;
  }

  .overview-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric-card {
    padding: 15px;
  }

  .metric-wide {
    grid-column: 1 / -1;
  }

  .workspace-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .toolbar-controls .search-field {
    grid-column: 1 / -1;
  }

  .search-field input,
  .filter-field select {
    width: 100%;
  }
}

@media (max-width: 650px) {
  .dashboard {
    padding-bottom: 145px;
  }

  .brand-line .eyebrow {
    display: none;
  }

  .topbar .brand-mark {
    width: 37px;
    height: 37px;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
    gap: 19px;
  }

  .hero .button {
    align-self: flex-start;
  }

  .overview-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric-card {
    text-align: center;
  }

  .metric-card > strong {
    font-size: 1.45rem;
  }

  .metric-card > span {
    display: none;
  }

  .metric-wide {
    align-items: flex-start;
    text-align: left;
  }

  .workspace-toolbar {
    padding: 18px 16px;
  }

  .mapping-row {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 19px 16px;
  }

  .league-cell,
  .manager-cell,
  .comanager-cell,
  .enabled-cell,
  .row-error {
    grid-column: 1;
  }

  .league-cell {
    margin-bottom: 16px;
  }

  .comanager-cell {
    margin-top: 13px;
  }

  .mapping-arrow {
    display: none;
  }

  .enabled-cell {
    justify-content: flex-start;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid var(--border);
  }

  .switch {
    grid-template-columns: auto auto;
    align-items: center;
  }

  .save-bar {
    padding: 10px 14px;
  }

  .save-inner {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .save-status {
    min-height: 30px;
  }

  .save-actions {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
  }
}

.delivery-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
  padding: 13px 15px;
  background: rgba(18, 19, 25, 0.72);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.delivery-setting strong,
.delivery-setting span { display: block; }
.delivery-setting strong { font-size: 0.78rem; }
.delivery-setting span { margin-top: 3px; color: var(--text-muted); font-size: 0.68rem; }

.delivery-setting select {
  width: min(320px, 46%);
  height: 38px;
  padding: 0 34px 0 11px;
  color: var(--text);
  background: #0d0e13;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
}

.mapping-row { padding-left: 50px; }

.drag-handle {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 27px;
  height: 42px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: grab;
  font-size: 1rem;
  letter-spacing: -5px;
  transform: translateY(-50%);
  touch-action: none;
}

.drag-handle:hover,
.drag-handle:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  outline: none;
}

.drag-handle:active { cursor: grabbing; }
.mapping-row.is-dragging { opacity: 0.5; }

@media (max-width: 650px) {
  .delivery-setting { align-items: stretch; flex-direction: column; }
  .delivery-setting select { width: 100%; }
  .mapping-row { padding-left: 48px; }
}

@media (max-width: 460px) {
  .login-intro,
  .login-form-wrap {
    padding-right: 22px;
    padding-left: 22px;
  }

  .feature-list {
    display: grid;
  }

  .brand-name {
    font-size: 0.85rem;
  }

  .topbar .button {
    padding-right: 11px;
    padding-left: 11px;
  }

  .overview-grid {
    gap: 7px;
  }

  .metric-card {
    padding: 13px 7px;
  }

  .metric-card > p {
    font-size: 0.65rem;
  }

  .metric-wide {
    padding: 14px;
  }

  .guild-chip {
    max-width: 60%;
  }

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

  .toolbar-controls .search-field {
    grid-column: 1;
  }
}

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

@media (forced-colors: active) {
  .brand-mark,
  .league-badge,
  .save-status-icon,
  .notice-icon,
  .switch-track {
    border: 1px solid CanvasText;
  }

  .status-dot,
  .role-dot {
    forced-color-adjust: none;
  }
}

/* Neutral admin interface. */
:root {
  --bg: #090a0e;
  --bg-raised: #101118;
  --surface: rgba(18, 19, 28, 0.9);
  --surface-solid: #12131b;
  --surface-soft: #171923;
  --surface-hover: #1d2030;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f7f7fa;
  --text-soft: #c7c8d1;
  --text-muted: #858896;
  --green: #bda8ff;
  --green-bright: #ded4ff;
  --green-dark: #2b2546;
  --green-ink: #110f18;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.2);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --content-width: 1180px;
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(110, 84, 196, 0.2), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(64, 112, 164, 0.14), transparent 30rem),
    linear-gradient(145deg, #0d0e15 0%, #090a0e 52%, #0d0a13 100%);
}

.ambient { opacity: 0.07; }

.panel {
  background: rgba(18, 19, 27, 0.82);
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.brand-mark {
  width: 42px;
  height: 42px;
  padding: 5px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(159, 125, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: none;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-mark-large {
  width: 62px;
  height: 62px;
  padding: 7px;
  border-radius: 18px;
}

.eyebrow {
  color: #a995ec;
  font-size: 0.66rem;
  letter-spacing: 0.13em;
}

.button {
  min-height: 42px;
  border-radius: 10px;
  font-weight: 680;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button-primary {
  color: #121019;
  background: linear-gradient(135deg, #eee9ff, #bca8ff);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(141, 110, 224, 0.18);
}

.button-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #fff, #cabbff);
  transform: translateY(-1px);
}

.button-secondary,
.button-quiet {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--border);
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-strong);
}

.login-layout {
  grid-template-columns: 0.92fr 1.08fr;
  width: min(900px, 100%);
  min-height: 540px;
  border-radius: 26px;
}

.login-intro {
  background:
    radial-gradient(circle at 20% 15%, rgba(177, 145, 255, 0.2), transparent 18rem),
    linear-gradient(145deg, rgba(32, 29, 48, 0.92), rgba(14, 15, 22, 0.95));
}

.login-intro::after {
  border-color: rgba(189, 168, 255, 0.11);
  box-shadow:
    0 0 0 42px rgba(189, 168, 255, 0.022),
    0 0 0 104px rgba(111, 139, 205, 0.014);
}

.login-form-wrap {
  background: linear-gradient(145deg, rgba(17, 18, 27, 0.94), rgba(13, 15, 24, 0.82));
}

.secure-pill {
  color: var(--green-bright);
  background: rgba(189, 168, 255, 0.07);
  border-color: rgba(189, 168, 255, 0.14);
}

.login-copy h1 {
  max-width: 430px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.03;
}

.feature-list {
  gap: 10px;
  color: var(--text-soft);
}

.feature-list li span {
  color: var(--green-bright);
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 30;
  width: min(var(--content-width), calc(100% - 32px));
  margin: 14px auto 0;
  padding: 12px 15px;
  border-radius: 16px;
}

.connection-state {
  background: transparent;
  border: 0;
}

.content-wrap {
  width: min(var(--content-width), calc(100% - 32px));
  padding-top: 38px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(400px, 1.2fr) auto;
  gap: 22px;
  align-items: end;
  padding: 10px 0 30px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  margin-top: 6px;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 500px;
  margin-bottom: 0;
  color: var(--text-muted);
}

.server-connect label,
.field-label {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

input,
select {
  background: rgba(7, 8, 12, 0.58);
  border-color: var(--border-strong);
  border-radius: 10px;
}

input:hover,
select:hover { border-color: rgba(255, 255, 255, 0.22); }

input:focus,
select:focus {
  border-color: rgba(189, 168, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(189, 168, 255, 0.09);
}

.notice,
.demo-banner {
  margin-top: 18px;
  border-radius: 13px;
}

.overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 0;
}

.overview-grid + .overview-grid {
  margin-top: 10px;
  opacity: 0.82;
}

.metric-card {
  min-height: 116px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 14px;
  box-shadow: none;
}

.metric-card strong { font-size: 1.65rem; }
.metric-card > p { color: var(--text-soft); }
.metric-card span { color: var(--text-muted); }

.metric-wide { grid-column: auto; }
.guild-chip { display: none; }

.overview-grid + .overview-grid .metric-card {
  min-height: 84px;
  background: transparent;
  border-color: transparent;
}

.workspace {
  margin-top: 18px;
  padding: 24px;
  border-radius: 18px;
  box-shadow: none;
}

.workspace-toolbar {
  gap: 18px;
  margin-bottom: 22px;
}

.workspace-toolbar h2 {
  margin-top: 5px;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.toolbar-controls { gap: 8px; }
.mapping-head { color: #717482; }

.mapping-row {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.018);
  border-color: var(--border);
  border-radius: 13px;
  box-shadow: none;
}

.mapping-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.11);
}

.league-badge {
  background: linear-gradient(145deg, rgba(202, 185, 255, 0.18), rgba(98, 122, 181, 0.12));
}

.role-search input,
.role-select-wrap select {
  background-color: rgba(7, 8, 12, 0.55);
}

.switch input:checked + .switch-track {
  background: linear-gradient(135deg, #a991ed, #7869bc);
}

.workspace[aria-labelledby="activity-heading"],
.workspace[aria-labelledby="operations-heading"] {
  background: rgba(15, 16, 22, 0.5);
}

.save-bar {
  background: rgba(9, 10, 14, 0.83);
  border-top-color: var(--border);
  backdrop-filter: blur(18px);
}

.save-bar[hidden] { display: none; }

.save-inner { width: min(var(--content-width), 100%); }

.league-dialog {
  width: min(460px, calc(100% - 28px));
  padding: 0;
  color: var(--text);
  background: linear-gradient(145deg, rgba(26, 25, 38, 0.98), rgba(13, 14, 21, 0.98));
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
}

.league-dialog::backdrop {
  background: rgba(4, 5, 8, 0.76);
  backdrop-filter: blur(8px);
}

.league-dialog form { padding: 26px; }
.team-config-card textarea, .league-dialog textarea {
  width: 100%; min-height: 96px; resize: vertical; padding: 12px 14px;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; font: inherit; line-height: 1.6;
}
.league-dialog textarea:focus { outline: 2px solid var(--green-bright); outline-offset: 2px; }

.dialog-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.dialog-brand h2 {
  margin: 4px 0 0;
  font-size: 1.4rem;
  letter-spacing: -0.035em;
}

.dialog-copy {
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.league-dialog input {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  padding: 0 13px;
}

.league-dialog .form-message { min-height: 22px; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.button-danger {
  color: #fff;
  background: #a94750;
  border-color: #bd5962;
}

.button-danger:hover:not(:disabled) { background: #bc525d; }

.remove-impact {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 18px;
  margin: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.remove-impact dt,
.remove-impact dd { margin: 0; }

.remove-impact dd {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; align-items: stretch; }
  .hero > .button { justify-self: start; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-wide { grid-column: auto; }
}

@media (max-width: 760px) {
  .center-stage { padding: 14px; }
  .login-layout { grid-template-columns: 1fr; min-height: 0; }
  .login-intro { padding: 28px 24px; }
  .login-copy h1 { font-size: 2.25rem; }
  .feature-list { display: none; }
  .login-form-wrap { padding: 30px 24px; }
  .topbar { top: 8px; width: calc(100% - 16px); margin-top: 8px; }
  .connection-state { display: none; }
  .content-wrap { width: calc(100% - 24px); padding-top: 26px; }
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 104px; }
  .workspace { padding: 17px; }
}

/* Single-field searchable role picker. */
.workspace[aria-labelledby="mapping-heading"] { overflow: visible; }

.mapping-row:focus-within {
  position: relative;
  z-index: 20;
}

.role-picker,
.role-combobox {
  position: relative;
  min-width: 0;
}

.channel-picker {
  width: min(320px, 100%);
}

.delivery-setting:focus-within {
  position: relative;
  z-index: 90;
}

.role-search-input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 38px;
  color: var(--text);
  background: #0d0e13;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: 0;
}

.role-search-input:hover { border-color: rgba(255, 255, 255, 0.22); }

.role-search-input:focus {
  border-color: #8794a7;
  box-shadow: 0 0 0 3px rgba(151, 165, 185, 0.1);
}

.role-search-input[aria-expanded="true"] {
  border-color: #8794a7;
  border-radius: 10px 10px 6px 6px;
}

.role-search-input[aria-invalid="true"] {
  border-color: rgba(255, 125, 134, 0.72);
}

.role-combobox > .search-icon {
  position: absolute;
  z-index: 2;
  top: 15px;
  left: 14px;
}

.role-combobox > .select-chevron {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 15px;
  pointer-events: none;
}

.role-search-input[aria-expanded="true"] + .select-chevron {
  transform: rotate(180deg);
}

.role-options {
  position: absolute;
  z-index: 80;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  max-height: 270px;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #15161c;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46);
  scrollbar-color: #474b56 transparent;
  scrollbar-width: thin;
}

.role-options[hidden] { display: none; }

.role-option {
  display: flex;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
}

.role-option:hover:not(:disabled),
.role-option:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: 0;
}

.role-option[aria-selected="true"] {
  color: var(--text);
  background: rgba(174, 187, 208, 0.1);
}

.role-option:disabled {
  color: #666a74;
  cursor: not-allowed;
}

.role-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-option small {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.role-options-empty,
.role-options-more {
  margin: 5px;
  padding: 8px;
  color: var(--text-muted);
  font-size: 0.74rem;
  text-align: center;
}

.mapping-arrow {
  width: auto;
  height: auto;
  color: var(--text-muted);
  background: transparent;
  border: 0;
}

@media (max-width: 480px) {
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 14px; }
  .metric-card strong { font-size: 1.4rem; }
  .guild-chip { display: none; }
}

/* Brandless presentation: compact, neutral, and task-focused. */
:root {
  --bg: #0b0c0f;
  --bg-raised: #101116;
  --surface: #121319;
  --surface-solid: #121319;
  --surface-soft: #17181f;
  --surface-hover: #1c1e26;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f2f3f5;
  --text-soft: #c5c7ce;
  --text-muted: #888b95;
  --green: #aebbd0;
  --green-bright: #e7ecf5;
  --green-dark: #252b36;
  --green-ink: #101216;
}

body {
  background: linear-gradient(145deg, #101116 0%, #0b0c0f 48%, #0d0f13 100%);
}

.panel {
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
}

.loading-card {
  display: block;
  width: min(400px, 100%);
  padding: 26px;
  border-radius: 16px;
}

.loading-bar { margin-top: 20px; }
.loading-bar span { background: #aebbd0; }

.login-layout {
  display: block;
  width: min(430px, 100%);
  min-height: 0;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.login-form-wrap {
  padding: 34px;
  background: transparent;
  border: 0;
}

.form-heading h1 {
  margin: 8px 0 6px;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.form-heading .muted { margin-bottom: 26px; }

.password-field {
  background: rgba(7, 8, 11, 0.72);
  border-color: var(--border-strong);
}

.password-field:focus-within {
  border-color: #8794a7;
  box-shadow: 0 0 0 3px rgba(151, 165, 185, 0.1);
}

.eyebrow {
  color: #9ca7b8;
  letter-spacing: 0.11em;
}

.button-primary {
  color: #111318;
  background: linear-gradient(135deg, #f1f3f7, #b8c2d2);
  box-shadow: none;
}

.button-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #fff, #c7d0dd);
}

.topbar {
  top: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 13px max(20px, calc((100% - var(--content-width)) / 2));
  background: rgba(13, 14, 18, 0.94);
  border-width: 0 0 1px;
  border-radius: 0;
}

.topbar .brand-name {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.content-wrap { padding-top: 32px; }

.hero {
  grid-template-columns: minmax(240px, 0.75fr) minmax(380px, 1.25fr) auto;
  padding: 8px 0 24px;
}

.hero h1 {
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  letter-spacing: -0.045em;
}

.overview-grid {
  gap: 0;
  padding: 4px;
  overflow: hidden;
  background: rgba(18, 19, 25, 0.72);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.metric-card,
.overview-grid + .overview-grid .metric-card {
  min-height: 86px;
  padding: 15px 17px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
}

.metric-card:last-child { border-right: 0; }
.metric-card strong { font-size: 1.45rem; }

.workspace {
  background: #111218;
  border-radius: 14px;
}

.workspace-toolbar { padding: 18px 20px; }
.mapping-row { border-radius: 10px; }

.league-dialog {
  background: #121319;
  border-radius: 16px;
}

.league-dialog::backdrop {
  background: rgba(4, 5, 7, 0.78);
  backdrop-filter: blur(4px);
}

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .metric-card:nth-child(2) { border-right: 0; }
  .metric-card:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 760px) {
  .login-form-wrap { padding: 28px 24px; }
  .topbar { width: 100%; margin: 0; }
  .overview-grid { grid-template-columns: 1fr 1fr; }
}

/* Clear role identity and league actions. */
.mapping-head,
.mapping-row {
  grid-template-columns: minmax(145px, 0.72fr) minmax(250px, 1fr) 24px minmax(250px, 1fr) 112px;
}

.role-search-input {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-meta {
  display: block;
  min-height: 18px;
  padding: 6px 3px 0;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  line-height: 1.35;
}

.role-option {
  display: grid;
  justify-content: stretch;
  gap: 3px;
}

.role-option span {
  overflow: visible;
  color: var(--text-soft);
  font-weight: 620;
  text-overflow: clip;
  white-space: normal;
}

.role-option small {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: normal;
}

.row-actions {
  display: grid;
  align-self: stretch;
  align-items: center;
  justify-items: end;
  gap: 9px;
  padding-left: 13px;
  border-left: 1px solid var(--border);
}

.enabled-cell {
  justify-content: flex-end;
}

.delete-row-button {
  position: static;
  width: auto;
  height: auto;
  padding: 5px 8px;
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 650;
}

.delete-row-button:hover {
  color: #f09aa1;
  background: rgba(255, 125, 134, 0.07);
  border-color: rgba(255, 125, 134, 0.12);
}

@media (max-width: 1180px) {
  .mapping-row {
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) 112px;
  }

  .row-actions {
    grid-column: 4;
  }
}

@media (max-width: 650px) {
  .mapping-row {
    grid-template-columns: 1fr;
  }

  .row-actions {
    grid-column: 1;
    grid-template-columns: 1fr auto;
    width: 100%;
    margin-top: 15px;
    padding: 13px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .enabled-cell {
    margin: 0;
    padding: 0;
    border: 0;
    justify-self: start;
  }
}
