html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  padding-bottom: 60px;
}

.jd-navbar {
  background-color: #166534;
  position: relative;
  z-index: 1080;
}

.jd-navbar .navbar-brand,
.jd-navbar .nav-link,
.jd-navbar .navbar-toggler {
  color: #fff;
}

.jd-navbar .nav-link:hover,
.jd-navbar .nav-link:focus,
.jd-navbar .navbar-brand:hover,
.jd-navbar .navbar-brand:focus {
  color: #d1fae5;
}

.jd-navbar .navbar-collapse {
  position: relative;
  z-index: 1080;
}

/* Keep Bootstrap gates above the custom navbar so modal headers and close buttons stay fully visible. */
.modal-backdrop {
  z-index: 1090;
}

.modal {
  z-index: 1100;
}

.modal-content {
  position: relative;
}

/* Floating helper for long acknowledgement gates. */
.modal-scroll-bottom-btn {
  position: absolute;
  right: 1.25rem;
  bottom: 4.75rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 0.35rem 0.8rem rgba(0, 0, 0, 0.25);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.index-option-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.index-option-row:first-of-type {
  padding-top: 1rem;
  border-top: 1px solid var(--bs-border-color);
}

.index-option-row:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.index-option-price {
  /* Reserve a fixed price column width so shorter prices (like €0) do not shift inline inputs. */
  flex: 0 0 1.5rem;
  text-align: right;
  white-space: nowrap;
}

.index-enabled-label {
  color: #166534;
  font-weight: 700;
}

.index-option-row .form-check-input:not(:disabled) {
  border-color: #166534;
  border-width: 2px;
  opacity: 1;
}

.index-option-row .form-check-input:not(:disabled):checked {
  background-color: #166534;
  border-color: #166534;
}

.index-option-row .form-check-input:not(:disabled):focus {
  border-color: #166534;
  box-shadow: 0 0 0 0.2rem rgba(22, 101, 52, 0.2);
}

.index-coming-soon-note {
  color: #7c3aed;
  font-style: italic;
}

.index-option-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.index-option-inline .form-check {
  margin-right: 0.25rem;
  flex: 1 1 auto;
}

/* Keep option input controls aligned to the right edge immediately before the price. */
.index-option-inline > .index-inline-input,
.index-option-inline > .index-inline-select,
.index-option-inline > .index-inline-controls {
  margin-left: auto;
}

/* Give the long Lost ECU label and ECU SN textbox separate columns before the price. */
.index-option-lost {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10rem;
  column-gap: 0.75rem;
  align-items: center;
}

/* The Lost ECU grid owns its spacing, so the textbox should stay in the second grid column. */
.index-option-lost > .index-inline-input {
  margin-left: 0;
}

/* Keep the long ProgramOnPnMismatch label and its Part Number textbox in separate columns before the price. */
.index-option-pn-mismatch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10rem;
  column-gap: 0.75rem;
  align-items: center;
}

/* The ProgramOnPnMismatch grid owns spacing, so keep the textbox fixed in its second column. */
.index-option-pn-mismatch > .index-inline-input {
  margin-left: 0;
}

/* Keep the multi-controller-hours label and textbox stack in fixed columns like other long-label options. */
.index-option-multi-hours {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10rem;
  column-gap: 0.75rem;
  align-items: start;
}

/* The multi-controller-hours grid owns spacing, so keep the textbox stack in its second column. */
.index-option-multi-hours > .index-multi-hours-stack {
  margin-left: 0;
}

.index-inline-input {
  width: 10rem;
  background-color: var(--bs-body-bg);
}

/* Shrink the inline hours placeholder text so longer controller labels fit inside the existing textbox width. */
.index-inline-input::placeholder {
  font-size: 0.7rem;
}

/* Hide the placeholder while the user is actively editing the inline hours fields. */
.index-inline-input:focus::placeholder {
  color: transparent;
}

/* Keep both inline hours inputs on the same background when the browser fills a suggested/autofill value. */
.index-inline-input:-webkit-autofill,
.index-inline-input:-webkit-autofill:hover,
.index-inline-input:-webkit-autofill:focus,
.index-inline-input:-webkit-autofill:active {
  background-color: var(--bs-body-bg);
  -webkit-text-fill-color: var(--bs-body-color);
  -webkit-box-shadow: 0 0 0 1000px var(--bs-body-bg) inset;
  box-shadow: 0 0 0 1000px var(--bs-body-bg) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.index-inline-select {
  width: 10rem;
}

/* Keep empty inline validation placeholders from taking flex space and shifting option textboxes left. */
.index-inline-validation:empty {
  display: none;
}

/* Give the promotional poster card a more polished ad-like presentation before upload. */
.promo-poster {
  position: relative;
  min-height: 100%;
  color: #f8fafc;
  background: linear-gradient(135deg, #0f172a 0%, #111827 48%, #1e3a8a 100%);
}

.promo-poster-accent {
  height: 0.45rem;
  background: linear-gradient(90deg, #22c55e 0%, #38bdf8 45%, #a78bfa 100%);
}

.promo-poster-body {
  position: relative;
  padding: 1.5rem;
}

.promo-poster-kicker {
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.promo-poster-title {
  color: #ffffff;
  font-size: clamp(1.5rem, 2vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
}

.promo-poster-copy {
  max-width: 34rem;
  color: #dbeafe;
  font-size: 1rem;
}

.promo-poster-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(255, 255, 255, 0.12);
  color: #e0f2fe;
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}

.promo-poster-list {
  margin: 0;
  padding-left: 1.15rem;
  color: #eff6ff;
}

.promo-poster-list li + li {
  margin-top: 0.55rem;
}

.promo-poster-cta {
  padding: 0.75rem 1.15rem;
  border: 0;
  border-radius: 999px;
  color: #0f172a;
  font-weight: 800;
  box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.22);
}

.promo-poster-cta:hover,
.promo-poster-cta:focus {
  color: #0f172a;
  transform: translateY(-1px);
}

.promo-poster-footnote {
  color: #bfdbfe;
  font-size: 0.9rem;
}

.promo-poster .btn-light {
  --bs-btn-bg: #e2e8f0;
  --bs-btn-hover-bg: #f8fafc;
  --bs-btn-hover-border-color: #f8fafc;
  --bs-btn-active-bg: #cbd5e1;
  --bs-btn-active-border-color: #cbd5e1;
}

@media (max-width: 767.98px) {
  .promo-poster-body {
    padding: 1.25rem;
  }

  .promo-poster-cta {
    width: 100%;
  }
}

/* Keep the multi-controller hours textboxes in a right-aligned vertical stack and align validation text with each input. */
.index-multi-hours-stack {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.index-multi-hours-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.pro-editor-card .card-body {
  display: flex;
  flex-direction: column;
}

/* Keep toolbar action buttons anchored while allowing long file names to shrink/truncate. */
.pro-editor-toolbar-row {
  min-width: 0;
}

/* Let the uploaded file name use only remaining space and shrink when needed. */
.pro-editor-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(0.78rem, 1.6vw, 1.25rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keep Undo/Redo/Maximize controls in a fixed-width, non-shrinking action block. */
.pro-editor-toolbar-actions {
  flex: 0 0 auto;
  white-space: nowrap;
}

.pro-page {
  position: relative;
  min-height: auto;
}

.pro-loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(2px);
  z-index: 20;
}

.pro-loading-overlay.show {
  display: flex;
}

.pro-loading-spinner,
.pro-loading-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pro-loading-progress.d-none,
.pro-loading-spinner.d-none {
  display: none !important;
}

.pro-progress-circle {
  --progress-value: 0;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: conic-gradient(#0d6efd calc(var(--progress-value) * 1%), #dce3ea 0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pro-progress-circle-inner {
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 50%;
  background: #fff;
  color: #0d6efd;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pro-layout-row {
  min-height: 0;
}

.pro-editor {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  height: 100%;
  min-height: 20rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  overflow: hidden;
  background-color: var(--bs-body-bg);
}

.pro-editor-toggle {
  line-height: 1;
  min-width: 2rem;
  padding-inline: 0.5rem;
}

.pro-editor-toggle-icon {
  display: inline-block;
  font-size: 1rem;
}

.pro-editor-toolbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
}

.pro-cursor-info-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.1rem;
}

.pro-cursor-location-label {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 14px;
  display: inline-block;
  cursor: pointer;
  user-select: text;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.pro-selection-size-label {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  display: inline-block;
  user-select: text;
  margin-top: 2px;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .pro-cursor-info-block {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
  }

  .pro-selection-size-label::before {
    content: "|";
    margin-right: 0.4rem;
    color: var(--bs-secondary-color, #6c757d);
  }
}

.pro-editor-history-btn:disabled {
  opacity: 0.65;
}

.pro-editor-status-success {
  color: #198754;
}

.pro-editor-status-error {
  color: #dc3545;
}

.pro-editor-status-info {
  color: #0d6efd;
}

/* Match the Fix Header Sizes button to the navbar green before header-size-relevant edits occur. */
.pro-fix-header-sizes-btn {
  color: #166534;
  border-color: #166534;
}

/* Keep the three PRO file action buttons equal in width/height and auto-shrink label text to fit one line. */
.pro-file-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: calc(1.5em + .75rem + 2px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  font-size: clamp(0.58rem, 1.35vw, 1rem);
  line-height: 1.2;
}

/* Keep the default hover state aligned with the navbar green styling. */
.pro-fix-header-sizes-btn:hover,
.pro-fix-header-sizes-btn:focus,
.pro-fix-header-sizes-btn:active {
  color: #fff;
  background-color: #166534;
  border-color: #166534;
}

/* Use a red warning state after inserts or deletes indicate header sizes may need fixing. */
.pro-fix-header-sizes-btn.pro-fix-header-sizes-btn-alert {
  color: #dc3545;
  border-color: #dc3545;
}

/* Preserve the red warning treatment while the user hovers or focuses the alert state. */
.pro-fix-header-sizes-btn.pro-fix-header-sizes-btn-alert:hover,
.pro-fix-header-sizes-btn.pro-fix-header-sizes-btn-alert:focus,
.pro-fix-header-sizes-btn.pro-fix-header-sizes-btn-alert:active {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

.pro-free-trial-label {
  color: #7c3aed;
  font-weight: 700;
}

.pro-layout-row.pro-editor-maximized {
  --bs-gutter-x: 0;
}

/* In PRO fullscreen mode, pin the editor column above global layout chrome and use the full viewport area. */
html.pro-editor-fullscreen-active,
body.pro-editor-fullscreen-active {
  overflow: hidden;
  overscroll-behavior: none;
}

/* Keep the fullscreen Monaco container fixed so it can consume navbar/footer/support line space. */
.pro-editor-column.pro-editor-column-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  margin: 0;
  padding: 0.75rem;
  background: var(--bs-body-bg, #fff);
  touch-action: none;
  overscroll-behavior: none;
}

/* Ensure the card and body inside the fullscreen column stretch to full height. */
.pro-editor-column.pro-editor-column-fullscreen .pro-editor-card,
.pro-editor-column.pro-editor-column-fullscreen .card-body {
  height: 100%;
}

/* Remove default viewport-based minimum heights in fullscreen so Monaco can shrink with the mobile keyboard. */
.pro-editor-column.pro-editor-column-fullscreen .pro-editor {
  min-height: 0;
  height: 100%;
}

/* Keep Monaco's own pointer handling authoritative during fullscreen drag operations on touch devices. */
.pro-editor-column.pro-editor-column-fullscreen .pro-editor,
.pro-editor-column.pro-editor-column-fullscreen .monaco-editor,
.pro-editor-column.pro-editor-column-fullscreen .monaco-editor .overflow-guard {
  touch-action: none;
  overscroll-behavior: none;
}

@media (max-width: 767.98px) {
  .index-option-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .jd-navbar .navbar-collapse {
    background-color: #166534;
  }

  /* Keep a small gap under the toggler so the expanded mobile menu does not cover the button edge. */
  .jd-navbar .navbar-collapse.show,
  .jd-navbar .navbar-collapse.collapsing {
    margin-top: 0.35rem;
  }

  .index-option-price {
    margin-left: 1.5rem;
  }

  .index-inline-input,
  .index-inline-select {
    width: 100%;
  }

  .pro-editor {
    min-height: 20rem;
  }

}