/* Bench identity stays above the workspace; use available height before scrolling. */
:is(#game, body) #station-dialog.gothic-panel.bench-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  max-height: calc(100dvh - 36px);
}
:is(#game, body) dialog.bench-panel::before {
  display: none;
}
#station-dialog.bench-panel .bench-header {
  margin: 0 8px -8px 30px;
  min-height: 64px;
  z-index: 2;
}
:is(#game, body) dialog.bench-panel .bench-header h2 {
  margin: 0;
  font-size: 20px;
}
:is(#game, body) dialog.bench-panel .bench-header .bench-level {
  margin: 3px 0;
  font-size: 12px;
}
.bench-panel .bench-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 128px);
  padding: 20px 12px 12px;
  border: 1px solid #a5b2bc;
  border-radius: 14px 14px 14px 4px;
  background: linear-gradient(145deg, #202d36, #0a1118 65%);
  box-shadow:
    0 0 0 4px #080b10,
    0 0 0 5px #53616f,
    inset 0 0 0 6px #111b23;
  box-sizing: border-box;
}
.bench-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 400px;
  gap: 4px;
  flex-shrink: 0;
  margin-bottom: 8px;
}
:is(#game, body) #station-dialog.gothic-panel.bench-panel .bench-tabs button {
  border: 1px solid #647c8d;
  border-radius: 7px;
  background: #111c24;
  color: #bcc9d1;
  padding: 6px 5px;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: normal;
}
:is(#game, body)
  #station-dialog.gothic-panel.bench-panel
  .bench-tabs
  button[aria-selected="true"] {
  background: #294454;
  color: #fff0c9;
  border-color: #c3b080;
}
.bench-tab-panel {
  overflow-y: auto;
  min-height: 0;
  padding: 0 3px;
}
.bench-tab-panel[hidden] {
  display: none;
}
.bench-panel .bench-work-area {
  border: 0;
  padding: 0;
}
:is(#game, body) dialog.bench-panel #repair-title {
  font-size: 18px;
  margin: 0 0 4px;
}
:is(#game, body) dialog.bench-panel #repair-instruction {
  font-size: 12px;
  margin: 3px 0 6px;
  line-height: 1.3;
}
.bench-panel .repair-surface #repair-board {
  height: 82px;
  margin: 6px 0;
  border-width: 3px;
}
.bench-panel .repair-surface .repair-object {
  height: 66px;
  width: 90%;
  border-width: 2px;
}
.bench-panel .repair-surface .slot {
  top: 7px;
  height: 48px;
  width: 54px;
}
.bench-panel .repair-surface .slot:nth-child(2) {
  left: calc(50% - 27px);
}
.bench-panel .repair-surface .part {
  height: 62px;
  width: 80px;
  border-radius: 10px;
}
.bench-panel .repair-surface .component-icon {
  height: 32px;
  width: 48px;
}
.bench-panel .repair-surface .part small {
  font-size: 10px;
}
.bench-panel .repair-surface .repair-tip {
  display: none;
}
:is(#game, body) dialog.bench-panel #repair-progress {
  margin: 2px 0;
  padding: 0;
  font-size: 11px;
}
.bench-panel .repair-surface #finish-repair {
  width: 100%;
  margin: 5px 0;
  padding: 6px;
}
.bench-panel .bench-supplies .gothic-materials {
  display: flex;
  gap: 6px;
  margin: 5px 0 0;
}
.bench-panel .bench-supplies .gothic-materials > div {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  min-width: 0;
}
.bench-panel .bench-supplies .material-icon {
  width: 30px;
  height: 30px !important;
  flex: 0 0 30px;
}
.bench-panel .bench-supplies .gothic-materials span:not(.material-icon) {
  display: none;
}
.bench-panel .bench-supplies .gothic-materials strong {
  font-size: 12px;
}
@media (max-height: 500px) {
  .bench-panel .bench-content {
    max-height: calc(100dvh - 120px);
  }
}

/* One frame for the repair area; the inner object only positions its slots. */
.bench-panel .repair-surface #repair-board {
  border: 1px solid #687d8d;
  border-radius: 12px;
  box-shadow: inset 0 2px 16px #0005;
}
.bench-panel .repair-surface .repair-object {
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.bench-panel .repair-surface .repair-object::before,
.bench-panel .repair-surface .repair-object::after {
  display: none;
}
