.fe {
  padding: 28px 0;
}
.fe-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.fe h1 {
  font-family: Georgia, serif;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: normal;
  line-height: 1.2;
  margin: 10px 0;
}
.fe p {
  color: var(--muted);
}
.fe-kicker {
  color: var(--blue);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: bold;
}
.fe-layout {
  --settings-width: 230px;
  --library-width: 280px;
  display: grid;
  grid-template-columns: var(--settings-width) minmax(0, 1fr) var(--library-width);
  gap: 18px;
  align-items: start;
}
.fe-layout.fe-settings-collapsed {
  grid-template-columns: minmax(0, 1fr) var(--library-width);
}
.fe-layout.fe-library-collapsed {
  grid-template-columns: var(--settings-width) minmax(0, 1fr);
}
.fe-layout.fe-settings-collapsed.fe-library-collapsed {
  grid-template-columns: minmax(0, 1fr);
}
.fe-sidebar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.fe-sidebar-controls button {
  font-size: 12px;
}
.fe-panel[hidden] {
  display: none;
}
.fe-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}
.fe h2 {
  font-size: 17px;
  margin: 0 0 20px;
}
.fe h3 {
  font-size: 14px;
  margin: 0;
}
.fe label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.fe input,
.fe select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 8px;
  padding: 9px;
}
.fe button {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 9px;
}
.fe button:hover:not(:disabled) {
  border-color: var(--blue);
}
.fe button:disabled {
  opacity: 0.45;
}
.fe .fe-primary {
  background: var(--btn);
  color: var(--btntext);
  font-weight: bold;
  padding: 13px 20px;
}
.fe-note,
.fe-source {
  font-size: 12px;
  line-height: 1.6;
}
.fe a {
  color: var(--blue);
}
.fe-row-heading,
.fe-history,
.fe-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.fe-row-heading {
  margin: 24px 0 12px;
}
.fe-row-heading span {
  font-size: 11px;
  color: var(--muted);
}
.fe-row-control {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.fe-row-top {
  display: flex;
  align-items: center;
  gap: 7px;
}
.fe-row-top strong {
  margin-right: auto;
  font-size: 12px;
}
.fe-row-top input {
  width: 54px;
  padding: 6px;
}
.fe-row-top button {
  padding: 5px 9px;
}
.fe-row-control label {
  margin: 8px 0 0;
  font-size: 11px;
  flex-direction: row;
  align-items: center;
}
.fe-row-control input[type="range"] {
  padding: 0;
  min-width: 0;
  accent-color: var(--btn);
}
.fe-history {
  justify-content: center;
  margin-top: 16px;
}
.fe-workspace {
  min-width: 0;
}
.fe-stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 12px;
  font-size: 12px;
  color: var(--muted);
}
.fe-stage-scroll {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.fe-stage {
  padding: 25px 12px 0;
  position: relative;
  min-width: 540px;
  background: radial-gradient(
    ellipse at 50% 100%,
    var(--soft),
    transparent 70%
  );
}
.fe .fe-stage-title {
  text-align: center;
  font:
    26px Georgia,
    serif;
  margin: 0 0 20px;
  overflow-wrap: anywhere;
}
.fe-back-label,
.fe-front-label {
  text-align: center;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 2px;
  padding: 12px;
}
.fe-front-label {
  border-top: 2px solid var(--line);
  border-radius: 50% 50% 0 0;
  padding: 22px 0;
  margin-top: 15px;
}
.fe-stage-row {
  height: 135px;
  position: relative;
  border-top: 1px dashed color-mix(in srgb, var(--line) 40%, transparent);
}
.fe-row-tag {
  position: absolute;
  top: 5px;
  left: 0;
  font-size: 9px;
  color: var(--muted);
}
.fe .fe-slot {
  position: absolute;
  top: 20px;
  transform: translateX(-50%);
  width: 72px;
  min-height: 105px;
  padding: 0;
  background: transparent;
  border: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
}
.fe-slot .member-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 19px;
}
.fe .member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.fe-slot-name {
  font-size: 10px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  max-width: 74px;
}
.fe-slot small {
  font-size: 9px;
  color: var(--muted);
}
.fe-slot[data-center="true"] .member-photo {
  border: 2px solid var(--blue);
  box-shadow: 0 0 0 3px var(--soft);
}
.fe-slot[data-center="true"] small {
  color: var(--blue);
}
.fe button[aria-pressed="true"] {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.fe-stage[data-style="card"] .member-photo {
  border-radius: 6px;
  height: 74px;
}
.fe-stage[data-style="card"] .fe-stage-row {
  height: 152px;
}
.fe-selection {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 14px;
  margin-top: 16px;
}
.fe-selection-text {
  font-size: 13px;
}
.fe-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.fe-selection-actions button {
  font-size: 11px;
  padding: 7px 9px;
}
.fe-status {
  font-size: 12px;
  min-height: 20px;
}
.fe-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fe-tray {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fe .fe-member {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  padding: 10px 5px;
  font-size: 11px;
  line-height: 1.3;
  background: var(--bg);
  overflow-wrap: anywhere;
}
.fe-member .member-photo {
  width: 53px;
  height: 62px;
  overflow: hidden;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
}
.fe-member small {
  font-size: 9px;
  color: var(--muted);
}
.fe-pagination {
  margin-top: 16px;
  font-size: 11px;
}
.fe-pagination button {
  padding: 6px;
  font-size: 11px;
}
.fe-import,
.fe-apply,
.fe-add-row {
  width: 100%;
}
.fe-library {
  max-height: 950px;
  overflow: auto;
}
.fe-empty {
  grid-column: 1/-1;
  font-size: 13px;
}
#app-formation {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  padding: 7px 12px;
}
.fe-stage-scroll:focus-visible {
  outline: 2px solid var(--blue);
}
#app:has(#oshi-formation:not([hidden])) {
  max-width: 1600px;
}
.fe-position-control {
  margin-top: 16px !important;
}
.fe-position-x {
  accent-color: var(--btn);
}
.fe-tools {
  padding: 14px;
  border: 1px solid var(--blue);
  background: var(--soft);
  border-radius: 12px;
  margin: 16px 0 12px;
}
.fe-mode-switch,
.fe-arrange-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.fe-mode-switch button {
  flex: 1;
  font-weight: bold;
}
.fe .fe-mode-switch button[aria-pressed="true"] {
  background: var(--btn);
  color: var(--btntext);
  outline: none;
  border-color: var(--btn);
}
.fe .fe-mode-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--ink);
}
.fe .fe-selection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  margin: 0 0 16px;
  box-shadow: 0 8px 24px var(--shadow);
}
.fe-position-actions-main {
  min-width: 0;
}
.fe-view-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.fe-view-actions button {
  font-size: 11px;
  white-space: nowrap;
}
.fe-selection > .fe-position-control,
.fe-selection > .fe-arrange-controls {
  grid-column: 1 / -1;
}
@media (max-width: 520px) {
  .fe .fe-selection {
    grid-template-columns: minmax(0, 1fr);
  }
  .fe-view-actions {
    flex-direction: row;
    justify-content: flex-end;
    margin-top: 14px;
    padding: 12px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
.fe-arrange-controls {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.fe-arrange-actions button {
  font-size: 12px;
}
.fe-arrange-prompt,
.fe-gap-note {
  font-size: 12px;
}
.fe .fe-gap-control {
  margin: 14px 0 0;
}
.fe-gap-size {
  accent-color: var(--btn);
}
.fe[data-edit-mode="arrange"] .fe-stage-row {
  background-image:
    linear-gradient(
      to right,
      transparent calc(50% - 1px),
      var(--line) 50%,
      transparent calc(50% + 1px)
    ),
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(10% - 1px),
      color-mix(in srgb, var(--line) 22%, transparent) 10%
    );
}
.fe[data-edit-mode="arrange"] .fe-slot {
  touch-action: none;
  cursor: ew-resize;
  user-select: none;
}
.fe[data-edit-mode="arrange"] .fe-slot::before {
  content: "↔";
  position: absolute;
  top: -20px;
  color: var(--blue);
  font-size: 16px;
}
@media (min-width: 1500px) {
  .fe-layout {
    --settings-width: 240px;
    --library-width: 300px;
  }
  .fe-slot-name {
    font-size: 11px;
  }
}
@media (max-width: 1150px) {
  .fe-layout,
  .fe-layout.fe-library-collapsed {
    --settings-width: 200px;
    grid-template-columns: var(--settings-width) minmax(0, 1fr);
  }
  .fe-layout.fe-settings-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
  .fe-library {
    grid-column: 1/-1;
    max-height: none;
  }
  .fe-tray {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .fe-filters {
    max-width: 500px;
  }
  .fe-library > .fe-import {
    width: auto;
  }
}
@media (max-width: 720px) {
  .fe-layout {
    display: flex;
    flex-direction: column;
  }
  .fe-workspace {
    width: 100%;
    order: 0;
  }
  .fe-settings {
    width: 100%;
    order: 1;
  }
  .fe-library {
    width: 100%;
    order: 2;
  }
  .fe-heading {
    align-items: flex-start;
  }
  .fe-heading p {
    font-size: 12px;
  }
  .fe .fe-primary {
    white-space: nowrap;
    padding: 10px;
  }
  .fe-tray {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fe-row-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .fe-heading {
    gap: 10px;
  }
  .fe-stage {
    min-width: 540px;
  }
}
