.ftSection {
  background:
    radial-gradient(circle at 92% 5%, rgba(25, 189, 236, .1), transparent 28%),
    linear-gradient(180deg, #071017 0%, #09151e 100%);
}

.ftGuideFlow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: 1rem;
}

.ftGuideFlow div {
  border: 1px solid #26404e;
  border-radius: 9px;
  padding: .75rem;
  background: rgba(10, 23, 32, .9);
}

.ftGuideFlow b,
.ftGuideFlow span {
  display: block;
}

.ftGuideFlow b {
  color: #62c8f0;
}

.ftGuideFlow span {
  margin-top: .2rem;
  color: #aebec7;
  font-size: .82rem;
}

.ftSetupGrid,
.ftWorkspace {
  display: grid;
  gap: 1rem;
  align-items: start;
}

.ftSetupGrid {
  grid-template-columns: minmax(0, .88fr) minmax(420px, 1.12fr);
}

.ftWorkspace {
  grid-template-columns: minmax(420px, .9fr) minmax(420px, 1.1fr);
  margin-top: 1rem;
}

.ftSetup,
.ftInventory,
.ftLogPanel,
.ftAssistant {
  padding: 1rem;
  min-width: 0;
}

.ftPanelHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
}

.ftPanelHead h3 {
  margin: .2rem 0 0;
  font-size: 1.55rem;
}

.ftEyebrow {
  margin: 0;
  color: #72d0f4;
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .14em;
}

.ftStatus,
.ftMatch,
#ftTopCount,
#ftGrStats {
  flex: 0 0 auto;
  border: 1px solid #35515f;
  border-radius: 999px;
  padding: .32rem .58rem;
  color: #9cb1bc;
  background: #071119;
  font-size: .7rem;
  font-weight: 700;
}

.ftStatus.good,
.ftMatch.high {
  border-color: #2e9174;
  color: #92e0c7;
}

.ftStatus.warn,
.ftMatch.moderate,
.ftMatch.low {
  border-color: #a57c2e;
  color: #f0ca75;
}

.ftStatus.error,
.ftMatch.error {
  border-color: #a95858;
  color: #ffaaaa;
}

.ftContextGrid,
.ftAddRow {
  display: grid;
  gap: .7rem;
  align-items: end;
}

.ftContextGrid {
  grid-template-columns: repeat(4, minmax(105px, 1fr));
}

.ftAddRow {
  grid-template-columns: minmax(160px, 1fr) 130px 110px auto;
  margin-top: .85rem;
  border-top: 1px solid #203844;
  padding-top: .85rem;
}

.ftWide {
  min-width: 0;
}

.ftContextGrid .ftWide {
  grid-column: 1 / -1;
}

.ftSetup label,
.ftAssistant label,
.ftLogPanel label {
  display: grid;
  gap: .38rem;
  color: #b8c8d2;
  font-size: .82rem;
}

.ftSetup input,
.ftSetup select,
.ftSetup textarea,
.ftAssistant input,
.ftAssistant textarea,
.ftLogToolbar select {
  width: 100%;
  border: 1px solid #315064;
  border-radius: 7px;
  padding: .66rem .7rem;
  background: #061017;
  color: #f3f7f9;
  font: inherit;
}

.ftSetup input:focus,
.ftSetup select:focus,
.ftSetup textarea:focus,
.ftAssistant input:focus,
.ftAssistant textarea:focus,
.ftLogToolbar select:focus {
  outline: 2px solid rgba(25, 189, 236, .32);
  outline-offset: 1px;
  border-color: #35bce9;
}

.ftSetup label small {
  color: #829aa6;
  font-size: .68rem;
}

.ftAddRow button,
.ftImportActions button,
.ftFileButton,
.ftLogToolbar button,
.ftCandidateBox button,
.ftManualRow button,
.ftAssistantActions button,
.ftRowActions button {
  border: 1px solid #3b5360;
  border-radius: 6px;
  padding: .63rem .78rem;
  background: #101f28;
  color: #dce9ee;
  cursor: pointer;
  font: inherit;
}

.ftAddRow button.primary,
.ftFileButton.primary,
.ftCandidateBox button.primary {
  border-color: #19bdec;
  background: #19bdec;
  color: #00131b;
  font-weight: 700;
}

.ftAddRow button {
  min-height: 42px;
  white-space: nowrap;
}

.ftImport {
  margin-top: .85rem;
  border-top: 1px solid #203844;
  padding-top: .75rem;
}

.ftImport summary {
  color: #d7e6ec;
  cursor: pointer;
  font-weight: 700;
}

.ftImport p {
  margin: .55rem 0;
  color: #91a8b4;
  font-size: .76rem;
}

.ftImport code {
  color: #9ee3fb;
}

.ftImportActions,
.ftLogToolbar,
.ftAssistantActions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-top: .55rem;
}

.ftFileButton {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.ftFileButton input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ftFileButton:focus-within {
  outline: 2px solid #72dfff;
  outline-offset: 3px;
}

.ftTableWrap {
  max-height: 330px;
  overflow: auto;
  border: 1px solid #263d49;
  border-radius: 8px;
}

.ftInventory table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}

.ftInventory th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: .55rem .5rem;
  background: #0b1a23;
  color: #829aa6;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .64rem;
}

.ftInventory td {
  border-top: 1px solid #203540;
  padding: .5rem;
  color: #cad7dd;
  vertical-align: middle;
}

.ftTopRow {
  cursor: pointer;
}

.ftTopRow:hover td,
.ftTopRow.selected td {
  background: #0b2531;
}

.ftTopRow.selected td:first-child {
  box-shadow: inset 3px 0 #19bdec;
}

.ftFormationCell b,
.ftFormationCell small {
  display: block;
}

.ftFormationCell small {
  color: #7f98a4;
  font-size: .68rem;
}

.ftDepthInput {
  width: 92px;
  border: 1px solid #2b4857;
  border-radius: 5px;
  padding: .4rem;
  background: #061017;
  color: #edf5f8;
  font: inherit;
}

.ftSuggested {
  color: #f2c96b;
}

.ftSuggested small {
  display: block;
  max-width: 135px;
  color: #ff9e9e;
  font-size: .62rem;
  line-height: 1.3;
}

.ftConfirmed {
  color: #8fe4c6;
}

.ftConfirmed small {
  display: block;
  color: #f4bd78;
  font-size: .62rem;
  line-height: 1.3;
}

.ftRowActions {
  display: flex;
  justify-content: flex-end;
  gap: .3rem;
}

.ftRowActions button {
  padding: .35rem .48rem;
  color: #a8bbc4;
  font-size: .72rem;
}

.ftRowActions button:focus-visible {
  outline: 2px solid #72dfff;
  outline-offset: 2px;
}

.ftEmptyRow td {
  padding: 1.3rem;
  color: #839ba6;
  text-align: center;
}

.ftLogToolbar {
  margin: 0 0 .7rem;
}

.ftLogToolbar select {
  width: auto;
  min-width: 145px;
  padding: .5rem .62rem;
}

.ftLogToolbar span {
  flex: 1 1 240px;
  color: #8fa4ae;
  font-size: .72rem;
}

.ftLogToolbar button:disabled,
.ftCandidateBox button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.ftCanvasShell {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  border: 1px solid #294654;
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(40, 75, 89, .25) 40px),
    #061017;
}

#ftGrCanvas {
  display: block;
  width: 100%;
  height: min(62vh, 660px);
  min-height: 480px;
  background: transparent;
  cursor: crosshair;
  touch-action: pan-y;
}

.ftCanvasEmpty {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  color: #345866;
  font: 700 4rem/1 "Barlow Condensed", sans-serif;
  letter-spacing: .08em;
  text-align: center;
  pointer-events: none;
}

.ftCanvasEmpty small {
  display: block;
  margin-top: .35rem;
  color: #4f7280;
  font: 600 .78rem Inter, sans-serif;
  letter-spacing: .12em;
}

.ftLegend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .65rem;
  color: #93a9b3;
  font-size: .68rem;
}

.ftLegend span {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
}

.ftLegend i {
  display: inline-block;
  width: 18px;
  border-top: 2px solid;
}

.ftLegend .curve { border-color: #55d4ff; }
.ftLegend .plan { border-color: #788e98; border-top-style: dashed; }
.ftLegend .candidate { border-color: #f4bd35; }
.ftLegend .confirmed { border-color: #54d4a8; }

.ftHint {
  margin: .55rem 0 0;
  color: #8da3ad;
  font-size: .72rem;
}

.ftAssistantEmpty {
  display: grid;
  min-height: 260px;
  place-content: center;
  border: 1px dashed #2b4654;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
}

.ftAssistantEmpty b {
  color: #d8e7ed;
}

.ftAssistantEmpty p {
  max-width: 430px;
  color: #8ea5af;
}

.ftGuidanceOutput textarea {
  min-height: 250px;
  resize: vertical;
  color: #dce8ed;
  line-height: 1.5;
}

.ftEvidenceCards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
  margin-top: .75rem;
}

.ftEvidenceCards article {
  border: 1px solid #243e4b;
  border-radius: 8px;
  padding: .7rem;
  background: rgba(5, 14, 20, .62);
}

.ftEvidenceCards article:last-child {
  grid-column: 1 / -1;
}

.ftEvidenceCards b {
  display: block;
  color: #70cdec;
  font-size: .69rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.ftEvidenceCards p {
  margin: .3rem 0 0;
  color: #c5d2d8;
  font-size: .79rem;
  line-height: 1.45;
}

.ftCautionCard {
  border-left: 3px solid #d7a83c !important;
}

.ftCandidateBox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .75rem;
  border: 1px solid #6f5c28;
  border-radius: 8px;
  padding: .75rem;
  background: rgba(109, 76, 13, .13);
}

.ftCandidateBox div,
.ftCandidateBox small,
.ftCandidateBox strong,
.ftCandidateBox span {
  display: block;
}

.ftCandidateBox small {
  color: #b99d61;
  font-size: .65rem;
  letter-spacing: .09em;
}

.ftCandidateBox strong {
  color: #ffd575;
  font: 700 1.7rem "Barlow Condensed", sans-serif;
}

.ftCandidateBox span {
  color: #aeb9bc;
  font-size: .7rem;
}

.ftManualRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .6rem;
  align-items: end;
  margin-top: .65rem;
}

.ftManualRow button {
  min-height: 42px;
}

.ftSources {
  margin-top: .8rem;
  border-top: 1px solid #203944;
  padding-top: .7rem;
  color: #a9bcc5;
  font-size: .73rem;
}

.ftSources > b {
  display: block;
  margin-bottom: .35rem;
  color: #dce7ec;
}

#ftSources {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
}

#ftSources a {
  color: #72d0f4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ftDisclaimer {
  margin: 1rem 0 0;
  border-left: 3px solid #d7a83c;
  padding: .75rem .85rem;
  background: rgba(86, 63, 18, .12);
  color: #aeb9bc;
  font-size: .76rem;
}

.ftDisclaimer b {
  color: #e5d4ad;
}

@media (max-width: 1060px) {
  .ftSetupGrid,
  .ftWorkspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .ftGuideFlow,
  .ftContextGrid,
  .ftAddRow,
  .ftEvidenceCards {
    grid-template-columns: 1fr;
  }

  .ftEvidenceCards article:last-child {
    grid-column: auto;
  }

  .ftPanelHead {
    display: block;
  }

  .ftStatus,
  .ftMatch,
  #ftTopCount,
  #ftGrStats {
    display: inline-block;
    margin-top: .55rem;
  }

  .ftTableWrap {
    overflow: visible;
    border: 0;
  }

  .ftInventory table,
  .ftInventory tbody,
  .ftInventory tr,
  .ftInventory td {
    display: block;
    width: 100%;
  }

  .ftInventory thead {
    display: none;
  }

  .ftTopRow {
    margin-bottom: .65rem;
    border: 1px solid #263d49;
    border-radius: 8px;
    overflow: hidden;
  }

  .ftInventory td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 42px;
  }

  .ftInventory td::before {
    content: attr(data-label);
    color: #78919d;
    font-size: .63rem;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  .ftInventory .ftFormationCell {
    display: block;
  }

  .ftInventory .ftFormationCell::before,
  .ftEmptyRow td::before {
    content: none;
  }

  .ftRowActions {
    justify-content: flex-end;
  }

  .ftCanvasShell,
  #ftGrCanvas {
    min-height: 430px;
  }

  #ftGrCanvas {
    height: 56vh;
  }

  .ftCandidateBox,
  .ftManualRow {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ftCandidateBox button,
  .ftManualRow button,
  .ftAssistantActions button,
  .ftImportActions button,
  .ftFileButton {
    width: 100%;
  }
}

@media print {
  body.ftPrinting {
    background: #fff !important;
    color: #111 !important;
  }

  body.ftPrinting .nav,
  body.ftPrinting .toolsHero,
  body.ftPrinting .directory,
  body.ftPrinting main > .toolSection:not(#formation-top),
  body.ftPrinting .toolsCta,
  body.ftPrinting footer {
    display: none !important;
  }

  body.ftPrinting main,
  body.ftPrinting #formation-top,
  body.ftPrinting #formation-top .wrap {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #111 !important;
  }

  body.ftPrinting #formation-top .ftSetup,
  body.ftPrinting #formation-top .ftGuideFlow,
  body.ftPrinting #formation-top .ftLogToolbar,
  body.ftPrinting #formation-top .ftAssistantActions,
  body.ftPrinting #formation-top .ftManualRow,
  body.ftPrinting #formation-top .ftCandidateBox button,
  body.ftPrinting #formation-top .reset {
    display: none !important;
  }

  body.ftPrinting #formation-top .ftSetupGrid,
  body.ftPrinting #formation-top .ftWorkspace,
  body.ftPrinting #formation-top .ftEvidenceCards {
    display: block;
  }

  body.ftPrinting #formation-top .ftTableWrap {
    max-height: none !important;
    overflow: visible !important;
  }

  body.ftPrinting #formation-top .panel,
  body.ftPrinting #formation-top .ftEvidenceCards article {
    margin-bottom: 10px;
    color: #111 !important;
    background: #fff !important;
    border-color: #999 !important;
    box-shadow: none !important;
  }

  body.ftPrinting #formation-top textarea,
  body.ftPrinting #formation-top input {
    color: #111 !important;
    background: #fff !important;
    border-color: #bbb !important;
  }

  body.ftPrinting #ftSources a {
    color: #111 !important;
  }

  body.ftPrinting #ftSources a::after {
    content: " (" attr(href) ")";
    overflow-wrap: anywhere;
  }
}
