.fm-page {
  --fm-accent: #a4dfc9;
  --fm-ink: #112c22;
  --fm-tint: rgba(164, 223, 201, 0.1);
  --fm-layer: var(--panel, #171b20);
  --fm-edge: var(--line-2, #363c42);
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
  color: var(--text, #eef1f0);
  padding-bottom: 8px;
  font-family: inherit;
}
.light-ui .fm-page {
  --fm-accent: #205f4d;
  --fm-ink: #fff;
  --fm-tint: rgba(37, 107, 83, 0.09);
}
.fm-page * {
  box-sizing: border-box;
}
.fm-page [hidden] {
  display: none !important;
}
.fm-page :is(h2, h3, h4, p, ul) {
  margin: 0;
}
.fm-page .fm-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 1px 0;
}
.fm-heading h2 {
  font: inherit;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 660;
  letter-spacing: -0.055em;
  line-height: 1.1;
}
.fm-heading .fm-note {
  margin-top: 6px;
}
.fm-page .fm-note,
.fm-page small {
  color: var(--dim, #b4bbbe);
  font-size: 0.83rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.fm-page .fm-note:empty {
  display: none;
}
.fm-page :is(button, select, input) {
  font-family: inherit;
}
.fm-page :is(.fm-button, .fm-modes button, .fm-view-controls button, .fm-room, select, input) {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  border: 1px solid var(--fm-edge);
  border-radius: 11px;
  padding: 9px 14px;
  color: var(--text, #eef1f0);
  background: transparent;
  font-size: 0.85rem;
  line-height: 1.25;
}
.fm-page :is(button, summary, select) {
  cursor: pointer;
}
.fm-page button {
  font-weight: 580;
}
.fm-page button:disabled {
  cursor: default;
  opacity: 0.43;
}
.fm-page :is(button, select, summary, input):focus-visible {
  outline: 2px solid var(--fm-accent);
  outline-offset: 3px;
}
.fm-page button:active:not(:disabled) {
  transform: translateY(1px);
}
.fm-page .fm-button.fm-primary {
  color: var(--fm-ink);
  background: var(--fm-accent);
  border-color: transparent;
}
.fm-page select {
  padding-inline-end: 34px;
  font-size: 1rem;
  line-height: 1.35;
  background-color: var(--fm-layer);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--dim) 50%),
    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 50%,
    calc(100% - 10px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.fm-page .fm-floor {
  width: auto;
  max-width: 50%;
  font-size: 0.86rem;
}
.fm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(225px, 0.36fr);
  align-items: start;
  gap: 14px;
}
.fm-world,
.fm-inspector {
  min-width: 0;
  border: 1px solid var(--fm-edge);
  border-radius: 19px;
  background: var(--fm-layer);
  overflow: hidden;
}
.fm-world {
  background-color: #171c1e;
  color: #edf1ee;
  isolation: isolate;
}
.fm-world-head,
.fm-world-foot,
.fm-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
}
.fm-world-head {
  position: relative;
  z-index: 1;
}
.fm-world-head h3 {
  font-size: 0.94rem;
  font-weight: 590;
  letter-spacing: -0.015em;
  color: #e7eae6;
}
.fm-modes,
.fm-view-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
  border: 1px solid #414946;
  background: #202724;
  border-radius: 12px;
  padding: 2px;
}
.fm-page .fm-modes button,
.fm-page .fm-view-controls button {
  color: #e3eae5;
  border: 0;
  font-size: 0.78rem;
  min-width: 44px;
  padding: 0 10px;
}
.fm-page .fm-modes [aria-pressed='true'] {
  color: #172a21;
  background: #b2ddc6;
  border-radius: 9px;
}
.fm-stage {
  position: relative;
  width: 100%;
  height: clamp(365px, 35vw, 570px);
  overflow: hidden;
  contain: layout paint;
  background-color: #1b2022;
  background-image:
    radial-gradient(ellipse at 47% 48%, rgba(130, 142, 130, 0.16), transparent 72%),
    repeating-linear-gradient(18.6deg, transparent 0 25px, rgba(187, 200, 186, 0.035) 25px 26px),
    repeating-linear-gradient(136.3deg, transparent 0 27px, rgba(187, 200, 186, 0.035) 27px 28px);
}
.fm-stage canvas,
.fm-stage .fm-labels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.fm-stage canvas {
  touch-action: pan-y;
  cursor: pointer;
}
.fm-stage[data-zoomed='true'] canvas {
  touch-action: none;
  cursor: grab;
}
.fm-stage[data-zoomed='true'] canvas:active {
  cursor: grabbing;
}
.fm-labels {
  pointer-events: none;
}
.fm-page .fm-stage .fm-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 126px;
  min-width: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: auto;
}
.fm-pin-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  min-height: 21px;
  background: rgba(31, 37, 34, 0.91);
  border: 1px solid rgba(241, 239, 223, 0.48);
  border-radius: 99px;
  box-shadow: 0 2px 4px #1d221d44;
  padding: 2px 7px;
  color: #f7f5eb;
  font: 580 0.7rem/1.2 system-ui;
  letter-spacing: -0.015em;
}
.fm-pin-name {
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.fm-pin-chip::before {
  content: '';
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a1aaa4;
}
.fm-pin[data-on='true'] .fm-pin-chip::before {
  background: #a6e6c2;
}
.fm-pin[aria-pressed='true'] .fm-pin-chip {
  background: #214637;
  border-color: #b5ead1;
  color: #fff;
}
.fm-page .fm-pin:active:not(:disabled) {
  transform: translate(-50%, -50%);
}
.fm-page .fm-caption {
  color: #b7c2bb;
  font-size: 0.73rem;
  line-height: 1.4;
}
.fm-page .fm-view-controls button {
  color: #e3eae5;
  min-width: 40px;
}
.fm-pages {
  border-top: 1px solid #353d38;
  color: #c7cec8;
  font-size: 0.8rem;
}
.fm-page .fm-pages button {
  color: #e2eae2;
  border-color: #444f48;
}
.fm-stage .fm-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  color: #c4cbc5;
}
.fm-inspector {
  display: grid;
  gap: 15px;
  padding: 17px;
}
.fm-page .fm-field {
  display: grid;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 590;
  color: var(--dim);
  min-width: 0;
}
.fm-page .fm-field select {
  width: 100%;
}
.fm-page .fm-power {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--fm-edge);
  padding-top: 14px;
}
.fm-power h3,
.fm-review h4 {
  font-size: 0.92rem;
  font-weight: 650;
  margin: 0;
}
.fm-switches,
.fm-decision,
.fm-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.fm-switches > .fm-button,
.fm-decision > .fm-button {
  flex: 1;
  white-space: nowrap;
}
.fm-power .fm-review {
  display: grid;
  gap: 9px;
}
.fm-page .fm-results,
.fm-page .fm-inventory {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 2px;
  max-height: 244px;
  overflow: auto;
}
.fm-results li,
.fm-inventory li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--fm-edge);
  padding: 7px 0;
}
.fm-results strong,
.fm-inventory strong {
  font-size: 0.79rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.fm-results span,
.fm-inventory span {
  font-size: 0.72rem;
  color: var(--dim);
  text-align: end;
}
.fm-results small {
  width: 100%;
}
.fm-results [data-kind='confirmed'],
.fm-results [data-kind='ready'] {
  color: var(--fm-accent);
}
.fm-results [data-kind='failed'],
.fm-results [data-kind='rejected'] {
  color: var(--warn);
}
.fm-info,
.fm-setup {
  border-top: 1px solid var(--fm-edge);
}
.fm-page summary {
  min-height: 44px;
  align-content: center;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 0;
}
.fm-role,
.fm-arrange,
.fm-setup-body {
  display: grid;
  gap: 8px;
}
.fm-role {
  border-top: 1px solid var(--fm-edge);
  padding: 9px 0;
}
.fm-role label {
  display: grid;
  gap: 5px;
  font-size: 0.83rem;
}
.fm-coordinates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.fm-coordinates input {
  width: 100%;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
}
.fm-links:empty,
.fm-links[hidden],
.fm-review:empty {
  display: none;
}
.fm-rail {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.fm-page .fm-room {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  font-size: 0.8rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  background: var(--fm-layer);
}
.fm-page .fm-room[aria-pressed='true'] {
  background: var(--fm-tint);
  color: var(--fm-accent);
  border-color: var(--fm-accent);
}
.fm-icon {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.fm-icon svg {
  width: 17px;
  height: 17px;
}
@media (max-width: 760px) {
  .fm-page {
    gap: 12px;
  }
  .fm-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .fm-stage {
    height: clamp(250px, 76vw, 415px);
  }
  .fm-pin {
    max-width: 82px !important;
  }
  .fm-inspector {
    padding: 14px;
    gap: 10px;
  }
  .fm-world-head,
  .fm-world-foot {
    padding: 7px 10px;
  }
  .fm-rail {
    flex-wrap: nowrap;
    overflow: auto;
    padding: 3px;
    margin: -3px;
    scrollbar-width: thin;
  }
  .fm-page .fm-room {
    flex: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fm-page * {
    scroll-behavior: auto;
  }
}

.fm-page .fm-heading h2 {
  color: var(--text, #eef1f0);
  text-transform: none;
  letter-spacing: -0.045em;
}
@media (max-width: 760px) {
  .fm-page {
    gap: 10px;
  }
  .fm-stage {
    height: clamp(190px, 55vw, 330px);
  }
  .fm-world-head,
  .fm-world-foot {
    padding: 4px 9px;
  }
  .fm-world .fm-modes,
  .fm-world .fm-view-controls {
    padding: 0;
  }
  .fm-inspector {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
  }
  .fm-inspector > *,
  .fm-inspector .fm-power > * {
    grid-column: 1/-1;
  }
  .fm-inspector > .fm-field {
    grid-column: 1;
    grid-row: 1;
  }
  .fm-inspector .fm-power {
    display: contents;
  }
  .fm-inspector .fm-power[hidden] {
    display: none;
  }
  .fm-inspector .fm-power > h3 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .fm-inspector .fm-switches {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    flex-wrap: nowrap;
    gap: 5px;
  }
  .fm-inspector .fm-switches button {
    padding: 8px 10px;
  }
  .fm-page .fm-pin-chip {
    font-size: 0.63rem;
    min-height: 19px;
    padding: 2px 5px;
  }
}
