.stemSheetEditor, .stemCharacterSheet, .stemSheetView, .stemResourceForm {
  min-width: 0;
  max-width: 100%;
}

.stemSheetSection > summary {
  padding-block: 8px;
  min-height: 44px;
}

.stemSheetGrid > .stemSheetWide,
.stemSheetGrid > .stemResourceForm,
.stemSheetGrid > .stemSheetStats,
.stemSheetGrid > .stemSheetNote {
  grid-column: 1 / -1;
  min-width: 0;
}

.stemSheetEditor [hidden] { display: none !important; }
.stemSheetEditor select, .stemSheetView select { width: 100%; max-width: 100%; }
.stemSheetEditor input, .stemSheetView input { min-width: 0; }
.stemSheetEditor .stemAbilityCard strong, .stemSheetView .stemAbilityCard strong { overflow-wrap: anywhere; }

.stemPregenPicker {
  border: 1px solid var(--zero-border, #685675);
  border-radius: 14px;
  padding: 14px;
  margin-block: 12px 20px;
  background: var(--zero-surface, #25202d);
}

.stemPregenPicker h3, .stemPregenPreview h4, .stemSheetNote h4 { margin: 0 0 6px; }
.stemPregenPicker label { margin-block: 12px; }
.stemPregenPreview p, .stemSheetNote p { margin: 6px 0 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.stemPregenScores { font-weight: 650; }
.stemSheetStatus { color: var(--zero-muted, #cdbdd8); }
.stemSheetStatus:empty, .stemPregenPreview:empty { display: none; }
.stemSheetEditor button, .stemSheetView button { min-height: 44px; }
.stemSheetView .stemPortraitPreview { display: block; max-width: min(100%, 250px); max-height: 180px; object-fit: contain; }
.stemSheetIdentity { font-size: 1rem; font-weight: 650; }

.stemSheetStats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 105px), 1fr));
  gap: 8px;
  margin-block: 10px;
}

.stemSheetStats > div {
  padding: 9px 10px;
  min-width: 0;
  border: 1px solid var(--zero-border, #685675);
  border-radius: 10px;
  background: var(--zero-surface, #25202d);
  overflow-wrap: anywhere;
}

.stemSheetStats dt { color: var(--zero-muted, #cdbdd8); font-size: .78rem; }
.stemSheetStats dd { margin: 3px 0 0; font-weight: 700; }
.stemSheetView .stemAbilityCard button { display: block; width: 100%; margin-top: 6px; padding-inline: 6px; }
.stemSheetRollTools { display: grid; align-items: end; gap: 8px; grid-template-columns: minmax(110px, 1fr) minmax(0, 2fr); }
.stemSheetRollTools label { min-width: 0; }

.stemSheetEditor label.stemSheetCheck, .stemSheetView label.stemSheetCheck {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  margin: 0;
  overflow-wrap: anywhere;
}

.stemSheetEditor .stemSheetCheck input, .stemSheetView .stemSheetCheck input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
}

.stemSkillChoice, .stemSkillResult {
  display: grid;
  align-items: center;
  gap: 4px 10px;
  min-height: 46px;
  padding: 6px 0;
  border-bottom: 1px solid var(--zero-border, #42394e);
}

.stemSkillChoice { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.stemSkillResult { grid-template-columns: minmax(0, 1fr) minmax(34px, auto) auto; }
.stemSkillResult small { display: block; }
.stemSkillChoice strong, .stemSkillResult strong { overflow-wrap: anywhere; }
.stemSkillResult output { text-align: right; font-weight: 750; }
.stemResourceForm .actions { flex-wrap: wrap; }
.stemSheetConditions summary { overflow-wrap: anywhere; }
.stemSheetConditions .stemSheetCheck { padding-inline-end: 12px; }

@media (max-width: 460px) {
  .stemSheetEditor .stemSheetSection, .stemSheetView .stemSheetSection { padding-inline: 10px; }
  .stemSkillChoice { grid-template-columns: minmax(0, 1fr) auto; }
  .stemSkillChoice > .stemSheetCheck { grid-row: 2; }
  .stemSheetRollTools { grid-template-columns: minmax(0, 1fr); }
  .stemSheetRollTools .stemSheetStatus { margin: 0; }
}
