/* Assignment composition keeps optional settings together at every screen size. */
.assignment-fields { display:grid;gap:16px;min-width:0; }
.assignment-section { border:1px solid var(--line);border-radius:10px;min-width:0; }
.assignment-section summary { display:flex;align-items:center;justify-content:space-between;gap:10px;list-style:none;cursor:pointer;padding:14px 15px;font-size:12px;font-weight:650;color:#515f7b; }
.assignment-section summary::-webkit-details-marker { display:none; }
.assignment-section summary small { display:block;font-size:11px;font-weight:400;color:#748198;margin-top:4px;line-height:1.5; }
.assignment-section summary svg { width:16px;height:16px;transition:transform .15s; }
.assignment-section[open] summary svg { transform:rotate(45deg); }
.assignment-section-body { display:grid;gap:15px;padding:0 15px 15px;min-width:0; }
.assignment-section .example-editor { margin:0;padding:0;border:0; }
.assignment-section .example-editor > p { font-size:11px;margin-bottom:12px;color:#748198; }
.assignment-section .example-picker { min-width:0; }
.assignment-fields .error:empty { display:none; }
.assignment-dialog .form { gap:0; }
.assignment-dialog .form > .actions { margin-top:20px; }
.assignment-dialog { scroll-padding-block:18px; }
@media(max-width:720px) {
  /* A comfortable reading size, with finger-sized controls. */
  :root { --muted:#66738b; }
  .wrap { padding:22px 16px calc(100px + env(safe-area-inset-bottom)); }
  .heading { margin-bottom:20px;gap:14px; }
  .heading h1 { font-size:25px;letter-spacing:-.7px; }
  .heading p { font-size:13px;line-height:1.55;color:#68758e; }
  .heading .eyebrow { font-size:10px;letter-spacing:.08em; }
  .heading-actions { gap:8px; }
  .btn,.btn.primary,.heading-actions .btn.primary,.heading-actions .btn.quiet,.request-heading-actions .btn.primary { min-height:44px;font-size:13px; }
  .btn { padding:10px 13px; }
  .btn.icon-only,.icon-button,.icon-button.mobile-menu { min-width:44px;width:44px;min-height:44px;height:44px;flex:none; }
  .btn.icon-only svg,.icon-button svg { width:19px;height:19px; }
  .top { height:64px;min-height:64px;gap:10px;padding-inline:10px; }
  .top > .row-flex { gap:2px;min-width:0;flex:1 1 auto; }
  .top strong { font-size:13px; }
  .top-search { flex:0 1 170px;max-width:170px;min-width:100px;padding-inline:9px; }
  .top-search input[type=search] { min-height:44px;font-size:16px; }
  .top-search input::placeholder { font-size:12px; }
  .top-search > svg { width:16px;height:16px; }
  .mobile-tabs { padding:6px 4px max(7px,env(safe-area-inset-bottom)); }
  .mobile-tabs button { min-height:52px;gap:4px; }
  .mobile-tabs button span { font-size:11px;font-weight:550; }
  .mobile-tabs svg { width:22px;height:22px; }
  .tabs { gap:14px; }
  .tabs button { min-height:44px;font-size:12px;padding-inline:2px; }
  .panel-head { padding:16px; }
  .panel-head h2 { font-size:16px; }
  .panel-head p { font-size:12px;color:#6e7b92; }
  .panel-head .btn { min-height:44px;font-size:12px; }
  .panel-head .icon-only { min-width:44px;width:44px;height:44px; }
  .calendar-toolbar .btn { font-size:12px; }
  .calendar-toolbar > strong { font-size:14px; }
  .calendar-toolbar { padding:8px 12px;gap:4px; }
  .calendar-toolbar .actions { gap:2px; }
  .calendar .day { padding:0; }
  .calendar .mobile-day { min-height:48px;height:48px;font-size:13px; }
  .calendar .week div { font-size:11px;padding:10px 0; }
  .calendar .mobile-day.today { border-radius:9px; }
  .calendar .day-marker { width:5px;height:5px;margin-top:3px; }
  .calendar-panel > .panel-head:first-child { gap:0; }
  .calendar-panel > .panel-head:first-child > .btn { padding-inline:0; }

  /* Four totals fit in one compact panel, so work appears earlier. */
  .wrap[data-page=overview] .heading p:not(.eyebrow) { display:none; }
  .wrap[data-page=overview] .heading h1 { font-size:24px; }
  .wrap[data-page=overview] .stats { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;border:1px solid var(--line);border-radius:13px;background:white;overflow:hidden;margin-bottom:18px; }
  .wrap[data-page=overview] .stat { border:0;border-radius:0;box-shadow:none;padding:12px 16px; }
  .wrap[data-page=overview] .stat:nth-child(odd) { border-right:1px solid var(--line); }
  .wrap[data-page=overview] .stat:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .wrap[data-page=overview] .stat .row-flex > span:first-child { font-size:12px;color:#69758b; }
  .wrap[data-page=overview] .stat .stat-icon,.wrap[data-page=overview] .stat > small { display:none; }
  .wrap[data-page=overview] .stat b { font-size:25px;margin:3px 0 0;line-height:1.15; }
  .dashboard-grid { display:flex;flex-direction:column;gap:18px; }
  .dashboard-rail { display:contents; }
  .dashboard-grid > *, .dashboard-rail > * { width:100%;min-width:0; }
  .up-next-panel { order:0; }.dashboard-main { order:1; }.daily-panel { order:2; }.progress-panel { order:3; }.dashboard-rail .content-folder-panel { order:4; }
  .up-next-panel .panel-head { padding:12px 16px 4px; }
  .compact-empty { display:grid;grid-template-columns:38px 1fr;column-gap:12px;text-align:left;padding:10px 16px 18px; }
  .compact-empty > span { grid-row:1/span 2;margin:0; }
  .compact-empty h3 { align-self:end;font-size:14px; }
  .compact-empty p { margin-top:3px;font-size:12px;color:#6e7b92; }
  .upcoming-list { padding-inline:16px; }
  .upcoming-list > button { min-height:64px;gap:12px; }
  .upcoming-list strong { font-size:14px; }
  .upcoming-list small { font-size:12px;color:#6e7b92; }
  .upcoming-icon { width:36px;height:36px; }
  .progress-content > strong { font-size:14px; }.progress-content > p { font-size:12px; }
  .daily-empty { padding:0 16px 16px; }.daily-empty p { font-size:13px;line-height:1.5; }
  .daily-empty .btn { min-height:44px;font-size:13px; }
  .today-checks .check { min-height:44px;font-size:14px; }
  .content-folder-panel h2 { font-size:15px; }.content-folder-panel .btn { min-height:44px;font-size:13px; }

  /* Categories read like a list of destinations, with clear primary actions. */
  .homework-summary { align-items:flex-start;font-size:12px;line-height:1.6;gap:8px; }
  .homework-summary a { display:inline-flex;align-items:center;min-height:44px;font-size:13px; }
  .category-grid { grid-template-columns:1fr;gap:14px; }
  .category-card { display:grid;grid-template-columns:42px minmax(0,1fr);gap:0 12px;padding:17px 17px 0; }
  .category-card-top { display:contents; }
  .category-icon { grid-column:1;grid-row:1/span 2;width:42px;height:42px;border-radius:12px; }
  .category-icon svg { width:21px;height:21px; }
  .category-card h3 { grid-column:2;grid-row:1;font-size:16px;line-height:1.4;min-height:0;align-self:end; }
  .folder-status { grid-column:2;grid-row:2;font-size:12px;gap:5px;margin-top:3px; }
  .folder-status svg { width:13px;height:13px; }
  .category-count { grid-column:1/-1;margin:16px 0;gap:6px;flex-wrap:wrap; }
  .category-count > strong { font-size:25px; }
  .category-count > span { font-size:13px;color:#66738b; }
  .category-count > small { font-size:12px;color:#758198;margin-left:auto;flex-basis:auto; }
  .category-card-actions { grid-column:1/-1;gap:10px; }
  .category-card-actions .category-view { justify-content:space-between;flex-direction:row;min-height:46px;padding:11px 13px;font-size:13px; }
  .category-view svg { display:block;width:16px;height:16px;order:2; }
  .category-card-actions .icon-only { width:46px;min-width:46px;height:46px;min-height:46px; }
  .category-folder-actions { grid-column:1/-1;flex-wrap:nowrap;justify-content:space-between;margin-top:14px;gap:8px;padding-block:4px;min-height:53px; }
  .category-folder-actions > a,.category-folder-actions > span { font-size:12px;flex-basis:auto;color:#69768f; }
  .category-folder-actions > a { display:inline-flex;align-items:center;min-height:44px; }
  .category-folder-actions .btn { min-height:44px;font-size:12px;padding:9px 7px; }
  .homework-assignments .panel-head { padding:16px; }
  .homework-assignments .panel-head p { font-size:12px; }

  /* Filters remain scrollable, with readable labels and larger hit areas. */
  .request-creator { font-size:12px;min-height:30px; }
  .request-heading-actions { width:100%; }
  .request-heading-actions .primary { flex:1; }
  .request-tabs { overflow-x:auto;gap:0;scrollbar-width:none; }
  .request-tabs button { font-size:12px;min-height:48px;padding-inline:12px;flex:0 0 auto; }
  .request-count { font-size:11px;min-width:18px; }
  .content-department-tabs { gap:2px;overflow-x:auto; }
  .content-department-tabs button { min-height:44px;font-size:12px;flex:0 0 auto;padding-inline:12px; }
  .request-filters select { min-height:44px;font-size:14px; }
  .request-search .btn,.request-selection .btn { font-size:13px;min-height:44px; }
  .responsive-table td::before { font-size:12px; }
  .responsive-table .table td { padding-block:8px;font-size:14px; }
  .table .link-button { font-size:14px;line-height:1.5; }
  .pill { font-size:12px; }.request-department { font-size:12px; }
  .request-empty h2 { font-size:17px; }.request-empty p { font-size:14px; }
  .creator-card .actions .btn { font-size:13px;min-height:44px; }
  .creator-card-caption { font-size:13px; }.creator-card h3 { font-size:17px; }
  .trend-row { font-size:13px; }.chart-caption { font-size:12px; }

  /* Dialog actions no longer float over fields or attached examples. */
  body:has(dialog[open]) { overflow:hidden; }
  dialog { font-size:14px;scroll-padding:20px;overscroll-behavior:contain; }
  dialog .form label { font-size:13px;color:#5f6e87; }
  dialog .form > p { font-size:13px; }
  dialog .form > .actions { position:static;min-height:64px;gap:10px;padding:13px 0 0; }
  dialog .form > .actions .btn { min-height:46px;font-size:14px; }
  dialog .form input:not([type=checkbox]),dialog .form select,dialog .form textarea { font-size:16px;min-height:48px;scroll-margin-block:24px; }
  dialog .panel-head h2 { font-size:18px;line-height:1.4; }
  .assignment-dialog {
    position:fixed;inset:auto 0 var(--keyboard-inset,0px);margin:0;padding:0;
    width:100%;max-width:none;height:auto;max-height:min(94dvh,var(--visible-height,94dvh));
    overflow:hidden;border:0;border-radius:20px 20px 0 0;
  }
  .assignment-dialog #dialog-content { display:flex;flex-direction:column;max-height:min(94dvh,var(--visible-height,94dvh));min-height:0; }
  .assignment-dialog #dialog-content > .panel-head { flex:none;padding:14px 17px!important;margin:0;border-bottom:1px solid var(--line);gap:8px; }
  .assignment-dialog #dialog-content > .panel-head h2 { flex:1;font-size:17px; }
  .assignment-dialog .form { display:flex;flex-direction:column;min-height:0;overflow:hidden;gap:0; }
  .assignment-fields { padding:20px 17px 16px;gap:17px;overflow:auto;min-height:0;overscroll-behavior:contain;scroll-padding-block:20px; }
  .assignment-dialog .form > .actions { flex:none;position:static;margin:0;border-top:1px solid var(--line);padding:12px 17px max(12px,env(safe-area-inset-bottom));background:white;min-height:70px; }
  .assignment-dialog .form > .actions .primary { flex:1; }
  .assignment-dialog .form > .actions .quiet { min-width:75px; }
  .assignment-section summary { min-height:60px;padding:13px;font-size:13px; }
  .assignment-section summary small { font-size:12px;line-height:1.45;color:#6c7a92; }
  .assignment-section-body { padding:0 13px 15px; }
  .assignment-section .example-editor h3 { font-size:14px; }
  .assignment-section .example-editor > p { font-size:12px;line-height:1.55; }
  .assignment-section .example-picker { padding:12px;font-size:13px; }
  .assignment-section input[type=file] { min-height:48px;width:100%;max-width:100%;font-size:12px; }
  .assignment-section input[type=file]::file-selector-button { min-height:44px;font:inherit;border:1px solid var(--line);border-radius:7px;background:#f6f7fc;color:#526594;margin:0 8px 0 0; }
  #toast { font-size:14px;line-height:1.5;bottom:calc(80px + env(safe-area-inset-bottom)); }
}
@media(max-width:360px) {
 .top-search { flex-basis:125px;max-width:125px; }.top strong { font-size:12px; }
 .wrap { padding-inline:12px; }.heading h1 { font-size:24px; }
 .heading-actions .btn.quiet { font-size:12px; }.category-card { padding-inline:15px; }
 .category-count > small { font-size:11px; }.homework-summary { font-size:11px; }
 .calendar-toolbar { padding-inline:8px; }.calendar-toolbar .btn.quiet { padding-inline:8px; }
}
