/* stage-35-schedule-wizard-flow-polish: Warm Glass OS schedule picker and wizard flow layer. */

#entryModal[data-action="schedule"] .modal-panel {
  --schedule-flow-accent: var(--label-schedule, #5f9073);
  --schedule-flow-card: color-mix(in srgb, var(--surface-elevated, var(--glass-elevated)) 70%, transparent);
  --schedule-flow-border: color-mix(in srgb, var(--schedule-flow-accent) 16%, var(--surface-border, var(--glass-border)));
}

.schedule-picker-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--schedule-flow-border, color-mix(in srgb, var(--label-schedule, #5f9073) 16%, var(--glass-border)));
  border-radius: var(--focus-radius-xl, 32px);
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 13%, transparent), transparent 18rem),
    radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--primary, #5678f5) 10%, transparent), transparent 17rem),
    linear-gradient(145deg, color-mix(in srgb, var(--surface-elevated, var(--glass-elevated)) 62%, transparent), color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 86%, transparent));
  box-shadow:
    0 18px 48px color-mix(in srgb, #000 10%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 16%, transparent);
  backdrop-filter: blur(var(--focus-blur-md, 20px)) saturate(1.08);
  -webkit-backdrop-filter: blur(var(--focus-blur-md, 20px)) saturate(1.08);
  padding: clamp(0.95rem, 1.7vw, 1.25rem);
}

.schedule-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.8rem, 1.5vw, 1rem);
}

.schedule-type-card {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: clamp(7rem, 12vw, 8.7rem);
  align-content: center;
  gap: 0.56rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 14%, var(--surface-border, var(--glass-border)));
  border-radius: var(--focus-radius-lg, 24px);
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, #fff 20%, transparent), transparent 54%),
    color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 74%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent),
    0 12px 32px color-mix(in srgb, #000 6%, transparent);
  color: var(--text-primary, var(--text));
  padding: clamp(1rem, 2vw, 1.28rem);
  text-align: left;
  transition:
    transform var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1)),
    border-color var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1)),
    background var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1)),
    box-shadow var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1));
}

.schedule-type-card::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, color-mix(in srgb, #fff 18%, transparent), transparent 42%),
    radial-gradient(circle at 90% 12%, color-mix(in srgb, var(--primary, #5678f5) 12%, transparent), transparent 44%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1));
}

.schedule-type-card strong {
  position: relative;
  z-index: 1;
  color: var(--text-primary, var(--text));
  font-size: clamp(1.05rem, 1.35vw, 1.18rem);
  font-weight: 790;
  letter-spacing: 0;
}

.schedule-type-card span {
  position: relative;
  z-index: 1;
  max-width: 28ch;
  color: var(--text-secondary, var(--muted-strong));
  font-size: 0.94rem;
  font-weight: 560;
  line-height: 1.45;
}

.schedule-type-card:is(:hover, :focus-visible, .selected) {
  border-color: color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 42%, var(--surface-border-strong, var(--glass-border-strong)));
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, #fff 26%, transparent), transparent 54%),
    color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 11%, var(--surface-elevated, var(--glass-elevated)));
  box-shadow:
    0 16px 42px color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 14%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent);
  transform: translateY(-2px);
}

.schedule-type-card:is(:hover, :focus-visible, .selected)::before {
  opacity: 1;
}

.schedule-wizard-shell {
  display: grid;
  min-width: 0;
  gap: clamp(0.72rem, 1.4vw, 0.95rem);
}

.wizard-topline {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 13%, var(--surface-border, var(--glass-border)));
  border-radius: var(--focus-radius-lg, 24px);
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, #fff 22%, transparent), transparent 58%),
    linear-gradient(145deg, color-mix(in srgb, var(--surface-elevated, var(--glass-elevated)) 60%, transparent), color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 86%, transparent));
  box-shadow:
    var(--focus-shadow-main, 0 10px 40px rgba(0,0,0,.08)),
    inset 0 1px 0 color-mix(in srgb, #fff 15%, transparent);
  padding: clamp(0.88rem, 1.5vw, 1.08rem);
}

.wizard-step-title {
  display: grid;
  min-width: 0;
  gap: 0.22rem;
}

.wizard-step-title span,
.wizard-step-count {
  color: var(--text-secondary, var(--muted-strong));
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0;
}

.wizard-step-title strong {
  overflow: hidden;
  color: var(--text-primary, var(--text));
  font-size: clamp(0.98rem, 1.2vw, 1.08rem);
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wizard-step-count {
  min-width: max-content;
}

.wizard-progress {
  height: 0.34rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-border, var(--glass-border)) 48%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 10%, transparent);
}

.wizard-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 78%, var(--primary, #5678f5)), color-mix(in srgb, var(--primary, #5678f5) 74%, #fff));
  box-shadow: 0 0 18px color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 18%, transparent);
}

.wizard-card {
  display: grid;
  gap: clamp(0.82rem, 1.5vw, 1.08rem);
  border: 1px solid color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 13%, var(--surface-border, var(--glass-border)));
  border-radius: var(--focus-radius-xl, 32px);
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, #fff 20%, transparent), transparent 60%),
    radial-gradient(circle at 94% 4%, color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 8%, transparent), transparent 48%),
    linear-gradient(145deg, color-mix(in srgb, var(--surface-elevated, var(--glass-elevated)) 60%, transparent), color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 88%, transparent));
  box-shadow:
    0 16px 44px color-mix(in srgb, #000 8%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 16%, transparent);
  backdrop-filter: blur(var(--focus-blur-md, 20px)) saturate(1.06);
  -webkit-backdrop-filter: blur(var(--focus-blur-md, 20px)) saturate(1.06);
  padding: clamp(1rem, 1.8vw, 1.28rem);
}

.wizard-card-head {
  display: grid;
  gap: 0.36rem;
  max-width: 66ch;
}

.wizard-card-head h3 {
  position: relative;
  margin: 0;
  color: color-mix(in srgb, var(--primary, #5678f5) 78%, var(--text-primary, var(--text)));
  font-size: clamp(1.08rem, 1.55vw, 1.34rem);
  font-weight: 800;
  letter-spacing: 0;
}

.wizard-card-head p {
  margin: 0;
  color: var(--text-secondary, var(--muted-strong));
  font-size: 0.92rem;
  font-weight: 560;
  line-height: 1.48;
}

.wizard-step-body {
  display: grid;
  min-width: 0;
  gap: clamp(0.82rem, 1.45vw, 1rem);
}

.wizard-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.58rem;
}

.wizard-chip {
  min-height: 2.62rem;
  border: 1px solid color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 13%, var(--surface-border, var(--glass-border)));
  border-radius: 999px;
  background:
    radial-gradient(circle at 28% 0%, color-mix(in srgb, #fff 18%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 78%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 13%, transparent);
  color: var(--text-primary, var(--text));
  font-size: 0.95rem;
  font-weight: 770;
  padding: 0 1rem;
  transition:
    transform var(--motion-fast, 140ms cubic-bezier(.2,.8,.2,1)),
    border-color var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1)),
    background var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1)),
    box-shadow var(--motion-standard, 220ms cubic-bezier(.2,.8,.2,1));
}

.wizard-chip:is(:hover, :focus-visible, .selected) {
  border-color: color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 42%, var(--surface-border-strong, var(--glass-border-strong)));
  background:
    radial-gradient(circle at 28% 0%, color-mix(in srgb, #fff 24%, transparent), transparent 58%),
    color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 14%, var(--surface-elevated, var(--glass-elevated)));
  box-shadow:
    0 10px 24px color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 13%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 16%, transparent);
  color: color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 76%, var(--text-primary, var(--text)));
  transform: translateY(-1px);
}

.wizard-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.wizard-option {
  min-height: 3.2rem;
  border: 1px solid color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 13%, var(--surface-border, var(--glass-border)));
  border-radius: var(--focus-radius-md, 18px);
  background:
    radial-gradient(circle at 24% 0%, color-mix(in srgb, #fff 18%, transparent), transparent 54%),
    color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 78%, transparent);
  color: var(--text-primary, var(--text));
  font-weight: 760;
  padding: 0.72rem 1rem;
  text-align: left;
}

.wizard-option:is(:hover, :focus-visible, .selected) {
  border-color: color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 42%, var(--surface-border-strong, var(--glass-border-strong)));
  background:
    radial-gradient(circle at 24% 0%, color-mix(in srgb, #fff 24%, transparent), transparent 54%),
    color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 13%, var(--surface-elevated, var(--glass-elevated)));
  box-shadow: 0 12px 28px color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 12%, transparent);
  color: color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 76%, var(--text-primary, var(--text)));
}

.wizard-subsection {
  border: 1px solid color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 12%, var(--surface-border, var(--glass-border)));
  border-radius: var(--focus-radius-lg, 24px);
  background:
    radial-gradient(circle at 16% 0%, color-mix(in srgb, #fff 18%, transparent), transparent 56%),
    color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 72%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 13%, transparent);
  padding: clamp(0.82rem, 1.45vw, 1rem);
}

.schedule-voice-slot {
  min-height: 0;
}

.schedule-voice-slot:not(:empty) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: -0.08rem;
  border: 1px solid color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 10%, var(--surface-border, var(--glass-border)));
  border-radius: var(--focus-radius-lg, 24px);
  background: color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 58%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 10%, transparent);
  padding: 0.38rem 0.55rem;
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  width: max-content;
  max-width: 100%;
  justify-self: end;
  margin-top: 0.05rem;
  border: 1px solid color-mix(in srgb, var(--schedule-flow-accent, #5f9073) 10%, var(--surface-border, var(--glass-border)));
  border-radius: var(--focus-radius-lg, 24px);
  background:
    radial-gradient(circle at 16% 0%, color-mix(in srgb, #fff 18%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 72%, transparent);
  box-shadow:
    var(--focus-shadow-main, 0 10px 40px rgba(0,0,0,.08)),
    inset 0 1px 0 color-mix(in srgb, #fff 13%, transparent);
  backdrop-filter: blur(var(--focus-blur-sm, 14px));
  -webkit-backdrop-filter: blur(var(--focus-blur-sm, 14px));
  padding: 0.42rem;
}

.schedule-preview-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--schedule-preview-color, var(--schedule-flow-accent, #5f9073)) 22%, var(--surface-border, var(--glass-border)));
  border-radius: var(--focus-radius-xl, 32px);
  background:
    radial-gradient(circle at 14% 0%, color-mix(in srgb, var(--schedule-preview-color, var(--schedule-flow-accent, #5f9073)) 14%, transparent), transparent 18rem),
    radial-gradient(circle at 92% 0%, color-mix(in srgb, #fff 15%, transparent), transparent 18rem),
    linear-gradient(145deg, color-mix(in srgb, var(--surface-elevated, var(--glass-elevated)) 58%, transparent), color-mix(in srgb, var(--surface-glass, var(--glass-surface)) 88%, transparent));
  box-shadow:
    0 18px 48px color-mix(in srgb, var(--schedule-preview-color, var(--schedule-flow-accent, #5f9073)) 10%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 15%, transparent);
  padding: clamp(1rem, 1.8vw, 1.25rem);
}

.schedule-preview-card::before {
  position: absolute;
  inset: 1rem auto auto 1rem;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: var(--schedule-preview-color, var(--schedule-flow-accent, #5f9073));
  box-shadow: 0 0 18px color-mix(in srgb, var(--schedule-preview-color, var(--schedule-flow-accent, #5f9073)) 34%, transparent);
  content: "";
}

.schedule-preview-card > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 760px) {
  .schedule-picker-shell {
    border-radius: var(--focus-radius-lg, 24px);
    padding: 0.82rem;
  }

  .schedule-type-grid,
  .wizard-option-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-type-card {
    min-height: 5.9rem;
    border-radius: var(--focus-radius-lg, 24px);
  }

  .wizard-topline {
    align-items: flex-start;
    border-radius: var(--focus-radius-lg, 24px);
  }

  .wizard-step-title strong {
    white-space: normal;
  }

  .wizard-card,
  .schedule-preview-card {
    border-radius: var(--focus-radius-lg, 24px);
    padding: 0.88rem;
  }

  .wizard-chip {
    min-height: 2.72rem;
  }

  .wizard-actions {
    position: sticky;
    bottom: max(0.8rem, env(safe-area-inset-bottom));
    z-index: 4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .schedule-type-card,
  .schedule-type-card::before,
  .wizard-chip,
  .wizard-option,
  .wizard-progress i {
    transition-duration: 1ms;
  }
}
