:root {
  color-scheme: dark;
  --bg: #0c0b12;
  --panel: #17151f;
  --panel-soft: #201d2a;
  --panel-strong: #282435;
  --line: #302b3b;
  --line-bright: #514765;
  --text: #f5f3f7;
  --muted: #9a94a8;
  --dim: #706a7d;
  --accent: #a970ff;
  --accent-strong: #8b4dff;
  --green: #39c982;
  --red: #ff5b63;
  --yellow: #f2c14e;
  --blue: #68a5ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

body.login-page {
  display: block;
  overflow: hidden;
  background: #000;
}

.login-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 0;
}

#loginCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.login-hero {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  text-align: center;
  transform: translateY(-8vh);
}

.login-hero h1,
.login-hero h2 {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(54px, 11vw, 152px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 0 18px rgba(255, 255, 255, 0.25),
    0 0 58px rgba(120, 105, 255, 0.28);
}

.login-hero h2 {
  font-size: clamp(32px, 5.8vw, 84px);
  font-weight: 850;
}

.login-panel {
  position: fixed;
  z-index: 2;
  right: auto;
  bottom: 8px;
  left: 50%;
  width: min(360px, calc(100vw - 16px));
  display: grid;
  justify-items: center;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  animation: loginDrawerIn 700ms 1.5s cubic-bezier(0.2, 0.84, 0.22, 1) both;
}

@keyframes loginDrawerIn {
  from {
    opacity: 0;
    transform: translate(-50%, calc(100% + 24px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.login-form {
  display: grid;
  width: 100%;
  gap: 10px;
}

.login-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.login-form label span {
  color: #333644;
  font-size: 11px;
  font-weight: 750;
}

.login-form input {
  width: 100%;
  border: 1px solid #dde0e8;
  border-radius: 999px;
  outline: 0;
  background: #fff;
  color: #11131a;
  padding: 10px 13px;
  font-size: 13px;
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.login-form input:focus {
  border-color: #8c4dff;
  box-shadow: 0 0 0 3px rgba(140, 77, 255, 0.14);
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: #c93046;
  font-size: 12px;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: end;
  gap: 10px;
}

.login-form button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(169, 112, 255, 0.5);
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
  padding: 0;
  font-size: 19px;
  font-weight: 850;
  line-height: 1;
}

.login-form button:disabled {
  cursor: wait;
  opacity: 0.7;
}

@media (max-width: 560px) {
  .login-shell {
    padding-inline: 18px;
  }

  .login-panel {
    padding: 20px 18px;
    border-radius: 22px;
  }

  .login-hero {
    transform: translateY(-11vh);
  }
}

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

button {
  color: inherit;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  background: #0f0d15;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  height: 58px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 11, 18, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 0 18px;
}

.logo-button,
.icon-button,
.rail-button,
.canvas-controls button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.logo-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  overflow: hidden;
}

.logo-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.divider {
  width: 1px;
  height: 26px;
  background: var(--line);
}

.slash {
  width: 1px;
  height: 32px;
  background: var(--line);
  transform: rotate(14deg);
}

.switcher-wrap {
  position: relative;
}

.switcher {
  display: inline-flex;
  min-width: 148px;
  height: 38px;
  align-items: center;
  gap: 9px;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  padding: 0 12px;
  font-weight: 650;
  color: #f2eff8;
}

.switcher:hover,
.switcher.is-open {
  border-color: var(--line);
  background: var(--panel);
}

.env-switcher {
  min-width: 122px;
}

.project-dot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 40%, #fff 0 3px, transparent 4px),
    linear-gradient(135deg, #9a7cff, #70a5ff);
}

.chevron {
  margin-left: auto;
  color: var(--dim);
}

.menu {
  position: absolute;
  top: 48px;
  left: 0;
  display: none;
  min-width: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 16, 25, 0.96);
  box-shadow: var(--shadow);
  padding: 8px;
}

.menu.is-open {
  display: block;
}

.menu-label {
  padding: 8px 10px 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 12px 10px;
  color: var(--muted);
  text-align: left;
}

.menu button:hover,
.menu button.is-active {
  background: var(--panel-soft);
  color: var(--text);
}

.menu .check {
  width: 18px;
  color: var(--accent);
}

.menu-separator {
  height: 1px;
  margin: 8px 0;
  background: var(--line);
}

.rail {
  position: fixed;
  inset: 58px auto 0 0;
  z-index: 15;
  display: flex;
  width: 72px;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-right: 1px solid var(--line);
  background: rgba(13, 11, 18, 0.86);
  padding-top: 18px;
}

.logout-button {
  display: grid;
  width: 42px;
  height: 42px;
  margin-top: auto;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid rgba(169, 112, 255, 0.5);
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
}

.logout-button:hover {
  border-color: rgba(255, 255, 255, 0.3);
  filter: brightness(1.08);
}

.rail-button {
  width: 56px;
  height: 52px;
  grid-template-rows: 20px 14px;
  gap: 3px;
  color: var(--dim);
  font-size: 17px;
}

.rail-button small {
  font-size: 11px;
  font-weight: 700;
}

.rail-button:hover,
.rail-button.is-active {
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.workspace {
  position: fixed;
  inset: 58px 0 0 72px;
}

.canvas-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-top-left-radius: 9px;
  background: #111019;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.canvas-shell.is-dragging {
  cursor: grabbing;
}

.canvas-shell.is-selecting {
  cursor: crosshair;
}

.canvas-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(154, 148, 168, 0.34) 1px, transparent 1.3px);
  background-position: var(--grid-x, 0px) var(--grid-y, 0px);
  background-size: var(--grid-size, 28px) var(--grid-size, 28px);
  pointer-events: none;
}

.canvas-grid.is-hidden {
  opacity: 0;
}

.canvas-stage {
  position: absolute;
  inset: 0;
  transform: translate(var(--pan-x, 0px), var(--pan-y, 0px)) scale(var(--zoom, 1));
  transform-origin: 0 0;
}

.node-card {
  position: absolute;
  width: 318px;
  min-height: 158px;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: rgba(22, 20, 29, 0.94);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
  padding: 22px;
  cursor: move;
}

.canvas-shell.is-node-dragging .node-card,
.canvas-shell.is-dragging .node-card {
  cursor: grabbing;
}

.selection-box {
  position: absolute;
  z-index: 11;
  display: none;
  border: 1px solid rgba(169, 112, 255, 0.95);
  background: rgba(169, 112, 255, 0.12);
  pointer-events: none;
}

.selection-box.is-active {
  display: block;
}

.node-card.is-main {
  border-color: rgba(169, 112, 255, 0.62);
}

.node-card.server-square {
  width: 300px;
  height: 176px;
  min-height: 176px;
  border-color: rgba(86, 78, 106, 0.9);
  background: rgba(17, 16, 24, 0.96);
  padding: 20px;
  overflow: hidden;
}

.node-card.server-square[data-has-recap="true"] {
  border-color: rgba(52, 164, 105, 0.92);
  background: rgba(31, 82, 57, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(85, 210, 139, 0.14),
    0 16px 42px rgba(0, 0, 0, 0.22);
}

.node-card.is-selected,
.node-card.server-square.is-selected {
  border-color: var(--accent);
  background: rgba(30, 24, 44, 0.98);
  box-shadow:
    0 0 0 3px rgba(169, 112, 255, 0.28),
    0 0 28px rgba(169, 112, 255, 0.18),
    0 16px 42px rgba(0, 0, 0, 0.22);
}

.node-card.server-square[data-has-recap="true"].is-selected {
  border-color: #58d18f;
  background: rgba(32, 96, 63, 0.48);
  box-shadow:
    0 0 0 3px rgba(88, 209, 143, 0.24),
    0 0 28px rgba(88, 209, 143, 0.14),
    0 16px 42px rgba(0, 0, 0, 0.22);
}

.server-square[data-has-recap="true"] .node-title {
  color: #eefbf3;
}

.server-square .node-head {
  align-items: flex-start;
  height: 100%;
}

.server-square .node-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  font-size: 11px;
}

.server-square .node-title {
  font-size: 17px;
  line-height: 1.25;
  word-break: break-word;
}

.server-square[data-profile-status="loading"] .node-title {
  color: var(--muted);
}

.server-square[data-profile-status="failed"] .node-title {
  color: #ffb0bc;
}

.server-identity {
  min-width: 0;
  flex: 1;
}

.server-guid-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 7px;
  align-items: center;
  margin-top: 10px;
}

.server-guid {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  word-break: break-word;
}

.copy-guid-button {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 13px;
}

.copy-guid-button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.server-square .node-subtitle {
  color: #bdb7c9;
  font-size: 12px;
  margin-top: 10px;
}

.node-head,
.node-meta,
.node-foot,
.health-row {
  display: flex;
  align-items: center;
}

.node-head {
  gap: 12px;
}

.node-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #f6f3f8;
  color: #111019;
  font-weight: 900;
}

.node-title {
  font-size: 18px;
  font-weight: 760;
}

.node-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.node-meta {
  justify-content: space-between;
  margin: 20px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.health-row {
  gap: 8px;
  color: var(--muted);
  font-size: 15px;
}

.health-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.health-dot.ok {
  background: var(--green);
  box-shadow: 0 0 18px rgba(57, 201, 130, 0.55);
}

.health-dot.warn {
  background: var(--yellow);
}

.health-dot.fail {
  background: var(--red);
}

.node-foot {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.node-action {
  position: absolute;
  right: 16px;
  top: 16px;
  height: 30px;
  border: 1px solid rgba(169, 112, 255, 0.35);
  border-radius: 7px;
  background: rgba(139, 77, 255, 0.16);
  color: #e8ddff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.node-action:hover {
  border-color: var(--accent);
  background: rgba(139, 77, 255, 0.28);
}

.node-action:disabled {
  cursor: wait;
  opacity: 0.72;
}


.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
}

.metric {
  color: var(--text);
  font-size: 12px;
}

.add-button {
  position: absolute;
  top: 24px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 11px 17px;
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.add-button:hover {
  border-color: var(--line-bright);
  background: var(--panel-strong);
}

.canvas-controls {
  position: absolute;
  left: 18px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.canvas-controls button,
.control-stack {
  border: 1px solid var(--line);
  background: rgba(20, 18, 27, 0.82);
}

.control-stack {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
}

.control-stack button {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.control-stack button:last-child {
  border-bottom: 0;
}

.canvas-controls button:hover {
  background: var(--panel-strong);
  color: var(--text);
}

.command-panel,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  background: rgba(8, 7, 12, 0.55);
}

.command-panel.is-open,
.modal-backdrop.is-open {
  display: grid;
}

.command-panel {
  background:
    radial-gradient(circle at center, rgba(98, 63, 158, 0.16), transparent 42%),
    rgba(7, 7, 13, 0.78);
}

.command-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image: radial-gradient(circle, rgba(100, 97, 149, 0.35) 1.5px, transparent 1.5px);
  background-size: 12px 12px;
  opacity: 0.5;
}

.command-card {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 32px));
  border: 1px solid var(--line-bright);
  border-radius: 16px;
  background: rgba(37, 33, 49, 0.97);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.command-search {
  width: calc(100% - 24px);
  height: 74px;
  margin: 12px;
  border: 1px solid var(--accent-strong);
  border-radius: 8px;
  outline: 0;
  background: #1d1029;
  color: var(--text);
  padding: 0 22px;
  font-size: 24px;
}

.command-search::placeholder {
  color: #898198;
}

.quick-create {
  padding: 10px 14px 16px;
}

.quick-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 22px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 20px;
  color: var(--muted);
  font-size: 22px;
  text-align: left;
}

.quick-row.is-focused,
.quick-row:hover {
  background: #211f2c;
  color: var(--text);
}

.quick-icon {
  width: 30px;
  color: var(--text);
}

.create-list {
  border-top: 1px solid var(--line);
  padding: 18px 14px 22px;
}

.create-list button {
  display: grid;
  width: 100%;
  grid-template-columns: 36px 1fr 24px;
  align-items: center;
  gap: 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 16px 20px;
  color: var(--muted);
  font-size: 20px;
  text-align: left;
}

.create-list button:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.modal-backdrop {
  backdrop-filter: blur(12px);
}

.modal {
  width: min(980px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  background: rgba(20, 18, 27, 0.98);
  box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.modal-header h1 {
  margin: 2px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-body {
  overflow: auto;
  padding: 24px 26px;
}

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

label {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: #111019;
  color: var(--text);
  padding: 12px 13px;
}

textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(169, 112, 255, 0.14);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 15px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 750;
}

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

.repo-card {
  position: relative;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15131c;
  padding: 15px;
  text-align: left;
}

.repo-card.is-selected,
.repo-card:hover {
  border-color: var(--accent);
  background: #1d1828;
}

.repo-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.repo-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.repo-card .repo-status {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--green);
  font-size: 12px;
}

.server-tools {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  gap: 16px;
}

.key-panel {
  display: grid;
  gap: 14px;
}

.modal-footer {
  border-top: 1px solid var(--line);
}

.server-detail-panel {
  position: fixed;
  inset: 58px 0 0 auto;
  z-index: 35;
  display: grid;
  width: min(860px, calc(100vw - 72px));
  grid-template-rows: auto auto minmax(0, 1fr);
  border-left: 1px solid var(--line-bright);
  background: rgba(18, 16, 25, 0.98);
  box-shadow: -20px 0 70px rgba(0, 0, 0, 0.38);
  transform: translateX(100%);
  transition: transform 160ms ease;
}

.server-detail-panel.is-open {
  transform: translateX(0);
}

.server-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 34px 18px;
}

.server-detail-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.detail-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #f5f2f8;
  color: #111019;
  font-size: 11px;
  font-weight: 900;
}

.server-detail-title h2 {
  max-width: 620px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  letter-spacing: 0;
}

.server-detail-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 0 34px;
}

.detail-tabs button {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.detail-tabs button.is-active {
  color: var(--text);
}

.detail-tabs button.is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--text);
  content: "";
}

.detail-content {
  overflow: auto;
  padding: 18px 34px 30px;
  min-width: 0;
}

.detail-source {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-source code {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111019;
  padding: 12px;
  color: #d5cfe0;
  font-size: 12px;
  font-weight: 500;
}

.detail-error {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 14px;
  color: var(--muted);
  background: rgba(13, 12, 19, 0.78);
}

.detail-loading,
.detail-empty {
  position: absolute;
  inset: 50%;
  display: inline-flex;
  width: 132px;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 12, 19, 0.86);
  color: var(--muted);
  transform: translate(-50%, -50%);
}

.detail-empty {
  width: 180px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.detail-loading span {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(169, 112, 255, 0.28);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.detail-loading strong {
  font-size: 13px;
}

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

.detail-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-color: rgba(255, 91, 99, 0.35);
  color: #ff9aa0;
  background: rgba(255, 91, 99, 0.08);
}

.detail-error strong {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.detail-error button {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 91, 99, 0.35);
  border-radius: 7px;
  background: rgba(255, 91, 99, 0.1);
  color: #ffd0d3;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.chat-list,
.recap-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.recap-day {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 12, 19, 0.72);
  overflow: hidden;
}

.recap-day summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
  padding: 13px 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.recap-day summary::-webkit-details-marker {
  display: none;
}

.recap-day summary::before {
  content: "›";
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.recap-day[open] summary::before {
  transform: rotate(90deg);
}

.recap-day summary span {
  flex: 1;
}

.recap-day summary em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.recap-day-content {
  display: grid;
  gap: 10px;
  min-width: 0;
  border-top: 1px solid var(--line);
  padding: 10px;
}

.chat-message,
.recap-card,
.chat-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 12, 19, 0.78);
  padding: 14px;
  overflow: hidden;
}

.chat-message.assistant,
.chat-card {
  border-color: rgba(169, 112, 255, 0.28);
  background: rgba(34, 24, 49, 0.52);
}

.chat-message.error {
  border-color: rgba(255, 91, 99, 0.35);
  background: rgba(255, 91, 99, 0.08);
}

.chat-meta,
.recap-card > div,
.chat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chat-message p,
.recap-card p {
  margin: 10px 0 0;
  color: #e5e0ea;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: normal;
}

.chat-card p {
  margin: 10px 0 0;
  color: #d8d2df;
  font-size: 13px;
  line-height: 1.5;
}

.chat-card pre {
  overflow: auto;
  margin: 12px 0 0;
  color: #d8d2df;
  font-size: 12px;
  line-height: 1.45;
}

.recap-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.recap-path {
  margin-top: 8px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.35;
  word-break: break-all;
}

.chat-card-head span {
  font-size: 13px;
}

.compact-card {
  border-color: var(--line);
  background: rgba(18, 16, 25, 0.88);
}

.summary-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 14px;
}

.summary-card h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
}

.recap-markdown {
  color: #e5e0ea;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: normal;
}

.recap-markdown strong {
  color: #fff;
}

.recap-guide {
  color: #cfc7dc;
}

.recap-sections {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.recap-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
}

.recap-section.muted {
  border-color: rgba(255, 200, 87, 0.22);
  background: rgba(255, 200, 87, 0.05);
}

.recap-section h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 12px;
}

.recap-section p,
.recap-section li {
  color: #d8d2df;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: normal;
}

.recap-section p {
  margin: 0;
}

.recap-section ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.recap-card > .metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  align-items: stretch;
  justify-content: initial;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.metric-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111019;
  padding: 12px;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.metric-card strong {
  color: var(--text);
  font-size: 18px;
}

.metric-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.metric-card em.up {
  color: var(--green);
}

.metric-card em.down {
  color: var(--red);
}

.supporter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.recap-card > .recap-sections,
.recap-card > .supporter-grid {
  display: grid;
  align-items: stretch;
  justify-content: initial;
}

.supporter-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111019;
  padding: 10px;
}

.supporter-card strong {
  color: var(--text);
  font-size: 12px;
}

.supporter-card span,
.supporter-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.suggestion-list button {
  border: 1px solid rgba(169, 112, 255, 0.35);
  border-radius: 999px;
  background: rgba(169, 112, 255, 0.12);
  color: #e8ddff;
  padding: 7px 10px;
  font-size: 12px;
}

.ghost-button,
.primary-button {
  height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 760;
}

.ghost-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.primary-button {
  border: 1px solid rgba(169, 112, 255, 0.35);
  background: var(--accent-strong);
  color: #fff;
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
  }

  .switcher {
    min-width: 0;
    max-width: 44vw;
  }

  .workspace {
    inset: 58px 0 0 0;
  }

  .rail {
    display: none;
  }

  .repo-list,
  .field-grid,
  .server-tools {
    grid-template-columns: 1fr;
  }

  .node-card {
    width: 292px;
  }

  .command-search {
    font-size: 18px;
  }

  .quick-row,
  .create-list button {
    font-size: 17px;
  }
}
