#account-dialog.account-creating {
    width: min(46rem, calc(100vw - 1.5rem));
    margin-block: clamp(1rem, 9dvh, 5rem) auto;
    max-height: calc(100dvh - clamp(1rem, 9dvh, 5rem) - 1rem);
}
#account-runim-complete { color: var(--moss-light); }
.account-identity { display: grid; gap: .4rem; }
.account-step-track { position: relative; }
.account-complete { margin: .2rem 0; color: var(--moss-light); font-size: 1.15rem; overflow-wrap: anywhere; }
#account-runim-step { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--steel-line); }
#account-runim-heading { font-size: 1.15rem; font-weight: 400; margin: 0 0 .6rem; }
.runim-selection { display: grid; grid-template: "bed choices" / minmax(0, .9fr) minmax(0, 1.1fr); gap: .9rem; }
.runim-choices { grid-area: choices; min-width: 0; margin: 0; padding: 0; border: 0; }
.runim-choices legend { padding: 0; margin-block-end: .35rem; color: #dfccb2; }
.runim-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
#account-form .runim-types label { margin: 0; }
.runim-type {
  position: relative; min-width: 0; padding: .3rem .15rem .38rem; display: grid; align-content: end;
  justify-items: center; text-align: center; border: 1px solid #72634e; background: #211f1a;
  color: #f2dfbb; font-size: clamp(.71rem, 1.6vw, .91rem); overflow-wrap: anywhere;
}
.runim-type input[type="radio"] {
  position: absolute; z-index: 1; inset: 0; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer;
}
.runim-type canvas {
  display: block; width: min(91%, 5rem); height: auto; aspect-ratio: 1; margin: 0 auto .18rem;
  filter: drop-shadow(0 0 4px rgb(var(--runim-color) / .13));
}
.runim-type:hover, .runim-type:has(:checked) { border-color: var(--steel-blue-light); }
.runim-type:has(:checked) { background: #2a2921; }
.runim-type:has(:checked)::after {
  content: "✓"; position: absolute; top: .12rem; right: .22rem; color: var(--steel-blue-light); pointer-events: none;
}
.runim-type:has(:checked) canvas { filter: brightness(1.08) drop-shadow(0 0 6px rgb(var(--runim-color) / .25)); }
.runim-type:has(:focus-visible) { outline: 2px solid var(--steel-blue-light); outline-offset: -2px; }
.runim-note { color: #dfccb2; margin: .45rem 0 0; font-size: .84rem; line-height: 1.32; min-height: 2.65em; }
.runim-bed {
  isolation: isolate; position: relative; display: grid; place-items: center; min-height: 11rem;
  border: 1px solid #84684a; border-radius: 3px; overflow: hidden;
  background: radial-gradient(ellipse at 46% 37%, transparent, #18110fa0), var(--runim-wood, none) center / cover, #3a2b22;
  box-shadow: inset 0 0 17px #110e0bd0;
}
#account-runim-bed { grid-area: bed; }
.runim-bed:has(canvas:not([hidden]))::before {
  content: ""; position: absolute; z-index: -1; bottom: 7%; left: 18%; width: 64%; height: 19%;
  border-radius: 50%; background: #100b09; filter: blur(8px); transform: rotate(-7deg);
}
.runim-bed canvas { width: min(94%, 17rem); height: auto; aspect-ratio: 1; }
.runim-empty {
  display: grid; gap: .55rem; justify-items: center; width: min(84%, 14rem); margin: .5rem 0;
  text-align: center; color: #dfccb2; font-size: .83rem;
}
.runim-empty::before {
  content: ""; width: clamp(58px, 12vw, 104px); aspect-ratio: .93; border-radius: 50%; border: 1px solid #ad8e674d;
  background: radial-gradient(ellipse at 45% 80%, #20130d30, #140e0a7d); box-shadow: inset 0 1px 11px #120b0780;
}
#generate-runim { margin-top: .65rem; min-height: 44px; }

.runim-dialog { width: min(33rem, calc(100vw - 1.5rem)); }
.runim-dialog [hidden], .squad-hero [hidden], #squad-hero[hidden] { display: none; }
.runim-dialog::backdrop { background: #0e100cb0; backdrop-filter: blur(3px); }
.runim-heading, .runim-actions { display: flex; gap: .5rem; align-items: center; justify-content: space-between; }
.runim-heading h2 { margin: 0; color: #ecd8b7; font-size: clamp(1.18rem, 4vw, 1.55rem); font-weight: 400; }
.runim-heading p { color: #cbb899; margin: 0; }
.runim-actions { min-height: 44px; margin-block-start: .55rem; justify-content: flex-end; }
.runim-actions button, .runim-close { min-height: 44px; }
.runim-close { min-width: 44px; font-size: 1.5rem; }
.runim-imprint-field {
  --runim-trace: -10%; --runim-color: 168 197 209;
  position: relative; isolation: isolate; display: grid; place-items: center; overflow: hidden;
  width: min(100%, 350px, 49dvh); aspect-ratio: 1; margin: .9rem auto .45rem;
  border: 1px solid #8a7963; border-radius: 4px;
  background: radial-gradient(ellipse at 48% 43%, rgb(var(--runim-color) / .13), transparent 69%), #141818;
  box-shadow: 0 8px 21px #0808089c, inset 0 0 27px #0b0e0e;
}
.runim-imprint-field.tracing::after {
  content: ""; position: absolute; z-index: -1; inset: 4%;
  background: radial-gradient(ellipse at var(--runim-core-x) var(--runim-core-y), transparent calc(var(--runim-trace) - 11%),
    rgb(var(--runim-color) / .20) var(--runim-trace), transparent calc(var(--runim-trace) + 7%));
}
.runim-imprint-field canvas {
  width: 92%; height: auto; aspect-ratio: 1;
  filter: brightness(1.19) drop-shadow(0 0 5px rgb(var(--runim-color) / .60));
  mask-image: radial-gradient(ellipse at var(--runim-core-x, 46%) var(--runim-core-y, 41%),
    #000 calc(var(--runim-trace) - 6%), #000d var(--runim-trace), transparent calc(var(--runim-trace) + 8%));
}
.runim-imprint-field.settled canvas { animation: runim-settle 630ms ease-out; }
@keyframes runim-settle { 30% { filter: brightness(1.49) drop-shadow(0 0 10px rgb(var(--runim-color) / .71)); } }
.runim-progress { min-height: 1.4em; margin: 0; text-align: center; color: #dfccb2; }
.runim-display { margin-top: .75rem; }
.runim-display canvas { width: min(97%, 27rem, 68dvh); }

.squad-hero {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: .85rem; margin: .7rem 0 1rem;
  padding: .75rem; border: 1px solid #806c50; background: linear-gradient(120deg, #3b3225bf, #1a1b18d9);
}
.squad-hero-character { display: grid; grid-template-columns: minmax(3rem, 6rem) minmax(0, 1fr); gap: .75rem; align-items: start; }
#squad-hero-portrait { width: 100%; }
.squad-hero h3 { color: #f1dec0; font-weight: 400; font-size: 1.13rem; margin: 0 0 .25rem; overflow-wrap: anywhere; }
.squad-hero-runim {
  display: inline-flex; align-items: center; gap: .38rem; padding: .14rem .5rem .14rem .18rem; margin: 0 0 .2rem;
  background: #231e18; color: #e8d2ac; border: 1px solid #8c704f; text-align: start;
}
.squad-hero-runim:hover, .squad-hero-runim:focus-visible { border-color: var(--steel-blue-light); }
.squad-hero-runim canvas { width: 3.2rem; aspect-ratio: 1; }
.squad-hero-runim span { display: block; font-size: .78rem; }
.squad-hero-runim strong { color: #f0dfc1; font-size: .95rem; font-weight: 400; }
.squad-hero #squad-loadout { margin: .18rem 0 0; }
.squad-awards { min-height: 6.4rem; border: 1px solid #89735470; padding: .65rem .8rem; background: #16161265; }
.squad-awards h3 { font-size: 1rem; }
.squad-awards p { border-top: 1px solid #a48c653f; margin: .35rem 0 0; padding-block-start: .6rem; color: #cbb899; font-size: .83rem; }

@media (max-width: 560px) {
  .runim-selection { grid-template: "choices" "bed" / minmax(0, 1fr); gap: .55rem; }
  .runim-bed { min-height: 7.5rem; }
  #account-runim-preview { width: min(65%, 11rem); }
  .runim-type canvas { max-width: 3.5rem; }
  .squad-hero { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
  .squad-hero-character { grid-template-columns: minmax(2.8rem, 4.4rem) minmax(0, 1fr); }
  .squad-awards { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { .runim-imprint-field.settled canvas { animation: none; } }
