:root {
  --ink-950: #0d1f19;
  --ink-900: #12261f;
  --ink-800: #1c352c;
  --ink-700: #2a4339;
  --ink-600: #3d574c;
  --ink-500: #64786f;
  --ink-400: #65786e;
  --ink-300: #b4c0ba;
  --ink-200: #d7dfdb;
  --ink-100: #e9eeeb;
  --ink-50: #f2f5f3;
  --surface: #ffffff;
  --canvas: #f5f7f6;
  --canvas-raised: #fafbfa;
  --border: #dfe6e2;
  --border-strong: #cbd6d0;
  --accent: #0b7d5a;
  --accent-strong: #087052;
  --accent-soft: #e8f6f0;
  --accent-border: #bce6d6;
  --blue: #3269d7;
  --blue-soft: #edf3ff;
  --blue-border: #c9daff;
  --amber: #9c5f09;
  --amber-soft: #fff7e8;
  --amber-border: #f3d9aa;
  --rose: #b7424f;
  --rose-soft: #fff0f1;
  --rose-border: #f2cdd1;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(13, 31, 25, 0.04);
  --shadow-md: 0 18px 48px rgba(13, 31, 25, 0.12);
  --sidebar-width: 248px;
  --topbar-height: 68px;
  --content-max: 1480px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --transition: 180ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink-900);
  background: var(--canvas);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

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

button:not(:disabled),
label[for],
select:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.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;
}

:focus-visible {
  outline: 3px solid rgba(14, 139, 101, 0.28);
  outline-offset: 2px;
}

::selection {
  color: var(--white);
  background: var(--accent);
}

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

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(8, 25, 18, 0.76), rgba(8, 25, 18, 0.88)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 64px);
  backdrop-filter: blur(10px);
}

body.is-authenticated .auth-gate {
  display: none;
}

.auth-card {
  width: min(420px, 100%);
  padding: 30px;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-brand .brand-mark {
  color: #08271c;
  background: var(--accent);
}

.auth-brand > div {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.auth-brand strong {
  color: var(--ink-950);
  font-size: 17px;
}

.auth-brand span:not(.brand-mark) {
  margin-top: 3px;
  color: var(--ink-400);
  font-size: 9px;
  font-weight: 700;
}

.auth-copy {
  margin: 30px 0 22px;
}

.auth-copy h1 {
  margin: 0;
  color: var(--ink-950);
  font-size: 25px;
  line-height: 1.25;
}

.auth-copy > p:last-child {
  margin: 8px 0 0;
  color: var(--ink-500);
  font-size: 11px;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form .input-shell input {
  height: 44px;
}

.auth-error {
  margin: 0;
  padding: 9px 10px;
  color: var(--rose);
  background: var(--rose-soft);
  border: 1px solid var(--rose-border);
  border-radius: 6px;
  font-size: 10px;
}

.auth-error[hidden] {
  display: none;
}

.auth-footnote {
  margin: 18px 0 0;
  color: var(--ink-400);
  font-size: 9px;
  text-align: center;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  color: rgba(255, 255, 255, 0.72);
  background: var(--ink-950);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.brand {
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  gap: 11px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #08271c;
  background: #64d3a8;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.brand > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.15;
}

.brand strong {
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
}

.brand span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 9px;
  font-weight: 700;
}

.sidebar-close {
  display: none !important;
  margin-left: auto;
  color: rgba(255, 255, 255, 0.7) !important;
}

.nav-groups {
  flex: 1;
  padding: 22px 12px;
  overflow-y: auto;
}

.nav-group + .nav-group {
  margin-top: 23px;
}

.nav-label {
  margin: 0 0 8px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 700;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
  transition:
    color var(--transition),
    background-color var(--transition);
}

.nav-item + .nav-item {
  margin-top: 3px;
}

.nav-item:hover {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.055);
}

.nav-item.is-active {
  color: var(--white);
  background: rgba(100, 211, 168, 0.13);
}

.nav-item.is-active::before {
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 0;
  width: 2px;
  content: "";
  background: #64d3a8;
  border-radius: 2px;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  stroke-width: 1.8;
}

.nav-item > span:nth-child(2) {
  flex: 1;
  font-size: 13px;
  font-weight: 550;
}

.nav-count,
.nav-tag {
  display: inline-flex;
  min-width: 22px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.075);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.nav-tag {
  color: #8de7c3;
  background: rgba(100, 211, 168, 0.12);
}

.sidebar-footer {
  padding: 14px 16px 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.service-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 7px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: #67d9ad;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(103, 217, 173, 0.1);
}

.service-status div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.service-status strong {
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 600;
}

.service-status span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
}

.service-status svg {
  width: 15px;
  height: 15px;
  color: rgba(255, 255, 255, 0.36);
}

.sidebar-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 3px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: rgba(9, 23, 18, 0.58);
  backdrop-filter: blur(2px);
}

.main-column {
  display: flex;
  width: calc(100% - var(--sidebar-width));
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  flex-direction: column;
  overflow-x: clip;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: var(--topbar-height);
  flex: 0 0 var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 12px;
}

.topbar-actions {
  gap: 8px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-400);
  font-size: 12px;
}

.breadcrumb svg {
  width: 13px;
  height: 13px;
  color: var(--ink-300);
}

.breadcrumb strong {
  color: var(--ink-700);
  font-weight: 600;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  padding: 0;
  color: var(--ink-500);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  transition:
    color var(--transition),
    background-color var(--transition),
    border-color var(--transition);
}

.icon-button:hover {
  color: var(--ink-800);
  background: var(--ink-50);
  border-color: var(--border);
}

.icon-button.subtle {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.notification-button {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 6px;
  height: 6px;
  background: #e16b79;
  border: 1.5px solid var(--white);
  border-radius: 50%;
}

.search-trigger {
  display: flex;
  width: 278px;
  height: 38px;
  align-items: center;
  gap: 9px;
  margin-right: 4px;
  padding: 0 9px 0 12px;
  color: var(--ink-600);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 7px;
  text-align: left;
  transition:
    border-color var(--transition),
    background-color var(--transition);
}

.search-trigger:hover {
  background: var(--white);
  border-color: var(--border-strong);
}

.search-trigger svg {
  width: 15px;
  height: 15px;
}

.search-trigger span {
  flex: 1;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

kbd {
  padding: 2px 5px;
  color: var(--ink-400);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border);
  font-family: inherit;
  font-size: 9px;
}

.profile-button {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  margin-left: 3px;
  padding: 4px 8px 4px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  text-align: left;
  transition:
    background-color var(--transition),
    border-color var(--transition);
}

.profile-button:hover {
  background: var(--ink-50);
  border-color: var(--border);
}

.avatar {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: #174d39;
  background: #dff3e9;
  border: 1px solid #c4e6d7;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.profile-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.profile-copy strong {
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 650;
}

.profile-copy small {
  margin-top: 3px;
  color: var(--ink-400);
  font-size: 9px;
}

.profile-button > svg {
  width: 13px;
  height: 13px;
  color: var(--ink-400);
}

.mobile-menu {
  display: none;
}

.content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 30px;
}

.view[hidden] {
  display: none !important;
}

.view {
  min-width: 0;
  overflow-x: clip;
  animation: view-in 260ms ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
}

.page-heading h1 {
  margin: 0;
  color: var(--ink-950);
  font-size: 28px;
  font-weight: 730;
  line-height: 1.2;
}

.page-description {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--ink-600);
  font-size: 13px;
}

.heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition:
    color var(--transition),
    background-color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

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

.button svg {
  width: 15px;
  height: 15px;
}

.button-primary {
  color: var(--white);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 7px rgba(14, 139, 101, 0.16);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 4px 12px rgba(14, 139, 101, 0.2);
}

.button-primary:disabled {
  color: #9eaaa4;
  background: #e8ecea;
  border-color: #e2e8e5;
  box-shadow: none;
}

.button-secondary {
  color: var(--ink-700);
  background: var(--white);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.button-secondary:hover {
  color: var(--ink-900);
  background: var(--ink-50);
  border-color: #bdcbc3;
}

.button-ghost {
  color: var(--ink-500);
  background: transparent;
  border-color: transparent;
}

.button-ghost:hover {
  color: var(--ink-800);
  background: var(--ink-50);
}

.button-small {
  min-height: 35px;
  padding: 0 12px;
  font-size: 11px;
}

.button-block {
  width: 100%;
}

.link-button,
.text-button,
.table-action,
.toast-close {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: var(--accent-strong);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 650;
}

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

.link-button svg,
.text-button svg {
  width: 13px;
  height: 13px;
}

.text-button {
  min-height: 38px;
  margin-top: 17px;
  padding: 0 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card {
  position: relative;
  min-width: 0;
  padding: 17px 17px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
}

.stat-icon svg {
  width: 16px;
  height: 16px;
}

.stat-icon-green {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}

.stat-icon-blue {
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid var(--blue-border);
}

.stat-icon-amber {
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
}

.stat-icon-rose {
  color: var(--rose);
  background: var(--rose-soft);
  border: 1px solid var(--rose-border);
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.trend svg {
  width: 10px;
  height: 10px;
}

.trend-up {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.trend-neutral {
  color: var(--ink-600);
  background: var(--ink-50);
}

.stat-card > p {
  margin: 14px 0 3px;
  color: var(--ink-500);
  font-size: 11px;
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-value strong {
  color: var(--ink-950);
  font-size: 28px;
  font-weight: 720;
  line-height: 1.2;
}

.stat-value span {
  color: var(--ink-400);
  font-size: 10px;
}

.stat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  padding-top: 11px;
  color: var(--ink-400);
  border-top: 1px solid var(--ink-100);
  font-size: 9px;
}

.stat-foot span:first-child {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-500);
}

.stat-foot svg {
  width: 11px;
  height: 11px;
  color: var(--accent);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header h2,
.summary-head h2 {
  margin: 0;
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 680;
}

.workflow-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.workflow-step {
  display: grid;
  grid-template-columns: auto 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 84px;
  padding: 12px 13px;
  background: var(--canvas-raised);
}

.step-number {
  align-self: start;
  padding-top: 3px;
  color: var(--ink-400);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  font-weight: 700;
}

.step-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
}

.step-icon svg {
  width: 14px;
  height: 14px;
}

.workflow-step strong {
  display: block;
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 650;
}

.workflow-step p {
  margin: 3px 0 0;
  color: var(--ink-400);
  font-size: 9px;
  line-height: 1.5;
}

.step-arrow {
  width: 12px !important;
  height: 12px !important;
  color: var(--ink-300);
}

.status-pill {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.status-pill svg {
  width: 11px;
  height: 11px;
}

.status-pill-green {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.status-pill-blue {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: var(--blue-border);
}

.status-pill-amber {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: var(--amber-border);
}

.status-pill-neutral {
  color: var(--ink-500);
  background: var(--ink-50);
  border-color: var(--ink-100);
}

.server-load-list {
  display: flex;
  flex-direction: column;
}

.server-load-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) minmax(120px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--ink-100);
}

.server-load-row:first-child {
  padding-top: 0;
}

.server-load-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.server-load-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.server-symbol {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: var(--ink-600);
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: 6px;
}

.server-symbol svg {
  width: 14px;
  height: 14px;
}

.server-symbol-muted {
  color: var(--ink-400);
}

.server-load-name > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.server-load-name strong {
  overflow: hidden;
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-load-name span {
  margin-top: 2px;
  color: var(--ink-400);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 8px;
}

.load-meter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.load-meter > span {
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  background: var(--ink-100);
  border-radius: 3px;
}

.load-meter i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.load-meter small {
  flex: 0 0 66px;
  color: var(--ink-400);
  font-size: 8px;
  text-align: right;
  white-space: nowrap;
}

.health-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
}

.health-label::before {
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
}

.health-ok {
  color: var(--accent-strong);
}

.health-ok::before {
  background: var(--accent);
}

.health-warn {
  color: var(--amber);
}

.health-warn::before {
  background: var(--amber);
}

.capacity-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px;
  padding: 12px 0 0;
  border-top: 1px solid var(--ink-100);
}

.capacity-summary > div {
  display: flex;
  flex-direction: column;
  padding: 0 13px;
  border-right: 1px solid var(--ink-100);
}

.capacity-summary > div:first-child {
  padding-left: 0;
}

.capacity-summary > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.capacity-summary span {
  color: var(--ink-400);
  font-size: 8px;
}

.capacity-summary strong {
  margin-top: 2px;
  color: var(--ink-800);
  font-size: 16px;
  font-weight: 700;
}

.accent-text {
  color: var(--accent) !important;
}

.recent-panel {
  margin-top: 14px;
  padding-bottom: 7px;
  overflow: hidden;
}

.muted-note {
  color: var(--ink-400);
  font-size: 9px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th {
  padding: 10px 12px;
  color: var(--ink-400);
  background: var(--canvas-raised);
  border-top: 1px solid var(--ink-100);
  border-bottom: 1px solid var(--ink-100);
  font-size: 8px;
  font-weight: 700;
  text-align: left;
}

th:first-child,
td:first-child {
  border-left: 1px solid var(--ink-100);
}

th:last-child,
td:last-child {
  border-right: 1px solid var(--ink-100);
}

td {
  padding: 13px 12px;
  color: var(--ink-600);
  border-bottom: 1px solid var(--ink-100);
  font-size: 10px;
}

tbody tr {
  transition: background-color var(--transition);
}

tbody tr:hover {
  background: #fbfcfb;
}

td:first-child {
  color: var(--ink-800);
  font-weight: 550;
}

.domain-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.domain-cell svg {
  width: 13px;
  height: 13px;
  color: var(--ink-400);
}

.table-action {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--ink-400);
  border-radius: 5px;
}

.table-action:hover {
  color: var(--ink-700);
  background: var(--ink-50);
}

.table-action svg {
  width: 15px;
  height: 15px;
}

.info-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 15px;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.info-strip-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 6px;
}

.info-strip-icon svg {
  width: 16px;
  height: 16px;
}

.info-strip > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.info-strip strong {
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 650;
}

.info-strip span:not(.status-pill) {
  margin-top: 2px;
  color: var(--ink-400);
  font-size: 9px;
}

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

.server-card {
  min-width: 0;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.server-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(13, 31, 25, 0.055);
}

.server-card-warning {
  border-color: var(--amber-border);
}

.server-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.server-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: var(--ink-600);
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: 7px;
}

.server-avatar svg {
  width: 17px;
  height: 17px;
}

.server-avatar-warning {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: var(--amber-border);
}

.server-title {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.server-title > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.server-title strong {
  overflow: hidden;
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-title > span {
  margin-top: 5px;
  color: var(--ink-400);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 8px;
}

.server-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 19px;
  padding: 13px 0;
  border-top: 1px solid var(--ink-100);
  border-bottom: 1px solid var(--ink-100);
}

.server-card-metrics div {
  display: flex;
  flex-direction: column;
}

.server-card-metrics span {
  color: var(--ink-400);
  font-size: 8px;
}

.server-card-metrics strong {
  margin-top: 3px;
  color: var(--ink-700);
  font-size: 11px;
  font-weight: 650;
}

.card-progress {
  height: 4px;
  margin-top: 13px;
  overflow: hidden;
  background: var(--ink-100);
  border-radius: 3px;
}

.card-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.card-progress-warning span {
  background: var(--amber-border);
}

.server-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
}

.server-card-foot > span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-400);
  font-size: 8px;
}

.server-card-foot > span svg {
  width: 11px;
  height: 11px;
}

.server-card-foot > .warning-text {
  color: var(--amber);
}

.add-resource-card,
.add-template-card {
  display: flex;
  min-height: 250px;
  align-items: center;
  justify-content: center;
  padding: 24px;
  flex-direction: column;
  color: var(--ink-500);
  background: rgba(255, 255, 255, 0.46);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  transition:
    color var(--transition),
    background-color var(--transition),
    border-color var(--transition);
}

.add-resource-card:hover,
.add-template-card:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.add-resource-card > span,
.add-template-card > span {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  place-items: center;
  color: var(--ink-500);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.add-resource-card:hover > span,
.add-template-card:hover > span {
  color: var(--accent-strong);
  border-color: var(--accent-border);
}

.add-resource-card > span svg,
.add-template-card > span svg {
  width: 18px;
  height: 18px;
}

.add-resource-card strong,
.add-template-card strong {
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 650;
}

.add-resource-card small,
.add-template-card small {
  margin-top: 3px;
  color: var(--ink-400);
  font-size: 9px;
}

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

.segmented-control {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--ink-50);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.segment {
  min-height: 34px;
  padding: 0 12px;
  color: var(--ink-500);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  transition:
    color var(--transition),
    background-color var(--transition),
    box-shadow var(--transition);
}

.segment:hover {
  color: var(--ink-800);
}

.segment.is-active {
  color: var(--ink-900);
  background: var(--white);
  box-shadow: 0 1px 3px rgba(13, 31, 25, 0.08);
}

.compact-search {
  display: flex;
  width: 200px;
  height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  color: var(--ink-400);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.compact-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 139, 101, 0.1);
}

.compact-search svg {
  width: 14px;
  height: 14px;
}

.compact-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink-800);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 11px;
}

.compact-search input::placeholder {
  color: var(--ink-400);
}

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

.template-card {
  min-width: 0;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.template-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 10px 28px rgba(13, 31, 25, 0.075);
  transform: translateY(-1px);
}

.template-card[hidden],
.add-template-card[hidden] {
  display: none !important;
}

.template-preview {
  position: relative;
  height: 194px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.preview-browser {
  position: absolute;
  inset: 13px 13px auto;
  z-index: 4;
  display: flex;
  height: 23px;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  color: rgba(13, 31, 25, 0.45);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(13, 31, 25, 0.08);
  border-radius: 4px 4px 0 0;
  backdrop-filter: blur(8px);
}

.preview-browser > span {
  width: 4px;
  height: 4px;
  background: rgba(13, 31, 25, 0.25);
  border-radius: 50%;
}

.preview-browser small {
  flex: 1;
  overflow: hidden;
  font-size: 6px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-page {
  position: absolute;
  inset: 36px 13px 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(13, 31, 25, 0.08);
  border-bottom: 0;
  border-radius: 0;
}

.preview-nav {
  display: flex;
  height: 22px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(13, 31, 25, 0.06);
}

.preview-nav b {
  width: 23px;
  height: 4px;
  margin-right: auto;
  background: currentColor;
  border-radius: 2px;
  opacity: 0.72;
}

.preview-nav i {
  width: 13px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  opacity: 0.24;
}

.preview-label {
  position: absolute;
  top: 11px;
  right: 11px;
  z-index: 5;
  padding: 3px 6px;
  color: var(--ink-600);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(13, 31, 25, 0.08);
  border-radius: 3px;
  font-size: 7px;
  font-weight: 650;
  backdrop-filter: blur(8px);
}

.preview-morning {
  color: #355f55;
  background: #e5eee9;
}

.preview-morning .preview-page {
  background: #fafcfb;
}

.preview-hero {
  display: flex;
  max-width: 76%;
  margin: 22px auto 0;
  align-items: center;
  flex-direction: column;
}

.preview-kicker {
  display: block;
  width: 31px;
  height: 3px;
  background: #5b8f7f;
  border-radius: 2px;
  opacity: 0.55;
}

.preview-hero strong,
.preview-split strong,
.preview-editorial-head strong,
.preview-centered strong {
  display: block;
  width: 110px;
  height: 9px;
  margin-top: 10px;
  background: #264a40;
  border-radius: 2px;
  opacity: 0.76;
}

.preview-hero p,
.preview-split p,
.preview-editorial-head p,
.preview-centered p {
  width: 140px;
  height: 4px;
  margin: 7px 0 0;
  background: #66897e;
  border-radius: 2px;
  opacity: 0.3;
}

.preview-hero > div {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}

.preview-hero button,
.preview-split button,
.preview-centered button {
  width: 37px;
  height: 10px;
  background: #2b6554;
  border: 0;
  border-radius: 2px;
  pointer-events: none;
}

.preview-hero button + button {
  background: #dce8e2;
}

.preview-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 21px 15px 0;
}

.preview-cards span {
  height: 32px;
  background: #eef3f0;
  border: 1px solid #e1e8e4;
  border-radius: 2px;
}

.preview-field {
  color: #654c2e;
  background: #f2eadc;
}

.preview-field .preview-page {
  background: #fffdf7;
}

.preview-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 10px;
  padding: 20px 13px 0;
  align-items: center;
}

.preview-split strong {
  width: 84px;
  background: #534731;
}

.preview-split p {
  width: 92px;
  background: #74644e;
}

.preview-split button {
  width: 31px;
  margin-top: 9px;
  background: #8b6d45;
}

.preview-image {
  height: 101px;
  background:
    linear-gradient(160deg, transparent 0 46%, rgba(255, 255, 255, 0.32) 46% 48%, transparent 48%),
    linear-gradient(28deg, #9a8a6e, #d6c8af);
  border-radius: 2px;
}

.preview-editorial {
  color: #33435d;
  background: #e7ebf2;
}

.preview-editorial .preview-page {
  background: #f8f9fb;
}

.preview-editorial-head {
  display: flex;
  margin-top: 17px;
  align-items: center;
  flex-direction: column;
}

.preview-editorial-head strong {
  width: 142px;
  background: #2c3b53;
}

.preview-article-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  gap: 5px;
  height: 80px;
  margin: 18px 15px 0;
}

.preview-article-grid div {
  background:
    linear-gradient(150deg, rgba(86, 108, 138, 0.08), rgba(86, 108, 138, 0.26));
  border: 1px solid rgba(86, 108, 138, 0.08);
  border-radius: 2px;
}

.preview-article-grid div:first-child {
  grid-row: 1 / 3;
}

.preview-gallery {
  color: #4c4640;
  background: #eee9e2;
}

.preview-gallery .preview-page {
  background: #faf9f7;
}

.preview-gallery-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 14px 10px;
}

.preview-gallery-head span {
  width: 43px;
  height: 3px;
  background: #8f7962;
  border-radius: 2px;
  opacity: 0.5;
}

.preview-gallery-head strong {
  width: 72px;
  height: 8px;
  background: #453e38;
  border-radius: 2px;
  opacity: 0.75;
}

.preview-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 54px 46px;
  gap: 4px;
  padding: 0 14px;
}

.preview-gallery-grid div {
  background: linear-gradient(135deg, #d6cec3, #b9aea0);
}

.preview-gallery-grid div:nth-child(1) {
  grid-column: 1 / 3;
}

.preview-gallery-grid div:nth-child(4) {
  grid-column: 2 / 4;
}

.preview-clear {
  color: #3b4a5e;
  background: #e8edf2;
}

.preview-clear .preview-page {
  background:
    radial-gradient(circle at 50% -20%, rgba(90, 126, 174, 0.16), transparent 53%),
    #fbfcfd;
}

.preview-centered {
  display: flex;
  margin-top: 24px;
  align-items: center;
  flex-direction: column;
}

.preview-centered strong {
  width: 132px;
  background: #30445f;
}

.preview-centered button {
  width: 38px;
  margin-top: 10px;
  background: #466788;
}

.preview-logo-row {
  display: flex;
  gap: 6px;
  margin: 25px 16px 0;
  justify-content: space-between;
}

.preview-logo-row span {
  width: 20%;
  height: 7px;
  background: #76889d;
  border-radius: 2px;
  opacity: 0.25;
}

.template-card-body {
  padding: 15px;
}

.template-card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.template-card-title > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.template-card-title strong {
  color: var(--ink-800);
  font-size: 13px;
  font-weight: 680;
}

.template-card-title span:not(.status-pill) {
  margin-top: 2px;
  color: var(--ink-400);
  font-size: 9px;
}

.template-card-body > p {
  margin: 9px 0 0;
  color: var(--ink-500);
  font-size: 10px;
}

.template-meta {
  display: flex;
  gap: 13px;
  margin-top: 12px;
  color: var(--ink-400);
  font-size: 8px;
}

.template-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.template-meta svg {
  width: 11px;
  height: 11px;
}

.template-actions {
  display: flex;
  gap: 5px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--ink-100);
}

.template-actions .button:first-child {
  flex: 1;
}

.add-template-card {
  min-height: 410px;
}

.empty-filter {
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--ink-400);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-filter[hidden] {
  display: none;
}

.empty-filter svg {
  width: 24px;
  height: 24px;
}

.empty-filter strong {
  margin-top: 10px;
  color: var(--ink-700);
  font-size: 12px;
}

.empty-filter span {
  margin-top: 3px;
  font-size: 10px;
}

.builder-heading {
  margin-bottom: 20px;
}

.draft-state {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  color: var(--ink-500);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 9px;
}

.draft-state svg {
  width: 12px;
  height: 12px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stepper li {
  position: relative;
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-right: 1px solid var(--border);
}

.stepper li:last-child {
  border-right: 0;
}

.stepper li::after {
  position: absolute;
  right: -6px;
  z-index: 2;
  width: 10px;
  height: 10px;
  content: "";
  background: var(--white);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  transform: rotate(45deg);
}

.stepper li:last-child::after {
  display: none;
}

.stepper li > span {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  color: var(--ink-400);
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: 50%;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  font-weight: 700;
}

.stepper li.is-current > span {
  color: var(--white);
  background: var(--accent);
  border-color: var(--accent);
}

.stepper li.is-current {
  background: #fbfefc;
}

.stepper li.is-current > div strong {
  color: var(--ink-900);
}

.stepper li > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.stepper strong {
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 650;
}

.stepper small {
  margin-top: 2px;
  color: var(--ink-400);
  font-size: 8px;
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 324px;
  gap: 16px;
  align-items: start;
}

.builder-form {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.form-section {
  padding: 22px;
}

.form-section + .form-section {
  border-top: 1px solid var(--border);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 17px;
}

.section-number {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 8px;
  font-weight: 700;
}

.section-heading > div {
  flex: 1;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink-900);
  font-size: 14px;
  font-weight: 680;
}

.section-heading p {
  margin: 3px 0 0;
  color: var(--ink-400);
  font-size: 9px;
}

.required-note {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 0 6px;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  border-radius: 4px;
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 650;
}

.field-label span {
  color: var(--rose);
}

textarea,
select,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"] {
  color: var(--ink-800);
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  outline: 0;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

textarea:hover,
select:hover,
input:hover {
  border-color: #b9c7bf;
}

textarea:focus,
select:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 139, 101, 0.1);
}

textarea {
  display: block;
  width: 100%;
  min-height: 130px;
  padding: 11px 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.8;
  resize: vertical;
}

textarea::placeholder,
input::placeholder {
  color: #a4b0aa;
}

select {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 11px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-400) 50%),
    linear-gradient(135deg, var(--ink-400) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 17px,
    calc(100% - 11px) 17px;
  background-repeat: no-repeat;
  background-size: 4px 4px;
  font-size: 11px;
}

.field-help-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 7px;
}

.field-help-row > span:first-child {
  color: var(--ink-400);
  font-size: 8px;
}

.domain-counter {
  flex: 0 0 auto;
  color: var(--ink-500);
  font-size: 8px;
}

.domain-counter.has-domains {
  color: var(--accent-strong);
  font-weight: 650;
}

.domain-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.domain-chip {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  color: var(--ink-600);
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 8px;
}

.domain-chip svg {
  width: 10px;
  height: 10px;
  color: var(--ink-400);
}

.domain-chip.is-overflow {
  color: var(--ink-400);
  background: transparent;
  border-style: dashed;
}

.choice-grid {
  display: grid;
  gap: 8px;
}

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

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

.choice-card,
.template-choice {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 72px;
  align-items: center;
  gap: 9px;
  padding: 11px;
  background: var(--canvas-raised);
  border: 1px solid var(--border);
  border-radius: 7px;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.choice-card:hover,
.template-choice:hover {
  background: var(--white);
  border-color: var(--border-strong);
}

.choice-card:has(input:checked),
.template-choice:has(input:checked) {
  background: #fbfefc;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(14, 139, 101, 0.08);
}

.choice-card input,
.template-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-card:focus-within,
.template-choice:focus-within {
  outline: 3px solid rgba(14, 139, 101, 0.2);
  outline-offset: 2px;
}

.choice-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  color: var(--ink-500);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.choice-icon svg {
  width: 14px;
  height: 14px;
}

.choice-content {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.choice-content strong {
  overflow: hidden;
  color: var(--ink-800);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-content small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-400);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-meta {
  color: var(--ink-400);
  font-size: 8px;
  white-space: nowrap;
}

.choice-check {
  display: none;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  place-items: center;
  color: var(--white);
  background: var(--accent);
  border-radius: 50%;
}

.choice-check svg {
  width: 10px;
  height: 10px;
  stroke-width: 2.5;
}

.choice-card:has(input:checked) .choice-check,
.template-choice:has(input:checked) .choice-check {
  display: grid;
}

.template-choice {
  min-height: 70px;
}

.template-thumb {
  position: relative;
  display: block;
  width: 52px;
  height: 42px;
  flex: 0 0 52px;
  overflow: hidden;
  background: #eff2f0;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.template-thumb i,
.template-thumb b,
.template-thumb em {
  position: absolute;
  display: block;
  border-radius: 1px;
}

.template-thumb i {
  top: 6px;
  left: 6px;
  width: 20px;
  height: 3px;
  background: currentColor;
  opacity: 0.7;
}

.template-thumb b {
  top: 15px;
  left: 6px;
  width: 39px;
  height: 13px;
  background: currentColor;
  opacity: 0.15;
}

.template-thumb em {
  top: 31px;
  left: 6px;
  width: 22px;
  height: 3px;
  background: currentColor;
  opacity: 0.45;
}

.thumb-morning {
  color: #366956;
  background: #edf4f0;
}

.thumb-field {
  color: #7c6443;
  background: #f5f0e6;
}

.thumb-editorial {
  color: #4b5e7c;
  background: #eef1f5;
}

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

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

.field-group-full {
  grid-column: 1 / -1;
}

.input-shell {
  position: relative;
}

.input-shell svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 14px;
  height: 14px;
  color: var(--ink-400);
  pointer-events: none;
  transform: translateY(-50%);
}

.input-shell input {
  width: 100%;
  height: 40px;
  padding: 0 11px 0 34px;
  font-size: 11px;
}

.builder-summary {
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
  padding: 19px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--ink-100);
}

.summary-domain {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: baseline;
  gap: 1px 10px;
  padding: 18px 0;
}

.summary-domain > span {
  color: var(--ink-500);
  font-size: 10px;
}

.summary-domain > strong {
  color: var(--ink-900);
  font-size: 25px;
  font-weight: 720;
}

.summary-domain > strong span {
  font-size: 18px;
}

.summary-domain > small {
  grid-column: 1 / -1;
  color: var(--ink-400);
  font-size: 8px;
}

.summary-list {
  margin: 0;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--ink-100);
}

.summary-list > div {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-list dt {
  flex: 0 0 auto;
  color: var(--ink-400);
  font-size: 9px;
}

.summary-list dd {
  max-width: 190px;
  margin: 0;
  overflow: hidden;
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 600;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-tip {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  padding: 9px 10px;
  color: var(--ink-500);
  background: var(--canvas-raised);
  border: 1px solid var(--ink-100);
  border-radius: 6px;
}

.summary-tip svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 1px;
  color: var(--blue);
}

.summary-tip p {
  margin: 0;
  font-size: 8px;
  line-height: 1.6;
}

.summary-footnote {
  margin: 9px 0 0;
  color: var(--ink-400);
  font-size: 8px;
  text-align: center;
}

.modal {
  width: min(680px, calc(100% - 32px));
  max-height: calc(100vh - 36px);
  padding: 0;
  color: var(--ink-900);
  background: transparent;
  border: 0;
  overflow: visible;
}

.modal::backdrop {
  background: rgba(8, 22, 17, 0.56);
  backdrop-filter: blur(3px);
}

.modal[open] {
  animation: modal-in 220ms ease both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-card {
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 21px 23px 18px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.modal-header h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 20px;
  font-weight: 700;
}

.modal-header > div > p:last-child {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 10px;
}

.modal-form {
  padding: 20px 23px 23px;
}

.modal-form input,
.modal-form select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  font-size: 11px;
}

.modal-form input:focus,
.modal-form select:focus {
  box-shadow: 0 0 0 3px rgba(14, 139, 101, 0.1);
}

.modal-form textarea {
  min-height: 80px;
  font-family: inherit;
  font-size: 11px;
}

.input-with-suffix {
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.input-with-suffix:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 139, 101, 0.1);
}

.input-with-suffix input {
  flex: 1;
  border: 0;
  box-shadow: none !important;
}

.input-with-suffix > span {
  padding: 0 12px;
  color: var(--ink-400);
  background: var(--ink-50);
  border-left: 1px solid var(--ink-100);
  font-size: 9px;
  line-height: 38px;
}

.test-connection {
  display: flex;
  width: 100%;
  min-height: 55px;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  color: var(--ink-600);
  background: var(--canvas-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: left;
}

.test-connection:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.test-connection > svg:first-child {
  width: 17px;
  height: 17px;
  color: var(--accent-strong);
}

.test-connection > svg:last-child {
  width: 13px;
  height: 13px;
  color: var(--ink-400);
}

.test-connection span {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.test-connection strong {
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 650;
}

.test-connection small {
  margin-top: 2px;
  color: var(--ink-400);
  font-size: 8px;
}

.upload-zone {
  display: flex;
  width: 100%;
  min-height: 146px;
  align-items: center;
  justify-content: center;
  padding: 18px;
  flex-direction: column;
  color: var(--ink-500);
  background: var(--canvas-raised);
  border: 1px dashed var(--border-strong);
  border-radius: 7px;
  transition:
    color var(--transition),
    background-color var(--transition),
    border-color var(--transition);
}

.upload-zone {
  cursor: pointer;
}

.upload-zone:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.advanced-fields {
  padding: 12px 13px;
  background: var(--canvas-raised);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.advanced-fields summary {
  color: var(--ink-600);
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.advanced-grid {
  margin-top: 13px;
}

.button.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.button.is-loading svg {
  animation: button-spin 900ms linear infinite;
}

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

.upload-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 9px;
  place-items: center;
  color: var(--ink-500);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.upload-icon svg {
  width: 18px;
  height: 18px;
}

.upload-zone strong {
  color: var(--ink-700);
  font-size: 11px;
  font-weight: 650;
}

.upload-zone small {
  margin-top: 4px;
  color: var(--ink-400);
  font-size: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 21px;
  padding-top: 17px;
  border-top: 1px solid var(--ink-100);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  min-width: 300px;
  max-width: calc(100% - 32px);
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 9px 10px 9px 12px;
  color: var(--ink-700);
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 12px 35px rgba(13, 31, 25, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 50%;
}

.toast-icon svg {
  width: 13px;
  height: 13px;
}

#toastMessage {
  flex: 1;
  font-size: 10px;
  font-weight: 550;
}

.toast-close {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  color: var(--ink-400);
  border-radius: 4px;
}

.toast-close:hover {
  background: var(--ink-50);
}

.toast-close svg {
  width: 13px;
  height: 13px;
}

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

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

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

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

  .server-choice-grid {
    grid-template-columns: 1fr;
  }
}

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

  .content {
    padding: 24px;
  }

  .topbar {
    padding: 0 24px;
  }

  .search-trigger {
    width: 210px;
  }

  .search-trigger span {
    display: none;
  }

  .search-trigger {
    width: auto;
    padding: 0 10px;
  }

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

  .builder-summary {
    position: static;
  }

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

@media (max-width: 820px) {
  :root {
    --topbar-height: 60px;
  }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }

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

  .sidebar-backdrop.is-visible {
    display: block;
  }

  .sidebar-close,
  .mobile-menu {
    display: inline-grid !important;
  }

  .main-column {
    width: 100%;
    margin-left: 0;
  }

  .topbar {
    padding: 0 18px;
  }

  .content {
    padding: 22px 18px 32px;
  }

  .profile-copy,
  .profile-button > svg {
    display: none;
  }

  .profile-button {
    padding: 3px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .heading-actions {
    width: 100%;
  }

  .heading-actions .button {
    flex: 1;
  }

  .stepper {
    overflow-x: auto;
  }

  .stepper li {
    min-width: 155px;
  }

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

  .add-resource-card {
    min-height: 150px;
  }

  .add-template-card {
    min-height: 230px;
  }

  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented-control {
    overflow-x: auto;
  }

  .segment {
    flex: 0 0 auto;
  }

  .compact-search {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .breadcrumb > span,
  .breadcrumb > svg {
    display: none;
  }

  .topbar-actions > .icon-button {
    display: none;
  }

  .search-trigger {
    display: none;
  }

  .content {
    padding: 19px 14px 28px;
  }

  .page-heading h1 {
    font-size: 24px;
  }

  .page-description {
    font-size: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-topline {
    align-items: flex-start;
  }

  .stat-icon {
    width: 29px;
    height: 29px;
  }

  .trend {
    padding: 2px 5px;
    font-size: 8px;
  }

  .stat-card > p {
    margin-top: 11px;
  }

  .stat-value strong {
    font-size: 23px;
  }

  .stat-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    padding-top: 9px;
  }

  .stat-foot > span:last-child {
    display: none;
  }

  .workflow-list {
    grid-template-columns: 1fr;
  }

  .workflow-step {
    min-height: 76px;
  }

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

  .load-meter {
    display: none;
  }

  .panel {
    padding: 16px;
  }

  .info-strip {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .info-strip > div:nth-child(2) {
    flex-basis: calc(100% - 50px);
  }

  .info-strip > .status-pill {
    margin-left: 46px;
  }

  .server-card {
    padding: 15px;
  }

  .server-title > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .form-section {
    padding: 17px;
  }

  .section-heading {
    flex-wrap: wrap;
  }

  .section-heading > div {
    min-width: calc(100% - 42px);
  }

  .section-heading .link-button,
  .section-heading .required-note {
    margin-left: 39px;
  }

  .field-help-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

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

  .field-group-full {
    grid-column: auto;
  }

  .choice-card {
    min-height: 68px;
  }

  .choice-meta {
    display: none;
  }

  .builder-summary {
    padding: 16px;
  }

  .modal {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
  }

  .modal-card {
    max-height: calc(100vh - 20px);
  }

  .modal-header {
    padding: 17px;
  }

  .modal-form {
    padding: 17px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    min-width: 0;
  }
}

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

  .stat-foot {
    align-items: center;
    flex-direction: row;
  }

  .heading-actions {
    flex-direction: column;
  }

  .heading-actions .button {
    width: 100%;
  }

  .server-card-metrics {
    gap: 5px;
  }

  .server-card-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .template-actions {
    flex-wrap: wrap;
  }
}

@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;
  }
}
