﻿:root {
  color-scheme: dark;
  --canvas: #090a0b;
  --surface: #121416;
  --raised: #1b1d20;
  --line: #34363a;
  --ink: #f2f3f3;
  --secondary: #bfc4c8;
  --red: #b00409;
  --accent: #ed6264;
  --action-bg: #331518;
  --action-hover: #48191d;
  --cyan: #51dceb;
  --sfi-text: var(--ink);
  --sfi-muted: var(--secondary);
  --sfi-medical: var(--cyan);
}

body {
  background: radial-gradient(ellipse at 12% 0, #241114 0, transparent 30rem), var(--canvas);
  color: var(--ink);
  font: 16px/1.5 system-ui, sans-serif;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
a, button, summary { text-underline-offset: .2em; }
h1,h2,h3,p { overflow-wrap: anywhere; }
:is(.fleet-content,.module-main,.v3-wrap,.tablewrap,.v3-table-wrap) { min-width: 0; }
:is(.module-shell,.fleet-page) {
  --rail: clamp(224px, 14vw, 292px);
  display: grid;
  grid-template-columns: var(--rail) minmax(0,1fr);
  min-height: 100vh;
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  gap: 0;
}
.module-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: auto;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: auto;
  align-self: start;
  isolation: isolate;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: clamp(15px, 1.4vw, 26px);
  background: linear-gradient(143deg,#4f1217 -10%, transparent 15%), linear-gradient(162deg,#101214 60%, #1c1012);
}
.module-sidebar::after {
  content: 'SFI';
  position: absolute;
  right: 7%;
  bottom: 11rem;
  color: #ffffff09;
  font: italic 900 clamp(3rem,5vw,8rem)/1 system-ui,sans-serif;
  z-index: -1;
  pointer-events: none;
}
.module-logo { display: grid; place-items: center; padding: 0; min-height: 0; margin-bottom: 1.7rem; }
.module-logo img { display: block; width: 78%; max-width: none; height: auto; max-height: 136px; object-fit: contain; }
.module-id { border-left: 3px solid var(--red); padding: .15rem .75rem; margin-bottom: .85rem; }
.module-id strong { color: var(--ink); font-size: clamp(1rem,1.2vw,1.35rem); text-transform: uppercase; }
.module-id span, .module-account small, .module-account>span { color: var(--secondary); }
.module-menu { gap: .25rem; }
.module-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .55rem .75rem;
  color: var(--ink);
  border: 1px solid transparent;
  border-bottom-color: #ffffff10;
  border-radius: 4px;
}
.module-menu a::before { content: ''; width: .46rem; height: .46rem; border: 1px solid currentColor; transform: rotate(45deg); margin-right: .75rem; opacity: .65; }
.module-menu a:is(.selected,:hover) { border-color: var(--red); background: var(--action-bg); color: var(--ink); }
.module-account { margin-top: auto; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.module-account button { margin-top: .65rem; width: 100%; }
.fleet-content,.module-main { width: auto; max-width: none; padding: 0 clamp(18px,1.4vw,46px) 2rem; }
.module-main .v3-wrap { width: 100%; max-width: none; padding: 0; margin: 0; }
.module-topline {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto;
  align-items: center;
  gap: .9rem;
}
.module-topline b { color: var(--secondary); letter-spacing: .16em; font-size: .72rem; font-style: italic; }
.module-topline > span { height: 1px; background: linear-gradient(90deg,transparent,var(--red)); }
.module-topline > span:nth-of-type(2) { transform: rotate(180deg); }
.module-topline > a {
  border: 1px solid var(--line); border-radius: 4px; padding: .45rem .7rem; background: var(--surface); color: var(--ink);
}
.sfi-hero {
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(235px, 29vh, 395px);
  padding: clamp(1.35rem,3vw,4rem);
  margin: 0 0 1.1rem;
  border: 1px solid var(--line);
  border-bottom-color: var(--red);
  clip-path: polygon(16px 0,100% 0,100% calc(100% - 16px),calc(100% - 16px) 100%,0 100%,0 16px);
  color: var(--ink);
  background: linear-gradient(90deg,#090a0bf7 0%,#090a0bd1 23%,#090a0b25 72%),var(--art) center var(--art-position,55%)/cover;
}
.sfi-hero h1 { font-size: clamp(2rem,4.1vw,4.5rem); line-height: 1; text-transform: uppercase; letter-spacing: -.045em; font-style: italic; margin: .35rem 0 .75rem; }
.sfi-hero p { margin: 0; max-width: 34rem; color: #e5e8e9; }
.eyebrow { color: var(--secondary); letter-spacing: .13em; }
.sfi-hero .eyebrow::before,.command-panel h2::before {
  content: ''; background: var(--accent); width: 4px; height: .9em; display: inline-block; transform: skew(-19deg); margin-right: .6rem;
}
.art-fleet,.hub-fleet { --art: url('/img/modules/fleet.webp'); }
.art-logistics,.hub-logistics { --art: url('/img/modules/logistics.webp'); }
.art-blueprints,.hub-blueprints { --art: url('/img/modules/blueprints.webp'); }
.art-inventory,.hub-inventory { --art: url('/img/modules/inventory.webp'); }
.art-medical,.hub-medical { --art: url('/img/modules/medical.webp'); }
.art-medical { --art-position: 48%; }
.hub-module {
  grid-column: auto;
  min-height: clamp(245px,33vh,430px);
  align-content: end;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: linear-gradient(0deg,#090a0b 0%,#090a0bea 20%,#090a0b44 74%), var(--art) center/cover;
}
.hub-module::before,.hub-module::after { content: none; }
.hub-module:hover { border-color: var(--accent); }
.hub-module h2 { font-size: clamp(1.45rem,2vw,2.15rem); margin: 0; }
.hub-module p { color: var(--secondary); }
.hub-symbol { display: none; }
.center-shell { max-width: min(94vw,2500px); margin: 0 auto; }
.center-intro-panel.hub-banner {
  display: grid;
  grid-template-columns: minmax(110px, 155px) 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.6rem;
  background: linear-gradient(110deg,#291418,#111315 45%);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.hub-banner img { width: 100%; max-height: 98px; object-fit: contain; }
.hub-account { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.premium-hub-grid { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 1rem; }
.premium-hub-grid .hub-module { grid-column: span 2; }
.premium-hub-grid .hub-module:nth-child(n+4) { grid-column: span 3; }
.fleet-overview { display: grid; grid-template-columns: 1.35fr 1fr; gap: .9rem; margin-bottom: .9rem; }
.command-panel {
  padding: clamp(.9rem,1.3vw,1.7rem);
  border: 1px solid var(--line);
  border-bottom-color: #59272a;
  background: linear-gradient(120deg,#161719,#0d0e10);
  border-radius: 5px;
}
.command-panel h2 { font-size: clamp(1rem,1.2vw,1.35rem); font-style: italic; text-transform: uppercase; margin: 0 0 .75rem; }
.command-upcoming { grid-column: 1 / -1; }
.command-actions,.dashboard-ships { display: grid; gap: .7rem; grid-template-columns: repeat(2,minmax(0,1fr)); }
.dashboard-ships { grid-template-columns: repeat(4,minmax(0,1fr)); }
.command-heading,.command-operation { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; }
.command-operation { padding: .75rem 1rem; background: var(--raised); border-left: 3px solid var(--red); }
.command-operation strong { flex: 1 1 14rem; }
.module-kpi-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .55rem; }
.module-kpi-strip > div { display: flex; flex-direction: column-reverse; align-items: flex-start; border: 1px solid var(--line); background: var(--surface); border-radius: 4px; padding: .6rem .7rem; min-width: 0; }
.module-kpi-strip span { color: var(--secondary); font-size: .82rem; }
.module-kpi-strip strong { font-size: 1.6rem; color: var(--ink); }
:is(.v3-panel,.adminbox,.history,.account-card,.extension-record,.op-row,.op-command-head,.assign-panel,.brief-ship,.model-card,.catalog-card) {
  background: linear-gradient(145deg,var(--raised),var(--surface) 58%);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 5px;
}
:is(.v3-panel,.adminbox,.account-card,.extension-record) { padding: clamp(.95rem,1.35vw,1.85rem); }
.module-page-head,.fleet-content .page-head {
  min-height: 105px;
  display: flex;
  align-content: center;
  flex-wrap: wrap;
  gap: .65rem;
  border-bottom: 1px solid var(--line);
  margin: 0 0 1rem;
  padding: .85rem 0;
}
.module-page-head { display: grid; }
.module-page-head h1,.fleet-content .page-head h1 { margin: 0; color: var(--ink); font-size: clamp(1.8rem,3vw,3.35rem); line-height: 1.05; }
:is(.v3-panel,.adminbox,.command-panel,.extension-record,.brief-ship) :is(h2,h3) { line-height: 1.18; }
:is(.muted,.empty-state,.empty-v35,.form-note,.crew-label) { color: var(--secondary); }
:is(.empty-state,.empty-v35) { padding: .9rem; border: 1px dashed var(--line); border-radius: 4px; }
:is(button,.action,.v34-link,.v3-button):not(.danger,.eye) {
  border: 1px solid var(--red);
  border-radius: 4px;
  background: var(--action-bg);
  color: var(--ink);
  min-height: 40px;
}
:is(button,.action,.v34-link,.v3-button):not(.danger,.eye):hover { background: var(--action-hover); }
button:disabled { opacity: .55; cursor: not-allowed; }
:is(input,select,textarea):not([type=checkbox],[type=radio],[type=hidden]) {
  border: 1px solid #505358;
  border-radius: 4px;
  background: #0c0e10;
  color: var(--ink);
  padding: .65rem .8rem;
  min-height: 43px;
  max-width: 100%;
  font: inherit;
}
input[type=checkbox] { accent-color: var(--accent); }
textarea { resize: vertical; min-height: 9rem; width: 100%; }
.v3-form label { display: grid; gap: .4rem; min-width: 0; }
.v3-form label:has(textarea) { grid-column: 1 / -1; }
.v3-form > [hidden] { display: none; }
details > summary { cursor: pointer; min-height: 32px; }
details[open] > summary { margin-bottom: .55rem; }
:is(.v3-table,table) th { color: var(--ink); background: #222428; text-align: left; }
:is(.v3-table,table) :is(th,td) { padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
:is(.v3-table,table) tr:nth-child(even) td { background: #ffffff05; }
.tablewrap,.v3-table-wrap { max-width: 100%; overflow: auto; }
:is(.model-grid,.catalog-grid,.brief-grid) { grid-template-columns: repeat(4,minmax(0,1fr)); }
.model-card { display: grid; align-content: start; gap: .65rem; padding: 1rem; min-width: 0; }
.model-card h2 { min-height: 2.45em; margin: 0; }
.model-card p { margin: 0; }
.fleet-content .model-top { display: grid; gap: .55rem; justify-content: stretch; align-items: start; }
.fleet-content .model-top .eyebrow { min-height: 2.8rem; letter-spacing: .02em; }
.model-count { justify-self: start; }
.crew-wide { grid-column: 1 / -1; order: 1; }
.crew-wide .crew { display: grid; grid-template-columns: repeat(auto-fit,minmax(165px,1fr)); gap: .5rem; }
.maker { display: inline-flex; align-items: center; gap: .55rem; min-width: 0; }
.maker .manufacturer-logo { display: block; flex: 0 0 40px; margin: 0; padding: 0; width: 40px; height: 32px; background: transparent; border-radius: 0; object-fit: contain; }
.ship-nickname,.capacity { display: block; }
.capacity { color: var(--secondary); font-size: .82rem; margin: .25rem 0; }
.capacity-live,.medical-cross { color: var(--cyan); }
.medical-assigned,.medical-support-panel { border: 1px solid var(--cyan); }
.medical-support-panel p,.record-fields dd { white-space: pre-wrap; }
.medical-module { --accent: var(--cyan); --red: #358996; --action-bg: #112d32; --action-hover: #17404a; }
.medical-module .sfi-hero h1 { color: var(--ink); }
.medical-module button.danger { color: #fff; background: #551317; border-color: #e86467; }
.medical-module textarea { min-height: 11rem; }
.medical-instances { padding: 0; list-style: none; }
.medical-instances li { display: grid; border-top: 1px solid var(--line); padding: .55rem 0; }
.module-config {
  border: 1px solid #3b6570;
  border-radius: 4px;
  padding: .85rem;
  background: linear-gradient(140deg,#142127,#121416);
  grid-column: 1 / -1;
  min-width: 0;
}
.module-config legend { color: var(--cyan); font-weight: 700; padding: 0 .45rem; }
.bay-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,150px),1fr)); gap: .5rem; margin: .5rem 0; }
.v3-form .bay-grid label { background: #0c151a; border: 1px solid #3b6570; padding: .6rem; border-radius: 4px; }
.v3-form .bay-grid .module-choice { display: flex; align-items: center; }
.config-editor { margin-top: .65rem; }
.config-editor form { grid-template-columns: minmax(0,1fr); }
@media (min-width: 2450px) {
  :is(.model-grid,.catalog-grid,.brief-grid) { grid-template-columns: repeat(6,minmax(0,1fr)); }
}
@media (max-width: 1120px) {
  .fleet-overview { grid-template-columns: 1fr; }
  :is(.model-grid,.catalog-grid,.brief-grid,.dashboard-ships) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .center-intro-panel.hub-banner { grid-template-columns: 90px 1fr; }
  .hub-account { grid-column: 1/-1; }
}
@media (max-width: 760px) {
  :is(.module-shell,.fleet-page) { grid-template-columns: minmax(0,1fr); }
  .module-sidebar { position: relative; min-height: auto; max-height: none; margin: 0; gap: .6rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .module-sidebar::after { display: none; }
  .module-logo { display: none; }
  .module-id,.module-account { margin: 0; }
  .module-menu { display: flex; flex-wrap: wrap; }
  .module-menu a { flex: 1 0 auto; }
  .module-topline { grid-template-columns: 1fr auto; }
  .module-topline > span { display: none; }
  .module-kpi-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .premium-hub-grid { grid-template-columns: 1fr; }
  .premium-hub-grid .hub-module,.premium-hub-grid .hub-module:nth-child(n+4) { grid-column: auto; }
}
@media (max-width: 420px) {
  :is(.model-grid,.catalog-grid,.brief-grid,.dashboard-ships) { grid-template-columns: minmax(0,1fr); }
}
.premium-module .module-main .v3-wrap { margin: 0; }
.medical-module .sfi-hero { border-bottom-color: var(--cyan); }
.medical-module .module-menu a:is(.selected,:hover) { border-color: var(--red); }
.request-tabs a[aria-current=page] { color: var(--ink); background: var(--action-bg); border-color: var(--accent); }
.module-account strong,.hub-account strong { overflow-wrap: anywhere; }
.command-actions a { display: grid; place-items: center start; text-align: left; }
@media(max-width: 1430px) {
  .admin-layout { grid-template-columns: minmax(0,1fr); }
}
.medical-module { --sfi-red: #358996; }
.medical-module .v3-form button:not(.danger) {
  background: var(--action-bg);
  color: var(--ink);
  border: 1px solid var(--red);
}
.medical-module .v3-form button:not(.danger):hover { background: var(--action-hover); }
.medical-module .v3-form button.danger { background: #551317; border: 1px solid #e86467; }
.premium-module .v3-form label {
  color: var(--secondary);
  font-size: .86rem;
  text-transform: none;
  letter-spacing: .01em;
}
.premium-module .v3-form :is(input,select,textarea) { margin-top: 0; }
.premium-module .v3-form:has(textarea) { align-items: start; }
.premium-module .v3-form label:has(textarea) { grid-column: 1/-1; }
.premium-module .v3-form textarea { min-height: 9rem; }
.premium-module .v3-form textarea[name=body] { min-height: 16rem; }
.premium-module .v3-table th { color: var(--ink); background: #222428; }
.medical-module .v3-panel > .extension-record > .v3-form,
.medical-module .v3-panel > .extension-record > details { margin-top: .8rem; }
.hub-module { justify-content: flex-end; }
.hub-card-foot { margin-top: 1rem; }
.module-logo img { max-height: 162px; }
.maker img[src*="/sc-logo-"] { filter: invert(.86); }
.fleet-content .brief-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.fleet-content .manage-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
@media(min-width: 2450px) {
 .fleet-content .brief-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
 .fleet-content .manage-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media(max-width: 1120px) {
 .fleet-content .brief-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width: 650px) {
 .fleet-content .brief-grid { grid-template-columns: minmax(0,1fr); }
}
.command-upcoming { grid-column: auto; }
.command-activity { padding: 0; margin: 0; list-style: none; }
.command-activity li { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding: .4rem 0; }
.command-activity time { color: var(--secondary); }
.dashboard.fleet-page {
  width: 100%;
  max-width: none;
  padding: 0;
  gap: 0;
  border: 0;
  grid-template-columns: var(--rail) minmax(0,1fr);
}
.fleet-content .module-topline { height: auto; }
.center-shell { max-width: min(94vw,2900px); }
.medical-module form.medical-form {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: start;
  gap: 1rem;
  width: min(100%,1400px);
}
.medical-module form.medical-form label:has(textarea) { grid-column: 1 / -1; }
.medical-module form.medical-form :is(input:not([type=checkbox]),select,textarea) { width: 100%; }
.medical-module form.medical-form button { justify-self: start; }
.wikelo-summary .module-kpi-strip { grid-template-columns: repeat(auto-fit,minmax(min(100%,10rem),1fr)); }
:where(.collective-card,.medical-access .extension-record) {
  max-width: 100%;
}
.v3-table td:has(details) { min-width: 10rem; }
.v3-table td details[open] form { grid-template-columns: minmax(0,1fr); }
@media(max-width: 760px) {
 .dashboard.fleet-page { grid-template-columns: minmax(0,1fr); }
 .medical-module form.medical-form { grid-template-columns: minmax(0,1fr); }
}

/* Shared work surfaces and controls */
:root {
  --accent: #e33136;
  --red: #b00409;
  --success: #78d7a1;
  --warning: #f1bd72;
  --space: clamp(1rem, 1.2vw, 1.65rem);
  --heading-size: clamp(1.7rem, 2.35vw, 3.15rem);
  --work-surface: linear-gradient(110deg, var(--action-bg), var(--surface) 42%, var(--canvas));
  --sfi-red: var(--red);
}
.medical-module { --accent: var(--cyan); --red: #358996; }
.module-sidebar {
  background: linear-gradient(145deg, var(--action-bg), transparent 19rem),
              linear-gradient(165deg, #101214 60%, var(--action-bg));
}
.module-id strong { font-size: clamp(1rem, 1vw, 1.22rem); }
.module-menu a { font-size: .94rem; gap: .6rem; }
.module-menu a::before { margin-right: 0; flex: 0 0 .46rem; }
.module-menu a[aria-current=page] { box-shadow: inset 3px 0 var(--accent); }

:is(.module-page-head,.module-main .page-head,.fleet-content .page-head,.dashboard > .page-head,
    .op-command-head,.wikelo-summary,.auth-heading) {
  margin: 0 0 var(--space);
  padding: var(--space) clamp(1rem, 1.75vw, 2.5rem);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent);
  border-radius: 5px;
  background: var(--work-surface);
}
:is(.module-page-head,.module-main .page-head,.fleet-content .page-head,.dashboard > .page-head,
    .op-command-head,.wikelo-summary,.auth-heading) h1 {
  margin: .2rem 0;
  color: var(--ink);
  font-size: var(--heading-size);
  line-height: 1.08;
  font-style: italic;
  font-weight: 800;
  letter-spacing: -.035em;
}
:is(.module-page-head,.page-head,.op-command-head,.wikelo-summary) .eyebrow {
  color: var(--secondary);
  letter-spacing: .11em;
  font-size: .78rem;
}
:is(.module-page-head,.page-head,.op-command-head,.wikelo-summary) .eyebrow::before {
  content: '';
  display: inline-block;
  width: .7em;
  height: .65em;
  margin-inline-end: .55em;
  border-inline: 2px solid var(--accent);
  transform: skew(-19deg);
}
.op-command-head > :is(.op-command-main,.op-fact,.op-state) { background: transparent; }
.op-command-main { padding-inline-start: 0; }
.error-shell { max-width: 60rem; padding: var(--space); margin: 8vh auto; }
.auth-heading h1 { font-size: clamp(1.5rem, 2vw, 2.2rem); }
.hub-banner h1, .hub-module h2 { font-style: italic; letter-spacing: -.025em; color: var(--ink); }

:is(.v3-panel,.adminbox,.history,.account-card,.extension-record,.op-row,.assign-panel,.brief-ship,.model-card,.catalog-card) {
  box-shadow: inset 0 1px #ffffff08;
}
:is(.v3-panel,.adminbox,.assign-panel,.composition-title) h2 {
  color: var(--ink);
  font-size: clamp(1.1rem, 1.05vw, 1.5rem);
  font-weight: 780;
}
:is(.v3-panel,.adminbox,.assign-panel) > h2 {
  padding-inline-start: .65rem;
  border-inline-start: 3px solid var(--accent);
}
:is(.v3-panel,.adminbox) > :is(.v3-form,.v3-table-wrap,.tablewrap) { margin-block: .9rem; }
:is(.v3-table-wrap,.tablewrap) { border: 1px solid var(--line); border-radius: 5px; }
.premium-module .v3-table :is(th,td) { font-size: .95rem; }
.premium-module .v3-table th { font-size: .79rem; letter-spacing: .055em; }
:is(table td, .record-fields dd, .extension-record, .module-config, .bp-owners) { overflow-wrap: anywhere; }
table :is(td,th) { font-variant-numeric: tabular-nums; }
:is(.v3-table,table) tbody tr:hover td { background: #ffffff09; }
:is(.empty-state,.empty-v35) {
  background: var(--surface);
  padding: 1rem 1.2rem;
  border-inline-start: 3px solid var(--accent);
}
:is(.v3-form,.account-form) label { font-size: .92rem; }
.premium-module :is(.v3-form,#bp-import) button:not(.danger) {
  background: var(--action-bg);
  border: 1px solid var(--red);
  color: var(--ink);
  font-size: .9rem;
  text-transform: none;
  letter-spacing: 0;
}
.premium-module :is(.v3-form,#bp-import) button:not(.danger):hover { background: var(--action-hover); }
:is(.v3-form,.account-form) button.danger, .danger-zone button {
  color: #fff;
  background: #551317;
  border: 1px solid #e33136;
  font-size: .9rem;
  text-transform: none;
  letter-spacing: 0;
}
:is(input,textarea)::placeholder { color: var(--secondary); opacity: .85; }
:is(input,select,textarea):not([type=hidden]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:is(.v3-panel,.extension-record,.config-editor,.account-actions) details > summary,
details:is(.config-editor,.danger-zone) > summary {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .55rem .75rem;
}
details > summary::marker { color: var(--accent); }
details[open] > summary { border-inline-start: 3px solid var(--accent); }
:is(.v3-alert,.sfi-message,[role=status]:not(:empty)) {
  padding: .65rem .9rem;
  border-inline-start: 3px solid var(--accent);
  background: var(--surface);
}
.sfi-message-error { border-color: var(--accent); }
.sfi-tag, .premium-module .v3-pill {
  display: inline-block;
  align-self: start;
  justify-self: start;
  width: fit-content;
  padding: .2rem .55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--secondary);
  background: var(--surface);
  font-size: .84rem;
}
.premium-module .sfi-status-success { color: var(--success); border-color: var(--success); }
.premium-module .sfi-status-pending { color: var(--warning); border-color: var(--warning); }
progress { accent-color: var(--accent); width: min(100%, 26rem); height: .75rem; }
:is(.module-kpi-strip,.v34-stats) strong { font-variant-numeric: tabular-nums; }
.maker .manufacturer-logo { width: 46px; height: 36px; flex-basis: 46px; }
.maker span { overflow-wrap: anywhere; }
.capacity { font-size: .9rem; }
.roster-card, .medical-record { display: grid; align-content: start; gap: .65rem; }
.medical-record + .medical-record { margin-top: .9rem; }
.roster-card > strong, .medical-record h3 { margin: 0; font-size: 1.2rem; }
.medical-module :is(.v3-panel,.medical-support-panel) > h2 { border-inline-start-color: var(--cyan); }
.medical-module .record-fields { margin: .5rem 0; }
.medical-module .record-fields > div {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: .8rem 1rem;
}
.medical-module .record-fields dt { font-size: .88rem; font-weight: 700; color: var(--secondary); }
.doctrine-document {
  max-width: 90ch;
  padding: 1rem 1.4rem;
  background: var(--surface);
  border-inline-start: 3px solid var(--cyan);
  line-height: 1.65;
}
.doctrine-document h4 { color: var(--cyan); margin-block: .4rem; }
.medical-module .medical-form textarea { min-height: 10rem; }
.medical-module .medical-form textarea[name=body] { min-height: 17rem; }
.collective-card .project-art:not(:has(img)) { display: none; }
@media (max-width: 760px) {
  .dashboard.fleet-page, .medical-module form.medical-form { grid-template-columns: minmax(0,1fr); }
  .module-topline { min-width: 0; }
  .maker .manufacturer-logo { width: 38px; flex-basis: 38px; }
}

dialog {
  width: min(92vw, 30rem);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent);
  border-radius: 5px;
  padding: 1.4rem 1.6rem;
}
dialog::backdrop { background: #070809c9; }
dialog h2 { margin: 0 0 1rem; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; }
.dialog-actions .danger { border: 1px solid var(--accent); background: #551317; color: #fff; }

.support-record > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem 1.4rem;
  margin-bottom: .8rem;
}
.support-record > header :is(h3,p), .support-ships :is(h4,p) { margin: 0 0 .45rem; }
.support-ships { margin-top: 1rem; }
.support-ships .medical-form { display: flex; }
.import-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,15rem),1fr));
  gap: .65rem 1.65rem;
  padding-inline-start: 1.5rem;
  max-width: 82rem;
}
.import-steps li {
  border-inline-start: 2px solid var(--accent);
  padding: .55rem .75rem;
  background: var(--surface);
}

.request-status-pending, .request-status-reserved { color: var(--warning); }
.request-status-distributed { color: var(--success); }
.request-status-refused, .request-status-cancelled { color: var(--secondary); }
#inventory td:nth-child(3) { color: var(--secondary); }
#inventory td:nth-child(4) { color: var(--ink); }

.medical-module {
  --work-surface: linear-gradient(110deg, var(--action-bg), var(--surface) 42%, var(--canvas));
}
.module-id { margin-inline: 0; }
.fleet-form [data-ship-form] {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  max-width: 70rem;
}
[data-ship-form] > [data-kind-panel] {
  grid-column: 1 / -1;
  min-inline-size: 0;
  border: 0;
  padding: 0;
  margin: 0;
}
.v3-form [type=checkbox] {
  inline-size: 1.1rem;
  block-size: 1.1rem;
  min-block-size: 0;
  padding: 0;
  margin: 0 .35rem 0 0;
  flex: 0 0 1.1rem;
}
[data-ship-form] > button { justify-self: start; }
.v3-form .module-choice { flex-direction: row; }
:is(.medical-means,.medical-roster) .extension-grid {
  grid-template-columns: repeat(auto-fill,minmax(min(100%,22rem),1fr));
}
.medical-means .maker .manufacturer-logo { width: 72px; height: 44px; flex-basis: 72px; }
.medical-means .extension-record { border-top-color: #358996; }
@media (max-width: 760px) {
  .fleet-form [data-ship-form] { grid-template-columns: minmax(0,1fr); }
}


/* RC5 - Alignement des commandes du Hub */
.hub-account > form {
  display: flex;
  align-items: center;
  margin: 0;
}

.hub-account > a.v34-link,
.hub-account > form > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 42px;
  min-height: 42px;
  margin: 0;
  padding: 0 16px;
}
/* RC5 - Catalogue constructeurs XL */
@media (min-width: 721px) {
  .catalog-row summary > span:first-child { grid-template-columns: 300px minmax(180px,1fr) minmax(180px,1fr); }
  .catalog-row .maker .manufacturer-logo { width: 72px; height: 52px; flex-basis: 72px; }
}
.catalog-row .maker span { overflow-wrap: normal; word-break: normal; }

/* RC5 - Harmonisation globale des logos constructeurs */
.manufacturer-logo:is([src$='sc-logo-anvil-aerospace.svg'],[src$='sc-logo-argo-astronautics.svg'],[src$='sc-icon-brand-argo.svg'],[src$='sc-logo-tumbril.svg']) { transform: scale(1.5); }

.manufacturer-logo[src$='sc-logo-anvil-aerospace.svg'] { transform: scale(1.75); }

.manufacturer-logo[src$='sc-logo-anvil-aerospace.svg'] { transform: scale(2); margin-right: 24px; }

/* RC5 - Harmonisation des logos dans les flottes */
.fleet-content .maker .manufacturer-logo { width: 72px; height: 52px; flex-basis: 72px; }
.fleet-content .model-top .manufacturer-logo { width: 72px; height: 52px; flex: 0 0 72px; }
.fleet-content .model-top .manufacturer-logo[src$='sc-logo-anvil-aerospace.svg'] { margin-right: 24px; }

/* RC5 - Ajustement Argo dans les flottes */
.fleet-content td .manufacturer-logo:is([src$='sc-logo-argo-astronautics.svg'],[src$='sc-icon-brand-argo.svg']) { transform: translateX(-3px) scale(1.85); margin-right: 20px; }
.fleet-content .model-top .manufacturer-logo:is([src$='sc-logo-argo-astronautics.svg'],[src$='sc-icon-brand-argo.svg']) { transform: scale(1.75); margin-right: 16px; }

/* RC5 - Harmonisation des logos en operation */
.brief-ship .manufacturer-logo { width: 72px; height: 52px; flex-basis: 72px; }
.brief-ship .manufacturer-logo[src$='sc-logo-anvil-aerospace.svg'] { margin-right: 24px; }
.brief-ship .manufacturer-logo:is([src$='sc-logo-argo-astronautics.svg'],[src$='sc-icon-brand-argo.svg']) { transform: scale(1.75); margin-right: 16px; }

/* RC5 - Filigrane institutionnel SFI */
@media (min-width: 1121px) {
  :is(.fleet-page,.module-shell):has(.module-menu a[aria-current="page"]:is(
    [href="/fleet/operations"],
    [href="/fleet/admin/operations"],
    [href="/logistics/requests"],
    [href="/logistics/manage-requests"],
    [href="/wikelo"],
    [href="/blueprints/import"],
    [href="/inventory/add"],
    [href="/inventory/projects"],
    [href="/admin/invitations"],
    [href="/admin/resets"],
    [href="/medical/roster"],
    [href="/medical/means"],
    [href="/medical/support"],
    [href="/medical/training"],
    [href="/medical/doctrine"],
    [href="/medical/rex"]
  )) > :is(.fleet-content,.module-main) {
    isolation: isolate;
  }

  :is(.fleet-page,.module-shell):has(.module-menu a[aria-current="page"]:is(
    [href="/fleet/operations"],
    [href="/fleet/admin/operations"],
    [href="/logistics/requests"],
    [href="/logistics/manage-requests"],
    [href="/wikelo"],
    [href="/blueprints/import"],
    [href="/inventory/add"],
    [href="/inventory/projects"],
    [href="/admin/invitations"],
    [href="/admin/resets"],
    [href="/medical/roster"],
    [href="/medical/means"],
    [href="/medical/support"],
    [href="/medical/training"],
    [href="/medical/doctrine"],
    [href="/medical/rex"]
  )) > :is(.fleet-content,.module-main)::before {
    content: "SHADOW FREIGHT\A INDUSTRIES";
    position: fixed;
    left: calc(var(--rail) + (100vw - var(--rail)) / 2);
    top: 75vh;
    transform: translate(-50%, -50%);
    width: calc(100vw - var(--rail) - 100px);
    text-align: center;
    white-space: pre;
    font-size: clamp(48px, 5.6vw, 190px);
    font-weight: 900;
    font-style: italic;
    line-height: 1.05;
    letter-spacing: .035em;
    color: rgba(255,255,255,.045);
    pointer-events: none;
    user-select: none;
    z-index: -1;
  }
}

