/* Mainselfly worker profile — editor consistency fixes (2026-08-09). */

/* Double-tap/page zoom is locked by the iOS viewport configuration.
   Do not intercept DOM gestures here: inputs, labels and scrolling must keep
   their native touch/focus path so keyboard presentation stays responsive. */

.worker-editor-dialog[data-editor-section="goals"] label {
  font-size: 12px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
  color: #334155 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.worker-editor-dialog textarea,
.worker-structured-dialog textarea {
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 44px !important;
  height: auto !important;
  max-height: 180px !important;
  field-sizing: content;
  overflow-y: auto !important;
  line-height: 1.45 !important;
}

.worker-editor-dialog[data-editor-section="goals"] textarea {
  min-height: 96px !important;
  max-height: 220px !important;
  padding-top: 13px !important;
  padding-bottom: 13px !important;
}

.worker-structured-dialog article,
.worker-structured-dialog article .grid,
.worker-structured-dialog article .grid > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

/* Month/date fields are used by Esperienze, Formazione, Certificazioni and Portfolio.
   Match the exact available width of ordinary text inputs. Removing the native
   appearance prevents WKWebView's intrinsic month-control width from overflowing,
   so no artificial 20px reserve is needed. */
.worker-structured-dialog input[type="month"] {
  display: block !important;
  box-sizing: border-box !important;
  inline-size: 100% !important;
  width: 100% !important;
  min-inline-size: 0 !important;
  min-width: 0 !important;
  max-inline-size: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  min-height: 44px !important;
  height: 44px !important;
  padding: 0 12px !important;
  line-height: normal !important;
  overflow: hidden !important;
  text-transform: capitalize !important;
  border-radius: 12px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.worker-structured-dialog article div:has(> input[type="month"]) {
  box-sizing: border-box !important;
  inline-size: 100% !important;
  width: 100% !important;
  min-inline-size: 0 !important;
  min-width: 0 !important;
  max-inline-size: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

/* Existing backend values can pre-date the capitalization rule. Keep their visual
   presentation coherent without changing technical values such as ids or dates. */
.worker-structured-dialog article p::first-letter {
  text-transform: uppercase;
}

.worker-structured-dialog select {
  text-transform: capitalize;
}

@supports (-webkit-touch-callout: none) {
  .worker-structured-dialog input[type="month"] {
    inline-size: -webkit-fill-available !important;
    width: -webkit-fill-available !important;
    max-inline-size: -webkit-fill-available !important;
    max-width: -webkit-fill-available !important;
  }

  .worker-structured-dialog input[type="month"]::-webkit-date-and-time-value {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    text-align: left !important;
    text-transform: capitalize !important;
  }

  .worker-structured-dialog input[type="month"]::-webkit-datetime-edit,
  .worker-structured-dialog input[type="month"]::-webkit-datetime-edit-month-field {
    display: flex !important;
    max-width: 100% !important;
    height: 100% !important;
    align-items: center !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    text-transform: capitalize !important;
  }
}

main.mx-auto.max-w-2xl section:has(> div:first-child .lucide-external-link)
  > div:last-child
  a:not([class*="sm:col-span-2"])
  span.mt-1.block.truncate {
  display: none !important;
}

main.mx-auto.max-w-2xl section:has(> div:first-child .lucide-external-link)
  > div:last-child
  a:not([class*="sm:col-span-2"]) {
  min-height: 54px !important;
  padding: 12px 14px !important;
}

main.mx-auto.max-w-2xl section:has(> div:first-child .lucide-external-link)
  > div:last-child
  a:not([class*="sm:col-span-2"])
  > span:first-child {
  display: flex !important;
  align-items: center !important;
}

.worker-editor-dialog [data-slot="dialog-description"],
.worker-structured-dialog [data-slot="dialog-description"] {
  font-size: 13px !important;
  line-height: 1.5 !important;
  font-weight: 500 !important;
  color: #7c8aa0 !important;
}

.worker-editor-dialog [class*="text-[11px]"][class*="font-medium"],
.worker-editor-dialog [class*="text-[11px]"][class*="font-semibold"],
.worker-structured-dialog [class*="text-[11px]"][class*="font-medium"],
.worker-structured-dialog [class*="text-[11px]"][class*="font-semibold"],
.worker-editor-dialog [class*="text-xs"][class*="text-slate-500"],
.worker-structured-dialog [class*="text-xs"][class*="text-slate-500"] {
  font-size: 12.5px !important;
  line-height: 1.5 !important;
}

.worker-editor-dialog [class*="text-[10px]"][class*="text-slate-400"],
.worker-structured-dialog [class*="text-[10px]"][class*="text-slate-400"] {
  font-size: 11.5px !important;
  line-height: 1.45 !important;
}

html.dark .worker-editor-dialog[data-editor-section="goals"] label {
  color: #cbd5e1 !important;
}

html.dark .worker-editor-dialog [data-slot="dialog-description"],
html.dark .worker-structured-dialog [data-slot="dialog-description"] {
  color: #aeb8c7 !important;
}

/* iOS keyboard-safe editor internals. Resize=None keeps the modal fixed.
   Only the existing action bar is lifted; its own safe-area padding is removed
   while the keyboard is visible so it stays compact instead of becoming a tall
   second white panel. */
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-editor-dialog > div:last-child,
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-structured-dialog > div:last-child {
  position: relative;
  z-index: 90;
  transform: translateY(var(--mainselfly-editor-keyboard-shift, 0px)) !important;
  transition: transform 180ms ease-out !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  min-height: 0 !important;
}

html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-editor-dialog > div:last-child {
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.07);
}

html.dark[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-editor-dialog > div:last-child {
  background: rgba(22, 34, 53, 0.97);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.18);
}

/* The modal stays fixed, but its scrolling content gets a temporary tail while
   the keyboard is open. This is what allows the actual last field to scroll
   completely above the lifted action bar. */
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-editor-dialog > .space-y-5 {
  padding-bottom: var(--mainselfly-editor-scroll-reserve, 0px) !important;
}

html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-structured-dialog > div.min-h-0.flex-1.overflow-y-auto {
  padding-bottom: var(--mainselfly-editor-scroll-reserve, 0px) !important;
}

html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-editor-dialog input,
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-editor-dialog textarea,
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-editor-dialog select,
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-structured-dialog input,
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-structured-dialog textarea,
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-structured-dialog select {
  scroll-margin-bottom: calc(var(--mainselfly-editor-keyboard-overlap, 0px) + 72px);
}

/* CV Studio riusa il contratto nativo di Cosa sto cercando: la sheet resta
   ancorata, il footer sale sopra la tastiera e il corpo conserva spazio
   sufficiente per scorrere realmente fino all'ultimo contenuto. */
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-cv-studio [data-cv-studio-footer] {
  position: relative;
  z-index: 90;
  transform: translateY(var(--mainselfly-editor-keyboard-shift, 0px)) !important;
  transition: transform 180ms ease-out !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-cv-studio [data-cv-studio-scroll-area] {
  padding-bottom: var(--mainselfly-editor-scroll-reserve, 0px) !important;
  scroll-padding-bottom: var(--mainselfly-editor-scroll-reserve, 0px) !important;
}

html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-cv-studio input,
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-cv-studio textarea,
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .worker-cv-studio select {
  scroll-margin-bottom: calc(var(--mainselfly-editor-keyboard-overlap, 0px) + 72px);
}

/* 2026-09-13 — Pubblica annuncio riusa il contratto tastiera degli editor Worker.
   Il footer sale sopra la tastiera e il modulo riceve una coda reale di scroll,
   così anche l'ultimo campo rimane raggiungibile durante la compilazione. */
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .job-publication-shell [data-job-publication-footer] {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 95;
  width: calc(100% - 32px);
  max-width: 648px;
  transform: translate(-50%, var(--mainselfly-editor-keyboard-shift, 0px)) !important;
  transition: transform 180ms ease-out !important;
  padding: 8px !important;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

html.dark[data-native-platform="ios"][data-native-keyboard-open="true"]
  .job-publication-shell [data-job-publication-footer] {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(14, 22, 33, 0.97);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);
}

html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .job-publication-shell [data-job-publication-scroll-area] {
  padding-bottom: var(--mainselfly-editor-scroll-reserve, 0px) !important;
}

html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .job-publication-shell input,
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .job-publication-shell textarea,
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .job-publication-shell select,
html[data-native-platform="ios"][data-native-keyboard-open="true"]
  .job-publication-shell button[role="radio"] {
  scroll-margin-bottom: calc(var(--mainselfly-editor-keyboard-overlap, 0px) + 76px);
}
