/* PZASM interface system
   This layer consolidates visual tokens and normalizes legacy page components. */

:root {
  color-scheme: light;
  --font-scale: 1.1;
  --bg: #f5f2ea;
  --bg-subtle: #e7e1d4;
  --surface: #ffffff;
  --surface-2: #f0ebe0;
  --surface-3: #e7e1d4;
  --surface-raised: #ffffff;
  --line: #d8d0c1;
  --line-strong: #c5bbab;
  --text: #212520;
  --text-strong: #151915;
  --muted: #7d8179;
  --muted-strong: #4e544c;
  --accent: #6e7e4c;
  --accent-strong: #607043;
  --accent-pressed: #55633c;
  --accent-soft: rgba(110, 126, 76, .14);
  --accent-contrast: #ffffff;
  --green: var(--accent);
  --green-dark: var(--accent-strong);
  --success: #4d983f;
  --success-soft: rgba(77, 152, 63, .14);
  --amber: #b98633;
  --warning: #d19b3f;
  --warning-soft: rgba(209, 155, 63, .15);
  --warning-contrast: #212520;
  --red: #b75a4d;
  --danger: #b75a4d;
  --danger-soft: rgba(183, 90, 77, .13);
  --info: #58758a;
  --info-soft: rgba(88, 117, 138, .13);
  --steel: #58758a;
  --steel-soft: rgba(88, 117, 138, .13);
  --offline: #a6aaa3;
  --offline-soft: rgba(166, 170, 163, .2);
  --maintenance: #b98633;
  --maintenance-soft: rgba(185, 134, 51, .14);
  --update: #58758a;
  --update-soft: rgba(88, 117, 138, .13);
  --selection: #58758a;
  --selection-soft: rgba(88, 117, 138, .13);
  --disabled: #d8d0c1;
  --forest-ink: #6e7e4c;
  --forest-silhouette: #d8d0c1;
  --link: #58758a;
  --link-hover: #405f74;
  --link-visited: #58758a;
  --sidebar-bg: #ffffff;
  --sidebar-border: #d8d0c1;
  --sidebar-text: #4e544c;
  --sidebar-text-strong: #212520;
  --sidebar-muted: #7d8179;
  --sidebar-hover: #f0ebe0;
  --sidebar-active: rgba(110, 126, 76, .14);
  --sidebar-active-border: rgba(110, 126, 76, .48);
  --sidebar-status-bg: #f0ebe0;
  --shadow-sm: 0 1px 2px rgba(33, 37, 32, .06), 0 4px 12px rgba(33, 37, 32, .04);
  --shadow: 0 14px 40px rgba(33, 37, 32, .09);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, .72);
  --shadow-lg: 0 28px 80px rgba(33, 37, 32, .18);
  --radius-xs: 5px;
  --radius-sm: 7px;
  --radius-md: 10px;
  --radius-lg: 13px;
  --sidebar-width: 248px;
  --topbar-height: 64px;
  --content-width: 1540px;
  --focus-ring: 0 0 0 3px rgba(126, 152, 172, .34);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101311;
  --bg-subtle: #0c0f0d;
  --surface: #171b18;
  --surface-2: #1e2420;
  --surface-3: #252d28;
  --surface-raised: #252d28;
  --line: #303a34;
  --line-strong: #4a5047;
  --text: #ece6d8;
  --text-strong: #fff9ec;
  --muted: #8b877d;
  --muted-strong: #b8b2a3;
  --accent: #6e7e4c;
  --accent-strong: #7d8d59;
  --accent-pressed: #5d6c40;
  --accent-soft: rgba(110, 126, 76, .2);
  --accent-contrast: #ffffff;
  --green: var(--accent);
  --green-dark: var(--accent-strong);
  --success: #6f9b5c;
  --success-soft: rgba(111, 155, 92, .18);
  --amber: #c79842;
  --warning: #d4a24a;
  --warning-soft: rgba(212, 162, 74, .18);
  --warning-contrast: #101311;
  --red: #b35a4d;
  --danger: #b35a4d;
  --danger-soft: rgba(179, 90, 77, .18);
  --info: #5b7283;
  --info-soft: rgba(91, 114, 131, .2);
  --steel: #5b7283;
  --steel-soft: rgba(91, 114, 131, .2);
  --offline: #6e736d;
  --offline-soft: rgba(110, 115, 109, .2);
  --maintenance: #c79842;
  --maintenance-soft: rgba(199, 152, 66, .18);
  --update: #5b7283;
  --update-soft: rgba(91, 114, 131, .2);
  --selection: #5b7283;
  --selection-soft: rgba(91, 114, 131, .2);
  --disabled: #303a34;
  --link: #5b7283;
  --link-hover: #8fa6b8;
  --link-visited: #5b7283;
  --forest-ink: #7d8d59;
  --forest-silhouette: #303a34;
  --sidebar-bg: #171b18;
  --sidebar-border: #303a34;
  --sidebar-text: #b8b2a3;
  --sidebar-text-strong: #ece6d8;
  --sidebar-muted: #8b877d;
  --sidebar-hover: #1e2420;
  --sidebar-active: rgba(110, 126, 76, .2);
  --sidebar-active-border: rgba(125, 141, 89, .58);
  --sidebar-status-bg: #1e2420;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .2), 0 6px 18px rgba(0, 0, 0, .12);
  --shadow: 0 18px 46px rgba(0, 0, 0, .22);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, .035);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, .48);
  --focus-ring: 0 0 0 3px rgba(143, 166, 184, .42);
}

html {
  min-width: 320px;
  background: var(--bg);
  font-size: calc(16px * var(--font-scale));
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: .875rem;
  line-height: 1.5;
  letter-spacing: -.006em;
}

body::before {
  content: none;
}

::selection {
  color: var(--text-strong);
  background: color-mix(in srgb, var(--selection) 38%, transparent);
}

:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

a {
  color: var(--link);
}

a:hover,
[data-theme="dark"] a:hover {
  color: var(--link-hover);
}

a:visited {
  color: var(--link-visited);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon use[href="#icon-grid"] {
  fill: currentColor;
  stroke: none;
}

/* Application shell */

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

.app-sidebar {
  position: fixed;
  z-index: 400;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  padding: 0 14px 16px;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg);
}

.app-sidebar::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 3%, transparent), transparent 48%),
    repeating-linear-gradient(135deg, transparent 0 18px, color-mix(in srgb, var(--accent) 1.4%, transparent) 18px 19px);
}

.app-brand {
  display: flex;
  height: var(--topbar-height);
  min-width: 0;
  padding: 0 10px;
  align-items: center;
  gap: 11px;
  color: var(--sidebar-text-strong);
  text-decoration: none;
}

.app-brand:hover {
  color: var(--sidebar-text-strong);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 50px;
  height: 38px;
  flex: 0 0 50px;
  grid-template-columns: 28px 1fr;
  align-items: end;
  color: var(--accent);
  border: 0;
  background: transparent;
  box-shadow: none;
  letter-spacing: -.04em;
}

.brand-mark .ui-icon {
  width: 31px;
  height: 30px;
  align-self: end;
  color: var(--forest-ink);
}

.brand-mark b {
  position: relative;
  z-index: 1;
  align-self: center;
  margin-left: -3px;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 1px 1px 0 color-mix(in srgb, var(--surface) 80%, transparent);
}

.app-brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.app-brand-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: .89rem;
  font-weight: 760;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-brand-copy small {
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: .67rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.primary-navigation {
  display: grid;
  align-content: start;
  gap: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--sidebar-border);
}

.navigation-label {
  padding: 0 12px 7px;
  color: var(--sidebar-muted);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.navigation-label-spaced {
  padding-top: 22px;
}

.primary-navigation a {
  position: relative;
  display: flex;
  min-height: 42px;
  padding: 0 12px;
  align-items: center;
  gap: 12px;
  color: var(--sidebar-text);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 650;
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
}

.primary-navigation a:hover {
  color: var(--sidebar-text-strong);
  background: var(--sidebar-hover);
  transform: translateX(2px);
}

.primary-navigation a.is-active {
  color: var(--accent-strong);
  border-color: var(--sidebar-active-border);
  background: var(--sidebar-active);
  box-shadow: var(--shadow-inset);
}

.primary-navigation a.is-active::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -15px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}

.primary-navigation a.is-active .ui-icon,
.primary-navigation a.is-active-secondary .ui-icon {
  color: var(--accent);
}

.sidebar-status {
  display: flex;
  min-height: 54px;
  padding: 11px 12px;
  margin-top: auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-md);
  background: var(--sidebar-status-bg);
}

.sidebar-landscape {
  width: calc(100% - 10px);
  height: 92px;
  margin: auto 5px -2px;
  color: var(--forest-silhouette);
  opacity: .62;
}

.sidebar-landscape + .sidebar-status {
  margin-top: 0;
}

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

.sidebar-status strong {
  color: var(--sidebar-text-strong);
  font-size: .7rem;
}

.sidebar-status small {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: .64rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .03);
}

.status-dot.is-online {
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 12%, transparent);
  animation: pzasm-live-pulse 2.8s ease-out infinite;
}

.app-main {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  grid-column: 2;
  flex-direction: column;
}

.app-topbar {
  position: sticky;
  z-index: 300;
  top: 0;
  display: flex;
  min-height: var(--topbar-height);
  padding: 0 clamp(18px, 2.2vw, 34px);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface) 90%, var(--accent) 10%));
  backdrop-filter: blur(18px) saturate(1.2);
}

.topbar-context,
.topbar-breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
}

.topbar-context {
  gap: 12px;
}

.topbar-breadcrumb {
  gap: 7px;
  color: var(--muted);
  font-size: .76rem;
}

.topbar-breadcrumb a {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
}

.topbar-breadcrumb a:hover {
  color: var(--accent-strong);
}

.topbar-breadcrumb .breadcrumb-separator {
  width: 13px;
  height: 13px;
  color: var(--line-strong);
}

.topbar-breadcrumb .breadcrumb-home-icon {
  width: 15px;
  height: 15px;
}

.topbar-breadcrumb strong {
  max-width: min(42vw, 440px);
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-menu-button {
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.app-preferences {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.language-control,
.font-scale-control {
  margin: 0;
}

.language-control select,
.font-scale-control select {
  width: auto;
  min-width: 62px;
  min-height: 36px;
  padding: 6px 26px 6px 9px;
  border-radius: var(--radius-sm);
  font-size: .72rem;
  font-weight: 750;
}

.theme-toggle {
  display: inline-flex;
  min-height: 36px;
  padding: 6px 10px;
  align-items: center;
  gap: 7px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
}

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

.theme-toggle [data-theme-icon] {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 32%, var(--line));
  border-radius: 50%;
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
  font-size: .72rem;
  transition: rotate .28s ease, background .16s ease;
}

.theme-toggle:hover [data-theme-icon] {
  rotate: 18deg;
}

.account-menu {
  position: relative;
  padding: 0;
  margin: 0 0 0 2px;
  border: 0;
}

.account-menu > summary {
  display: grid;
  min-width: 176px;
  min-height: 42px;
  padding: 4px 8px 4px 5px;
  grid-template-columns: 32px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  list-style: none;
}

.account-menu > summary::-webkit-details-marker {
  display: none;
}

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

.account-avatar {
  --avatar-skin: #c79e72;
  --avatar-hair: #292923;
  --avatar-jacket: #65523d;
  --avatar-shirt: #84745d;
  --avatar-outline: #191612;
  --avatar-feature: #4b3527;
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  overflow: hidden;
  place-items: center;
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--accent) 72%, var(--line));
  border-radius: 50%;
  background:
    radial-gradient(circle at 62% 30%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 34%),
    linear-gradient(145deg, #393128, #191612);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent);
}

.account-avatar::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border: 1px solid color-mix(in srgb, var(--surface) 70%, transparent);
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 18%, transparent);
}

.account-avatar-icon {
  width: 32px;
  height: 32px;
  translate: 0 2px;
}

.account-menu-copy,
.account-popover > div {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.account-menu-copy strong,
.account-popover strong {
  overflow: hidden;
  color: var(--text);
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-copy small,
.account-popover small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .62rem;
}

.account-menu > summary > .ui-icon {
  width: 13px;
  height: 13px;
  color: var(--muted);
  transition: transform .15s ease;
}

.account-menu[open] > summary > .ui-icon {
  transform: rotate(180deg);
}

.account-popover {
  position: absolute;
  z-index: 500;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  width: 230px;
  padding: 12px;
  gap: 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.account-popover form,
.account-popover .button {
  width: 100%;
  margin: 0;
}

.app-content {
  width: 100%;
  max-width: var(--content-width);
  padding: clamp(20px, 2.6vw, 38px) clamp(18px, 2.8vw, 42px) 56px;
  margin: 0 auto;
  flex: 1;
}

.app-footer {
  display: flex;
  width: calc(100% - clamp(36px, 5.6vw, 84px));
  max-width: calc(var(--content-width) - clamp(36px, 5.6vw, 84px));
  min-height: 56px;
  padding: 16px 0;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: .68rem;
}

.auth-topbar {
  display: flex;
  min-height: var(--topbar-height);
  padding: 0 clamp(18px, 4vw, 64px);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.auth-topbar .app-brand {
  height: auto;
  padding: 0;
  color: var(--text);
}

.auth-topbar .app-brand:hover {
  color: var(--text-strong);
}

.auth-content {
  width: min(1400px, 100%);
  min-height: calc(100vh - var(--topbar-height));
  padding: 0 clamp(20px, 4vw, 64px);
  margin: 0 auto;
}

/* Typography and content rhythm */

h1,
h2,
h3,
h4 {
  color: var(--text-strong);
  letter-spacing: -.025em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.03;
}

h2 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.2;
}

h3 {
  font-size: 1rem;
  line-height: 1.3;
}

p {
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.6;
}

small {
  line-height: 1.45;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--accent);
  font-size: .64rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

code {
  padding: .14rem .34rem;
  color: var(--info);
  border: 1px solid color-mix(in srgb, var(--info) 20%, var(--line));
  border-radius: 4px;
  background: color-mix(in srgb, var(--info) 7%, var(--surface-2));
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: .84em;
}

[data-theme="light"] code {
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 20%, var(--line));
  background: color-mix(in srgb, var(--info) 7%, var(--surface-2));
}

[data-theme="light"] .mod-list-source-grid code,
[data-theme="light"] .mod-import-candidate-copy em,
[data-theme="light"] .mod-import-status {
  color: var(--accent-strong);
}

/* Core controls */

input,
textarea,
select,
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
  min-height: 40px;
  padding: 9px 11px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: .83rem;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .02);
}

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

input::placeholder,
textarea::placeholder,
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 82%, transparent);
  opacity: 1;
}

input:hover,
textarea:hover,
select:hover {
  border-color: color-mix(in srgb, var(--line-strong) 65%, var(--muted));
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--info);
  box-shadow: var(--focus-ring);
}

input[type="checkbox"],
input[type="radio"] {
  min-height: 0;
  accent-color: var(--accent);
}

label > span,
[data-theme="light"] label > span,
[data-theme="light"] .check-stack label,
[data-theme="light"] .expert-disclosure summary {
  color: var(--text);
  font-size: .78rem;
  font-weight: 700;
}

.button {
  position: relative;
  overflow: hidden;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: -.005em;
  box-shadow: none;
  transition: border-color .13s ease, background .13s ease, color .13s ease, transform .13s ease, box-shadow .13s ease;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, .16) 48%, transparent 76%);
  translate: -140% 0;
  transition: translate .34s ease;
}

.button:hover::after {
  translate: 140% 0;
}

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

.button.primary,
[data-theme="light"] .button.primary,
[data-theme="light"] .catalog-source-tabs a.active,
[data-theme="light"] .workspace-tabs button.is-active {
  color: var(--accent-contrast);
  border-color: color-mix(in srgb, var(--accent) 78%, #000);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent));
  box-shadow: var(--shadow-inset), 0 5px 14px color-mix(in srgb, var(--accent) 18%, transparent);
}

.button.primary:hover,
[data-theme="light"] .button.primary:hover {
  color: var(--accent-contrast);
  background: var(--accent-strong);
}

.button.secondary,
[data-theme="light"] .button.secondary {
  color: var(--text);
  border-color: color-mix(in srgb, var(--amber) 72%, var(--line));
  background: color-mix(in srgb, var(--amber) 5%, var(--surface-2));
}

.button.secondary:hover {
  border-color: var(--amber);
  background: color-mix(in srgb, var(--amber) 12%, var(--surface-2));
}

.button.ghost,
[data-theme="light"] .button.ghost {
  color: var(--muted-strong);
  border-color: var(--line);
  background: transparent;
}

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

.button.danger,
[data-theme="light"] .button.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 38%, var(--line));
  background: var(--danger-soft);
}

.button.danger-outline,
[data-theme="light"] .button.danger-outline {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  background: transparent;
}

.button.compact {
  min-height: 32px;
  padding: 6px 9px;
  font-size: .7rem;
}

.button .ui-icon {
  width: 15px;
  height: 15px;
}

.icon-button {
  color: var(--text);
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

[data-theme="light"] .icon-button {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-2);
}

/* Cards, panels and page headers */

.hero,
[data-theme="light"] .hero {
  display: grid;
  min-height: 0;
  padding: clamp(24px, 3vw, 34px);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 94% 10%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 30%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--accent);
}

.hero h1 {
  max-width: 820px;
  font-size: clamp(2rem, 3.2vw, 2.7rem);
  line-height: 1.06;
}

.hero p,
[data-theme="light"] .hero p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: .92rem;
}

.hero-mark,
[data-theme="light"] .hero-mark {
  position: relative;
  display: grid;
  width: clamp(170px, 18vw, 270px);
  height: 108px;
  place-items: end center;
  color: color-mix(in srgb, var(--accent) 25%, var(--line));
  user-select: none;
}

.hero-mark .ui-icon {
  width: 100%;
  height: 100%;
  opacity: .66;
}

.hero-mark > span {
  position: absolute;
  right: 10px;
  bottom: 15px;
  color: color-mix(in srgb, var(--accent) 36%, transparent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.hero-mark span,
[data-theme="light"] .hero-mark span {
  color: color-mix(in srgb, var(--accent) 16%, transparent);
}

.panel,
.create-panel,
.setting-card,
[data-theme="light"] .panel,
[data-theme="light"] .create-panel,
[data-theme="light"] .setting-card {
  padding: 22px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-inset), var(--shadow-sm);
}

.panel-heading {
  margin-bottom: 19px;
}

.panel-heading,
.section-heading,
.project-hero {
  gap: 18px;
}

.section-heading {
  margin: 34px 0 14px;
}

.count-pill,
[data-theme="light"] .count-pill,
[data-theme="light"] .step-number,
[data-theme="light"] .map-rank {
  min-width: 32px;
  height: 27px;
  padding: 0 9px;
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--accent-soft);
  font-size: .7rem;
}

.legal-banner,
[data-theme="light"] .legal-banner {
  padding: 12px 15px;
  margin: 14px 0 22px;
  align-items: flex-start;
  color: var(--muted);
  border-color: color-mix(in srgb, var(--warning) 32%, var(--line));
  border-radius: var(--radius-md);
  background: var(--warning-soft);
}

.legal-banner strong,
[data-theme="light"] .legal-banner strong {
  color: var(--warning);
  font-size: .76rem;
}

.legal-banner span {
  font-size: .76rem;
  line-height: 1.55;
}

.dashboard-summary-grid {
  display: grid;
  margin: 16px 0 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-summary-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 104px;
  padding: 16px;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-inset), var(--shadow-sm);
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.dashboard-summary-card::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 9px;
  width: 36px;
  height: 15px;
  opacity: .32;
  background: linear-gradient(135deg, transparent 0 8%, var(--accent) 8% 13%, transparent 13% 25%, var(--accent) 25% 31%, transparent 31% 44%, var(--accent) 44% 51%, transparent 51% 64%, var(--accent) 64% 72%, transparent 72%);
  clip-path: polygon(0 78%, 18% 55%, 35% 67%, 52% 24%, 70% 44%, 86% 0, 100% 14%, 100% 100%, 0 100%);
}

.dashboard-summary-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--surface) 95%, var(--accent) 5%);
  box-shadow: var(--shadow-inset), var(--shadow);
}

.dashboard-summary-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--surface) 60%, transparent);
}

.dashboard-summary-icon .ui-icon {
  width: 21px;
  height: 21px;
  stroke-width: 1.9;
}

.dashboard-summary-icon.is-success {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 28%, var(--line));
  background: var(--success-soft);
}

.dashboard-summary-icon.is-info {
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 28%, var(--line));
  background: var(--info-soft);
}

.dashboard-summary-icon.is-warning {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 30%, var(--line));
  background: var(--warning-soft);
}

.dashboard-summary-card > div {
  display: grid;
  min-width: 0;
}

.dashboard-summary-card span:not(.dashboard-summary-icon) {
  color: var(--muted);
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.dashboard-summary-card strong {
  margin-top: 1px;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 1.45rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-summary-card small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .72fr);
  gap: 18px;
}

.inline-navigation-link {
  display: inline-flex;
  margin-top: 18px;
  align-items: center;
  gap: 7px;
  color: var(--link);
  font-size: .76rem;
  font-weight: 750;
  text-decoration: none;
}

.inline-navigation-link:hover {
  gap: 10px;
}

.modpacks-page-hero {
  margin-bottom: 0;
  align-items: center;
  gap: 30px;
}

.modpacks-page-hero p {
  max-width: 760px;
}

.modpack-tools-grid {
  display: grid;
  margin-top: 22px;
  grid-template-columns: minmax(300px, .76fr) minmax(420px, 1.24fr);
  gap: 18px;
  align-items: stretch;
}

.modpack-tools-grid > .panel {
  height: 100%;
  margin-bottom: 0;
}

.modpack-import-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, .56fr);
  grid-template-rows: auto auto auto 1fr;
  column-gap: 24px;
}

.modpack-import-panel > .eyebrow,
.modpack-import-panel > h2,
.modpack-import-panel > p,
.modpack-import-panel > form {
  grid-column: 1;
}

.modpack-import-panel > .transfer-note {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: stretch;
}

.modpack-project-grid {
  margin-bottom: 18px;
}

.path-list {
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 8px 16px;
}

.path-list dt {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
}

.path-list dd,
[data-theme="light"] .path-list dd,
[data-theme="light"] .technical-values dd {
  color: var(--text);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: .72rem;
}

.transfer-panel {
  gap: 8px 28px;
}

.transfer-note {
  border-style: solid;
  border-radius: var(--radius-sm);
}

.project-grid {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}

.project-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 18px;
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-inset), var(--shadow-sm);
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent));
  opacity: .68;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: var(--shadow);
}

.project-card h3 {
  margin-top: 14px;
  font-size: 1.04rem;
}

.project-top,
.project-meta {
  font-size: .68rem;
}

.project-meta {
  padding-top: 12px;
}

.mode-badge {
  color: var(--accent);
}

.project-card-actions {
  padding-top: 12px;
}

.project-export-options {
  border-color: var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.project-hero {
  padding: 5px 0 26px;
  align-items: flex-end;
}

.project-hero h1 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
}

.back-link {
  margin-bottom: 16px;
  font-size: .75rem;
}

.workspace-hero,
.catalog-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 0, color-mix(in srgb, var(--accent) 8%, transparent), transparent 30%),
    var(--surface);
  box-shadow: var(--shadow-inset), var(--shadow-sm);
}

.workspace-hero::after,
.catalog-hero::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 0;
  width: 150px;
  height: 52px;
  pointer-events: none;
  opacity: .19;
  background: var(--accent);
  clip-path: polygon(0 100%, 8% 72%, 15% 100%, 23% 43%, 32% 100%, 44% 60%, 53% 100%, 63% 25%, 74% 100%, 84% 52%, 94% 100%);
}

.workspace-hero h1,
.catalog-hero h1 {
  font-size: clamp(1.9rem, 3.5vw, 2.65rem);
}

.workspace-hero p,
.catalog-hero p {
  margin-top: 10px;
}

.workspace-hero .project-kpis {
  margin-top: 14px;
}

.project-kpis {
  gap: 6px;
}

.project-kpis > span,
[data-theme="light"] .project-kpis > span {
  min-height: 29px;
  padding: 4px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: .69rem;
}

.project-kpis > span strong {
  color: var(--text-strong);
  font-size: .72rem;
}

.primary-command-center,
[data-theme="light"] .primary-command-center {
  width: min(770px, 53vw);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: none;
}

.primary-command-heading {
  margin-bottom: 10px;
}

.primary-command-heading > span:last-child {
  color: var(--muted);
  font-size: .67rem;
}

.primary-command-grid {
  gap: 8px;
}

.primary-command,
[data-theme="light"] .primary-command {
  min-height: 68px;
  padding: 10px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-inset);
}

.primary-command:hover:not(:disabled),
[data-theme="light"] .primary-command:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.primary-command strong {
  color: var(--text-strong);
  font-size: .78rem;
}

.primary-command small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .64rem;
}

.primary-command-icon,
[data-theme="light"] .primary-command-icon,
.update-command .primary-command-icon,
[data-theme="light"] .update-command .primary-command-icon,
.publish-command .primary-command-icon,
[data-theme="light"] .publish-command .primary-command-icon,
.folder-command .primary-command-icon,
[data-theme="light"] .folder-command .primary-command-icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  color: var(--accent-contrast);
  border: 1px solid color-mix(in srgb, var(--accent) 78%, #000);
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, white), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 5px 12px color-mix(in srgb, var(--accent) 20%, transparent);
}

.primary-command-icon .ui-icon {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.publish-command {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
}

.publish-command strong,
.publish-command small,
[data-theme="light"] .publish-command strong,
[data-theme="light"] .publish-command small {
  color: inherit;
}

.publish-command > span:last-child {
  color: var(--text);
}

.publish-command small,
[data-theme="light"] .publish-command small {
  color: var(--muted);
}

.package-folder-command .primary-command {
  min-height: 48px;
}

.workspace {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.workspace-tabs,
.server-view-tabs,
.catalog-source-tabs {
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.workspace-tabs button,
.server-view-tabs button {
  border-radius: var(--radius-sm);
}

.workspace-tabs button span,
.server-view-tabs button > span {
  color: var(--muted);
  background: var(--surface-3);
}

.workspace-tabs button:hover,
.server-view-tabs button:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-2);
}

.workspace-tabs button.is-active,
.server-view-tabs button.is-active,
[data-theme="light"] .workspace-tabs button.is-active {
  position: relative;
  color: var(--text-strong);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-soft);
  box-shadow: none;
}

.workspace-tabs button.is-active::after,
.server-view-tabs button.is-active::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}

.workspace-tabs button.is-active span,
.server-view-tabs button.is-active > span {
  color: var(--accent-contrast);
  background: var(--accent);
}

.step-number {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: var(--accent-soft);
}

.choice-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

[data-theme="light"] .choice-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: var(--accent-soft);
}

.description-preview,
[data-theme="light"] .description-preview {
  color: var(--muted-strong);
  background: var(--surface-2);
}

.workspace-savebar {
  border-top-color: var(--line);
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
}

.toast-message,
.error-message {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.toast-message {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 32%, var(--line));
  background: var(--success-soft);
}

.error-message {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 32%, var(--line));
  background: var(--danger-soft);
}

.empty-state,
[data-theme="light"] .empty-state {
  padding: 48px 24px;
  border-color: var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

/* Pack editor and compatibility workspace */

.project-health-card {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.project-health-mark {
  border-radius: var(--radius-sm);
  background: var(--accent);
}

.project-health-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow);
}

.project-health-action strong,
.project-health-arrow {
  color: var(--accent);
}

.switch-row,
.choice-card,
.map-order-item,
.mod-card,
.mod-metadata > div,
.expert-disclosure,
[data-theme="light"] .switch-row,
[data-theme="light"] .choice-card,
[data-theme="light"] .map-order-item,
[data-theme="light"] .mod-card,
[data-theme="light"] .mod-metadata > div,
[data-theme="light"] .expert-disclosure {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.mod-card {
  box-shadow: none;
}

.mod-card summary {
  min-height: 62px;
  padding: 11px 13px;
}

.mod-card summary strong {
  font-size: .8rem;
}

.mod-card summary small {
  margin-top: 2px;
  font-size: .66rem;
}

.mod-card[open] {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.mod-reorder-edge-actions .button,
.mod-reorder-relative-actions .button {
  min-height: 36px;
}

.validation-box,
[data-theme="light"] .validation-box {
  color: var(--muted);
  border-color: color-mix(in srgb, var(--warning) 32%, var(--line));
  border-radius: var(--radius-md);
  background: var(--warning-soft);
}

.validation-box strong,
[data-theme="light"] .validation-box strong {
  color: var(--warning);
}

.validation-box.ok,
[data-theme="light"] .validation-box.ok {
  border-color: color-mix(in srgb, var(--success) 30%, var(--line));
  background: var(--success-soft);
}

.info-callout,
[data-theme="light"] .info-callout {
  border-color: color-mix(in srgb, var(--info) 32%, var(--line));
  background: var(--info-soft);
}

.info-callout strong,
[data-theme="light"] .info-callout strong {
  color: var(--info);
}

.map-rank,
[data-theme="light"] .map-rank {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: var(--accent-soft);
}

.catalog-launch-card,
[data-theme="light"] .catalog-launch-card,
.mod-list-importer,
[data-theme="light"] .mod-list-importer {
  border-color: var(--line);
  background: var(--surface-2);
}

.mod-list-import-icon,
[data-theme="light"] .mod-list-import-icon {
  color: var(--accent-contrast);
  background: var(--accent);
}

.preview-placeholder {
  color: var(--text-strong);
  background:
    radial-gradient(circle at 70% 25%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 36%),
    var(--surface-3);
}

.preview-placeholder span {
  color: var(--accent-contrast);
  background: var(--accent);
}

.preview-placeholder small {
  color: var(--muted);
}

.compatibility-workbench,
.compatibility-dashboard,
.conflict-item,
.conflict-diagnostic-card {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

/* Server workspace */

.server-page-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: var(--surface);
}

.server-page-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}

.server-page-hero::after {
  display: none;
}

.server-hero-aside {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: min(520px, 44vw);
  gap: 10px;
  justify-items: end;
}

.server-hero-mark {
  position: relative;
  width: 178px;
  height: 56px;
  color: color-mix(in srgb, var(--forest-ink) 42%, var(--line));
  opacity: .78;
}

.server-hero-mark > .ui-icon {
  width: 100%;
  height: 100%;
}

.server-hero-mark > span {
  position: absolute;
  right: 17px;
  bottom: 5px;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: var(--accent-contrast);
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--text) 12%, transparent);
}

.server-hero-mark > span .ui-icon {
  width: 17px;
  height: 17px;
}

.server-page-hero .project-kpis {
  position: relative;
  z-index: 1;
  justify-content: flex-end;
}

.server-page-hero .project-kpis > span,
[data-theme="light"] .server-page-hero .project-kpis > span {
  border-color: var(--line);
  background: var(--surface-raised);
}

.server-layout {
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
}

.server-sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
}

.server-sidebar,
.server-command-center,
.server-workspace,
.server-network-panel {
  border-color: var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.server-view-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  margin-bottom: 14px;
}

.server-view-tabs button {
  min-height: 52px;
  padding: 7px 9px;
  grid-template-columns: 27px minmax(0, 1fr);
  column-gap: 8px;
}

.server-view-tabs button > span {
  width: 27px;
  height: 27px;
  color: var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
}

.server-view-tabs button strong {
  font-size: .75rem;
}

.server-view-tabs button small {
  font-size: .62rem;
}

.server-sidebar nav a {
  padding: 11px;
  color: var(--text);
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.server-sidebar nav a:hover,
.server-sidebar nav a.active {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--accent-soft);
}

.server-profile-groups h3 > span {
  color: var(--accent-contrast);
  background: var(--accent);
}

.server-status {
  position: relative;
  padding: 5px 9px 5px 20px;
  border-radius: 999px;
  font-size: .65rem;
}

.server-status::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 6px;
  height: 6px;
  translate: 0 -50%;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
}

.server-status.online {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 36%, var(--line));
  background: var(--success-soft);
}

.server-status.degraded,
.server-status.offline {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 35%, var(--line));
  background: var(--warning-soft);
}

.server-status.offline {
  color: var(--offline);
  border-color: color-mix(in srgb, var(--offline) 42%, var(--line));
  background: var(--offline-soft);
}

.server-status.starting {
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 35%, var(--line));
  background: var(--info-soft);
}

.server-status.conflict {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: var(--danger-soft);
}

.server-action {
  position: relative;
  overflow: hidden;
  min-height: 68px;
  padding: 12px 14px;
  border-color: var(--line-strong);
  border-radius: var(--radius-md);
  background:
    linear-gradient(120deg, transparent 0 76%, color-mix(in srgb, var(--accent) 4%, transparent) 76%),
    var(--surface-2);
  box-shadow: var(--shadow-inset);
}

.server-action:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
}

.server-action-icon {
  display: grid;
  width: 34px;
  height: 34px;
  color: var(--accent-contrast);
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 68%, var(--line));
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, white), var(--accent));
}

.server-action-icon .ui-icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.1;
}

.server-action.danger-action,
.server-action.force-stop-action {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--line));
  background: var(--danger-soft);
}

.server-action.danger-action .server-action-icon {
  color: #fff;
  border-color: color-mix(in srgb, var(--danger) 76%, #000);
  background: linear-gradient(180deg, color-mix(in srgb, var(--danger) 86%, white), var(--danger));
}

.server-action.force-stop-action strong {
  color: var(--danger);
}

.maintenance-action {
  border-color: color-mix(in srgb, var(--update) 42%, var(--line));
  background: var(--update-soft);
}

.maintenance-action .server-action-icon {
  border-color: color-mix(in srgb, var(--update) 68%, var(--line));
  background: var(--update);
}

.runtime-live-indicator,
.network-state-pill {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 38%, var(--line));
  background: var(--success-soft);
}

.network-state-pill.is-off {
  color: var(--offline);
  border-color: color-mix(in srgb, var(--offline) 42%, var(--line));
  background: var(--offline-soft);
}

.runtime-live-indicator i {
  background: var(--success);
}

.summary-columns > div,
.runtime-facts > span,
.network-address-card,
.network-port-grid > article,
.local-profile-mode-form {
  border-color: var(--line);
  background: var(--surface-2);
}

.summary-columns span,
.network-port-grid strong {
  color: var(--accent-strong);
}

.network-port-grid .rcon-port-card {
  border-color: color-mix(in srgb, var(--info) 32%, var(--line));
  background: var(--info-soft);
}

.network-port-grid .rcon-port-card strong {
  color: var(--info);
}

[data-theme="light"] .server-sidebar,
[data-theme="light"] .server-view-tabs,
[data-theme="light"] .server-command-center,
[data-theme="light"] .runtime-monitor-panel,
[data-theme="light"] .server-network-panel,
[data-theme="light"] .rcon-console-panel,
[data-theme="light"] .server-data-panel,
[data-theme="light"] .remote-connection-panel,
[data-theme="light"] .pack-apply-panel,
[data-theme="light"] .server-mod-audit,
[data-theme="light"] .server-workspace {
  border-color: var(--line);
  background: var(--surface-raised);
}

[data-theme="light"] .server-sidebar nav a,
[data-theme="light"] .summary-columns > div,
[data-theme="light"] .runtime-facts > span,
[data-theme="light"] .runtime-instance,
[data-theme="light"] .network-address-card,
[data-theme="light"] .network-port-grid > article,
[data-theme="light"] .local-profile-mode-form,
[data-theme="light"] .server-action:not(.danger-action),
[data-theme="light"] .admin-account-state,
[data-theme="light"] .admin-bootstrap {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
}

[data-theme="light"] .server-sidebar nav a:hover,
[data-theme="light"] .server-sidebar nav a.active,
[data-theme="light"] .server-view-tabs button:hover,
[data-theme="light"] .server-view-tabs button.is-active {
  color: var(--text-strong);
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  background: var(--accent-soft);
}

[data-theme="light"] .server-view-tabs button > span {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

[data-theme="light"] .server-view-tabs button.is-active > span {
  color: var(--accent-contrast);
  background: var(--accent);
}

[data-theme="light"] .server-status.online {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 42%, var(--line));
  background: var(--success-soft);
}

[data-theme="light"] .server-status.offline {
  color: var(--offline);
  border-color: color-mix(in srgb, var(--offline) 44%, var(--line));
  background: var(--offline-soft);
}

[data-theme="light"] .server-status.degraded {
  color: color-mix(in srgb, var(--warning) 72%, var(--text));
  border-color: color-mix(in srgb, var(--warning) 44%, var(--line));
  background: var(--warning-soft);
}

[data-theme="light"] .runtime-live-indicator,
[data-theme="light"] .network-state-pill {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 42%, var(--line));
  background: var(--success-soft);
}

[data-theme="light"] .network-state-pill.is-off {
  color: var(--offline);
  border-color: color-mix(in srgb, var(--offline) 44%, var(--line));
  background: var(--offline-soft);
}

[data-theme="light"] .network-port-grid .rcon-port-card {
  border-color: color-mix(in srgb, var(--info) 36%, var(--line));
  background: var(--info-soft);
}

[data-theme="light"] .maintenance-action {
  border-color: color-mix(in srgb, var(--update) 42%, var(--line));
  background: var(--update-soft) !important;
}

.process-log-shell,
.rcon-console,
.process-output {
  border-color: #303a34;
  border-radius: var(--radius-md);
  background: #101311;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
}

.process-log-filters button {
  color: #b8b2a3;
  border-color: #303a34;
  border-radius: var(--radius-xs);
  background: #1e2420;
}

.process-log-filters button:hover,
.process-log-filters button.is-active {
  color: #ece6d8;
  border-color: color-mix(in srgb, var(--info) 50%, #303a34);
  background: color-mix(in srgb, var(--info) 18%, #1e2420);
}

.process-log-filters button span {
  color: #b8b2a3;
  background: #252d28;
}

/* Workshop and data views */

.catalog-hero {
  align-items: center;
}

.workshop-catalog-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workshop-catalog-card {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.workshop-catalog-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: var(--shadow);
}

.workshop-catalog-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent), var(--shadow-sm);
}

.workshop-preview {
  min-height: 158px;
  background: var(--surface-3);
}

.workshop-preview img {
  height: 158px;
}

.workshop-preview > span:not(.catalog-state) {
  color: color-mix(in srgb, var(--accent) 28%, transparent);
}

.workshop-card-copy {
  padding: 14px;
}

.workshop-id,
.local-version,
.workshop-version {
  color: var(--accent) !important;
}

.workshop-card-copy > strong {
  font-size: .9rem;
}

.workshop-card-copy > small {
  color: var(--muted);
  font-size: .75rem;
}

.workshop-stats span {
  color: var(--muted);
  background: var(--surface-3);
}

table {
  color: var(--text);
  border-color: var(--line);
}

th {
  color: var(--muted);
  background: var(--surface-2);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

td {
  font-size: .76rem;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}

/* Dialogs and loading feedback */

.confirmation-overlay {
  background: rgba(33, 37, 32, .46);
  backdrop-filter: blur(8px) saturate(.9);
}

[data-theme="dark"] .confirmation-overlay {
  background: rgba(16, 19, 17, .72);
}

.loading-overlay,
[data-theme="light"] .loading-overlay {
  background: rgba(33, 37, 32, .32);
  backdrop-filter: grayscale(.68) saturate(.5) brightness(.9) blur(3px);
}

[data-theme="dark"] .loading-overlay {
  background: rgba(16, 19, 17, .58);
  backdrop-filter: grayscale(.58) saturate(.54) brightness(.74) blur(3px);
}

html[aria-busy="true"].has-loading-overlay::before,
html[aria-busy="true"].has-loading-overlay::after,
html[aria-busy="true"]:has(.loading-overlay:not([hidden]))::before,
html[aria-busy="true"]:has(.loading-overlay:not([hidden]))::after {
  content: none !important;
  display: none !important;
}

.confirmation-card,
.loading-card {
  border-color: var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.confirmation-mark {
  color: var(--accent-contrast);
  border-radius: var(--radius-md);
  background: var(--accent);
}

.loading-emblem {
  --zombie-skin: #918c79;
  --zombie-hair: #2b2823;
  --zombie-outline: #171410;
  --zombie-wound: #8a3830;
  --zombie-shirt: #5a4e42;
  position: relative;
  isolation: isolate;
  width: 76px;
  height: 76px;
  overflow: visible;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 82%, var(--line));
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 46%, #2a2620 0 53%, #13110e 54% 100%);
  box-shadow:
    inset 0 0 0 5px color-mix(in srgb, var(--accent) 7%, transparent),
    0 0 0 5px color-mix(in srgb, var(--accent) 8%, transparent),
    0 12px 34px color-mix(in srgb, var(--accent) 24%, transparent);
}

.loading-emblem::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 50%;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .5);
}

.loading-character {
  position: relative;
  z-index: 3;
  width: 49px;
  height: 49px;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .42));
  animation: pzasm-zombie-breathe 1.8s ease-in-out infinite;
}

.loading-scratches {
  position: absolute;
  z-index: 4;
  right: 7px;
  bottom: 9px;
  width: 21px;
  height: 17px;
  opacity: .78;
  background: repeating-linear-gradient(108deg, transparent 0 4px, var(--danger) 4px 6px, transparent 6px 8px);
  clip-path: polygon(0 0, 100% 18%, 86% 100%, 8% 82%);
  animation: pzasm-scratch-flicker 1.8s ease-in-out infinite;
}

.loading-card {
  width: min(560px, 100%);
  padding: 24px;
}

.loading-spinner {
  z-index: 5;
  inset: -8px;
  border-width: 2px;
  border-color: color-mix(in srgb, var(--accent) 18%, transparent);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 44%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 12%, transparent);
}

.loading-track {
  background: var(--surface-3);
}

.loading-track span,
.loading-track span.is-determinate {
  background-color: var(--accent);
}

.loading-progress-item {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.loading-progress-item.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 11%, transparent);
}

.loading-progress-item.is-current > span:first-child {
  color: var(--accent-contrast);
  border-color: var(--accent);
  background: var(--accent);
}

.loading-progress-item.is-complete > span:first-child {
  border-color: var(--success);
  background: var(--success);
}

.loading-stage > span {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.loading-interaction {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}

.loading-overlay.has-error .loading-card {
  border-color: var(--danger);
}

html[aria-busy="true"]::before {
  background: rgba(33, 37, 32, .32) !important;
  backdrop-filter: grayscale(.68) saturate(.5) brightness(.9) blur(3px) !important;
}

html[data-theme="dark"][aria-busy="true"]::before {
  background: rgba(16, 19, 17, .58) !important;
  backdrop-filter: grayscale(.58) saturate(.54) brightness(.74) blur(3px) !important;
}

html[aria-busy="true"]::after {
  width: min(390px, calc(100vw - 32px)) !important;
  padding: 22px 26px !important;
  color: var(--text) !important;
  border-color: var(--line-strong) !important;
  border-radius: var(--radius-lg) !important;
  background: var(--surface-raised) !important;
  box-shadow: var(--shadow-lg) !important;
  font-size: calc(14px * var(--font-scale)) !important;
}

@keyframes pzasm-live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 48%, transparent); }
  70% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--success) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 0%, transparent); }
}

@keyframes pzasm-zombie-breathe {
  0%, 100% { transform: translateY(1px) rotate(-1deg) scale(.98); }
  50% { transform: translateY(-1px) rotate(1deg) scale(1.025); }
}

@keyframes pzasm-scratch-flicker {
  0%, 100% { opacity: .46; transform: translate(1px, 1px); }
  42% { opacity: .82; }
  50% { opacity: .62; transform: translate(0, 0); }
  58% { opacity: .9; }
}

@keyframes pzasm-panel-enter {
  from { opacity: 0; translate: 0 5px; }
  to { opacity: 1; translate: 0 0; }
}

.workspace-panel:not([hidden]),
.server-view-stack > [data-server-view]:not([hidden]) {
  animation: pzasm-panel-enter .2s ease-out both;
}

/* Authentication */

.auth-shell {
  min-height: calc(100vh - var(--topbar-height));
  padding-top: clamp(36px, 6vw, 88px);
  padding-bottom: clamp(36px, 6vw, 88px);
}

.auth-card,
.account-card {
  border-color: var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-intro h1 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
}

/* Responsive behavior */

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 220px;
  }

  .server-layout {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .project-grid,
  .workshop-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .account-menu-copy {
    display: none;
  }

  .account-menu > summary {
    min-width: 52px;
    grid-template-columns: 32px 12px;
  }
}

@media (max-width: 920px) {
  .app-frame {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-main {
    grid-column: 1;
  }

  .app-sidebar {
    width: min(280px, calc(100vw - 44px));
    transform: translateX(-104%);
    box-shadow: 20px 0 70px rgba(0, 0, 0, .28);
    transition: transform .2s ease;
  }

  .app-frame.is-sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 390;
    inset: 0;
    background: rgba(5, 8, 11, .58);
    backdrop-filter: blur(3px);
  }

  .app-frame.is-sidebar-open .sidebar-scrim {
    display: block !important;
  }

  .topbar-menu-button {
    display: grid;
  }

  .server-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .server-sidebar {
    position: static;
  }

  .server-page-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .server-hero-aside {
    width: 100%;
    min-width: 0;
    justify-items: start;
  }

  .server-page-hero .project-kpis {
    justify-content: flex-start;
  }

  .dashboard-grid,
  .modpack-tools-grid,
  .modpack-import-panel,
  .transfer-panel,
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .modpack-import-panel > .eyebrow,
  .modpack-import-panel > h2,
  .modpack-import-panel > p,
  .modpack-import-panel > form,
  .modpack-import-panel > .transfer-note {
    grid-column: 1;
    grid-row: auto;
  }

  .transfer-panel > .eyebrow,
  .transfer-panel > h2,
  .transfer-panel > p,
  .transfer-panel > form {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 680px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-topbar {
    padding: 0 12px;
  }

  .app-preferences {
    padding: 0;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .language-control select,
  .font-scale-control select,
  .theme-toggle {
    width: auto;
  }

  .account-menu {
    width: auto;
    padding: 0;
    margin: 0 0 0 2px;
    border: 0;
  }

  .app-content {
    padding: 16px 12px 40px;
  }

  .topbar-breadcrumb > span,
  .topbar-breadcrumb > a,
  .topbar-breadcrumb .breadcrumb-separator,
  .theme-toggle [data-theme-label] {
    display: none;
  }

  .theme-toggle {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .language-control select,
  .font-scale-control select {
    min-width: 54px;
  }

  .account-menu > summary {
    min-width: 42px;
    padding-right: 4px;
    grid-template-columns: 34px;
  }

  .account-menu > summary > .ui-icon {
    display: none;
  }

  .hero,
  .workspace-hero,
  .catalog-hero {
    padding: 24px 20px;
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-mark {
    display: none;
  }

  .legal-banner,
  .panel-heading,
  .section-heading,
  .project-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel,
  .create-panel,
  .setting-card {
    padding: 17px;
  }

  .project-grid,
  .workshop-catalog-grid,
  .form-grid.two,
  .server-action-grid,
  .dashboard-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-summary-card {
    min-height: 86px;
  }

  .path-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .path-list dd {
    margin-bottom: 8px;
  }

  .server-view-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-tabs {
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .workspace-tabs button {
    scroll-snap-align: start;
  }

  .loading-card {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .loading-emblem {
    display: grid;
    width: 52px;
    height: 52px;
  }

  .loading-character {
    width: 36px;
    height: 36px;
  }

  .loading-scratches {
    right: 3px;
    bottom: 5px;
    width: 16px;
    height: 13px;
  }

  .app-footer {
    width: calc(100% - 24px);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .auth-content {
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
    padding: 0 20px;
    overflow: hidden;
  }

  .auth-shell {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    overflow: hidden;
  }

  .auth-shell > *,
  .auth-intro,
  .auth-card {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .auth-intro h1 {
    width: 100%;
    min-width: 0;
    max-width: calc(100vw - 40px);
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    font-size: clamp(2.25rem, 11vw, 3rem);
  }

  .auth-intro p {
    max-width: 100%;
    overflow-wrap: break-word;
    font-size: .9rem;
  }

  .auth-card {
    padding: 22px;
  }

  .auth-card .stack-form,
  .auth-card label,
  .auth-card input,
  .auth-card button {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 440px) {
  .auth-topbar {
    min-height: 58px;
    padding: 0 14px;
  }

  .auth-topbar .app-brand-copy strong {
    max-width: 158px;
  }

  .auth-topbar .app-preferences {
    display: none;
  }

  .auth-content {
    padding: 0 14px;
  }

  .auth-shell {
    padding: 34px 0;
  }

  .auth-intro h1 {
    max-width: calc(100vw - 28px);
    font-size: clamp(2rem, 10vw, 2.7rem);
    line-height: 1.05;
  }

  .auth-card {
    padding: 19px;
  }
}

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

/* Final palette and interaction normalization */

.primary-navigation a:hover {
  color: var(--sidebar-text-strong);
  border-color: var(--sidebar-border);
  background: var(--sidebar-hover);
  transform: none;
}

.primary-navigation a.is-active,
[data-theme="light"] .primary-navigation a.is-active,
[data-theme="dark"] .primary-navigation a.is-active {
  color: color-mix(in srgb, var(--accent) 76%, var(--text));
  border-color: color-mix(in srgb, var(--accent) 58%, var(--sidebar-border));
  background: var(--accent-soft);
  box-shadow: none;
}

.primary-navigation a.is-active::before {
  background: var(--accent);
}

.primary-navigation a.is-active .ui-icon,
.primary-navigation a.is-active-secondary .ui-icon {
  color: var(--accent);
}

.account-avatar {
  background:
    radial-gradient(circle at 62% 30%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 34%),
    var(--surface-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent);
}

input,
textarea,
select,
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: none;
}

input:hover,
textarea:hover,
select:hover {
  border-color: color-mix(in srgb, var(--info) 50%, var(--line-strong));
  background: color-mix(in srgb, var(--info) 3%, var(--surface));
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--info);
  background: var(--surface);
  box-shadow: var(--focus-ring);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
}

.button::after {
  content: none;
  display: none;
}

.button.primary,
[data-theme="light"] .button.primary,
[data-theme="dark"] .button.primary {
  color: var(--accent-contrast);
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: none;
}

.button.primary:hover,
[data-theme="light"] .button.primary:hover,
[data-theme="dark"] .button.primary:hover {
  color: var(--accent-contrast);
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 18%, transparent);
}

.button.primary:active,
[data-theme="light"] .button.primary:active,
[data-theme="dark"] .button.primary:active {
  border-color: var(--accent-pressed);
  background: var(--accent-pressed);
}

.button.secondary,
[data-theme="light"] .button.secondary,
[data-theme="dark"] .button.secondary {
  color: var(--text);
  border-color: color-mix(in srgb, var(--amber) 54%, var(--line));
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
  box-shadow: none;
}

.button.secondary:hover {
  color: var(--text-strong);
  border-color: var(--amber);
  background: color-mix(in srgb, var(--amber) 14%, var(--surface));
}

.button.ghost,
[data-theme="light"] .button.ghost,
[data-theme="dark"] .button.ghost {
  color: var(--muted-strong);
  border-color: var(--line);
  background: transparent;
  box-shadow: none;
}

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

.button.danger,
.button.danger-outline,
[data-theme="light"] .button.danger,
[data-theme="light"] .button.danger-outline,
[data-theme="dark"] .button.danger,
[data-theme="dark"] .button.danger-outline {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
  background: var(--danger-soft);
  box-shadow: none;
}

.button.danger:hover,
.button.danger-outline:hover {
  color: var(--accent-contrast);
  border-color: var(--danger);
  background: var(--danger);
}

.button:active,
.primary-command:active,
.server-action:active {
  transform: none;
  box-shadow: none;
}

.button:disabled,
.primary-command:disabled,
.server-action:disabled,
.catalog-selected-remove:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: var(--disabled);
  box-shadow: none;
  opacity: .62;
}

.panel,
.dashboard-summary-card,
.workspace-hero,
.catalog-hero,
.server-page-hero,
.server-command-center,
.server-workspace,
.server-network-panel {
  box-shadow: var(--shadow-sm);
}

.dashboard-summary-icon,
.dashboard-summary-icon.is-success,
.dashboard-summary-icon.is-warning,
.dashboard-summary-icon.is-info {
  box-shadow: none;
}

.primary-command,
[data-theme="light"] .primary-command,
[data-theme="dark"] .primary-command,
.server-action {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

.primary-command:hover:not(:disabled),
[data-theme="light"] .primary-command:hover:not(:disabled),
[data-theme="dark"] .primary-command:hover:not(:disabled),
.server-action:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.primary-command-icon,
[data-theme="light"] .primary-command-icon,
[data-theme="dark"] .primary-command-icon,
.update-command .primary-command-icon,
.publish-command .primary-command-icon,
.folder-command .primary-command-icon,
.server-action-icon {
  color: var(--accent-contrast);
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: none;
}

.server-action.danger-action,
.server-action.force-stop-action {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  background: var(--danger-soft);
}

.server-action.danger-action .server-action-icon,
.server-action.force-stop-action .server-action-icon {
  color: var(--accent-contrast);
  border-color: var(--danger);
  background: var(--danger);
  box-shadow: none;
}

.maintenance-action,
[data-theme="light"] .maintenance-action,
[data-theme="dark"] .maintenance-action {
  border-color: color-mix(in srgb, var(--update) 44%, var(--line));
  background: var(--update-soft) !important;
}

.maintenance-action .server-action-icon {
  border-color: var(--update);
  background: var(--update);
}

.workspace-tabs button:hover,
.server-view-tabs button:hover,
[data-theme="light"] .workspace-tabs button:hover,
[data-theme="dark"] .workspace-tabs button:hover,
[data-theme="light"] .server-view-tabs button:hover,
[data-theme="dark"] .server-view-tabs button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: none;
}

.workspace-tabs button.is-active,
.server-view-tabs button.is-active,
[data-theme="light"] .workspace-tabs button.is-active,
[data-theme="dark"] .workspace-tabs button.is-active,
[data-theme="light"] .server-view-tabs button.is-active,
[data-theme="dark"] .server-view-tabs button.is-active {
  color: var(--text-strong);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: var(--accent-soft);
  box-shadow: none;
}

.workspace-tabs button.is-active::after,
.server-view-tabs button.is-active::after {
  height: 2px;
  background: var(--accent);
}

.workspace-tabs button.is-active span,
.server-view-tabs button.is-active > span,
[data-theme="light"] .workspace-tabs button.is-active span,
[data-theme="dark"] .workspace-tabs button.is-active span,
[data-theme="light"] .server-view-tabs button.is-active > span,
[data-theme="dark"] .server-view-tabs button.is-active > span {
  color: var(--accent-contrast);
  background: var(--accent);
  box-shadow: none;
}

.choice-card:has(input:checked),
.mod-import-candidate:has(input:checked),
.local-catalog-card.is-selected,
.workshop-catalog-card.is-selected,
[data-theme="light"] .choice-card:has(input:checked),
[data-theme="dark"] .choice-card:has(input:checked),
[data-theme="light"] .mod-import-candidate:has(input:checked),
[data-theme="dark"] .mod-import-candidate:has(input:checked),
[data-theme="light"] .local-catalog-card.is-selected,
[data-theme="dark"] .local-catalog-card.is-selected,
[data-theme="light"] .workshop-catalog-card.is-selected,
[data-theme="dark"] .workshop-catalog-card.is-selected {
  color: var(--text);
  border-color: color-mix(in srgb, var(--selection) 62%, var(--line));
  background: var(--selection-soft);
  box-shadow: none;
}

.choice-card:hover,
.mod-import-candidate:hover,
.local-catalog-card:hover,
.workshop-catalog-card:hover {
  border-color: color-mix(in srgb, var(--selection) 44%, var(--line));
  background: color-mix(in srgb, var(--selection) 5%, var(--surface));
}

.server-sidebar nav a:hover,
[data-theme="light"] .server-sidebar nav a:hover,
[data-theme="dark"] .server-sidebar nav a:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: none;
}

.server-sidebar nav a.active,
[data-theme="light"] .server-sidebar nav a.active,
[data-theme="dark"] .server-sidebar nav a.active {
  color: var(--text-strong);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: var(--accent-soft);
  box-shadow: none;
}

.catalog-source-tabs a:hover,
.catalog-tag-presets button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.catalog-source-tabs a.active,
.catalog-tag-presets button.active,
.catalog-state,
.is-selected .catalog-state,
[data-theme="light"] .catalog-source-tabs a.active,
[data-theme="dark"] .catalog-source-tabs a.active,
[data-theme="light"] .catalog-tag-presets button.active,
[data-theme="dark"] .catalog-tag-presets button.active {
  color: var(--accent-contrast);
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: none;
}

.project-export-menu[open] > summary {
  color: color-mix(in srgb, var(--selection) 74%, var(--text));
  border-color: var(--selection);
  background: var(--selection-soft);
  box-shadow: none;
}

.process-log-shell,
.rcon-console,
.process-output,
[data-theme="light"] .process-log-shell,
[data-theme="light"] .rcon-console,
[data-theme="light"] .process-output,
[data-theme="dark"] .process-log-shell,
[data-theme="dark"] .rcon-console,
[data-theme="dark"] .process-output {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-2);
  box-shadow: none;
}

.process-log-filters button,
[data-theme="light"] .process-log-filters button,
[data-theme="dark"] .process-log-filters button {
  color: var(--muted-strong);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

.process-log-filters button:hover,
[data-theme="light"] .process-log-filters button:hover,
[data-theme="dark"] .process-log-filters button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.process-log-filters button.is-active,
[data-theme="light"] .process-log-filters button.is-active,
[data-theme="dark"] .process-log-filters button.is-active {
  color: var(--text-strong);
  border-color: color-mix(in srgb, var(--selection) 58%, var(--line));
  background: var(--selection-soft);
  box-shadow: none;
}

.process-log-filters button span,
[data-theme="light"] .process-log-filters button span,
[data-theme="dark"] .process-log-filters button span {
  color: var(--muted-strong);
  background: var(--surface-3);
}

.process-log-filters button.is-active span {
  color: var(--accent-contrast);
  background: var(--selection);
}

.process-log-line:hover {
  background: color-mix(in srgb, var(--info) 12%, #171b18);
}

.runtime-instance,
[data-theme="light"] .runtime-instance,
[data-theme="dark"] .runtime-instance {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-2);
}

.runtime-instance.hosted,
[data-theme="light"] .runtime-instance.hosted,
[data-theme="dark"] .runtime-instance.hosted {
  border-color: color-mix(in srgb, var(--info) 42%, var(--line));
  background: var(--info-soft);
}

.runtime-instance.hosted .runtime-instance-icon {
  color: var(--accent-contrast);
  background: var(--info);
}

.runtime-instance code {
  color: var(--info);
}

.runtime-instance-warning {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  background: var(--danger-soft);
}

.process-log-view,
[data-theme="light"] .process-log-view,
[data-theme="dark"] .process-log-view {
  color: #ece6d8;
  border-color: #303a34;
  background: #101311;
  box-shadow: none;
}

.process-log-toolbar,
[data-theme="light"] .process-log-toolbar,
[data-theme="dark"] .process-log-toolbar {
  color: #ece6d8;
  border-bottom-color: #303a34;
  background: #171b18;
}

.process-log-toolbar > div:first-child strong {
  color: #ece6d8;
}

.process-log-toolbar > div:first-child small,
.process-log-search {
  color: #8b877d;
}

.process-log-search input,
[data-theme="light"] .process-log-search input,
[data-theme="dark"] .process-log-search input {
  color: #ece6d8;
  border-color: #303a34;
  background: #101311;
  box-shadow: none;
}

.process-log-search input:hover {
  border-color: #5b7283;
  background: #171b18;
}

.process-log-search input:focus {
  border-color: #8fa6b8;
  background: #101311;
  box-shadow: 0 0 0 3px rgba(143, 166, 184, .42);
}

.process-log-search input::placeholder {
  color: #8b877d;
}

.process-log-filters button,
[data-theme="light"] .process-log-filters button,
[data-theme="dark"] .process-log-filters button {
  color: #b8b2a3;
  border-color: #303a34;
  background: #1e2420;
}

.process-log-filters button:hover,
[data-theme="light"] .process-log-filters button:hover,
[data-theme="dark"] .process-log-filters button:hover {
  color: #ece6d8;
  border-color: #4a5047;
  background: #252d28;
}

.process-log-filters button.is-active,
[data-theme="light"] .process-log-filters button.is-active,
[data-theme="dark"] .process-log-filters button.is-active {
  color: #ece6d8;
  border-color: #5b7283;
  background: rgba(91, 114, 131, .2);
}

.process-log-filters button span,
[data-theme="light"] .process-log-filters button span,
[data-theme="dark"] .process-log-filters button span {
  color: #b8b2a3;
  background: #252d28;
}

.process-log-filters button.is-active span {
  color: #ffffff;
  background: #5b7283;
}

.process-terminal,
[data-theme="light"] .process-terminal,
[data-theme="dark"] .process-terminal {
  color: #ece6d8;
  background: #101311;
  scrollbar-color: #4a5047 #171b18;
}

.process-terminal-empty {
  color: #8b877d;
}

.process-terminal-empty strong {
  color: #b8b2a3;
}

.process-log-line {
  color: #b8b2a3;
  border-bottom-color: #303a34;
}

.process-log-line:nth-child(even) {
  background: rgba(255, 255, 255, .02);
}

.process-log-line time,
.process-log-line > span {
  color: #8b877d;
}

.process-log-line code,
.process-log-line.level-stack code {
  color: #b8b2a3 !important;
}

.process-log-line.level-error {
  color: #ece6d8;
  border-left-color: #b35a4d;
  background: rgba(179, 90, 77, .18);
}

.process-log-line.level-error > span,
.process-log-line.level-error code {
  color: #ece6d8 !important;
}

.process-log-line.level-warning {
  border-left-color: #d4a24a;
  background: rgba(212, 162, 74, .18);
}

.process-log-line.level-warning > span {
  color: #d4a24a;
}

.process-log-line.level-success {
  border-left-color: #6f9b5c;
  background: rgba(111, 155, 92, .18);
}

.process-log-line.level-success > span {
  color: #6f9b5c;
}

.process-log-line.level-system > span {
  color: #8fa6b8;
}

.process-log-line.level-stack,
.process-log-line.level-stack code {
  color: #8b877d !important;
}

.conflict-type-card.risk-low,
.conflict-issue.risk-low,
.diff-hero.risk-low {
  --risk-color: var(--info);
}

.conflict-type-heading > a.active,
.conflict-filter-group a.active,
.conflict-pager a.active,
.diff-view-switch button.active {
  color: var(--accent-contrast);
  border-color: var(--selection);
  background: var(--selection);
  box-shadow: none;
}

.conflict-type-heading > a:hover,
.conflict-filter-group a:hover,
.conflict-pager a:hover,
.diff-view-switch button:hover,
.diff-change-navigation button:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--selection) 48%, var(--line));
  background: var(--selection-soft);
}

.conflict-type-card.active {
  border-color: color-mix(in srgb, var(--selection) 58%, var(--line));
  border-left-color: var(--risk-color);
  background: var(--selection-soft);
  box-shadow: none;
}

.severity-information .conflict-severity-mark {
  background: var(--info);
}

.conflict-issue.is-resolved .conflict-severity-mark {
  background: var(--success);
}

.workshop-id,
.local-version,
.workshop-version,
.summary-columns span,
.network-port-grid strong {
  color: var(--info) !important;
}

.loading-emblem {
  background:
    radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--surface-3) 82%, var(--bg)) 0 53%, var(--bg) 54% 100%);
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--accent) 8%, transparent),
    0 12px 34px color-mix(in srgb, var(--accent) 20%, transparent);
}

.loading-emblem::before {
  box-shadow: none;
}

.workspace-tabs button.is-active:hover,
.server-view-tabs button.is-active:hover,
[data-theme="light"] .workspace-tabs button.is-active:hover,
[data-theme="dark"] .workspace-tabs button.is-active:hover,
[data-theme="light"] .server-view-tabs button.is-active:hover,
[data-theme="dark"] .server-view-tabs button.is-active:hover {
  color: var(--accent-contrast);
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  box-shadow: none;
}

[data-loading-interaction-error] {
  color: var(--danger) !important;
}
