/**
 * MinhaDoula — elementos HTML nativos de formulário
 *
 * Select: dropdown customizado (.md-select) — o <select> nativo fica oculto
 * para envio do formulário; o painel é desenhado pelo projeto.
 *
 * Date: datepicker customizado (.md-date) — o <input type="date"> nativo fica
 * oculto; o calendário é desenhado pelo projeto.
 *
 * Spec: .ai/frontend.md §7.5
 */

:root {
  --md-select-roxo-hover: rgba(57, 58, 143, 0.08);
  --md-select-roxo-ativo: rgba(57, 58, 143, 0.13);
  --md-select-roxo-foco: rgba(57, 58, 143, 0.10);
}

/* —— select nativo (oculto após enhance) —— */

select.md-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— wrapper —— */

.md-select {
  position: relative;
  width: 100%;
  min-width: 0;
  font-family: var(--md-font-ui), ui-sans-serif, system-ui, sans-serif;
}

/* —— gatilho (campo visível) —— */

.md-select__gatilho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(57, 58, 143, 0.14);
  background: var(--md-white, #fff);
  color: var(--md-ink);
  font-family: var(--md-font-ui), ui-sans-serif, system-ui, sans-serif;
  font-size: inherit;
  font-weight: 600;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    transform 0.14s ease;
}

.md-select--auth .md-select__gatilho {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--md-surface);
}

.md-select--campo .md-select__gatilho {
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--app-surface, #fff);
  border-color: var(--app-border-strong, rgba(57, 58, 143, 0.18));
}

.md-select__valor {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: inherit;
  text-transform: none;
  letter-spacing: normal;
}

.md-select__valor.is-placeholder {
  color: var(--md-muted);
  font-weight: 500;
}

.md-select__chevron {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  background: var(--md-select-chevron, none) center / 18px no-repeat;
  transition: transform 0.22s ease;
}

.md-select__chevron {
  --md-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366677D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.md-select.is-open .md-select__chevron {
  transform: rotate(180deg);
}

/* —— estados do gatilho —— */

.md-select__gatilho:hover:not(:disabled) {
  border-color: rgba(57, 58, 143, 0.28);
  background: var(--md-white, #fff);
}

.md-select--auth .md-select__gatilho:hover:not(:disabled) {
  background: var(--md-white);
}

.md-select--campo .md-select__gatilho:hover:not(:disabled) {
  background: var(--app-surface-alt, #fbfbfe);
}

.md-select.is-open .md-select__gatilho,
.md-select__gatilho:focus-visible {
  outline: none;
}

.md-select--auth.is-open .md-select__gatilho,
.md-select--auth .md-select__gatilho:focus-visible {
  outline: 2px solid var(--md-accent);
  outline-offset: 2px;
  border-color: rgba(57, 58, 143, 0.28);
  background: var(--md-white);
}

.md-select--campo.is-open .md-select__gatilho,
.md-select--campo .md-select__gatilho:focus-visible {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px var(--app-wash-primary, #ececf9);
  background: var(--app-surface, #fff);
}

.md-select.is-invalid .md-select__gatilho {
  border-color: var(--md-rose);
}

.md-select.is-disabled .md-select__gatilho {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--app-canvas, var(--md-surface));
}

/* —— painel dropdown —— */

.md-select__painel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(280px, 52vh);
  /* Quando aberto, o JS move o painel para document.body com position:fixed */
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(57, 58, 143, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(32, 33, 61, 0.12);
  font-family: var(--md-font-ui), ui-sans-serif, system-ui, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 58, 143, 0.22) transparent;
}

.md-select__painel::-webkit-scrollbar {
  width: 6px;
}

.md-select__painel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(57, 58, 143, 0.22);
}

/* —— busca opcional dentro do select —— */

.md-select__pesquisa {
  position: sticky;
  z-index: 2;
  top: -6px;
  margin: -6px -6px 4px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--app-border, rgba(57, 58, 143, 0.10));
}

.md-select__pesquisa-entrada {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px 9px 40px;
  border: 1px solid var(--app-border-strong, rgba(57, 58, 143, 0.18));
  border-radius: 10px;
  outline: none;
  background: var(--app-surface, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366677D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") 13px center / 18px no-repeat;
  color: var(--md-ink);
  font: inherit;
  font-weight: 500;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.md-select__pesquisa-entrada::placeholder {
  color: var(--md-muted);
}

.md-select__pesquisa-entrada:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px var(--app-wash-primary, #ececf9);
}

.md-select__pesquisa-entrada::-webkit-search-cancel-button {
  cursor: pointer;
}

.md-select__vazio {
  margin: 0;
  padding: 18px 14px;
  color: var(--md-muted);
  font-size: 0.9rem;
  text-align: center;
}

.md-select__carregando {
  margin: 0;
  padding: 10px 14px 14px;
  color: var(--md-muted);
  font-size: 0.84rem;
  text-align: center;
}

.md-select.is-carregando .md-select__painel {
  opacity: 0.92;
}

.md-select__opcao[hidden],
.md-select__vazio[hidden] {
  display: none;
}

/* —— opções —— */

.md-select__opcao {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--md-ink);
  font-family: var(--md-font-ui), ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.md-select__opcao.is-placeholder {
  color: var(--md-muted);
}

.md-select__opcao:hover,
.md-select__opcao.is-focada {
  background: var(--md-select-roxo-hover);
}

.md-select__opcao.is-selecionada {
  background: var(--md-select-roxo-ativo);
  color: var(--md-primary);
  font-weight: 700;
}

.md-select__opcao.is-focada:not(.is-selecionada) {
  background: var(--md-select-roxo-foco);
}

.md-select__opcao:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.md-select__rodape {
  margin-top: 4px;
  padding: 8px 8px 4px;
  border-top: 1px solid var(--app-border, rgba(57, 58, 143, 0.10));
}

.md-select__acao-sistema {
  display: block;
  width: 100%;
  padding: 8px 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--app-gold-forte, #886b12);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.md-select__acao-sistema:hover,
.md-select__acao-sistema:focus-visible {
  background: var(--app-wash-gold, #fbf3d9);
  outline: none;
}

@media (hover: hover) {
  .md-select__gatilho:active:not(:disabled) {
    transform: translateY(1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .md-select__gatilho,
  .md-select__chevron,
  .md-select__opcao {
    transition: none;
  }
}

/* —— date nativo (oculto após enhance) —— */

input.md-date__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— wrapper date —— */

.md-date {
  position: relative;
  /* `flex` e nao `block`: o wrapper tem nos de TEXTO (as quebras de linha do
     template) entre os filhos, e num contentor de bloco eles criam uma caixa
     de linha de ~17px. O campo de data media 63px onde um input normal mede
     46, e ficava 17px mais baixo que o vizinho na mesma linha do formulario.
     Contentor flex ignora no de texto so com espaco em branco. */
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  font-family: var(--md-font-ui), ui-sans-serif, system-ui, sans-serif;
}

.md-date__campo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(57, 58, 143, 0.14);
  background: var(--md-white, #fff);
  color: var(--md-ink);
  font-family: var(--md-font-ui), ui-sans-serif, system-ui, sans-serif;
  font-size: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.md-date--auth .md-date__campo {
  min-height: 52px;
  padding: 0 10px 0 16px;
  border-radius: 14px;
  background: var(--md-surface);
}

.md-date--campo .md-date__campo {
  min-height: 46px;
  padding: 0 8px 0 14px;
  border-radius: 12px;
  background: var(--app-surface, #fff);
  border-color: var(--app-border-strong, rgba(57, 58, 143, 0.18));
}

.md-date__entrada {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--md-ink);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.md-date__entrada::placeholder {
  color: var(--md-muted);
  font-weight: 500;
}

.md-date__abrir {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.md-date__icone {
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366677D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.md-date__abrir:hover:not(:disabled) {
  background: var(--md-select-roxo-hover);
}

.md-date__campo:hover {
  border-color: rgba(57, 58, 143, 0.28);
}

.md-date--auth .md-date__campo:hover {
  background: var(--md-white);
}

.md-date--campo .md-date__campo:hover {
  background: var(--app-surface-alt, #fbfbfe);
}

.md-date--auth.is-open .md-date__campo,
.md-date--auth .md-date__campo:focus-within {
  outline: 2px solid var(--md-accent);
  outline-offset: 2px;
  border-color: rgba(57, 58, 143, 0.28);
  background: var(--md-white);
}

.md-date--campo.is-open .md-date__campo,
.md-date--campo .md-date__campo:focus-within {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px var(--app-wash-primary, #ececf9);
  background: var(--app-surface, #fff);
}

.md-date.is-invalid .md-date__campo {
  border-color: var(--md-rose);
}

.md-date.is-disabled .md-date__campo {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--app-canvas, var(--md-surface));
}

.md-date.is-disabled .md-date__entrada,
.md-date.is-disabled .md-date__abrir {
  cursor: not-allowed;
}

/* —— painel calendário —— */

.md-date__painel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  width: min(320px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid rgba(57, 58, 143, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(32, 33, 61, 0.12);
  font-family: var(--md-font-ui), ui-sans-serif, system-ui, sans-serif;
}

.md-date__cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.md-date__mes {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--md-ink);
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.md-date__mes:hover,
.md-date__mes:focus-visible {
  background: var(--md-select-roxo-hover);
  outline: none;
}

.md-date__mes::after {
  content: '';
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366677D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 14px no-repeat;
  transition: transform 0.2s ease;
}

.md-date__painel.is-anos .md-date__mes::after {
  transform: rotate(180deg);
}

.md-date__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--md-muted);
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.md-date__nav:hover {
  background-color: var(--md-select-roxo-hover);
}

.md-date__nav--prev {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366677D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
}

.md-date__nav--next {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366677D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
}

.md-date__dias-semana {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.md-date__dia-semana {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--md-muted);
  padding: 4px 0;
}

.md-date__grade {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.md-date__dia {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--md-ink);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.md-date__dia:hover:not(:disabled):not(.is-vazio) {
  background: var(--md-select-roxo-hover);
}

.md-date__dia.is-hoje:not(.is-selecionado) {
  background: var(--md-select-roxo-hover);
  color: var(--md-primary);
  font-weight: 700;
}

.md-date__dia.is-selecionado {
  background: var(--md-select-roxo-ativo);
  color: var(--md-primary);
  font-weight: 700;
}

.md-date__dia.is-bloqueado,
.md-date__dia.is-vazio {
  opacity: 0.35;
  cursor: default;
}

/* —— seletor de anos —— */

.md-date__painel:not(.is-anos) .md-date__anos,
.md-date__anos[hidden] {
  display: none !important;
}

.md-date__painel.is-anos .md-date__corpo-dias,
.md-date__corpo-dias[hidden] {
  display: none !important;
}

.md-date__anos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  max-height: min(280px, 52vh);
  overflow-y: auto;
  padding: 4px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 58, 143, 0.22) transparent;
}

.md-date__anos::-webkit-scrollbar {
  width: 6px;
}

.md-date__anos::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(57, 58, 143, 0.22);
}

.md-date__ano {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 4px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--md-ink);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.md-date__ano:hover,
.md-date__ano:focus-visible {
  background: var(--md-select-roxo-hover);
  outline: none;
}

.md-date__ano.is-atual:not(.is-selecionado) {
  color: var(--md-primary);
  font-weight: 700;
}

.md-date__ano.is-selecionado {
  background: var(--md-select-roxo-ativo);
  color: var(--md-primary);
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .md-date__campo,
  .md-date__abrir,
  .md-date__nav,
  .md-date__dia,
  .md-date__mes,
  .md-date__ano {
    transition: none;
  }

  .md-date__mes::after {
    transition: none;
  }
}

/* —— month —— */

input.md-month__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.md-month {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.md-month__campo,
.md-time__campo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--app-border-strong, rgba(57, 58, 143, 0.18));
  border-radius: 12px;
  background: var(--app-surface, #fff);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.md-month__entrada,
.md-time__entrada {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--md-ink);
  font-family: var(--md-font-ui), ui-sans-serif, system-ui, sans-serif;
  font-size: inherit;
  font-weight: 600;
  outline: none;
}

.md-month__abrir,
.md-time__abrir {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.md-month__icone,
.md-time__icone {
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366677D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.md-time__icone {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366677D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

.md-month.is-open .md-month__campo,
.md-month .md-month__campo:focus-within,
.md-time.is-open .md-time__campo,
.md-time .md-time__campo:focus-within {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px var(--app-wash-primary, #ececf9);
}

.md-month__painel,
.md-time__painel {
  padding: 12px;
  border: 1px solid var(--app-border-strong, rgba(57, 58, 143, 0.18));
  border-radius: 14px;
  background: var(--app-surface, #fff);
  box-shadow: var(--app-shadow-pop, 0 18px 40px rgba(23, 20, 40, 0.14));
}

.md-month__cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.md-month__ano {
  font-size: 0.95rem;
  color: var(--md-muted);
}

.md-month__nav {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--md-primary);
  font-size: 1.2rem;
  cursor: pointer;
}

.md-month__grade {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.md-month__mes {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--md-ink);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: lowercase;
  cursor: pointer;
}

.md-month__mes.is-selecionado {
  border-color: var(--md-primary);
  background: var(--md-select-roxo-ativo);
  color: var(--md-primary);
}

.md-month__rodape,
.md-time__rodape {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.md-month__acao,
.md-time__acao {
  border: none;
  background: transparent;
  color: var(--md-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

/* —— time —— */

input.md-time__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.md-time {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.md-time__colunas {
  display: flex;
  gap: 8px;
  align-items: stretch;
  height: 180px;
  min-height: 0;
  overflow: hidden;
}

.md-time__coluna {
  flex: 1 1 0;
  min-width: 0;
  /* Sem min-height: 0 o flex estica a coluna e o overflow nunca ativa. */
  min-height: 0;
  height: 100%;
  max-height: 180px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: y proximity;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 58, 143, 0.22) transparent;
}

/* Driver.js (tour) desliga pointer-events em tudo — o picker precisa continuar clicável. */
.driver-active .md-time__painel,
.driver-active .md-time__painel * {
  pointer-events: auto;
}

.md-time__coluna::-webkit-scrollbar {
  width: 8px;
}

.md-time__coluna::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(57, 58, 143, 0.22);
}

.md-time__opcao {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 100%;
  min-height: 34px;
  margin: 0 0 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--md-ink);
  font-family: inherit;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  user-select: none;
  scroll-snap-align: center;
}

.md-time__opcao:last-child {
  margin-bottom: 0;
}

.md-time__opcao.is-selecionado {
  background: var(--md-primary);
  color: #fff;
  font-weight: 700;
}

.campo__datetime {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(110px, 0.8fr);
  gap: 10px;
}
