/* Motaz CV Builder v41.3 — complete dark surfaces, clean step navigation, and guarded swipe. */
:root {
  --v40-ink: #153747;
  --v40-blue: #17617f;
  --v40-blue-dark: #0d3143;
  --v40-gold: #efd29a;
  --v40-soft: #f3f8fa;
  --v40-line: #d8e4e9;
  --v40-success: #2d8b5c;
  --v40-shadow: 0 28px 90px rgba(5, 29, 42, .28);
}

body.v40-menu-open {
  overflow: hidden !important;
}

body.v40-builder .v39-guide-launcher,
body.v40-builder .v39-guide-backdrop,
body.v40-builder .v39-guide-drawer,
body.v40-builder .v40-menu-launcher,
body.v40-builder .v40-menu-backdrop,
body.v40-builder .v40-menu-drawer {
  display: none !important;
}

.v40-menu-launcher {
  position: fixed;
  z-index: 112;
  top: 50%;
  left: 11px;
  width: 54px;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 7px 5px;
  color: #fff;
  background: linear-gradient(145deg, #103649, #1d718f);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 17px;
  box-shadow: 0 16px 38px rgba(8, 42, 58, .28);
  transform: translateY(-50%);
  font-family: inherit;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.v40-menu-launcher:hover {
  transform: translateY(calc(-50% - 2px));
  box-shadow: 0 20px 48px rgba(8, 42, 58, .36);
}

.v40-menu-launcher > span {
  font-size: 19px;
  line-height: 1;
}

.v40-menu-launcher > b {
  font-size: 8px;
  font-weight: 900;
}

.v40-menu-backdrop {
  position: fixed;
  z-index: 170;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: rgba(4, 23, 33, .6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity .22s ease;
}

.v40-menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.v40-menu-drawer {
  position: fixed;
  z-index: 171;
  inset: 0 auto 0 0;
  width: min(420px, 94vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #2b4b59;
  background: #f6f9fa;
  border-right: 1px solid #d2e0e6;
  box-shadow: var(--v40-shadow);
  transform: translateX(-104%);
  transition: transform .26s cubic-bezier(.22, .8, .24, 1);
}

.v40-menu-drawer.open {
  transform: translateX(0);
}

.v40-menu-head {
  position: sticky;
  z-index: 3;
  top: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 11px;
  padding: 16px 17px;
  color: #fff;
  background: linear-gradient(135deg, #0d2e40, #1b6682);
  box-shadow: 0 8px 24px rgba(7, 38, 53, .14);
}

.v40-menu-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  align-content: center;
  color: #153c50;
  background: linear-gradient(145deg, #f5dfb5, #dfb967);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .54);
}

.v40-menu-logo b {
  font: 900 16px/1 Georgia, serif;
}

.v40-menu-logo small {
  margin-top: 2px;
  font-size: 5px;
  font-weight: 950;
}

.v40-menu-head > div {
  min-width: 0;
}

.v40-menu-head > div small {
  display: block;
  margin-bottom: 3px;
  opacity: .68;
  letter-spacing: .06em;
  font-size: 6.5px;
  font-weight: 900;
}

.v40-menu-head h2 {
  overflow: hidden;
  margin: 0;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.v40-menu-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .11);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
}

.v40-menu-body {
  display: grid;
  gap: 11px;
  padding: 14px 14px calc(22px + env(safe-area-inset-bottom));
}

.v40-menu-status {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--v40-line);
  border-radius: 17px;
  box-shadow: 0 9px 28px rgba(23, 67, 87, .07);
}

.v40-progress-orb {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--v40-success) var(--v40-progress), #e4edf0 0);
  border-radius: 50%;
}

.v40-progress-orb::before {
  content: "";
  grid-area: 1 / 1;
  width: 50px;
  height: 50px;
  background: #fff;
  border-radius: 50%;
}

.v40-progress-orb > span {
  z-index: 1;
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.v40-progress-orb b {
  color: #173f53;
  font-size: 12px;
}

.v40-progress-orb small {
  color: #82939b;
  font-size: 5px;
  font-weight: 950;
}

.v40-menu-status > div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.v40-menu-status > div:last-child > small {
  color: #a77a35;
  letter-spacing: .08em;
  font-size: 6px;
  font-weight: 950;
}

.v40-menu-status > div:last-child > b {
  color: #173e51;
  font-size: 13px;
}

.v40-menu-status p {
  margin: 0;
  color: #71838c;
  font-size: 7.5px;
  line-height: 1.55;
}

.v40-menu-section {
  padding: 13px;
  background: #fff;
  border: 1px solid var(--v40-line);
  border-radius: 17px;
}

.v40-section-title {
  min-height: 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.v40-section-title h3 {
  margin: 0;
  color: #173d50;
  font-size: 10px;
}

.v40-section-title > span {
  padding: 4px 7px;
  color: #687c85;
  background: #f0f5f7;
  border-radius: 999px;
  font-size: 6px;
  font-weight: 850;
}

.v40-step-grid {
  display: grid;
  gap: 5px;
}

.v40-step-grid button {
  min-height: 39px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  text-align: start;
  color: #3d5965;
  background: #f8fafb;
  border: 1px solid #e4ebee;
  border-radius: 11px;
  font-family: inherit;
  cursor: pointer;
}

.v40-step-grid button > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: #2d718b;
  background: #e8f3f7;
  border-radius: 9px;
  font-size: 7px;
  font-weight: 950;
}

.v40-step-grid button > b {
  font-size: 8.5px;
}

.v40-step-grid button > i {
  color: #9babb2;
  font-size: 14px;
  font-style: normal;
}

.v40-step-grid button.complete > span {
  color: #fff;
  background: var(--v40-success);
}

.v40-step-grid button.complete > span::after {
  content: "✓";
  position: absolute;
}

.v40-step-grid button.complete > span {
  color: transparent;
}

.v40-step-grid button.active {
  color: #173f53;
  background: #eef7fa;
  border-color: #86b7ca;
  box-shadow: 0 0 0 2px rgba(44, 130, 164, .09);
}

.v40-step-grid button.active > span {
  color: #153e52;
  background: var(--v40-gold);
}

.v40-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.v40-action-grid > button {
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  text-align: start;
  color: #35535f;
  background: #f7fafb;
  border: 1px solid #e1e9ec;
  border-radius: 13px;
  font-family: inherit;
  cursor: pointer;
}

.v40-action-grid > button:hover,
.v40-step-grid button:hover {
  background: #eef6f9;
  border-color: #a8c8d4;
}

.v40-action-grid > button > span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: #1d617d;
  background: #e7f2f6;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
}

.v40-action-grid > button > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.v40-action-grid b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
}

.v40-action-grid small {
  overflow: hidden;
  color: #819098;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 6px;
}

.v40-action-grid > button > i {
  color: #a3b2b9;
  font-size: 12px;
  font-style: normal;
}

.v40-setting-row {
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #edf1f3;
}

.v40-setting-row > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.v40-setting-row b {
  color: #345360;
  font-size: 8px;
}

.v40-setting-row small {
  color: #89979e;
  font-size: 6px;
}

.v40-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  background: #edf3f5;
  border-radius: 10px;
}

.v40-segmented button {
  min-width: 41px;
  min-height: 30px;
  color: #647981;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: 900 7px/1 Arial, sans-serif;
  cursor: pointer;
}

.v40-segmented button.active {
  color: #173f52;
  background: #fff;
  box-shadow: 0 3px 10px rgba(24, 69, 89, .12);
}

.v40-tools-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 9px;
}

.v40-tools-row button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  color: #49636e;
  background: #f7fafb;
  border: 1px solid #e1e9ec;
  border-radius: 11px;
  font-family: inherit;
  cursor: pointer;
}

.v40-tools-row button.active {
  color: #fff;
  background: #173f53;
  border-color: #173f53;
}

.v40-tools-row span {
  font-size: 13px;
}

.v40-tools-row b {
  font-size: 6.5px;
}

.v40-export-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.v40-export-row button {
  min-height: 53px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  color: #3e5965;
  background: #f8fafb;
  border: 1px solid #dfe8eb;
  border-radius: 12px;
  font-family: inherit;
  cursor: pointer;
}

.v40-export-row button:first-child {
  color: #173e51;
  background: #f8ecd4;
  border-color: #e5c887;
}

.v40-export-row span {
  font: 950 8px/1 Arial, sans-serif;
}

.v40-export-row b {
  font-size: 7px;
}

.v40-pro-note {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: #dcecf2;
  background: linear-gradient(145deg, #13394c, #1b5d77);
  border: 1px solid #2c728c;
  border-radius: 15px;
}

.v40-pro-note > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #163e52;
  background: var(--v40-gold);
  border-radius: 11px;
  font-size: 8px;
  font-weight: 950;
}

.v40-pro-note > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.v40-pro-note b {
  color: #fff;
  font-size: 8.5px;
}

.v40-pro-note small {
  opacity: .73;
  font-size: 6.5px;
  line-height: 1.45;
}

.v40-menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--v40-line);
  border-radius: 15px;
}

.v40-menu-footer > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.v40-menu-footer b {
  color: #34525f;
  font-size: 8px;
}

.v40-menu-footer small {
  overflow: hidden;
  color: #73868f;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 6.5px;
}

.v40-menu-footer a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  color: #fff;
  background: #1c6682;
  border-radius: 10px;
  font-size: 7px;
  font-weight: 900;
  text-decoration: none;
}

.v40-inline-progress {
  display: none;
}

.v40-top-step-nav {
  display: none;
}

.v40-focus-pulse {
  animation: v40FocusPulse 1.1s ease;
}

@keyframes v40FocusPulse {
  0%, 100% { box-shadow: inherit; }
  35% { box-shadow: 0 0 0 5px rgba(44, 137, 174, .2), 0 16px 38px rgba(19, 69, 91, .16); }
}

.v40-swipe-toast {
  position: fixed;
  z-index: 180;
  left: 50%;
  bottom: 150px;
  padding: 9px 14px;
  opacity: 0;
  color: #fff;
  background: rgba(13, 49, 67, .94);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(4, 30, 43, .24);
  transform: translate(-50%, 10px);
  font-size: 9px;
  font-weight: 900;
  transition: opacity .18s ease, transform .18s ease;
}

.v40-swipe-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

html.v30-dark .v40-menu-drawer,
html.v30-dark .v40-menu-body {
  color: #d9e6eb;
  background: #0d171c;
}

html.v30-dark .v40-menu-status,
html.v30-dark .v40-menu-section,
html.v30-dark .v40-menu-footer {
  background: #142329;
  border-color: #2d424b;
}

html.v30-dark .v40-progress-orb::before {
  background: #142329;
}

html.v30-dark .v40-menu-status > div:last-child > b,
html.v30-dark .v40-section-title h3,
html.v30-dark .v40-setting-row b,
html.v30-dark .v40-menu-footer b,
html.v30-dark .v40-progress-orb b {
  color: #e4eef2;
}

html.v30-dark .v40-step-grid button,
html.v30-dark .v40-action-grid > button,
html.v30-dark .v40-tools-row button,
html.v30-dark .v40-export-row button {
  color: #cad9df;
  background: #192a31;
  border-color: #31464f;
}

html.v30-dark .v40-setting-row {
  border-color: #293c44;
}

html.v30-dark .v40-segmented {
  background: #0d181d;
}

html.v30-dark .v40-segmented button.active {
  color: #fff;
  background: #285e74;
}

html.v30-dark .entry-card,
html.v30-dark .list-editor,
html.v30-dark .signature-footer-control,
html.v30-dark .library-save-card,
html.v30-dark .editable-backup-card,
html.v30-dark .saved-cv-card,
html.v30-dark .suggestion-box,
html.v30-dark .custom-section-card,
html.v30-dark .section-organizer,
html.v30-dark .v38-photo-nudges {
  color: #edf5f7 !important;
  background: #172831 !important;
  border-color: #465f6b !important;
  box-shadow: none !important;
}

html.v30-dark .entry-head b,
html.v30-dark .list-editor-title b,
html.v30-dark .signature-footer-control b,
html.v30-dark .library-save-card b,
html.v30-dark .editable-backup-card b,
html.v30-dark .saved-cv-card b,
html.v30-dark .suggestion-box b,
html.v30-dark .group-title b,
html.v30-dark .group-title small,
html.v30-dark .v38-photo-nudge-copy b,
html.v30-dark .v38-photo-nudge-copy small {
  color: #f1f7f9 !important;
}

html.v30-dark .entry-card .field > span,
html.v30-dark .entry-card label,
html.v30-dark .list-editor label,
html.v30-dark .signature-footer-control label,
html.v30-dark .suggestion-box small,
html.v30-dark .v26-field-hint {
  color: #c8d9e0 !important;
}

html.v30-dark .form-panel input::placeholder,
html.v30-dark .form-panel textarea::placeholder {
  color: #8fa6b0 !important;
  opacity: 1 !important;
}

html.v30-dark .entry-head button,
html.v30-dark .custom-field-row button,
html.v30-dark .list-item-row button {
  color: #ffb3a8 !important;
  background: #3a2021 !important;
  border-color: #744344 !important;
}

@media (max-width: 760px) {
  .v40-menu-launcher {
    top: auto;
    left: 10px;
    bottom: calc(96px + env(safe-area-inset-bottom));
    width: 47px;
    min-height: 52px;
    border-radius: 15px;
    transform: none;
  }

  .v40-menu-launcher:hover {
    transform: translateY(-2px);
  }

  .v40-menu-launcher > span {
    font-size: 17px;
  }

  .v40-menu-launcher > b {
    font-size: 7px;
  }

  .mobile-app-dock {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .mobile-app-dock .v40-menu-launcher {
    position: static !important;
    z-index: auto !important;
    inset: auto !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 61px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 5px 3px !important;
    gap: 4px !important;
    color: #445b67 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .mobile-app-dock .v40-menu-launcher:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .mobile-app-dock .v40-menu-launcher > span {
    width: 32px !important;
    height: 29px !important;
    display: grid !important;
    place-items: center !important;
    color: #315d72 !important;
    background: #e7f0f4 !important;
    border: 1px solid #c8d9e1 !important;
    border-radius: 9px !important;
    font-size: 17px !important;
    line-height: 1 !important;
  }

  .mobile-app-dock .v40-menu-launcher > b {
    display: block !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
  }

  .v40-menu-drawer {
    width: min(390px, 92vw);
    border-radius: 0 24px 24px 0;
  }

  .v40-menu-body {
    padding: 12px 12px calc(20px + env(safe-area-inset-bottom));
  }

  body.v40-builder .form-panel {
    padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
  }

  .section-journey-head {
    grid-template-columns: 82px minmax(0, 1fr) 82px !important;
    gap: 7px !important;
  }

  .journey-arrow.v40-journey-control {
    width: 82px !important;
    min-width: 82px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 5px 7px !important;
    font-size: 16px !important;
  }

  .journey-arrow.v40-journey-control > span {
    font-size: 17px;
    line-height: 1;
  }

  .journey-arrow.v40-journey-control > b {
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
  }

  .v40-top-step-nav {
    direction: inherit;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) 86px;
    align-items: stretch;
    gap: 7px;
    margin: -2px 0 18px;
    padding: 8px;
    background: linear-gradient(145deg, #f7fafb, #ebf2f5);
    border: 1px solid #cbdbe2;
    border-radius: 15px;
    box-shadow: 0 8px 22px rgba(13, 52, 70, .09);
  }

  .v40-top-step-nav > button {
    min-width: 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 6px;
    color: #163f53;
    background: #fff;
    border: 1px solid #bed2db;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 950;
  }

  .v40-top-step-nav > button > span {
    font-size: 17px;
    line-height: 1;
  }

  .v40-top-step-nav > button:disabled {
    opacity: .42;
    cursor: not-allowed;
  }

  .v40-top-step-current {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 5px;
    color: #fff;
    text-align: center;
    background: linear-gradient(135deg, #10384b, #23708d);
    border: 1px solid #2a7895;
    border-radius: 11px;
  }

  .v40-top-step-current small {
    color: #c9e2eb;
    font-size: 7.5px;
    font-weight: 800;
  }

  .v40-top-step-current b {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 950;
  }

  body.v40-builder .preview-stage {
    padding-bottom: calc(108px + env(safe-area-inset-bottom)) !important;
  }

  body.v40-builder .form-step-actions {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 22px 0 0 !important;
    padding: 9px !important;
    background: linear-gradient(145deg, #f8fbfc, #eef4f7) !important;
    border: 1px solid #cfdde4 !important;
    border-radius: 17px !important;
    box-shadow: 0 12px 30px rgba(18, 59, 78, .1) !important;
    transform: none !important;
  }

  .form-step-actions .v40-inline-progress {
    position: relative;
    grid-column: 1 / -1;
    order: 0;
    min-width: 0;
    min-height: 51px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    overflow: hidden;
    padding: 7px 10px;
    color: #fff;
    background: linear-gradient(135deg, #11394d, #1d6985);
    border: 1px solid #2b718c;
    border-radius: 12px;
  }

  .form-step-actions .v40-inline-progress::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    width: var(--v40-inline-progress, 20%);
    height: 3px;
    background: linear-gradient(90deg, #e4bd70, #f3dca9);
    transition: width .2s ease;
  }

  .v40-inline-progress > span {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #173c4f;
    background: #f1d7a3;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 950;
  }

  .v40-inline-progress > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .v40-inline-progress small {
    opacity: .7;
    font-size: 7px;
    font-weight: 800;
  }

  .v40-inline-progress b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 950;
  }

  body.v40-builder .form-step-actions > button {
    position: static !important;
    min-width: 0 !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 9px 8px !important;
    color: #254958 !important;
    background: #fff !important;
    border: 1px solid #cbd9df !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    transform: none !important;
    font-size: 12px !important;
    font-weight: 900 !important;
  }

  body.v40-builder .form-step-actions > button:first-of-type {
    order: 1;
  }

  body.v40-builder .form-step-actions > button:last-of-type {
    order: 2;
  }

  body.v40-builder .form-step-actions .form-preview-button {
    grid-column: 1 / -1 !important;
    order: 3 !important;
    color: #fff !important;
    background: linear-gradient(135deg, #153f55, #246f8c) !important;
    border-color: #286d87 !important;
  }

  body.v40-builder .form-step-actions > button:disabled {
    opacity: .42 !important;
    cursor: not-allowed !important;
  }

  html.v30-dark .mobile-app-dock .v40-menu-launcher {
    color: #d3e0e5 !important;
  }

  html.v30-dark .mobile-app-dock .v40-menu-launcher > span {
    color: #d7e5eb !important;
    background: #203640 !important;
    border-color: #3a515c !important;
  }

  html.v30-dark body.v40-builder .form-step-actions {
    background: #132229 !important;
    border-color: #314750 !important;
  }

  html.v30-dark body.v40-builder .form-step-actions > button {
    color: #d9e6eb !important;
    background: #1a2b32 !important;
    border-color: #354b55 !important;
  }

  html.v30-dark .v40-top-step-nav {
    background: #101d23 !important;
    border-color: #3d545f !important;
  }

  html.v30-dark .v40-top-step-nav > button {
    color: #eef5f7 !important;
    background: #1a2d36 !important;
    border-color: #49636f !important;
  }

  html.v30-dark .journey-arrow.v40-journey-control {
    color: #eef7fa !important;
    background: #1b3039 !important;
    border-color: #4b6976 !important;
  }

  html.v30-dark .journey-arrow.v40-journey-control:disabled {
    color: #80959e !important;
    background: #111f26 !important;
    border-color: #304650 !important;
  }
}

@media (max-width: 390px) {
  .v40-action-grid {
    grid-template-columns: 1fr;
  }

  .mobile-app-dock .v40-menu-launcher > b {
    font-size: 8px !important;
  }
}

@media print {
  .v40-menu-launcher,
  .v40-menu-backdrop,
  .v40-menu-drawer,
  .v40-inline-progress,
  .v40-swipe-toast {
    display: none !important;
  }
}

/* v41.3: one consistent, accessible surface map for the whole builder. */
body.v40-builder button:focus-visible,
body.v40-builder a:focus-visible,
body.v40-builder input:focus-visible,
body.v40-builder textarea:focus-visible,
body.v40-builder select:focus-visible,
body.v40-builder summary:focus-visible {
  outline: 3px solid #48a6ca !important;
  outline-offset: 2px !important;
}

html.v30-dark body.v40-builder {
  --v41-bg: #091318;
  --v41-surface: #12232b;
  --v41-raised: #192f39;
  --v41-control: #0d1b21;
  --v41-border: #405c68;
  --v41-border-soft: #304852;
  --v41-text: #f2f7f9;
  --v41-muted: #bfd0d7;
  --v41-subtle: #96adb7;
  --v41-gold: #f0d59f;
  --v41-danger: #ffb8ae;
}

html.v30-dark body.v40-builder .editor-head,
html.v30-dark body.v40-builder .v26-builder-map,
html.v30-dark body.v40-builder .format-switcher,
html.v30-dark body.v40-builder .template-switcher,
html.v30-dark body.v40-builder .completion-card,
html.v30-dark body.v40-builder .workspace-dashboard,
html.v30-dark body.v40-builder .section-journey,
html.v30-dark body.v40-builder .panel-route-tip,
html.v30-dark body.v40-builder .v26-context-guide,
html.v30-dark body.v40-builder .form-panel,
html.v30-dark body.v40-builder .photo-editor,
html.v30-dark body.v40-builder .flexible-group,
html.v30-dark body.v40-builder .entry-card,
html.v30-dark body.v40-builder .list-editor,
html.v30-dark body.v40-builder .signature-footer-control,
html.v30-dark body.v40-builder .custom-section-card,
html.v30-dark body.v40-builder .section-organizer,
html.v30-dark body.v40-builder .preview-toolbar,
html.v30-dark body.v40-builder .preview-design-studio,
html.v30-dark body.v40-builder .selected-design-bar,
html.v30-dark body.v40-builder .preview-save-card,
html.v30-dark body.v40-builder .creator-credit {
  color: var(--v41-text) !important;
  background: var(--v41-surface) !important;
  border-color: var(--v41-border) !important;
  box-shadow: none !important;
}

html.v30-dark body.v40-builder .entry-card,
html.v30-dark body.v40-builder .list-editor,
html.v30-dark body.v40-builder .signature-footer-control,
html.v30-dark body.v40-builder .custom-section-card,
html.v30-dark body.v40-builder .section-organizer,
html.v30-dark body.v40-builder .photo-editor,
html.v30-dark body.v40-builder .flexible-group {
  background: var(--v41-raised) !important;
}

html.v30-dark body.v40-builder .editor-head h1,
html.v30-dark body.v40-builder .v26-map-head b,
html.v30-dark body.v40-builder .v26-map-steps b,
html.v30-dark body.v40-builder .panel-heading h2,
html.v30-dark body.v40-builder .format-heading span,
html.v30-dark body.v40-builder .template-switcher b,
html.v30-dark body.v40-builder .completion-info b,
html.v30-dark body.v40-builder .workspace-dashboard b,
html.v30-dark body.v40-builder .journey-current b,
html.v30-dark body.v40-builder .panel-route-tip b,
html.v30-dark body.v40-builder .v26-context-guide b,
html.v30-dark body.v40-builder .photo-editor b,
html.v30-dark body.v40-builder .group-title b,
html.v30-dark body.v40-builder .entry-head b,
html.v30-dark body.v40-builder .list-editor-title b,
html.v30-dark body.v40-builder .preview-studio-head b,
html.v30-dark body.v40-builder .preview-save-copy b,
html.v30-dark body.v40-builder .creator-credit b {
  color: var(--v41-text) !important;
}

html.v30-dark body.v40-builder .editor-head p,
html.v30-dark body.v40-builder .v26-map-head small,
html.v30-dark body.v40-builder .v26-map-steps small,
html.v30-dark body.v40-builder .panel-heading p,
html.v30-dark body.v40-builder .format-heading small,
html.v30-dark body.v40-builder .template-switcher small,
html.v30-dark body.v40-builder .completion-info span,
html.v30-dark body.v40-builder .workspace-dashboard small,
html.v30-dark body.v40-builder .journey-current small,
html.v30-dark body.v40-builder .panel-route-tip p,
html.v30-dark body.v40-builder .v26-context-guide li,
html.v30-dark body.v40-builder .photo-editor small,
html.v30-dark body.v40-builder .group-title small,
html.v30-dark body.v40-builder .v26-field-hint,
html.v30-dark body.v40-builder .preview-studio-head small,
html.v30-dark body.v40-builder .preview-save-copy span,
html.v30-dark body.v40-builder .preview-save-copy small,
html.v30-dark body.v40-builder .creator-credit span {
  color: var(--v41-muted) !important;
}

html.v30-dark body.v40-builder .eyebrow,
html.v30-dark body.v40-builder .v26-map-head > span,
html.v30-dark body.v40-builder .panel-heading > span {
  color: var(--v41-gold) !important;
}

html.v30-dark body.v40-builder .sample-data-alert {
  color: #fff0cf !important;
  background: #30281b !important;
  border-color: #80663a !important;
}

html.v30-dark body.v40-builder .sample-data-alert b,
html.v30-dark body.v40-builder .sample-data-alert p {
  color: #fff0cf !important;
}

html.v30-dark body.v40-builder .panel-route-tip > span {
  color: #142630 !important;
  background: #f0d59f !important;
  border-color: #d0aa5e !important;
}

html.v30-dark body.v40-builder .sample-data-alert p {
  opacity: .86 !important;
}

html.v30-dark body.v40-builder .progress-track,
html.v30-dark body.v40-builder .journey-progress {
  background: #293e47 !important;
}

html.v30-dark body.v40-builder .field > span,
html.v30-dark body.v40-builder .entry-card label,
html.v30-dark body.v40-builder .list-editor label,
html.v30-dark body.v40-builder .signature-footer-control label {
  color: var(--v41-muted) !important;
}

html.v30-dark body.v40-builder .field input,
html.v30-dark body.v40-builder .field textarea,
html.v30-dark body.v40-builder .custom-field-row input,
html.v30-dark body.v40-builder .custom-field-row textarea,
html.v30-dark body.v40-builder .list-item-row input,
html.v30-dark body.v40-builder .list-item-row textarea,
html.v30-dark body.v40-builder select {
  color: var(--v41-text) !important;
  background: var(--v41-control) !important;
  border-color: var(--v41-border) !important;
  caret-color: #75c4e2 !important;
}

html.v30-dark body.v40-builder input::placeholder,
html.v30-dark body.v40-builder textarea::placeholder {
  color: var(--v41-subtle) !important;
  opacity: 1 !important;
}

html.v30-dark body.v40-builder .section-journey .panel-tabs,
html.v30-dark body.v40-builder .preview-design-tabs,
html.v30-dark body.v40-builder .template-language-toggle,
html.v30-dark body.v40-builder .preview-more > div {
  color: var(--v41-muted) !important;
  background: var(--v41-control) !important;
  border-color: var(--v41-border-soft) !important;
}

html.v30-dark body.v40-builder .section-journey .panel-tabs button,
html.v30-dark body.v40-builder .format-buttons button,
html.v30-dark body.v40-builder .template-buttons button,
html.v30-dark body.v40-builder .journey-arrow,
html.v30-dark body.v40-builder .journey-library,
html.v30-dark body.v40-builder .template-language-toggle button,
html.v30-dark body.v40-builder .inline-title-toggle,
html.v30-dark body.v40-builder .compare-toggle,
html.v30-dark body.v40-builder .design-cycle,
html.v30-dark body.v40-builder .preview-actions button,
html.v30-dark body.v40-builder .preview-actions summary,
html.v30-dark body.v40-builder .preview-more > div button,
html.v30-dark body.v40-builder .preview-save-actions button,
html.v30-dark body.v40-builder .workspace-dashboard-actions button,
html.v30-dark body.v40-builder .sample-alert-actions button,
html.v30-dark body.v40-builder .photo-actions button,
html.v30-dark body.v40-builder .add-button,
html.v30-dark body.v40-builder .mini-add-button,
html.v30-dark body.v40-builder .form-step-actions button:not(.form-preview-button) {
  color: var(--v41-text) !important;
  background: var(--v41-control) !important;
  border-color: var(--v41-border) !important;
}

html.v30-dark body.v40-builder .section-journey .panel-tabs button.active,
html.v30-dark body.v40-builder .format-buttons button.active,
html.v30-dark body.v40-builder .template-buttons button.active,
html.v30-dark body.v40-builder .template-language-toggle button.active {
  color: #fff !important;
  background: linear-gradient(135deg, #17475d, #237491) !important;
  border-color: #4f9ab7 !important;
}

html.v30-dark body.v40-builder .preview-design-tabs > button {
  color: var(--v41-muted) !important;
  background: var(--v41-raised) !important;
  border-color: var(--v41-border) !important;
}

html.v30-dark body.v40-builder .preview-design-tabs > button b {
  color: var(--v41-text) !important;
}

html.v30-dark body.v40-builder .preview-design-tabs > button small {
  color: var(--v41-muted) !important;
}

html.v30-dark body.v40-builder .preview-design-tabs > button.active {
  color: #fff7e8 !important;
  background: linear-gradient(145deg, #513f22, #362d20) !important;
  border-color: #d1af68 !important;
  box-shadow: inset 0 0 0 1px rgba(240, 213, 159, .14) !important;
}

html.v30-dark body.v40-builder .preview-design-tabs > button.active b,
html.v30-dark body.v40-builder .preview-design-tabs > button.active small {
  color: #fff1d1 !important;
}

html.v30-dark body.v40-builder .selected-design-bar small,
html.v30-dark body.v40-builder .selected-design-bar b {
  color: var(--v41-text) !important;
}

html.v30-dark body.v40-builder .selected-design-bar em,
html.v30-dark body.v40-builder .ats-chip {
  color: #12354a !important;
  background: #dff1f7 !important;
  border-color: #b9dbe7 !important;
}

html.v30-dark body.v40-builder .preview-note,
html.v30-dark body.v40-builder .preview-note a {
  color: var(--v41-muted) !important;
}

html.v30-dark body.v40-builder .creator-credit a[href^="mailto:"] {
  color: #dff4fb !important;
  background: #183b4b !important;
  border-color: #4f7c8e !important;
}

html.v30-dark body.v40-builder .creator-credit a:not([href^="mailto:"]) {
  color: var(--v41-gold) !important;
  border-color: transparent !important;
  background: transparent !important;
}

html.v30-dark body.v40-builder .entry-head button,
html.v30-dark body.v40-builder .custom-field-row button,
html.v30-dark body.v40-builder .list-item-row button {
  color: var(--v41-danger) !important;
  background: #402527 !important;
  border-color: #7a484b !important;
}

html.v30-dark body.v40-builder .preview-canvas,
html.v30-dark body.v40-builder .preview-stage {
  background-color: var(--v41-bg) !important;
}

html.v30-dark body.v40-builder .cv-sheet,
html.v30-dark body.v40-builder #cv-document {
  color-scheme: light !important;
  color: #202020 !important;
  background: #fff !important;
}

@media (max-width: 760px) {
  body.v40-builder .v40-top-step-nav {
    display: none !important;
  }

  body.v40-builder .section-journey-head {
    grid-template-columns: 88px minmax(0, 1fr) 88px !important;
    gap: 8px !important;
    padding: 9px !important;
  }

  body.v40-builder .journey-arrow.v40-journey-control {
    width: 88px !important;
    min-width: 88px !important;
    min-height: 48px !important;
    border-radius: 12px !important;
  }

  body.v40-builder .journey-arrow.v40-journey-control > b {
    font-size: 11px !important;
  }

  body.v40-builder .mobile-app-dock {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  html.v30-dark body.v40-builder .mobile-switch {
    background: var(--v41-control) !important;
    border-color: var(--v41-border) !important;
  }

  html.v30-dark body.v40-builder .mobile-switch button {
    color: var(--v41-muted) !important;
    background: transparent !important;
  }

  html.v30-dark body.v40-builder .mobile-switch button.active {
    color: #fff !important;
    background: #1b536a !important;
  }

  html.v30-dark body.v40-builder .mobile-app-dock {
    background: rgba(13, 27, 33, .98) !important;
    border-color: var(--v41-border) !important;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .42) !important;
  }

  html.v30-dark body.v40-builder .mobile-app-dock button {
    color: var(--v41-muted) !important;
    background: transparent !important;
  }

  html.v30-dark body.v40-builder .mobile-app-dock button > span {
    color: #d9e9ef !important;
    background: #1d3540 !important;
    border-color: #405c68 !important;
  }

  html.v30-dark body.v40-builder .mobile-app-dock button.active {
    color: #fff !important;
    background: #1a4152 !important;
    box-shadow: inset 0 0 0 1px #4a7182 !important;
  }

  html.v30-dark body.v40-builder .mobile-app-dock .dock-save {
    color: #ffe7b7 !important;
    background: #3d321f !important;
    box-shadow: inset 0 0 0 1px #826a3d !important;
  }

  html.v30-dark body.v40-builder .mobile-app-dock .dock-save > span {
    color: #ffe7b7 !important;
    background: #514226 !important;
    border-color: #9a7b42 !important;
  }
}
