@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;600&family=Manrope:wght@500;600;700&display=swap");

:root {
  color-scheme: dark;
  --font-ui: "Manrope", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  --bg-page: #0b0b0c;
  --bg-elev-1: #101113;
  --bg-elev-2: #15171a;
  --bg-0: var(--bg-page);
  --bg-1: #101113;
  --bg-2: #15171a;
  --bg-3: #1b1d21;
  --surface-0: rgba(24, 25, 28, 0.94);
  --surface-1: rgba(30, 32, 36, 0.96);
  --surface-2: rgba(36, 38, 43, 0.98);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text-0: #f5f5f7;
  --text-1: #d2d3d8;
  --text-2: #9a9ca3;
  --accent: #7f97bf;
  --accent-2: #90a6c9;
  --good: #7fa890;
  --warn: #a89473;
  --bad: #9f7777;
  --shadow-xl: 0 14px 28px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 8px 18px rgba(0, 0, 0, 0.2);
  --radius-xl: 12px;
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 7px;
  --builder-port-half: 7px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  color: var(--text-0);
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 18% -16%, rgba(255, 255, 255, 0.035), transparent 34%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-page) 100%);
}

body {
  overflow: auto;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(33, 35, 40, 0.9);
  color: var(--text-0);
  padding: 9px 11px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-2);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(127, 151, 191, 0.14);
  background: rgba(39, 41, 47, 0.96);
}

label {
  display: grid;
  gap: 6px;
  color: var(--text-1);
  font-weight: 600;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  height: auto;
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  transition: grid-template-columns 190ms ease;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px 12px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(25, 26, 30, 0.98), rgba(19, 20, 23, 0.98));
  backdrop-filter: blur(4px);
  overflow: auto;
  transition: width 190ms ease, padding 190ms ease, opacity 150ms ease, border-color 150ms ease;
}

@media (min-width: 1201px) {
  .shell.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .shell.sidebar-collapsed .sidebar {
    width: 0;
    min-width: 0;
    padding: 0;
    gap: 0;
    border-right-color: transparent;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
  }
}

.profile-switcher {
  position: relative;
}

.profile-picker-trigger {
  width: 100%;
  border: 1px solid rgba(169, 186, 210, 0.26);
  border-radius: 11px;
  background: rgba(31, 41, 54, 0.88);
  color: var(--text-0);
  font-weight: 700;
  min-height: 42px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-picker-trigger:hover {
  border-color: rgba(169, 186, 210, 0.4);
}

.profile-picker-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #71c69c;
  box-shadow: 0 0 0 3px rgba(113, 198, 156, 0.2);
  flex: 0 0 auto;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 35;
  border: 1px solid rgba(81, 120, 180, 0.56);
  border-radius: 10px;
  background: rgba(6, 14, 26, 0.98);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.profile-dropdown-list {
  max-height: 280px;
  overflow: auto;
}

.profile-dropdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(84, 127, 190, 0.24);
}

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

.profile-dropdown-row.active {
  background: rgba(45, 92, 164, 0.18);
}

.profile-dropdown-name {
  min-width: 0;
  flex: 1 1 auto;
  font-weight: 700;
  color: var(--text-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dropdown-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.profile-action-btn {
  border: 0;
  border-radius: 7px;
  color: #f5fbff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  min-height: 26px;
}

.profile-action-btn.select {
  background: linear-gradient(180deg, #3d7a62 0%, #336650 100%);
}

.profile-action-btn.delete {
  background: linear-gradient(180deg, #7c4f54 0%, #6a4348 100%);
}

.profile-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-checkbox {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

.profile-bulk-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(169, 186, 210, 0.18);
  background: rgba(24, 33, 45, 0.75);
}

.profile-bulk-btn {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #e5f1ff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  min-height: 26px;
  background: linear-gradient(180deg, #323f50 0%, #2a3544 100%);
  cursor: pointer;
  transition: filter 100ms ease;
}

.profile-bulk-btn:hover {
  filter: brightness(1.05);
}

.profile-bulk-btn.danger {
  border-color: rgba(187, 125, 129, 0.54);
  background: linear-gradient(180deg, #815c61 0%, #724f54 100%);
  color: #fff;
}

.profile-bulk-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-create-btn {
  width: calc(100% - 12px);
  margin: 6px;
  border: 1px solid rgba(145, 169, 204, 0.56);
  border-radius: 8px;
  background: linear-gradient(180deg, #5a7397 0%, #4c6383 100%);
  color: #eff6ff;
  font-weight: 700;
  min-height: 34px;
}

.nav-group-title {
  margin-top: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-2);
}

.nav-block {
  display: grid;
  gap: 3px;
}

.nav-item {
  position: relative;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  text-align: left;
  padding: 9px 11px;
  transition: background-color 110ms ease, color 110ms ease;
}

.nav-item:hover {
  color: var(--text-0);
  background: rgba(136, 160, 198, 0.14);
}

.nav-item.active {
  color: #e8eef8;
  background: linear-gradient(90deg, rgba(126, 150, 186, 0.22), rgba(46, 59, 78, 0.2));
}

.nav-item.active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #8dafdf 0%, #6f97d6 100%);
}

.main-shell {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(29, 31, 35, 0.96), rgba(23, 25, 29, 0.96));
}

.topbar h1 {
  margin: 0;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-0);
}

.topbar p {
  margin: 3px 0 0;
  color: var(--text-2);
}

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

.sidebar-toggle-btn {
  min-width: 108px;
}

.runtime-engine-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(34, 36, 41, 0.92);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 600;
}

.runtime-engine-top select {
  width: auto;
  min-width: 132px;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(29, 31, 36, 0.96);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(34, 36, 41, 0.92);
  color: var(--text-1);
  font-weight: 600;
}

.status-chip.online {
  border-color: rgba(75, 191, 132, 0.45);
  background: rgba(52, 83, 67, 0.45);
  color: #ccead8;
}

.status-chip.offline {
  border-color: rgba(217, 111, 111, 0.45);
  background: rgba(84, 47, 50, 0.45);
  color: #efd2d2;
}

.page-host {
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 20px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.settings-shell {
  display: grid;
  gap: 12px;
}

.settings-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-tab {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 34px;
  padding: 6px 14px;
  background: rgba(36, 38, 43, 0.92);
  color: var(--text-1);
  font-weight: 600;
}

.settings-tab.active {
  border-color: rgba(127, 151, 191, 0.38);
  color: var(--text-0);
  background: rgba(53, 58, 67, 0.76);
}

.settings-content {
  display: grid;
  gap: 12px;
}

.settings-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-0) 100%);
  box-shadow: var(--shadow-lg);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.settings-guidance {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(34, 36, 41, 0.82);
}

.settings-help-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.settings-help-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-1);
}

.settings-risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  min-width: 82px;
  flex: 0 0 auto;
}

.settings-risk-badge.info {
  background: rgba(69, 121, 202, 0.36);
  color: #e5f0ff;
}

.settings-risk-badge.warn {
  background: rgba(171, 121, 38, 0.4);
  color: #ffe8b6;
}

.settings-risk-badge.danger {
  background: rgba(170, 62, 62, 0.42);
  color: #ffd3d3;
}

.settings-preset-block {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(169, 186, 210, 0.22);
  border-radius: 10px;
  background: rgba(24, 33, 45, 0.66);
}

.settings-preset-title {
  font-weight: 700;
  color: #e7f2ff;
}

.settings-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-preset-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(38, 40, 46, 0.92);
  color: var(--text-1);
  min-height: 32px;
  padding: 5px 12px;
  font-weight: 700;
}

.settings-preset-btn.active {
  border-color: rgba(127, 151, 191, 0.4);
  color: var(--text-0);
  background: rgba(56, 61, 71, 0.88);
}

.settings-help-caption {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
}

.settings-card h3,
.settings-card h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.settings-card h4 {
  margin-top: 4px;
  color: #d7e8ff;
  font-size: 16px;
  font-weight: 700;
}

.settings-option-grid {
  display: grid;
  gap: 10px;
}

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

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

.settings-option-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settings-option {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(37, 39, 45, 0.88);
  color: var(--text-0);
  padding: 14px 12px 12px;
  text-align: left;
  min-height: 126px;
}

.settings-option:hover {
  border-color: rgba(169, 186, 210, 0.42);
}

.settings-option.selected {
  border-color: rgba(169, 186, 210, 0.58);
  box-shadow: inset 0 0 0 1px rgba(169, 186, 210, 0.24);
}

.settings-option-title {
  font-weight: 700;
  font-size: 16px;
  color: #eaf2ff;
}

.settings-option-desc {
  margin-top: 6px;
  color: var(--text-1);
}

.settings-option-note {
  margin-top: 9px;
  color: #dbe9ff;
  font-weight: 700;
}

.settings-option-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(48, 84, 145, 0.9);
  color: #e7f2ff;
  font-weight: 900;
}

.settings-inline-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-inline-row > * {
  flex: 1 1 220px;
}

.settings-list-grid {
  display: grid;
  gap: 8px;
}

.settings-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-list-row input {
  flex: 1 1 auto;
}

.settings-list-row .btn {
  min-width: 34px;
  padding: 0;
}

.settings-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(15, 28, 48, 0.92);
  color: #d0e3ff;
}

.settings-slot-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
}

.settings-slot-cell {
  border: 1px solid rgba(121, 160, 219, 0.4);
  border-radius: 7px;
  background: rgba(10, 21, 39, 0.92);
  color: #91afd6;
  min-height: 36px;
  font-size: 12px;
  padding: 0;
}

.settings-slot-cell.selected {
  border-color: rgba(255, 229, 140, 0.88);
  background: rgba(108, 93, 25, 0.56);
  color: #fff6d1;
}

.settings-card.danger {
  border-color: rgba(240, 93, 122, 0.48);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-0) 100%);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.card-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card strong {
  color: #e7f2ff;
  font-weight: 700;
}

.card-head strong {
  font-size: 16px;
}

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

.hidden {
  display: none !important;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.row.split > * {
  flex: 1 1 220px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

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

.btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 34px;
  padding: 6px 13px;
  background: linear-gradient(180deg, rgba(54, 56, 62, 0.98) 0%, rgba(44, 46, 52, 0.98) 100%);
  color: var(--text-0);
  font-weight: 700;
  letter-spacing: 0.005em;
  transition: filter 100ms ease, transform 80ms ease, border-color 120ms ease;
}

.btn:hover {
  filter: brightness(1.05);
  border-color: rgba(169, 186, 210, 0.42);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  border-color: rgba(127, 151, 191, 0.5);
  background: linear-gradient(180deg, #6e86ac 0%, #5f7699 100%);
  color: #f7f9fc;
}

.btn-success {
  border-color: rgba(127, 168, 142, 0.42);
  background: linear-gradient(180deg, #617d6c 0%, #567061 100%);
}

.btn-warning {
  border-color: rgba(168, 149, 116, 0.42);
  background: linear-gradient(180deg, #786c59 0%, #6b6050 100%);
}

.btn-danger {
  border-color: rgba(159, 125, 125, 0.44);
  background: linear-gradient(180deg, #785f5f 0%, #6c5656 100%);
}

.btn-light {
  background: linear-gradient(180deg, rgba(50, 52, 58, 0.98) 0%, rgba(42, 44, 50, 0.98) 100%);
}

.btn-icon-sm {
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  font-size: 14px;
}

.mt-1 {
  margin-top: 4px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1.25fr) minmax(260px, 0.85fr) minmax(240px, 0.7fr);
  gap: 14px;
  align-items: start;
}

.account-grid-card {
  grid-column: 1 / 2;
  align-self: start;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100vh - 160px);
  min-height: 420px;
}

.bot-selected-card {
  grid-column: 2 / 3;
  min-height: 420px;
  align-self: start;
}

.bot-window-card {
  grid-column: 3 / 4;
  min-height: 420px;
  align-self: start;
}

.plugin-summary-card {
  grid-column: 1 / 2;
  align-self: start;
}

.macro-summary-card {
  grid-column: 2 / 3;
  align-self: start;
}

.map-card {
  grid-column: 3 / 4;
  min-height: 190px;
  align-self: start;
}

.start-control-card,
.server-card,
.global-card {
  grid-column: 1 / 3;
  padding: 12px;
  align-self: start;
}

.activity-card {
  grid-column: 3 / 4;
  min-height: 330px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: start;
}

.account-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 10px;
  align-content: start;
  min-height: 0;
  overflow: auto;
}

.grid-account {
  position: relative;
  border: 1px solid rgba(129, 165, 220, 0.35);
  padding: 0;
  cursor: pointer;
  overflow: visible;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(50, 72, 106, 0.7), rgba(18, 36, 61, 0.75));
  box-shadow: inset 0 1px 0 rgba(212, 229, 255, 0.16);
}

.grid-account-skin {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
  image-rendering: pixelated;
}

.grid-account.selected {
  border-color: rgba(101, 156, 255, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(223, 236, 255, 0.2),
    0 0 0 2px rgba(76, 132, 255, 0.26);
}

.grid-account .dot {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #8094b6;
  box-shadow: 0 0 0 2px rgba(4, 10, 21, 0.8);
}

.grid-account .dot.running {
  background: #2cd48d;
}

.grid-account .dot.starting {
  background: #f0bc48;
}

.grid-account .dot.stopping {
  background: #f59e0b;
}

.grid-account .dot.error {
  background: #ff7272;
}

.grid-account .dot.stopped {
  background: #91a4c4;
}

.grid-account .tooltip {
  position: absolute;
  left: calc(50% - 80px);
  top: -68px;
  transform: none;
  min-width: 160px;
  border: 1px solid rgba(116, 152, 210, 0.44);
  border-radius: 10px;
  background: rgba(8, 17, 33, 0.98);
  color: #dceafe;
  padding: 8px 10px;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 20;
}

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

.tooltip-row span {
  color: #8ca7cf;
  text-transform: lowercase;
}

.grid-account:hover .tooltip {
  opacity: 1;
}

.dashboard-account-tooltip {
  position: fixed;
  z-index: 4200;
  min-width: 188px;
  border: 1px solid rgba(126, 167, 232, 0.52);
  border-radius: 10px;
  background: rgba(6, 16, 32, 0.98);
  box-shadow: var(--shadow-xl);
  color: #dceaff;
  padding: 8px 10px;
  pointer-events: none;
}

.window-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-1);
  font-weight: 600;
}

.dashboard-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(37, 39, 45, 0.92);
  color: var(--text-1);
  font-weight: 600;
  min-height: 34px;
  padding: 4px 12px;
}

.dashboard-tab.active {
  border-color: rgba(127, 151, 191, 0.4);
  color: var(--text-0);
  background: rgba(53, 58, 67, 0.76);
}

.dashboard-window-pane {
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  min-height: 345px;
  overflow: auto;
}

.dashboard-selected-card {
  height: auto;
  padding: 12px;
}

.dashboard-profile-card {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.dashboard-profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-profile-skin {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 1px solid rgba(117, 152, 212, 0.42);
  image-rendering: pixelated;
}

.dashboard-profile-meta {
  display: grid;
  gap: 3px;
}

.dashboard-profile-name {
  font-size: clamp(18px, 1.45vw, 24px);
  font-weight: 700;
  line-height: 1.02;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-profile-uuid {
  color: #8ca7cf;
  font-size: 12px;
  word-break: break-all;
  opacity: 0.86;
}

.dashboard-profile-host {
  color: #9bb4d8;
  font-size: 13px;
}

.dashboard-profile-proxy {
  color: #8bb7ff;
  font-size: 12px;
}

.dashboard-profile-error {
  color: #ff9d9d;
  font-size: 12px;
  font-weight: 700;
  word-break: break-word;
}

.dashboard-profile-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dashboard-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(124, 160, 218, 0.36);
  border-radius: 999px;
  background: rgba(8, 17, 31, 0.86);
  color: #d8e8ff;
  min-height: 24px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-pill.muted {
  color: #bbd1f2;
}

.dashboard-pill.running {
  border-color: rgba(61, 213, 138, 0.62);
  background: rgba(20, 95, 62, 0.55);
  color: #b8f5d9;
}

.dashboard-pill.starting {
  border-color: rgba(243, 190, 89, 0.62);
  background: rgba(91, 67, 24, 0.62);
  color: #ffe2a5;
}

.dashboard-pill.stopping {
  border-color: rgba(245, 158, 11, 0.62);
  background: rgba(120, 53, 15, 0.62);
  color: #fde68a;
}

.dashboard-pill.error {
  border-color: rgba(247, 120, 120, 0.6);
  background: rgba(95, 37, 37, 0.65);
  color: #ffd4d4;
}

.dashboard-pill.stopped {
  border-color: rgba(147, 171, 207, 0.44);
  background: rgba(40, 57, 84, 0.72);
  color: #cad7ec;
}

.dashboard-profile-bars {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f3f8ff;
}

.dashboard-profile-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-profile-stats span {
  border: 1px solid rgba(124, 160, 218, 0.32);
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(10, 19, 35, 0.85);
  color: #d4e2f9;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-profile-stats span strong {
  color: #9dc0ed;
  font-weight: 700;
  font-size: 12px;
}

.dashboard-profile-status {
  border: 1px solid rgba(124, 160, 218, 0.32);
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
  color: #9fb6d8;
}

.dashboard-profile-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash-view-link {
  border: 0;
  background: transparent;
  color: #66a1ff;
  font-weight: 700;
  padding: 0;
  text-align: left;
}

.dash-menu-trigger {
  border: 0;
  background: transparent;
  color: #95b2db;
  font-size: 20px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}

.dashboard-profile-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(117, 152, 212, 0.28);
  border-radius: 10px;
  background: rgba(6, 14, 27, 0.96);
  padding: 8px;
}

.link-btn {
  text-align: left;
  border: 1px solid rgba(117, 152, 212, 0.3);
  border-radius: 8px;
  background: rgba(8, 19, 35, 0.86);
  color: #cfe0fb;
  min-height: 34px;
  padding: 7px 10px;
  font-weight: 700;
}

.dash-chat-log {
  min-height: 250px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid rgba(124, 160, 218, 0.28);
  border-radius: 10px;
  background: #08172d;
  padding: 8px 10px;
}

.dash-chat-line {
  color: #d6e6ff;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.dash-chat-line.warn {
  color: #ffd28f;
}

.dash-chat-line.error {
  color: #ff9d9d;
}

.dash-chat-line.chat {
  color: #68ff82;
}

.dash-chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.dash-inventory-wrap,
.dash-window-wrap {
  display: grid;
  gap: 8px;
  min-width: fit-content;
}

.dash-inventory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94afda;
  font-weight: 700;
}

.dash-slot-grid {
  display: grid;
  gap: 3px;
}

.dash-slot-grid-armor {
  grid-template-columns: repeat(4, 34px);
}

.dash-slot-grid-main {
  grid-template-columns: repeat(9, 34px);
}

.dash-slot-grid-hotbar {
  grid-template-columns: repeat(9, 34px);
  margin-top: 4px;
}

.dash-window-grid {
  grid-template-columns: repeat(var(--cols, 9), 34px);
}

.dash-slot {
  position: relative;
  border: 1px solid rgba(117, 152, 212, 0.58);
  border-radius: 2px;
  background: rgba(7, 16, 30, 0.92);
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}

.dash-slot.empty {
  background: rgba(7, 16, 30, 0.64);
}

.dash-slot-icon-wrap {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}

.dash-slot-icon {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
}

.dash-slot-fallback {
  font-size: 10px;
  font-weight: 700;
  color: #bed2f3;
}

.dash-slot-count {
  position: absolute;
  right: 1px;
  bottom: 0;
  font-size: 11px;
  font-weight: 700;
  color: #eff5ff;
  text-shadow: 0 0 3px #000;
}

.dash-window-title {
  color: #eef5ff;
  font-weight: 700;
  margin-bottom: 6px;
}

.dash-inventory-combined-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  overflow-y: auto;
  max-height: 100%;
}

.dash-window-section {
  padding-bottom: 4px;
}

.dash-inventory-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(113, 154, 220, 0.35), transparent);
  margin: 4px 0;
}

.dash-inventory-section {
  padding-top: 2px;
}

.dash-inventory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 2px;
  gap: 8px;
}

.dash-offhand-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-offhand-label {
  font-size: 0.72rem;
  color: #8ea8d0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-slot-grid-offhand {
  display: inline-grid;
  grid-template-columns: 1fr;
}

.dash-close-window-btn {
  background: rgba(220, 50, 50, 0.18);
  border: 1px solid rgba(220, 80, 80, 0.4);
  color: #ff8888;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.dash-close-window-btn:hover {
  background: rgba(220, 50, 50, 0.35);
  border-color: rgba(220, 80, 80, 0.7);
  color: #ffaaaa;
}

.dash-mini-cmd-inline {
  margin-top: 8px;
}

.dash-mini-cmd-wrap {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(110, 152, 220, 0.26);
  border-radius: 10px;
  background: rgba(8, 17, 33, 0.78);
  padding: 8px;
}

.dash-mini-cmd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash-mini-cmd-head-title {
  color: #cbe1ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dash-mini-cmd-head .btn {
  min-height: 30px;
  padding: 0 12px;
}

.dash-mini-cmd-fields {
  display: grid;
  gap: 8px;
}

.dash-mini-cmd-label {
  display: grid;
  gap: 4px;
  color: #98b5de;
  font-size: 12px;
  font-weight: 700;
}

.dash-mini-cmd-select {
  width: 100%;
}

.dash-mini-cmd-grid2 {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dash-mini-cmd-grid3 {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dash-mini-cmd-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #c4d9f9;
  font-size: 12px;
  font-weight: 600;
  min-height: 36px;
}

.dash-item-enchants {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(113, 154, 220, 0.15);
}

.dash-item-ench {
  color: #7df8ff;
  font-size: 0.78rem;
  text-transform: capitalize;
}

.dash-item-lore-wrap {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(113, 154, 220, 0.15);
}

.dash-item-lore {
  color: #b48eff;
  font-size: 0.75rem;
  font-style: italic;
  white-space: pre-wrap;
  word-break: break-word;
}

.dashboard-slot-menu {
  position: fixed;
  min-width: 292px;
  border: 1px solid rgba(113, 154, 220, 0.45);
  border-radius: 12px;
  background: rgba(6, 14, 28, 0.98);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  z-index: 250;
}

.dashboard-slot-menu button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(111, 155, 224, 0.2);
  background: transparent;
  color: #d9e7ff;
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.dashboard-slot-menu .menu-item-title {
  font-size: 15px;
  line-height: 1.25;
}

.dashboard-slot-menu .menu-item-sub {
  font-size: 12px;
  font-weight: 500;
  color: #8eaad2;
}

.dashboard-slot-menu-divider {
  height: 1px;
  background: rgba(122, 162, 229, 0.22);
}

.dashboard-slot-menu button:last-child {
  border-bottom: 0;
}

.dashboard-slot-menu button:hover {
  background: rgba(49, 85, 140, 0.42);
}

.dashboard-item-tooltip {
  position: fixed;
  z-index: 320;
  max-width: min(440px, 72vw);
  border: 1px solid rgba(122, 164, 236, 0.5);
  border-radius: 10px;
  background: rgba(6, 13, 25, 0.98);
  box-shadow: var(--shadow-xl);
  padding: 9px 10px;
  color: #dbe9ff;
  pointer-events: none;
}

.dash-item-name {
  color: #fff0a8;
  font-weight: 700;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.dash-item-id {
  margin-top: 2px;
  font-family: var(--font-mono);
  color: #8eadcf;
  font-size: 11px;
}

.dash-item-meta {
  margin-top: 3px;
  color: #bad0f1;
  font-size: 12px;
}

.dash-item-nbt {
  margin: 6px 0 0;
  max-height: 180px;
  overflow: auto;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(113, 154, 220, 0.34);
  background: rgba(7, 18, 36, 0.94);
  color: #d6e6ff;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}

.dashboard-map-pane {
  padding: 12px;
  height: 100%;
}

.dashboard-map-canvas {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  border: 1px solid rgba(117, 152, 212, 0.38);
}

.no-selection {
  padding: 14px;
  color: var(--text-1);
}

.stack-list {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.stack-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(12, 23, 40, 0.86);
  padding: 10px;
}

.stack-item .title {
  font-weight: 700;
}

.stack-item .meta {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 12px;
}

.run-row {
  margin-top: 10px;
}

.activity-list {
  min-height: 0;
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.activity-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(11, 22, 39, 0.9);
  padding: 8px 9px;
}

.activity-item .meta {
  font-size: 12px;
  color: var(--text-2);
}

.accounts-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.3fr) minmax(350px, 0.8fr);
  gap: 14px;
  align-items: start;
  overflow: visible;
}

.accounts-table-card {
  position: relative;
  z-index: 4;
  overflow: visible;
}

.account-editor-card {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.accounts-table-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: min(80vh, 940px);
}

.accounts-bulk-actions {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 37, 63, 0.82);
}

.macro-action-select {
  min-width: 210px;
  height: 34px;
}

.account-table-head,
.account-row {
  display: grid;
  grid-template-columns: 28px minmax(150px, 1fr) 126px 192px 192px 94px;
  gap: 6px;
  align-items: center;
}

.account-table-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}

.account-table {
  min-height: 0;
  flex: 1 1 auto;
  height: auto;
  overflow: auto;
}

.account-row {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(122, 159, 213, 0.16);
}

.account-row:hover {
  background: rgba(57, 92, 147, 0.2);
}

.account-row.active {
  background: rgba(79, 132, 217, 0.24);
}

.account-row .name {
  font-weight: 700;
}

.account-row .sub {
  color: var(--text-2);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 3px 10px;
  font-weight: 700;
  font-size: 12px;
}

.status-pill.running {
  border-color: rgba(61, 213, 138, 0.62);
  background: rgba(20, 95, 62, 0.55);
  color: #b8f5d9;
}

.status-pill.starting {
  border-color: rgba(243, 190, 89, 0.62);
  background: rgba(91, 67, 24, 0.62);
  color: #ffe2a5;
}

.status-pill.stopping {
  border-color: rgba(245, 158, 11, 0.62);
  background: rgba(120, 53, 15, 0.62);
  color: #fde68a;
}

.status-pill.error {
  border-color: rgba(247, 120, 120, 0.6);
  background: rgba(95, 37, 37, 0.65);
  color: #ffd4d4;
}

.status-pill.stopped {
  border-color: rgba(147, 171, 207, 0.44);
  background: rgba(40, 57, 84, 0.72);
  color: #cad7ec;
}

.add-account-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  background: rgba(10, 20, 36, 0.95);
}

.menu-wrap {
  position: relative;
  z-index: 1100;
}

.menu {
  position: absolute;
  right: 0;
  top: auto !important;
  bottom: calc(100% + 8px) !important;
  min-width: 290px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(10, 20, 35, 0.98);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  z-index: 1200;
}

.menu button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(123, 158, 212, 0.16);
  background: transparent;
  color: #d8e7ff;
  text-align: left;
  padding: 10px 12px;
}

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

.menu button:hover {
  background: rgba(73, 120, 199, 0.24);
}

.menu button:disabled {
  color: rgba(152, 170, 197, 0.65);
  background: rgba(32, 46, 68, 0.5);
}

.account-editor-card {
  padding-bottom: 12px;
}

.form-grid {
  padding: 12px 14px;
  display: grid;
  gap: 9px 10px;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
}

.form-grid .full {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 35px;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.account-editor-card .row-actions {
  padding: 0 14px;
  margin-top: 8px;
}

.commands-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.46fr) minmax(440px, 0.9fr) minmax(280px, 0.56fr);
  gap: 14px;
}

.command-type-list {
  display: grid;
}

.command-type-item {
  border-top: 1px solid rgba(122, 159, 213, 0.17);
  background: rgba(9, 19, 34, 0.85);
  padding: 12px 13px;
}

.command-type-item:first-child {
  border-top: 0;
}

.command-type-item:hover {
  background: rgba(28, 48, 77, 0.72);
}

.command-type-item.active {
  background: rgba(55, 89, 145, 0.46);
  border-left: 3px solid rgba(99, 149, 255, 0.95);
  padding-left: 10px;
}

.command-type-item .title {
  font-weight: 700;
}

.command-type-item .desc {
  margin-top: 3px;
  color: var(--text-2);
  font-size: 12px;
}

.command-settings-panel {
  padding: 13px;
  display: grid;
  gap: 10px;
}

.command-settings-panel .dark-box {
  border: 1px solid rgba(105, 148, 218, 0.35);
  border-radius: 10px;
  background: rgba(9, 22, 42, 0.86);
  padding: 10px;
}

.command-run-row {
  padding: 0 13px 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#commandTargetSummary {
  padding: 0 13px 12px;
}

.command-history-list {
  padding: 10px;
  max-height: 78vh;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.command-history-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 20, 36, 0.82);
  padding: 9px 10px;
}

.command-history-item .title {
  font-weight: 700;
}

.command-history-item .meta {
  margin-top: 3px;
  color: var(--text-2);
  font-size: 12px;
}

.plugins-layout,
.macros-layout {
  display: grid;
  gap: 14px;
}

.macros-layout {
  grid-template-columns: minmax(520px, 1fr) minmax(320px, 0.62fr);
}

.plugin-list,
.macro-list {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.macro-list {
  max-height: min(72vh, 920px);
  overflow: auto;
  overscroll-behavior: contain;
}

.plugin-item,
.macro-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(9, 19, 34, 0.82);
  padding: 10px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plugin-item.plugin-instance {
  display: block;
  padding: 0;
  overflow: hidden;
}

.plugin-instance-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
}

.plugin-instance-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.plugin-instance-grip {
  color: #9ba9bd;
  font-weight: 900;
  font-size: 28px;
  line-height: 1;
  user-select: none;
}

.plugin-instance-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plugin-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.plugin-tag {
  border: 1px solid rgba(124, 170, 238, 0.46);
  border-radius: 8px;
  background: rgba(23, 45, 78, 0.68);
  color: #b9d7ff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
}

.plugin-editor {
  border-top: 1px solid rgba(112, 152, 220, 0.26);
  background: rgba(17, 32, 54, 0.82);
  padding: 14px;
  display: grid;
  gap: 14px;
}

.plugin-editor-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.plugin-editor-box {
  border: 1px solid rgba(111, 152, 220, 0.24);
  border-radius: 10px;
  background: rgba(9, 20, 38, 0.66);
  padding: 11px 12px;
  display: grid;
  gap: 8px;
}

.plugin-editor-box h4 {
  margin: 0;
  font-size: 17px;
}

.plugin-editor-box p {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

.plugin-radio-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.plugin-radio-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-1);
  font-weight: 700;
}

.plugin-radio-option input[type="radio"] {
  width: 16px;
  height: 16px;
}

.plugin-runon-select {
  min-height: 110px;
}

.plugin-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.plugin-setting-field {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(113, 156, 226, 0.2);
  border-radius: 10px;
  background: rgba(11, 24, 44, 0.6);
  padding: 10px;
}

.plugin-setting-label {
  font-weight: 700;
  color: var(--text-0);
}

.plugin-setting-hint {
  font-size: 12px;
  color: var(--text-2);
}

.plugin-boolean-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-1);
  font-weight: 700;
}

.plugin-boolean-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.plugin-minmax-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.plugin-minmax-field {
  display: grid;
  gap: 4px;
}

.plugin-string-list {
  display: grid;
  gap: 6px;
}

.plugin-string-list-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.plugin-string-list-row input {
  flex: 1 1 auto;
}

.plugin-editor-footer {
  border-top: 1px solid rgba(113, 156, 226, 0.2);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plugin-editor-status {
  color: var(--text-2);
  font-size: 12px;
  text-transform: capitalize;
}

@media (max-width: 980px) {
  .plugin-instance-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .plugin-instance-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .plugin-editor-top {
    grid-template-columns: 1fr;
  }
}

.macro-item {
  cursor: grab;
  user-select: none;
}

.macro-item:active {
  cursor: grabbing;
}

.macro-item.active {
  border-color: rgba(105, 155, 255, 0.78);
  background: rgba(35, 58, 95, 0.52);
}

.macro-item.selected {
  border-color: rgba(108, 169, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(108, 169, 255, 0.35) inset;
}

.macro-list.drag-active .macro-item {
  transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.macro-item.dragging {
  opacity: 0.52;
  border-style: dashed;
  border-color: rgba(132, 164, 226, 0.75);
}

.macro-item.drop-before {
  box-shadow: inset 0 3px 0 rgba(124, 184, 255, 0.95);
}

.macro-item.drop-after {
  box-shadow: inset 0 -3px 0 rgba(124, 184, 255, 0.95);
}

.macro-select-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 2px;
  min-width: 24px;
  min-height: 24px;
}

.macro-select-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #5f9eff;
}

.plugin-item .title,
.macro-item .title {
  font-weight: 700;
}

.plugin-item .meta,
.macro-item .meta {
  font-size: 12px;
  color: var(--text-2);
}

.macro-builder-footer {
  border-top: 1px dashed var(--line-strong);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.macro-detail {
  padding: 12px;
  min-height: 180px;
}

.macro-detail-title {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  color: #e6edf7;
}

.card-callout {
  margin: 12px;
  border: 1px dashed rgba(141, 164, 198, 0.45);
  border-radius: 10px;
  background: rgba(28, 37, 50, 0.72);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.card-notice {
  margin: 12px;
  border: 1px dashed rgba(141, 164, 198, 0.45);
  border-radius: 10px;
  background: rgba(31, 41, 55, 0.74);
  padding: 11px;
  color: #d8e0ed;
  font-weight: 600;
}

.page-placeholder {
  max-width: 1080px;
}

.placeholder-card {
  padding: 15px;
}

.logs-card {
  padding-bottom: 12px;
}

.terminal-log {
  margin: 12px;
  height: 52vh;
  border: 1px solid rgba(113, 152, 213, 0.34);
  border-radius: 10px;
  background: linear-gradient(180deg, #121a24 0%, #0e151f 100%);
  color: #cfe0ff;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  padding: 10px;
  overflow: auto;
}

.incident-card {
  margin-top: 12px;
  padding-bottom: 12px;
}

.incident-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.incident-filters select {
  width: auto;
  min-width: 180px;
  max-width: 280px;
}

.incident-list {
  margin: 12px;
  display: grid;
  gap: 8px;
  max-height: 38vh;
  overflow: auto;
}

.incident-item {
  border: 1px solid rgba(111, 152, 216, 0.24);
  border-radius: 10px;
  background: rgba(8, 17, 31, 0.84);
  padding: 9px 10px;
  display: grid;
  gap: 5px;
}

.incident-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.incident-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(114, 154, 220, 0.5);
  background: rgba(35, 65, 107, 0.62);
  color: #ddebff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 8px;
  text-transform: uppercase;
}

.incident-pill.macro-start {
  border-color: rgba(81, 166, 120, 0.55);
  background: rgba(35, 95, 59, 0.55);
  color: #dbffe8;
}

.incident-pill.macro-end {
  border-color: rgba(97, 161, 220, 0.55);
  background: rgba(33, 72, 118, 0.58);
  color: #dcefff;
}

.incident-pill.warn {
  border-color: rgba(194, 150, 73, 0.55);
  background: rgba(106, 77, 31, 0.56);
  color: #ffefcb;
}

.incident-pill.error {
  border-color: rgba(211, 96, 96, 0.55);
  background: rgba(112, 42, 42, 0.56);
  color: #ffd9d9;
}

.incident-ts {
  color: var(--text-2);
  font-size: 11px;
}

.incident-message {
  color: var(--text-1);
  word-break: break-word;
}

.incident-meta {
  color: var(--text-2);
  font-size: 12px;
}

.notifications-card,
.schedule-card,
.team-card {
  padding-bottom: 12px;
}

.notifications-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.notifications-filters select {
  width: auto;
  min-width: 160px;
}

.notifications-list,
.schedule-list,
.team-list {
  margin: 12px;
  display: grid;
  gap: 8px;
  max-height: 56vh;
  overflow: auto;
}

.notice-item,
.schedule-item,
.team-item {
  border: 1px solid rgba(112, 154, 220, 0.24);
  border-radius: 10px;
  background: rgba(8, 17, 31, 0.84);
  padding: 10px;
}

.notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notice-level {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid rgba(114, 156, 222, 0.46);
  background: rgba(35, 66, 107, 0.58);
  color: #dcecff;
}

.notice-item.warn .notice-level {
  border-color: rgba(194, 150, 73, 0.55);
  background: rgba(106, 77, 31, 0.56);
  color: #ffefcb;
}

.notice-item.error .notice-level {
  border-color: rgba(211, 96, 96, 0.55);
  background: rgba(112, 42, 42, 0.56);
  color: #ffd9d9;
}

.notice-ts,
.notice-meta,
.schedule-meta,
.team-meta {
  color: var(--text-2);
  font-size: 12px;
}

.notice-message,
.team-name {
  color: var(--text-1);
  font-weight: 700;
  margin-top: 4px;
}

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

.schedule-select {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  color: var(--text-1);
}

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

.team-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.team-status {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(112, 154, 220, 0.48);
  background: rgba(27, 57, 98, 0.56);
  color: #deedff;
}

.team-status.running {
  border-color: rgba(81, 166, 120, 0.55);
  background: rgba(35, 95, 59, 0.55);
  color: #dbffe8;
}

.team-status.error {
  border-color: rgba(211, 96, 96, 0.55);
  background: rgba(112, 42, 42, 0.56);
  color: #ffd9d9;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(3, 9, 19, 0.62);
  backdrop-filter: blur(2px);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.modal-card {
  width: min(620px, calc(100vw - 30px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(10, 20, 36, 0.98) 0%, rgba(7, 14, 26, 0.98) 100%);
  box-shadow: var(--shadow-xl);
  color: var(--text-0);
  padding: 14px;
}

.modal-card.dark {
  border-color: rgba(122, 168, 240, 0.44);
  background: linear-gradient(180deg, rgba(6, 14, 28, 0.99) 0%, rgba(3, 10, 20, 0.99) 100%);
}

.modal-head {
  margin-bottom: 10px;
}

.modal-head strong {
  font-size: 16px;
  font-weight: 700;
}

.target-list {
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 16, 30, 0.78);
}

.target-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(122, 159, 213, 0.15);
}

.target-item:last-child {
  border-bottom: 0;
}

.target-item .info {
  display: grid;
  gap: 2px;
}

.target-item .name {
  font-weight: 700;
}

.builder {
  position: fixed;
  inset: 0;
  z-index: 130;
  background:
    radial-gradient(circle at 12% -12%, rgba(128, 151, 187, 0.12), transparent 34%),
    linear-gradient(180deg, #121922 0%, #0f141b 100%);
}

.builder-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.builder-topbar {
  border-bottom: 1px solid rgba(175, 190, 212, 0.18);
  background: linear-gradient(180deg, rgba(24, 33, 44, 0.96), rgba(20, 28, 38, 0.96));
  padding: 7px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.builder-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.builder-title {
  display: none;
  color: #e8f3ff;
  font-weight: 700;
}

.builder-pill {
  border: 1px solid rgba(175, 190, 212, 0.3);
  border-radius: 7px;
  background: rgba(28, 37, 49, 0.88);
  color: #d4deeb;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
}

.builder-body {
  min-height: 0;
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
}

.hidden-panel {
  display: none !important;
}

.builder-left,
.builder-center,
.builder-right {
  min-height: 0;
  background: rgba(17, 24, 34, 0.8);
}

.builder-center {
  border-right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.builder-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(340px, 38vw);
  z-index: 14;
  border-right: 1px solid rgba(175, 190, 212, 0.2);
  box-shadow: 10px 0 20px rgba(0, 0, 0, 0.22);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.builder-right {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(372px, 40vw);
  z-index: 14;
  border-left: 1px solid rgba(175, 190, 212, 0.2);
  box-shadow: -10px 0 20px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
}

.panel-title {
  border-bottom: 1px solid rgba(169, 186, 210, 0.18);
  padding: 9px 10px;
  font-size: 16px;
  font-weight: 700;
  color: #dbe3ef;
}

.builder-left .panel-title,
.builder-right .panel-title,
.builder-center .panel-title {
  font-size: 16px;
}

.builder-canvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.builder-scroll {
  min-height: 0;
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.builder-right .builder-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.builder-right input {
  margin: 10px;
  width: calc(100% - 20px);
}

#builderPalette {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.builder-canvas {
  position: relative;
  min-height: 0;
  overflow: scroll;
  background-color: #111a27;
  background-image:
    radial-gradient(circle, rgba(148, 168, 196, 0.2) 1px, transparent 1px),
    radial-gradient(circle, rgba(122, 142, 173, 0.08) 1px, transparent 1px);
  background-size: 20px 20px, 80px 80px;
  cursor: grab;
  touch-action: none;
  overscroll-behavior: contain;
}

.builder-canvas.panning {
  cursor: grabbing;
}

.builder-viewport {
  position: relative;
  width: 12000px;
  height: 9000px;
}

.builder-links {
  position: absolute;
  inset: 0;
  width: 12000px;
  height: 9000px;
  pointer-events: none;
  z-index: 0;
}

.builder-node-layer,
.builder-nodes {
  z-index: 1;
}

.builder-links path {
  filter: drop-shadow(0 0 3px rgba(130, 196, 255, 0.15));
}

.builder-node-layer {
  position: relative;
  width: 12000px;
  height: 9000px;
}

.palette-group {
  border: 1px solid rgba(175, 190, 212, 0.24);
  border-radius: 10px;
  background: rgba(19, 27, 39, 0.8);
  overflow: hidden;
}

.palette-title-btn {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(175, 190, 212, 0.18);
  background: linear-gradient(180deg, rgba(42, 54, 70, 0.9), rgba(34, 45, 59, 0.9));
  color: #d9e2ef;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.palette-title-btn:hover {
  filter: brightness(1.1);
}

.palette-title-btn .caret {
  width: 13px;
  color: #b9c9de;
}

.palette-title-btn .count {
  color: #a8b8ce;
  font-size: 11px;
}

.palette-items {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.palette-btn {
  text-align: left;
  border: 1px solid rgba(175, 190, 212, 0.24);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(31, 41, 54, 0.92), rgba(25, 34, 46, 0.92));
  color: #dce5f1;
  padding: 8px;
  display: grid;
  gap: 3px;
}

.palette-btn:hover {
  background: linear-gradient(180deg, rgba(41, 53, 69, 0.95), rgba(33, 44, 59, 0.95));
}

.palette-btn.disabled {
  opacity: 0.58;
}

.palette-btn .comp-name {
  font-weight: 700;
}

.palette-btn .comp-id {
  color: #9fbbe8;
  font-size: 11px;
  font-family: var(--font-mono);
}

/* WIP Folder Group: collapsible container for 6 lesser-used component groups */
.palette-wip-folder {
  border-color: rgba(194, 160, 88, 0.32);
  background: rgba(28, 24, 16, 0.65);
}

.palette-wip-btn {
  background: linear-gradient(180deg, rgba(62, 50, 24, 0.92), rgba(48, 38, 18, 0.92)) !important;
  color: #f0dcb0 !important;
  letter-spacing: 0.1em;
}

.palette-wip-btn:hover {
  filter: brightness(1.15);
}

.palette-wip-btn .count {
  color: #c8b47e !important;
}

.palette-wip-container {
  padding: 6px;
  display: grid;
  gap: 6px;
}

.palette-wip-subgroup {
  border-color: rgba(175, 190, 212, 0.18);
  margin-left: 6px;
  border-left: 3px solid rgba(194, 160, 88, 0.38);
}

.node-card {
  position: absolute;
  width: 300px;
  border: 1px solid rgba(175, 190, 212, 0.26);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(41, 52, 66, 0.95), rgba(30, 40, 53, 0.95));
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.3);
  padding: 10px 10px 12px;
  overflow: visible;
}

.node-card.active {
  border-color: rgba(165, 182, 205, 0.9);
  box-shadow:
    0 0 0 2px rgba(145, 169, 204, 0.22),
    0 14px 24px rgba(0, 0, 0, 0.34);
}

.node-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  cursor: grab;
  align-items: flex-start;
}

.node-head:active {
  cursor: grabbing;
}

.node-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.node-name {
  font-size: 16px;
  line-height: 1.02;
  font-weight: 700;
  color: #edf4ff;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.node-id {
  display: none;
}

.node-actions {
  display: flex;
  gap: 6px;
}

.node-icon-btn {
  border: 1px solid rgba(110, 150, 224, 0.34);
  background: rgba(18, 34, 59, 0.96);
  color: #d7e7ff;
  border-radius: 9px;
  width: 30px;
  height: 30px;
  font-weight: 900;
  line-height: 1;
}

.node-icon-btn:hover {
  filter: brightness(1.12);
}

.node-desc {
  margin-top: 8px;
  color: #c6d8f4;
  font-size: 13px;
  line-height: 1.18;
  min-height: 64px;
}

.node-inline {
  margin-top: 7px;
  display: grid;
  gap: 4px;
}

.node-inline span {
  color: #abc4e8;
  font-size: 12px;
}

.node-inline select,
.node-inline input,
.node-inline textarea,
.builder-left input,
.builder-left select,
.builder-left textarea,
.builder-right input,
.builder-right select,
.builder-right textarea {
  border-color: rgba(101, 147, 224, 0.36);
  background: rgba(8, 18, 34, 0.96);
  color: #e4eeff;
}

.node-connect-row {
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.node-handle {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 3px;
  padding: 0;
  box-shadow: 0 0 0 2px rgba(4, 9, 20, 0.75);
}

.node-handle.in {
  background: #7fc9ff;
}

.node-handle.out {
  background: #92f8dc;
}

.node-handle.active {
  box-shadow:
    0 0 0 2px rgba(4, 9, 20, 0.75),
    0 0 0 4px rgba(131, 184, 255, 0.42);
}

.node-handle.linked {
  filter: saturate(1.15) brightness(1.06);
}

.node-handle:focus {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(4, 9, 20, 0.75),
    0 0 0 4px rgba(116, 172, 255, 0.34);
}

.node-handle:hover {
  transform: scale(1.15);
}

.node-input-handle {
  margin-top: 0;
  left: calc(-1 * var(--builder-port-half, 7px));
}

.node-outputs {
  display: grid;
  gap: 10px;
}

.node-handle-abs {
  position: absolute;
  z-index: 4;
}

.node-output-handle {
  right: calc(-1 * var(--builder-port-half, 7px));
}

.builder-canvas .muted-line {
  color: #9db7df;
}

.builder-save {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 8, 19, 0.62);
}

.builder-save-card {
  width: min(530px, calc(100vw - 36px));
  border: 1px solid rgba(175, 190, 212, 0.28);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(34, 44, 58, 0.98), rgba(25, 34, 46, 0.98));
  box-shadow: var(--shadow-xl);
  padding: 14px;
  display: grid;
  gap: 11px;
}

.builder-save-title {
  font-size: 16px;
  font-weight: 700;
  color: #e6edf7;
}

.builder-save-card label {
  display: grid;
  gap: 6px;
}

.builder-preflight-summary {
  border: 1px solid rgba(117, 151, 200, 0.3);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(10, 21, 39, 0.72);
  display: grid;
  gap: 6px;
}

.builder-preflight-summary.ok {
  border-color: rgba(56, 195, 123, 0.6);
  background: rgba(15, 54, 34, 0.32);
}

.builder-preflight-summary.error {
  border-color: rgba(230, 98, 98, 0.64);
  background: rgba(62, 20, 26, 0.34);
}

.builder-preflight-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #cde2ff;
}

.builder-preflight-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.builder-preflight-list li {
  color: #cfe2ff;
  font-size: 12px;
  line-height: 1.4;
}

.builder-canvas-head .row-actions .btn {
  min-width: 34px;
  padding: 6px 10px;
}

#builderZoomOutBtn,
#builderZoomInBtn {
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.builder-left label {
  color: #c2d8fa;
}

@media (max-width: 1700px) {
  .dashboard-grid {
    grid-template-columns: minmax(320px, 1.2fr) minmax(240px, 0.9fr);
  }

  .bot-window-card,
  .map-card,
  .activity-card {
    grid-column: auto;
  }

  .activity-card {
    grid-column: 1 / -1;
    min-height: 260px;
  }
}

@media (max-width: 1450px) {
  .accounts-layout,
  .commands-layout,
  .macros-layout {
    grid-template-columns: 1fr;
  }

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

  .accounts-table-card {
    height: min(72vh, 820px);
  }

  .builder-body.inspector-open {
    grid-template-columns: 250px minmax(360px, 1fr);
  }

  .builder-body.palette-open {
    grid-template-columns: minmax(360px, 1fr) 280px;
  }

  .builder-body.inspector-open.palette-open {
    grid-template-columns: 250px minmax(360px, 1fr) 280px;
  }
}

@media (max-width: 1200px) {
  .shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(117, 151, 200, 0.24);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
  }

  .profile-switcher,
  .nav-group-title {
    grid-column: 1 / -1;
  }

  .main-shell {
    min-height: calc(100vh - 120px);
  }

  .page-host {
    padding: 12px;
    overflow: auto;
  }

  .account-table-head,
  .account-row {
    grid-template-columns: 28px minmax(140px, 1fr) 120px 170px;
  }

  .account-table-head span:nth-child(5),
  .account-table-head span:nth-child(6) {
    display: none;
  }

  .account-row > :nth-child(5),
  .account-row > :nth-child(6) {
    display: none;
  }

  .builder {
    overflow: auto;
  }

  .builder-shell {
    min-height: 100vh;
    height: auto;
  }

  .settings-option-grid.two,
  .settings-option-grid.three,
  .settings-option-grid.four {
    grid-template-columns: 1fr;
  }

  .settings-inline-row > * {
    flex: 1 1 100%;
  }

  .builder-topbar {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .builder-top-actions {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .builder-body,
  .builder-body.inspector-open,
  .builder-body.palette-open,
  .builder-body.inspector-open.palette-open {
    display: block;
  }

  .builder-center,
  .builder-left,
  .builder-right {
    width: 100%;
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .builder-center {
    min-height: 72vh;
  }

  .builder-left:not(.hidden-panel) {
    max-height: 42vh;
  }

  .builder-right:not(.hidden-panel) {
    max-height: 46vh;
  }

  .builder-canvas {
    min-height: 56vh;
  }
}

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

  .account-grid-card {
    max-height: none;
    min-height: 0;
  }

  .account-grid {
    max-height: none;
  }

  .account-grid-card,
  .bot-selected-card,
  .bot-window-card,
  .plugin-summary-card,
  .macro-summary-card,
  .map-card,
  .start-control-card,
  .server-card,
  .global-card,
  .activity-card {
    grid-column: auto;
    min-height: auto;
  }

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

  .command-run-row,
  .row-actions,
  .row {
    width: 100%;
  }

  .row-actions > * {
    flex: 1 1 auto;
  }

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

  .topbar h1 {
    font-size: 24px;
  }

  .dashboard-profile-name {
    font-size: 21px;
  }

  .dashboard-window-pane {
    min-height: 270px;
  }
}

@media (max-width: 760px) {
  .sidebar {
    display: block;
    padding: 10px;
  }

  .nav-block {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .topbar {
    padding: 11px 12px;
  }

  .topbar h1 {
    font-size: 23px;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .topbar-actions .sidebar-toggle-btn {
    grid-column: 1 / -1;
  }

  .topbar-actions .status-chip {
    grid-column: 1 / -1;
    width: fit-content;
  }

  .runtime-engine-top {
    width: 100%;
    justify-content: space-between;
  }

  .runtime-engine-top select {
    width: 100%;
    min-width: 0;
  }

  #saveTopRuntimeEngineBtn {
    width: 100%;
  }

  .page-host {
    padding: 10px 10px 16px;
  }

  .account-grid {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .dashboard-selected-card {
    padding: 10px;
  }

  .dashboard-profile-head {
    align-items: flex-start;
  }

  .dashboard-profile-skin {
    width: 48px;
    height: 48px;
  }

  .dashboard-profile-name {
    font-size: 20px;
  }

  .dashboard-profile-uuid {
    font-size: 11px;
  }

  .window-tabs {
    gap: 4px;
    padding: 8px 10px;
    flex-wrap: wrap;
  }

  .dashboard-tab {
    flex: 1 1 0;
    min-width: 90px;
    padding: 5px 8px;
  }

  .dash-slot-grid-main,
  .dash-slot-grid-hotbar,
  .dash-window-grid {
    width: max-content;
  }

  .accounts-table-card {
    overflow-x: auto;
  }

  .account-table-head,
  .account-row {
    min-width: 620px;
  }
}

@media (max-width: 560px) {
  .topbar h1 {
    font-size: 21px;
  }

  .card-head strong {
    font-size: 15px;
  }

  .dashboard-profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .dashboard-profile-stats span {
    padding: 5px 8px;
    font-size: 12px;
  }

  .dashboard-slot-menu {
    min-width: 250px;
  }

.dashboard-item-tooltip {
  max-width: min(360px, 90vw);
}
}

.proxy-root {
  display: grid;
  gap: 16px;
}

.proxy-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-0) 100%);
  box-shadow: var(--shadow-lg);
  padding: 18px;
}

.proxy-mode-grid,
.proxy-option-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.proxy-diag-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.proxy-diag-card {
  border: 1px solid rgba(116, 156, 219, 0.3);
  background: rgba(14, 24, 40, 0.62);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.proxy-diag-label {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.proxy-diag-value {
  color: #e7f2ff;
  font-weight: 700;
  font-size: 14px;
}

.proxy-card,
.proxy-option {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 30, 50, 0.6);
  color: inherit;
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
}

.proxy-card.active,
.proxy-option.active {
  border-color: #4f8cff;
  box-shadow: 0 0 0 1px rgba(79, 140, 255, 0.4);
}

.proxy-card-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.proxy-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(79, 140, 255, 0.2);
  color: #7fb0ff;
  font-size: 12px;
}

.proxy-custom-grid {
  display: grid;
  gap: 12px;
}

.proxy-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.proxy-list {
  margin-top: 12px;
}

.proxy-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.proxy-table {
  display: grid;
  gap: 6px;
}

.proxy-row {
  display: grid;
  grid-template-columns: 36px 1fr 110px 110px 1fr;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 20, 35, 0.5);
  align-items: center;
}

.proxy-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.proxy-assignments {
  margin-top: 16px;
}

.proxy-assign-grid {
  display: grid;
  gap: 8px;
}

.proxy-assign-row {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 12px;
  align-items: center;
}

.proxy-wip-row {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

#proxyLiveStatus {
  color: #ffb6b6;
  font-weight: 600;
}

.logs-page {
  margin: 0;
}

.logs-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.logs-head {
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(23, 31, 41, 0.96), rgba(18, 25, 34, 0.96));
  display: grid;
  gap: 8px;
}

.logs-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.logs-title {
  margin: 0;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-0);
}

.logs-sub {
  margin: 2px 0 0;
  color: var(--text-2);
}

.logs-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 600;
  color: var(--text-1);
  background: rgba(28, 37, 49, 0.92);
}

.logs-chip.online {
  border-color: rgba(100, 185, 143, 0.48);
  background: rgba(64, 95, 78, 0.45);
  color: #d6e9de;
}

.logs-chip.offline {
  border-color: rgba(201, 119, 119, 0.48);
  background: rgba(87, 51, 54, 0.45);
  color: #edd5d5;
}

.logs-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.logs-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--text-1);
  background: rgba(21, 29, 39, 0.84);
}

.logs-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
}

.logs-count {
  color: var(--text-2);
  font-size: 13px;
}

.logs-console {
  margin: 0;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: linear-gradient(180deg, rgba(20, 28, 38, 0.98) 0%, rgba(15, 21, 30, 0.98) 100%);
}

.logs-console .line {
  padding: 2px 0;
}

.logs-console .line.log {
  color: #dbe9ff;
}

.logs-console .line.runtime {
  color: #9fc8f0;
}

.logs-console .line.status {
  color: #f1d7a4;
}

.logs-console .line.error {
  color: #ffbcbc;
}

@media (max-width: 760px) {
  .logs-head {
    padding: 11px 12px;
  }

  .logs-title {
    font-size: clamp(21px, 5vw, 24px);
  }
}

/* Graphite Theme Harmonization */
.sidebar,
.topbar,
.builder-topbar,
.logs-head {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(29, 31, 35, 0.96), rgba(23, 25, 29, 0.96));
}

.card,
.settings-card,
.proxy-section,
.proxy-diag-card,
.proxy-card,
.proxy-option,
.stack-item,
.activity-item,
.command-history-item,
.plugin-item,
.macro-item,
.logs-card,
.incident-card,
.notifications-card,
.schedule-card,
.team-card,
.modal-card,
.builder-save-card,
.builder-left,
.builder-center,
.builder-right,
.palette-group,
.palette-btn,
.node-card,
.settings-guidance,
.settings-option,
.settings-preset-block,
.target-list,
.dashboard-profile-actions,
.link-btn,
.dash-chat-log,
.terminal-log,
.dashboard-slot-menu,
.dashboard-item-tooltip,
.dash-item-nbt {
  border-color: var(--line);
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-0) 100%);
  color: var(--text-0);
}

.nav-item {
  color: var(--text-2);
}

.nav-item:hover {
  color: var(--text-0);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: var(--text-0);
  background: linear-gradient(90deg, rgba(127, 151, 191, 0.2), rgba(255, 255, 255, 0.05));
}

.nav-item.active::before {
  background: linear-gradient(180deg, #90a6c9 0%, #7f97bf 100%);
}

.settings-tab,
.dashboard-tab,
.runtime-engine-top,
.status-chip,
.dashboard-pill,
.status-pill,
.logs-chip,
.builder-pill {
  border-color: var(--line);
  background: rgba(38, 40, 46, 0.92);
  color: var(--text-1);
}

.settings-tab.active,
.dashboard-tab.active {
  border-color: rgba(127, 151, 191, 0.38);
  background: rgba(53, 58, 67, 0.8);
  color: var(--text-0);
}

.btn,
.profile-bulk-btn,
.profile-action-btn,
.profile-create-btn {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(54, 56, 62, 0.98) 0%, rgba(44, 46, 52, 0.98) 100%);
  color: var(--text-0);
}

.btn-primary {
  border-color: rgba(127, 151, 191, 0.5);
  background: linear-gradient(180deg, #6e86ac 0%, #5f7699 100%);
  color: #f7f9fc;
}

.btn-success {
  border-color: rgba(127, 168, 142, 0.42);
  background: linear-gradient(180deg, #617d6c 0%, #567061 100%);
}

.btn-warning {
  border-color: rgba(168, 149, 116, 0.42);
  background: linear-gradient(180deg, #786c59 0%, #6b6050 100%);
}

.btn-danger {
  border-color: rgba(159, 125, 125, 0.44);
  background: linear-gradient(180deg, #785f5f 0%, #6c5656 100%);
}

.status-chip.online,
.logs-chip.online {
  border-color: rgba(127, 168, 142, 0.42);
  background: rgba(66, 82, 72, 0.56);
  color: #deebe1;
}

.status-chip.offline,
.logs-chip.offline {
  border-color: rgba(159, 125, 125, 0.46);
  background: rgba(84, 65, 65, 0.56);
  color: #ecdede;
}

.profile-picker-trigger,
.profile-dropdown,
.profile-bulk-actions,
.profile-dropdown-row.active,
.settings-chip,
.settings-slot-cell,
.logs-toggle,
.proxy-row,
.proxy-field input,
.proxy-field select,
.proxy-field textarea {
  border-color: var(--line);
  background: rgba(34, 36, 41, 0.9);
  color: var(--text-0);
}

.proxy-card.active,
.proxy-option.active {
  border-color: rgba(127, 151, 191, 0.46);
  box-shadow: 0 0 0 1px rgba(127, 151, 191, 0.24);
}

.proxy-badge {
  background: rgba(127, 151, 191, 0.18);
  color: #cad5e8;
}

.dashboard-profile-uuid,
.dashboard-profile-host,
.dashboard-profile-proxy,
.dashboard-profile-status,
.dashboard-profile-stats span,
.dashboard-profile-stats span strong,
.window-tabs,
.plugin-item .meta,
.macro-item .meta,
.settings-help-caption,
.logs-count {
  color: var(--text-2);
}

.dash-view-link,
.link-btn {
  color: #c9d5e8;
}

.builder {
  background:
    radial-gradient(circle at 18% -16%, rgba(255, 255, 255, 0.03), transparent 34%),
    linear-gradient(180deg, #101113 0%, #0b0b0c 100%);
}

.builder-canvas {
  background-color: #15171a;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

.builder-links path {
  filter: drop-shadow(0 0 3px rgba(127, 151, 191, 0.2));
}

.node-handle.in {
  background: #96abc8;
}

.node-handle.out {
  background: #a8b8ce;
}

.node-handle.active {
  box-shadow:
    0 0 0 2px rgba(17, 18, 21, 0.8),
    0 0 0 4px rgba(127, 151, 191, 0.34);
}

.logs-head {
  border-bottom: 1px solid var(--line);
}

.logs-console {
  background: linear-gradient(180deg, rgba(26, 28, 32, 0.98) 0%, rgba(20, 21, 24, 0.98) 100%);
}

.logs-console .line.log {
  color: #e5e8ee;
}

.logs-console .line.runtime {
  color: #d1d9e6;
}

.logs-console .line.status {
  color: #d8ccb7;
}

.logs-console .line.error {
  color: #e5cbcb;
}



/* Mobile Responsiveness for Macro Builder */
@media (max-width: 768px) {
  .builder-left,
  .builder-right {
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    background: rgba(17, 24, 34, 0.95);
  }
  .builder-right .builder-scroll {
    padding-bottom: 80px;
  }
  .builder-topbar {
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
  }
  .builder-top-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 4px;
  }
  .builder-pill {
    font-size: 10px;
    padding: 2px 4px;
  }
}

/* Command Settings Visual Grids */
.dash-hotbar-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  margin-top: 6px;
}

.slot-box {
  aspect-ratio: 1;
  min-width: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  background: rgba(15, 20, 35, 0.7);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.slot-box:hover {
  border-color: rgba(127, 151, 191, 0.35);
  background: rgba(30, 45, 70, 0.55);
  color: rgba(255,255,255,0.7);
}

.slot-box.active {
  border-color: rgba(127, 151, 191, 0.7);
  background: rgba(60, 90, 140, 0.4);
  color: #fff;
  box-shadow: 0 0 6px rgba(127, 151, 191, 0.25);
}

.setting-group {
  margin-bottom: 2px;
}

.setting-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
}

.form-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 28, 40, 0.85);
  color: var(--text-0);
  font-size: 13px;
  margin-top: 4px;
}

.form-input:focus {
  outline: none;
  border-color: rgba(127, 151, 191, 0.5);
  box-shadow: 0 0 0 2px rgba(127, 151, 191, 0.15);
}

.dash-chest-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  margin-top: 6px;
}

/* Unified responsive cleanup (portrait/mobile first) */
@media (max-width: 980px), (orientation: portrait) {
  html,
  body {
    overflow-x: hidden;
  }

  .shell,
  .shell.sidebar-collapsed {
    position: relative;
    min-height: 100dvh;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 340px);
    max-width: 340px;
    z-index: 120;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 10px 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(0);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .shell.sidebar-collapsed .sidebar {
    transform: translateX(calc(-100% - 8px));
    opacity: 0;
    pointer-events: none;
  }

  .main-shell {
    min-height: 100dvh;
    width: 100%;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    padding: 10px 12px;
    gap: 8px;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .topbar-actions .sidebar-toggle-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .topbar-actions .status-chip {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .page-host {
    padding: 10px;
    overflow-x: hidden;
  }

  .row-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .row-actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 120px;
  }

  .accounts-layout,
  .commands-layout,
  .plugins-layout,
  .macros-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .accounts-table-card {
    height: auto;
    max-height: min(70dvh, 760px);
  }

  .dashboard-selected-card,
  .dashboard-window-pane,
  .dashboard-map-pane,
  .account-grid-card {
    min-width: 0;
  }

  .account-grid {
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  }

  .card,
  .settings-card,
  .proxy-section,
  .command-settings-panel .dark-box {
    min-width: 0;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  .topbar h1 {
    font-size: clamp(18px, 5.2vw, 22px);
  }

  .topbar p {
    font-size: 12px;
  }

  .runtime-engine-top {
    width: 100%;
    justify-content: space-between;
  }

  .runtime-engine-top select {
    min-width: 0;
    width: 100%;
  }

  .accounts-bulk-actions {
    padding: 10px;
  }

  .account-table-head,
  .account-row {
    min-width: 580px;
  }
}

/* Macro builder: usable touch UX on portrait/mobile */
@media (max-width: 980px), (orientation: portrait) {
  .builder {
    overflow: hidden;
  }

  .builder-shell {
    min-height: 100dvh;
    height: 100dvh;
  }

  .builder-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    padding: 8px;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .builder-title {
    font-size: 21px;
  }

  .builder-pill {
    font-size: 11px;
    padding: 3px 6px;
  }

  .builder-top-actions {
    margin-left: auto;
    width: auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-end;
    flex: 0 0 auto;
  }

  .builder-top-actions .btn,
  .builder-topbar > .btn,
  .builder-pill {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .builder-body {
    height: calc(100dvh - 96px);
  }

  .builder-center {
    min-height: 0;
    height: 100%;
  }

  .builder-canvas {
    min-height: 0;
    height: 100%;
  }

  .builder-canvas-head {
    flex-wrap: wrap;
  }

  .builder-canvas-head .row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .builder-canvas-head .row-actions .btn {
    flex: 0 0 auto;
    min-width: 0;
  }

  .builder-left,
  .builder-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(92vw, 380px);
    max-width: 380px;
    z-index: 40;
    border-top: 1px solid var(--line);
    box-shadow: 0 0 26px rgba(0, 0, 0, 0.34);
    background: rgba(17, 24, 34, 0.98);
  }

  .builder-left {
    left: 0;
    right: auto;
    border-left: 0;
    border-right: 1px solid rgba(175, 190, 212, 0.2);
  }

  .builder-right {
    right: 0;
    left: auto;
    border-right: 0;
    border-left: 1px solid rgba(175, 190, 212, 0.2);
  }

  .builder-scroll {
    padding: 10px 10px calc(88px + env(safe-area-inset-bottom));
  }

  .builder-right input {
    margin: 8px 10px calc(10px + env(safe-area-inset-bottom));
    width: calc(100% - 20px);
  }
}

@media (max-width: 560px) {
  .builder-topbar {
    padding: 6px;
  }

  .builder-title {
    font-size: 18px;
  }

  .builder-body {
    height: calc(100dvh - 86px);
  }
}

/* Resolution/ratio mode hooks from app.js (portrait, tall, landscape, wide) */
html[data-ui-mode="portrait"] .topbar,
html[data-ui-mode="tall"] .topbar {
  align-items: flex-start;
}

html[data-ui-mode="portrait"] .topbar-actions,
html[data-ui-mode="tall"] .topbar-actions {
  width: 100%;
}

html[data-ui-mode="tall"] .page-host {
  padding-bottom: 20px;
}

html[data-ui-mode="tall"] .builder-body {
  height: calc(100dvh - 104px);
}

html[data-ui-mode="wide"] .builder-topbar {
  padding-left: 10px;
  padding-right: 10px;
}

/* Keep desktop-like horizontal shell for landscape/wide even when browser zoom reduces CSS width */
html[data-ui-mode="landscape"] .shell,
html[data-ui-mode="wide"] .shell {
  grid-template-columns: 258px minmax(0, 1fr);
  min-height: 100vh;
}

html[data-ui-mode="landscape"] .sidebar,
html[data-ui-mode="wide"] .sidebar {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: auto;
  max-width: none;
  z-index: auto;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px 12px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
  box-shadow: none;
}

html[data-ui-mode="landscape"] .nav-block,
html[data-ui-mode="wide"] .nav-block {
  display: grid;
  gap: 3px;
  overflow: visible;
  padding-bottom: 0;
}

html[data-ui-mode="landscape"] .nav-item,
html[data-ui-mode="wide"] .nav-item {
  white-space: normal;
  flex: initial;
}

html[data-ui-mode="landscape"] .topbar-actions,
html[data-ui-mode="wide"] .topbar-actions {
  width: auto;
  display: flex;
  grid-template-columns: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

html[data-ui-mode="landscape"] .topbar-actions .sidebar-toggle-btn,
html[data-ui-mode="wide"] .topbar-actions .sidebar-toggle-btn,
html[data-ui-mode="landscape"] .topbar-actions .status-chip,
html[data-ui-mode="wide"] .topbar-actions .status-chip {
  grid-column: auto;
  width: auto;
}

html[data-ui-mode="landscape"] .main-shell,
html[data-ui-mode="wide"] .main-shell {
  min-height: 100vh;
}

html[data-ui-mode="landscape"] .shell.sidebar-collapsed,
html[data-ui-mode="wide"] .shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

html[data-ui-mode="landscape"] .shell.sidebar-collapsed .sidebar,
html[data-ui-mode="wide"] .shell.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  padding: 0;
  gap: 0;
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Force desktop builder layout for landscape/wide at any browser zoom */
html[data-ui-mode="landscape"] .builder-topbar,
html[data-ui-mode="wide"] .builder-topbar {
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
}

html[data-ui-mode="landscape"] .builder-top-actions,
html[data-ui-mode="wide"] .builder-top-actions {
  margin-left: auto;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
}

html[data-ui-mode="landscape"] .builder-topbar > .btn,
html[data-ui-mode="wide"] .builder-topbar > .btn,
html[data-ui-mode="landscape"] .builder-top-actions .btn,
html[data-ui-mode="wide"] .builder-top-actions .btn,
html[data-ui-mode="landscape"] .builder-pill,
html[data-ui-mode="wide"] .builder-pill {
  flex: 0 0 auto;
  white-space: nowrap;
}

html[data-ui-mode="landscape"] .builder-shell,
html[data-ui-mode="wide"] .builder-shell {
  min-height: 100vh;
  height: 100vh;
}

html[data-ui-mode="landscape"] .builder-body,
html[data-ui-mode="wide"] .builder-body {
  display: block;
  height: 100%;
  overflow: hidden;
}

html[data-ui-mode="landscape"] .builder-center,
html[data-ui-mode="wide"] .builder-center {
  position: relative;
  width: 100%;
  min-height: 0;
  height: 100%;
}

html[data-ui-mode="landscape"] .builder-left,
html[data-ui-mode="wide"] .builder-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(340px, 38vw);
  max-height: none;
  border-right: 1px solid rgba(175, 190, 212, 0.2);
  box-shadow: 10px 0 20px rgba(0, 0, 0, 0.22);
}

html[data-ui-mode="landscape"] .builder-right,
html[data-ui-mode="wide"] .builder-right {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(372px, 40vw);
  max-height: none;
  border-left: 1px solid rgba(175, 190, 212, 0.2);
  box-shadow: -10px 0 20px rgba(0, 0, 0, 0.22);
}

html[data-ui-mode="landscape"] .builder-left:not(.hidden-panel),
html[data-ui-mode="landscape"] .builder-right:not(.hidden-panel),
html[data-ui-mode="wide"] .builder-left:not(.hidden-panel),
html[data-ui-mode="wide"] .builder-right:not(.hidden-panel) {
  max-height: none;
}

html[data-ui-mode="landscape"] .builder-canvas,
html[data-ui-mode="wide"] .builder-canvas {
  min-height: 0;
  height: 100%;
}

/* ── Prismarine Viewer Modal ─────────────────────────────────────── */
.viewer-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: viewerFadeIn 0.25s ease;
}

@keyframes viewerFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.viewer-modal-container {
  width: 94vw;
  height: 90vh;
  max-width: 1600px;
  max-height: 920px;
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(127, 151, 191, 0.25);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  background: #0d0f13;
}

.viewer-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(29, 31, 35, 0.98), rgba(23, 25, 29, 0.98));
  border-bottom: 1px solid rgba(127, 151, 191, 0.15);
}

.viewer-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #e5e8ee;
  letter-spacing: -0.01em;
}

.viewer-modal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.viewer-modal-stop-btn {
  background: linear-gradient(180deg, #785f5f 0%, #6c5656 100%);
  border: 1px solid rgba(159, 125, 125, 0.44);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #f0e0e0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.viewer-modal-stop-btn:hover {
  background: linear-gradient(180deg, #8c6e6e 0%, #7d6464 100%);
  border-color: rgba(180, 140, 140, 0.6);
}

.viewer-modal-close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(38, 40, 46, 0.92);
  color: var(--text-1);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.viewer-modal-close-btn:hover {
  background: rgba(60, 62, 70, 0.92);
  color: var(--text-0);
}

.viewer-modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}
