/* Configuration-only skin; the game and both original backgrounds stay untouched. */
.workbench-panel { color: #e7edf5; color-scheme: dark; }
.workbench-panel .workbench-section-body { padding-top: 20px; }
.workbench-panel .workbench-section > summary { min-height: 64px; }
.workbench-panel .workbench-section > summary span { flex-shrink: 0; }
.workbench-panel .workbench-section > summary small { font-size: 12px; line-height: 1.7; }
.workbench-panel .workbench-note,.workbench-panel .config-intro,.workbench-panel .symbol-intro { font-size: 13px; color: #b6c5d7; line-height: 1.85; }
.workbench-panel button,.workbench-panel #layout-actions button,.workbench-panel .config-preview button,.workbench-panel #layout-controls button {
  box-sizing: border-box; min-height: 44px; max-width: 100%; padding: 10px 13px; border: 1px solid #536780; border-radius: 8px;
  background: #24354d; color: #edf3fa; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.5;
  text-align: center; white-space: normal; overflow-wrap: anywhere; letter-spacing: .02em; cursor: pointer;
}
.workbench-panel button:hover:not(:disabled) { background: #334d6b; border-color: #97b3ce; }
.workbench-panel button:disabled { opacity: .5; cursor: not-allowed; }
.workbench-panel button.primary,.workbench-panel .config-preview button.primary,.workbench-panel button[aria-pressed="true"],.workbench-panel .config-tabs button.active { background: #91d6ce; color: #102c32; border-color: #91d6ce; }
.workbench-panel :is(button,input,select,summary):focus-visible { outline: 2px solid #f2d886; outline-offset: 3px; }
.workbench-panel :is(select,input[type="number"],input[type="text"]) { min-width: 0; min-height: 44px; border: 1px solid #647890; border-radius: 7px; padding: 8px 10px; background: #0d1726; color: #eef4fc; font: inherit; font-size: 14px; }
.workbench-panel input[type="number"] { font-variant-numeric: tabular-nums; text-align: right; }
.workbench-panel input[type="range"] { min-width: 0; width: 100%; min-height: 32px; accent-color: #91d6ce; }
.workspace.workbench .workbench-panel button { min-height: 44px; font-size: 13px; white-space: normal; }
.workspace.workbench .workbench-panel :is(select,input[type="number"]) { min-height: 44px; }
.workbench-panel .config-field-title label,.workbench-panel .symbol-field-title label { color: #e7edf5; font-size: 14px; line-height: 1.6; }
.workbench-panel .config-field p,.workbench-panel .symbol-field p,.workbench-panel .layout-note,.workbench-panel .symbol-footer p,.workbench-panel .config-preview p { color: #b6c5d7; font-size: 12px; line-height: 1.8; }
.workbench-panel .config-field,.workbench-panel .symbol-field { padding-block: 12px 16px; }
.workbench-panel .config-inputs,.workbench-panel .symbol-inputs { align-items: center; gap: 12px; }
.workbench-panel .config-files,.workbench-panel .symbol-files { max-width: none; gap: 10px; }
.workbench-panel .game-info-launchers,.workbench-panel .scenarios { display: grid; grid-template-columns: repeat(auto-fit,minmax(125px,1fr)); gap: 10px; }
.workbench-panel .game-info-launchers button,.workbench-panel .scenarios button { width: 100%; padding-inline: 10px; }
.workbench-panel .config-presets { align-items: stretch; gap: 10px; }
.workbench-panel .config-tabs button[aria-selected="true"] { background: #91d6ce; color: #102c32; }
.workbench-panel .config-field-title span,.workbench-panel .config-group summary small,.workbench-panel .symbol-group summary small,.workbench-panel .symbol-field-heading label small { color: #b6c5d7; font-size: 12px; }
.workbench-panel .symbol-field-heading label { font-size: 14px; }
.workbench-panel .symbol-inputs > div > span { top: 50%; transform: translateY(-50%); }
.workbench-panel #config-message,.workbench-panel #symbol-message,.workbench-panel #layout-message { font-size: 12px; line-height: 1.8; }
.workbench-panel .config-preview,.workbench-panel .symbol-footer { background: #1b2b40; border-color: #44546a; }
.editor-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); gap: 12px 20px; margin-block: 16px; }
.editor-field { min-width: 0; padding: 12px 14px; border: 1px solid #394e68; border-radius: 9px; background: #17263b; }
.editor-field > label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; color: #e7edf5; font-size: 14px; font-weight: 600; }
.editor-field label small { margin-left: auto; color: #b6c5d7; font-size: 11px; font-weight: 400; }
.editor-inputs { display: grid; grid-template-columns: minmax(40px,1fr) 84px; gap: 12px; align-items: center; }
.editor-inputs input[type="number"] { width: 100%; }
.editor-field p { margin: 8px 0 0; font-size: 12px; color: #b6c5d7; line-height: 1.7; }
.editor-select { display: flex; flex-direction: column; gap: 8px; color: #e7edf5; font-size: 14px; }
.editor-select select,.editor-select input { width: 100%; }
.editor-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(135px,1fr)); gap: 10px; margin-block: 16px; }
.editor-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.editor-message { min-height: 22px; margin: 10px 0; color: #a3ded7; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.editor-message.error,.workbench-panel [aria-invalid="true"] { color: #ffd2c7; border-color: #ffa28b; }
.editor-nested { border-block: 1px solid #44546a; margin-block: 20px; padding-block: 14px; }
.editor-nested > summary { color: #ead599; font-size: 14px; min-height: 36px; cursor: pointer; }
.editor-stat-section { border-top: 1px solid #44546a; padding-top: 18px; margin-top: 22px; }
.editor-stat-section h3 { margin: 0 0 12px; font-size: 16px; color: #f2d886; }
.editor-stat-section h3 small { font-size: 12px; color: #b6c5d7; margin-left: 8px; }
.editor-stat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 10px; }
.editor-stat-grid > div { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-width: 0; padding: 14px; background: #1b2b40; border: 1px solid #44546a; border-radius: 9px; }
.editor-stat-grid span { color: #b6c5d7; font-size: 12px; line-height: 1.6; }
.editor-stat-grid strong { font-size: 20px; font-variant-numeric: tabular-nums; color: #f2e1af; overflow-wrap: anywhere; }
#math-progress { width: 100%; height: 8px; accent-color: #91d6ce; }
@media(max-width:850px){
  .workbench-panel :is(select,input[type="number"]) { font-size: 16px; }
  .workbench-panel .workbench-section > summary { flex-wrap: wrap; gap: 4px 10px; }
  .workbench-panel .workbench-section > summary small { flex-basis: 58%; font-size: 11px; }
  .workbench-panel .workbench-subsection > summary { flex-wrap: wrap; }
  .editor-field { padding-inline: 12px; }
  .editor-stat-grid { grid-template-columns: 1fr 1fr; }
}

/* Content-sized actions: consistent space between buttons, wrap whole actions first. */
.workspace.workbench .workbench-panel :is(.game-info-launchers,.scenarios,.config-files,.symbol-files,.editor-actions,.editor-tabs,.config-tabs,.config-presets),
.workspace.workbench .workbench-panel .config-preview > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}
.workspace.workbench .workbench-panel button,
.workspace.workbench .workbench-panel :is(#layout-actions,#layout-controls) button {
  flex: 0 1 auto;
  width: fit-content;
  min-width: 44px;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 16px;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.5;
}
.workspace.workbench .workbench-panel #preview-skip { flex: 0 1 auto; }
.workspace.workbench .workbench-panel #layout-reset { margin-block: 12px; }
.workspace.workbench .workbench-panel #random-mode { margin-top: 12px; }
.workbench-panel .symbol-field-heading { gap: 12px; flex-wrap: wrap; }
.workbench-panel .symbol-field-heading label { min-width: 80px; }
.game-tools :is(.gt-tabs,.gt-footer,.gt-pagination,.gt-toolbar,.gt-range) { gap: 12px; }
.game-tools .gt-tabs button { flex: 0 0 auto; width: max-content; }
.game-tools button { min-height: 44px; padding-inline: 16px; }
.game-tools #gt-close { width: 44px; min-width: 44px; padding: 0; }
.game-tools .gt-record-link { min-height: 44px!important; padding-block: 8px!important; }
.game-tools .gt-tabs-mobile-hint { display: none; }
@media(max-width:850px){
  .game-tools .gt-tabs-mobile-hint { display: block; margin: 0; padding: 7px 14px 0; background: #091b2c; color: #9fbfd1; font-size: 11px; }
}
