:root {
  color-scheme: dark;
  font-family: Inter,Segoe UI,system-ui,Arial,sans-serif;
  background: #10141b;
  color: #e6e9f1;
  --panel: #1b222d;
  --line: #343d4c;
  --muted: #a5b0c1;
  --accent: #a995df;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,input,select {
  font: inherit;
}
button {
  background: #303949;
  color: #e8e8f1;
  border: 1px solid #465166;
  border-radius: 8px;
  padding: 9px 13px;
  cursor: pointer;
}
button:hover {
  background: #45516a;
}
button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
button.primary {
  background: #7864a9;
  border-color: #7864a9;
  color: #fff;
}
button.primary:hover {
  background: #9079bf;
}
button.full {
  width: 100%;
}
.top {
  background: #181f2a;
  border-bottom: 1px solid var(--line);
  padding: 13px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.top span {
  color: #b6a4ed;
}
.top nav {
  display: flex;
  gap: 6px;
}
.top nav button {
  font-size: 13px;
}
main {
  max-width: 1680px;
  margin: 24px auto;
  padding: 0 24px;
}
h1 {
  font-size: 25px;
  margin: 0 0 9px;
}
h2 {
  font-size: 18px;
  margin: 0 0 12px;
}
h3 {
  font-size: 15px;
  margin: 0 0 12px;
}
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 22px 0;
}
article,.op,.inspector {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 19px;
  margin-bottom: 14px;
}
input:not([type=checkbox]),select {
  background: #111721;
  border: 1px solid #414b5a;
  color: #e6e9f1;
  border-radius: 7px;
  padding: 10px;
  width: 100%;
  margin: 5px 0 12px;
  min-width: 0;
}
input:focus,select:focus,button:focus-visible {
  outline: 2px solid #a995df;
  outline-offset: 1px;
}
.hint,small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.eyebrow {
  color: #b6a4ed;
  letter-spacing: .1em;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 5px;
}
#message:not(:empty) {
  padding: 13px 16px;
  border: 1px solid #695c92;
  background: #29243c;
  border-radius: 8px;
  margin-bottom: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.op,.inline,.split-heading,.operation-head,.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.inline input {
  flex: 1;
}
.operation-head {
  margin: 0 0 17px;
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.state-pill {
  font-size: 12px;
  border: 1px solid #51645b;
  background: #21362c;
  color: #c5e3d0;
  border-radius: 20px;
  padding: 6px 11px;
}
.state-pill.offline {
  background: #422a30;
  border-color: #84535e;
  color: #f1b7c1;
}
.workspace-tabs {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tab {
  border: 0;
  background: transparent;
  border-radius: 7px 7px 0 0;
  padding: 12px 15px;
  white-space: nowrap;
  color: #b3bece;
}
.tab.active {
  background: #252e3b;
  color: #f2eaff;
  box-shadow: inset 0 -2px #b6a4ed;
}
.workspace-shell {
  display: grid;
  grid-template-columns: minmax(0,1fr) 360px;
  align-items: start;
  gap: 18px;
}
.work-main {
  min-width: 0;
}
.work-page[hidden],section[hidden],div[hidden] {
  display: none!important;
}
.inspector {
  position: sticky;
  top: 18px;
  margin: 0;
  min-height: 380px;
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.inspector-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
  margin-bottom: 15px;
}
.inspector-header h2 {
  margin: 0;
}
.inspector-content {
  font-size: 14px;
}
.inspector-content .detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #303b49;
}
.inspector-content .detail-row span:first-child {
  color: var(--muted);
}
.inspector-content .detail-row span:last-child {
  text-align: right;
}
.inspector-content label {
  display: block;
  margin: 13px 0 4px;
  font-size: 13px;
}
.inspector-content select {
  margin-bottom: 7px;
}
.inspector-content .danger {
  margin-top: 20px;
  color: #ffbdc2;
  border-color: #74434b;
  background: #3b252d;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
}
.stat-grid article {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-grid strong {
  font-size: 28px;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.fleet-layout {
  display: grid;
  grid-template-columns: minmax(240px,300px) minmax(0,1fr);
  gap: 14px;
}
.fleet-layout article {
  margin-bottom: 0;
}
.scroll-list {
  max-height: 320px;
  overflow: auto;
  margin: 12px 0;
}
.model-item,.ship-card,.person-card,.manifest-item {
  display: block;
  width: 100%;
  text-align: left;
  background: #222b38;
  border: 1px solid #394657;
  border-radius: 9px;
  margin: 6px 0;
  padding: 12px;
  color: #e6e9f1;
}
.model-item.active,.ship-card.active,.person-card.active {
  border-color: #b6a4ed;
  background: #35314a;
}
.ship-card small,.model-item small,.person-card small {
  display: block;
  margin-top: 4px;
}
.fleet-canvas {
  min-height: 450px;
}
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(180px,1fr));
  gap: 8px;
}
.page-heading {
  margin-bottom: 16px;
}
.page-heading p {
  margin: 0 0 10px;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  line-height: 1.4;
}
.field-label {
  font-size: 13px;
  color: var(--muted);
}
.empty {
  padding: 24px;
  text-align: center;
  border: 1px dashed #485367;
  border-radius: 9px;
  color: var(--muted);
}
.chip {
  display: inline-block;
  padding: 5px 10px;
  margin: 4px;
  background: #303849;
  border-radius: 7px;
}
.station-pill {
  display: inline-block;
  border: 1px solid #455366;
  padding: 4px 8px;
  border-radius: 7px;
  margin: 3px;
  font-size: 12px;
}
.station-pill.filled {
  border-color: #637d72;
  color: #c3dfcd;
}
.manifest-item {
  cursor: default;
}
.section-head {
  margin-bottom: 16px;
}
@media(max-width:1100px) {
  .workspace-shell {
    grid-template-columns: minmax(0,1fr) 300px;
  }
  .fleet-layout {
    grid-template-columns: 1fr;
  }
  .scroll-list {
    max-height: 180px;
  }
}
@media(max-width:750px) {
  main {
    padding: 0 12px;
  }
  .cols,.workspace-shell,.stat-grid {
    grid-template-columns: 1fr;
  }
  .top,.operation-head {
    flex-wrap: wrap;
  }
  .inspector {
    position: static;
    max-height: none;
  }
  .workspace-tabs {
    margin-bottom: 12px;
  }
}
/* v6.2 scrollable active library and neutral ship placeholders */
.library {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.library #shipSearch {
  position: sticky;
  top: 0;
  z-index: 2;
}
.library .scroll-list {
  max-height: min(60vh,650px);
  min-height: 230px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.model-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.model-copy {
  min-width: 0;
}
.ship-placeholder {
  width: 56px;
  height: 39px;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg,#454b55,#272e39);
  border: 1px solid #59616e;
  border-radius: 7px;
  color: #a0a7b0;
  font-size: 30px;
  filter: grayscale(1);
}
/* Phase 2A: drag-and-drop catalog ships */
.model-item[draggable="true"] {
  cursor: grab;
}
.model-item[draggable="true"]:active {
  cursor: grabbing;
}
#shipList {
  min-height: 250px;
  border: 1px dashed transparent;
  border-radius: 10px;
  padding: 6px;
  transition: background .15s,border-color .15s;
}
#shipList.drag-target {
  background: #302a43;
  border-color: #b6a4ed;
}
/* v6.7: full-canvas drag target and persistent fleet subdivisions */
.fleet-canvas {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  transition: background .15s,border-color .15s;
}
.fleet-canvas.drag-target {
  background: #302a43;
  border-color: #b6a4ed;
  outline: 2px dashed #b6a4ed;
  outline-offset: -6px;
}
#shipList {
  flex: 1;
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.division-toolbar {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.division-toolbar input {
  flex: 1;
  min-width: 0;
}
.fleet-division {
  border: 1px solid #39465a;
  border-radius: 10px;
  padding: 12px;
  min-height: 115px;
  background: rgba(12,18,29,.22);
}
.fleet-division.drag-target {
  outline: 2px dashed #b6a4ed;
  background: #302a43;
}
.division-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.division-heading span {
  font-size: 12px;
  color: #9bacc7;
}
.division-delete {
  margin-left: auto;
  font-size: 12px;
}
.division-ships {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.division-empty {
  color: #8092ad;
  font-size: 13px;
  padding: 15px;
  text-align: center;
}
/* v6.8: visually distinct, automatically hidden when empty */
.unassigned-division {
  background: rgba(114,83,49,.15);
  border-color: #766045;
}
.unassigned-division .division-heading b {
  color: #e2c59d;
}
.crew-summary,.crew-pool {
  border: 1px solid var(--line);
  background: #1b222d;
  border-radius: 11px;
  padding: 16px;
  margin-bottom: 14px;
}
.readiness-groups,.crew-pool-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.readiness-chip {
  border: 1px solid #536579;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
}
.crew-warnings {
  margin-top: 12px;
  padding: 12px;
  background: #302822;
  border: 1px solid #796042;
  border-radius: 8px;
  color: #eed0ad;
}
.crew-warnings ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.crew-person {
  cursor: grab;
  text-align: left;
}
.crew-person small {
  display: block;
}
.crew-stations {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(190px,1fr));
  gap: 9px;
  margin-top: 12px;
}
.crew-station {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  position: relative;
  border: 1px dashed #536079;
  border-radius: 9px;
  padding: 12px;
  min-height: 80px;
  background: #171f2a;
}
.crew-station span {
  color: #aebed0;
  font-size: 13px;
}
.crew-station.filled {
  border-style: solid;
  border-color: #577b68;
}
.crew-station.crew-drag-target {
  outline: 2px solid #b6a4ed;
  background: #343047;
}
.crew-station button {
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 2px 7px;
}
/* v6.9: compact, page-following ship picker. The list scrolls independently
   while the library remains visible as the fleet composition grows. */
@media (min-width:1101px) {
  .fleet-layout {
    align-items: start;
  }
  .fleet-layout>.library {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow: hidden;
  }
  .library .scroll-list {
    flex: 1;
    min-height: 80px;
    max-height: none;
    overflow-y: auto;
  }
}
.library {
  gap: 0;
  padding: 13px;
}
.library h3 {
  margin-bottom: 7px;
}
.library #shipSearch {
  margin: 2px 0 8px;
  padding: 8px 10px;
}
.library .check {
  font-size: 12px;
  margin: 2px 0;
}
.library .scroll-list {
  margin: 7px 0 10px;
}
.library .model-item {
  gap: 8px;
  padding: 5px 7px;
  margin: 3px 0;
  border-radius: 7px;
  min-height: 43px;
}
.library .ship-placeholder {
  width: 43px;
  height: 30px;
  border-radius: 5px;
  font-size: 23px;
}
.library .ship-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.library .model-copy b {
  font-size: 12px;
  line-height: 1.25;
  display: block;
}
.library .model-copy small {
  font-size: 10px;
  line-height: 1.2;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.library .model-copy {
  overflow: hidden;
  flex: 1;
}
.library select {
  padding: 7px 8px;
  margin: 3px 0 7px;
  font-size: 12px;
}
.library .field-label,.library #ownershipHint {
  font-size: 11px;
}
.library #shipAdd {
  padding: 8px;
  font-size: 12px;
}
@media(max-width:1100px) {
  .fleet-layout>.library {
    position: static;
    max-height: none;
  }
  .library .scroll-list {
    max-height: 240px;
    min-height: 100px;
  }
}
/* v6.11 multi-selection and header */
.top .global-nav {
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: center;
}
.top .nav-left,.top .nav-right {
  display: flex;
  gap: 8px;
}
.fleet-canvas {
  position: relative;
  touch-action: pan-y;
}
.fleet-marquee {
  position: absolute;
  pointer-events: none;
  z-index: 12;
  background: rgba(169,144,219,.19);
  border: 1px solid #b6a4ed;
  border-radius: 4px;
}
.ship-card.multi-selected {
  outline: 2px solid #b6a4ed!important;
  background: #302a46!important;
}
.fleet-selection-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid #75618f;
  background: #252036;
  border-radius: 9px;
  margin: 12px 0;
}
.fleet-selection-toolbar[hidden] {
  display: none;
}
.fleet-selection-toolbar span {
  margin-right: auto;
  font-weight: 600;
}
#opCodeField {
  min-width: 230px;
  flex: 1;
}
.fleet-canvas .division-ships {
  min-height: 44px;
}
/* v6.12 compact responsive crew cards */
.crew-ship-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
  align-items: start;
}
.crew-ship-grid>.crew-ship {
  margin: 0;
  padding: 11px 12px;
  min-width: 0;
}
.crew-ship-grid>.crew-wide {
  grid-column: 1/-1;
}
.crew-ship .ship-card {
  padding: 6px 8px;
  margin: 0;
  min-width: 0;
}
.crew-ship .split-heading {
  gap: 8px;
}
.crew-ship .crew-stations {
  grid-template-columns: repeat(auto-fit,minmax(125px,1fr));
  gap: 6px;
  margin-top: 7px;
}
.crew-ship .crew-station {
  min-height: 46px;
  padding: 7px 28px 7px 9px;
  gap: 3px;
  font-size: 12px;
}
.crew-ship .crew-station span {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.masked-code {
  display: flex;
  align-items: center;
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #414b5a;
  background: #111721;
  border-radius: 7px;
  letter-spacing: .07em;
  user-select: none;
}
@media(max-width:1050px) {
  .crew-ship-grid {
    grid-template-columns: 1fr;
  }
}
/* Admin code controls can wrap onto a second line. */
#adminOps .op {
  flex-wrap: wrap;
}
#adminOps .admin-code-panel {
  flex-basis: 100%;
}
/* v7.1: carrier ship cards accept fleet-ship drops and display their cargo */
.ship-card.carrier-card {
  border-color: #637a85;
  background: #202e39;
}
.ship-card.carrier-drop-target {
  outline: 3px dashed #b6a4ed!important;
  background: #353049!important;
}
.carrier-hint {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  color: #b6c6dc;
}
.carrier-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.carrier-child {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  background: #14222e;
  border: 1px solid #465e6d;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}
.carrier-unload {
  font-size: 17px;
  font-weight: 700;
  color: #f0b6bb;
  padding: 0 3px;
}
.carrier-empty,.loaded-label {
  font-size: 12px;
  color: #a5b0c1;
}
.loaded-label {
  display: block;
  margin-top: 5px;
}
/* v7.2: hierarchical carrier presentation on Fleet and Crew pages */
.fleet-ship-wrapper {
  position: relative;
  min-width: 0;
}
.fleet-ship-wrapper>.ship-card {
  width: 100%;
  text-align: left;
}
.fleet-carrier-bay {
  margin: 5px 0 5px 14px;
  padding: 8px 8px 8px 12px;
  border-left: 2px solid #7b89a2;
  background: rgba(114,129,159,.07);
  border-radius: 0 8px 8px 0;
  display: grid;
  gap: 6px;
}
.fleet-carried-wrapper {
  padding-right: 0;
}
.fleet-carrier-bay.carrier-drop-target {
  outline: 2px dashed #b6a4ed;
  background: rgba(182,164,237,.14);
}
.crew-carrier-bay {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #455367;
  background: rgba(12,18,27,.35);
}
.crew-carrier-heading {
  font-size: 12px;
  font-weight: 700;
  color: #b5c5d9;
  margin-bottom: 8px;
}
.crew-carrier-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
}
.crew-carried-ship {
  min-width: 0;
  margin: 0!important;
  padding: 9px!important;
}
.crew-carrier-grid>.crew-wide {
  grid-column: 1/-1;
}
@media(max-width:850px) {
  .crew-carrier-grid {
    grid-template-columns: 1fr;
  }
}
.embarked-group {
  border-top: 1px solid var(--border,#384151);
  padding: 10px 0;
  margin-top: 8px;
}
.embarked-drop {
  border: 1px dashed #778195;
  padding: 12px;
  margin-top: 8px;
  border-radius: 6px;
}
.manifest-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: monospace;
}
#rosterPaste {
  width: 100%;
  margin: 10px 0;
}
#manifestParts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
/* v7.4.1 compact embarked personnel and nested crew layout */
.crew-ship .split-heading>.ship-card {
  flex: 1;
  min-width: 0;
  width: auto;
}
.crew-fill-count {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 11px;
  color: #aebed0;
}
.crew-ship .crew-stations {
  grid-template-columns: repeat(auto-fit,minmax(min(100%,160px),1fr));
}
.crew-ship .crew-station:not(.filled) {
  padding-right: 9px;
}
.crew-station b {
  overflow-wrap: anywhere;
  max-width: 100%;
}
.crew-carrier-grid {
  grid-template-columns: repeat(auto-fit,minmax(min(100%,340px),1fr));
}
.embarked-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 0 0;
  margin-top: 8px;
}
.embarked-group>b {
  flex-basis: 100%;
  font-size: 12px;
  color: #b5c5d9;
  margin-bottom: 2px;
}
.embarked-member {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 5px 7px 5px 9px;
  border: 1px solid #577b68;
  background: #171f2a;
  border-radius: 7px;
  font-size: 12px;
}
.embarked-member span {
  overflow-wrap: anywhere;
  min-width: 0;
}
.embarked-member button {
  padding: 1px 6px;
  font-size: 12px;
  line-height: 18px;
  min-height: 0;
  border-radius: 5px;
}
.embarked-drop {
  flex-basis: 100%;
  margin: 0;
  padding: 7px 9px;
  font-size: 12px;
  color: #aebed0;
  background: #171f2a;
}
.embarked-drop.crew-drag-target {
  outline: 2px solid #b6a4ed;
  background: #343047;
}
/* v7.4.2: shared subsection treatment */
.embarked-group.crew-carrier-bay {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #455367;
  border-radius: 8px;
  background: rgba(12,18,27,.35);
}
.embarked-group>.crew-carrier-heading {
  flex-basis: 100%;
  margin-bottom: 2px;
}
.embarked-member[draggable=true] {
  cursor: grab;
}
.embarked-member[draggable=true]:active {
  cursor: grabbing;
}
/* Collapsible ship subsections */
details.shelf {
  display: block;
}
details.shelf>summary {
  cursor: pointer;
  user-select: none;
  list-style: revert;
  display: list-item;
  margin: 0;
  padding: 2px 0;
}
details.shelf[open]>summary {
  margin-bottom: 8px;
}
details.shelf:not([open])> :not(summary) {
  display: none!important;
}
.fleet-shelf-content {
  display: grid;
  gap: 6px;
}
.embarked-shelf-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.embarked-shelf-content>.embarked-drop {
  flex-basis: 100%;
}
/* Parent ship shelves: header remains selectable; marker toggles shelf. */
details.ship-parent-shelf>summary.ship-parent-summary {
  padding: 0 0 0 2px;
  list-style-position: outside;
  margin-left: 12px;
  color: #b5c5d9;
}
.ship-parent-summary>.split-heading {
  display: inline-flex;
  vertical-align: middle;
  width: calc(100% - 4px);
  margin: 0;
}
.crew-ship-grid,.crew-carrier-grid {
  align-items: start;
}
/* v7.4.5: complete ship containers and expanded carried ship cards */
.crew-ship-grid > .crew-ship, .crew-carrier-grid > .crew-ship {
  border: 1px solid #3c485a;
  border-radius: 12px;
  background: #1a212c;
  box-sizing: border-box;
  min-width: 0;
}
.crew-ship-grid > .crew-ship {
  padding: 12px!important;
}
.crew-carrier-grid > .crew-ship {
  background: #202833;
  padding: 10px!important;
}
.crew-ship-grid > details.ship-parent-shelf > summary.ship-parent-summary {
  list-style-position: inside;
  margin-left: 0;
  padding: 0;
}
.ship-parent-summary > .split-heading {
  width: calc(100% - 20px);
}
.crew-carried-ship > .ship-parent-summary > .split-heading {
  display: flex;
  width: 100%;
}
.crew-carrier-bay {
  background: #151c26;
}
.roster-preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}
.roster-preview-grid {
  display: grid;
  gap: 8px;
}
.roster-category {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #151b24;
}
.roster-category label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.roster-category label small {
  margin-left: auto;
}
.roster-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.roster-names span {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 13px;
}
.person-card-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
}
.person-card-select {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: none;
  border: 0;
  padding: 4px;
  overflow-wrap: anywhere;
}
.person-card-remove {
  flex: none;
  padding: 2px 7px;
  font-size: 14px;
  line-height: 20px;
}
.person-card-remove:hover {
  border-color: #d08080;
  color: #ffaaaa;
}
/* v7.4.7: keep personnel selection surface visually flat, including hover. */
.person-card-wrap > .person-card-select,
.person-card-wrap > .person-card-select:hover,
.person-card-wrap > .person-card-select:active,
.person-card-wrap > .person-card-select:focus {
  background: transparent;
  box-shadow: none;
  border: 0;
}
.person-card-wrap > .person-card-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.fleet-parent-shelf {
  border: 1px solid #414c5e;
  border-radius: 10px;
  padding: 8px;
  background: #1a212c;
}
.fleet-parent-shelf>summary.fleet-parent-summary {
  display: list-item;
  list-style-position: outside;
  margin-left: 14px;
  padding: 0;
  color: #b5c5d9;
}
.fleet-parent-summary>.ship-card {
  display: inline-block;
  width: 100%;
  vertical-align: middle;
  text-align: left;
}
.fleet-parent-shelf:not([open])>summary {
  margin-bottom: 0;
}
.fleet-carrier-bay>summary {
  cursor: pointer;
}
.owner-options {
  display: grid;
  gap: 6px;
  margin: 8px 0 16px;
}
.owner-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #414c5e;
  border-radius: 6px;
  margin: 0;
}
.owner-options input {
  width: auto;
  margin: 0;
}
.owner-options small {
  margin-left: auto;
  color: #aab8ca;
}
/* v7.4.11 — shared spacing rhythm; compact nested controls. */
:root {
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
}
article,.inspector {
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}
.inspector,.fleet-layout article {
  margin-bottom: 0;
}
h1,h2,h3 {
  line-height: 1.35;
}
h2,h3 {
  margin: 0 0 var(--space-md);
}
article p,.inspector p {
  margin: 0 0 var(--space-md);
}
article p:last-child,.inspector p:last-child {
  margin-bottom: 0;
}
button,input,select,textarea {
  line-height: 1.4;
}
input:not([type=checkbox]):not([type=radio]),select,textarea {
  margin: 0 0 var(--space-md);
  padding: 8px 10px;
  min-height: 36px;
}
textarea {
  font: inherit;
  color: inherit;
  background: #111721;
  border: 1px solid #414b5a;
  border-radius: 7px;
  resize: vertical;
}
input[type=checkbox],input[type=radio] {
  flex: none;
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}
button {
  padding: 8px 12px;
}
.inline,.division-toolbar,.split-heading,.button-row {
  gap: var(--space-sm);
}
.inline,.division-toolbar {
  align-items: center;
}
.inline>input:not([type=checkbox]),.division-toolbar>input {
  margin: 0;
  min-width: 0;
}
.inline>button,.division-toolbar>button {
  flex: none;
}
.division-toolbar {
  margin: var(--space-md) 0;
}
.split-heading>h3 {
  margin: 0;
}
article>.split-heading {
  margin-bottom: var(--space-md);
}
.inspector-header {
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
}
.inspector-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.inspector-content>h3 {
  margin: var(--space-lg) 0 var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--line);
}
.inspector-content>h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.inspector-content .detail-row {
  align-items: center;
  min-height: 32px;
  padding: var(--space-sm) 0;
  gap: var(--space-sm);
  border-bottom: 1px solid var(--line);
}
.inspector-content .detail-row>span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.inspector-content .detail-row>button {
  flex: none;
  font-size: 12px;
  padding: 5px 8px;
}
.inspector-content>label {
  margin: var(--space-sm) 0 var(--space-xs);
  font-size: 13px;
}
.inspector-content>select {
  margin: 0 0 var(--space-xs);
}
.inspector-content>button {
  align-self: flex-start;
  margin: var(--space-sm) 0 0;
}
.inspector-content>.danger {
  margin-top: var(--space-lg);
}
.inspector-content>p.hint {
  margin: var(--space-sm) 0;
}
.inspector-content .owner-options {
  margin: 0;
  gap: var(--space-sm);
}
.inspector-content .owner-options label {
  margin: 0;
  padding: var(--space-sm);
  min-width: 0;
}
.owner-options label span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.owner-options small {
  white-space: nowrap;
}
.inspector-content>label.check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-lg) 0 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--line);
}
.inspector-content .embarked-shelf-content>select {
  margin: 0;
  flex-basis: 100%;
}
.inspector-content .embarked-shelf-content>button {
  font-size: 12px;
  padding: 6px 10px;
}
.library {
  padding: var(--space-md);
}
.library #shipSearch {
  margin: 0 0 var(--space-sm);
}
.library .check {
  margin: var(--space-xs) 0;
}
.library .scroll-list {
  margin: var(--space-sm) 0 0;
}
.library .model-item {
  margin: 0 0 var(--space-xs);
}
#shipList {
  padding: 0;
  gap: var(--space-md);
}
.fleet-division {
  padding: var(--space-md);
}
.division-heading {
  margin-bottom: var(--space-md);
  gap: var(--space-sm);
}
.division-ships,.fleet-shelf-content {
  gap: var(--space-sm);
}
.fleet-ship-wrapper>.ship-card,.fleet-parent-summary>.ship-card {
  margin: 0;
}
.fleet-carrier-bay {
  margin: var(--space-sm) 0 0 var(--space-md);
  padding: var(--space-sm);
  gap: var(--space-sm);
}
.crew-summary,.crew-pool {
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}
.crew-ship .crew-stations {
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.crew-carrier-bay,.embarked-group.crew-carrier-bay {
  margin-top: var(--space-md);
  padding: var(--space-sm);
}
.crew-carrier-grid,.embarked-shelf-content {
  gap: var(--space-sm);
}
.crew-station button,.embarked-member button,.person-card-remove {
  padding: 2px 6px;
  line-height: 18px;
  font-size: 12px;
}
.people-grid {
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.people-grid>.person-card {
  margin: 0;
}
#rosterPaste {
  display: block;
  margin: var(--space-sm) 0;
}
#rosterResults:not(:empty) {
  margin-top: var(--space-md);
}
#rosterResults>button {
  margin-top: var(--space-md);
}
.roster-preview-title {
  margin: 0 0 var(--space-sm);
}
#manifestList {
  margin: 0;
  padding: var(--space-md);
  background: #111721;
  border: 1px solid var(--line);
  border-radius: 8px;
}
#manifestParts:not(:empty),#shareList:not(:empty) {
  margin-top: var(--space-md);
}
[data-page=sharing] article>label,#admin article>label {
  display: block;
  margin: 0 0 var(--space-xs);
  font-size: 13px;
}
#admin article>h2:not(:first-child) {
  margin-top: var(--space-lg);
}
#admin hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-lg) 0;
}
#admin .inline {
  flex-wrap: wrap;
  justify-content: flex-start;
}
.stat-grid article {
  margin-bottom: var(--space-md);
}
@media(max-width:750px) {
  article,.inspector {
    padding: var(--space-md);
  }
  .division-toolbar,.inline {
    flex-wrap: wrap;
  }
  .division-toolbar>input,.inline>input {
    flex-basis: 100%;
  }
  .inspector {
    min-height: 0;
  }
  .top {
    padding: var(--space-md);
  }
  .head-actions {
    flex-wrap: wrap;
  }
}
.manifest-text {
  line-height: 1.55;
  padding: 16px;
  tab-size: 2;
}
#viewerLinkBox:not([hidden]) {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
#viewerLink {
  width: 100%;
  min-width: 0;
}
/* v7.5.1: scoped administrator workspace */
#admin {
  max-width: 1280px;
  margin: auto;
}
#admin .admin-tabs {
  margin-top: 20px;
}
#admin .admin-stat-grid,#admin .admin-import-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(230px,1fr));
  gap: 16px;
}
#admin .admin-stat-grid article {
  display: grid;
  gap: 8px;
}
#admin .admin-stat-grid strong {
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}
#admin .admin-filters {
  display: grid;
  grid-template-columns: minmax(0,2fr) minmax(0,1fr);
  gap: 12px;
  margin: 12px 0;
}
#admin .admin-filters input,#admin .admin-filters select {
  margin: 0;
}
#adminOps .op {
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
#adminOps .op>span:last-of-type {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#adminOps .op button {
  font-size: 12px;
  padding: 7px 10px;
}
#admin .admin-image-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
#admin .admin-image-row small {
  display: block;
  overflow-wrap: anywhere;
}
#admin .image-state {
  font-size: 12px;
  color: #d9bd8e;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
}
#admin .image-state.cached {
  color: #a7d4b8;
}
#admin .image-match {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 8px;
}
#admin .image-match select {
  margin: 0;
  flex: 1;
}
#admin .admin-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}
#admin progress {
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
}
#admin details summary {
  cursor: pointer;
  color: var(--accent);
  margin-bottom: 12px;
}
#admin .audit-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
@media(max-width:650px) {
  #admin .admin-filters,#admin .audit-row {
    grid-template-columns: 1fr;
  }
  #admin .admin-import-grid {
    grid-template-columns: 1fr;
  }
}
/* v7.5.2: full-colour official thumbnails, generic role images in grayscale. */
.ship-placeholder {
  filter: none;
  overflow: hidden;
}
.ship-placeholder.generic-image {
  filter: grayscale(1);
}
.ship-placeholder img,.library .ship-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ship-card:has(>.ship-placeholder),.fleet-parent-summary>.ship-card:has(>.ship-placeholder) {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.ship-card>.ship-placeholder {
  width: 100px;
  height: 56px;
}
.crew-ship .ship-card>.ship-placeholder {
  width: 72px;
  height: 41px;
}
.ship-card-copy {
  display: block;
  min-width: 0;
  flex: 1;
}
.ship-card-copy b,.ship-card-copy small,.ship-card-copy .carrier-hint {
  display: block;
}
.ship-card-copy small {
  overflow-wrap: anywhere;
}
@media(max-width:600px) {
  .ship-card>.ship-placeholder {
    width: 64px;
    height: 36px;
  }
}
.crew-division {
  border: 1px solid #394353;
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
}
.crew-division>summary {
  cursor: pointer;
  padding: 4px 0 10px;
}
.crew-division>summary small {
  margin-left: 8px;
}
.crew-filter {
  margin: 12px 0;
}
[hidden] {
  display: none!important;
}
.intel-layout {
  display: grid;
  grid-template-columns: minmax(220px,290px) minmax(0,1fr);
  gap: 16px;
  align-items: start;
}
.intel-layout>article {
  min-width: 0;
}
.intel-layout input,.intel-layout select {
  width: 100%;
  margin-bottom: 8px;
}
.intel-op {
  display: block;
  width: 100%;
  text-align: left;
  margin: 6px 0;
  padding: 12px;
  white-space: normal;
}
.intel-op small,.intel-ship small {
  display: block;
  opacity: .75;
  margin-top: 4px;
}
.intel-op.active {
  border-color: #c4acec;
  background: #343047;
}
.intel-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #ffffff15;
  overflow-wrap: anywhere;
}
.intel-row span {
  text-align: right;
}
.intel-ship {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid #ffffff20;
  border-radius: 8px;
  margin: 8px 0;
  align-items: flex-start;
}
.intel-ship>div {
  flex: 1;
  min-width: 0;
}
.intel-manifest {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.intel-layout progress {
  width: 100%;
}
#intelOps {
  max-height: 65vh;
  overflow: auto;
}
@media(max-width:800px) {
  .intel-layout {
    grid-template-columns: 1fr;
  }
  #intelOps {
    max-height: 250px;
  }
}
/* v7.5.9: distinct teal administrative workspace, scoped to Admin route. */
#logoutBtn[hidden] {
  display: none!important;
}
body.admin-mode {
  --accent: #69c9bd;
}
body.admin-mode .top {
  border-bottom: 2px solid #438d86;
}
body.admin-mode .top>b span {
  color: var(--accent);
}
body.admin-mode #adminBtn {
  color: #b4f1e8;
  background: #24433f;
  border-color: #438d86;
}
body.admin-mode #admin h1 {
  color: var(--accent);
}
body.admin-mode #admin .tab.active {
  background: #203b3a;
  color: #c5f5ee;
  box-shadow: inset 0 -2px var(--accent);
}
body.admin-mode #admin .intel-op.active {
  background: #203b3a;
  border-color: var(--accent);
}
body.admin-mode #admin button.primary,body.admin-mode #loginBtn {
  background: #28665e;
  border-color: #438d86;
  color: #fff;
}
body.admin-mode #admin button.primary:hover,body.admin-mode #loginBtn:hover {
  background: #347d73;
}
body.admin-mode :is(input,select,button):focus-visible {
  outline-color: var(--accent);
}
body.admin-mode #message:not(:empty) {
  background: #203b3a;
  border-color: #438d86;
}
body.admin-mode #admin progress {
  accent-color: var(--accent);
}
.guide-link {
  display: inline-block;
  padding: 8px 12px;
  color: inherit;
  text-decoration: none;
  border: 1px solid #465267;
  border-radius: 7px;
}
.guide-link:hover,.guide-link[aria-current=page] {
  color: #c4acec;
  border-color: #a995df;
}
.guide-layout {
  display: grid;
  grid-template-columns: 220px minmax(0,1fr);
  gap: 20px;
  align-items: start;
}
.guide-nav {
  position: sticky;
  top: 80px;
  padding: 16px;
  border: 1px solid #465267;
  border-radius: 10px;
}
.guide-nav a {
  display: block;
  color: inherit;
  padding: 8px 0;
  text-decoration: none;
}
.guide-section {
  scroll-margin-top: 85px;
  margin-bottom: 16px;
}
.guide-section p {
  line-height: 1.65;
}
@media(max-width:850px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }
  .guide-nav {
    position: static;
  }
}
.division-toolbar>input,.division-toolbar>button {
  height: 40px;
  box-sizing: border-box;
  margin: 0;
  align-self: center;
}
.fleet-marquee {
  position: fixed;
  z-index: 9999;
}
.bulk-inspector-list {
  max-height: 180px;
  overflow: auto;
}
.inspector-content>button {
  margin-top: 4px;
}
/* Consistent global navigation and workspace selection */
.top .global-nav button,.top .global-nav .guide-link {
  font: inherit;
  font-size: 13px;
  line-height: 20px;
  padding: 8px 12px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  color: #e8e8f1;
  background: transparent;
  border: 1px solid #465166;
  border-radius: 8px;
  text-decoration: none;
}
.top .global-nav [aria-current="page"] {
  background: #303949;
  color: var(--accent);
  border-color: var(--accent);
}
.top .global-nav button:hover,.top .global-nav .guide-link:hover {
  background: #45516a;
}
.top .global-nav [hidden] {
  display: none!important;
}
.marquee-selecting,.marquee-selecting * {
  user-select: none!important;
  -webkit-user-select: none!important;
}
.marquee-selecting .fleet-marquee {
  pointer-events: none;
}
.guide-section .guide-synopsis {
  color: #c4acec;
  border-left: 3px solid #a995df;
  padding: 8px 12px;
  background: #a995df0d;
  margin: 8px 0 18px;
}
.guide-section h3 {
  font-size: 15px;
  margin: 18px 0 8px;
}
.guide-section ol {
  padding-left: 24px;
  line-height: 1.65;
}
.guide-section li {
  margin: 6px 0;
}
/* Keep the fleet heading above all three columns. */
@media (min-width: 751px) {
  .workspace-shell.fleet-active {
    grid-template-rows: auto 1fr;
  }
  .fleet-active .work-main, .fleet-active [data-page="fleet"] {
    display: contents;
  }
  .fleet-active [data-page="fleet"] > .page-heading {
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: 0;
  }
  .fleet-active .fleet-layout {
    grid-column: 1;
    grid-row: 2;
  }
  .fleet-active .inspector {
    grid-column: 2;
    grid-row: 2;
  }
}
