/* The host theme supplies the palette, typography, surfaces and radii. */
.mm-tool [hidden], .mm-tool .mm-alert:empty, .mm-tool [data-mm-share-warning]:empty,
.mm-tool dialog:not([open]) { display: none; }
.mm-tool, .mm-tool :is(.mm-card,.mm-node,.mm-drawer,.mm-summary,.mm-branch,.mm-branches,.mm-results,.mm-grid) {
  min-width: 0; overflow-wrap: anywhere;
}
.mm-tool input, .mm-tool select { max-width: 100%; }
.mm-tool :is(.mm-toolbar,.mm-planner-bar) label, .mm-tool .mm-hero-switch {
  display: grid; gap: .3rem; min-width: 0; color: var(--muted); font-size: .875rem;
}
.mm-tool .mm-planner-actions, .mm-tool .mm-route-links, .mm-tool .mm-hero-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
}
.mm-tool .mm-planner-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.mm-tool .mm-branch-nodes { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,7rem),1fr)); gap: .4rem; }
.mm-tool .mm-branch-head { margin-bottom: .25rem; }
.mm-tool :is(.mm-branch-head small,.mm-cogs-reference,.mm-node-key,.mm-path-intro,.mm-card-summary,.mm-steps small,.mm-stat-entry small,.mm-inspector > p) { color: var(--muted); }
.mm-tool .mm-path-intro { font-size: .875rem; margin: 0 0 .7rem; }
.mm-tool .mm-node { min-height: 5.25rem; padding: .55rem; }
.mm-tool .mm-node-val { color: var(--text); }
.mm-tool .mm-inspector { margin-top: .8rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.mm-tool .mm-inspector > p, .mm-tool .mm-steps { font-size: .84rem; }
.mm-tool .mm-step-scroll { overflow-x: auto; }
.mm-tool .mm-steps { border-collapse: collapse; width: 100%; min-width: 34rem; }
.mm-tool .mm-steps :is(th,td) { border-bottom: 1px solid var(--border-subtle); padding: .48rem; text-align: left; vertical-align: top; }
.mm-tool .mm-steps th { color: var(--gold); }
.mm-tool .mm-steps [aria-current="step"] { background: var(--gold-soft); }
.mm-tool .mm-steps small, .mm-tool .mm-summary small, .mm-tool .mm-hero-picker small { display: block; }
.mm-tool .mm-summary summary, .mm-tool .mm-fold > summary { cursor: pointer; }
.mm-tool .mm-encyclopedia, .mm-tool .mm-hero-section, .mm-tool .mm-result-group { margin-block: 1.5rem; }
.mm-tool .mm-stat-entry { border-top: 1px solid var(--border-subtle); padding-block: .7rem; }
.mm-tool .mm-stat-entry :is(p,ol), .mm-tool .mm-skill-entry p { margin: .35rem 0; }
.mm-tool .mm-fold { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: .65rem .8rem; margin-block: .35rem; }
.mm-tool .mm-fold > summary { font-weight: 650; }
.mm-tool .mm-fold[open] > summary { margin-bottom: .65rem; }
.mm-tool .mm-result-group > h3, .mm-tool .mm-result-group > h4 { border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.mm-tool :is(.mm-result-group,.mm-fold) small { color: var(--muted); font-size: .8rem; }
.mm-tool .mm-grid, .mm-tool .mm-ability-grid, .mm-tool .mm-skill-list, .mm-tool .mm-hero-items {
  display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%,15rem),1fr)); align-items: stretch;
}
.mm-tool .mm-card { width: 100%; }
.mm-tool .mm-record-head { display: flex; align-items: center; gap: .75rem; text-align: left; }
.mm-tool .mm-record-head :is(h3,h4) { margin: 0; }
.mm-tool .mm-art { display: inline-grid; place-items: center; width: 2.8rem; height: 2.8rem; flex: 0 0 2.8rem; position: relative; color: var(--mm-line,var(--gold)); }
.mm-tool .mm-crest { width: 100%; height: 100%; }
.mm-tool .mm-icon-image, .mm-tool .mm-hero-stamp { position: absolute; border: 1px solid var(--mm-line,var(--border-strong)); border-radius: var(--radius-sm); background: var(--surface); object-fit: cover; }
.mm-tool .mm-icon-image { inset: 0; width: 100%; height: 100%; }
.mm-tool .mm-hero-stamp { bottom: -.18rem; right: -.18rem; width: 1.45rem; height: 1.45rem; border-radius: 50%; }
.mm-tool :is([data-pool-tier],[data-rarity]) { --mm-line: var(--card-accent,var(--border-strong)); }
.mm-tool [data-pool-tier="hero_exclusive"] { box-shadow: inset 0 1px var(--gold), var(--shadow-card); }
.mm-tool .mm-card:is([data-rarity],[data-pool-tier]), .mm-tool .mm-fold[data-pool-tier], .mm-tool .mm-skill-entry {
  border-color: color-mix(in srgb,var(--mm-line) 52%, var(--surface)); border-inline-start: 3px solid var(--mm-line);
}
.mm-tool .mm-card[data-pool-tier] .mm-badge:first-child { border-color: var(--mm-line); color: var(--mm-line); }
.mm-tool .mm-card-meta .mm-badge { white-space: normal; }
.mm-tool .mm-badge[data-chapter-lock], .mm-tool .mm-mode-note { color: var(--tier-eldritch); background: var(--eldritch-soft); border: 1px solid var(--tier-eldritch); }
.mm-tool .mm-tier-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .35rem; font-size: .78rem; }
.mm-tool .mm-tier { display: inline-flex; align-items: baseline; gap: .3rem; color: var(--mm-line); }
.mm-tool .mm-tier i { width: .5rem; height: .5rem; flex: 0 0 .5rem; border-radius: 50%; background: currentColor; }
.mm-tool .mm-tier-arrow, .mm-tool .mm-raw-value { color: var(--muted); }
.mm-tool dialog.mm-drawer-backdrop { margin: 0; padding: 0; border: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; color: var(--text); }
.mm-tool dialog.mm-drawer-backdrop::backdrop { background: transparent; }
.mm-tool .mm-drawer { overscroll-behavior: contain; gap: 1rem; border-inline-start: 3px solid var(--mm-line,var(--gold)); }
.mm-tool :is(.mm-card,.mm-drawer)[data-rarity="eldritch"] { border-inline-start: 4px double var(--mm-line); }
.mm-tool .mm-drawer button { align-self: flex-start; }
.mm-tool .mm-drawer dt { color: var(--gold); font-weight: 600; }
.mm-tool .mm-drawer dd { margin: 0 0 .75rem; }
.mm-tool .mm-full-effect { white-space: pre-line; }
.mm-tool .mm-hero-picker { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr)); gap: .6rem; }
.mm-tool .mm-hero-picker a { display: flex; align-items: center; gap: .7rem; padding: .65rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; }
.mm-tool .mm-hero-picker small { color: var(--muted); }
.mm-tool .mm-hero-switch { max-width: 22rem; margin-bottom: .85rem; }
.mm-tool .mm-hero-banner { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: clamp(.8rem,2vw,1.5rem); display: flex; align-items: center; gap: 1.35rem; }
.mm-tool .mm-portrait { width: 38%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); }
.mm-tool .mm-hero-banner h2 { font: bold clamp(2rem,5vw,3.4rem)/1.1 var(--font-display); margin: .55rem 0; }
.mm-tool .mm-unlock { color: var(--gold); background: var(--gold-soft); border: 1px solid var(--gold); border-radius: var(--radius-sm); padding: .15rem .65rem; }
.mm-tool .mm-route-links { margin-top: .6rem; }
.mm-tool .mm-route-links strong { width: 100%; font-size: .875rem; }
.mm-tool .mm-ability, .mm-tool .mm-skill-entry { padding: .85rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.mm-tool .mm-ability .mm-record-head { margin-bottom: .65rem; }
.mm-tool .mm-mode-note { padding: .45rem; border-radius: var(--radius-sm); }
.mm-tool .mm-skill-list { margin-top: .5rem; }
.mm-tool .mm-hero-items { align-items: start; }
.mm-tool .mm-hero-nav { justify-content: space-between; border-top: 1px solid var(--border); padding-block: 1rem; }
@media (min-width: 960px) {
  .mm-tool .mm-planner-layout { grid-template-columns: minmax(0,1fr) minmax(12rem,22%); }
  .mm-tool .mm-branch-nodes { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .mm-tool .mm-toolbar label { width: 100%; }
  .mm-tool .mm-select { min-width: 0; }
  .mm-tool .mm-hero-banner { align-items: stretch; flex-direction: column; }
  .mm-tool .mm-portrait { width: 100%; }
}

/* Hero navigation and game-style records */
.mm-tool .mm-strip-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .35rem; align-items: center; margin-bottom: .5rem; }
.mm-tool .mm-strip-arrow { padding: .15rem .45rem; min-width: 2.3rem; min-height: 2.75rem; font-size: 1.3rem; }
.mm-tool .mm-hero-strip { display: flex; flex-wrap: nowrap; align-items: stretch; overflow-x: auto; min-width: 0; gap: .25rem; padding: .25rem; scrollbar-width: thin; overscroll-behavior-inline: contain; }
.mm-hero-strip a { flex: 0 0 auto; min-width: 3rem; min-height: 44px; display: grid; justify-items: center; align-content: center; padding: .15rem .35rem; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; }
.mm-hero-strip a > span:last-child { font-size: var(--fs-xs); line-height: 1.2; white-space: nowrap; }
.mm-tool .mm-hero-strip .mm-art { width: 2rem; height: 2rem; }
.mm-tool .mm-hero-strip img { object-fit: contain; border: 0; background: var(--bg); }
.mm-hero-strip a:is(:hover,:focus-visible,[aria-current="page"]) { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }
.mm-tool .mm-hero-splash {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 11rem; padding: clamp(.75rem,1.4vw,1.15rem);
  border-block-end: 3px solid var(--gold);

}
.mm-tool .mm-hero-splash .mm-portrait {
  position: absolute; z-index: -1; inset: 0 0 0 auto; width: 60%; height: 100%; object-fit: contain;
  mask-image: linear-gradient(to right,transparent,var(--bg) 22%);
}
.mm-tool .mm-hero-splash:has(.mm-portrait:not([hidden])) > div { width: 58%; }
.mm-tool .mm-hero-splash h2 { text-wrap: balance; margin: .3rem 0; font-size: clamp(1.75rem,3.5vw,2.65rem); }
.mm-tool .mm-hero-splash p { margin: .35rem 0; }
.mm-tool .mm-route-links a { border-radius: 2rem; }
.mm-tool :is(.mm-hero-tabs,.mm-planner-tabs) { margin-block: 1rem; }
.mm-tool :is(.mm-hero-tabs,.mm-planner-tabs) .mm-tab {
  flex: 1 1 auto; justify-content: center; flex-wrap: wrap; min-width: 0;
}
.mm-tool .mm-ability-art { width: 3.35rem; height: 3.35rem; flex-basis: 3.35rem; }
.mm-tool .mm-ability-icon { border-color: var(--border-strong); }
.mm-tool .mm-path-guide { padding-inline-start: 1.65rem; }
.mm-tool .mm-path-guide li { padding: .45rem .65rem; }
.mm-tool .mm-path-guide li::marker { color: var(--gold); }
.mm-tool .mm-path-guide p { margin: .35rem 0; }
.mm-tool .mm-souvenir-plaque {
  position: relative; min-width: 0; text-align: center; display: flex; align-items: center;
  flex-direction: column; gap: .7rem; align-self: stretch; padding: 1.45rem 1.1rem 1.1rem;
  color: var(--text); border: 3px double var(--border-strong); border-radius: var(--radius-xs);
  background:
    radial-gradient(circle at .28rem .28rem,var(--gold) 0 .12rem,transparent .17rem) top left / 52% 52% no-repeat,
    radial-gradient(circle at calc(100% - .28rem) .28rem,var(--gold) 0 .12rem,transparent .17rem) top right / 52% 52% no-repeat,
    radial-gradient(circle at .28rem calc(100% - .28rem),var(--gold) 0 .12rem,transparent .17rem) bottom left / 52% 52% no-repeat,
    radial-gradient(circle at calc(100% - .28rem) calc(100% - .28rem),var(--gold) 0 .12rem,transparent .17rem) bottom right / 52% 52% no-repeat,
    repeating-linear-gradient(94deg,transparent 0 7px,color-mix(in srgb,var(--bg) 14%,transparent) 8px 9px,transparent 10px 16px),
    linear-gradient(155deg,color-mix(in srgb,var(--tier-eldritch) 21%,var(--bg)),color-mix(in srgb,var(--tier-uncommon) 7%,var(--bg)));
  box-shadow: inset 0 0 1.4rem color-mix(in srgb,var(--bg) 60%,transparent),var(--shadow-card);
}
.mm-tool .mm-souvenir-plaque::before { content: none; }
.mm-tool .mm-souvenir-plaque:focus-within { border-color: var(--gold); }
.mm-tool .mm-plaque-title {
  margin: 0; color: var(--text); font: 650 1.15rem/1.27 var(--font-display); text-wrap: balance;
}
.mm-tool .mm-plaque-open {
  position: static; display: inline; padding: 0; min-height: 0; font: inherit; color: inherit;
  text-align: inherit; background: transparent; border: 0; box-shadow: none; transform: none; clip-path: none;
}
.mm-tool .mm-plaque-open::after { content: ""; position: absolute; inset: 0; cursor: pointer; }
.mm-tool .mm-plaque-effect { margin: 0; line-height: 1.6; white-space: pre-line; }
.mm-tool .mm-plaque-effect strong { font-size: 1.05em; color: color-mix(in srgb,var(--text) 80%,var(--gold)); }
.mm-tool .mm-souvenir-plaque small { color: var(--muted); }
.mm-tool .mm-souvenir-plaque .mm-card-meta { justify-content: center; }
.mm-tool :is(.mm-medallion,.mm-medallion-sm) {
  width: 4rem; height: 4rem; flex: 0 0 auto; padding: .47rem; box-sizing: border-box;
  border-radius: 50%; border: 3px double var(--gold); color: var(--gold);
  background: radial-gradient(ellipse at 40% 25%,color-mix(in srgb,var(--gold) 35%,var(--surface)),var(--bg) 78%);
  box-shadow: 0 0 0 .17rem var(--bg),0 0 0 .23rem var(--border-strong),var(--shadow-card); overflow: hidden;
}
.mm-tool .mm-medallion-sm { width: 3.25rem; height: 3.25rem; }
.mm-tool :is(.mm-medallion,.mm-medallion-sm) img {
  inset: 0; width: 100%; height: 100%; border: 0; border-radius: 50%; background: transparent;
}
.mm-tool .mm-medallion img { object-fit: contain; padding: .12rem; }
.mm-tool .mm-aug-chips {
  display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; margin-top: auto;
}
.mm-tool .mm-aug-chip {
  position: relative; z-index: 1; max-width: 100%; min-height: 2.5rem; border-radius: 1.5rem; padding: .35rem .65rem;
  font-size: var(--fs-xs); line-height: 1.35; color: var(--text); border-color: var(--border-strong); background: var(--bg);
  white-space: normal; overflow-wrap: anywhere;
}
.mm-tool .mm-aug-chip[aria-expanded="true"] { border-color: var(--gold); color: var(--gold); }
.mm-tool .mm-quality-dots { display: inline-flex; flex-shrink: 0; gap: .12rem; }
.mm-tool .mm-quality-dots i { width: .4rem; height: .4rem; border-radius: 50%; background: var(--mm-line); }
.mm-tool .mm-aug-popover {
  box-sizing: border-box; position: fixed; inset: auto; opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: none; z-index: 100; margin: 0; width: min(20rem,calc(100vw - 16px));
  max-height: calc(100dvh - 16px); overflow: auto; overflow-wrap: anywhere;
  padding: 1rem; background: var(--surface); color: var(--text); border: 1px solid var(--gold); border-radius: var(--radius);
  box-shadow: var(--shadow-deep); text-align: left;
}
.mm-tool .mm-aug-popover p { margin: .55rem 0; line-height: 1.45; }
.mm-tool .mm-aug-card[data-rarity] {
  border: 1px solid color-mix(in srgb,var(--mm-line) 52%,var(--surface)); border-top: 3px solid var(--mm-line);
  background: linear-gradient(145deg,color-mix(in srgb,var(--mm-line) 13%,var(--surface)),var(--surface));
  box-shadow: inset 0 1px .8rem color-mix(in srgb,var(--mm-line) 8%,transparent),var(--shadow-card);
}
.mm-tool :is(.mm-aug-card,.mm-aug-popover) .mm-tier-strip { align-items: stretch; gap: .25rem; margin-top: auto; }
.mm-tool :is(.mm-aug-card,.mm-aug-popover) .mm-tier { flex: 1 1 4.8rem; padding: .25rem .3rem; border-top: 3px solid var(--mm-line); background: var(--bg); }
.mm-tool :is(.mm-aug-card,.mm-aug-popover) :is(.mm-tier i,.mm-tier-arrow) { display: none; }

.mm-tool [data-rarity="common"] { --mm-line: var(--tier-uncommon); }
.mm-tool [data-rarity="uncommon"] { --mm-line: var(--tier-rare); }
.mm-tool [data-rarity="rare"] { --mm-line: var(--tier-legendary); }
.mm-tool :is([data-rarity="legendary"],[data-rarity="ancient"]) { --mm-line: var(--gold); }
.mm-tool :is(.mm-aug-card,.mm-aug-popover) {
  display: flex; flex-direction: column; align-items: stretch; gap: .55rem;
  background: linear-gradient(115deg,color-mix(in srgb,var(--tier-rare) 10%,var(--surface)),var(--surface));
}
.mm-tool :is(.mm-aug-card,.mm-aug-popover) .mm-record-head { justify-content: space-between; }
.mm-tool :is(.mm-aug-card,.mm-aug-popover) .mm-medallion-sm { margin-left: auto; }
.mm-tool .mm-aug-card .mm-card-meta { margin: 0; }
.mm-tool .mm-rarity-band {
  display: block; flex: none; margin: .2rem -1rem -1rem; padding: .35rem .6rem;
  border-block-start: 1px solid var(--mm-line); text-align: center; color: var(--text);
  font-weight: 700; font-size: var(--fs-sm);
  background: linear-gradient(90deg,color-mix(in srgb,var(--mm-line) 12%,var(--bg)),color-mix(in srgb,var(--mm-line) 48%,var(--bg)),color-mix(in srgb,var(--mm-line) 12%,var(--bg)));
}
.mm-tool .mm-aug-card { padding: 1rem; }
.mm-tool .mm-aug-popover .mm-record-head > strong { color: var(--gold); font-family: var(--font-display); }
.mm-tool .mm-aug-popover[hidden] { display: none; }
.mm-tool .mm-planner-layout { display: block; }
.mm-tool .mm-planner-bar { position: static; }
.mm-tool .mm-board-scroll {
  max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: var(--border-strong) var(--bg);
  border: 1px solid var(--border);
}
.mm-tool .mm-branches { min-width: 60rem; padding: 0; gap: 0; }
.mm-tool .mm-track {
  display: grid; grid-template-columns: 7rem minmax(0,1fr); gap: 0 .45rem; align-items: start;
  padding: .65rem .8rem; background: transparent; border: 0; border-bottom: 1px solid var(--border-subtle);
}
.mm-tool .mm-track:last-child { border-bottom: 0; }
.mm-tool .mm-track .mm-branch-head {
  display: grid; justify-content: start; gap: .35rem; margin: .6rem 0 0; align-items: start;
}
.mm-tool .mm-track .mm-branch-head small { font: var(--fs-xs)/1.2 var(--font-mono); }
.mm-tool .mm-track .mm-alert:not(:empty) { grid-column: 2; }
.mm-tool .mm-track .mm-branch-nodes { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: .28rem; }
.mm-tool .mm-track .mm-branch-nodes::before {
  display: block; inset: 1.69rem 6% auto; height: 2px;
  background: linear-gradient(to bottom,var(--gold),var(--border)); opacity: .7;
}
.mm-tool .mm-node.mm-arcana-node {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .2rem; position: relative;
  min-height: 0; padding: 0 .15rem .3rem; border: 0; background: transparent; box-shadow: none; text-align: center; opacity: 1;
}
.mm-tool .mm-node-ring {
  position: relative; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; margin: .4rem 0;
  color: var(--muted); border: 3px double color-mix(in srgb,var(--gold) 72%,var(--bg));
  border-radius: 50%; background: radial-gradient(ellipse at 40% 30%,var(--surface-2),var(--bg));
  box-shadow: 0 0 0 2px var(--bg); font: 700 1.05rem var(--font-display);
}
.mm-tool .is-keystone .mm-node-ring { width: 3.4rem; height: 3.4rem; margin: 0; border-width: 5px; font-size: 1.25rem; }
.mm-tool .mm-node-ring small {
  position: absolute; top: -.25rem; right: -.2rem; color: var(--text); border-radius: 50%;
  background: var(--surface); font: 700 var(--fs-xs)/1.15 var(--font-mono); padding: .05rem .16rem;
}
.mm-tool .mm-arcana-node:is(:focus-visible,:hover,[data-inspected]) .mm-node-ring { border-color: var(--gold); color: var(--gold); }
.mm-tool .mm-arcana-node.is-selected .mm-node-ring {
  color: var(--text); border-color: var(--gold); background: radial-gradient(circle,color-mix(in srgb,var(--gold) 47%,var(--surface)),var(--bg));
  box-shadow: 0 0 .8rem var(--gold),inset 0 0 .65rem var(--gold-soft);
}
.mm-tool .mm-arcana-node .mm-node-title { font: 650 var(--fs-xs)/1.3 var(--font-sans); }
.mm-tool .mm-arcana-node .mm-node-cost { align-self: center; color: var(--gold); border: 0; padding: 0; background: transparent; }
.mm-tool .mm-arcana-node .mm-node-val { color: var(--muted); font-size: var(--fs-xs); }
.mm-tool .mm-planner-details { display: grid; grid-template-columns: minmax(0,1fr) minmax(12rem,23%); gap: 1rem; margin-top: 1rem; }
.mm-tool .mm-inspector { min-width: 0; margin: 0; }
@media (max-width: 780px) {
  .mm-tool .mm-planner-details { grid-template-columns: minmax(0,1fr); }
  .mm-tool .mm-track .mm-branch-head { position: sticky; left: 0; z-index: 2; padding: .3rem; background: var(--surface); }
}
[data-mm-roster-filter] [hidden], .mm-hero-card[hidden], .mm-roster-section[hidden] { display: none !important; }
@media (max-width: 600px) {
  .mm-tool .mm-strip-row { display: block; }
  .mm-tool .mm-strip-arrow { display: none; }
  .mm-tool .mm-hero-splash { gap: .75rem; min-height: 0; }
  .mm-tool .mm-hero-splash .mm-portrait { position: static; width: 100%; height: auto; max-height: 12rem; mask-image: none; }
  .mm-tool .mm-hero-splash:has(.mm-portrait:not([hidden])) > div { width: 100%; }
  .mm-tool :is(.mm-hero-tabs,.mm-planner-tabs) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mm-tool .mm-tab { padding: .45rem; }
}

.mm-tool .mm-plaque-heading { margin: 0; text-align: center; }
.mm-tool .mm-plaque-heading :is(.mm-plaque-open,.mm-plaque-title,.mm-plaque-sub) { display: block; text-transform: none; white-space: normal; }
.mm-tool .mm-plaque-sub { margin: .25rem 0 0; color: var(--muted); font: 500 .85rem/1.25 var(--font-sans); }
.mm-tool .mm-plaque-medal { position: relative; display: inline-flex; }
.mm-tool .mm-medal-hero-pip { position: absolute; bottom: -.15rem; right: -.3rem; width: 1.45rem; height: 1.45rem; border: 1px solid var(--gold); border-radius: 50%; background: var(--bg); object-fit: contain; }
.mm-tool .mm-pop-close { position: absolute; top: .3rem; right: .3rem; min-width: 2.25rem; min-height: 2.25rem; padding: 0; border-radius: 50%; line-height: 1; font-size: 1.3rem; }
.mm-tool .mm-aug-popover .mm-record-head { padding-inline-end: 1.85rem; }
.mm-tool .mm-tier:only-child { width: 100%; border-color: var(--mm-line); font-weight: 700; }
.mm-tool .mm-preset-bar, .mm-tool .mm-build-summary header, .mm-tool .mm-build-summary ul { display: flex; flex-wrap: wrap; gap: .4rem .7rem; align-items: center; }
.mm-tool .mm-build-summary { padding: .7rem 1rem; margin: .6rem 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); }
.mm-tool .mm-build-summary header { justify-content: space-between; color: var(--gold); }
.mm-tool .mm-build-summary ul { list-style: none; padding: 0; margin: .45rem 0 0; }
.mm-tool .mm-build-summary li { padding: .12rem .5rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.mm-tool .mm-build-summary p { margin: .35rem 0 0; color: var(--muted); }
.mm-tool .mm-preset-bar [aria-pressed="true"], .mm-tool .mm-track[data-mm-focused] { background: var(--gold-soft); box-shadow: inset 3px 0 var(--gold); }

.mm-tool .mm-hub-roster { min-width: 0; }
.mm-tool .mm-hub-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.mm-tool .mm-hub-controls label { flex: 1 1 10rem; }
.mm-tool .mm-hub-controls label:first-child { flex-grow: 2; }
.mm-tool .mm-hub-controls :is(input,select) { width: 100%; box-sizing: border-box; }
.mm-tool .mm-hub-roster [data-mm-hub-count] { color: var(--muted); margin: .8rem 0; }
.mm-tool .mm-hub-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mm-tool .mm-hub-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.mm-tool .mm-hub-copy { display: grid; gap: .35rem; padding: .65rem; }
.mm-tool .mm-hub-copy strong { font-size: 1.05rem; line-height: 1.2; }
.mm-tool .mm-hub-tags { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; color: var(--gold); font-size: .75rem; }
.mm-tool .mm-hub-role { color: var(--muted); font-size: .85rem; }

.mm-ant-app { display: grid; gap: 1rem; }
.mm-ant-app :is(input,select,button) { font: inherit; }
.mm-ant-app :is(input,select,button,.mm-ant-heroes a) {
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.mm-ant-app button { cursor: pointer; }
.mm-ant-app :is(button,a):hover { border-color: var(--gold); }
.mm-ant-app :is(button,a,input,select):focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mm-ant-controls { display: grid; grid-template-columns: 2fr repeat(3,minmax(0,1fr)); gap: .75rem; }
.mm-ant-controls label { display: grid; gap: .35rem; color: var(--muted); font-size: .86rem; }
.mm-ant-controls :is(input,select) { width: 100%; min-width: 0; padding: .65rem; }
.mm-ant-reverse-bar { padding: 1rem; background: var(--surface-2); border-inline-start: 3px solid var(--gold); border-radius: var(--radius); }
.mm-ant-reverse-bar h2 { margin: 0; font-size: 1.25rem; }
.mm-ant-reverse-bar p { margin: .25rem 0 .7rem; color: var(--muted); }
.mm-ant-app [data-selection]:empty { display: none; }
.mm-ant-app [data-selection]:not(:empty) { margin: .65rem 0 0; }
.mm-ant-app :is([data-reverse],.mm-ant-tabs,.mm-ant-formula,.mm-ant-heroes) { display: flex; align-items: center; flex-wrap: wrap; gap: .38rem; }
.mm-ant-app .mm-ant-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .45rem .18rem .18rem; font-size: .79rem; text-align: start; }
.mm-ant-chip img { width: 1.75rem; height: 1.32rem; object-fit: cover; border-radius: var(--radius-xs); }
.mm-ant-chip b { padding: 0 .28rem; background: var(--surface-2); color: var(--gold); border-radius: var(--radius-xs); }
.mm-ant-app [aria-pressed="true"] { color: var(--gold); background: var(--gold-soft); border-color: var(--gold); }
.mm-ant-app .mm-ant-tabs button { padding: .43rem .68rem; border-radius: var(--radius-pill); font-size: .87rem; }
.mm-ant-app [data-count] { margin: 0; color: var(--muted); font-size: .88rem; }
.mm-ant-results { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit,minmax(min(100%,26rem),1fr)); align-items: start; }
.mm-ant-card { min-width: 0; scroll-margin-block: 6rem; border: 1px solid var(--border-strong); background: var(--surface); padding: 1rem; border-radius: var(--radius); }
.mm-ant-card[data-shared] { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.mm-ant-card header { display: flex; align-items: center; gap: .8rem; }
.mm-ant-card header :is(img,svg) { display: block; flex: none; width: 4.25rem; height: 3.2rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.mm-ant-emblem { color: var(--gold); background: radial-gradient(ellipse,var(--gold-soft),var(--bg)); }
.mm-ant-card h3 { font-size: 1.23rem; margin: .16rem 0 0; }
.mm-ant-card header small,.mm-ant-total { color: var(--gold); }
.mm-ant-recipe-box { display: grid; gap: .4rem; margin: .8rem 0; padding: .65rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.mm-ant-formula { color: var(--muted); font-size: .85rem; }
.mm-ant-formula .mm-ant-scroll { padding-inline-start: 0; }
.mm-ant-total { white-space: nowrap; }
.mm-ant-or { font-size: .75rem; color: var(--gold); font-weight: 700; }
.mm-ant-details { font-size: .89rem; }
.mm-ant-details ul { display: flex; flex-wrap: wrap; gap: .2rem .7rem; padding: 0; list-style: none; }
.mm-ant-details :is(ul,p),.mm-ant-card .mm-ant-note,.mm-ant-card .mm-ant-pool { margin: .55rem 0; }
.mm-ant-details p { white-space: pre-line; }
.mm-ant-note,.mm-ant-pool,.mm-ant-recipe-box small,.mm-ant-details small { color: var(--muted); font-size: .83rem; }
.mm-ant-heroes { font-size: .78rem; }
.mm-ant-heroes a { padding: .12rem .38rem; text-decoration: none; }
.mm-ant-share { display: inline-block; margin-top: .75rem; padding: .32rem .65rem; font-size: .83rem; }
.mm-ant-table { overflow-x: auto; max-width: 100%; }
.mm-ant-table table { width: 100%; min-width: 40rem; border-collapse: collapse; }
.mm-ant-table :is(td,th) { color: var(--text); padding: .55rem; text-align: start; vertical-align: top; border-bottom: 1px solid var(--border); }
.mm-ant-table thead th { color: var(--gold); }
@media (max-width: 720px) {
  .mm-ant-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mm-ant-controls label:first-child,.mm-ant-controls label:last-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .mm-tool .mm-hub-controls label:first-child { flex-basis: 100%; }
  .mm-tool .mm-hub-controls label { flex-basis: 8rem; }
}

/* The server-rendered catalog summary already identifies the database. */
.mm-ssr-scale-strip ~ .mm-tool-stage [data-mm-augments-app] > .mm-loading {
  display: none;
}

/* Compact Antique catalogue and native modal. */
.mm-ant-app {
  --mm-line: var(--gold);
  grid-template-columns: minmax(0, 1fr);
}
.mm-ant-app .mm-ant-controls { scroll-margin-top: 5rem; }
.mm-ant-app .mm-ant-results {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem; align-items: stretch;
}
.mm-ant-app .mm-ant-scan {
  display: flex; flex-direction: column; align-items: stretch; justify-content: start; gap: .38rem;
  width: 100%; min-width: 0; margin: 0; padding: .7rem .8rem; text-align: start; text-transform: none;
  white-space: normal; letter-spacing: normal; font: 400 var(--fs-sm)/1.3 var(--font-sans);
  color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: linear-gradient(130deg,var(--surface-2),var(--surface) 55%); box-shadow: var(--shadow-card);
}
.mm-ant-app .mm-ant-scan:is(:hover,:focus-visible,:has([data-matched])) { border-color: var(--mm-line); }
.mm-ant-scan-head, .mm-ant-dialog-head { display: flex; align-items: center; gap: .65rem; }
.mm-ant-scan-head > :is(img,svg), .mm-ant-dialog-head > :is(img,svg) {
  object-fit: contain; flex: none; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.mm-ant-scan-head > :is(img,svg) { width: 48px; height: 36px; }
.mm-ant-scan-head strong { display: block; font: 700 1.02rem/1.18 var(--font-display); color: var(--mm-line); }
.mm-ant-scan-head small, .mm-ant-dialog-head small { color: var(--muted); font-size: var(--fs-xs); }
.mm-ant-scan-head small b { color: var(--mm-line); }
.mm-ant-values { display: flex; flex-wrap: wrap; gap: .18rem .28rem; }
.mm-ant-values > span {
  padding: .1rem .28rem; border-radius: var(--radius-xs); font: 500 var(--fs-xs)/1.25 var(--font-sans);
  color: var(--text); background: var(--bg); border: 1px solid var(--border-subtle);
}
.mm-ant-summary {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--text); font-size: var(--fs-sm); line-height: 1.32;
}
.mm-ant-mini-route {
  display: flex; align-items: center; gap: .2rem; flex-wrap: nowrap; margin-top: auto; padding: .2rem .28rem;
  border: 1px solid var(--border-subtle); background: var(--bg); border-radius: var(--radius-xs);
  white-space: nowrap; font: 500 var(--fs-xs)/1.2 var(--font-mono); color: var(--muted);
}
.mm-ant-mini-route b, .mm-ant-mini-route small { color: var(--mm-line); font-size: var(--fs-xs); }
.mm-ant-mini-route [title] { display: inline-flex; gap: .15rem; align-items: center; }
.mm-ant-mini-route img { flex: none; width: 22px; height: 22px; object-fit: cover; border-radius: var(--radius-xs); }
.mm-ant-mini-fee { border-inline-start: 1px dashed var(--border-strong); }
.mm-ant-app [data-matched] { border: 1px solid var(--mm-line); background: var(--gold-soft); }
.mm-ant-hint { color: var(--mm-line); font-size: var(--fs-xs); line-height: 1.2; }
.mm-ant-app .mm-ant-dialog {
  box-sizing: border-box; position: fixed; inset: 0; margin: auto; width: min(42rem,calc(100% - 1.5rem));
  height: fit-content; max-height: min(88dvh,52rem); padding: 1.15rem; overflow: auto; overscroll-behavior: contain;
  color: var(--text); border: 3px double var(--mm-line); border-radius: var(--radius); box-shadow: var(--shadow-deep);
  background: radial-gradient(ellipse at top left,var(--surface-2),var(--surface) 65%);
}
.mm-ant-dialog::backdrop { background: color-mix(in srgb,var(--bg) 82%,transparent); }
html:has(.mm-ant-dialog[open]) { overflow: hidden; }
html:has(.mm-ant-app) { scrollbar-gutter: stable; }
.mm-ant-dialog-head { padding-inline-end: 2.5rem; }
.mm-ant-dialog-head > :is(img,svg) { width: 88px; height: 66px; }
.mm-ant-dialog-head h2 { margin: .2rem 0; color: var(--mm-line); line-height: 1.15; }
.mm-ant-dialog h3 { margin: 1rem 0 .4rem; font-size: 1rem; }
.mm-ant-dialog .mm-ant-close {
  position: absolute; top: .65rem; right: .65rem; margin: 0; padding: 0; width: 2.5rem; min-height: 2.5rem;
  display: grid; place-items: center; font: 550 1.5rem/1 var(--font-sans); border-radius: 50%;
}
.mm-ant-dialog .mm-ant-recipe-box { min-width: 0; margin: 0; }
.mm-ant-dialog .mm-ant-scroll { padding: .15rem .4rem; border: 1px dashed var(--mm-line); }
.mm-ant-dialog .mm-ant-formula { padding: .25rem; }
.mm-ant-dialog .mm-ant-formula [data-ingredient] { white-space: normal; }
.mm-ant-dialog .mm-ant-upgrade, .mm-ant-dialog .mm-ant-share { margin-top: .6rem; }
.mm-ant-app .mm-ant-top {
  position: fixed; z-index: 12; inset: auto max(1rem,env(safe-area-inset-right)) max(1rem,env(safe-area-inset-bottom)) auto;
  min-height: 2.75rem; background: var(--surface-2); border-color: var(--mm-line); color: var(--mm-line);
  border-radius: var(--radius-pill); box-shadow: var(--shadow-card);
}
.mm-ant-app .mm-ant-top[hidden] { display: none; }
@media (max-width: 960px) {
  .mm-ant-app .mm-ant-results { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .mm-ant-app .mm-ant-results { grid-template-columns: minmax(0,1fr); }
  .mm-ant-app .mm-ant-dialog { padding: .85rem; }
}
