/* Hold-Tab Auto-Build controls. Kept separate from the legacy shared stylesheet
   so this feature does not grow its frozen size exception. */

.tab-menu-button {
  position: absolute;
  z-index: 20;
  left: 12px;
  top: 68px;
  appearance: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius-sm);
  background: rgba(39, 37, 31, 0.94);
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  line-height: 1;
  pointer-events: auto;
}

.tab-menu-button:hover {
  border-color: var(--accent);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4), inset 0 0 0 1px var(--panel-glow);
}

.tab-menu-button.active {
  border-color: var(--accent);
  box-shadow:
    4px 4px 0 rgba(0, 0, 0, 0.4),
    inset 0 0 0 2px var(--accent),
    0 0 12px var(--panel-glow);
}

.hamburger-icon {
  width: 18px;
  display: grid;
  gap: 3px;
}

.hamburger-icon i {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.tab-menu {
  position: absolute;
  z-index: 19;
  left: 60px;
  top: 68px;
  width: min(430px, calc(100vw - 72px));
  max-height: calc(100vh - 80px);
  padding: 9px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius);
  pointer-events: auto;
}

.tab-menu-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--panel-edge);
}

.tab-menu-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.1;
  text-transform: uppercase;
}

.tab-menu-held-hint {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  white-space: nowrap;
}

.tab-menu-held-hint kbd {
  display: inline-grid;
  min-width: 30px;
  min-height: 16px;
  place-items: center;
  margin-left: 3px;
  padding: 1px 4px;
  border: 1px solid var(--panel-edge);
  border-bottom-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.tab-menu-intro {
  margin: 5px 0 6px;
  color: var(--ink-dim);
  font-size: 11px;
  line-height: 1.35;
}

.tab-menu-pause-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 5px;
  border: 1px solid rgba(91, 83, 65, 0.65);
  background: rgba(17, 17, 15, 0.42);
}

.tab-menu .cmd-btn {
  min-width: 0;
  min-height: 0;
}

.tab-menu-pause {
  width: 52px;
  height: 44px;
}

.tab-menu-pause .cmd-label {
  display: none;
}

.tab-menu-pause.is-paused {
  border-color: var(--warn);
  box-shadow: inset 0 0 0 1px rgba(199, 162, 74, 0.5);
}

.tab-menu-pause-copy {
  display: grid;
  gap: 2px;
}

.tab-menu-pause-copy strong {
  color: var(--ink);
  font-size: 14px;
  text-transform: uppercase;
}

.tab-menu-pause-copy span {
  color: var(--ink-dim);
  font-size: 11px;
  line-height: 1.35;
}

.tab-menu-reservations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 7px;
}

.tab-menu-reservation {
  display: grid;
  gap: 4px;
}

.tab-menu-reservation h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--ink-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tab-menu-reservation h3 .res-icon {
  width: 16px;
  height: 16px;
}

.tab-menu .res-icon {
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
}

.tab-menu .res-icon.steel {
  color: var(--steel);
  text-shadow: 1px 1px 0 #191710;
}

.tab-menu .res-icon.oil {
  color: var(--oil);
  text-shadow: 1px 1px 0 #5f6848;
}

.tab-menu-stepper {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  grid-auto-rows: 38px;
  gap: 4px;
}

.tab-menu-step {
  width: 38px;
  height: 38px;
}

.tab-menu-step .cmd-icon {
  font-size: 18px;
}

.tab-menu-reserve-value {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-family: var(--mono);
}

.tab-menu-reserve-value strong {
  overflow: hidden;
  font-size: 15px;
  line-height: 1;
  text-overflow: ellipsis;
}

.tab-menu-production {
  display: grid;
  gap: 6px;
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid var(--panel-edge);
}

.tab-menu-production-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.tab-menu-production-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 11px;
  text-transform: uppercase;
}

.tab-menu-production-header span {
  color: var(--ink-faint);
  font: 8px var(--mono);
}

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

.tab-menu-unit {
  width: 100%;
  height: 60px;
}

.tab-menu-unit .cmd-label {
  font-size: 8px;
}

.tab-menu-unit .cmd-icon {
  font-size: 18px;
}

.tab-menu-reserve-value .res-icon {
  width: 20px;
  height: 20px;
}

@media (pointer: coarse) and (max-width: 1024px) and (max-height: 1024px) {
  .tab-menu-button {
    left: var(--mobile-debug-left);
    top: var(--mobile-debug-top);
    width: 40px;
    height: 40px;
  }

  .tab-menu {
    left: calc(var(--mobile-debug-left) + 48px);
    top: var(--mobile-debug-top);
    width: min(430px, calc(100vw - var(--mobile-debug-left) - var(--mobile-debug-right) - 48px));
    max-height: calc(100vh - var(--mobile-debug-top) - var(--mobile-debug-bottom));
  }
}
