:root {
  color-scheme: dark;
  --bg: #0f1115;
  --topbar: #15171d;
  --panel: #191c22;
  --panel-soft: #20242c;
  --field: #11141a;
  --field-2: #151922;
  --line: #2d333d;
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f2f5f8;
  --muted: #9da7b3;
  --muted-2: #737f8d;
  --accent: #49c77f;
  --accent-blue: #4da3ff;
  --accent-amber: #f4b85c;
  --danger: #ef6464;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
}

html {
  background: var(--bg);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 220px),
    var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", Arial, sans-serif;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(21, 23, 29, 0.94);
  backdrop-filter: blur(12px);
}

h1 {
  font-size: 22px;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
  letter-spacing: 0;
}

.topbar p {
  color: var(--muted);
  font-size: 13px;
}

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

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 10, 14, 0.86);
}

.login-box {
  width: min(390px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-error {
  min-height: 20px;
  color: #ffb4b4;
}

.status-pill {
  min-width: 118px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--field);
  font-weight: 700;
}

.app-tabs {
  position: sticky;
  top: 76px;
  z-index: 19;
  display: flex;
  gap: 8px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(12px);
  overflow-x: auto;
}

.tab-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.tab-button:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel-soft);
}

.tab-button.active {
  color: #07100b;
  background: var(--accent);
  border-color: transparent;
  font-weight: 800;
}

.layout {
  max-width: 1560px;
  margin: 0 auto;
  padding: 18px 28px 32px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 28, 34, 0.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.controls,
.command,
.screen,
.bot-chat,
.inventory,
.logs,
.overview,
.client-launcher,
.desktop-view,
.chest-shop,
.profiles,
.schematics {
  padding: 18px;
}

.chest-shop[data-tab-panel="chestshop"] {
  grid-column: 1 / -1;
}

.chest-shop-head {
  align-items: end;
}

.chest-shop-head > div:first-child {
  display: grid;
  gap: 4px;
}

.chest-shop-head .action-status {
  max-width: none;
  font-size: 13px;
}

.chest-shop-bot-picker {
  width: min(360px, 42vw);
}

.chest-shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 320px);
  gap: 22px;
  align-items: start;
}

.chest-shop-config {
  min-width: 0;
  display: grid;
  gap: 0;
}

.chest-shop-group {
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line-soft);
}

.chest-shop-group + .chest-shop-group,
.chest-shop-selected-actions + .chest-shop-group {
  padding-top: 20px;
}

.chest-shop-group h3,
.chest-shop-fleet h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.chest-shop-fields {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.chest-shop-cycle-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chest-shop-group-head,
.chest-shop-fleet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chest-shop-group-head .muted-line {
  margin: 0;
  text-align: right;
}

.chest-shop-coordinates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.chest-shop-coordinates label {
  position: relative;
}

.chest-shop-coordinates input {
  padding-left: 36px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.coordinate-axis {
  position: absolute;
  left: 1px;
  bottom: 1px;
  z-index: 1;
  width: 28px;
  height: 38px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  border-radius: 7px 0 0 7px;
  background: var(--field-2);
  font-size: 13px;
  font-weight: 900;
}

.axis-x {
  color: #ff8b8b;
}

.axis-y {
  color: #78d99e;
}

.axis-z {
  color: #79b7ff;
}

.chest-shop-target-options {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.chest-shop-advanced {
  border-bottom: 1px solid var(--line-soft);
}

.chest-shop-advanced summary {
  padding: 16px 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.chest-shop-advanced[open] {
  padding-bottom: 18px;
}

.chest-shop-timing-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.chest-shop-toggles {
  margin-top: 12px;
}

.chest-shop-selected-actions {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 10px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}

.chest-shop-presets {
  margin-top: 0;
  border-bottom: 0;
}

.chest-shop-fleet {
  position: sticky;
  top: 146px;
  min-width: 0;
  padding-left: 22px;
  border-left: 1px solid var(--line-soft);
}

.chest-shop-fleet-head {
  min-height: 32px;
}

.chest-shop-fleet-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chest-shop-fleet-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.chest-shop-fleet-actions button {
  min-width: 0;
  padding: 0 10px;
  white-space: normal;
}

#chestShopApplyAllBtn {
  grid-column: 1 / -1;
}

.chest-shop-batch-status {
  min-height: 30px;
  padding: 10px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.chest-shop-batch-status.ok {
  color: var(--accent);
}

.chest-shop-batch-status.error {
  color: #ffb7b7;
}

.chest-shop-fleet-list {
  display: grid;
  border-top: 1px solid var(--line-soft);
}

.chest-shop-fleet-list.empty {
  padding: 14px 0;
  color: var(--muted);
}

.chest-shop-bot-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 9px 4px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.chest-shop-bot-row:hover,
.chest-shop-bot-row.selected {
  border-color: var(--line-soft);
  background: rgba(77, 163, 255, 0.07);
}

.chest-shop-bot-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chest-shop-bot-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 800;
}

.chest-shop-bot-state {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.chest-shop-bot-state.active {
  color: var(--accent);
}

.chest-shop-bot-state.offline {
  color: #ffb7b7;
}

.chest-shop-bot-money {
  align-self: center;
  color: var(--accent-amber);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

.controls[data-tab-panel="launch"] {
  grid-column: span 5;
}

.overview[data-tab-panel="launch"] {
  grid-column: span 7;
}

.client-launcher[data-tab-panel="client"] {
  grid-column: 1 / -1;
}

.desktop-view[data-tab-panel="desktop"] {
  grid-column: 1 / -1;
}

.command[data-tab-panel="control"] {
  grid-column: span 7;
}

.bot-chat[data-tab-panel="control"] {
  grid-column: span 5;
}

.screen[data-tab-panel="screen"],
.inventory[data-tab-panel="inventory"],
.logs[data-tab-panel="logs"] {
  grid-column: 1 / -1;
}

.profiles[data-tab-panel="assets"],
.schematics[data-tab-panel="assets"] {
  grid-column: span 6;
}

.section-head {
  min-height: 38px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.head-actions,
.command-head,
.log-tools,
.stats,
.actions,
.fleet-actions,
.profile-actions {
  gap: 8px;
}

.asset-actions {
  align-items: end;
}

.asset-actions label {
  min-width: 190px;
  margin: 0;
}

label {
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select,
textarea {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

input,
select {
  height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 170px;
  padding: 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.16);
}

button,
.file-button {
  min-height: 38px;
  border-radius: 8px;
  background: var(--panel-soft);
  border-color: var(--line);
  color: var(--text);
  font-weight: 700;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

button:hover,
.file-button:hover {
  border-color: var(--accent-blue);
  background: #252b34;
}

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

.primary {
  background: var(--accent);
  color: #07100b;
}

.danger {
  background: rgba(239, 100, 100, 0.13);
  border-color: rgba(239, 100, 100, 0.42);
  color: #ffb7b7;
}

.ghost {
  background: transparent;
}

.grid.two {
  gap: 12px;
}

.toggles {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.toggles label {
  min-height: 28px;
  padding: 2px 0;
  text-transform: none;
  font-size: 13px;
  font-weight: 600;
}

.proxy-config {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(77, 163, 255, 0.04);
  display: grid;
  gap: 12px;
}

.proxy-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.proxy-head h3 {
  margin: 0;
  font-size: 13px;
}

.proxy-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.proxy-fields {
  gap: 10px;
}

#proxyText {
  min-height: 96px;
}

.upload {
  padding: 10px 0 0;
}

#accountSummary {
  color: var(--muted);
  font-size: 12px;
}

.bot-card,
.profile-row,
.asset-row {
  border-radius: 8px;
  background: var(--field-2);
  border-color: var(--line);
}

.bot-card {
  padding: 14px;
}

.bot-title {
  align-items: center;
}

.bot-title > span:first-child {
  font-size: 15px;
}

.bot-meta {
  gap: 7px;
}

.bot-meta span,
.stats span,
.bot-status {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 3px 7px;
}

.stats span {
  font-size: 12px;
}

.command-stack {
  gap: 14px;
}

.command-row,
.baritone-box,
.bot-chat-send,
.auth-actions,
.inventory-actions,
.hand-actions {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.024);
}

.baritone-box {
  border-top: 1px solid var(--line-soft);
}

.command-catalog {
  display: grid;
  gap: 10px;
}

.command-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-2);
  overflow: hidden;
}

.command-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.command-group summary::-webkit-details-marker {
  display: none;
}

.command-group summary span {
  font-weight: 800;
}

.command-group summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.command-group summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--muted);
}

.command-group[open] summary::after {
  content: "-";
  color: var(--accent);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.catalog-grid button {
  min-width: 0;
  min-height: 58px;
  padding: 8px 9px;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 2px;
  text-align: left;
}

.catalog-grid button span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  color: var(--text);
}

.catalog-grid button small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

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

.viewer-status,
.inventory-meta {
  min-height: 30px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--field);
  color: var(--muted);
}

.client-fields {
  margin-bottom: 12px;
}

.desktop-frame-wrap {
  height: min(72vh, 780px);
  min-height: 460px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #06080b;
}

#desktopFrame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #06080b;
}

.client-actions {
  justify-content: flex-start;
}

.client-account-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
}

.client-log-stream {
  height: 260px;
  min-height: 220px;
  margin-top: 14px;
}

.client-process-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.client-process-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 170px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--field);
}

.client-process-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-process-row.pending {
  color: var(--muted);
}

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

.viewer-frame-wrap {
  height: min(62vh, 620px);
  min-height: 340px;
  border-radius: 8px;
  border-color: var(--line);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.bot-chat-stream,
.log-stream {
  border-radius: 8px;
  border-color: var(--line);
  background: #0b0d11;
}

.bot-chat-stream {
  height: 430px;
}

.log-stream {
  height: calc(100vh - 240px);
  min-height: 420px;
}

.bot-chat-line,
.log-line {
  padding: 5px 0;
}

.inventory-batch {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(77, 163, 255, 0.045);
}

.inventory-batch-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.inventory-batch-head h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0;
}

.inventory-batch-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.inventory-batch-fields {
  display: grid;
  grid-template-columns: 170px 110px;
  gap: 10px;
}

.inventory-batch-bots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.inventory-batch-bots.empty {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.inventory-batch-bots label {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--field);
  text-transform: none;
  font-size: 12px;
}

.inventory-batch-bots input {
  width: 15px;
  height: 15px;
}

.inventory-batch-bots span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.inventory-batch-bots small {
  color: var(--muted);
}

.inventory-batch-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 8px;
}

.mass-slot-clicker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.slot-pad {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-2);
}

.slot-pad-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.slot-pad-head h3 {
  margin: 0;
  font-size: 13px;
}

.slot-pad-head span {
  color: var(--muted);
  font-size: 11px;
}

.slot-pad-grid {
  display: grid;
  gap: 6px;
}

.menu-slot-pad {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

.inventory-slot-pad {
  grid-template-columns: repeat(9, minmax(0, 1fr));
  margin-bottom: 12px;
}

.hotbar-slot-pad {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

.slot-pad-grid button {
  position: relative;
  min-width: 0;
  height: 72px;
  padding: 6px;
  background: var(--field);
  display: grid;
  grid-template-rows: 32px 14px 12px;
  align-content: center;
  justify-items: center;
  gap: 3px;
  overflow: hidden;
}

.slot-pad-grid button span {
  font-weight: 900;
}

.slot-pad-grid button small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.menu-slot-pad button {
  color: var(--accent-blue);
}

.slot-pad-grid button.has-item {
  background:
    linear-gradient(180deg, rgba(73, 199, 127, 0.08), transparent),
    #121821;
  border-color: rgba(73, 199, 127, 0.28);
  color: var(--text);
}

.item-icon-box {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
}

.slot-pad-icon,
.slot-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.36));
}

.slot-pad-icon-box,
.slot-icon-box {
  justify-self: center;
}

.slot-pad-icon.icon-missing,
.slot-icon.icon-missing {
  opacity: 0;
}

.slot-pad-item-name,
.slot-pad-item-tech,
.slot-pad-empty {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-pad-item-name {
  font-size: 11px;
  color: var(--text);
}

.slot-pad-item-tech {
  color: var(--muted);
  font-size: 9px;
}

.slot-pad-empty {
  color: var(--muted-2);
  font-size: 11px;
}

.slot-pad-count {
  position: absolute;
  right: 6px;
  bottom: 4px;
  color: var(--accent-amber);
  font-size: 11px;
  font-weight: 900;
}

.inventory-preview {
  display: none;
}

.inventory-actions {
  grid-template-columns: repeat(3, minmax(130px, auto)) 150px 110px 120px 120px;
}

.hand-actions {
  grid-template-columns: repeat(5, minmax(120px, auto)) 100px;
}

.inventory-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.inventory-stat {
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--field-2);
  display: grid;
  align-content: center;
  gap: 4px;
}

.inventory-stat span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.inventory-stat strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.inventory-filter {
  margin-top: 12px;
  max-width: 360px;
}

.inventory-grid.inventory-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-height: none;
  overflow: visible;
  margin-top: 14px;
}

.inventory-grid.inventory-sections.window-inventory {
  grid-template-columns: 1fr;
}

.inventory-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-2);
  overflow: hidden;
}

.inventory-section-window-player {
  background: rgba(255, 255, 255, 0.018);
}

details.inventory-section > summary {
  cursor: pointer;
  list-style: none;
}

details.inventory-section > summary::-webkit-details-marker {
  display: none;
}

details.inventory-section > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--field);
  color: var(--muted);
  font-weight: 900;
}

details.inventory-section[open] > summary::after {
  content: "-";
  color: var(--accent);
}

.inventory-section-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.inventory-section-head h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0;
}

.inventory-section-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.inventory-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.slot-grid {
  --slot-columns: 9;
  display: grid;
  grid-template-columns: repeat(var(--slot-columns), minmax(54px, 1fr));
  gap: 7px;
  padding: 12px;
}

.crafting-board {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 34px minmax(78px, 110px);
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.crafting-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(68px, 1fr));
  gap: 8px;
}

.crafting-output {
  display: grid;
}

.crafting-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--field);
  color: var(--muted);
  font-weight: 900;
}

.slot-card {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.slot-card.held-slot {
  padding: 4px;
  border: 1px solid rgba(244, 184, 92, 0.55);
  border-radius: 8px;
  background: rgba(244, 184, 92, 0.08);
}

.slot-card.menu-slot {
  gap: 0;
}

.slot-card .slot-button {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 86px;
  padding: 7px;
  border-radius: 8px;
  background: #11151b;
  border-color: #333a45;
  display: grid;
  grid-template-rows: 12px 32px 16px 12px;
  align-content: start;
  justify-items: start;
  gap: 3px;
  overflow: hidden;
}

.slot-card:not(.empty-slot) .slot-button {
  background:
    linear-gradient(180deg, rgba(73, 199, 127, 0.08), transparent),
    #131820;
  border-color: rgba(73, 199, 127, 0.28);
}

.slot-card.menu-slot:not(.empty-slot) .slot-button {
  min-height: 86px;
  background:
    linear-gradient(180deg, rgba(77, 163, 255, 0.08), transparent),
    #121821;
  border-color: rgba(77, 163, 255, 0.26);
}

.slot-card.empty-slot .slot-button {
  color: var(--muted-2);
  background: #0f1319;
  border-color: #252b34;
}

.held-slot .slot-button {
  border-color: rgba(244, 184, 92, 0.72);
}

.slot-hold {
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
  background: var(--field);
  color: var(--muted);
}

.slot-hold:not(:disabled):hover {
  color: var(--text);
  border-color: var(--accent-amber);
}

.slot-hold:disabled {
  cursor: default;
  color: var(--accent-amber);
  border-color: rgba(244, 184, 92, 0.46);
}

.slot-role {
  max-width: calc(100% - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-blue);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.slot-index {
  font-size: 10px;
  color: var(--muted-2);
}

.slot-name {
  min-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.slot-icon {
  justify-self: center;
  margin: 1px 0 2px;
}

.slot-technical {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10px;
}

.slot-count {
  position: absolute;
  right: 7px;
  bottom: 5px;
  color: var(--accent-amber);
  font-size: 12px;
  font-weight: 900;
}

.profile-list,
.asset-list {
  gap: 10px;
}

.chest-shop-presets h3 {
  margin: 0;
  font-size: 15px;
}

.inventory-batch-actions,
.inventory-actions,
.hand-actions {
  display: none;
}

.slot-pad-button {
  cursor: context-menu;
}

.slot-context-menu {
  position: fixed;
  z-index: 1000;
  min-width: 230px;
  max-width: min(320px, calc(100vw - 16px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #181b22;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.slot-context-menu[hidden] {
  display: none;
}

.slot-context-title {
  padding: 8px 10px 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: baseline;
}

.slot-context-title > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-context-title small {
  color: var(--muted);
  font-weight: 800;
}

.slot-context-title em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.slot-context-targets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 4px 4px 7px;
}

.slot-context-menu button {
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
}

.slot-context-menu .slot-context-target {
  min-height: 42px;
  padding: 7px 8px;
  grid-template-columns: 1fr;
  gap: 2px;
  text-align: center;
  background: var(--field);
  border: 1px solid var(--line-soft);
}

.slot-context-menu .slot-context-target.active {
  background: rgba(47, 151, 255, 0.18);
  border-color: rgba(77, 163, 255, 0.54);
  color: #ffffff;
}

.slot-context-menu button:hover {
  background: rgba(47, 151, 255, 0.16);
  color: #ffffff;
}

.slot-context-menu button span {
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
}

.slot-context-menu button small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.slot-context-separator {
  height: 1px;
  margin: 6px -6px;
  background: var(--line);
}

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

  .controls[data-tab-panel],
  .overview[data-tab-panel],
  .command[data-tab-panel],
  .bot-chat[data-tab-panel],
  .screen[data-tab-panel],
  .inventory[data-tab-panel],
  .logs[data-tab-panel],
  .client-launcher[data-tab-panel],
  .desktop-view[data-tab-panel],
  .profiles[data-tab-panel],
  .schematics[data-tab-panel] {
    grid-column: 1 / -1;
  }

  .catalog-grid,
  .inventory-summary,
  .inventory-grid.inventory-sections,
  .mass-slot-clicker,
  .inventory-batch-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 940px) {
  .chest-shop-layout {
    grid-template-columns: 1fr;
  }

  .chest-shop-fleet {
    position: static;
    padding: 20px 0 0;
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .chest-shop-fleet-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }
}

@media (max-width: 760px) {
  .topbar,
  .app-tabs,
  .layout {
    padding-left: 14px;
    padding-right: 14px;
  }

  .app-tabs {
    top: auto;
    position: static;
  }

  .controls,
  .command,
  .screen,
  .bot-chat,
  .inventory,
  .logs,
  .overview,
  .client-launcher,
  .desktop-view,
  .chest-shop,
  .profiles,
  .schematics {
    padding: 14px;
  }

  .catalog-grid,
  .inventory-summary,
  .inventory-grid.inventory-sections,
  .mass-slot-clicker,
  .inventory-batch-head,
  .inventory-batch-fields,
  .inventory-batch-actions,
  .inventory-actions,
  .hand-actions,
  .client-account-head,
  .client-process-row {
    grid-template-columns: 1fr;
  }

  .chest-shop-preset-editor {
    grid-template-columns: 1fr;
  }

  .chest-shop-head,
  .chest-shop-group-head {
    align-items: stretch;
    display: grid;
  }

  .chest-shop-bot-picker {
    width: 100%;
  }

  .chest-shop-group-head .muted-line {
    text-align: left;
  }

  .chest-shop-cycle-fields,
  .chest-shop-timing-fields,
  .chest-shop-target-options,
  .chest-shop-selected-actions,
  .chest-shop-fleet-list {
    grid-template-columns: 1fr;
  }

  .client-account-head {
    align-items: stretch;
    display: grid;
  }

  .inventory-batch-head {
    align-items: stretch;
    display: grid;
  }

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

  .crafting-board {
    grid-template-columns: 1fr;
  }

  .crafting-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .viewer-frame-wrap {
    height: 280px;
    min-height: 260px;
  }
}
