/* Match Upcoming School Events across event screens while keeping flyers printable. */
@media screen {
  html body main#app:is([data-page="event"], [data-page="eventPreview"], [data-page="eventDraftFamilyPreview"], [data-page="eventEmail"], [data-page="eventPlan"], [data-page="schoolEvent"], [data-page="schoolEventEdit"], [data-page="eventDesk"]):not([data-page="schoolEvent"]:has(.fundraiser-page)),
  html body main#app:has(.school-flyer-builder, .school-event-flyer, .family-journey, .ticket-checkout) {
    background: radial-gradient(ellipse at top left, #eee2ff, transparent 52%),
      radial-gradient(ellipse at right, #dff7ef, transparent 58%), #faf8ff !important;
    color: #251940;
  }

  html body #app :is(.flyer-editor-heading, .ed-studio-heading, .journey-hero, .stripe-surface.ticket-checkout .stripe-heading) {
    background: linear-gradient(125deg, #fff9e8, #eee2ff) !important;
    color: #251940 !important;
    border: 1px solid #a98bda66 !important;
    border-radius: 18px !important;
    padding: clamp(16px, 3vw, 26px) !important;
    box-shadow: 0 8px 20px #563d741b;
  }

  html body #app :is(.flyer-editor-heading, .ed-studio-heading, .journey-hero, .stripe-surface.ticket-checkout .stripe-heading) h1 {
    font-family: Cubby, system-ui, sans-serif !important;
    font-size: clamp(24px, 4vw, 36px) !important;
    color: #291a48 !important;
    text-shadow: none !important;
  }

  html body #app :is(.flyer-editor-heading, .ed-studio-heading, .journey-hero, .stripe-surface.ticket-checkout .stripe-heading) p {
    color: #594672 !important;
  }

  html body #app :is(.flyer-editor-heading .flyer-editor-eyebrow, .ed-studio-heading .ed-eyebrow, .journey-hero dt) {
    color: #206a5c !important;
  }

  html body #app :is(.family-journey, .stripe-surface.ticket-checkout) {
    background: #faf6ff !important;
    border: 1px solid #7a67915c !important;
  }

  html body #app :is(.family-journey .ed-section, .ticket-checkout .ed-section, [data-page="eventDesk"] .ed-desk > .ed-section) {
    border-color: #a99bc7 !important;
    border-radius: 15px !important;
  }

  html body #app .school-flyer-builder > form,
  html body #app .school-flyer-builder > .school-flyer-preview {
    border: 1px solid #a99bc7;
    border-radius: 16px;
  }

  html body #app .school-flyer-builder .flyer-builder-step {
    background: #faf7ff;
    border-color: #ded1f0;
    padding: 12px 14px;
    margin-bottom: 12px;
  }

  html body #app .school-flyer-builder .flyer-builder-step > summary {
    color: #362653;
    font-weight: 750;
  }

  html body #app:is([data-page="event"], [data-page="eventPreview"], [data-page="eventDraftFamilyPreview"], [data-page="eventEmail"], [data-page="eventPlan"], [data-page="schoolEvent"], [data-page="schoolUpcomingEvents"], [data-page="schoolEvents"]) > :is(button.block, a.block),
  html body #app :is(.school-flyer-builder, .school-event-family-tools, [data-page="eventDesk"] .ed-desk, .ticket-checkout) :is(button.block, a.block):not(.card) {
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    width: fit-content !important;
    max-width: 100% !important;
    min-height: 44px !important;
    padding: 8px 14px !important;
    margin: 6px 8px 6px 0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    text-align: center;
  }

  html body #app :is(.family-journey, [data-page="eventDesk"] .ed-desk) .ed-choice-grid button {
    min-height: 44px;
    padding: 9px 12px;
  }

  html body #app .family-journey .ed-desk > p:not(.journey-deadline),
  html body #app[data-page="eventDesk"] .ed-desk > p:not(.card, .journey-deadline) {
    color: #e6def7;
  }

  html body #app[data-page="eventDesk"] .ed-desk > p a {
    color: #206a5c;
  }
}

@media screen {
  #app .event-flyer-view {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(230px, 1fr);
    align-items: start;
    gap: clamp(14px, 3vw, 26px);
    max-width: 1040px;
    margin: 14px auto;
  }

  #app .event-flyer-display {
    min-width: 0;
    padding: clamp(8px, 2vw, 18px);
    border: 1px solid #a48bcc70;
    border-radius: 24px;
    background: linear-gradient(145deg, #252039, #172638);
    box-shadow: 0 18px 44px #0005;
  }

  html body #app .event-flyer-display > .school-event-flyer {
    margin: 0 auto !important;
    max-width: 100% !important;
    border-radius: 18px !important;
    box-shadow: 0 5px 26px #0005;
  }

  #app .event-flyer-side {
    min-width: 0;
    display: grid;
    gap: 10px;
  }

  #app .event-flyer-side :is(.school-event-family-tools, .cc-ticket-actions) {
    margin: 0 !important;
  }

  #app .event-flyer-side .cc-ticket-actions {
    padding: 16px !important;
    border: 1px solid #a98bda66 !important;
    border-radius: 16px !important;
    background: #21233a !important;
    color: #251940 !important;
  }

  #app .event-flyer-side .cc-ticket-actions h2 { color: #97f5e8 !important; }
  #app .event-flyer-side .cc-ticket-actions p { color: #594672 !important; }
  #app .event-flyer-actions { display: flex; flex-wrap: wrap; gap: 7px; }

  html body #app .event-flyer-actions :is(button, a).block {
    width: auto !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 8px 12px !important;
  }

  html body #app .journey-hero {
    display: block !important;
    min-height: 0 !important;
  }

  #app .family-journey .journey-hero dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(125px, 100%), 1fr));
    gap: 8px;
  }

  #app .family-journey .journey-hero dl > div {
    padding: 8px 12px;
    border: 1px solid #d8c6ff44;
    border-radius: 10px;
    background: #ffffff0a;
  }

  #app :is(.family-journey, .ticket-checkout) .ed-ticket {
    position: relative;
    border-top: 5px solid #7353b8 !important;
    background: linear-gradient(#faf5ff 0 55px, #fff 55px) !important;
  }

  #app :is(.family-journey, .ticket-checkout) .ed-ticket-brand {
    border-bottom-style: dashed;
    letter-spacing: .07em;
  }

  @media (max-width: 720px) {
    #app .event-flyer-view { grid-template-columns: minmax(0, 1fr); }
  }
}

@media print {
  #app .event-flyer-view .event-flyer-side { display: none !important; }
}

@media screen {
  html body main#app:has(.organizer-workspace) {
    background: #faf9ff !important;
    color: #21183c;
  }

  #app .organizer-workspace {
    max-width: 980px;
    margin: auto;
    font: 15px/1.5 Inter, system-ui, sans-serif;
    color: #21183c;
  }

  #app .organizer-pass {
    display: grid !important;
    grid-template-columns: minmax(90px, 34%) minmax(0, 1fr);
    align-items: stretch;
    min-height: 0 !important;
    background: #ede4ff !important;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
  }

  .organizer-pass::after {
    content: "";
    position: absolute;
    right: -10px;
    top: calc(50% - 10px);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #faf9ff;
    pointer-events: none;
  }

  #app .organizer-pass-art {
    display: grid;
    align-items: center;
    min-width: 0;
    border-right: 3px dashed #bba3e3;
    background: linear-gradient(155deg, #6439bc, #2b6fb0);
    padding: 8px;
  }

  #app .organizer-pass-art > span {
    text-align: center;
    font-size: 44px;
    color: #fff;
  }

  html body #app .organizer-pass-art > .school-event-flyer {
    margin: 0 !important;
    max-width: 100% !important;
    max-height: 190px;
    overflow: hidden;
    border-radius: 10px !important;
  }

  #app .organizer-pass-copy { padding: clamp(12px, 3vw, 25px); overflow-wrap: anywhere; }
  html body #app .organizer-pass h1 {
    margin: 4px 0 6px !important;
    font: 800 clamp(24px, 4vw, 42px)/1.1 Inter, system-ui, sans-serif !important;
    color: #26174c !important;
    text-align: left !important;
  }
  #app .organizer-pass-copy p { margin: 0 0 6px; color: #463663 !important; }
  #app .organizer-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 12px 0 18px;
    padding: 10px 0;
    background: #f0ecfc;
    border-radius: 12px;
    text-align: center;
  }
  #app .organizer-totals > div + div { border-left: 1px solid #d8cbea; }
  #app .organizer-totals dd { margin: 0; font-size: clamp(20px, 3vw, 30px); font-weight: 800; }
  #app .organizer-totals dt { font-weight: 650; }
  #app .organizer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 12px; }
  #app .organizer-records { min-width: 0; padding: 14px; border: 1px solid #ded7ed; border-radius: 14px; background: white; }
  html body #app .organizer-records h2 { font: 750 22px/1.2 Inter, system-ui, sans-serif !important; color: #21183c !important; margin: 0 0 10px; }
  #app .organizer-actions { display: grid; align-content: start; gap: 8px; }
  html body #app .organizer-actions button {
    min-height: 44px; margin: 0; padding: 8px; border: 1px solid #d0b9f3; border-radius: 11px;
    font: 700 14px/1.25 Inter, system-ui, sans-serif !important;
    background: #eee4ff !important; color: #361970 !important;
  }
  html body #app .organizer-actions button[data-ed-scan] { background: #632bc0 !important; color: white !important; }
  html body #app .organizer-workspace .ed-desk { padding: 0; }
  html body #app .organizer-workspace .ed-desk > p { color: #39314c; }
  #app .organizer-records .ed-controls { margin: 0 0 10px; padding: 0; }

  @media (max-width: 680px) {
    #app .organizer-grid { display: flex; flex-direction: column; }
    #app .organizer-actions {
      position: sticky;
      bottom: 0;
      z-index: 2;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
      background: #faf9ff;
    }
    #app .organizer-pass-copy p { font-size: 13px; }
    #app .organizer-records .ed-table :is(tbody,tr,td) { display: block; }
    #app .organizer-records .ed-table { min-width: 0 !important; width: 100%; }
    #app .organizer-records .ed-table thead { display: none; }
    #app .organizer-records .ed-table tr { border-bottom: 1px solid #ded7ed; padding: 8px 0; }
    #app .organizer-records .ed-table td { padding: 4px 8px; overflow-wrap: anywhere; }
    #app .organizer-records .ed-table td:first-child { display: none; }
    #app .organizer-records .ed-table td[data-record-label]::before {
      content: attr(data-record-label) ": ";
      font-weight: 650;
    }
  }

  html body #app .event-flyer-side .cc-ticket-actions {
    background: #faf8ff !important;
    color: #251c3f !important;
  }
  html body #app .event-flyer-side .cc-ticket-actions :is(h2,p) { color: #35245e !important; }
  #app .event-flyer-display {
    padding: clamp(8px, 2vw, 16px);
    background: linear-gradient(150deg, #f1e9ff, #dff9f2);
    border-color: #cebde9;
  }
  html body #app .event-flyer-display .flyer-details {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(125px, 100%), 1fr)) !important;
    gap: 12px !important;
  }
  html body #app .event-flyer-display .flyer-details > div:last-child {
    grid-column: auto;
  }
  html body #app .event-flyer-display .flyer-details strong {
    overflow-wrap: anywhere;
  }
}
