/* ============================================================
   fasting.css — Monitor de Jejum · Kronos Health
   Alinhado com o design system de temtudinho.online
   ============================================================ */

/* ── LAYOUT PRINCIPAL ───────────────────────────────────────── */
.kh-app {
  position: relative;
  padding: 6rem 1.5rem 5rem;
  color: var(--paper);
  min-height: 100vh;
}

/* ── HERO ────────────────────────────────────────────────────── */
.kh-hero {
  max-width: 860px;
  margin: 0 auto 3rem;
  text-align: center;
  animation: fadeUp 0.5s ease both;
}

.kh-mono {
  font-family: "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 0.65rem;
  display: block;
  margin-bottom: 1rem;
}

.kh-hero h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 0.95;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.kh-hero h1 em {
  color: var(--accent);
  font-style: italic;
}

.kh-sub {
  max-width: 580px;
  margin: 0 auto;
  color: rgba(240, 243, 248, 0.55);
  line-height: 1.7;
  font-size: 0.9rem;
}

/* ── GRID PRINCIPAL ──────────────────────────────────────────── */
.kh-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ── CARDS ────────────────────────────────────────────────────── */
.kh-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  animation: fadeUp 0.5s ease both;
}

.kh-card:nth-child(1) {
  animation-delay: 0.05s;
}
.kh-card:nth-child(2) {
  animation-delay: 0.1s;
}
.kh-card:nth-child(3) {
  animation-delay: 0.15s;
}
.kh-card:nth-child(4) {
  animation-delay: 0.2s;
}

.kh-main-card {
  grid-row: span 2;
}

.kh-history-card {
  grid-column: 1 / -1;
}

/* ── CARD HEADER ─────────────────────────────────────────────── */
.kh-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.kh-label {
  font-family: "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 0.62rem;
  display: block;
  margin-bottom: 0.4rem;
}

.kh-card h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--paper);
}

/* ── STATUS PILL ─────────────────────────────────────────────── */
.kh-pill {
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  border: 1px solid rgba(42, 109, 217, 0.25);
  background: rgba(42, 109, 217, 0.08);
  border-radius: 2px;
  padding: 0.3rem 0.65rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background 0.3s,
    color 0.3s,
    border-color 0.3s;
}

.kh-pill.active {
  color: #6ee7a0;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.22);
}

/* ── ANEL DE PROGRESSO ───────────────────────────────────────── */
.kh-ring-wrap {
  display: flex;
  justify-content: center;
  padding: 2rem 0 1.75rem;
}

.kh-ring {
  --progress: 0deg;
  width: min(280px, 68vw);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) var(--progress), var(--border) 0deg);
  position: relative;
  transition: background 0.8s ease;
}

.kh-ring::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #0d0f14;
  border: 1px solid var(--border);
}

.kh-ring-inner {
  position: relative;
  text-align: center;
  padding: 0.5rem;
}

.kh-ring-label {
  display: block;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(240, 243, 248, 0.45);
  margin-bottom: 0.5rem;
}

.kh-ring-inner strong {
  display: block;
  font-family: "DM Mono", monospace;
  font-size: clamp(1.6rem, 6vw, 2.5rem);
  letter-spacing: -0.02em;
  color: var(--paper);
  line-height: 1;
}

.kh-ring-inner small {
  display: block;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  color: rgba(240, 243, 248, 0.45);
  margin-top: 0.5rem;
  letter-spacing: 0.08em;
}

/* ── BLOCO DE INÍCIO ─────────────────────────────────────────── */
.kh-start-box {
  margin-top: 0.25rem;
}

.kh-start-box label,
.kh-form-grid label {
  display: grid;
  gap: 0.4rem;
  font-family: "DM Mono", monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(240, 243, 248, 0.5);
}

.kh-start-hint {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(240, 243, 248, 0.38);
}

/* ── INPUTS ──────────────────────────────────────────────────── */
.kh-target-row select,
.kh-form-grid input,
.kh-form-grid select,
.kh-start-box input {
  width: 100%;
  background: rgba(13, 15, 20, 0.85);
  border: 1px solid var(--border);
  color: var(--paper);
  border-radius: 3px;
  padding: 0.65rem 0.75rem;
  outline: none;
  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.kh-target-row select:focus,
.kh-form-grid input:focus,
.kh-form-grid select:focus,
.kh-start-box input:focus {
  border-color: rgba(42, 109, 217, 0.5);
}

.kh-target-row select {
  max-width: 160px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(240,243,248,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2rem;
}

.kh-form-grid select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(240,243,248,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2rem;
}

/* datetime-local: remover ícone padrão */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5);
  cursor: pointer;
}

/* ── BOTÕES ───────────────────────────────────────────────────── */
.kh-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.kh-btn {
  border: 0;
  border-radius: 3px;
  padding: 0.75rem 1rem;
  font-family: "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.64rem;
  cursor: pointer;
  transition:
    transform 0.1s,
    opacity 0.2s,
    background 0.2s,
    border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.kh-btn:active {
  transform: scale(0.97);
}

.kh-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.kh-btn-primary {
  flex: 1;
  background: var(--accent);
  color: #fff;
}

.kh-btn-primary:hover:not(:disabled) {
  background: #3a7de9;
}

.kh-btn-danger {
  flex: 1;
  background: transparent;
  color: #ff8a8a;
  border: 1px solid rgba(255, 88, 88, 0.22);
}

.kh-btn-danger:hover:not(:disabled) {
  background: rgba(255, 88, 88, 0.07);
}

.kh-btn-secondary {
  width: 100%;
  margin-top: 1rem;
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(42, 109, 217, 0.28);
}

.kh-btn-secondary:hover:not(:disabled) {
  background: rgba(42, 109, 217, 0.08);
  border-color: rgba(42, 109, 217, 0.5);
}

/* ── META ROW ─────────────────────────────────────────────────── */
.kh-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.kh-target-row label {
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(240, 243, 248, 0.5);
}

/* ── MÉTRICAS ─────────────────────────────────────────────────── */
.kh-metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.kh-metric:last-of-type {
  border-bottom: none;
}

.kh-metric span {
  font-size: 0.82rem;
  color: rgba(240, 243, 248, 0.52);
  line-height: 1.4;
}

.kh-metric strong {
  font-family: "DM Mono", monospace;
  font-size: 0.9rem;
  color: var(--paper);
  white-space: nowrap;
}

.kh-note {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: rgba(240, 243, 248, 0.38);
  line-height: 1.6;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ── FASE BADGE ───────────────────────────────────────────────── */
.kh-phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.kh-phase-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: blink 2s ease infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ── PERFIL METABÓLICO ────────────────────────────────────────── */
.kh-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.kh-full {
  grid-column: 1 / -1;
}

/* ── HISTÓRICO ────────────────────────────────────────────────── */
.kh-history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.kh-clear {
  background: transparent;
  border: 1px solid var(--border);
  color: rgba(240, 243, 248, 0.45);
  border-radius: 3px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.2s;
  flex-shrink: 0;
}

.kh-clear:hover {
  border-color: rgba(255, 88, 88, 0.3);
  color: #ff8a8a;
}

.kh-history-empty {
  color: rgba(240, 243, 248, 0.38);
  padding: 1.5rem 0 0.5rem;
  font-size: 0.85rem;
}

.kh-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.kh-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 3px;
  background: rgba(240, 243, 248, 0.03);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.kh-history-item:hover {
  border-color: rgba(42, 109, 217, 0.22);
}

.kh-history-main strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--paper);
}

.kh-history-main small {
  font-size: 0.75rem;
  color: rgba(240, 243, 248, 0.45);
  line-height: 1.5;
}

.kh-history-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.kh-history-tag {
  font-family: "DM Mono", monospace;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: rgba(42, 109, 217, 0.08);
  border: 1px solid rgba(42, 109, 217, 0.2);
  border-radius: 2px;
  padding: 0.2rem 0.5rem;
}

.kh-history-actions {
  display: flex;
  gap: 0.35rem;
}

.kh-mini-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: rgba(240, 243, 248, 0.5);
  border-radius: 2px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.15s;
}

.kh-mini-btn:hover {
  border-color: rgba(240, 243, 248, 0.28);
  color: var(--paper);
}

.kh-mini-btn.danger:hover {
  border-color: rgba(255, 88, 88, 0.3);
  color: #ff8a8a;
}

/* ── NOTIFICAÇÃO TOAST ────────────────────────────────────────── */
.kh-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  font-family: "DM Mono", monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(13, 15, 20, 0.96);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.75rem 1.1rem;
  color: var(--paper);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.25s,
    transform 0.25s;
  pointer-events: none;
  max-width: 280px;
}

.kh-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.kh-toast.success {
  border-left: 3px solid #6ee7a0;
}
.kh-toast.error {
  border-left: 3px solid #ff8a8a;
}
.kh-toast.info {
  border-left: 3px solid var(--accent);
}

/* ── BARRA DE PROGRESSO COMPACTA ──────────────────────────────── */
.kh-progress-bar {
  width: 100%;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.kh-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  transition: width 1s linear;
}

/* ── RESPONSIVE MOBILE ────────────────────────────────────────── */
@media (max-width: 768px) {
  .kh-app {
    padding: 4.5rem 1rem 6rem;
  }

  .kh-hero {
    text-align: left;
    margin-bottom: 1.5rem;
  }

  .kh-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .kh-main-card,
  .kh-history-card {
    grid-column: auto;
    grid-row: auto;
  }

  .kh-actions {
    flex-direction: column;
  }

  .kh-form-grid {
    grid-template-columns: 1fr;
  }

  .kh-history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .kh-history-meta {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: space-between;
  }

  .kh-ring {
    width: min(240px, 62vw);
  }

  .kh-toast {
    bottom: 5rem;
    right: 1rem;
    left: 1rem;
    max-width: 100%;
  }
}
/* ============================================================
   ADDITIONS — Timeline de Fases + Datetime Picker customizado
   Adicione ao final de fasting.css
   ============================================================ */

/* ── TIMELINE DE FASES ───────────────────────────────────────── */
.kh-phases-card {
  grid-column: 1 / -1;
}

.kh-timeline {
  position: relative;
  margin-top: 1.25rem;
  padding: 0.5rem 0;
}

/* Linha de fundo contínua */
.kh-timeline-track {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  border-radius: 3px;
}

/* Barra de progresso sobre a linha */
.kh-timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(42, 109, 217, 0.18),
    rgba(110, 231, 160, 0.12)
  );
  border-radius: 3px;
  transition: width 1s linear;
  pointer-events: none;
  z-index: 0;
}

/* Cada segmento de fase */
.kh-phase-seg {
  flex: 1;
  position: relative;
  padding: 0.85rem 0.7rem 0.75rem;
  border-top: 2px solid var(--border);
  cursor: default;
  transition:
    border-color 0.4s,
    background 0.4s;
  z-index: 1;
}

.kh-phase-seg:not(:last-child) {
  border-right: 1px solid rgba(240, 243, 248, 0.06);
}

/* Estado: passada */
.kh-phase-seg.passed {
  border-top-color: rgba(42, 109, 217, 0.5);
  background: rgba(42, 109, 217, 0.05);
}

/* Estado: atual */
.kh-phase-seg.current {
  border-top-color: #6ee7a0;
  background: rgba(110, 231, 160, 0.07);
}

.kh-phase-seg.current .kh-pseg-name {
  color: #6ee7a0;
}

/* Estado: futura */
.kh-phase-seg.future {
  opacity: 0.42;
}

/* Marcador de hora no topo */
.kh-pseg-hour {
  font-family: "DM Mono", monospace;
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  color: rgba(240, 243, 248, 0.35);
  display: block;
  margin-bottom: 0.4rem;
}

.kh-phase-seg.current .kh-pseg-hour {
  color: rgba(110, 231, 160, 0.6);
}

/* Nome da fase */
.kh-pseg-name {
  font-family: "DM Mono", monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(240, 243, 248, 0.6);
  display: block;
  line-height: 1.3;
  transition: color 0.4s;
}

/* Dot pulsante na fase atual */
.kh-pseg-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6ee7a0;
  display: inline-block;
  margin-right: 0.3rem;
  vertical-align: middle;
  animation: blink 1.8s ease infinite;
  flex-shrink: 0;
}

/* Tooltip com detalhe da fase */
.kh-pseg-detail {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 15, 20, 0.97);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.5rem 0.7rem;
  font-size: 0.7rem;
  color: rgba(240, 243, 248, 0.75);
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.kh-pseg-detail::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
}

.kh-phase-seg:hover .kh-pseg-detail {
  display: block;
}

/* Legenda abaixo */
.kh-timeline-legend {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.kh-tl-leg {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "DM Mono", monospace;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(240, 243, 248, 0.4);
}

.kh-tl-leg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.kh-tl-leg-dot.done {
  background: rgba(42, 109, 217, 0.6);
}
.kh-tl-leg-dot.now {
  background: #6ee7a0;
}
.kh-tl-leg-dot.next {
  background: rgba(240, 243, 248, 0.2);
}

/* Fase atual — detalhe expandido abaixo da timeline */
.kh-phase-current-detail {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(110, 231, 160, 0.05);
  border: 1px solid rgba(110, 231, 160, 0.15);
  border-radius: 3px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: fadeUp 0.4s ease both;
}

.kh-pcd-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  line-height: 1;
}

.kh-pcd-text {
  flex: 1;
}

.kh-pcd-label {
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #6ee7a0;
  display: block;
  margin-bottom: 0.25rem;
}

.kh-pcd-desc {
  font-size: 0.82rem;
  color: rgba(240, 243, 248, 0.65);
  line-height: 1.55;
}

.kh-pcd-next {
  font-size: 0.72rem;
  color: rgba(240, 243, 248, 0.35);
  margin-top: 0.3rem;
  display: block;
}

/* ── DATETIME PICKER CUSTOMIZADO ─────────────────────────────── */
/* Esconde o input original mas mantém no DOM (acessibilidade) */
.kh-start-box input[type="datetime-local"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Container do picker customizado */
.kh-dt-picker {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: rgba(13, 15, 20, 0.85);
  overflow: hidden;
  transition: border-color 0.2s;
}

.kh-dt-picker:focus-within {
  border-color: rgba(42, 109, 217, 0.5);
}

/* Linha de data e hora */
.kh-dt-row {
  display: flex;
  align-items: stretch;
}

.kh-dt-row + .kh-dt-row {
  border-top: 1px solid var(--border);
}

/* Ícone / label da linha */
.kh-dt-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  border-right: 1px solid var(--border);
  color: rgba(240, 243, 248, 0.28);
  font-size: 0.75rem;
  background: rgba(240, 243, 248, 0.02);
  flex-shrink: 0;
  min-width: 2.4rem;
}

/* Grupo de selects dentro de cada linha */
.kh-dt-fields {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0;
}

/* Cada select dentro do picker */
.kh-dt-select {
  flex: 1;
  background: #10141c !important;
  border: none !important;
  border-radius: 0 !important;
  color: var(--paper) !important;
  padding: 0.65rem 0.5rem !important;
  font-family: "DM Mono", monospace !important;
  font-size: 0.78rem !important;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  transition: background 0.15s;
}

.kh-dt-select:hover {
  background: rgba(42, 109, 217, 0.06) !important;
}

.kh-dt-select:focus {
  background: rgba(42, 109, 217, 0.1) !important;
}

/* Separador entre selects */
.kh-dt-sep {
  color: rgba(240, 243, 248, 0.2);
  font-family: "DM Mono", monospace;
  font-size: 0.8rem;
  flex-shrink: 0;
  user-select: none;
}

/* Botão "Agora" */
.kh-dt-now {
  border: none;
  background: transparent;
  border-left: 1px solid var(--border);
  color: var(--accent);
  font-family: "DM Mono", monospace;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 0.85rem;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.kh-dt-now:hover {
  background: rgba(42, 109, 217, 0.1);
  color: #7ab4f5;
}

/* Preview legível abaixo do picker */
.kh-dt-preview {
  font-family: "DM Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: rgba(240, 243, 248, 0.32);
  margin-top: 0.4rem;
  padding-left: 0.1rem;
  transition: color 0.3s;
}

.kh-dt-preview.has-value {
  color: rgba(240, 243, 248, 0.55);
}

/* Disabled state */
.kh-dt-picker.disabled {
  opacity: 0.38;
  pointer-events: none;
}

/* ── RESPONSIVE ADDITIONS ────────────────────────────────────── */
@media (max-width: 768px) {
  .kh-timeline-track {
    flex-direction: column;
  }

  .kh-phase-seg {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-top: none;
    border-left: 2px solid var(--border);
  }

  .kh-phase-seg.passed {
    border-left-color: rgba(42, 109, 217, 0.5);
    border-top: none;
  }
  .kh-phase-seg.current {
    border-left-color: #6ee7a0;
    border-top: none;
  }
  .kh-phase-seg:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid rgba(240, 243, 248, 0.06);
  }

  .kh-pseg-hour {
    margin-bottom: 0;
    min-width: 2.5rem;
  }

  .kh-pseg-detail {
    left: auto;
    right: 0;
    transform: none;
    bottom: auto;
    top: calc(100% + 4px);
  }

  .kh-pseg-detail::after {
    display: none;
  }

  .kh-timeline-progress {
    width: 100% !important;
    top: 0;
    height: var(--progress-h, 0%);
    transition: height 1s linear;
  }

  .kh-dt-select {
    font-size: 0.72rem !important;
    padding: 0.6rem 0.3rem !important;
  }
}
/* ===============================
   FIX SELECT ANDROID / WEBVIEW
   =============================== */

.kh-dt-select,
.kh-target-row select,
.kh-form-grid select {
  color-scheme: dark;
}

/* opções internas */
.kh-dt-select option,
.kh-target-row select option,
.kh-form-grid select option {
  background: #10141c !important;
  color: #ffffff !important;
}

/* item selecionado */
.kh-dt-select option:checked,
.kh-target-row select option:checked,
.kh-form-grid select option:checked {
  background: #2a6dd9 !important;
  color: #ffffff !important;
}

/* Firefox fallback */
.kh-dt-select optgroup,
.kh-target-row select optgroup,
.kh-form-grid select optgroup {
  background: #10141c;
  color: #ffffff;
}
/* ===============================
   FIX TIMELINE MOBILE + CLIQUE
   =============================== */

.kh-phase-seg {
  border: 0;
  text-align: left;
  color: inherit;
  font: inherit;
}

.kh-phase-seg.selected {
  outline: 1px solid rgba(110, 231, 160, 0.45);
  background: rgba(110, 231, 160, 0.1) !important;
}

.kh-pseg-detail-inline {
  display: none;
}

@media (max-width: 768px) {
  .kh-timeline-track {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .kh-phase-seg {
    width: 100%;
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 0.35rem 0.75rem;
    padding: 0.8rem 0.75rem;
    background: rgba(240, 243, 248, 0.025);
    border-left: 2px solid var(--border);
    border-bottom: 1px solid rgba(240, 243, 248, 0.06);
  }

  .kh-phase-seg.current {
    border-left-color: #6ee7a0;
    background: rgba(110, 231, 160, 0.08);
  }

  .kh-phase-seg.passed {
    border-left-color: rgba(42, 109, 217, 0.55);
  }

  .kh-pseg-hour {
    grid-row: span 2;
    min-width: 0;
    margin: 0;
    font-size: 0.56rem;
  }

  .kh-pseg-name {
    font-size: 0.62rem;
  }

  .kh-pseg-detail {
    display: none !important;
  }

  .kh-pseg-detail-inline {
    display: block;
    font-size: 0.72rem;
    line-height: 1.45;
    color: rgba(240, 243, 248, 0.55);
    text-transform: none;
    letter-spacing: 0;
  }

  .kh-timeline-progress {
    display: none;
  }

  .kh-timeline-legend {
    display: none;
  }
}
/* Corrige fases futuras acinzentadas no desktop */
.kh-timeline-progress {
  display: none;
}

.kh-phase-seg.future {
  opacity: 0.32;
  background: rgba(240, 243, 248, 0.025) !important;
}

.kh-phase-seg.future .kh-pseg-hour,
.kh-phase-seg.future .kh-pseg-name,
.kh-phase-seg.future .kh-pseg-detail,
.kh-phase-seg.future .kh-pseg-detail-inline {
  color: rgba(240, 243, 248, 0.28) !important;
}

.kh-phase-seg.current {
  opacity: 1;
  background: rgba(110, 231, 160, 0.08) !important;
}

.kh-phase-seg.passed {
  opacity: 0.72;
  background: rgba(42, 109, 217, 0.06) !important;
}
/* remove borda padrão mobile */
.kh-phase-seg,
.kh-phase-seg:focus,
.kh-phase-seg:active,
.kh-phase-seg:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

/* clique selecionado no padrão do site */
.kh-phase-seg.selected,
.kh-phase-seg:focus-visible {
  border-color: rgba(42, 109, 217, 0.55) !important;
  background: rgba(42, 109, 217, 0.08) !important;
  box-shadow: inset 0 0 0 1px rgba(42, 109, 217, 0.28);
}

/* mobile toque */
@media (max-width: 768px) {
  .kh-phase-seg.selected,
  .kh-phase-seg:focus-visible {
    border-left-color: #2a6dd9 !important;
    background: rgba(42, 109, 217, 0.1) !important;
  }
  .kh-phase-seg {
    user-select: none;
    touch-action: manipulation;
  }
}
