/* S1 shell frame. The page is the surface (the approved redesign, sections 1 and 2): white edge to edge under the top bar; the grey tint (--s1-panel-head) only for full-width insets;
 * hairlines divide; nothing floats on a grey floor. The sidebar, top bar, menus and dock are redesign-v3.css (the mockup, verbatim) and s1-nav.css (glue). Tokens: s1-tokens.css. */
body.s1-shell { background: var(--s1-canvas); font-family: var(--s1-font-ui); color: var(--s1-ink); }
.workspace > main { flex: 1 1 auto; min-width: 0; }
.sb a, .tb a, .dock a, .pop a, .crumb a, .hd .tabs a { text-decoration: none; }
.tb .main-site { display: none !important; }
.topbar .role-preview-control { grid-auto-flow: column; align-items: center; gap: calc(8px * var(--s1-scale, 1)); max-width: none; color: var(--s1-mute); font: 600 var(--s1-text-small) var(--s1-font-ui); }
.topbar .rpc-menu .k-btn { gap: calc(6px * var(--s1-scale, 1)); }
.topbar .rpc-menu .rpc-k { color: var(--s1-mute); font-weight: 600; }
.topbar .rpc-menu .rpc-v { color: var(--s1-ink); font-weight: 700; }
/* the shell is the document: anything that spills past it is clipped, so the sidebar always reaches the viewport bottom */
/* ...and sideways: a closed menu (visibility:hidden, still laid out) must never widen the document */
.app-shell { overflow-x: clip; }
@media (min-width: 601px) { .app-shell { overflow-y: clip; } }
/* pages that fill the viewport (Apex, Messages): the main column is the one scroll container */
@media (min-width: 601px) {
  body.s1-shell:not(.s1-project-mode) .workspace:has(> main > .s1-fill) { height: 100dvh; min-height: 0; }
  body.s1-shell .workspace > main:has(> .s1-fill) { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
  body.s1-shell main > .s1-fill { flex: 1 1 auto; display: flex; flex-direction: column; padding-bottom: 0; }
  body.s1-shell main > .s1-fill > .s1-fill-body { flex: 1 1 auto; height: auto; min-height: 480px; }
}
body.s1-project-mode [data-s1-project] { display: block; }
html.rwt-booting .app-shell > .rail > *, html.rwt-booting .workspace > *, html.rwt-booting .mobile-dock, html.rwt-booting .skip-link { visibility: hidden; }

/* ── Classic leftovers inside S1 (sweep) ─────────────────────────────────────────────────────────
 * Any element still rendered by a classic module (feedback, inbox, personal projects, access-denied cards, legacy dialogs)
 * reads the legacy design tokens. Inside the S1 shell those tokens map to the S1 palette, so the classic markup shows
 * S1 ink, grey lines and ink buttons instead of navy headings and maroon buttons. Nothing here changes behavior or markup. */
body.s1-shell {
  --s1-font-ui: "RWT S1 Inter", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --s1-font-display: "RWT S1 Inter Tight", "RWT S1 Inter", "Inter Tight", Inter, system-ui, sans-serif;
  --font: "RWT S1 Inter", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: var(--s1-font-display); /* one display face for the v3/v4 pages and the kit pages: a failed font load cannot split them */
  --bg: var(--s1-canvas); --surface: var(--s1-panel); --surface-muted: var(--s1-panel-head);
  --ink: var(--s1-ink); --muted: var(--s1-mute); --faint: var(--s1-mute); --line: var(--s1-line); --control-border: var(--s1-control-line);
  --accent: var(--s1-accent); --rail-accent: var(--s1-rail-accent); --accent-dark: var(--s1-ink-hover); --accent-soft: var(--s1-column); --focus-ring: var(--s1-ink);
  --radius-xl: 12px; --radius-lg: 12px; --radius-md: var(--s1-radius-control);
  --shadow: none; --shadow-hover: none;
}
/* brand mark keeps its own maroon (it reads --accent, which the block above turns to ink) */
/* programmatic focus on a heading (route change) is not a keyboard target: no ring box around the title */
body.s1-shell :is(h1, h2, h3, h4, main, section, article, header, .k-title, .s1t-title, .s1cc-title)[tabindex="-1"]:focus, body.s1-shell :is(h1, h2, h3, h4, main, section, article, header, .k-title, .s1t-title, .s1cc-title)[tabindex="-1"]:focus-visible {  box-shadow: none; }
/* Gutter for classic pages that render straight into the page root (S1 pages set their own). */
/* Inbox (reached from the bell and the Messages | Inbox tabs): S1 segmented tabs, panels and rows */
/* Partner projects (collaboration) page and its empty state */
/* Guided tour (Show me around): ink card and highlight instead of the maroon one. */
body.s1-shell .portal-guide::backdrop { background: rgb(17 19 24 / .45); }
/* Command Center access card */
body.s1-shell a.s1-btn { text-decoration: none; }
body.s1-shell .s1cc-gate .s1-btn { justify-self: start; }
/* Publication request / review pages (reached from the project's Publication tab and Command Center > Publication review) */
body.s1-shell :is(.publication-route-header h1, .publication-route-panel h1, .publication-review-queue h1) { font: 700 var(--s1-title)/1.15 var(--s1-font-display); letter-spacing: -.015em; color: var(--s1-ink); }
body.s1-shell :is(.publication-route-panel, .publication-review-release, .publication-review-card, .publication-request-history) { border: 1px solid var(--s1-line); border-radius: var(--s1-radius-panel); background: var(--s1-panel); box-shadow: none; }
body.s1-shell :is(.publication-route-field, .publication-review-note) :is(input:not([type=checkbox]):not([type=radio]), textarea, select) { min-height: 40px; border: 1px solid var(--s1-control-line); border-radius: var(--s1-radius-control); background-color: var(--s1-panel); padding: calc(9px * var(--s1-scale, 1)) calc(12px * var(--s1-scale, 1)); font: 400 var(--s1-fs-3)/1.4 var(--s1-font-ui); color: var(--s1-ink); }
body.s1-shell :is(.publication-route-field, .publication-review-note) :is(input, textarea, select):focus-visible { border-color: var(--s1-focus-border); }
body.s1-shell :is(.publication-route-page, .publication-review-queue) :is(.button, button):not(.s1-btn) { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: calc(8px * var(--s1-scale, 1)) calc(16px * var(--s1-scale, 1)); border: 1px solid var(--s1-line); border-radius: var(--s1-radius-control);
  background: var(--s1-panel); color: var(--s1-ink); font: 600 var(--s1-fs-3) var(--s1-font-ui); text-decoration: none; box-shadow: none; cursor: pointer; }
body.s1-shell :is(.publication-route-page, .publication-review-queue) :is(.button-primary, [type=submit]):not(.s1-btn) { border-color: var(--s1-ink); background: var(--s1-ink); color: var(--s1-on-ink); font-weight: 700; }
body.s1-shell :is(.publication-route-page, .publication-review-queue) :is(.button, button):not(.s1-btn):hover { background: var(--s1-panel-head); }
body.s1-shell :is(.publication-route-page, .publication-review-queue) :is(.button-primary, [type=submit]):not(.s1-btn):hover { background: var(--s1-ink-hover); }
/* Bare links inside S1 pages and dialogs (inline guide links, "Add skills"...) use the browser blue; give them the S1 ink. */
/* :where() keeps this at link specificity so any component rule (.k-tab, ...) wins. */
:where(body.s1-shell :is(#student-page-root, .k-modal-root, dialog.s1-dialog)) a:not([class]) { color: var(--s1-ink); text-decoration: underline; text-underline-offset: 2px; }
:where(body.s1-shell :is(#student-page-root, .k-modal-root, dialog.s1-dialog)) a:not([class]):hover { color: var(--s1-ink-hover); }
/* A Manage page is the mock-up's: its links are bare (the mock-up's .frame a), as specific as the rule above and after it. */
.mxp a { text-decoration: none; }
/* ---- Phone (390): reachable actions, scrolling tabs, clear of the dock and the Ask button, work before stats ---- */
@media (max-width: 640px) {/* Primary actions and filter chips: 44px minimum touch target (icons do not grow; only the hit area). */
  body.s1-shell :is(.s1h-btn, .k-fchip, .s1h-btn--sm, .k-btn, .k-btn--sm, .k-fchip, .k-tab, .k-iconbtn, .k-select, .kp-linkbtn, .button-primary, .button-secondary, .soft-button, .text-button, .calendar-add-button, .kt-status, .kt-check, .k-seg > button, .s1h-seg button, .s1-project-header .s1-btn, .project-actions :is(button, select), .project-state-preview select, .current .advance, .complete > button, .key-date > button) { min-height: 44px; }
  body.s1-shell :is(.complete, .key-date) > button { min-width: 44px; }
  body.s1-shell :is(.project-identity, .project-phases, .phase-strip) button[title*="Edit" i], body.s1-shell button:is([aria-label^="Edit"], [title^="Edit"]):not(.k-iconbtn) { min-height: 44px; min-width: 44px; }
  body.s1-shell :is(.k-iconbtn, .kt-check) { min-width: 44px; }
  body.s1-shell :is(.s1h-btn, .k-btn, .k-fchip, .k-tab, .kt-status) { display: inline-flex; align-items: center; justify-content: center; }
/* Project tabs: one scrolling row with a fade on the trailing edge instead of clipped labels. */
  body.s1-shell .s1-tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity; padding: 0 28px 0 4px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  body.s1-shell .s1-tabs::-webkit-scrollbar { display: none; }
  body.s1-shell .s1-tabs > .s1-tab { flex: 0 0 auto; min-width: 76px; padding-inline: 12px; scroll-snap-align: start; white-space: nowrap; }
/* Pages end above the dock and the Ask button, so the last actions are never covered. */
}
/* on a phone Preview as is a row in the Menu sheet (s1-nav.js), not the top bar */
/* Phone: keep the docked rail clear of focused fields and keep inputs at 16px so iOS does not zoom on focus. */
@media (max-width: 660px) {  html { scroll-padding-bottom: 140px; }
}
/* ---- Phone, round 2: touch size and zoom guards that the first phone block did not cover ---- */
@media (max-width: 640px) {  body.s1-shell :is([role=tab], .s1-text-btn, .k-seg > button, .k-menu-item) { min-height: 44px; }
  body.s1-shell :is(.k-fchip) :is(select) { min-height: 44px; }
  body.s1-shell .s1-person-link { padding-block: 6px; }
  body.s1-shell .k-row-title { margin-block: 6px; } /* margin, not padding: a two-line clamp would otherwise show its third line in the padding */
  body.s1-shell :is(.s1-project-breadcrumb, .project-breadcrumb, nav[aria-label=Breadcrumb]) a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* a table inside a panel scrolls in that panel and never widens the page */
:where(.wsc, .sec):has(> table.tm) { overflow-x: auto; max-width: 100%; }
/* the Team table on a phone: one block per person, each cell labelled, so nothing clips or scrolls sideways */
@media (max-width: 640px) {
  table.tm[aria-label="Team and authorship"], table.tm[aria-label="Team and authorship"] tbody, table.tm[aria-label="Team and authorship"] tr, table.tm[aria-label="Team and authorship"] td { display: block; }
  table.tm[aria-label="Team and authorship"] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.tm[aria-label="Team and authorship"] tr { display: flex; flex-direction: column; padding: 12px 0; border-top: 1px solid var(--line-soft); }
  table.tm[aria-label="Team and authorship"] td { display: flex; gap: 12px; align-items: baseline; padding: 3px 0; border: 0; min-width: 0; overflow-wrap: anywhere; white-space: normal !important; }
  table.tm[aria-label="Team and authorship"] td::before { flex: 0 0 108px; font: 650 var(--s1-fs-1)/1.5 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
  table.tm[aria-label="Team and authorship"] td:nth-child(1):not(:has(.grip)) { display: none; }
  table.tm[aria-label="Team and authorship"] td:nth-child(2)::before { content: "Order"; }
  table.tm[aria-label="Team and authorship"] td:nth-child(3) { order: -1; padding-bottom: 6px; }
  table.tm[aria-label="Team and authorship"] td:empty, table.tm[aria-label="Team and authorship"] td:nth-child(2):has(> .mu) { display: none; }
  table.tm[aria-label="Team and authorship"] td:nth-child(3)::before { content: none; }
  table.tm[aria-label="Team and authorship"] td:nth-child(4)::before { content: "On project"; }
  table.tm[aria-label="Team and authorship"] td:nth-child(5)::before { content: "What they do"; }
  table.tm[aria-label="Team and authorship"] td:nth-child(6)::before { content: "Work"; }
  table.tm[aria-label="Team and authorship"] td:nth-child(7)::before { content: "Author order"; }
  table.tm[aria-label="Team and authorship"] td > small { display: inline; }
}
/* Any other row table on a phone (People roster, Project health, Work tasks): a block per row, the first cell is its title, the rest are labelled lines. */
@media (max-width: 640px) {
  table.tm.rows:not([aria-label="Team and authorship"]), table.tm.rows:not([aria-label="Team and authorship"]) tbody, table.tm.rows:not([aria-label="Team and authorship"]) tr, table.tm.rows:not([aria-label="Team and authorship"]) td { display: block; }
  table.tm.rows:not([aria-label="Team and authorship"]) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.tm.rows:not([aria-label="Team and authorship"]) tr { padding: 12px 0; border-top: 1px solid var(--line-soft); }
  table.tm.rows:not([aria-label="Team and authorship"]) td { display: flex; gap: 12px; align-items: baseline; padding: 3px 0; border: 0; min-width: 0; width: auto; overflow-wrap: anywhere; white-space: normal !important; }
  table.tm.rows:not([aria-label="Team and authorship"]) td[data-label]::before { content: attr(data-label); flex: 0 0 96px; font: 650 var(--s1-fs-1)/1.5 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
  table.tm.rows:not([aria-label="Team and authorship"]) td:first-child { padding-bottom: 6px; font-weight: 600; }
  table.tm.rows:not([aria-label="Team and authorship"]) td:first-child::before, table.tm.rows:not([aria-label="Team and authorship"]) td:empty { display: none; }
  /* A task cell's extra blocks (the count and bar, who counted what, the log buttons) each take its own full line under the task name; a status word ("Not started") never wraps inside its pill. */
  table.tm.rows:not([aria-label="Team and authorship"]) td:nth-child(2) { flex-wrap: wrap; }
  table.tm.rows:not([aria-label="Team and authorship"]) td:nth-child(2) > :not(.ttl, .st, .kd) { flex: 1 1 100%; min-width: 0; margin-top: 4px; }
  table.tm.rows:not([aria-label="Team and authorship"]) td > .st, table.tm.rows:not([aria-label="Team and authorship"]) td:last-child > .mu { flex: none; white-space: nowrap; }
  table.tm.rows:not([aria-label="Team and authorship"]) td:nth-child(n+2) { overflow-wrap: break-word; }
  table.tm.rows:not([aria-label="Team and authorship"]) td:nth-child(3) { flex-wrap: wrap; gap: 0 6px; }
  table.tm.rows:not([aria-label="Team and authorship"]) td:nth-child(3) > * { flex: none; white-space: nowrap; }
}
/* A tab row that scrolls on a phone fades out at its right edge, so a half-cut tab reads as "more this way". */
/* A project's tabs are the same one scrolling row with a fade on the trailing edge: they never wrap onto a second row (the active underline would then sit between the rows). */
@media (max-width: 640px) { .hd > .tabs:not(.s1-project-page .tabs), .s1-project-page .hd > .tabs { padding-right: 28px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); } }
/* Phone: a segmented filter is one row that scrolls sideways inside itself, with a soft fade on the side that has more (CSS scroll shadows: the fade shows only while there is something past that edge). */
@media (max-width: 640px) { .workspace .seg:not(.setr .seg) { display: flex; max-width: 100%; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; background-color: var(--well);
  background-image: linear-gradient(90deg, var(--well), var(--well)), linear-gradient(270deg, var(--well), var(--well)), linear-gradient(90deg, rgb(17 19 24 / .16), transparent), linear-gradient(270deg, rgb(17 19 24 / .16), transparent);
  background-position: left center, right center, left center, right center; background-repeat: no-repeat; background-size: 28px 100%, 28px 100%, 16px 100%, 16px 100%; background-attachment: local, local, scroll, scroll; }
  .workspace .seg:not(.setr .seg)::-webkit-scrollbar { display: none; } .workspace .seg:not(.setr .seg) > button { flex: none; }
  .upc .inp, .s1-project-page .inp { flex-wrap: wrap; } .upc .inp > span, .s1-project-page .inp > span { flex: 1 1 140px; min-width: 0; } }
/* Phone: the three-column action strip (Compliance) stacks; a Plan chart whose bar labels run past the edge scrolls inside itself. */
@media (max-width: 760px) { .act3 > div { padding-left: var(--gut); } }
/* An address that is not a page: a plain state in the normal shell (student-pages.js), on the page edge. */
.k-page.s1-notfound { --s1-gutter: var(--gut, 28px); }
.s1-notfound-t { margin: 0 0 14px; max-width: 60ch; color: var(--s1-ink-2); font-size: var(--s1-fs-3); }
.s1-notfound > .k-btn { justify-self: start; align-self: start; width: auto; }
