/* Screen-only components shared by the Hub and LMS. Content and print templates retain their own semantics. */
@media screen {
  :root {
    --hub-blue: #007ec3;
    --hub-red: #d43839;
    --hub-rail: #00669c;
    --hub-rail-deep: #005581;
    --hub-link: #075c8a;
    --hub-ink: #183548;
    --hub-muted: #4c6270;
    --hub-surface: #fff;
    --hub-canvas: #f6f8fa;
    --hub-line: #d9e2e7;
    --hub-tint: #e8f4fb;
    --hub-radius: .875rem;
    --hub-gap: clamp(.75rem, 1.6vw, 1.5rem);
    --hub-sidebar-width: 224px;
    --hub-sidebar-compact-width: 68px;
    --hub-nav-row: 40px;
    --hub-nav-gap: 3px;
    --hub-control-radius: 6px;
    --hub-rail-line: #ffffff52;
    --hub-focus-on-blue: #ffda73;
    --hub-nav-section-weight: 700;
    --hub-nav-section-size: 14px;
    --hub-nav-subsection-weight: 650;
    --hub-nav-subsection-size: 14px;
    --hub-nav-link-weight: 400;
    --hub-nav-link-size: 14px;
    --hub-nav-active-weight: 600;
    --hub-nav-meta-size: 12px;
    --hub-font: Inter, "Segoe UI", system-ui, sans-serif;
  }
  .hub-page { background: var(--hub-canvas); color: var(--hub-ink); font-family: var(--hub-font); }
  .hub-page :where(h1,h2,h3) { color: var(--hub-ink); text-wrap: pretty; }
  .hub-page :where(h1) { font-size: clamp(1.65rem, 3.2vw, 2.8rem); line-height: 1.13; letter-spacing: -.035em; }
  .hub-panel { background: var(--hub-surface); border: 1px solid var(--hub-line); border-radius: var(--hub-radius); padding: var(--hub-gap); min-width: 0; }
  .hub-toolbar { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; }
  .hub-toolbar > * { max-width: 100%; }
  .hub-grid { display: grid; gap: var(--hub-gap); grid-template-columns: repeat(auto-fit,minmax(min(100%,17rem),1fr)); }
  .hub-status { color: var(--hub-muted); overflow-wrap: anywhere; }
  .hub-document-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.65; }
  .hub-status[role=alert]:not(:empty) { border-inline-start: 3px solid var(--hub-red); padding-inline-start: .75rem; }
  /* Draw quiet placeholders in the space already reserved for the loading surface. */
  .hub-page :is(.hub-panel,.hub-grid,section)[aria-busy=true],
  .hub-page[data-assessment-state=loading] #assessmentLoading {
    background-image: linear-gradient(var(--hub-line),var(--hub-line)), linear-gradient(var(--hub-tint),var(--hub-tint));
    background-position: right 1rem bottom .5rem, right 1rem bottom .9rem;
    background-size: min(18%,5rem) 3px, min(24%,7rem) 3px;
    background-repeat: no-repeat;
  }
  .hub-page :where(a,button,input,select,textarea,summary):focus-visible { outline: 3px solid #7f3000; outline-offset: 2px; }
  .classroom-recognition:not([hidden]) { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; padding:8px 14px; border-radius:9px; background:var(--hub-tint); }
  .classroom-recognition a { color:var(--hub-link); font-weight:600; padding:6px 0; }
}

@media screen {
 body[data-family-communications] { background:var(--hub-canvas); color:var(--hub-ink); }
 body[data-family-communications] > main {
   box-sizing:border-box; width:100%; max-width:1440px; margin:0 auto; padding:24px clamp(16px,2vw,28px) 64px;
 }
 body[data-family-communications] :is(.email-tabs,.source-tabs,.family-feedback-choices,.connection-tabs) button[aria-pressed=true],
 body[data-family-communications] :is(.trip-actions,.connection-actions,.addon-dialog,.addon-queue-card,.connection-dialog) .primary,
 body[data-family-communications] .trip-button.primary {
   background:var(--hub-rail); color:white; border-color:var(--hub-rail);
 }
 body[data-family-communications] :is(.email-tabs,.source-tabs,.family-feedback-choices,.connection-tabs) button[aria-pressed=false] {
   background:var(--hub-surface); color:var(--hub-link); border-color:var(--hub-line);
 }
 body[data-family-communications] .connections-hero {background:var(--hub-tint);border-color:var(--hub-line);}
}

/* A verified account and the loading state occupy the same header tracks. */
@media screen and (max-width:840px) {
 body.hub-page:not([data-hub-surface="index"],[data-director-header-only],[data-teacher-header-only]) > header:is([data-portal-account=pending],[data-mounting-workspace-rail]),
 body.hub-page.director-shell > header[data-portal-account=ready] {
   display:grid;grid-template-columns:44px minmax(0,1fr) clamp(80px,26vw,180px);
   grid-template-rows:minmax(58px,auto);gap:0 6px;align-items:center;
   height:auto;min-height:75px;padding:8px;box-sizing:border-box;
 }
 body.hub-page > header:is([data-portal-account=pending],[data-mounting-workspace-rail],[data-portal-account=ready]) > .jla-brand {
   grid-area:1/2;min-width:0;max-width:100%;gap:6px;
 }
 body.hub-page > header:is([data-portal-account=pending],[data-mounting-workspace-rail],[data-portal-account=ready]) > .jla-brand :is(span,small) {
   display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
 }
 body.hub-page > header:is([data-portal-account=pending],[data-mounting-workspace-rail],[data-portal-account=ready]) > .portal-account {
   grid-area:1/3;display:flex;align-items:center;justify-content:flex-end;min-width:0;
   min-height:44px;width:100%;margin:0;
 }
 body.hub-page > header[data-mounting-workspace-rail] :is(.portal-shortcuts,.portal-pages){display:none}
 body.hub-page.director-shell .portal-account-menu{max-width:100%;min-width:0;}
 body.hub-page.director-shell .portal-account-menu > summary {min-width:0;white-space:normal;overflow-wrap:anywhere;}
}

@media screen {
 body[data-family-communications] > main > h1.communications-title { margin:0 0 12px; font-size:clamp(1.65rem,2.3vw,2.15rem); line-height:1.15; }
 body[data-family-communications] :is(.page-heading,.email-heading,.trip-heading) {margin:0 0 1rem;}
}

@media screen {
 body[data-family-communications] main :is(#refreshFamilyFeedback,#refreshEmails,#refreshScheduled,#refreshSource) {
   appearance:none;min-height:44px;padding:9px 16px;border:1px solid var(--hub-line);border-radius:999px;
   background:var(--hub-surface);color:var(--hub-link);font:600 .875rem/1.4 var(--hub-font);cursor:pointer;
 }
 body[data-family-communications] main :is(#refreshFamilyFeedback,#refreshEmails,#refreshScheduled,#refreshSource):disabled {opacity:.55;cursor:default;}
}

/* Hide redundant Home launchers only once the canonical family shell has mounted. */
body.director-shell:has(#familyQuestionHome:not(:empty)) #homeView :is(.quick-actions,#progressReportsCard,#smartworkPromotion),
body.director-shell:has(#familyQuestionHome:not(:empty)) #hub > .hub-install {display:none}
#hub #childCard {align-items:center; margin-block:0 1rem; padding:.65rem 1rem;}
#hub #childCard .child-switch-hint {margin:0}
#formsView .child-card-details {margin:1rem 0}
#formsView .child-card-details:empty {display:none}
@media(min-width:840px){#hub #childCard {max-width:36rem}}

/* Family contact works with the standard rail, the standalone task list or the sign-in dialog. */
#familyContact{width:min(100%,46rem);margin:clamp(2rem,8vh,6rem) auto}
#familyContactForm label{font-weight:650;color:var(--hub-ink);font-size:.95rem}
#familyContactForm textarea{line-height:1.5}
.family-contact-note,.family-contact-address,#familyContactStatus,.family-contact-methods{text-align:center}
.family-contact-note{margin:1rem 0 .25rem;color:var(--hub-muted)}
.family-contact-address{margin:.2rem 0}
.family-contact-address button{min-height:44px;padding:.35rem .7rem;border:0;background:transparent;color:var(--hub-link);font:inherit;text-decoration:underline;cursor:pointer}
.family-contact-methods{display:flex;justify-content:center;flex-wrap:wrap;gap:.25rem 1.5rem;margin-top:.5rem}
.family-contact-methods a,#publicFamilyTasks a{display:inline-flex;align-items:center;min-height:44px}
#familyContactStatus:empty{display:none}
#familyContactStatus{color:var(--hub-ink)}
#publicFamilyTasks{max-width:44rem;margin:2rem auto}
#publicFamilyTasks nav{display:grid}
body.director-shell:has(#workspace-navigation a[data-view-id="family-task-home"]) :is(#publicFamilyTasks,#hub .back-home[data-view=home]){display:none}
#familySignInHelp #familyContact{margin:.75rem auto;padding:0}
#familySignInHelp #familyContactTitle,#familySignInHelp .sara-subtitle{display:none}
#familySignInHelp>header{position:sticky;top:0;padding:.45rem 0;background:var(--hub-surface,#fff);z-index:1}
#familySignInHelp :focus-visible,#familyContact :focus-visible{outline:2px solid var(--hub-link);outline-offset:3px}
body:has(#homeView:not([hidden])) #childCard{max-width:44rem;margin:0 auto}
@media(max-width:480px){#familyContact{margin-block:1.5rem}.family-contact-methods{gap:0 1rem}}
