/* Workspace presentation stays separate from document and PDF typography. */
@media screen {
  :root {
    --ref-dark: #123f50;
    --ref-main: #176c73;
    --ref-accent: #237b79;
    --ref-light: #eaf1f4;
    --ref-border: #d5e1e5;
    --ref-ink: #173847;
  }
  body.home-mode {
    --ui-teal: #176c73;
    --ui-teal-dark: #123f50;
    --ui-teal-soft: #e6f4f2;
    background: var(--ref-light);
  }
  body .top {
    background: #fff;
    color: var(--ref-ink);
    padding: 16px 24px;
    gap: 18px;
    min-height: 92px;
    border-bottom: 1px solid var(--ref-border);
    box-shadow: 0 3px 15px #142c5005;
  }
  .top .top-actions { display: none; }
  .top-school-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
  }
  .top-school-identity > div:last-child { min-width: 0; }
  .top-school-identity h1 {
    margin: 0;
    font-size: clamp(18px, 1.6vw, 24px);
    line-height: 1.6;
    overflow-wrap: anywhere;
  }
  .top-school-identity small { font-size: 13px; color: #62738b; margin: 0; }
  .top .home-school-mark {
    width: 52px;
    height: 52px;
    flex: none;
    color: #176c73;
    background: #e6f4f2;
    border: 1px solid #d5e1e5;
    border-radius: 14px;
    padding: 6px;
  }
  .top .home-school-mark svg { width: 36px; height: 36px; }
  body .top .sidebar-toggle {
    background: #eaf1f4 !important;
    color: #176c73 !important;
    border-color: #d8e2ef !important;
    padding: 10px !important;
  }
  .sidebar-toggle span:last-child { display: none; }
  .dashboard-top-utilities {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 14px;
    margin-inline-start: auto;
    min-width: 0;
  }
  .reference-clock { margin: 2px 0 0; min-width: 0; max-width: none; color: #243d5b; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .reference-clock > span { font-size: 14px; font-weight: 500; }
  .reference-clock time { color: #405467; font-size: 14px; line-height: 1.7; }
  .top #notificationBell {
    margin: 0;
    width: 44px;
    height: 44px;
    border: 1px solid #dce6f3;
    border-radius: 12px;
    background: #f1f7f7;
    color: #176c73;
  }
  .dashboard-top-utilities .account-actions { display: block; padding: 0; margin: 0; }
  .dashboard-top-utilities .reference-account-menu { width: auto; }
  .dashboard-top-utilities .reference-account-menu summary {
    padding: 7px 10px;
    border: 1px solid #dce6f3;
    border-radius: 12px;
    color: #2b405b;
    background: #fff;
    gap: 9px;
    max-width: 235px;
  }
  .reference-account-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
  .reference-account-icon { color: #176c73; background: #e6f4f2; border: 0; }
  .dashboard-top-utilities .reference-account-menu summary > span:last-child {
    max-width: 175px;
    font-size: 13px;
    direction: ltr;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dashboard-top-utilities .reference-account-options {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);
    width: min(260px, calc(100vw - 24px));
    display: grid;
    gap: 6px;
    border: 1px solid #dce6f3;
    border-radius: 12px;
    padding: 8px;
    background: #fff;
    box-shadow: 0 12px 35px #142c5020;
  }
  .dashboard-top-utilities .reference-account-options button {
    min-height: 44px;
    padding: 10px;
    text-align: start;
    white-space: normal;
    font-size: 14px;
  }
  body .site-sidebar { background: linear-gradient(165deg, var(--ref-dark), #14545d 72%, var(--ref-main)); }
  .site-sidebar .sidebar-head { padding: max(22px, env(safe-area-inset-top)) 16px 22px; font-size: 0; min-height: 114px; display: flex; align-items: center; justify-content: center; position: relative; }
  .sidebar-head .home-school-mark { width: 80px; height: 80px; color: #d2ede9; background: transparent; border: 0; padding: 0; }
  .sidebar-head .home-school-mark svg { width: 76px; height: 76px; }
  .sidebar-head .sidebar-close { position: absolute; inset-inline-end: 12px; top: 12px; font-size: 18px; }
  .site-sidebar .sidebar-scroll { padding: 10px 12px 20px; }
  .site-sidebar .dashboard-nav-group { border-bottom: 1px solid #ffffff17; padding-bottom: 12px; margin-bottom: 10px; }
  .site-sidebar .dashboard-nav-group h2 { padding: 7px 12px; margin: 0; color: #aac2e2; font-size: 13px; }
  .site-sidebar .reference-shortcuts { gap: 0; margin: 0; }
  .site-sidebar .reference-shortcuts button { padding: 10px 12px; border-radius: 10px; min-height: 44px; font-size: 14px; }
  .site-sidebar .reference-shortcuts svg { width: 21px; height: 21px; }
  body .site-sidebar .reference-shortcuts button.active {
    color: #fff;
    background: var(--ref-main);
    border-color: #ffffff22;
    box-shadow: 0 4px 10px #0c234722;
  }
  .site-sidebar .sidebar-navigation:has(> .view-tabs:empty) { display: none; }
  .site-sidebar .reference-tools-label { color: #aac2e2; margin: 8px 12px 0; font-size: 13px; }
  .site-sidebar .menu-disclosure summary { font-size: 14px; }
  .home-view { padding: 22px 26px 40px; max-width: 1600px; margin: auto; }
  .home-view .school-dashboard-header {
    background: transparent;
    border: 0;
    min-height: 64px;
    padding: 0;
    margin-bottom: 18px;
    box-shadow: none;
  }
  .school-dashboard-header .home-hero-content h2 { font-size: 24px; line-height: 1.5; margin: 0 0 4px; color: #173847; }
  .home-view .school-dashboard-header p { font-size: 14px; color: #60738c; }
  .home-view .reference-welcome { display: none; }
  .home-view #resumeDraft { border-radius: 10px; min-height: 46px; padding: 11px 18px; max-width: 340px; font-size: 14px; }
  #homeOverviewStats { margin: 0 0 22px; }
  #homeOverviewStats::before { display: none; }
  #homeOverviewStats .today-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0; }
  #homeOverviewStats .today-stat {
    --stat-color: #b77d42; --stat-soft: #fff0de;
    display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 14px 10px;
    align-items: center; text-align: start; background: #fff; min-height: 154px;
    padding: 18px; border: 1px solid #e0e3e5; border-radius: 16px;
    box-shadow: 0 7px 14px #24394c12, 0 2px 3px #24394c08;
  }
  #homeOverviewStats [data-stat="todayStudents"] { --stat-color: #9a70b5; --stat-soft: #f0e6f7; }
  #homeOverviewStats [data-stat="todayEvents"] { --stat-color: #4c9fc2; --stat-soft: #e3f3fb; }
  #homeOverviewStats [data-stat="todayPending"] { --stat-color: #5da68d; --stat-soft: #e0f3e9; }
  #homeOverviewStats .today-stat strong {
    grid-column: 1 / -1; justify-self: end; display: grid; place-items: center;
    width: 66px; height: 66px; border: 6px solid var(--stat-soft);
    border-inline-start-color: var(--stat-color); border-bottom-color: var(--stat-color);
    border-radius: 50%; font-size: 28px; margin: 0; color: var(--stat-color); line-height: 1;
  }
  #homeOverviewStats .today-stat > span:not(.dashboard-stat-icon) { grid-column: 2; grid-row: 1; font-size: 15px; font-weight: 700; color: #213344; margin: 0; }
  #homeOverviewStats .dashboard-stat-icon { grid-row: 1; width: 42px; height: 42px; background: var(--stat-soft); color: var(--stat-color); border-radius: 12px; display: grid; place-items: center; }
  #homeOverviewStats .today-stat strong[data-digits="4"] { font-size: 19px; }
  #homeOverviewStats .today-stat strong:is([data-digits="5"], [data-digits="6"]) { font-size: 14px; }
  #homeOverviewStats .dashboard-stat-icon svg { width: 26px; height: 26px; }
  #homeActivitySlot .today-work { margin: 0; }
  #homeActivitySlot .today-heading { display: none; }
  #homeActivitySlot .today-heading h2 { font-size: 18px; margin: 0; color: #173847; }
  #homeActivitySlot .today-heading p { display: none; }
  #homeActivitySlot .today-columns { gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #homeActivitySlot .today-list-section {
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #d5e1e5;
    box-shadow: 0 7px 16px #24394c12, 0 2px 3px #24394c08;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  #homeActivitySlot .today-list-section h3 { font-size: 17px; padding-bottom: 16px; min-height: 44px; line-height: 1.6; flex-wrap: wrap; }
  #homeActivitySlot .today-list-section h3 button { min-height: 40px; background: #e6f4f2; color: #176c73; padding: 8px 12px; border-radius: 8px; font-size: 14px; }
  #homeActivitySlot .today-empty { font-size: 15px; line-height: 1.9; min-height: 120px; padding: 20px 0; margin: 0; }
  #homeActivitySlot .today-row { gap: 12px; padding: 14px 0; }
  #homeActivitySlot .today-row > div { min-width: 0; }
  #homeActivitySlot .today-row strong { font-size: 15px; }
  #homeActivitySlot .today-row small { font-size: 14px; color: #63738a; }
  #homeActivitySlot .today-row button { min-height: 44px; border-radius: 8px; }
  .dashboard-help { margin-top: auto; padding-top: 16px; border-top: 1px solid #e4ebf5; }
  .dashboard-help label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
  .dashboard-help > div { display: flex; gap: 8px; }
  .dashboard-help textarea { min-width: 0; flex: 1; width: 100%; min-height: 66px; resize: vertical; padding: 10px 12px; border: 1px solid #d4dfed; border-radius: 9px; background: #f5f9f9; font-size: 14px; }
  .dashboard-help button { min-height: 44px; white-space: normal; flex: none; }
  .home-view .daily-tools-heading { margin: 22px 0 12px; }
  .daily-tools-heading h2 { font-size: 18px; }
  .home-tools-section > .home-launch-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .home-launch-grid .home-card { flex-direction: column; justify-content: center; gap: 8px; text-align: center; min-height: 126px; padding: 17px; border-radius: 14px; border-color: #d5e1e5; box-shadow: 0 7px 16px #24394c12, 0 2px 3px #24394c08; }
  .home-launch-grid .home-card strong { font-size: 15px; margin: 0; }
  .home-launch-grid .home-card small { display: block; font-size: 12px; line-height: 1.6; color: #647584; }
  .home-launch-grid .home-card-icon { width: 42px; height: 42px; margin: 0; flex: none; background: transparent !important; color: #123f50; border-radius: 12px; }
  .home-launch-grid .home-card-icon svg { width: 27px; height: 27px; }
  .home-all-tools { border-radius: 14px; border-color: #d5e1e5; margin-top: 14px; }
  .home-all-tools > summary { font-size: 15px; padding: 14px 18px; }
  .home-all-tools .home-quick-tools { padding: 14px; gap: 10px; }
  .home-all-tools .home-card { border-radius: 10px; min-height: 56px; }
  .home-view .home-projects { border-radius: 16px; padding: 20px; border-color: #d5e1e5; box-shadow: 0 7px 16px #24394c12, 0 2px 3px #24394c08; }
  body .top { background: linear-gradient(155deg, var(--ref-dark), var(--ref-main) 77%, var(--ref-accent)); border-bottom: 0; box-shadow: none; }
  .top-school-identity h1 { color: #fff; }
  .top .reference-clock, .top .reference-clock time { color: #d7ebec; }
  .dashboard-week { margin-bottom: 12px; min-width: 0; }
  .dashboard-week table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; border: 1px solid #dce4e8; border-radius: 10px; overflow: hidden; text-align: center; }
  .dashboard-week caption { text-align: start; padding: 0 0 8px; font-size: 13px; color: #657788; }
  .dashboard-week th { background: #f3f6f7; font-size: 12px; font-weight: 600; padding: 8px 2px; }
  .dashboard-week td { padding: 8px 2px; border-top: 1px solid #dce4e8; }
  .dashboard-week td + td, .dashboard-week th + th { border-inline-start: 1px solid #e2e8eb; }
  .dashboard-week td strong, .dashboard-week td small { display: block; }
  .dashboard-week td strong { font-size: 17px; color: #243d50; }
  .dashboard-week td small { font-size: 11px; margin-top: 4px; color: #6b7e8c; }
  .dashboard-week .is-today { background: #e6f4f2; }
  #homeActivitySlot .dashboard-schedule-button { width: 100%; margin-top: auto; background: #123f50; border-color: #123f50; min-height: 44px; }
  #homeActivitySlot .dashboard-schedule-button:hover { background: #176c73; }
  #todayPendingList .today-row > div::before { content: ''; float: right; width: 14px; height: 14px; border: 1px solid #aebfc8; border-radius: 4px; margin: 5px 0 0 8px; }
  .home-card:hover { transform: translateY(-2px); }
  .dashboard-help textarea:focus { outline: 2px solid #237b79; outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) { .home-card:hover { transform: none; } }
  .site-footer { color: #718099; font-size: 12px; padding-block: 20px; }
}
@media screen and (min-width: 1101px) {
  .sidebar-head .sidebar-close { display: none; }
  body { padding-inline-start: 248px; }
  .site-sidebar { width: 248px; }
  body.sidebar-collapsed { padding-inline-start: 0; }
}
@media screen and (max-width: 1250px) {
  body .top { flex-wrap: wrap; }
  .dashboard-top-utilities { flex-wrap: wrap; }
  .dashboard-top-utilities .reference-clock { min-width: 110px; max-width: 150px; }
  #homeOverviewStats .today-stat { padding: 16px 12px; column-gap: 10px; }
}
@media screen and (max-width: 900px) {
  #homeOverviewStats .today-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-tools-section > .home-launch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-view { padding: 18px; }
  body .top { padding: 12px 18px; gap: 12px; }
}
@media screen and (max-width: 650px) {
  body .top { gap: 10px; min-height: 76px; padding: 10px 12px; }
  .top-school-identity { gap: 8px; }
  .top-school-identity h1 { font-size: 16px; }
  .dashboard-top-utilities { width: 100%; border-top: 1px solid #e5ecf5; padding-top: 9px; justify-content: space-between; gap: 8px; }
  .reference-clock > span { font-size: 14px; }
  .reference-clock time { font-size: 12px; }
  .dashboard-top-utilities .account-actions { margin-inline-start: auto; }
  .dashboard-top-utilities .reference-account-menu summary { padding: 5px; max-width: 155px; min-height: 44px; }
  .dashboard-top-utilities .reference-account-menu summary > span:last-child { max-width: 112px; font-size: 12px; }
  .reference-account-icon { width: 26px; height: 26px; }
  body .top { padding-top: max(10px, env(safe-area-inset-top)); }
  .home-view { padding: 16px max(12px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .home-view .school-dashboard-header { gap: 12px; align-items: flex-start; }
  .school-dashboard-header .home-hero-content h2 { font-size: 22px; }
  .home-view #resumeDraft { width: 100%; max-width: none; }
  #homeOverviewStats .today-stats { gap: 10px; }
  #homeOverviewStats .today-stat { padding: 14px 10px; grid-template-columns: 36px minmax(0, 1fr); column-gap: 8px; min-height: 140px; }
  #homeOverviewStats .dashboard-stat-icon { width: 36px; height: 36px; border-radius: 10px; }
  #homeOverviewStats .dashboard-stat-icon svg { width: 22px; height: 22px; }
  #homeOverviewStats .today-stat strong { font-size: 24px; width: 56px; height: 56px; border-width: 5px; }
  #homeOverviewStats .today-stat > span:not(.dashboard-stat-icon) { font-size: 14px; }
  #homeActivitySlot .today-columns { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  #homeActivitySlot .today-list-section { padding: 16px; }
  .home-launch-grid .home-card { padding: 12px; gap: 9px; min-height: 122px; }
  .home-launch-grid .home-card strong { font-size: 14px; }
  .home-launch-grid .home-card-icon { width: 34px; height: 34px; }
  .dashboard-help > div { flex-wrap: wrap; }
  .dashboard-help textarea { flex-basis: 100%; font-size: 16px; }
  .dashboard-help button { width: 100%; }
}
@media screen and (max-width: 380px) {
  .dashboard-top-utilities .reference-account-menu summary > span:last-child { display: none; }
  .dashboard-top-utilities .reference-account-menu summary { width: 44px; justify-content: center; }
  #homeOverviewStats .today-stat { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  #homeOverviewStats .dashboard-stat-icon { grid-row: 1; }
  #homeOverviewStats .today-stat > span:not(.dashboard-stat-icon) { grid-column: 1; grid-row: 2; }
  #homeOverviewStats .today-stat strong { grid-row: 3; }
  .home-tools-section > .home-launch-grid { grid-template-columns: minmax(0, 1fr); }
}

@media screen and (max-height: 500px) {
  .site-sidebar .sidebar-head { min-height: 68px; padding-block: max(8px, env(safe-area-inset-top)) 8px; }
  .sidebar-head .home-school-mark { width: 48px; height: 48px; }
  .sidebar-head .home-school-mark svg { width: 46px; height: 46px; }
}
