/* AATD Sim Scheduler — scoped to .aatd so it won't fight the theme. */
.aatd {
  --aatd-ink: #14202e;
  --aatd-muted: #5b6878;
  --aatd-line: #d9dee5;
  --aatd-bg: #ffffff;
  --aatd-soft: #f5f7fa;
  --aatd-accent: #1f5fa8;
  --aatd-accent-ink: #ffffff;
  --aatd-free: #fdf6d8;
  --aatd-free-line: #eadc9c;
  --aatd-taken: #e4e7ec;
  --aatd-bad: #b42318;
  --aatd-ok: #067647;
  max-width: 760px;
  margin: 0 auto;
  color: var(--aatd-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
.aatd *, .aatd *::before, .aatd *::after { box-sizing: border-box; }
.aatd button, .aatd input, .aatd select { font: inherit; color: inherit; }

.aatd-form, .aatd-done {
  background: var(--aatd-bg);
  border: 1px solid var(--aatd-line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.aatd-title h2 { margin: 0; font-size: 26px; line-height: 1.2; }
.aatd-sub { color: var(--aatd-muted); margin-top: 2px; }

.aatd-sec { border-top: 1px solid var(--aatd-line); margin-top: 20px; padding-top: 18px; }
.aatd-sec h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 0 0 12px; }
.aatd-n {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--aatd-accent); color: var(--aatd-accent-ink); font-size: 14px; font-weight: 700;
}

/* Date bar */
.aatd-datebar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aatd-nav, .aatd-today {
  height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid var(--aatd-line); border-radius: 10px;
  background: var(--aatd-soft); cursor: pointer; font-size: 20px; line-height: 1;
}
.aatd-today { font-size: 15px; font-weight: 600; }
.aatd-nav:disabled { opacity: .35; cursor: default; }
.aatd-date {
  height: 44px; padding: 0 10px; border: 1px solid var(--aatd-line); border-radius: 10px; background: #fff; min-width: 170px;
}
.aatd-pretty { margin-top: 8px; font-weight: 600; font-size: 17px; }

/* Slot grid */
.aatd-hint { margin: 0 0 10px; color: var(--aatd-muted); font-size: 15px; }
.aatd-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px;
  transition: opacity .15s;
}
.aatd-grid.is-loading { opacity: .45; pointer-events: none; }
.aatd-slot {
  position: relative; min-height: 46px; padding: 6px 4px; border-radius: 8px; cursor: pointer;
  background: var(--aatd-free); border: 1px solid var(--aatd-free-line); text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.aatd-slot .t { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; }
.aatd-slot:not(.hour) .t { font-weight: 500; color: #4a4a2a; }
.aatd-slot:hover:not(:disabled) { border-color: var(--aatd-accent); }
.aatd-slot:focus-visible { outline: 3px solid rgba(31, 95, 168, .35); outline-offset: 1px; }
.aatd-slot.taken { background: var(--aatd-taken); border-color: var(--aatd-taken); color: #8a94a3; cursor: not-allowed;
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.05) 6px 12px); }
.aatd-slot.past { background: #f2f3f5; border-color: #eceef1; color: #b3bac4; cursor: not-allowed; }
.aatd-slot.past .t, .aatd-slot.taken .t { color: inherit; font-weight: 500; }
.aatd-slot .who { font-size: 11px; line-height: 1.2; color: #5b6878; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.aatd-slot.sel { background: var(--aatd-accent); border-color: var(--aatd-accent); color: var(--aatd-accent-ink); }
.aatd-slot.sel .t { color: inherit; }
.aatd-full, .aatd-err { grid-column: 1 / -1; margin: 6px 0 0; color: var(--aatd-muted); }
.aatd-err { color: var(--aatd-bad); }

.aatd-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--aatd-muted); margin-top: 10px; }
.aatd-legend .k { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }
.aatd-legend .k.free { background: var(--aatd-free); border: 1px solid var(--aatd-free-line); }
.aatd-legend .k.sel { background: var(--aatd-accent); }
.aatd-legend .k.taken { background: var(--aatd-taken); }

.aatd-times { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.aatd-times .aatd-field { flex: 0 1 200px; }
.aatd-dur { padding-bottom: 12px; font-weight: 600; color: var(--aatd-accent); }

/* Fields */
.aatd-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.aatd-field label { font-size: 14px; font-weight: 600; color: #344054; }
.aatd-field input, .aatd-field select {
  height: 46px; padding: 0 12px; border: 1px solid #c4cbd5; border-radius: 10px; background: #fff; width: 100%;
}
.aatd-field input:focus, .aatd-field select:focus, .aatd-date:focus {
  outline: none; border-color: var(--aatd-accent); box-shadow: 0 0 0 3px rgba(31, 95, 168, .18);
}
.aatd-field select:disabled { background: var(--aatd-soft); color: #98a2b3; }
.aatd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* Aircraft buttons */
.aatd-planes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.aatd-plane {
  min-height: 52px; padding: 10px 14px; border: 2px solid var(--aatd-line); border-radius: 10px; background: #fff;
  cursor: pointer; font-weight: 600; text-align: left;
}
.aatd-plane:hover { border-color: #9fb3cc; }
.aatd-plane.on { border-color: var(--aatd-accent); background: #eaf1fb; color: #123d6e; }
.aatd-plane.on::before { content: "✓ "; }
.aatd-location { margin-top: 12px; }
.aatd-location[hidden] { display: none; }

.aatd-trap { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Messages & submit */
.aatd-msg:empty { display: none; }
.aatd-msg { margin: 18px 0 0; padding: 12px 14px; border-radius: 10px; font-weight: 500; }
.aatd-msg.bad { background: #fef3f2; color: var(--aatd-bad); border: 1px solid #fecdca; }
.aatd-msg.ok { background: #ecfdf3; color: var(--aatd-ok); border: 1px solid #abefc6; }
.aatd-submit {
  display: block; width: 100%; margin-top: 18px; height: 54px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--aatd-accent); color: var(--aatd-accent-ink); font-size: 18px; font-weight: 700;
}
.aatd-submit:hover:not(:disabled) { filter: brightness(1.08); }
.aatd-submit:disabled { opacity: .6; cursor: progress; }
.aatd-submit.secondary { background: var(--aatd-soft); color: var(--aatd-ink); border: 1px solid var(--aatd-line); font-size: 16px; height: 48px; }

/* Done */
.aatd-done { text-align: center; }
.aatd-check { width: 64px; height: 64px; margin: 4px auto 10px; border-radius: 50%; background: #ecfdf3; color: var(--aatd-ok);
  display: grid; place-items: center; font-size: 34px; font-weight: 700; }
.aatd-done h2 { margin: 0 0 6px; }
.aatd-done p { margin: 4px 0; }
.aatd-when { font-weight: 600; }
.aatd-when.big { font-size: 24px; font-variant-numeric: tabular-nums; }
.aatd-note { color: var(--aatd-muted); margin-top: 12px !important; }

@media (max-width: 560px) {
  .aatd-form, .aatd-done { padding: 16px; border-radius: 12px; }
  .aatd-two { grid-template-columns: 1fr; }
  .aatd-grid { grid-template-columns: repeat(4, 1fr); }
  .aatd-date { flex: 1; min-width: 0; }
  .aatd-title h2 { font-size: 22px; }
}

/* Themes often style every <button>; keep our colors. */
.aatd button.aatd-submit { background: var(--aatd-accent) !important; color: var(--aatd-accent-ink) !important; }
.aatd button.aatd-submit.secondary { background: var(--aatd-soft) !important; color: var(--aatd-ink) !important; }
.aatd button.aatd-slot.sel, .aatd button.aatd-slot.sel .t { color: var(--aatd-accent-ink) !important; }
.aatd button.aatd-plane.on { color: #123d6e !important; }

/* Theme-proofing: many themes force inputs/buttons to full width, add margins, uppercase, etc. */
.aatd button, .aatd input, .aatd select {
  margin: 0 !important; text-transform: none !important; letter-spacing: normal !important;
  box-shadow: none; text-shadow: none; min-width: 0; max-width: 100%;
}
.aatd button { width: auto; line-height: 1.2 !important; }
.aatd .aatd-datebar { display: flex !important; flex-wrap: nowrap; align-items: center; gap: 8px; }
.aatd .aatd-datebar > * { flex: 0 0 auto; width: auto !important; display: inline-flex !important; align-items: center; justify-content: center; }
.aatd .aatd-datebar input.aatd-date { flex: 0 1 220px; width: 220px !important; height: 44px !important; padding: 0 10px !important; }
.aatd .aatd-datebar button { height: 44px !important; padding: 0 14px !important; color: var(--aatd-ink) !important; background: var(--aatd-soft) !important; border: 1px solid var(--aatd-line) !important; border-radius: 10px !important; }
.aatd .aatd-datebar button:disabled { opacity: .35; }
.aatd .aatd-field input, .aatd .aatd-field select { width: 100% !important; height: 46px !important; padding: 0 12px !important; border: 1px solid #c4cbd5 !important; border-radius: 10px !important; background: #fff !important; font-size: 16px !important; }
.aatd .aatd-times .aatd-field { width: auto; }
.aatd button.aatd-slot { width: 100% !important; min-height: 46px !important; padding: 6px 4px !important; border-radius: 8px !important; display: flex !important; }
.aatd button.aatd-slot:not(.sel):not(.taken):not(.past) { background: var(--aatd-free) !important; border: 1px solid var(--aatd-free-line) !important; color: var(--aatd-ink) !important; }
.aatd button.aatd-slot.taken { background-color: var(--aatd-taken) !important; color: #8a94a3 !important; border: 1px solid var(--aatd-taken) !important; }
.aatd button.aatd-slot.past { background: #f2f3f5 !important; color: #b3bac4 !important; border: 1px solid #eceef1 !important; }
.aatd button.aatd-slot.sel { background: var(--aatd-accent) !important; border: 1px solid var(--aatd-accent) !important; }
.aatd button.aatd-plane { width: 100% !important; min-height: 52px !important; padding: 10px 14px !important; border: 2px solid var(--aatd-line) !important; border-radius: 10px !important; background: #fff !important; color: var(--aatd-ink) !important; text-align: left !important; display: block !important; }
.aatd button.aatd-plane.on { border-color: var(--aatd-accent) !important; background: #eaf1fb !important; color: #123d6e !important; }
.aatd button.aatd-submit { width: 100% !important; height: 54px !important; border-radius: 12px !important; margin-top: 18px !important; border: 0 !important; }
@media (max-width: 560px) {
  .aatd .aatd-datebar input.aatd-date { flex: 1 1 auto; width: auto !important; }
}
@media (max-width: 560px) {
  .aatd .aatd-datebar { gap: 6px; }
  .aatd .aatd-datebar button { padding: 0 10px !important; }
  .aatd .aatd-datebar input.aatd-date { padding: 0 6px !important; font-size: 15px !important; }
}

/* Always show a dropdown arrow on menus (some themes remove it). */
.aatd .aatd-field select {
  -webkit-appearance: none !important; appearance: none !important;
  padding-right: 38px !important; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23344054' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 14px center !important; background-size: 12px 8px !important;
}
.aatd .aatd-field select:disabled { background-color: var(--aatd-soft) !important; opacity: .7; }
.aatd button, .aatd select, .aatd input { -webkit-tap-highlight-color: transparent; }
