:root {
  --form-paper: #f8fbff;
  --form-panel: #eaf4fb;
  --form-ink: #10223b;
  --form-muted: #60738d;
  --form-line: #c7dae8;
  --form-cyan: #1ca9e4;
  --form-gold: #ffc85a;
}

#xem-ngay.astro-entry {
  width: min(1120px, calc(100% - 32px)) !important;
  max-width: 1120px !important;
  margin: 28px auto 46px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

#xem-ngay > h2 {
  margin: 0 0 18px !important;
  color: #fff !important;
  font-size: clamp(34px, 4vw, 52px) !important;
  line-height: 1.08 !important;
  letter-spacing: -.04em !important;
  text-align: left !important;
}

#xem-ngay .astro-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, .75fr) !important;
  gap: 16px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: clamp(18px, 3vw, 34px) !important;
  color: var(--form-ink) !important;
  border: 1px solid rgba(186, 213, 234, .8) !important;
  border-radius: 26px !important;
  background: rgba(248, 251, 255, .99) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .32) !important;
}

#xem-ngay .astro-saved {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .85fr) !important;
  gap: 8px 18px !important;
  align-items: center !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 16px 18px !important;
  border: 1px solid #c7dcec !important;
  border-radius: 16px !important;
  background: var(--form-panel) !important;
  box-shadow: none !important;
}

#xem-ngay .astro-saved > label {
  grid-column: 1 !important;
  margin: 0 !important;
  color: var(--form-ink) !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}

#xem-ngay .astro-saved__controls {
  grid-column: 2 !important;
  grid-row: 1 / span 2 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 10px !important;
  width: 100% !important;
}

#xem-ngay .astro-saved__status {
  grid-column: 1 !important;
  margin: 0 !important;
  color: var(--form-muted) !important;
  font-size: 11px !important;
}

#xem-ngay .astro-form > label:has(#short-name) { grid-column: 1 !important; grid-row: 2 !important; }
#xem-ngay .astro-form > label:has(#gender) { grid-column: 2 !important; grid-row: 2 !important; }
#xem-ngay .astro-form > .astro-form__hint { grid-column: 1 !important; grid-row: 3 !important; margin: -10px 3px 0 !important; color: var(--form-muted) !important; font-size: 11px !important; }
#xem-ngay .astro-form > .astro-control:has(#birth-day) { grid-column: 1 !important; grid-row: 4 !important; }
#xem-ngay .astro-form > .astro-control:has(#birth-hour) { grid-column: 2 !important; grid-row: 4 !important; }

#xem-ngay .astro-control:not(.astro-control--location) {
  min-width: 0 !important;
  min-height: 52px !important;
  margin: 0 !important;
  border: 1px solid #cadce9 !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

#xem-ngay .astro-control:not(.astro-control--location):focus-within {
  border-color: var(--form-cyan) !important;
  box-shadow: 0 0 0 3px rgba(28, 169, 228, .13) !important;
}

#xem-ngay .astro-control:not(.astro-control--location) .astro-control__icon {
  width: 54px !important;
  min-width: 54px !important;
  height: 50px !important;
  color: #147aaa !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #edf7ff !important;
}

#xem-ngay .astro-control:not(.astro-control--location) input,
#xem-ngay .astro-control:not(.astro-control--location) select {
  width: 100% !important;
  min-width: 0 !important;
  height: 50px !important;
  padding: 0 14px !important;
  color: var(--form-ink) !important;
  border: 0 !important;
  border-left: 1px solid #e2edf5 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#xem-ngay .astro-control:has(#birth-day),
#xem-ngay .astro-control:has(#birth-hour) {
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 0 !important;
  padding: 0 !important;
}

#xem-ngay .astro-control:has(#birth-day) .astro-control__fields,
#xem-ngay .astro-control:has(#birth-hour) .astro-control__fields {
  display: grid !important;
  grid-column: 2 !important;
  gap: 8px !important;
  padding: 0 10px !important;
}

#xem-ngay .astro-control:has(#birth-day) .astro-control__fields { grid-template-columns: .75fr .85fr 1.1fr !important; }
#xem-ngay .astro-control:has(#birth-hour) .astro-control__fields { grid-template-columns: 1fr 1fr !important; }

#xem-ngay .astro-control:has(#birth-day) select,
#xem-ngay .astro-control:has(#birth-hour) select {
  height: 42px !important;
  padding: 0 12px !important;
  border: 1px solid #d6e5f0 !important;
  border-radius: 10px !important;
  background: var(--form-paper) !important;
}

#xem-ngay .astro-control__note { display: none !important; }

#xem-ngay .astro-location-title {
  grid-column: 1 / -1 !important;
  margin: 2px 0 -8px !important;
  color: var(--form-ink) !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}

#xem-ngay .astro-location-title::before {
  display: inline-grid !important;
  width: 30px !important;
  height: 30px !important;
  margin-right: 10px !important;
  place-items: center !important;
  color: #071628 !important;
  border-radius: 9px !important;
  background: var(--form-gold) !important;
  font-weight: 800 !important;
}

#xem-ngay .astro-location-title:first-of-type::before { content: '1' !important; }
#xem-ngay .astro-location-title:last-of-type::before { content: '2' !important; }

#xem-ngay .astro-control--location {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 16px !important;
  border: 1px solid var(--form-line) !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, #f4f9fd 0%, #eaf3f9 100%) !important;
  box-shadow: none !important;
}

#xem-ngay .astro-control--location > .astro-control__icon {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  color: #147aaa !important;
  border-radius: 12px !important;
  background: #e5f4fd !important;
}

#xem-ngay .tuvi5s-location-picker { width: 100% !important; margin: 0 !important; color: var(--form-ink) !important; }

#xem-ngay .tuvi5s-location-picker select,
#xem-ngay .tuvi5s-location-picker input {
  min-height: 48px !important;
  color: var(--form-ink) !important;
  border: 1px solid #c8dbe9 !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: none !important;
}

#xem-ngay .astro-save-option,
#xem-ngay .astro-form__pending,
#xem-ngay .astro-form__actions { grid-column: 1 / -1 !important; }

#xem-ngay .astro-save-option { color: #35516f !important; }

#xem-ngay .astro-form__pending {
  min-height: 40px !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  color: #19456a !important;
  border-left: 4px solid var(--form-cyan) !important;
  border-radius: 10px !important;
  background: #eaf6fc !important;
}

#xem-ngay .astro-form__actions {
  display: grid !important;
  grid-template-columns: minmax(220px, 1fr) 150px !important;
  gap: 12px !important;
  width: min(650px, 100%) !important;
  margin: 0 auto !important;
}

#xem-ngay .astro-form__actions button,
#xem-ngay .astro-form__actions input[type='submit'] {
  min-height: 52px !important;
  border-radius: 13px !important;
  font-weight: 800 !important;
}

#xem-ngay .astro-form__actions button[type='submit'],
#xem-ngay .astro-form__actions input[type='submit'] {
  color: #071628 !important;
  border: 0 !important;
  background: linear-gradient(180deg, #8bd9fa, #4db9e8) !important;
  box-shadow: 0 12px 25px rgba(28, 169, 228, .22) !important;
}

@media (max-width: 760px) {
  #xem-ngay.astro-entry { width: min(100% - 18px, 620px) !important; }
  #xem-ngay > h2 { font-size: 35px !important; }
  #xem-ngay .astro-form { grid-template-columns: 1fr !important; padding: 14px !important; border-radius: 20px !important; }
  #xem-ngay .astro-saved { grid-template-columns: 1fr !important; padding: 13px !important; }
  #xem-ngay .astro-saved > label,
  #xem-ngay .astro-saved__controls,
  #xem-ngay .astro-saved__status { grid-column: 1 !important; grid-row: auto !important; }
  #xem-ngay .astro-saved__controls { grid-template-columns: 1fr !important; }
  #xem-ngay .astro-form > label:has(#short-name),
  #xem-ngay .astro-form > label:has(#gender),
  #xem-ngay .astro-form > .astro-form__hint,
  #xem-ngay .astro-form > .astro-control:has(#birth-day),
  #xem-ngay .astro-form > .astro-control:has(#birth-hour) { grid-column: 1 !important; grid-row: auto !important; }
  #xem-ngay .astro-control:has(#birth-day),
  #xem-ngay .astro-control:has(#birth-hour) { grid-template-columns: 44px minmax(0, 1fr) !important; }
  #xem-ngay .astro-control:has(#birth-day) .astro-control__icon,
  #xem-ngay .astro-control:has(#birth-hour) .astro-control__icon { width: 44px !important; min-width: 44px !important; }
  #xem-ngay .astro-control--location { padding: 13px !important; }
  #xem-ngay .astro-form__actions { grid-template-columns: 1fr !important; }
}

@media (max-width: 430px) {
  #xem-ngay .astro-control:has(#birth-day) .astro-control__fields { grid-template-columns: 1fr 1fr !important; }
  #xem-ngay .astro-control:has(#birth-day) .astro-control__fields select:last-of-type { grid-column: 1 / -1 !important; }
  #xem-ngay .astro-control:has(#birth-hour) .astro-control__fields { grid-template-columns: 1fr 1fr !important; }
}
