.mm-register, .mm-card, .mm-empty {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.mm-register, .mm-card { padding: clamp(14px, 2.2vw, 24px); }
.mm-register h2, .mm-roster h2, .mm-picker h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.4;
}
.mm-form, .mm-actions, .mm-card-actions, .mm-card-head, .mm-picker footer {
  display: flex;
  gap: 8px;
  align-items: center;
}
.mm-form { margin-top: 14px; max-width: 540px; align-items: flex-end; }
.mm-name-label { flex: 1 1 0; min-width: 0; display: grid; gap: 5px; }
.mm-name-label > span, .mm-selected, .mm-count, .mm-group h4 {
  color: var(--dim);
  font-size: .84rem;
}
.mm-name-label input, .mm-search-label input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #526152;
  border-radius: 6px;
  padding: .5rem .7rem;
  background: var(--inset);
  color: var(--paper);
  font: inherit;
}
.mm-button, .mm-link, .mm-factions button {
  min-height: 44px;
  border-radius: 6px;
  padding: .45rem .8rem;
  border: 1px solid #4a584a;
  background: #253029;
  color: var(--paper);
  font: inherit;
  font-size: .89rem;
  font-weight: 600;
}
.mm-button:hover, .mm-factions button:hover { background: #344535; border-color: #68795e; }
.mm-primary, .mm-primary:hover { background: var(--accent); border-color: var(--accent); color: #25311e; }
.mm-primary:hover { background: #e6f4b4; }
.mm-roster { margin-top: clamp(22px, 3vw, 36px); }
.mm-list { margin-top: 12px; display: grid; gap: 14px; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.mm-empty { grid-column: 1 / -1; padding: 1.4rem; margin: 0; color: var(--dim); }
.mm-card { min-width: 0; display: grid; gap: 14px; }
.mm-card-head, .mm-card-actions, .mm-picker footer { justify-content: space-between; }
.mm-card-head h3 { margin: 0; color: var(--paper); font-size: 1.1rem; overflow-wrap: anywhere; }
.mm-count { flex: none; }
.mm-group h4 { margin: 0 0 5px; font-weight: 600; }
.mm-pool {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
}
.mm-pool li, .mm-choice {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid #3c4c3e;
  border-radius: 6px;
  background: linear-gradient(155deg,#303d30,#1d2822);
}
.mm-pool img, .mm-choice img {
  display: block;
  width: 100%;
  object-fit: contain;
  object-position: center bottom;
}
.mm-pool img { height: 48px; }
.mm-pool li > span, .mm-choice > span {
  overflow-wrap: anywhere;
  font-size: .73rem;
  line-height: 1.25;
  padding: 2px 3px 4px;
  color: var(--paper);
}
.mm-card-actions { flex-wrap: wrap; gap: 4px; }
.mm-card-actions .mm-actions { gap: 2px; }
.mm-pick-button { color: var(--accent); border-color: #617151; }
.mm-link { background: transparent; border-color: transparent; padding-inline: 7px; color: var(--dim); font-size: .81rem; }
.mm-link:hover { color: var(--paper); text-decoration: underline; }
.mm-editor { padding-top: 12px; border-top: 1px solid var(--border); }
.mm-editor p { margin: 0 0 9px; overflow-wrap: anywhere; }
.mm-rename-form { display: grid; gap: 9px; }
.mm-editor .mm-actions { justify-content: flex-end; }
.mm-danger { background: #532e28; color: #f8d4c9; border-color: #915b4d; }
.mm-danger:hover { background: #68392f; border-color: #a56454; }
.mm-picker {
  width: min(660px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
  background: var(--panel);
}
.mm-picker[open] { display: flex; flex-direction: column; }
.mm-picker header, .mm-picker footer { flex: none; padding: 14px 18px; }
.mm-picker header { display: grid; gap: 10px; border-bottom: 1px solid var(--border); }
.mm-picker h2 { overflow-wrap: anywhere; max-height: 3em; overflow: auto; }
.mm-factions { display: inline-flex; gap: 3px; justify-self: start; border-radius: 7px; background: var(--inset); padding: 3px; }
.mm-factions button { min-height: 38px; border-color: transparent; background: transparent; color: var(--dim); }
.mm-factions button[aria-pressed="true"] { border-color: #78865e; color: var(--accent); background: #303d2c; }
.mm-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 7px;
  padding: 12px 18px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.mm-choice { position: relative; padding: 0; justify-content: flex-start; }
.mm-choice:hover { border-color: #8c986e; }
.mm-choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mm-choice[aria-pressed="true"]::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 0 4px;
  border-radius: 4px;
  color: #1c2819;
  background: var(--accent);
  font: bold .76rem/1.3 system-ui, sans-serif;
}
.mm-choice img { height: 62px; }
.mm-choice:focus-visible { outline-offset: 1px; }
.mm-selected { color: var(--accent); }
.mm-picker footer { flex-wrap: wrap; border-top: 1px solid var(--border); }
.mm-no-hits { grid-column: 1 / -1; margin: 1rem 0; color: var(--dim); }
.mm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 480px) {
  .mm-choices { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 5px; padding: 10px; }
  .mm-choice img { height: 51px; }
  .mm-picker header, .mm-picker footer { padding: 10px; }
  .mm-picker .mm-actions { gap: 5px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .mm-picker { max-height: calc(100dvh - 12px); }
  .mm-picker header { grid-template-columns: auto minmax(110px, 1fr); gap: 4px 14px; padding: 6px 14px; align-items: center; }
  .mm-picker h2 { grid-column: 1 / -1; font-size: 1rem; max-height: 1.5em; }
  .mm-picker footer { padding: 5px 14px; }
  .mm-factions button { min-height: 36px; }
}
