.ml {
  --ml-bg: #f6efe7;
  --ml-card: #fffaf4;
  --ml-brown: #5e4330;
  --ml-brown-dark: #4a3425;
  --ml-ink: #3d2b1f;
  --ml-muted: #8a7361;
  --ml-line: rgba(94, 67, 48, 0.16);
  --ml-soft: rgba(94, 67, 48, 0.07);
  --ml-radius: 18px;
  --ml-serif: "Fraunces", Georgia, serif;
  --ml-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ml-bg);
  color: var(--ml-ink);
  font-family: var(--ml-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.ml *,
.ml *::before,
.ml *::after {
  box-sizing: border-box;
}

.ml .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.ml-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 12px 22px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.ml-top {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.ml-logo {
  width: 128px;
  height: auto;
  margin-top: 6px;
}

.ml-back {
  position: absolute;
  left: -8px;
  top: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ml-brown);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ml-back[hidden] {
  display: none;
}

.ml-back:active {
  background: var(--ml-soft);
}

.ml-progress {
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: var(--ml-line);
  overflow: hidden;
}

.ml-progress[hidden] {
  display: none;
}

.ml-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ml-brown);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.ml-screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding-top: 26px;
  animation: mlIn 0.35s ease both;
}

.ml-screen.is-active {
  display: flex;
}

@keyframes mlIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Capa */
.ml-cover {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 6vh;
}

.ml-eyebrow {
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ml-muted);
  font-weight: 500;
}

.ml-title {
  margin: 0;
  font-family: var(--ml-serif);
  font-weight: 600;
  font-size: clamp(30px, 8.4vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ml-brown);
}

.ml-title em {
  font-style: italic;
  font-weight: 500;
}

.ml-title--sm {
  font-size: clamp(28px, 7.4vw, 34px);
}

.ml-lead {
  margin: 18px 0 30px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ml-muted);
}

.ml-note {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--ml-muted);
}

/* Botões */
.ml-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--ml-brown);
  color: #fdf8f2;
  font: 600 16px/1.2 var(--ml-sans);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(74, 52, 37, 0.7);
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
}

.ml-btn:active {
  transform: scale(0.98);
  background: var(--ml-brown-dark);
}

.ml-btn:disabled {
  opacity: 0.38;
  box-shadow: none;
  cursor: default;
}

.ml-btn--wa {
  margin-top: 4px;
}

.ml-link {
  margin: 14px auto 0;
  border: 0;
  background: none;
  color: var(--ml-brown);
  font: 500 14px var(--ml-sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 6px;
}

/* Perguntas */
.ml-step {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ml-muted);
  font-weight: 500;
}

.ml-q {
  margin: 0 0 22px;
  font-family: var(--ml-serif);
  font-weight: 600;
  font-size: clamp(24px, 6.6vw, 30px);
  line-height: 1.18;
  color: var(--ml-brown);
}

.ml-field {
  display: block;
  margin-bottom: 18px;
}

.ml-field input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 1.5px solid var(--ml-line);
  border-radius: 14px;
  background: var(--ml-card);
  color: var(--ml-ink);
  font: 500 17px var(--ml-sans);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ml-field input::placeholder {
  color: #b5a393;
  font-weight: 400;
}

.ml-field input:focus {
  border-color: var(--ml-brown);
  box-shadow: 0 0 0 4px var(--ml-soft);
}

.ml-field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ml-muted);
}

.ml-field--date input {
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.ml-error {
  margin: -8px 0 14px;
  font-size: 13px;
  color: #a64b3c;
}

.ml-error[hidden] {
  display: none;
}

/* Calendário vertical */
.ml-cal {
  border: 1.5px solid var(--ml-line);
  border-radius: var(--ml-radius);
  background: var(--ml-card);
  overflow: hidden;
  margin-bottom: 18px;
}

.ml-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--ml-line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ml-muted);
  text-align: center;
}

.ml-cal-scroll {
  height: min(44vh, 330px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 10px 10px;
  scroll-snap-type: y proximity;
}

.ml-cal-month {
  scroll-snap-align: start;
}

.ml-cal-mtitle {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 12px 4px 8px;
  background: var(--ml-card);
  font-family: var(--ml-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ml-brown);
  text-transform: capitalize;
}

.ml-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.ml-day {
  aspect-ratio: 1;
  max-height: 46px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ml-ink);
  font: 500 15px var(--ml-sans);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  justify-self: center;
  width: 100%;
  max-width: 46px;
}

.ml-day:not(:disabled):active {
  background: var(--ml-soft);
}

.ml-day:disabled {
  color: #cdbfb2;
  cursor: default;
}

.ml-day.is-weekend:not(:disabled) {
  color: var(--ml-brown);
  font-weight: 600;
}

.ml-day.is-selected {
  background: var(--ml-brown);
  color: #fdf8f2 !important;
}

/* Opções */
.ml-options {
  display: grid;
  gap: 12px;
}

.ml-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 18px;
  border: 1.5px solid var(--ml-line);
  border-radius: var(--ml-radius);
  background: var(--ml-card);
  color: var(--ml-ink);
  font: 500 17px var(--ml-sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.ml-opt:active {
  transform: scale(0.985);
}

.ml-opt-n {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ml-line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ml-brown);
}

.ml-opt.is-selected {
  border-color: var(--ml-brown);
  background: #f3e8dc;
}

.ml-opt.is-selected .ml-opt-n {
  background: var(--ml-brown);
  border-color: var(--ml-brown);
  color: #fdf8f2;
}

/* Prioridades */
.ml-prios {
  margin-bottom: 6px;
}

.ml-field--prio {
  position: relative;
  margin-bottom: 14px;
}

.ml-field--prio input {
  padding-left: 54px;
  padding-right: 62px;
}

.ml-prio-n {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ml-soft);
  color: var(--ml-brown);
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

.ml-count {
  position: absolute;
  right: 16px;
  top: 19px;
  font-size: 12px;
  color: #b5a393;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.ml-count.is-full {
  color: var(--ml-brown);
  font-weight: 600;
}

/* Final */
.ml-final {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 6vh;
}

.ml-final-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  background: var(--ml-brown);
  color: #fdf8f2;
}

@media (prefers-reduced-motion: reduce) {
  .ml-screen {
    animation: none;
  }
}
