/* Presentation only: no changes to authentication, requests, record values or order. */
@media screen {
  /* A bounded floating menu leaves room for the device edge. */
  .site-header .mobile-menu {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 8px);
    width: min(600px, calc(100% - 24px));
    margin-inline: auto;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 18px 48px rgb(10 39 67 / 18%);
    max-height: calc(100vh - var(--kyp-header-height, var(--header-h)) - 40px);
    max-height: calc(100dvh - var(--kyp-header-height, var(--header-h)) - 40px - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-block: 14px;
  }
  .mobile-menu .mobile-menu-inner { width: 100%; padding: 12px; gap: 4px; }
  .mobile-menu .mobile-link {
    min-height: 46px;
    padding: 12px 14px;
    border: 0;
    border-radius: 11px;
    text-align: start;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .mobile-menu .mobile-link:hover, .mobile-menu .mobile-link:focus-visible {
    background: var(--surface-soft);
    color: var(--ink);
  }
  .mobile-menu .mobile-link.is-active {
    background: var(--surface-soft);
    box-shadow: inset 3px 0 var(--blue-700);
    color: var(--ink);
  }
  html[dir="rtl"] .mobile-menu .mobile-link.is-active { box-shadow: inset -3px 0 var(--blue-700); }
  .mobile-menu .mobile-link[data-nav="explore"] {
    margin-top: 8px;
    border-top: 1px solid var(--line);
    border-start-start-radius: 0;
    border-start-end-radius: 0;
    padding-top: 18px;
  }
  .mobile-menu .mobile-flyer-menu { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
  .mobile-menu .mobile-flyer-links { padding: 6px 4px 12px; gap: 8px; }
  .mobile-menu .mobile-flyer-links a { min-height: 46px; }
  body:has(#mobileMenu:not([hidden])) .help-fab,
  body:has(#mobileMenu:not([hidden])) .help-panel { visibility: hidden; }

  /* Shared record-page rhythm, retaining Know Your Path's blue and gold. */
  .schedule-hero, .credits-page-hero {
    background: linear-gradient(115deg, var(--surface-soft), var(--surface));
    border-bottom: 1px solid var(--line);
    color: var(--ink);
  }
  .schedule-hero::after { display: none; }
  .schedule-hero { padding: 26px 0 30px; }
  .schedule-hero .back-link, .schedule-eyebrow { color: var(--blue-700); }
  .schedule-hero-copy { padding-top: 18px; }
  .schedule-hero h1, .credits-hero-row h1 {
    color: var(--ink);
    font-size: clamp(2rem, 3.6vw, 3rem);
    line-height: 1.16;
    margin: 10px 0 12px;
    letter-spacing: -.035em;
  }
  .schedule-hero p, .credits-hero-row p { color: var(--muted); font-size: 1rem; line-height: 1.65; }
  .credits-page-hero-content { padding-block: 26px 30px; }
  .credits-hero-row { margin-top: 16px; gap: 20px; }
  .credits-content-shell, .schedule-content { padding-block: 28px 72px; }
  .credits-page-actions .button, .schedule-actions .button { min-height: 46px; }

  /* Classes: one clear sequence, with teacher and site above secondary details. */
  .schedule-toolbar { padding: 20px 24px; border-radius: 18px; box-shadow: none; }
  .schedule-date-control { gap: 8px 16px; }
  .schedule-date-control > span { font-size: .82rem; }
  .schedule-heading { align-items: center; flex-wrap: wrap; gap: 6px 20px; }
  .schedule-heading h2 { font-size: 1.4rem; }
  .schedule-heading > span { font-size: .95rem; }
  .schedule-metrics { gap: 12px; margin: 18px 0 26px; }
  .schedule-metrics > div { padding: 18px 20px; border-radius: 16px; box-shadow: none; }
  .schedule-metrics strong { font-size: 1.8rem; }
  .schedule-metrics span { font-size: .9rem; }
  .schedule-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .schedule-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, .6fr);
    border-radius: 20px;
    box-shadow: 0 4px 16px rgb(10 39 67 / 3%);
  }
  .schedule-card header { grid-column: 1; padding: 24px 26px 0; border-top: 0; }
  .schedule-card h3 { font-size: 1.35rem; line-height: 1.4; margin: 7px 0 12px; }
  .schedule-course-code { font-size: .8rem; }
  .schedule-status { font-size: .78rem; padding: 7px 10px; }
  .schedule-details { grid-column: 1; padding: 22px 26px; gap: 20px 24px; }
  .schedule-details dt { font-size: .75rem; letter-spacing: .035em; margin-bottom: 6px; }
  .schedule-details dd { font-size: .94rem; font-weight: 650; }
  .schedule-details > div:first-child dd { font-size: 1.08rem; color: var(--ink); }
  .schedule-details > div:nth-child(n+3) { padding-top: 14px; border-top: 1px solid var(--line); }
  .schedule-meetings {
    grid-column: 2;
    grid-row: 1 / 3;
    margin: 18px 18px 18px 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--blue-700);
    border-radius: 14px;
  }
  html[dir="rtl"] .schedule-meetings { margin: 18px 0 18px 18px; }
  .schedule-meetings li { display: block; padding: 20px; background: transparent; }
  .schedule-period { display: block; font-size: 1rem; color: var(--ink); }
  .schedule-period small { font-size: .8rem; color: var(--muted); margin-top: 5px; }
  .schedule-meetings strong { display: block; font-size: 1rem; margin-top: 16px; text-align: start; overflow-wrap: anywhere; }
  .schedule-card:not(:has(.schedule-meetings)) { grid-template-columns: minmax(0, 1fr); }
  .schedule-card footer { grid-column: 1 / -1; font-size: .78rem; padding: 14px 26px; }
  .schedule-note { font-size: .9rem; padding: 18px 20px; border-radius: 0 14px 14px 0; background: var(--surface); }
  .schedule-refreshed { font-size: .8rem; }

  /* Credits: readable summary and subject cards, retaining all original totals. */
  .credits-summary { border-radius: 22px; box-shadow: 0 12px 28px rgb(10 39 67 / 10%); }
  .credits-summary-top { padding: 28px 30px; }
  .credits-kicker { font-size: .78rem; letter-spacing: .06em; }
  .credits-summary h2 { font-size: 1.8rem; overflow-wrap: anywhere; }
  .credits-summary-top p { font-size: .9rem; color: #d2e2f1; }
  .credits-ring span { font-size: .7rem; color: #d2e2f1; }
  .credits-metrics > div { padding: 20px 28px; gap: 5px; }
  .credits-metrics span { font-size: .8rem; color: #d2e2f1; letter-spacing: .03em; }
  .credits-metrics strong { font-size: 2.15rem; line-height: 1.2; }
  .credits-metrics small { font-size: .8rem; color: #d2e2f1; }
  .credits-summary-message { padding: 17px 28px; font-size: .95rem; line-height: 1.6; }
  .credits-section-head { align-items: center; gap: 16px; margin-bottom: 18px; }
  .credits-section-head span { font-size: .75rem; }
  .credits-section-head h2 { font-size: 1.5rem; }
  .credits-section-head p { font-size: .9rem; }
  .credits-subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
  .credits-subject { border-radius: 16px; box-shadow: none; }
  .credits-subject summary { padding: 19px 18px; gap: 10px; min-height: 94px; }
  .credits-subject-id { gap: 12px; }
  .credits-subject-id strong { font-size: 1rem; line-height: 1.4; }
  .credits-subject-id > div > span { font-size: .8rem; color: var(--muted); }
  .credits-subject-numbers { font-size: .85rem; color: var(--muted); }
  .credits-subject-numbers b { font-size: 1.12rem; }
  .credits-subject-details { padding: 4px 18px 18px; }
  .credits-req-head { gap: 12px; flex-wrap: wrap; }
  .credits-req-head strong { font-size: .9rem; }
  .credits-course-row { font-size: .85rem; }
  .credits-source-note { font-size: .9rem; line-height: 1.7; }
  .credits-source-note p, .credits-source-note span { font-size: .85rem; }
}
@media screen and (max-width: 760px) {
  .schedule-hero { padding: 20px 0 24px; }
  .credits-page-hero-content { padding-block: 20px 24px; }
  .schedule-hero h1, .credits-hero-row h1 { font-size: 2rem; }
  .credits-hero-row { align-items: stretch; flex-direction: column; }
  .credits-page-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .credits-page-actions .button { padding-inline: 10px; white-space: normal; }
  .credits-content-shell, .schedule-content { padding-block: 20px 100px; }
  .schedule-toolbar { padding: 18px; gap: 16px; }
  .schedule-date-control { grid-template-columns: minmax(0, 1fr); }
  .schedule-date-control input { width: 100%; min-width: 0; }
  .schedule-metrics { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .schedule-metrics > div { display: flex; flex-direction: row-reverse; justify-content: space-between; gap: 16px; padding: 13px 16px; }
  .schedule-metrics strong { margin: 0; font-size: 1.6rem; }
  .schedule-metrics span { font-size: .9rem; }
  .schedule-card { grid-template-columns: minmax(0, 1fr); }
  .schedule-card header { padding: 20px 18px 0; }
  .schedule-card h3 { font-size: 1.2rem; }
  .schedule-details { padding: 20px 18px; gap: 18px 16px; }
  .schedule-meetings, html[dir="rtl"] .schedule-meetings {
    grid-column: 1;
    grid-row: auto;
    margin: 0 18px 18px;
  }
  .schedule-meetings li { padding: 16px; }
  .schedule-meetings strong { margin-top: 10px; }
  .schedule-card footer { padding: 14px 18px; }
  .credits-summary-top { padding: 22px 20px; gap: 14px; }
  .credits-summary h2 { font-size: 1.35rem; }
  .credits-kicker { font-size: .72rem; }
  .credits-ring { width: 94px; height: 94px; flex: 0 0 94px; }
  .credits-ring::before { width: 72px; height: 72px; }
  .credits-ring strong { font-size: 1.15rem; }
  .credits-metrics { grid-template-columns: minmax(0, 1fr); }
  .credits-metrics > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 16px;
    padding: 14px 20px;
    border-right: 0;
    border-bottom: 1px solid rgb(255 255 255 / 10%);
  }
  .credits-metrics > div:last-child { border-bottom: 0; }
  .credits-metrics strong { grid-column: 2; grid-row: 1 / 3; font-size: 1.85rem; }
  .credits-metrics span { grid-column: 1; text-transform: none; font-size: .95rem; }
  .credits-metrics small { grid-column: 1; font-size: .78rem; }
  .credits-summary-message { padding: 16px 20px; font-size: .9rem; }
  .credits-section-head { display: block; }
  .credits-section-head p { margin-top: 8px; }
  .credits-subjects { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .credits-subject summary { padding: 17px 14px; min-height: 88px; }
  .credits-subject-id { gap: 9px; }
  .credits-subject-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .credits-subject-id strong { font-size: .95rem; }
  .credits-subject-numbers b { font-size: 1rem; }
}
@media screen and (max-width: 380px) {
  .credits-summary-top { align-items: flex-start; }
  .credits-subject summary { grid-template-columns: minmax(0, 1fr) auto; }
  .credits-subject-id { grid-column: 1; }
  .credits-subject-numbers { grid-column: 1; padding-inline-start: 43px; }
  .credits-chev { grid-column: 2; grid-row: 1 / 3; }
}
@media screen {
  .credits-course-chip { width: 100%; min-width: 0; padding: 11px 12px; }
  .credits-course-chip strong { font-size: .82rem; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
  .credits-course-chip small { font-size: .75rem; color: var(--muted); }
  .credits-course-chip b { flex-shrink: 0; font-size: .85rem; }
  .credits-course-group h4 { font-size: .75rem; color: var(--muted); }
  body.dark .schedule-eyebrow,
  body.dark .schedule-hero .back-link { color: #91d3ff; }
  body.dark .schedule-status:not(.is-scheduled) { color: var(--ink); }
  body.dark .credits-page-actions .button-secondary {
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
  }
}

/* Account details stay in the page; Help floats above the device safe area. */
@media screen {
  .account-tools { background: var(--surface); border-bottom: 1px solid var(--line); }
  .account-tools:not(:has(#authAccountPill:not([hidden]))) { display: none; }
  .account-tools-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 8px; min-width: 0; }
  .account-tools #authAccountPill {
    position: static;
    inset: auto;
    z-index: auto;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    gap: 9px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    color: var(--ink);
  }
  .account-tools .auth-account-copy { flex: 1; text-align: start; }
  .account-tools .auth-account-copy strong {
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
    font-size: .8rem;
  }
  .account-tools .auth-account-copy small { color: var(--muted); }
  .account-tools .auth-signout { min-height: 44px; flex-shrink: 0; color: var(--ink); border-color: var(--line); }
  body #helpFab {
    position: fixed;
    top: auto;
    left: auto;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    min-width: 48px;
    min-height: 48px;
  }
  body #helpPanel {
    top: auto;
    left: auto;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: min(360px, calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-height: calc(100vh - var(--kyp-header-height, var(--header-h)) - 92px);
    max-height: calc(100dvh - var(--kyp-header-height, var(--header-h)) - 92px - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #helpClose { min-width: 44px; min-height: 44px; flex-shrink: 0; }
  .site-footer { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .schedule-toolbar, .schedule-date-control { min-width: 0; max-width: 100%; }
  .schedule-date-control { grid-template-columns: auto minmax(0, 1fr); }
  .schedule-date-control input {
    display: block;
    box-sizing: border-box;
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
  }
  .schedule-date-control input::-webkit-date-and-time-value { min-width: 0; text-align: start; }
  .schedule-date-control input::-webkit-datetime-edit { min-width: 0; padding: 0; }
  .schedule-actions { min-width: 0; }
}
@media screen and (max-width: 760px) {
  .account-tools-inner { gap: 8px; }
  .account-tools #authAccountPill { flex: 1; gap: 7px; }
  .account-tools .auth-account-avatar { flex: 0 0 30px; width: 30px; height: 30px; }
  .account-tools .auth-account-copy strong { font-size: .75rem; }
  .account-tools .auth-signout { padding-inline: 8px; font-size: .7rem; }
  .schedule-date-control { grid-template-columns: minmax(0, 1fr); }
  .schedule-date-control input { font-size: 16px; }
  .schedule-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-actions .button { min-width: 0; padding-inline: 8px; white-space: normal; }
  .credits-content-shell, .schedule-content { padding-bottom: 40px; }
}
@media print {
  .account-tools { display: none !important; }
}

/* The assigned site comes only from the student-scoped school-record response. */
.student-site[hidden] { display: none !important; }
@media screen {
  .student-site {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    overflow: hidden;
    min-width: 0;
  }
  .student-site.has-photo { grid-template-columns: minmax(240px, .85fr) minmax(0, 1fr); align-items: center; }
  .student-site-photo { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--surface-soft); }
  .student-site-copy { min-width: 0; padding: 24px 28px; }
  .student-site-eyebrow { margin: 0 0 8px; font-size: .85rem; line-height: 1.5; color: var(--muted); font-weight: 800; }
  .student-site-name { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.8rem); color: var(--ink); line-height: 1.35; font-weight: 850; overflow-wrap: anywhere; }
  .student-site-message { margin: 4px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
  .student-site-retry { min-height: 44px; margin-top: 12px; background: var(--surface-soft); color: var(--ink); border: 1px solid var(--line); }
}
@media screen and (max-width: 760px) {
  .student-site.has-photo { grid-template-columns: minmax(0, 1fr); }
  .student-site-copy { padding: 18px 20px; }
}
@media print {
  .student-site { display: none !important; }
}
