@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.tattoo-form-widget,
.tattoo-form-widget * {
  box-sizing: border-box;
}

.tattoo-form-widget {
  --ink-header-bg: #075E54;
  --ink-header-text: #FFFFFF;
  --ink-accent-text: #FFFFFF;
  --wa-green-dark: #008069;
  --wa-green: #008069;
  --wa-green-soft: #008069;
  --wa-accent: #25D366;
  --wa-chat-bg: #EFEAE2;
  --wa-panel: #F0F2F5;
  --wa-white: #FFFFFF;
  --wa-text: #111B21;
  --wa-muted: #667781;
  --wa-border: #DADDE1;
  --wa-user-bubble: #D9FDD3;
  --wa-bot-bubble: #FFFFFF;
  --wa-danger: #D93025;

  width: min(100%, 640px);
  min-height: min(720px, 100svh);
  margin: 0 auto;
  font-family: 'Inter', Arial, sans-serif;
  color: var(--wa-text);
  background:
    radial-gradient(circle at 18px 18px, rgba(0, 0, 0, 0.045) 1px, transparent 1.6px) 0 0 / 38px 38px,
    radial-gradient(circle at 32px 30px, rgba(255,255,255,0.36) 1px, transparent 1.7px) 0 0 / 48px 48px,
    var(--wa-chat-bg);
  border: 1px solid var(--wa-border);
  border-radius: 22px;
  overflow: clip;
  box-shadow: none;
  position: relative;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
}

.tfw-header {
  background: var(--ink-header-bg);
  color: var(--ink-header-text);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.tfw-avatar {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(127, 127, 127, 0.18);
  display: grid;
  place-items: center;
  font-weight: 700;
  border: 2px solid var(--ink-header-text);
  flex: 0 0 auto;
  overflow: hidden;
}

.tfw-avatar img {
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  max-width: none !important;
  display: block !important;
  object-fit: cover !important;
  object-position: 50% 50% !important;
  transform: translate(var(--ink-avatar-tx, 0%), var(--ink-avatar-ty, 0%)) scale(var(--ink-avatar-zoom, 1)) !important;
  transform-origin: 50% 50% !important;
}

.tfw-avatar img.tfw-avatar-cropped {
  position: absolute !important;
  min-width: 0 !important;
  object-fit: fill !important;
}

.tfw-header-main {
  min-width: 0;
  flex: 1;
}

.tfw-title {
  display: block;
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tfw-subtitle {
  display: block;
  margin-top: 0.22rem;
  color: currentColor;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tfw-subtitle.is-empty {
  display: none;
}

.tfw-step-count {
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(127, 127, 127, 0.18);
  padding: 0.4rem 0.62rem;
  border-radius: 999px;
  white-space: nowrap;
}

.tfw-progress-track {
  position: sticky;
  top: 82px;
  z-index: 49;
  height: 4px;
  background: var(--wa-border);
}

.tfw-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--wa-accent);
  transition: width 0.35s ease;
}

.tfw-chat {
  min-height: calc(100svh - 86px);
  padding: 1rem 0.85rem 1.4rem;
  overflow: visible;
  scroll-behavior: smooth;
}

.tfw-chat-stream {
  min-height: calc(100svh - 128px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.45rem;
  padding-top: 0.9rem;
  padding-bottom: clamp(140px, 34svh, 280px);
}

.tfw-message-row {
  display: flex;
  align-items: flex-start;
  animation: tfwMessageIn 0.22s ease both;
}

.tfw-message-row.bot { justify-content: flex-start; }
.tfw-message-row.user { justify-content: flex-end; }
.tfw-message-row.answer { justify-content: flex-end; }

.tfw-bubble {
  width: fit-content;
  max-width: min(86%, 460px);
  border-radius: 14px;
  padding: 0.72rem 0.86rem;
  box-shadow: 0 1px 1px rgba(17, 27, 33, 0.09);
  position: relative;
  line-height: 1.42;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  background: var(--wa-bot-bubble);
  color: var(--wa-text);
  font-size: 0.98rem;
}

.tfw-message-row.bot .tfw-bubble {
  background: var(--wa-bot-bubble);
  border-top-left-radius: 5px;
}

.tfw-message-row.user .tfw-bubble {
  background: var(--wa-user-bubble);
  border-top-right-radius: 5px;
}

.tfw-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  min-width: 58px;
  min-height: 36px;
}

.tfw-typing-bubble span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wa-muted);
  animation: tfwTyping 1.05s infinite ease-in-out;
}

.tfw-typing-bubble span:nth-child(2) { animation-delay: 0.16s; }
.tfw-typing-bubble span:nth-child(3) { animation-delay: 0.32s; }

.tfw-active-answer {
  width: fit-content;
  max-width: min(88%, 520px);
  margin: 0.2rem 0 0.55rem auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.48rem;
}

.tfw-active-answer-choice {
  width: 100%;
  max-width: 100%;
  margin-right: 0;
  margin-left: 0;
}

.tfw-inline-form {
  width: 100%;
  margin: 0;
  padding: 0;
}

.tfw-inline-input-row {
  width: min(100%, 520px);
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  background: var(--wa-user-bubble);
  border: 1px solid var(--wa-border);
  border-radius: 16px 5px 16px 16px;
  padding: 0.58rem 0.58rem 0.58rem 0.72rem;
  box-shadow: 0 1px 1px rgba(17, 27, 33, 0.08);
}

.tfw-inline-field {
  width: 100%;
  min-width: 175px;
  border: none !important;
  background: transparent !important;
  color: var(--wa-text) !important;
  font-family: inherit !important;
  font-size: 16px !important;
  line-height: 1.35 !important;
  border-radius: 0 !important;
  padding: 0.45rem 0.25rem !important;
  outline: none !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

textarea.tfw-inline-field {
  resize: none;
  min-height: 74px;
  max-height: 150px;
}

.tfw-inline-field:focus {
  border-color: transparent !important;
  box-shadow: none !important;
}

.tfw-inline-field::placeholder {
  color: var(--wa-muted);
}

.tfw-send-inline {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50% !important;
  border: none !important;
  background: var(--wa-green) !important;
  color: var(--ink-accent-text) !important;
  display: grid;
  place-items: center;
  cursor: pointer;
  font: inherit !important;
  font-size: 1.25rem !important;
  line-height: 1 !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.tfw-send-inline:hover,
.tfw-send-inline:focus,
.tfw-send-inline:active {
  background: var(--wa-green) !important;
  color: var(--ink-accent-text) !important;
  filter: brightness(0.9);
  outline: none !important;
  box-shadow: none !important;
}

.tfw-send-inline span {
  transform: translateX(1px);
}

.tfw-inline-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.46rem;
  justify-content: flex-start;
  background: var(--wa-panel);
  border: 1px solid var(--wa-border);
  border-radius: 18px;
  padding: 0.66rem;
}

.tfw-choice {
  border: 1px solid var(--wa-green) !important;
  background: var(--wa-white) !important;
  color: var(--wa-green) !important;
  border-radius: 999px !important;
  padding: 0.64rem 0.82rem !important;
  cursor: pointer;
  font: inherit !important;
  font-size: 0.90rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tfw-choice:hover,
.tfw-choice:focus,
.tfw-choice:active,
.tfw-choice.selected {
  background: var(--wa-user-bubble) !important;
  color: var(--wa-green) !important;
  border-color: var(--wa-accent) !important;
  outline: none !important;
  box-shadow: 0 0 0 2px var(--wa-border) !important;
}

.tfw-back-inline {
  align-self: flex-start;
  border: none !important;
  background: transparent !important;
  color: var(--wa-muted) !important;
  cursor: pointer;
  font: inherit !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  padding: 0.35rem 0.15rem !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.tfw-back-inline:hover,
.tfw-back-inline:focus,
.tfw-back-inline:active {
  color: var(--wa-green) !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

.tfw-error {
  min-height: 1.05em;
  color: var(--wa-danger);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.tfw-summary-card {
  background: var(--wa-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(17, 27, 33, 0.08);
  margin: 0.35rem 0 0.6rem;
  border: 1px solid var(--wa-border);
}

.tfw-summary-title {
  padding: 0.86rem 0.9rem;
  font-weight: 800;
  color: var(--wa-text);
  background: var(--wa-panel);
  border-bottom: 1px solid var(--wa-border);
}

.tfw-summary-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.78rem 0.9rem;
  border-bottom: 1px solid var(--wa-border);
}

.tfw-summary-row:last-child { border-bottom: none; }

.tfw-summary-text { min-width: 0; }

.tfw-summary-label {
  display: block;
  color: var(--wa-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.22rem;
}

.tfw-summary-value {
  display: block;
  font-size: 0.92rem;
  color: var(--wa-text);
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.tfw-summary-edit {
  flex: 0 0 auto;
  border: 1px solid var(--wa-green) !important;
  background: var(--wa-white) !important;
  color: var(--wa-green) !important;
  border-radius: 999px !important;
  padding: 0.45rem 0.68rem !important;
  cursor: pointer;
  font: inherit !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}

.tfw-summary-edit:hover,
.tfw-summary-edit:focus,
.tfw-summary-edit:active {
  background: var(--wa-user-bubble) !important;
  color: var(--wa-green) !important;
  border-color: var(--wa-accent) !important;
}

.tfw-summary-row.is-editing {
  display: block;
  padding: 0.9rem;
}

.tfw-summary-editor {
  width: 100%;
}

.tfw-summary-field {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--wa-border);
  border-radius: 10px;
  background: var(--wa-white);
  color: var(--wa-text);
  padding: 0.68rem 0.75rem;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.35;
  outline: none;
}

.tfw-summary-field:focus {
  border-color: var(--wa-green);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--wa-green) 18%, transparent);
}

textarea.tfw-summary-field {
  min-height: 5.5rem;
  resize: vertical;
}

.tfw-summary-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.tfw-summary-editor-actions button {
  border-radius: 999px !important;
  padding: 0.48rem 0.78rem !important;
  cursor: pointer;
  font: inherit !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}

.tfw-summary-cancel {
  border: 1px solid var(--wa-border) !important;
  background: var(--wa-white) !important;
  color: var(--wa-muted) !important;
}

.tfw-summary-save {
  border: 1px solid var(--wa-green) !important;
  background: var(--wa-green) !important;
  color: var(--wa-white) !important;
}

.tfw-final-controls {
  width: 100%;
  max-width: min(94%, 560px);
  margin: 0.25rem 0 0.8rem auto;
  background: var(--wa-panel);
  border: 1px solid var(--wa-border);
  border-radius: 18px;
  padding: 0.85rem;
}

.tfw-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.84rem;
  line-height: 1.36;
  color: var(--wa-text);
}

.tfw-consent input {
  margin-top: 0.12rem;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--wa-green);
}

.tfw-consent.has-error span {
  color: var(--wa-danger);
}

.tfw-final-buttons {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.tfw-submit-success {
  margin-top: 0.75rem;
  border: 1px solid var(--wa-border);
  border-radius: 12px;
  padding: 0.8rem;
  background: var(--wa-white);
  color: var(--wa-text);
  font-size: 0.84rem;
  line-height: 1.45;
  font-weight: 700;
}

.tfw-chat-stream-success{display:flex;flex:1;min-height:360px;align-items:center;justify-content:center;padding:28px 18px!important}.tfw-submission-success-screen{width:min(100%,480px);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:42px 26px;border:1px solid var(--wa-border);border-radius:22px;background:var(--wa-white);color:var(--wa-text);text-align:center;box-shadow:0 12px 34px rgba(0,0,0,.08)}.tfw-submission-success-icon{display:grid;place-items:center;width:76px;height:76px;margin-bottom:22px;border-radius:50%;background:var(--wa-green);color:var(--ink-accent-text);font-size:38px;font-weight:900;box-shadow:0 10px 26px color-mix(in srgb,var(--wa-green) 30%,transparent)}.tfw-submission-success-screen h2{margin:0 0 10px;color:var(--wa-text);font-size:26px;line-height:1.2}.tfw-submission-success-screen p{max-width:390px;margin:0;color:var(--wa-muted);font-size:15px;line-height:1.6}.tfw-submitted-state .tfw-progress-fill{width:100%!important}@media(max-width:600px){.tfw-chat-stream-success{min-height:calc(100svh - 130px);padding:22px 14px!important}.tfw-submission-success-screen{padding:38px 20px}.tfw-submission-success-icon{width:70px;height:70px;font-size:34px}.tfw-submission-success-screen h2{font-size:23px}}

.tfw-whatsapp-action,
.tfw-secondary-action {
  border-radius: 999px !important;
  padding: 0.85rem 1rem !important;
  cursor: pointer;
  font: inherit !important;
  font-weight: 800 !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.tfw-whatsapp-action {
  flex: 1 1 210px;
  border: 1px solid var(--wa-green) !important;
  background: var(--wa-green) !important;
  color: var(--ink-accent-text) !important;
}

.tfw-whatsapp-action:hover,
.tfw-whatsapp-action:focus,
.tfw-whatsapp-action:active {
  background: var(--wa-green) !important;
  border-color: var(--wa-green) !important;
  color: var(--ink-accent-text) !important;
  filter: brightness(0.9);
}

.tfw-secondary-action {
  flex: 0 1 auto;
  border: 1px solid var(--wa-green) !important;
  background: var(--wa-white) !important;
  color: var(--wa-green) !important;
}

.tfw-secondary-action:hover,
.tfw-secondary-action:focus,
.tfw-secondary-action:active {
  background: var(--wa-user-bubble) !important;
  color: var(--wa-green) !important;
}

.tfw-composer[hidden] {
  display: none !important;
}


/* Final screen: remove the large keyboard safety spacer because there is no answer field active. */
.tattoo-form-widget.tfw-final-state .tfw-chat-stream,
.tfw-chat-stream.tfw-chat-stream-final {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.tattoo-form-widget.tfw-final-state .tfw-chat {
  padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 767px) {
  .tattoo-form-widget.tfw-final-state .tfw-chat-stream,
  .tfw-chat-stream.tfw-chat-stream-final {
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
  }
}

@keyframes tfwMessageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tfwTyping {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 767px) {
  .tattoo-form-widget.tfw-mode-pagina {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    min-height: 100svh;
    margin: 0;
    border: none;
    border-radius: 0;
    overflow: hidden;
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    flex-direction: column;
  }

  .tattoo-form-widget.tfw-mode-card {
    width: 100%;
    max-width: none;
    min-height: 100svh;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    overflow: visible;
  }

  .tattoo-form-widget.tfw-mode-pagina .tfw-header {
    flex: 0 0 auto;
    position: relative;
    top: auto;
    z-index: 5;
  }

  .tattoo-form-widget.tfw-mode-pagina .tfw-progress-track {
    flex: 0 0 auto;
    position: relative;
    top: auto;
    z-index: 4;
  }

  .tattoo-form-widget.tfw-mode-pagina .tfw-chat {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .tattoo-form-widget.tfw-mode-pagina .tfw-chat-stream {
    min-height: 100%;
  }

  .tfw-header {
    padding: 0.85rem 1rem;
  }

  .tfw-avatar {
    width: 50px;
    height: 50px;
  }

  .tfw-title {
    font-size: 1.2rem;
  }

  .tfw-chat {
    min-height: calc(100svh - 82px);
    padding: 1rem 0.78rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
  }

  .tfw-chat-stream {
    min-height: calc(100svh - 126px);
    padding-top: 0.85rem;
    padding-bottom: clamp(180px, 42svh, 360px);
  }

  .tfw-bubble {
    max-width: 88%;
    font-size: 1rem;
    padding: 0.72rem 0.84rem;
  }

  .tfw-active-answer {
    max-width: 92%;
  }

  .tfw-active-answer-choice,
  .tfw-final-controls {
    max-width: 100%;
  }

  .tfw-inline-input-row {
    width: min(100%, 92vw);
    border-radius: 16px 5px 16px 16px;
    padding: 0.52rem 0.52rem 0.52rem 0.68rem;
  }

  .tfw-send-inline {
    width: 46px;
    height: 46px;
  }

  .tfw-choice {
    font-size: 0.90rem !important;
  }
}

@media (min-width: 768px) {
  .tattoo-form-widget.tfw-mode-card,
  .tattoo-form-widget.tfw-mode-pagina {
    margin: 1.2rem auto;
  }
}


.tfw-start-wrap {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin: 0.25rem 0 0.7rem;
}

.tfw-start-button {
  border: none !important;
  background: var(--wa-green) !important;
  color: var(--ink-accent-text) !important;
  border-radius: 999px !important;
  padding: 0.82rem 1.32rem !important;
  cursor: pointer;
  font: inherit !important;
  font-weight: 800 !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.tfw-start-button:hover,
.tfw-start-button:focus,
.tfw-start-button:active {
  background: var(--wa-green) !important;
  color: var(--ink-accent-text) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px var(--wa-border) !important;
}

/* Ink Form 1.1.4: preserve the beginning of the first conversation and
   prevent WordPress/theme button rules from stretching the inline send button. */
.tattoo-form-widget .tfw-chat,
.tattoo-form-widget .tfw-chat-stream {
  overflow-anchor: none;
}

.tattoo-form-widget button.tfw-send-inline,
.tattoo-form-widget button.tfw-send-inline:hover,
.tattoo-form-widget button.tfw-send-inline:focus,
.tattoo-form-widget button.tfw-send-inline:focus-visible,
.tattoo-form-widget button.tfw-send-inline:active {
  box-sizing: border-box !important;
  flex: 0 0 46px !important;
  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  aspect-ratio: 1 / 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  align-self: center !important;
  line-height: 1 !important;
  text-indent: 0 !important;
  transform: none !important;
}

.tattoo-form-widget button.tfw-send-inline span {
  display: block;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  line-height: 1;
  transform: translateX(1px);
}


/* Ink Form 1.1.5: keyboard-safe mobile viewport.
   Only the conversation scrolls; header and progress remain permanently visible. */
@media (max-width: 767px) {
  .tattoo-form-widget.tfw-mode-pagina {
    top: var(--ink-form-viewport-top, 0px) !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    height: var(--ink-form-viewport-height, 100dvh) !important;
    min-height: 0 !important;
    max-height: var(--ink-form-viewport-height, 100dvh) !important;
  }

  .tattoo-form-widget.tfw-mode-pagina .tfw-header {
    position: relative !important;
    top: 0 !important;
    flex: 0 0 auto !important;
    z-index: 100 !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  .tattoo-form-widget.tfw-mode-pagina .tfw-progress-track {
    position: relative !important;
    top: 0 !important;
    flex: 0 0 auto !important;
    z-index: 99 !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  .tattoo-form-widget.tfw-mode-pagina .tfw-chat {
    flex: 1 1 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    scroll-padding-top: 12px;
    scroll-padding-bottom: 14px;
  }

  .tattoo-form-widget.tfw-mode-pagina.tfw-keyboard-open .tfw-chat-stream {
    /* Keep enough room for the answer bubble, but do not simulate another keyboard. */
    padding-bottom: 24px !important;
    min-height: 100% !important;
  }

  .tattoo-form-widget.tfw-mode-pagina.tfw-keyboard-open .tfw-active-answer {
    scroll-margin-top: 12px;
    scroll-margin-bottom: 14px;
  }
}


/* Ink Form 1.2.3: compact options and Samsung keyboard viewport fallback. */
@media (max-width: 767px) {
  .tattoo-form-widget.tfw-mode-pagina.tfw-keyboard-open {
    background-color: var(--wa-chat-bg) !important;
  }

  .tattoo-form-widget .tfw-inline-choices {
    gap: 0.46rem;
    padding: 0.66rem;
  }

  .tattoo-form-widget button.tfw-choice {
    padding: 0.64rem 0.82rem !important;
    font-size: 0.90rem !important;
    line-height: 1.25 !important;
  }
}


/* Full-screen fallback behind the form while a mobile keyboard is open.
   This is intentionally a separate, isolated layer because Samsung Internet
   can temporarily pan the visual viewport beyond the fixed form bounds. */
.tfw-keyboard-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999998;
  pointer-events: none;
  background: #EFEAE2;
}

.tfw-keyboard-backdrop.is-visible {
  display: block;
}

/* Ink Form 1.2.4: reduce the initial gap below the fixed mobile header.
   The conversation keeps a small breathing space, but starts immediately
   below the progress bar in Instagram and other mobile browsers. */
@media (max-width: 767px) {
  .tattoo-form-widget.tfw-mode-pagina .tfw-chat {
    padding-top: 0.45rem !important;
  }

  .tattoo-form-widget.tfw-mode-pagina .tfw-chat-stream {
    padding-top: 0.15rem !important;
  }
}


/* Ink Form 1.2.5: the JS now limits the full-screen form to the visible
   viewport in Samsung Internet, so the chat ends above the keyboard and
   remains scrollable. No additional visual styling is required here. */

/* Ink Form 1.4.4: isolate the title and subtitle in their own compact block.
   This prevents themes, builders and cached legacy rules from distributing the
   two lines across the full header height. */
.tattoo-form-widget .tfw-header-main {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  margin: 0 !important;
  padding: 0 !important;
  height: auto !important;
  min-height: 0 !important;
}

.tattoo-form-widget .tfw-header-copy {
  min-width: 0 !important;
  width: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: max-content max-content !important;
  align-content: center !important;
  justify-content: stretch !important;
  row-gap: 0.2rem !important;
  margin: 0 !important;
  padding: 0 !important;
  height: auto !important;
  min-height: 0 !important;
}

.tattoo-form-widget .tfw-title,
.tattoo-form-widget .tfw-subtitle {
  position: static !important;
  inset: auto !important;
  float: none !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  align-self: auto !important;
}

.tattoo-form-widget .tfw-title {
  grid-row: 1 !important;
}

.tattoo-form-widget .tfw-subtitle {
  grid-row: 2 !important;
}

.tattoo-form-widget .tfw-subtitle.is-empty {
  display: none !important;
}


/* Ink Form 1.4.5: vertically center the compact name/subtitle group with
   the avatar. Grid controls the three header columns explicitly and avoids
   external theme rules shifting only the text block upward. */
.tattoo-form-widget .tfw-header {
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) max-content !important;
  align-items: center !important;
  justify-items: stretch !important;
  column-gap: 0.9rem !important;
}

.tattoo-form-widget .tfw-avatar,
.tattoo-form-widget .tfw-header-main,
.tattoo-form-widget .tfw-step-count {
  align-self: center !important;
}

.tattoo-form-widget .tfw-header-main,
.tattoo-form-widget .tfw-header-copy {
  transform: none !important;
  top: auto !important;
  bottom: auto !important;
}

.tattoo-form-widget .tfw-header-copy {
  align-self: center !important;
}


/* Ink Form 1.4.6: optical centering for a two-line header.
   CSS had centered the line boxes mathematically, but the visible glyphs still
   appeared above the avatar center. Apply a small downward offset only when
   the optional subtitle exists. */
.tattoo-form-widget .tfw-header.has-subtitle .tfw-header-main {
  position: relative !important;
  top: 6px !important;
  transform: none !important;
}
.tfw-booking-closed .tfw-header{border-bottom:1px solid var(--wa-border)}.tfw-closed-state{min-height:340px;padding:48px 28px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:var(--wa-chat-bg);color:var(--wa-text)}.tfw-closed-icon{display:grid;place-items:center;width:68px;height:68px;margin-bottom:18px;border-radius:22px;background:var(--wa-panel);font-size:30px}.tfw-closed-state h2{margin:0 0 10px;font-size:24px;line-height:1.2;color:var(--wa-text)}.tfw-closed-state p{max-width:520px;margin:0;color:var(--wa-muted);font-size:15px;line-height:1.65}@media(max-width:600px){.tfw-closed-state{min-height:300px;padding:38px 22px}.tfw-closed-state h2{font-size:21px}}
.tfw-reference-upload{display:flex;flex-direction:column;gap:7px;margin:0 0 16px;padding:14px;border:1px solid var(--wa-border);border-radius:14px;background:var(--wa-white)}.tfw-reference-upload>strong{font-size:14px}.tfw-reference-upload>span{color:var(--wa-muted);font-size:12px;line-height:1.4}.tfw-reference-button{display:flex;align-items:center;justify-content:center;min-height:42px;margin-top:3px;padding:9px 12px;border:1px solid var(--wa-border);border-radius:11px;background:var(--wa-panel);color:var(--wa-text);font-size:13px;font-weight:800;cursor:pointer}.tfw-reference-button input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.tfw-reference-upload>small{min-height:16px;color:var(--wa-green-dark);font-size:11px;font-weight:700}
.tfw-reference-thumbnails{display:flex;gap:9px;flex-wrap:wrap;margin:4px 0}.tfw-reference-thumbnails>span{position:relative;display:flex;flex-direction:column;gap:6px;width:min(145px,100%)}.tfw-reference-thumbnails img{display:block;width:72px;height:72px;border:2px solid var(--wa-white);border-radius:10px;object-fit:cover;box-shadow:0 0 0 1px var(--wa-border)}.tfw-reference-thumbnails textarea{box-sizing:border-box;width:100%;min-height:50px;padding:7px 8px;border:1px solid var(--wa-border);border-radius:9px;background:var(--wa-white);color:var(--wa-text);font:500 11px/1.35 system-ui;resize:vertical}.tfw-reference-thumbnails textarea:focus{outline:2px solid var(--wa-green);outline-offset:1px}.tfw-reference-thumbnails button{position:absolute;top:-7px;left:59px;display:grid;place-items:center;width:23px;height:23px;padding:0!important;border:2px solid var(--wa-white)!important;border-radius:50%!important;background:var(--wa-danger)!important;color:#fff!important;font:700 16px/1 system-ui!important;cursor:pointer}.tfw-reference-thumbnails button:hover,.tfw-reference-thumbnails button:focus,.tfw-reference-thumbnails button:active{background:var(--wa-danger)!important;color:#fff!important;filter:brightness(.9)}.tfw-reference-button.is-disabled{opacity:.55;cursor:not-allowed}.tfw-images-continue,.tfw-skip-images{display:flex;align-items:center;justify-content:center;width:100%;min-height:42px;margin-top:9px;padding:9px 12px;border-radius:11px;font:inherit;font-size:13px;font-weight:800;cursor:pointer}.tfw-images-continue,.tfw-images-continue:hover,.tfw-images-continue:focus,.tfw-images-continue:active{border:1px solid var(--wa-green)!important;background:var(--wa-green)!important;color:var(--ink-accent-text)!important;box-shadow:none!important;filter:none!important}.tfw-skip-images,.tfw-skip-images:hover,.tfw-skip-images:focus,.tfw-skip-images:active{border:1px solid var(--wa-border)!important;background:var(--wa-white)!important;color:var(--wa-text)!important;text-transform:none!important;letter-spacing:0!important;box-shadow:none!important;filter:none!important}
.tfw-skin-tone-picker{display:flex;flex-direction:column;gap:10px;padding:15px;border:1px solid var(--wa-border);border-radius:15px;background:var(--wa-white)}.tfw-skin-tone-carousel{display:grid;grid-template-columns:40px minmax(0,1fr) 40px;align-items:center;gap:8px}.tfw-skin-tone-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:190px;border-radius:14px;background:var(--wa-panel);touch-action:pan-y;user-select:none;cursor:grab;overflow:hidden}.tfw-skin-tone-preview:active{cursor:grabbing}.tfw-skin-tone-preview i{display:block;width:126px;height:126px;border-radius:50%;box-shadow:0 5px 18px #0002,0 0 0 1px #0002}.tfw-skin-tone-preview strong{color:var(--wa-text);font-size:15px}.tfw-skin-tone-arrow,.tfw-skin-tone-arrow:hover,.tfw-skin-tone-arrow:focus,.tfw-skin-tone-arrow:active{display:grid;place-items:center;width:40px;height:48px;padding:0!important;border:1px solid var(--wa-border)!important;border-radius:12px!important;background:var(--wa-white)!important;color:var(--wa-text)!important;font:700 30px/1 system-ui!important;box-shadow:none!important;cursor:pointer}.tfw-skin-tone-arrow:disabled{opacity:.3;cursor:default}.tfw-skin-tone-picker>small{text-align:center;color:var(--wa-muted);font-size:11px}.tfw-skin-tone-confirm,.tfw-skin-tone-confirm:hover,.tfw-skin-tone-confirm:focus,.tfw-skin-tone-confirm:active{min-height:42px;padding:9px 12px;border:1px solid var(--wa-green)!important;border-radius:11px!important;background:var(--wa-green)!important;color:var(--ink-accent-text)!important;font:inherit;font-size:13px;font-weight:800;box-shadow:none!important;cursor:pointer}

/* Desktop page mode: occupy the full useful browser height without making the
   document itself scroll. Card embeds keep their natural content height.
   Mobile rules stay untouched. */
@media (min-width: 768px) {
  body:has(.tattoo-form-widget.tfw-mode-pagina) {
    overflow: hidden;
  }

  .tattoo-form-widget.tfw-mode-pagina {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 50%;
    z-index: 999999;
    width: min(100%, 640px);
    height: 100dvh;
    min-height: 0;
    max-height: none;
    margin: 0;
    border-top: 0;
    border-bottom: 0;
    border-radius: 0;
    overflow: hidden;
    box-shadow:
      0 0 0 100vmax color-mix(in srgb, var(--wa-chat-bg) 74%, #64707a),
      0 0 34px rgba(17, 27, 33, 0.16);
    transform: translateX(-50%);
  }

  .tattoo-form-widget.tfw-mode-pagina .tfw-header,
  .tattoo-form-widget.tfw-mode-pagina .tfw-progress-track {
    flex: 0 0 auto;
  }

  .tattoo-form-widget.tfw-mode-pagina .tfw-chat {
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .tattoo-form-widget.tfw-mode-pagina .tfw-chat::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .tattoo-form-widget.tfw-mode-pagina .tfw-chat-stream {
    min-height: 100%;
    padding-bottom: 1.5rem;
  }
}
