/*
  Deliberately plain. This is a scaffold, and the thing worth reviewing in it
  is the authorization path, not the styling. Kept in a file rather than a
  <style> block so the Content-Security-Policy can stay 'self' with no
  'unsafe-inline' -- see SecurityConfig.
*/

:root {
    /* Saint Francis High School brand palette (https://www.sfhs.com/color-palette):
       Leather and Dove are primary, Cedar (academics) and Sunlight (athletics) secondary,
       the Ash family is neutral. Gold marks are decoration only; text stays Leather/Ash for contrast. */
    --leather: #48291b;
    --dove: #ffffff;
    --cedar: #a16c0d;
    --sunlight: #ffc62b;
    --ash1: #e3e1de;
    --ash2: #c6c2bd;
    --ash3: #978f85;
    --ash4: #5e5243;
    --ash5: #1f1c1a;
    --fire: #b66008;

    --ink: var(--ash5);
    --muted: var(--ash4);
    --line: var(--ash1);
    --bg: var(--dove);
    --panel: #f7f5f2;            /* a light tint of Ash 1, for panels and the app bar */
    --accent: var(--leather);
    --gold: var(--sunlight);
    --tint: #f6efe2;             /* a light tint of Sunlight, for highlights */
    --tint-line: #e7d3a4;
    --warn-bg: #fff6dc;
    --warn-line: #e6cf8f;
    --stripe: #f6f2ec;           /* every other row in roster tables: a faint warm Ash tint (a shade past --panel) */
    --stripe-hover: #eee7dc;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }

h1 { font-size: 22px; margin: 0 0 16px; }

/* --- sign-in ------------------------------------------------------ */

.signin { max-width: 420px; margin: 18vh auto 0; text-align: center; }
.signin h1 { font-size: 28px; margin-bottom: 4px; color: var(--leather); }
.signlogo { display: block; margin: 0 auto 18px; height: 120px; width: auto; max-width: 80%; }
/* Sign-in page: school logo (links to sfhs.com) and the GC logo side by side, same height. */
.signlogos { display: flex; justify-content: center; align-items: center; gap: 20px; margin: 0 auto 18px; }
.signlogos a { display: block; line-height: 0; }
.signlogos img { display: block; height: clamp(72px, 22vw, 120px); width: auto; }
.lede { color: var(--muted); margin: 0 0 28px; }


.error {
    margin-top: 24px;
    padding: 12px 14px;
    background: var(--warn-bg);
    border: 1px solid var(--warn-line);
    border-radius: 6px;
    text-align: left;
    color: var(--muted);
}

.notice {
    margin-top: 24px;
    padding: 12px 14px;
    border: 1px solid var(--line, #d9d9d9);
    border-radius: 6px;
    text-align: center;
    color: var(--muted);
}

/* --- app bar ------------------------------------------------------ */

.bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    border-bottom: 3px solid var(--gold);
    background: var(--dove);
}

/* Upper-left: school logo (links to sfhs.com), GC logo (links to home). */
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brandlogolink { display: block; line-height: 0; border-radius: 4px; }
.brandlogolink:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.brandlogo { height: 34px; width: auto; display: block; }
.spacer { flex: 1; }
.whoami { color: var(--muted); font-size: 13px; }

.nav { display: flex; gap: 14px; margin-left: 12px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 13px; }
.nav a.current { color: var(--leather); font-weight: 600; }
.nav a:hover { color: var(--accent); }

.linkish {
    background: none;
    border: 0;
    padding: 0;
    color: var(--accent);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}
/* Same as every other link on the site: leather, underlined only on hover. */
.linkish:hover:not(:disabled) { text-decoration: underline; }

/* --- search ------------------------------------------------------- */

.search { display: flex; gap: 8px; margin-bottom: 14px; }

.search input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}



.policy {
    margin: 0 0 14px;
    padding: 10px 12px;
    background: var(--warn-bg);
    border: 1px solid var(--warn-line);
    border-radius: 6px;
    font-size: 13px;
    color: #6b5a2a;
}

.status { color: var(--muted); font-size: 13px; min-height: 20px; margin: 0 0 10px; }

/* --- results ------------------------------------------------------ */



table { border-collapse: collapse; width: 100%; font-size: 14px; }

th, td {
    text-align: left;
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

th.restricted::after {
    content: " \25CF";
    color: #b06a00;
}

tbody tr:hover { background: var(--panel); }

/* --- student list (app.html) --------------------------------------- */
/*
   Not a <table>. Each result is a variable-height block (summary row +
   an optional expandable detail panel below it), which doesn't fit a
   table's row model cleanly, and a CSS grid gets the mobile "stacked card"
   layout below for free from the same markup -- no separate mobile
   template to keep in sync with the desktop one.

   Column count/widths here MUST match the number of <span> children
   app.js's buildRow() actually appends (toggle + up to 5 primary fields);
   a mismatch just misaligns columns, it will not error, so a future
   PRIMARY_FIELDS change in app.js needs a matching change here.
*/
.studentlist-head,
.studentrow {
    display: grid;
    grid-template-columns: 28px 90px 1fr 1fr 70px 1fr;
    align-items: center;
    gap: 4px 10px;
}

.studentlist-head {
    padding: 7px 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

.studentrow {
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.studentrow:hover { background: var(--panel); }

.studentrow .cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-toggle { text-align: center; }

.expand-toggle {
    background: none;
    border: 0;
    padding: 0;
    color: var(--muted);
    font-size: 11px;
    cursor: pointer;
    width: 100%;
}

.expand-toggle:hover:not(:disabled) { color: var(--accent); }
.expand-toggle:disabled { visibility: hidden; cursor: default; }

/* The detail panel spans every column (it sits below the summary row
   within the same .studentrow grid) rather than living in its own column. */
.studentdetail {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
}

/* An author rule's `display` always wins over the browser's own
   `[hidden] { display: none }` default, regardless of specificity -- so
   without this override, setting the `hidden` attribute in app.js had no
   visible effect at all, and every row's detail panel rendered expanded
   from the start. This is the rule that actually makes app.js's toggle
   (detail.hidden = true/false) do anything. */
.studentdetail[hidden] {
    display: none;
}

/* The student's photo in the upper right of their record (app.js). */
.studentdetail.hasphoto { position: relative; padding-right: 150px; min-height: 170px; }
.studentphoto { position: absolute; top: 10px; right: 12px; margin: 0; padding: 4px; background: #fff;
    border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 4px rgba(60, 40, 20, 0.18); }
.studentphoto img { display: block; width: 120px; height: 150px; object-fit: cover; border-radius: 5px; }

/* The student record's boxes (the Community card's tiles, person-card.js) fill the expanded row. */
.studentdetail .recordtiles { flex: 1 1 100%; min-width: 0; font-size: 14px; }
.studentdetail .recordtiles .ptiles { padding: 0; }

.detailfield { display: flex; gap: 6px; white-space: nowrap; }
.detaillabel { color: var(--muted); }
.detaillabel::after { content: ":"; }

/* Same orange-dot convention as the engines/students PII marker
   elsewhere -- applied per field here since there is no shared header
   row for the detail section to carry it on instead. */
.detaillabel.restricted::before {
    content: "\25CF ";
    color: #b06a00;
}

/* Below this width, the grid becomes a single column and every field
   (including the ones normally implied by column position) grows a
   visible label via `data-label` -- this is the "stacked card" mobile
   layout. The detail panel needs no separate rule: it already reflows
   with `flex-wrap`, and at this width each field naturally takes its own
   line. */
@media (max-width: 640px) {
    .studentlist-head { display: none; }

    .studentrow {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 4px 0;
        padding: 10px 12px;
    }

    .col-toggle { flex: 0 0 24px; order: -1; }

    .studentrow .cell {
        flex: 1 1 100%;
        overflow: visible;
        white-space: normal;
    }

    .studentrow .cell::before {
        content: attr(data-label) ": ";
        color: var(--muted);
        font-size: 12px;
    }

    .studentdetail { margin-top: 8px; flex-direction: column; gap: 4px; }
    .studentdetail.hasphoto { padding-right: 12px; min-height: 0; }
    .studentrow .studentdetail { flex: 1 1 100%; min-width: 0; }
    .studentdetail .recordtiles { flex: none; width: 100%; }
    .studentphoto { position: static; align-self: flex-start; margin-bottom: 6px; }
}

/* --- contact list (contacts.html) ----------------------------------- */
/*
   Same block-per-row/expandable-detail markup as .studentlist-head/
   .studentrow above (see that comment) -- contacts.js builds rows with
   contacts.js's own buildRow(), reusing every other class (.col-toggle,
   .cell, .expand-toggle, .studentdetail, .detailfield, ...) unchanged.
   Only the column count differs (toggle + 3 directory fields here, vs.
   toggle + 5 for students), so only grid-template-columns is overridden,
   scoped to .contactlist-head/.contactrow rather than duplicating the
   whole ruleset.
*/
.contactlist-head,
.contactrow {
    grid-template-columns: 28px 110px 1fr 1fr;
}

@media (max-width: 640px) {
    .contactlist-head { display: none; }

    .contactrow {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 4px 0;
        padding: 10px 12px;
    }
}

/* --- linked students/contacts (expanded-row detail) ------------------ */
/*
   The read-only list of linked contacts (on a student's expanded row) or
   linked students (on a contact's expanded row) -- see app.js/contacts.js.
   Deliberately just a list, not a nested .studentrow: there is nothing to
   expand further and no per-field permission dance, since the server
   already applied field policy before these names ever reached the
   browser.
*/
.linkedlist {
    grid-column: 1 / -1;
    margin-top: 8px;
}

.linkedlist-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin: 0 0 4px;
}

.linkeditem {
    padding: 3px 0;
    font-size: 13px;
}

.linkeditem .relationship {
    color: var(--muted);
}

/* --- student schedule (expanded-row detail, app.js renderSchedule) --- */
/*
   Sits in the same detail panel as the contacts list. A real <table>
   here, unlike the student list itself: fixed columns, no nested
   expansion, and the Term column simply isn't rendered for S1/S2.
*/
.schedulelist { flex: 1 1 100%; }

.schedule-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.schedule-head .linkedlist-title { margin: 0; }

.schedule-term {
    font: inherit;
    font-size: 13px;
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--bg);
    color: var(--ink);
}

table.schedule {
    font-size: 13px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 4px;
}

table.schedule th,
table.schedule td { padding: 5px 10px; }

.pager {
    display: flex;
    align-items: center;
    margin-top: 14px;
}


.pager button:disabled { opacity: .5; cursor: default; }

.apinote { margin-top: 32px; color: var(--muted); font-size: 13px; }
.apinote p { max-width: 60ch; }
.apinote code { background: var(--panel); padding: 1px 5px; border-radius: 3px; }

/* --- engines page -------------------------------------------------- */

.enginename { font: inherit; padding: 0; }
.docsDialog { max-width: 860px; width: calc(100% - 32px); max-height: 85vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; }
.docsDialog::backdrop { background: rgba(0, 0, 0, .35); }

.livebadge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--warn-bg);
    border: 1px solid var(--warn-line);
    color: #8a4b00;
    vertical-align: middle;
}

.cards { display: flex; flex-direction: column; gap: 18px; margin-top: 12px; }
.destcard {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 16px 6px;
    background: var(--bg);
}
.destcard h2 { font-size: 15px; margin: 0 0 6px; }
.destcard table { width: 100%; border-collapse: collapse; font-size: 13px; }
.destcard th, .destcard td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.destcard tr:last-child td { border-bottom: none; }
td.schedule { color: var(--muted); } /* engine cards: schedule text may wrap */

/* Safety net: a wide table scrolls inside its own box instead of pushing the page sideways. */
.tablescroll, .tablewrap { overflow-x: auto; max-width: 100%; }
/* Same behaviour on Engines, Runs and Schedules: text cells wrap (long unbroken
   strings such as arguments break rather than stretch the page), short cells
   (times, status, buttons) are marked .nw and stay on one line, and when the
   screen is too narrow for all that the table scrolls inside its own box. */
.tablescroll table, .tablewrap table { min-width: 560px; }
.tablescroll th, .tablescroll td,
.tablewrap th, .tablewrap td { white-space: normal; overflow-wrap: break-word; vertical-align: top; }
.tablescroll th.nw, .tablescroll td.nw,
.tablewrap th.nw, .tablewrap td.nw { white-space: nowrap; overflow-wrap: normal; }
.tablescroll input[type="text"], .tablewrap input[type="text"] { max-width: 100%; }

/* Schedules: each job is two rows -- settings, then arguments / note / results -- so the table stays narrow. */
table.schedule tr.jobmain td { border-bottom: 0; padding-bottom: 2px; }
table.schedule tr.jobsub td { padding-top: 0; padding-bottom: 10px; vertical-align: top; }
table.schedule tr.jobsub label { display: inline-block; font-size: 12px; color: var(--muted); margin-right: 4px; }
table.schedule tr.jobsub .subfield { display: inline-block; vertical-align: top; margin-right: 18px; }
table.schedule tr.jobsub .results { font-size: 12px; color: var(--muted); }

.freshness { margin: 8px 0; font-size: 13px; color: var(--muted); }
.freshness.stale { color: #8a4b00; font-weight: 600; }

.docsbody { font-size: 13px; line-height: 1.5; max-width: 90ch; }
.docsbody h3, .docsbody h4 { margin: 16px 0 4px; font-size: 14px; }
.docsbody h3:first-child { margin-top: 0; }
.docsbody p { margin: 6px 0; }
.docsbody ul { margin: 6px 0; padding-left: 20px; }
.docsbody code { background: var(--panel); padding: 1px 4px; border-radius: 3px; }
.docsbody pre {
    background: #1a1d21; color: #e6e8eb; padding: 10px 12px; border-radius: 6px;
    overflow: auto; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.docsbody pre code { background: none; padding: 0; }
.docsbody table { border-collapse: collapse; margin: 8px 0; }
.docsbody th, .docsbody td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }

.status-running   { color: var(--accent); font-weight: 600; }
.status-succeeded { color: #1a7a3c; }
.status-failed,
.status-error      { color: #a3271f; font-weight: 600; }

.optionsrow td {
    background: var(--panel);
    padding: 8px 12px;
    font-size: 13px;
    border-top: none;
}
.optionsrow select { margin-left: 4px; }
.optionsrow label { white-space: nowrap; }
.optionsrow .optionitem { margin: 4px 0; }
.optionsrow .optionhelp { color: var(--muted, #667085); font-size: 12px; }

button:disabled { opacity: .5; cursor: default; }

.detail {
    margin-top: 28px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.detailhead { display: flex; align-items: center; justify-content: space-between; }
.detailhead h2 { font-size: 16px; margin: 0; }

#historyTable { border-collapse: collapse; width: 100%; font-size: 13px; margin: 12px 0; }
#historyTable th, #historyTable td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid var(--line);
}

.output {
    max-height: 420px;
    overflow: auto;
    background: #1a1d21;
    color: #e6e8eb;
    padding: 12px 14px;
    border-radius: 6px;
    font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.confirmDialog {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px 22px;
    max-width: 420px;
}

.confirmDialog::backdrop { background: rgba(0, 0, 0, .35); }

.confirmButtons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* --- admin page ----------------------------------------------------- */

.panel {
    margin-bottom: 24px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.panel h2 { font-size: 15px; margin: 0 0 10px; }

.inviteform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.inviteform input,
.inviteform select {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
}

.inviteform input[type="text"],
.inviteform input[type="email"] { flex: 1 1 200px; }


td.roles { white-space: normal; }

.rolechip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px 2px 8px;
    margin: 2px 4px 2px 0;
    border-radius: 999px;
    background: var(--tint);
    color: var(--accent);
    font-size: 12px;
}

.rolechip-x {
    background: none;
    border: 0;
    padding: 0 4px;
    margin: 0;
    color: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.rolechip-x:hover { color: #a3271f; }

/* --- roles & permissions panel (admin.html) ------------------------- */

.permgrid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.permgroup {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px 10px;
    min-width: 180px;
    background: var(--bg);
}

.permgroup legend {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    padding: 0 4px;
}

.permcheck {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    padding: 2px 0;
    cursor: pointer;
}

.permcheck input { margin: 0; }

/* Same orange-dot PII convention used on th.restricted and .detaillabel.
   isPii is the server's own answer, from GET /api/admin/permissions --
   never decided here. */
.permcheck.restricted span::before {
    content: "\25CF ";
    color: #b06a00;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --- groups (groups.html, group.html) ------------------------------- */

/* Same `[hidden]` trap as .studentdetail above: any rule here that sets
   `display` would otherwise beat the hidden attribute groups.js/group.js
   toggle. One blanket rule for this section instead of one per class. */
.pagehead[hidden], .menu[hidden], .menu [hidden], .panel[hidden],
.rostertoolbar [hidden], .rolebadge[hidden], .groupdesc[hidden],
#groupSection[hidden], .formerror[hidden], #addResultsWrap[hidden],
.pager[hidden], .search[hidden], .gearwrap[hidden] {
    display: none;
}

.pagehead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.pagehead h1 { margin: 0; }
.titleblock { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

button.dangerbtn:not(:disabled):hover { background: #a3271f; color: #fff; }

.crumb { margin: 0 0 10px; font-size: 13px; }
.crumb a { color: var(--accent); text-decoration: none; }

.grouptable td.num, .grouptable th.num { text-align: right; }
.grouptable a.grouplink { color: var(--accent); font-weight: 600; text-decoration: none; }
.grouptable a.grouplink:hover { text-decoration: underline; }
.grouptable td.owners { white-space: normal; }
.muted { color: var(--muted); }

.visbadge, .rolebadge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--muted);
    vertical-align: middle;
}
.vis-private  { background: #f3eefa; border-color: #d6c8ec; color: #5b3f8c; }
.vis-internal { background: var(--tint); border-color: var(--tint-line); color: var(--accent); }
.vis-public   { background: #e8f5ec; border-color: #bfe0c9; color: #1a7a3c; }
.role-owner   { background: #fdf6e3; border-color: var(--warn-line); color: #8a4b00; }
.role-manager { background: var(--tint); border-color: var(--tint-line); color: var(--accent); }

.groupdesc { margin: 4px 0 4px; max-width: 75ch; }
.groupmeta { margin: 0 0 18px; color: var(--muted); font-size: 13px; }

/* gear menu */
.gearwrap { position: relative; }
.gearbtn {
    width: 38px; height: 38px;
    border: 2px solid var(--ash2);   /* a touch heavier than other borders so the gear is easy to spot */
    background: var(--bg);
    border-radius: 8px;
    font-size: 20px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
}
.gearbtn:hover, .gearbtn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.menu {
    position: absolute;
    right: 0;
    top: 44px;
    z-index: 20;
    min-width: 240px;
    padding: 6px 0;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    background: none;
    border: 0;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
}
.menu button:hover:not(:disabled) { background: var(--panel); }
.menu button.danger { color: #a3271f; }
.menu button em { color: var(--muted); font-size: 12px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* add members */
.addpanel summary { cursor: pointer; list-style: revert; }
.addpanel summary h2 { display: inline; }
.addpanel .inviteform { margin-top: 12px; }
.addpanel .inviteform input[type="search"] {
    flex: 1 1 240px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
}
.addtoolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 6px 0; font-size: 13px; }
.addtoolbar select { margin-left: 4px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.addresults {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
}
.addresults li { border-bottom: 1px solid var(--line); }
.addresults li:last-child { border-bottom: 0; }
.addresults label { display: block; padding: 6px 10px; font-size: 14px; cursor: pointer; }
.addresults label:hover { background: var(--panel); }

/* roster */
.rostertoolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.rostertoolbar input[type="search"] {
    flex: 1 1 260px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
}
.perpage { font-size: 13px; color: var(--muted); white-space: nowrap; }
.perpage select { margin: 0 4px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }

.rostertable .col-check { width: 32px; text-align: center; }
.rostertable .col-x { width: 32px; text-align: center; }
.rostertable td.name { white-space: normal; }
.rostertable td.email { white-space: normal; word-break: break-all; }
.rostertable tr.inactive td { color: var(--muted); }
.rostertable .refid { margin-left: 8px; color: var(--muted); font-size: 12px; }
.rostertable .tag {
    margin-left: 6px; padding: 0 6px; border-radius: 3px; font-size: 11px;
    background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}
.roleselect { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; }
.rowx {
    background: none; border: 0; padding: 0 4px; font-size: 18px; line-height: 1;
    color: var(--muted); cursor: pointer;
}
.rowx:hover { color: #a3271f; }

.pagerlabel { margin: 0 10px; }

/* dialogs */
.confirmDialog.wide { max-width: 560px; width: calc(100% - 32px); }
.confirmDialog h2 { font-size: 17px; margin: 0 0 12px; }
.field { display: block; margin: 0 0 12px; border: 0; padding: 0; }
.field > span, .field legend { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input[type="text"], .field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
}
.visibilitychoice label { display: block; font-size: 14px; padding: 4px 0; cursor: pointer; }
.formerror {
    margin: 8px 0 0;
    padding: 8px 10px;
    background: #fbeceb;
    border: 1px solid #e8b9b5;
    border-radius: 6px;
    color: #a3271f;
    font-size: 13px;
}

@media (max-width: 640px) {
    .search { flex-wrap: wrap; }
}

/* --- employees (employees.html) -------------------------------------- */
.inlinecheck { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.addpanel .inviteform input[type="email"] { flex: 1 1 200px; }
.inlinecheck[hidden] { display: none; }
.grouptable tr.inactive td { color: var(--muted); }
.grouptable .refid { margin-left: 6px; color: var(--muted); font-size: 12px; }
.grouptable .tag {
    margin-left: 6px; padding: 0 6px; border-radius: 3px; font-size: 11px;
    background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}

/* schedule page */
/* Diffs stay light. Run output (pre.output) is styled by the .output rule above: white on black, like a terminal. */
pre.diff { max-height: 360px; overflow: auto; font-size: 12px; background: var(--panel); padding: 8px 10px; border-radius: 6px; white-space: pre-wrap; }
input.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
#driftBody pre { margin: 4px 0; font-size: 12px; white-space: pre-wrap; }
#confirmText { white-space: pre-line; }

/* Setup menu (Engines, Schedule, Access) */
.navmenu { position: relative; }
.navmenu summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 13px; }
.navmenu summary::-webkit-details-marker { display: none; }
.navmenu summary::after { content: " \25BE"; }
.navmenu summary:hover { color: var(--accent); }
.navmenu.current summary { color: var(--ink); font-weight: 600; }
.navmenu-items { position: absolute; top: 22px; left: -10px; z-index: 20; display: flex; flex-direction: column; gap: 2px;
    min-width: 140px; padding: 6px 4px; background: var(--bg); border: 1px solid var(--line, #d0d7de); border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.navmenu-items a { padding: 5px 12px; }

/* per-pair data-access gate on linked contacts/students */
.dataaccess { font-size: 12px; color: var(--muted); }
.dataaccess.da-yes { color: #1a7a3c; }
.dataaccess.da-no { color: #a3271f; }

/* Credentials page */
table.creds { width: 100%; }
table.creds td { padding: 6px 10px; vertical-align: top; }
table.creds input { min-width: 16em; margin-right: .4em; }
table.creds button { margin-right: .3em; }

/* Integrations tabs (Engines / Runs / Schedules share one section) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border, #ccc); margin: 0 0 16px; }
.tabs a { padding: 8px 16px; text-decoration: none; color: var(--muted); border: 1px solid transparent;
          border-bottom: none; border-radius: 6px 6px 0 0; margin-bottom: -1px; }
.tabs a:hover { color: var(--accent); }
.tabs a.current { color: var(--leather); font-weight: 600; background: var(--bg, #fff); border-color: var(--border, #ccc); border-top: 3px solid var(--gold); }

/* Runs pager */
.runpager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0; }
.runpager label { font-size: 13px; color: var(--muted); }
.runpager-buttons { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.runpager[hidden] { display: none; }

/* Breadcrumb bar under the header */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 20px; font-size: 13px;
          color: var(--muted); background: var(--panel); border-bottom: 1px solid var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs [aria-current="page"], .crumbs #crumbCurrent { color: inherit; font-weight: 600; }
.crumbs .sep { opacity: .6; }

/* Audit log filters */
.auditfilters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin: 12px 0; }
.auditfilters label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.auditfilters label.inlinecheck { flex-direction: row; align-items: center; gap: 6px; margin: 0; }

/* Compose pop-up (js/mail-modal.js) */
.mailDialog { width: min(920px, 96vw); max-height: 92vh; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--bg); }
.mailDialog::backdrop { background: rgba(0, 0, 0, .35); }
.mailhead { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.mailhead h2 { margin: 0; font-size: 17px; }
.mailbanner { margin: 8px 16px 0; }
.mailgrid { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 0; min-height: 420px; max-height: calc(92vh - 60px); }
.mailrecipients { padding: 12px 14px; border-right: 1px solid var(--line); overflow-y: auto; }
.mailcompose { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.maillabel { font-size: 13px; color: var(--muted); margin: 6px 0 4px; }
.mailcats { margin-bottom: 8px; }
.mailcheck { display: block; padding: 2px 0; font-size: 14px; cursor: pointer; }
.mailcheck.off { color: var(--muted); cursor: default; }
.mailrow-person.indent { margin-left: 22px; }
.mailstudent { margin-bottom: 2px; }
.mailbulk { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin-bottom: 8px; background: var(--panel); }
.mailbulk .maillabel { font-weight: 600; }
.mailadd { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.mailadd select, .mailadd input { width: 100%; font: inherit; font-size: 13px; }
.mailcount { margin-top: 10px; }
.mailrow { display: flex; align-items: center; gap: 8px; }
.mailrow label { width: 64px; font-size: 14px; }
.mailrow input { flex: 1 1 auto; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 14px; }
.mailmerge { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.mailmerge .mergechip { padding: 2px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font: inherit; font-size: 12px; cursor: pointer; }
.mailmerge .mergechip:hover { border-color: var(--muted); }
.mailrow input[readonly] { background: var(--panel); color: var(--muted); }
.mailtoolbar { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.mailtoolbar button { min-width: 32px; }
.mailcompose textarea { flex: 1 1 auto; min-height: 220px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 14px; resize: vertical; box-sizing: border-box; }
.mailfoot { display: flex; align-items: center; gap: 12px; }
.mailfoot .spacer { flex: 1 1 auto; }
.mailstatus:empty { display: none; }
.mailattachments { display: flex; flex-wrap: wrap; gap: 6px; }
.mailattachments:empty { display: none; }
.mailfile { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-size: 13px; }
.mailfile .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.mailfile .size { color: var(--muted); white-space: nowrap; }
.mailfile.failed { border-color: var(--danger, #b42318); }
.mailfile.failed .size { color: var(--danger, #b42318); }
.mailfile button { min-width: 24px; padding: 0 6px; border: 0; background: none; font: inherit; font-size: 15px; line-height: 1; cursor: pointer; color: var(--muted); }
.mailfile button:hover { color: var(--accent); }
@media (max-width: 720px) {
    .mailgrid { grid-template-columns: 1fr; }
    .mailrecipients { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
}

/* Inbox and rich-text message bodies */
.inboxmessage { margin-top: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 6px; }
.messagebody { overflow-wrap: anywhere; }
.messagebody blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }

/* The compose editor */
.maileditor { flex: 1 1 auto; min-height: 220px; max-height: 50vh; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--line);
    border-radius: 6px; font-size: 14px; background: var(--bg); overflow-wrap: anywhere; }
.maileditor:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.maileditor blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.maileditor a { color: var(--accent); text-decoration: underline; }
.mailtoolbar button.on { background: var(--accent); color: #fff; }

/* --- viewing as another user ---------------------------------------- */

.impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 16px;
    background: #a3271f;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.impersonation-banner button {
    background: #fff;
    color: #a3271f;
    border: 0;
    border-radius: 4px;
    padding: 4px 10px;
    font-weight: 600;
    cursor: pointer;
}

/* Courses and rosters */
.coursetable td, .coursetable th { padding: 6px 10px; text-align: left; vertical-align: top; }
.coursetable .tag, .rostertable2 .tag { margin-left: 6px; padding: 0 6px; border-radius: 3px; font-size: 11px;
    background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.rostertable2 { width: 100%; border-collapse: collapse; }
.rostertable2 th, .rostertable2 td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.rostertable2 tbody tr:nth-child(odd) { background: var(--panel); }

@media print {
    header.bar, nav.crumbs, .noprint, .mailDialog { display: none !important; }
    body { background: #fff; }
    .rostertable2 th, .rostertable2 td { border-bottom: 1px solid #999; }
    .rostertable2 tbody tr:nth-child(odd) { background: none; }
}

/* Course icons (Bootstrap Icons) and the course page's action row */
.iconlink { display: inline-flex; align-items: center; justify-content: center; padding: 4px; border: 0; background: none;
    color: var(--muted); cursor: pointer; border-radius: 6px; text-decoration: none; }
.iconlink:hover, .iconlink:focus-visible { color: var(--accent); background: var(--panel); }
.rowicons { text-align: right; }
.rosteractions { display: flex; align-items: center; gap: 6px; }
.termselect { padding: 9px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--bg); }
.coursetable .tag { margin-left: 6px; }

/* Editor toolbar: icon buttons */
.mailtoolbar { align-items: center; flex-wrap: wrap; }
.mailtoolbar .tbtn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; padding: 0;
    border: 1px solid transparent; border-radius: 4px; background: none; color: var(--ink); cursor: pointer; }
.mailtoolbar .tbtn:hover { background: var(--bg); border-color: var(--line); color: var(--accent); }
.mailtoolbar .tbsep { width: 1px; align-self: stretch; margin: 3px 4px; background: var(--line); }

/* Compose pop-up: the x in the corner */
.mailx { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted);
    font-size: 24px; line-height: 1; cursor: pointer; }
.mailx:hover, .mailx:focus-visible { color: var(--ink); background: var(--panel); }

/* Compose pop-up: fixed-height layout so everything fits. The recipient list and the message editor scroll on
   their own; the header and the footer buttons always stay visible. Later rules override the earlier ones. */
.mailDialog { width: min(920px, 96vw); height: min(720px, 92vh); max-height: 92vh; overflow: hidden; }
.mailDialog[open] { display: flex; flex-direction: column; }
.mailDialog .mailhead, .mailDialog .mailbanner { flex: 0 0 auto; }
.mailDialog .mailgrid { flex: 1 1 auto; min-height: 0; max-height: none; display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.mailDialog .mailrecipients { min-height: 0; overflow-y: auto; }
.mailDialog .mailcompose { min-height: 0; overflow: hidden; }
.mailDialog .maileditor { flex: 1 1 auto; min-height: 100px; max-height: none; overflow-y: auto; }
.mailDialog .mailtoolbar, .mailDialog .mailrow, .mailDialog .mailstatus, .mailDialog .mailfoot, .mailDialog .maillabel { flex: 0 0 auto; }
.mailDialog .mailtree .formerror { margin: 0 0 8px; }

/* The three footer buttons are one size and one shape; only the colour says which one is primary. */
.mailDialog .mailfoot button { box-sizing: border-box; min-width: 92px; height: 36px; padding: 0 18px; border: 1px solid var(--accent);
    border-radius: 6px; font: inherit; font-size: 14px; line-height: 1; cursor: pointer; background: var(--accent); color: #fff; }
.mailDialog .mailfoot button.secondary { background: var(--bg); color: var(--accent); }
.mailDialog .mailfoot button:disabled { opacity: .5; cursor: default; }
.mailDialog .mailnote { font-size: 12px; text-align: right; }
.mailDialog .mailadd button { box-sizing: border-box; height: 32px; padding: 0 14px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; }

/* Email modal enhancements (2026-10-30): the button bar sits under the two columns, outside anything that scrolls,
   so Send shows at any window size; the compose column scrolls on its own instead of cutting off its bottom. */
.mailDialog .mailcompose { overflow-y: auto; }
.mailDialog .mailrow input, .mailDialog .mailrow select { min-width: 0; }
.mailDialog .maileditor { min-height: 140px; }
.mailfootbar { flex: 0 0 auto; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--bg); }
.mailfootbar .mailfoot { flex-wrap: wrap; row-gap: 8px; }
.mailfootbar .mailnote { margin: 6px 0 0; font-size: 12px; text-align: right; }
/* Recipient categories: Teachers / Counselors / Parents sit under Students. */
.mailcats .mailcheck.sub { margin-left: 1.6em; }
/* Templates button and the merge-field list share a row. */
.mailtools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 0 0 auto; }
.mailtools button, .mailtools select { box-sizing: border-box; height: 32px; padding: 0 10px; border: 1px solid var(--line);
    border-radius: 6px; font: inherit; font-size: 13px; background: var(--bg); color: var(--ink); cursor: pointer; }
.mailtools .mailtplbtn { color: var(--accent); border-color: var(--accent); }
.mailtpl { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--panel);
    max-height: 45%; overflow-y: auto; font-size: 13px; }
.mailtplhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mailtpllist { list-style: none; margin: 0; padding: 0; }
.mailtpllist li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.mailtplinfo { overflow-wrap: anywhere; }
.mailtplname { font-weight: 600; }
.mailtplacts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2px; }
.mailtplshare { margin-top: 6px; }
.mailtplfoot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mailtplfoot button { box-sizing: border-box; height: 30px; padding: 0 12px; border: 1px solid var(--accent); border-radius: 6px;
    font: inherit; font-size: 13px; background: var(--bg); color: var(--accent); cursor: pointer; }
/* Pictures in the editor, the inbox and a signature never overflow their box. */
.maileditor img, .messagebody img, .sigeditor img { max-width: 100%; height: auto; }
/* Profile: the signature editor */
.sigeditor .maileditor { min-height: 120px; max-height: 320px; }
.sigeditor .sigactions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

@media (max-width: 720px) {
    .mailDialog { height: 94vh; }
    .mailDialog .mailgrid { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 38%) minmax(0, 1fr); }
    .mailDialog .mailrecipients { border-right: 0; border-bottom: 1px solid var(--line); }
    .mailDialog .mailfoot { flex-wrap: wrap; }
    .mailfootbar .mailfoot button { min-width: 0; flex: 1 1 auto; padding: 0 10px; }
    .mailfootbar .mailfoot .spacer { display: none; }
}

/* Group absence requests (wizard, office queue, PowerSchool setup) */
.wizsteps { display: flex; gap: 6px; list-style: none; margin: 0 0 14px; padding: 0; flex-wrap: wrap; }
.wizsteps li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; color: var(--muted); background: var(--panel); }
.wizsteps li.on { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.wizsteps li.past { color: var(--ink); }
.wizstep h2 { font-size: 18px; margin: 0 0 8px; }
.wizbtns { display: flex; gap: 8px; margin-top: 16px; }
.wizselall { margin: 0 0 8px; font-size: 14px; }
.wizselall label { cursor: pointer; }
.wiztable td, .wiztable th { padding: 6px 10px; text-align: left; vertical-align: top; }
.wizskipped { list-style: none; margin: 8px 0 0; padding: 0; }
.wizselopts { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin: 0 0 12px; font-size: 14px; }
.wizselopts legend { padding: 0 4px; font-weight: 600; }
.wizpicks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.wizpicks label { cursor: pointer; white-space: nowrap; }
.wizpicks button { min-width: 88px; }
.wizstep { max-width: 900px; }
.wizbtns button { min-width: 88px; }
button.primary:hover:not(:disabled) { filter: brightness(1.12); }
button.secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button.primary:disabled, button.secondary:disabled { opacity: .5; cursor: not-allowed; }
.pagehead .headactions { display: flex; align-items: center; gap: 10px; }
.wizsummary ul { margin: 6px 0 14px 20px; padding: 0; }
.grouptable .checkcol, .abstable .checkcol { width: 32px; }
.abstabs { display: flex; gap: 4px; list-style: none; margin: 0 0 12px; padding: 0; border-bottom: 1px solid var(--line); }
.abstabs a { display: block; padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-size: 14px; }
.abstabs a.current { color: var(--leather); font-weight: 600; border-bottom-color: var(--gold); }
.abstabs .count { color: var(--muted); font-weight: 400; }
.abstable td, .abstable th { padding: 6px 10px; text-align: left; vertical-align: top; }
.abstable td.rowact { text-align: right; white-space: nowrap; }
.rowgear { position: relative; display: inline-block; }
/* The row menu sits inside .tablewrap (overflow-x: auto clips it vertically), so it is fixed-positioned; the page
   script sets its top/left from the gear button's rectangle each time it opens. */
.rowgear .menu { position: fixed; right: auto; left: 0; top: 0; }
.abstate { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.abstate.s-submitted { color: var(--accent); background: var(--tint); border-color: var(--tint-line); }
.abstate.s-approved { color: #1a7a3c; background: #e6f4ea; border-color: #b9dcc4; }
.abstate.s-denied { color: #a3271f; background: #fbeceb; border-color: #e8b9b5; }
.absflag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; color: #7a4b00; background: #fff1d6; border: 1px solid #f0cf8f; }
.absalert { margin: 0 0 12px; padding: 10px 12px; background: #fff1d6; border: 1px solid #f0cf8f; border-radius: 6px; color: #7a4b00; font-size: 14px; }
.abstable tr.hasconflict { background: #fffaf0; }
.envbanner { display: inline-block; padding: 8px 14px; border-radius: 6px; font-weight: 600; }
.envbanner.env-test { color: var(--accent); background: var(--tint); border: 1px solid var(--tint-line); }
.envbanner.env-prod { color: #fff; background: #a3271f; border: 1px solid #7d1d17; }
.envlist { margin: 6px 0 18px 20px; padding: 0; font-size: 13px; color: var(--muted); }
.confirmDialog ul { margin: 6px 0 12px 18px; padding: 0; max-height: 220px; overflow: auto; font-size: 13px; }

.envwarn { margin: 0 0 14px; padding: 10px 14px; background: #fff1d6; border: 2px solid #e0a82e; border-radius: 6px; color: #5c3a00; font-size: 14px; }
.envwarn strong { letter-spacing: 0.02em; }

/* ---- shared people search (js/person-search.js) ---- */
.psearch { position: relative; max-width: 560px; }
.psearch .ps-q { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--bg); color: inherit; }
.psearch .ps-tagrow { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.psearch .ps-taglabel { color: var(--muted); font-size: 13px; white-space: nowrap; }
.psearch .ps-tagbox { position: relative; flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 32px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); cursor: text; }
.psearch .ps-chips { display: contents; }
.psearch .ps-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.psearch .ps-chipx { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 3px; color: var(--muted); }
.psearch .ps-chipx:hover { color: var(--accent); }
.psearch .ps-tagq { flex: 1; min-width: 120px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; color: inherit; cursor: pointer; }
.psearch .ps-menu { position: absolute; z-index: 30; left: 0; top: 100%; margin: 2px 0 0; padding: 4px 0; min-width: 160px; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.psearch .ps-menu li { padding: 6px 12px; cursor: pointer; }
.psearch .ps-menu li:hover { background: var(--panel); color: var(--accent); }
.psearch .ps-results { list-style: none; margin: 4px 0 0; padding: 0; max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.psearch .ps-item { padding: 6px 10px; cursor: pointer; }
.psearch .ps-item:hover, .psearch .ps-item.ps-active { background: var(--panel); }
.psearch .ps-item.ps-done { opacity: .55; }
.psearch .ps-mark { font-weight: 600; color: var(--accent); }
.psearch .ps-status { margin-top: 4px; min-height: 1.2em; }
.psearch .ps-staged { list-style: none; margin: 6px 0 0; padding: 0; }
.psearch .ps-stagedrow { padding: 3px 0; }
.psearch .ps-stagedrow .ps-leader { margin: 0 0 0 8px; color: var(--text, inherit); }
.psearch .ps-stagedrow .ps-unstage { margin-left: 18px; }
.linkish.dangerlink { color: #a3271f; }
.selectallnote { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin: 6px 0; }
.selectallnote button { margin-left: 4px; }
.rosterselbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 8px 0; }
.rosterselbar .status { margin: 0; }
.newgrouprow { display: block; margin: 0 0 12px; }
.newgroupfields { border-left: 3px solid var(--line); padding-left: 12px; margin: 0 0 12px; }
.field select { max-width: 100%; }
.gcattable .gcatmove button { padding: 2px 8px; margin-right: 4px; }
.gcattable td { vertical-align: middle; }
/* A group's Resources tab (V060). */
.reslist { list-style: none; margin: 0; padding: 0; }
.reslist .resitem { padding: 10px 0; border-bottom: 1px solid var(--line); }
.reslist .resitem:last-child { border-bottom: 0; }
.reslist .restitle { font-weight: 600; overflow-wrap: anywhere; }
.reslist .reshost { font-size: 12px; }
.reslist .resdesc { margin-top: 2px; }
.reslist .resacts { margin-top: 4px; }
.groupresadd { margin-top: 12px; }
.groupresadd summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.groupresform { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 12px; margin-top: 8px; }
.groupresform label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 2px; }
.groupresform .wide { grid-column: 1 / -1; }
.groupresform input { font: inherit; color: var(--ink); padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
/* Group adjustments (V055): hidden rows, sub-groups, archived groups. */
.tag.hiddentag { margin-left: 6px; }
.tag.subtag { margin-left: 6px; font-style: italic; }
.rostertable td .rowhidden { margin: 0 0 0 8px; }
.subgroups { margin: 0 0 14px; }
.subgrouplist { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.subgrouplist .tag { margin-left: 6px; }
.grouptable td.subgroupname { padding-left: 28px; }
.grouptable td.subgroupname::before { content: "\21B3  "; color: var(--muted); }
.grouptable .tag { margin-left: 6px; }
.groupsarchived { margin: 0 0 0 12px; }
.archivednote button { margin-left: 8px; }

.psearch .ps-hit { background: #fff3a8; color: inherit; padding: 0; }
.psearch .ps-menu .ps-none { color: var(--muted, #666); cursor: default; }

/* Permissions > Users tab */
.userfilters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0; }
.userfilters input[type=search] { min-width: 260px; }
.userfilters label { font-size: 13px; color: var(--muted); }
.usertoolbar { margin-top: 16px; }
.usertoolbar > select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.usertoolbar .gearwrap { margin-left: 2px; }
.rostertable td.nocheck { color: var(--muted); }
.usertable td.name a { font-weight: 600; }
.rolechip-name { border: 0; background: none; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; }
.rolechip-name:hover { text-decoration: underline; color: var(--accent); }

/* ---- profile menu (js/gc.js) and landing page tiles (home.html) ---- */
.whoami[hidden], #logoutForm[hidden] { display: none; }
.profmenu { position: relative; }
.profbtn { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--accent); color: #fff; cursor: pointer; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; font: inherit; }
.profbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.profinit { font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.profimg { width: 100%; height: 100%; object-fit: cover; }
.profpanel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 200px; padding: 4px 0; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.profpanel[hidden] { display: none; }
.profhead { display: flex; flex-direction: column; padding: 8px 14px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.profsub { color: var(--muted); font-size: 12px; }
.profitem { display: block; width: 100%; box-sizing: border-box; padding: 8px 14px; text-align: left; background: none; border: 0; font: inherit; font-size: 14px; color: var(--ink); text-decoration: none; cursor: pointer; }
.profitem:hover, .profitem:focus { background: var(--panel); color: var(--accent); outline: none; }

.homehead { margin: 4px 0 14px; font-size: 22px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.tile { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 12px 16px 14px; min-height: 140px; }
.tile .tilehead { margin: 0 0 8px; font-size: 16px; }
.tile .tilehead a { color: var(--accent); text-decoration: none; }
.tile .tilehead a:hover { text-decoration: underline; }
.tilelist { list-style: none; margin: 0 0 8px; padding: 0; }
.tilelist li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tilelist li:last-child { border-bottom: 0; }
.tilelist a { color: var(--ink); text-decoration: none; }
.tilelist a:hover { color: var(--accent); }
.tilenote { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tileempty { color: var(--muted); font-size: 13px; margin: 0; }
.tileall { font-size: 13px; color: var(--accent); }
.tile-disabled { background: var(--panel); opacity: .7; }
/* Zoom tile (zoom-tile.js) */
.zoomvm { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.zoomvm-count { font-size: 22px; font-weight: 700; margin-right: 2px; }
.zoomvm-new { color: var(--ink); }
.zoomvm-new .zoomvm-count { color: #a3271f; }
.zoomactions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.tile-disabled .tilehead { color: var(--muted); }

.profiledl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.profiledl dt { color: var(--muted); }
.profiledl dd { margin: 0; }
.permlist { columns: 2 220px; font-size: 13px; }

@media (max-width: 640px) {
    .tiles { grid-template-columns: 1fr; }
    .profpanel { position: fixed; right: 8px; top: 52px; }
}

/* --- Community page: selected people, result "+" buttons, row gears (search.js, person-search.js, app.js, contacts.js) --- */
.commlayout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 20px; align-items: start; }
.commlayout[hidden] { display: none; }
.selpanel { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 10px 14px 12px; }
.selhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.selhead h2 { font-size: 16px; margin: 0; }
.sellist { list-style: none; margin: 8px 0 0; padding: 0; max-height: 420px; overflow-y: auto; }
.selrow { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.selrow .selname { color: var(--ink); text-decoration: none; font-weight: 600; }
.selrow .selname:hover { color: var(--accent); text-decoration: underline; }
.selrow .ps-mark { font-weight: 600; color: var(--accent); }
.selx { margin-left: auto; border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; color: var(--muted); }
.selx:hover { color: #a3271f; }
.sendas-shared { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
.selfoot { margin: 8px 0 0; font-size: 13px; }
.psearch .ps-item { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.psearch .ps-add { flex: 0 0 auto; width: 24px; height: 24px; margin-right: 6px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); color: var(--accent); font-size: 16px; line-height: 1; cursor: pointer; }
.psearch .ps-add:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }
.psearch .ps-add.ps-added, .psearch .ps-add:disabled { color: #1a7a3c; border-color: #b9dcc4; background: #e6f4ea; cursor: default; }
.col-gear { display: flex; justify-content: flex-end; }
.col-gear .gearbtn { width: 30px; height: 30px; font-size: 16px; }
.studentlist-head, .studentrow { grid-template-columns: 28px 90px 1fr 1fr 70px 1fr 40px; }
.contactlist-head, .contactrow { grid-template-columns: 28px 110px 1fr 1fr 40px; }
.pgear.rowgear .menu { position: fixed; right: auto; left: 0; top: 0; }
@media (max-width: 760px) {
    .commlayout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .studentrow .col-gear { order: -1; margin-left: auto; flex: 0 0 auto; }
}

/* Profile page: two-column key/value grid on desktop, one column on phones. */
.profilegrid { grid-template-columns: max-content 1fr max-content 1fr; }
.permdetails { margin-top: 16px; }
.permdetails summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
@media (max-width: 640px) {
    .profilegrid { grid-template-columns: max-content 1fr; }
}

/* Messages tabs: delivery problems and suppression list */
.searchrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.dlvsummary { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.dlvstat { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 8px 14px; min-width: 96px; }
.dlvstat .n { display: block; font-size: 22px; font-weight: 600; }
.dlvstat .l { display: block; font-size: 12px; color: var(--muted); }
.dlvstat.bad .n { color: #a3271f; }
.dlvbanner { border: 1px solid var(--warn-line); background: var(--warn-bg); padding: 8px 12px; border-radius: 6px; margin: 0 0 12px; }
.dlvbanner.error { border-color: #d9a29d; background: #fbeceb; color: #7d1d17; }
.dlvchip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.dlvchip-hard { background: #fbeceb; color: #a3271f; border-color: #d9a29d; }
.dlvchip-soft { background: #fdf6e3; color: #8a6414; border-color: #e0cfa0; }
.dlvchip-complaint { background: #f1e8f7; color: #5b2a86; border-color: #cdb6e0; }
.dlvchip-unsub { background: var(--tint); color: var(--accent); border-color: var(--tint-line); }
.dlvchip-manual { background: var(--panel); color: var(--muted); border-color: var(--line); }
tr.suppressedremoved td { color: var(--muted); background: var(--panel); }
tr.suppressedremoved td:first-child { text-decoration: line-through; }

/* Integrations > Credentials: the list of systems beside the selected system's settings. */
.split { display: flex; gap: 24px; align-items: flex-start; }
.syslist { flex: 0 0 15em; position: sticky; top: 8px; }
.syslist ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border, #ccc); border-radius: 6px; overflow: hidden; }
.syslist li + li { border-top: 1px solid var(--border, #ccc); }
.sysbtn { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left;
    padding: 9px 12px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.sysbtn:hover { background: rgba(0, 0, 0, .05); }
.sysbtn.current { font-weight: 600; background: var(--bg, #fff); box-shadow: inset 3px 0 0 var(--gold); }
.sysdot { display: inline-block; min-width: 1.3em; height: 1.3em; line-height: 1.3em; text-align: center;
    border-radius: 50%; background: #a3271f; color: #fff; font-size: .8em; font-weight: 700; }
.syspanel { flex: 1 1 auto; min-width: 0; }
.syspanel h2:first-child { margin-top: 0; }
@media (max-width: 760px) {
    .split { flex-direction: column; }
    .syslist { position: static; flex-basis: auto; width: 100%; }
}

/* Keep the settings panel inside the window: long keys and inputs wrap instead of pushing the page wider. */
.syspanel { max-width: 100%; overflow-x: auto; }
.syspanel table.creds { table-layout: fixed; width: 100%; }
.syspanel table.creds td { overflow-wrap: anywhere; }
.syspanel table.creds td:nth-child(1) { width: 30%; }
.syspanel table.creds td:nth-child(2) { width: 16%; }
.syspanel table.creds td:nth-child(3) { width: 54%; }
.syspanel table.creds input { min-width: 0; width: 100%; max-width: 28em; box-sizing: border-box; margin: 0 0 4px 0; }
.syspanel table.creds td:nth-child(3) button { margin: 0 .3em 4px 0; }
.syspanel textarea, .syspanel select { max-width: 100%; }
@media (max-width: 1000px) {
    .syspanel table.creds td:nth-child(1) { width: 34%; }
    .syspanel table.creds td:nth-child(2) { width: 18%; }
    .syspanel table.creds td:nth-child(3) { width: 48%; }
}

/* ===== Buttons: one look everywhere (primary = filled, secondary = outlined, danger = red outline) =====
   Link-style actions inside table rows use .linkish; menu items, gear buttons and chips have their own styles. */
button.primary, button.secondary, button.dangerbtn, button.danger:not([role="menuitem"]), a.button, a.buttonlike {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    box-sizing: border-box; min-height: 34px; padding: 0 16px;
    border: 1px solid var(--accent); border-radius: 6px;
    background: var(--accent); color: #fff;
    font: inherit; font-size: 14px; line-height: 1.2; text-decoration: none; cursor: pointer;
}
a.button { padding: 0 22px; min-height: 40px; font-weight: 600; }
button.secondary, a.buttonlike { background: var(--bg); color: var(--accent); }
button.dangerbtn, button.danger:not([role="menuitem"]) { background: var(--bg); color: #a3271f; border-color: #a3271f; }
button.dangerbtn:not(:disabled):hover, button.danger:not([role="menuitem"]):not(:disabled):hover { background: #a3271f; color: #fff; }
button.primary:hover:not(:disabled), a.button:hover { filter: brightness(1.12); }
button.secondary:hover:not(:disabled), a.buttonlike:hover { background: var(--panel); }
button.primary:disabled, button.secondary:disabled, button.dangerbtn:disabled, button.danger:not([role="menuitem"]):disabled { opacity: .5; cursor: not-allowed; }
button.primary:focus-visible, button.secondary:focus-visible, button.dangerbtn:focus-visible, a.button:focus-visible,
a.buttonlike:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pager button { font-size: 13px; }
.search button { margin: 0; }

/* Roster download pop-up */
.exportset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 12px; padding: 8px 12px 10px; }
.exportset legend { font-weight: 600; font-size: 13px; padding: 0 6px; }
.exportrow { display: block; margin: 4px 0; }
.exportrow input { margin-right: 4px; }

/* Group import pop-up */
.importdlg { max-width: 640px; }
.importcsv { margin: 4px 0 10px 22px; }
.importcsv > * { margin-bottom: 6px; }
.importpreview { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); max-height: 280px; overflow: auto; }
.importpreview h3 { font-size: 13px; margin: 10px 0 2px; }
.importpreview ul { max-height: none; margin: 2px 0 6px 18px; }

/* ---- Calendar page and tiles ---- */
.calmain { max-width: 1200px; }
.calbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 8px; }
.calbar h1 { margin: 0; }
.calnav { display: flex; align-items: center; gap: 6px; }
.calnav button { min-width: 34px; padding: 0 10px; }
.calrange { margin-left: 8px; }
.calactions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.calsubjects { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 10px; font-size: 14px; }
.calweek { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: auto; background: var(--bg); }
.calcorner { border-bottom: 1px solid var(--line); background: var(--panel); }
.calalllabel { font-size: 11px; color: var(--muted); padding: 4px; text-align: right; }
.calhead { text-align: center; padding: 6px 2px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--panel); }
.calhead .calday { display: block; font-size: 12px; color: var(--muted); }
.calhead .caldate { font-size: 20px; }
.calhead.caltoday .caldate { background: var(--accent); color: #fff; border-radius: 50%; display: inline-block; min-width: 32px; line-height: 32px; }
.calallday { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 2px; min-height: 26px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.caltoday { background: #fbf6ea; }
.calhours { position: relative; }
.calhour { position: absolute; right: 4px; font-size: 11px; color: var(--muted); transform: translateY(-7px); }
.calcol { position: relative; border-left: 1px solid var(--line); min-width: 0; }
.calline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.calblock { position: absolute; display: block; text-align: left; overflow: hidden; border: 1px solid rgba(0,0,0,.2); border-radius: 4px; padding: 2px 4px; font: inherit; font-size: 12px; line-height: 1.25; color: #fff; background: var(--accent); cursor: pointer; }
.calblock strong, .calblock .calwhen { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calblock .calwhen { font-size: 11px; opacity: .9; }
.cal-chip { display: block; text-align: left; border: 0; border-radius: 4px; padding: 2px 6px; font: inherit; font-size: 12px; color: #fff; background: var(--accent); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-school { background: var(--cedar); }
.cal-course { background: var(--accent); }
.cal-group { background: var(--ash4); }
.cal-class { background: var(--accent); }
.calfoot { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; margin-top: 12px; font-size: 14px; }
.calkey .cal-chip { display: inline-block; }
.calnote { white-space: pre-wrap; }
.calitems li { align-items: baseline; }
.calitems li.cal-school, .calitems li.cal-course, .calitems li.cal-group { background: none; color: inherit; border-left: 4px solid; padding-left: 8px; }
.calitems li.cal-school { border-left-color: var(--cedar); }
.calitems li.cal-course { border-left-color: var(--accent); }
.calitems li.cal-group { border-left-color: var(--ash4); }
@media (max-width: 700px) { .calweek { grid-template-columns: 40px repeat(7, minmax(80px, 1fr)); } }

.roleselect { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.roleselect select { min-width: 260px; max-width: 100%; }

/* ---- Brand touches: gold focus ring, gold underline on headings, Leather primary buttons ---- */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
main > h1:first-child { padding-bottom: 6px; border-bottom: 2px solid var(--gold); display: inline-block; color: var(--leather); }
button.primary:hover:not(:disabled), a.button:hover { filter: none; background: #5e3624; border-color: #5e3624; }
button.secondary { color: var(--leather); border-color: var(--leather); }
button.secondary:hover:not(:disabled), a.buttonlike:hover { background: var(--tint); border-color: var(--leather); color: var(--leather); }
.tile .tilehead a, .tileall { color: var(--leather); }
.tile { border-top: 3px solid var(--gold); }

/* ---- SMS pop-up (shares the email pop-up's layout) ---- */
.smsbody { width: 100%; min-height: 160px; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 6px; resize: vertical; }
.smscounter { text-align: right; }
.smsrecent { margin-top: 12px; font-size: 13px; }
.smsrecentrow { padding: 6px 0; border-bottom: 1px solid var(--line); }
.numberchoice { display: block; margin: 4px 0; }
/* SMS opt-in pop-up and the public program page (js/sms-program.js, sms-info.html) */
.smsprogram p { margin: 0 0 8px; font-size: 13px; line-height: 1.45; }
.confirmDialog.smsoptin { max-height: 92vh; overflow-y: auto; }
.smsinfo { max-width: 720px; margin: 6vh auto 40px; padding: 0 16px; }
.smsinfo h1 { color: var(--leather); }
.switchrow { display: block; line-height: 1.5; }
.smscatrow { display: block; margin-top: .5rem; }
.smscatrow select { margin-left: .5rem; max-width: 100%; }
.smscats { border: 0; padding: 0; margin: .5rem 0; }
.smscats label { display: block; line-height: 1.6; }
.smscats .smscatall { font-weight: 600; }
.smscats .smscatone { margin-left: 1.5rem; }

/* Community: expandable record cards with tiles */
.pcards { margin-top: 16px; display: grid; gap: 12px; }
.pcard { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.pcard > summary { cursor: pointer; padding: 10px 14px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-weight: 600; }
.pcard > summary .pcard-link { margin-left: auto; font-weight: 400; font-size: 0.9em; }
.pcard > summary .pcard-gear { margin-left: 6px; font-weight: 400; }
.pcard[open] > summary { border-bottom: 1px solid var(--line); background: var(--panel); border-radius: 8px 8px 0 0; }
.ptiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; padding: 12px 14px 14px; }
.ptile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg); min-width: 0; }
.ptile.wide { grid-column: 1 / -1; }
/* Grid items default to min-width:auto, which let a wide schedule table push the card past the results column. */
.pcards > *, .ptiles > *, .commsearch { min-width: 0; }
.ptablewrap { max-width: 100%; overflow-x: auto; }
.ptablewrap .ptable td { overflow-wrap: anywhere; }
/* Details with the short lists (groups, parents / students) beside it; stacked when the card is narrow. */
.ptiles { container-type: inline-size; }
.ptoprow { grid-column: 1 / -1; display: grid; gap: 12px; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
.ptoprow[data-count="2"] { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.ptoprow[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
@container (max-width: 640px) { .ptoprow, .ptoprow[data-count="2"] { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .ptoprow, .ptoprow[data-count="2"] { grid-template-columns: minmax(0, 1fr); } }
.pcard > summary .pcard-add { margin-right: 8px; width: 26px; height: 26px; padding: 0; border: 1px solid var(--line);
    border-radius: 50%; background: var(--bg); color: var(--accent); font-size: 17px; line-height: 1; cursor: pointer; flex: none; }
.pcard > summary .pcard-add:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }
.pcard > summary .pcard-add.ps-added, .pcard > summary .pcard-add:disabled { color: #1a7a3c; border-color: #b9dcc4; background: #e6f4ea; cursor: default; }

/* Course roster (course.html): sortable headers, the Grade column toggle, and the + before each name. */
.rostertable2 th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.rostertable2 th.sortable:hover { color: var(--accent); }
.rostertable2 th.sortable::after { content: "\2195"; margin-left: 4px; font-size: 0.8em; opacity: 0.35; }
.rostertable2 th[aria-sort="ascending"]::after { content: "\25B2"; opacity: 0.9; }
.rostertable2 th[aria-sort="descending"]::after { content: "\25BC"; opacity: 0.9; }
.rostertable2 th.addcol, .rostertable2 td.addcol { width: 34px; padding-right: 0; }
.rostertable2 .pcard-add { width: 24px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--bg);
    color: var(--accent); font-size: 16px; line-height: 1; cursor: pointer; }
.rostertable2 .pcard-add:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }
.rostertable2 .pcard-add.ps-added, .rostertable2 .pcard-add:disabled { color: #1a7a3c; border-color: #b9dcc4; background: #e6f4ea; cursor: default; }
.rostertable2 td.rostername a { font-weight: 600; }
@media print { .rostertable2 th.sortable::after { content: none; } }

/* Group roster: the optional Email / Counselor / Grade columns, sortable headings, the small filter button on each
   optional heading and its pop-up (group-roster-cols.js). */
.rostertable th[hidden] { display: none; }
.rostertable th .rcsort { background: none; border: 0; padding: 0; font: inherit; font-weight: inherit; color: inherit;
    text-transform: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
.rostertable th.rc-email, .rostertable th.rc-counselor, .rostertable th.rc-grade { white-space: nowrap; }
.rostertable th .rcsort:hover { color: var(--accent); }
.rostertable th .rcsort::after { content: "\2195"; margin-left: 4px; font-size: 0.8em; opacity: 0.35; }
.rostertable th[aria-sort="ascending"] .rcsort::after { content: "\25B2"; opacity: 0.9; }
.rostertable th[aria-sort="descending"] .rcsort::after { content: "\25BC"; opacity: 0.9; }
.rostertable th .rcfilter { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
    margin-left: 4px; padding: 0; vertical-align: middle; border: 1px solid transparent; border-radius: 4px;
    background: none; color: var(--muted); cursor: pointer; }
.rostertable th .rcfilter:hover { color: var(--accent); border-color: var(--line); }
.rostertable th .rcfilter.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.rostertable td.rc-grade, .rostertable th.rc-grade { white-space: nowrap; }
#rosterColPick .colpickmenu { left: 0; right: auto; min-width: 160px; }
.rcsummary { margin: 0 0 8px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rcsummary[hidden] { display: none; }
.rcchip { display: inline-flex; align-items: center; gap: 4px; }
.rcchipx { background: none; border: 0; padding: 0 2px; font-size: 15px; line-height: 1; cursor: pointer; color: inherit; }
.rcdialog { width: min(360px, calc(100vw - 32px)); box-sizing: border-box; }
.rcdialog .field { display: block; margin: 8px 0; }
.rcdialog .rcemail { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.rcdialog .rclive { display: block; margin: 4px 0 0; }
.rcdialog .rcquick { margin: 4px 0 6px; font-size: 13px; }
.rcdialog .rcpicklist { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 0; }
.rcdialog .confirmButtons .spacer { flex: 1; }
@media (pointer: coarse) { .rostertable th .rcfilter { width: 36px; height: 36px; } }
@media (max-width: 760px) { .rcdialog .rcemail { font-size: 16px; } }
@media print { .rostertable th .rcsort::after { content: none; } .rostertable th .rcfilter, #rosterColPick { display: none; } }

/* Community: the Selected people heading opens the first full record. */
.selhead a.selopen { color: inherit; text-decoration: none; }
.selhead a.selopen[href] { color: var(--accent); cursor: pointer; }
.selhead a.selopen[href]:hover { text-decoration: underline; }

/* The full record page (person.html): ‹ name ▾ › in the upper left, then name, actions and photo, then the tiles. */
.selnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.selnav[hidden] { display: none; }
.selnav button.navarrow { min-width: 36px; min-height: 34px; padding: 0 10px; font-size: 20px; line-height: 1; }
.selnav select { min-height: 34px; max-width: min(28em, 100%); padding: 4px 8px; border: 1px solid var(--box-line, var(--line));
    border-radius: 6px; font: inherit; background: var(--bg); color: inherit; }
.selnav .selpos { font-size: 0.9em; margin-left: 4px; }
.recordhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.recordhead[hidden] { display: none; }
.recordtitle { min-width: 0; }
.recordname { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.recordname h1 { margin: 0; }
.recordtitle > p { margin: 4px 0 0; }
.recordhead .pcard-add { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--bg);
    color: var(--accent); font-size: 18px; line-height: 1; cursor: pointer; flex: none; }
.recordhead .pcard-add:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }
.recordhead .pcard-add.ps-added, .recordhead .pcard-add:disabled { color: #1a7a3c; border-color: #b9dcc4; background: #e6f4ea; cursor: default; }
.recordphoto { flex: none; margin: 0; padding: 4px; background: #fff; border: 1.5px solid var(--box-line, var(--line)); border-radius: 8px;
    box-shadow: 0 1px 4px rgba(60, 40, 20, 0.18); }
.recordphoto[hidden] { display: none; }
.recordphoto img { display: block; width: 130px; height: 162px; object-fit: cover; border-radius: 5px; }
.recordpage .ptiles { padding: 0; }
@media (max-width: 640px) {
    .recordphoto img { width: 88px; height: 110px; }
}
.ptile h3 { margin: 0 0 8px; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.pdl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
.pdl dt { color: var(--muted); }
.pdl dd { margin: 0; overflow-wrap: anywhere; }
.ptable { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.ptable th, .ptable td { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); }
.ptable th { color: var(--muted); font-weight: 600; }
.plist { margin: 0; padding-left: 18px; }
.ptile h3 .ptile-day { margin-left: 10px; text-transform: none; letter-spacing: 0; font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.ptile h3 .ptile-date { margin-left: 12px; max-width: 100%; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px;
    background: var(--bg); color: var(--ink); font-family: inherit; font-size: 0.9rem; font-weight: 400;
    text-transform: none; letter-spacing: 0; vertical-align: middle; }
@media (max-width: 760px) { .ptile h3 .ptile-date { font-size: 16px; margin: 6px 0 0; display: block; } }
.ptile h3 .ptile-term { float: right; font-size: 0.85rem; text-transform: none; letter-spacing: 0; }
.importpaste { margin: 4px 0 10px 22px; }
.importpaste textarea { width: 100%; box-sizing: border-box; font: inherit; }
.mailwhen { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
/* Import members: compact layout */
.importdlg { max-height: 92vh; overflow-y: auto; }
.importdlg h2 { margin-bottom: 8px; }
.importrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.importrow select { flex: 1; }
.importdlg .importpaste, .importdlg .importcsv, .importdlg .importgroup { margin: 0 0 8px; }
.importdlg .importcsv { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.importdlg .importline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.importdlg .importgroup select { width: 100%; }
.importdlg .importnote { margin: 0 0 6px; font-size: 0.9em; }
.importdlg .importpreview { max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; }
.importdlg .importpreview h3 { margin: 8px 0 2px; font-size: 0.85rem; }
.importdlg .importpreview ul { margin: 0; padding-left: 18px; }
.importdlg .importpreview p { margin: 0 0 4px; }
.importdlg [hidden] { display: none !important; }
.pgradehist { margin-top: 8px; }
.pgradehist summary { cursor: pointer; color: var(--muted); }
.pgradebar { display: block; margin: 0 0 8px; }
.profviewas .profviewhead { padding: 6px 12px 2px; }
.profviewas .profwhy { padding: 0 12px 6px; font-size: 0.8em; }
.profviewas button[disabled] { opacity: 0.6; cursor: not-allowed; }
.pviewas { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 0.92em; }
.tile .tilesub { font-size: 0.85rem; margin: 8px 0 2px; color: var(--muted); }
.smsprogram p a { overflow-wrap: anywhere; }
.numberchoice button.primary { margin-left: 6px; }

/* Links: one site-wide look for every ordinary link (leather, no underline until hover, no purple "visited").
   Zero-specificity (:where) so any component's own link style (nav, tabs, tiles, buttons) still wins. */
:where(a) { color: var(--accent); }
:where(a):visited { color: var(--accent); }
:where(main, dialog, .impersonation-banner) :where(a:not(.button, .buttonlike)) { text-decoration: none; }
:where(main, dialog, .impersonation-banner) :where(a:not(.button, .buttonlike)):hover { text-decoration: underline; }
/* Names in tables (group roster, people lists) read like the group links: bold. */
.grouptable td.name a, .ptable td a { font-weight: 600; }
/* Profile: tiles, information and sign-in side by side, SMS full width below */
.proftiles { margin: 8px 0 16px; }
.proftiles .tile { min-height: 0; }
.proftiles .tile.wide { grid-column: 1 / -1; }
.proftiles .tile p { margin: 6px 0; }
.proftiles .profiledl { gap: 4px 14px; font-size: 14px; }
.proftiles .proftilenote { font-size: 12px; margin-top: 10px; }
.proftiles .permlist { margin: 0; }
/* SMS opt-in pop-up: same tile look as the Profile page */
.confirmDialog.smsoptin .smsoptintiles { margin: 8px 0 10px; gap: 10px; }
.confirmDialog.smsoptin h2 { margin: 4px 0 6px; }
.confirmDialog.smsoptin .smsprogram > p:first-child { margin-top: 0; }
.confirmDialog.smsoptin .tile .tilehead { font-size: 14px; margin-bottom: 4px; }
.confirmDialog.smsoptin .tile p { margin: 4px 0; font-size: 14px; }
.confirmDialog.smsoptin .smsprogram p { font-size: 13px; margin: 0 0 6px; }
.confirmDialog.smsoptin .smsoptinbox { min-height: 0; margin: 6px 0 10px; padding: 10px 14px; }
.confirmDialog.smsoptin .smsoptinbox p { margin: 4px 0; font-size: 14px; }
.confirmDialog.smsoptin .smsoptinbox .smsprogram { margin: 6px 0; padding-top: 6px; border-top: 1px solid var(--line); }
.confirmDialog.smsoptin .smsoptinbox .smsprogram p { font-size: 13px; margin: 0 0 4px; }
.confirmDialog.smsoptin .smsoptinbox > p:last-of-type { padding-top: 6px; border-top: 1px solid var(--line); }
/* My devices: Contact support */
.tile .tilefoot { margin: 10px 0 0; }
.supportdlg .supportbox { min-height: 0; padding: 10px 14px; margin: 6px 0 10px; }
.supportdlg .field { display: block; margin: 8px 0; }
.supportdlg .field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.supportdlg input[type="text"], .supportdlg textarea { width: 100%; box-sizing: border-box; font: inherit; }
.supportdlg .supportfiles { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.iiqdetail { max-height: 360px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
    padding: 10px 12px; font-size: 12px; white-space: pre-wrap; }
/* Integrations > Engines: the Incident IQ card's parent-sync section */
.destcard .iiqsyncbox { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.destcard .iiqsyncbox h3 { margin: 0 0 6px; font-size: 15px; }
.destcard .iiqsyncbox button { margin-right: 8px; }
.optionsrow table.iiqhist { width: 100%; border-collapse: collapse; font-size: 13px; }
.optionsrow table.iiqhist th, .optionsrow table.iiqhist td { text-align: left; padding: 3px 8px 3px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.optionsrow table.iiqhist .iiqdetail { margin: 4px 0 8px; }

/* Integrations > Engines: same look as the rest of the site (leather headings and links, compact buttons in rows). */
.destcard h2 { color: var(--leather); }
.destcard td { vertical-align: middle; }
.destcard .enginename { font-weight: 600; font-size: 13px; }
.destcard td.nw button.secondary { min-height: 28px; padding: 0 12px; font-size: 13px; margin-left: 4px; }
.destcard .optionsrow td { background: var(--panel); }
.cronpick select, .cronpick input { margin-right: 2px; }
.cronpick .cronmin { width: 4em; }
.cronpick [hidden] { display: none !important; }
.optionsrow .schedline { margin-bottom: 6px; }
tr.jobwanted td { background: var(--tint); }
tr.jobwanted + tr.jobsub td { background: var(--tint); }
/* Group boards */
.boardcompose { min-height: 0; margin-bottom: 14px; }
.boardcompose input[type="text"] { width: 100%; box-sizing: border-box; font: inherit; margin-bottom: 6px; }
.boardtools { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.boardtools button { font: inherit; font-size: 13px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); cursor: pointer; }
.boardeditor { min-height: 110px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--bg); }
.boardeditor:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.boardactions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; }
.boardposts { display: grid; gap: 12px; }
.boardpost { min-height: 0; }
.boardpost.ispinned { border-color: var(--tint-line); background: var(--tint); }
.boardpost.ishidden, .boardcomment.ishidden { opacity: .6; }
.boardposthead { display: flex; align-items: baseline; gap: 8px; }
.boardpin { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--cedar); }
.boardby { font-size: 12px; margin: 0 0 6px; }
.boardbody { overflow-wrap: anywhere; }
.boardbody p { margin: 0 0 8px; }
.boardacts { font-size: 13px; margin: 4px 0; }
.boardcomments { margin-top: 10px; border-top: 1px solid var(--line); }
.boardcomment { padding: 6px 0 6px 12px; border-bottom: 1px solid var(--line); }
.boardcommenttext { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.boardcommentform { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.boardcommentform textarea, .boardcomment textarea { flex: 1; width: 100%; box-sizing: border-box; font: inherit; }
.newbadge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 9px; font-size: 11px; font-weight: 700;
    background: var(--gold); color: var(--leather); vertical-align: middle; }
.boardsbox { min-height: 0; margin-bottom: 14px; }
.titleblock #boardLink { margin-left: 10px; }
#dashTab, #rosterTab { margin-top: 12px; }
.boardtoolbar { margin-bottom: 4px; }
.boardeditor a { color: var(--accent); text-decoration: underline; }
/* Board: posts on the left, the editor on the right (laptop); stacked on a phone, editor first. */
.boardlayout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: 18px; align-items: start; }
.boardlayout.noeditor { grid-template-columns: minmax(0, 1fr); }
.boardlayout .boardcol { min-height: 420px; padding: 16px 20px 18px; }
.boardlayout .boardcompose { position: sticky; top: 12px; margin-bottom: 0; }
.boardlayout .boardcompose .boardeditor { min-height: 260px; }
.boardlayout .boardpostscol .boardposts .tile { box-shadow: none; }
@media (max-width: 900px) {
    .boardlayout { grid-template-columns: minmax(0, 1fr); }
    .boardlayout .boardcompose { order: -1; position: static; }
    .boardlayout .boardcol { min-height: 0; }
    .boardlayout .boardcompose .boardeditor { min-height: 140px; }
}
main.boardmain { max-width: 1320px; }
/* Board: a post's calendar date; the group Calendar tab */
.boardcalcheck { display: block; margin: 8px 0 4px; }
.boardcal { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px 10px; margin-bottom: 6px; }
.boardcal label, .groupcalform label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 2px; }
.boardcal .wide, .groupcalform .wide { grid-column: 1 / -1; }
.boardcal input, .groupcalform input, .groupcalform textarea { font: inherit; color: var(--ink); }
.boardevent { font-size: 13px; font-weight: 600; color: var(--cedar); margin: 0 0 6px; }
.groupcal { min-height: 0; }
.groupcalhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.groupcalnav { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.groupcalday { font-size: 14px; margin: 12px 0 4px; color: var(--leather); }
.groupcalitems { list-style: none; margin: 0; padding: 0; }
.groupcalitems li { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); align-items: start; }
.groupcaltime { font-size: 13px; color: var(--muted); }
.groupcaldesc { font-size: 13px; white-space: pre-wrap; color: var(--ink); }
.groupcaladd { margin-top: 12px; }
.groupcaladd summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.groupcalform { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; margin-top: 8px; }
@media (max-width: 600px) { .groupcalitems li { grid-template-columns: 1fr; } }
.calgroups { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
.calgroups h2 { font-size: 16px; color: var(--leather); margin: 0 0 4px; }
.calgrouplist { list-style: none; padding: 0; margin: 6px 0 0; }
.calgrouplist li { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.calgroupstate { margin-left: 4px; font-size: 13px; }
.calswatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.groupcalgoogle { margin: 6px 0 10px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 6px; background: var(--panel); }
.groupcalgoogle p { margin: 4px 0; }
.gcacts { display: flex; gap: 8px; flex-wrap: wrap; }
.gcconnect input[type="url"] { width: 100%; box-sizing: border-box; font: inherit; margin: 6px 0; }
.gcbadge { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 9px; font-size: 11px; font-weight: 600;
    background: #e8f0fe; color: #1a5fb4; vertical-align: middle; }
.gcsteps { margin: 4px 0 6px; padding-left: 20px; font-size: 14px; }
.gcsteps li { margin: 2px 0; }

/* ===== Photos (avatars) ===== */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%;
    overflow: hidden; background: var(--tint, #f3ede6); color: var(--leather); font-weight: 600; vertical-align: middle;
    border: 1px solid var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard summary .avatar { margin-right: 10px; }
.portalname { display: flex; align-items: center; gap: 10px; }
label.buttonlike { display: inline-flex; align-items: center; min-height: 34px; padding: 0 16px; border: 1px solid var(--leather);
    border-radius: 6px; color: var(--leather); background: var(--bg); cursor: pointer; font-size: 14px; }
label.buttonlike:hover { background: var(--tint); }
.photopick { display: flex; flex-wrap: wrap; gap: 8px; }
.phototile { margin: 0 0 14px; min-height: 0; }
.phototile h2 { font-size: 16px; margin: 0 0 8px; color: var(--leather); }
.photobig { max-width: 240px; border-radius: 8px; border: 1px solid var(--line); }
.plist.cols { columns: 3 220px; font-size: 13px; }

/* ===== Attendance ===== */
.attdialog { max-width: 820px; }
.attbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; }
.attbar input, .attbar select { font: inherit; }
.attwrap { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.atttable { width: 100%; border-collapse: collapse; font-size: 14px; }
.atttable th { position: sticky; top: 0; background: var(--panel, #faf7f2); text-align: left; font-weight: 600; }
.atttable th, .atttable td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.atttable td.attpic { width: 40px; }
.atttable .attnum { font-size: 12px; }
.atttable select.attchoice { font: inherit; min-width: 140px; }
.atttable tr.absentrow { background: #fdf0ee; }
.attcode { display: inline-block; padding: 1px 6px; border-radius: 4px; background: #eef2f7; font-size: 13px; }
.attcode.locked { background: #fff4d6; }
.attstatus { font-size: 12px; max-width: 220px; }
.tileaction { margin-left: 8px; font-size: 12px; white-space: nowrap; }
td.num, th.num { text-align: right; }
td.strong { font-weight: 700; color: #a3271f; }
.attgrid { border-collapse: collapse; font-size: 14px; }
.attgrid th, .attgrid td { border: 1px solid var(--line); padding: 4px 10px; min-width: 34px; }
.attgrid thead th { background: var(--panel, #faf7f2); }
.attgrid td.num { text-align: center; }
.attgrid-totals th { text-align: left; background: var(--panel, #faf7f2); }
.attcell { font-weight: 600; }
.attcell.abs { color: #a3271f; }
.attcell.tardy { color: #8a5a00; }
.attcell.gconly { text-decoration: underline dotted; }
.portalatt { margin-top: 10px; }
@media print { .attgrid { font-size: 12px; } }
.daybar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; }
.daybar select { font: inherit; }
.daybar #postBtn { margin-left: auto; }
.rostertable2 td.attcol select { font: inherit; padding: 2px 4px; }
.rostertable2 tr.absentrow { background: #fdf0ee !important; }
/* The course Report tab: data centred under its heading, a line between columns. */
.reporttable th, .reporttable td { text-align: center; }
.reporttable th + th, .reporttable td + td { border-left: 1px solid var(--line); }
#attSummary > thead > tr > th:first-child, #attSummary > tbody > tr > td:first-child { text-align: left; }
@media print { .reporttable th + th, .reporttable td + td { border-left: 1px solid #999; } }
/* Stripes set per student row (the expander's detail rows would otherwise shift them). */
.reporttable tbody tr:nth-child(odd) { background: none; }
.reporttable tbody tr.stripe { background: var(--panel); }
.rowexpander { border: 0; background: none; padding: 0 6px 0 0; font-size: 14px; color: var(--muted); cursor: pointer; line-height: 1; }
.rowexpander:hover, .rowexpander:focus-visible { color: var(--accent); }
.reporttable tr.recrow > td { padding: 4px 16px 14px 40px; text-align: left; background: var(--bg); }
.reporttable .rectable { width: auto; min-width: 60%; border-collapse: collapse; font-size: 13px; }
.reporttable .rectable th, .reporttable .rectable td { text-align: left; border-left: none; padding: 5px 14px 5px 0;
    border-bottom: 1px solid var(--line); background: none; }
.reporttable .rectable th { font-size: 11px; color: var(--muted); }
.rectype.absent { color: #a3271f; font-weight: 600; }
.rectype.tardy { color: #8a5a00; font-weight: 600; }
/* Grade arrows: course Report tab and a student's schedule. */
.gradeup { color: #1a7a3c; font-weight: 700; margin-left: 4px; }
.gradedown { color: #a3271f; font-weight: 700; margin-left: 4px; }
.codestable td.codeyes { color: #1a7a3c; font-weight: 600; }
.codestable td.codecell { font-weight: 700; }
.attval { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 13px; }
.attval.present { color: #2e6b30; }
.attval.marked { background: #fdf0ee; color: #a3271f; font-weight: 600; }
.corrreason { font-weight: 600; color: var(--leather); }
/* Attendance comments: a bubble next to the code, a tip on hover/focus, a dialog to read and add. */
.attchoicewrap { display: inline-flex; align-items: center; gap: 2px; }
.attcomment { border: 0; background: none; padding: 2px 4px; margin-left: 2px; cursor: pointer; line-height: 0;
    vertical-align: middle; border-radius: 4px; }
.attcomment.has { color: #3b82f6; }
.attcomment.empty { color: var(--ash3); }
.attcomment.draft { color: #3b82f6; outline: 1px dashed #3b82f6; outline-offset: 1px; }
.attcomment:hover, .attcomment:focus-visible { background: var(--panel); }
.attcomment.empty:hover, .attcomment.empty:focus-visible { color: var(--accent); }
.commenttip { position: fixed; z-index: 1000; max-width: 340px; padding: 8px 12px; border-radius: 8px;
    background: rgba(60, 60, 60, .94); color: #fff; font-size: 14px; line-height: 1.4; white-space: pre-wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25); pointer-events: none; }
.noteexisting { margin: 0 0 12px; padding: 8px 10px; border-radius: 6px; background: var(--panel);
    border: 1px solid var(--line); white-space: pre-wrap; max-height: 40vh; overflow: auto; }
@media print { .attcomment, .commenttip { display: none !important; } }

/* The hidden attribute always wins. Without this, any rule that sets display (buttons, .daybar, tiles) shows an
   element the script has hidden: a "Take attendance" button with no handler, an empty day picker. */
[hidden] { display: none !important; }
/* Setup > Settings: only the chosen section shows in the right-hand panel. */
#setPanel > section.setoff { display: none; }
#setPanel > section > h2:first-child { margin-top: 0; }

/* ===== Boxes and tiles: a slightly heavier, darker edge so each box reads clearly (sitewide) ===== */
:root { --box-line: #cbc6c0; }   /* between Ash 1 and Ash 2 */
.tile, .ptile, .pcard, .selpanel, .destcard, .panel, .studentdetail, .studentrow .studentdetail, .docsDialog,
.confirmDialog, .mailDialog, .inboxmessage, .exportset, .calweek, .sendas-shared, .iiqdetail, .attwrap,
.syspanel > section, .integpanel {
    border-color: var(--box-line);
    border-width: 1.5px;
}
.pcard[open] > summary { border-bottom-color: var(--box-line); }

/* Safety net: an action button that was given no class at all still gets the standard dark-brown look.
   Menu items, chips and icon buttons all carry a class or role, so they are not affected. */
main button:not([class]):not([role]), dialog button:not([class]):not([role]) {
    display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 34px;
    padding: 0 16px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff;
    font: inherit; font-size: 14px; line-height: 1.2; cursor: pointer;
}
main button:not([class]):not([role]):disabled, dialog button:not([class]):not([role]):disabled { opacity: .5; cursor: not-allowed; }

/* ---- Integrations nav (integrations-nav.js) ---- */
/* Setup > Integrations: the System and View drop-downs that replaced the Engines / Runs / Schedules / Credentials tabs. */
.integtitle { margin-bottom: 8px; }
.integnav { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin: 0 0 18px; padding: 10px 14px;
    background: var(--panel, #faf7f2); border: 1px solid var(--line, #ccc); border-top: 3px solid var(--gold, #c9a227); border-radius: 6px; }
.integnav .integfield { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.integnav select { font: inherit; font-size: 15px; font-weight: 400; color: var(--ink, inherit); min-width: 14em; padding: 6px 8px;
    border: 1px solid var(--line, #ccc); border-radius: 6px; background: var(--bg, #fff); }
.integnav select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.integpanel { width: 100%; }
.integpanel .credsys + .credsys { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line, #ccc); }
.integpanel .credsys h2 { margin-top: 0; }
.integpanel .credsys h2 .sysdot { margin-left: 8px; }
.integpanel table.creds { width: 100%; }
@media (max-width: 640px) {
    .integnav { padding: 10px; }
    .integnav .integfield { flex: 1 1 100%; }
    .integnav select { width: 100%; min-width: 0; }
}

/* --- SMS opt-in reminder after sign-in (sms-reminder.js) --------------- */
.smsreminder p { font-size: 14px; line-height: 1.45; }
.smsreminder-changed { padding: 8px 10px; background: #fff6e0; border: 1px solid #ecd28f; border-radius: 6px; }
.smsreminder-buttons { flex-wrap: wrap; }

/* --- Admin > Reports (reports.html) ------------------------------------ */
.reportfilters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; margin: 0 0 12px; }
.reportfilters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.reportsummary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.reportsummary button { font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; }
.reportsummary button.current { border-color: currentColor; font-weight: 600; }

/* The public message-approval page (V056). */
.approvalpage { max-width: 720px; margin: 24px auto; padding: 0 16px; }
.approvalbody { white-space: pre-wrap; border-left: 4px solid var(--line, #ccc); padding: 8px 12px; margin: 12px 0;
    background: var(--tint, #f6f6f6); }
.approvalform { margin: 16px 0; }
.approvalform textarea { width: 100%; }
.approvalfiles { margin: 4px 0 12px; padding-left: 20px; }

/* ---- student accommodations (js/accommodations.js): the alert icon beside a name, and its pop-up ---- */
.accomicon {
    background: none;
    border: 0;
    padding: 0 2px;
    margin-left: 6px;
    color: #2f6db5;
    cursor: pointer;
    vertical-align: -3px;
    line-height: 0;
}
.accomicon:hover, .accomicon:focus-visible { color: #1d4f8a; }
.accomdialog { max-width: 460px; width: calc(100% - 32px); }
.accomdialog .accomhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.accomdialog .accomhead h2 { margin: 0; }
.accomdialog h3 { font-size: 15px; margin: 14px 0 6px; }
.accomdialog ul { margin: 6px 0 12px 20px; padding: 0; max-height: none; font-size: 14px; }
.accomdialog li { margin: 3px 0; }
#accomNotesBox { border-top: 1px solid var(--line); margin-top: 8px; }
.accomnotes { white-space: pre-wrap; word-break: break-word; margin: 4px 0 0; font-size: 14px; }

/* ===== Phones (features/review-mobileUI) ==========================================================================
   Four parts, all inside media queries so the desktop layout is unchanged:
     1. Phone header: the top menu folds behind a menu button (the button is added by gc.js on every page).
     2. 16px text in form fields, so iPhone Safari does not zoom in when one is tapped.
     3. Search rows wrap: search box + Search on the first line, the other buttons and filters below.
     4. Phone cards: tables marked .cardtable (Courses, Groups, My groups) become one card per row.
   ================================================================================================================= */

.navtoggle { display: none; }
.iconlabel { display: none; }

/* --- 1. Phone header ----------------------------------------------------------------------------------------- */
@media (max-width: 760px) {
    .bar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
    .brandlogo { height: 30px; }
    .navtoggle {
        display: inline-flex; order: 5; align-items: center; justify-content: center;
        width: 44px; height: 44px; margin-right: -6px; padding: 0;
        border: 0; border-radius: 6px; background: none; color: var(--leather); cursor: pointer;
    }
    .navtoggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
    .navtoggle .nt-close { display: none; }
    .bar.navopen .navtoggle { background: var(--panel); }
    .bar.navopen .navtoggle .nt-open { display: none; }
    .bar.navopen .navtoggle .nt-close { display: inline; }

    /* The menu panel: its own full-width row under the logos, shown while the button is pressed. */
    .bar .nav {
        display: none; order: 10; flex: 1 1 100%; flex-direction: column; gap: 0;
        margin: 0 -12px -8px; padding: 2px 12px 8px; border-top: 1px solid var(--line);
    }
    .bar.navopen .nav { display: flex; }
    .nav > a, .nav > .navmenu { border-bottom: 1px solid var(--line); }
    .nav > :last-child { border-bottom: 0; }
    .nav > a, .navmenu summary {
        display: flex; align-items: center; min-height: 48px; padding: 0 4px;
        font-size: 16px; color: var(--ink);
    }
    .navmenu summary::after { content: "\25BE"; margin-left: auto; padding-left: 12px; color: var(--muted); }
    .navmenu[open] summary::after { content: "\25B4"; }
    /* Each drop-down opens in place, as an indented list, instead of floating. */
    .navmenu-items {
        position: static; min-width: 0; gap: 0; padding: 0 0 8px 12px;
        background: none; border: 0; border-radius: 0; box-shadow: none;
    }
    .navmenu-items a { display: flex; align-items: center; min-height: 44px; padding: 0 10px; font-size: 16px; border-radius: 6px; }
    .navmenu-items a.current { background: var(--tint); }
}
@media (max-width: 640px) {
    /* The account menu opens just under the (now taller) phone header. */
    .profpanel { top: 64px; }
}

/* --- 2. No zoom on tap --------------------------------------------------------------------------------------- */
/* iPhone Safari zooms the page when a field under 16px is focused, and leaves it zoomed. !important because many
   page rules set field fonts (font: inherit, or 13px on smaller fields) with higher specificity. */
@media (max-width: 760px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
    select, textarea { font-size: 16px !important; }
}

/* --- 3. Search rows wrap ------------------------------------------------------------------------------------- */
@media (max-width: 760px) {
    .search { flex-wrap: wrap; }
    .search > * { order: 2; }
    .search > input, .search > [type="submit"] { order: 1; }
    .search > input { flex: 1 1 60%; min-width: 0; }
    .search > button.secondary, .search > .termselect { flex: 1 1 auto; }
    .search > button { min-height: 44px; }
    .search .inlinecheck, .search .groupsarchived { margin: 0; min-height: 44px; }
    .search .perpage { display: inline-flex; align-items: center; min-height: 44px; }
}

/* --- 4. Phone cards ------------------------------------------------------------------------------------------ */
@media (max-width: 640px) {
    .tablewrap table.cardtable { min-width: 0; }
    table.cardtable, table.cardtable tbody { display: block; }
    table.cardtable thead { display: none; }
    table.cardtable tr { padding: 12px 2px; border-bottom: 1px solid var(--line); }
    table.cardtable tbody tr:hover { background: none; }
    table.cardtable td { display: block; padding: 0; border: 0; white-space: normal; }
    table.cardtable td:empty, table.cardtable td.g-none { display: none; }
    table.cardtable a.grouplink, table.cardtable td.mg-name a { font-size: 16px; }

    /* Courses:  Period 3   Room 204
                 Course name (the link)
                 Teacher          Sec 1234-5
                 [Excel] [Print / PDF]          */
    table.coursecards tr {
        display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 2px;
        grid-template-areas: "period room" "name name" "teacher sec" "act act";
    }
    .coursecards td.c-period { grid-area: period; }
    .coursecards td.c-room { grid-area: room; }
    .coursecards td.c-period, .coursecards td.c-room, .coursecards td.c-sec { color: var(--muted); font-size: 13px; }
    .coursecards td.c-period::before { content: "Period "; }
    .coursecards td.c-room::before { content: "Room "; }
    .coursecards td.c-name { grid-area: name; }
    .coursecards td.c-teacher { grid-area: teacher; }
    .coursecards td.c-sec { grid-area: sec; text-align: right; align-self: center; }
    .coursecards td.c-sec::before { content: "Sec "; }
    .coursecards td.c-act { grid-area: act; display: flex; gap: 8px; margin-top: 8px; text-align: left; }
    .coursecards .iconlink { gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); color: var(--accent); }
    .coursecards .iconlabel { display: inline; font-size: 14px; }

    /* Groups:  Group name (the link)
                [Public]  Category  Members: 12  Your role: Owner
                Owners: ...                                      */
    table.groupcards tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
    .groupcards td.g-name { flex: 1 1 100%; order: 0; }
    .groupcards td.g-vis { order: 1; }
    .groupcards td.g-cat { order: 2; font-size: 13px; }
    .groupcards td.g-members { order: 3; text-align: left; font-size: 13px; color: var(--muted); }
    .groupcards td.g-members::before { content: "Members: "; }
    .groupcards td.g-role { order: 4; font-size: 13px; }
    .groupcards td.g-role::before { content: "Your role: "; }
    .groupcards td.g-owners { order: 5; flex: 1 1 100%; font-size: 13px; color: var(--muted); }
    .groupcards td.g-owners::before { content: "Owners: "; }
    /* A sub-group's whole card is indented under its parent, not just its name. */
    .groupcards tr:has(td.subgroupname) { padding-left: 20px; }
    .groupcards td.subgroupname { padding-left: 0; }

    /* My groups:  Group name (the link)  [3 new]
                   Description, cut to two lines
                   Internal · Member                 */
    table.mygroupcards tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; }
    .mygroupcards td.mg-name { flex: 1 1 100%; }
    .mygroupcards td.mg-about {
        flex: 1 1 100%; font-size: 14px; color: var(--muted);
        display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
    }
    .mygroupcards td.mg-about:empty { display: none; }
    .mygroupcards td.mg-vis, .mygroupcards td.mg-role { font-size: 13px; color: var(--muted); }
    .mygroupcards td.mg-vis + td.mg-role::before { content: "\00a0\00b7\00a0"; }
}

/* --- 5. Search page: "Selected people" bar (search.html, search.js) ----------------------------------------- */
/* Phones: instead of sitting below every result, the list is a bar fixed to the bottom of the screen, shown once
   someone is added. The arrow opens it as a sheet; the gear's menu opens upward from the bar. */
.seltoggle { display: none; }
.commhelp-short { display: none; }
@media (max-width: 760px) {
    .commhelp { display: none; }
    .commhelp-short { display: block; }
    .commlayout { padding-bottom: 76px; }
    .selpanel {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
        border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, .14);
    }
    .selpanel:not(.hasitems) { display: none; }
    .selpanel .selbody { display: none; }
    .selpanel.expanded .selbody { display: block; }
    .selpanel .sellist { max-height: 55vh; }
    .selhead { min-height: 44px; }
    .selhead h2 { flex: 1; }
    .seltoggle {
        display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
        border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--accent);
        font-size: 14px; cursor: pointer;
    }
    .selpanel.expanded .seltoggle span { display: inline-block; transform: rotate(180deg); }
    .selhead .menu { top: auto; bottom: 46px; }
}

/* --- 6. Touch screens: bigger tap targets ------------------------------------------------------------------- */
/* pointer: coarse = a finger, not a mouse (phones and tablets), whatever the screen width. */
@media (pointer: coarse) {
    .psearch .ps-add, .pcard > summary .pcard-add, .rostertable2 .pcard-add, .recordhead .pcard-add {
        width: 36px; height: 36px; font-size: 20px;
    }
    .psearch .ps-item { padding: 8px 10px; }
    .psearch .ps-chipx { min-width: 32px; min-height: 32px; font-size: 18px; }
    .selx { min-width: 40px; min-height: 40px; font-size: 22px; }
    .selrow { align-items: center; }
    .gearbtn, .col-gear .gearbtn { width: 44px; height: 44px; }
    .menu button { padding: 12px 16px; font-size: 16px; }
    .iconlink { min-width: 40px; min-height: 40px; }
    .expand-toggle { min-height: 36px; font-size: 14px; }
    .pager button, .runpager button { min-height: 44px; }
    .inlinecheck input[type="checkbox"], td input[type="checkbox"], th input[type="checkbox"] { width: 22px; height: 22px; }
}

/* --- Course page (course.html, course.js) ---------------------------------------------------------------- */
/* Attendance tab: no Email column (the plain Roster still has it). */
#rosterTable.noemail .emailcol { display: none; }
/* Report tab: the Columns picker above the table. */
.reportbar { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.colpick { position: relative; }
.colpick > summary {
    list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px;
    border: 1px solid var(--accent); border-radius: 6px; background: var(--bg); color: var(--accent);
    font-size: 14px; cursor: pointer;
}
.colpick > summary::-webkit-details-marker { display: none; }
.colpick > summary::after { content: "\25BE"; }
.colpick[open] > summary { background: var(--panel); }
.colpickmenu {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 200px; padding: 6px 0;
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.colpickitem { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.colpickitem:hover { background: var(--panel); }
.reporttable td.leftcell { text-align: left; }
@media (pointer: coarse) { .colpickitem { min-height: 44px; font-size: 16px; } .colpick > summary { min-height: 44px; } }

@media (max-width: 640px) {
    /* Title and the print / CSV / gear icons: the icons drop under a long course name instead of squeezing it. */
    .pagehead { flex-wrap: wrap; }
    .courseline { font-size: 13px; }
    /* The roster / attendance table fits the screen instead of scrolling sideways: names wrap. */
    .tablescroll table.rostertable2 { min-width: 0; }
    .rostertable2 th, .rostertable2 td { padding: 7px 6px; }
    .rostertable2 td.rostername { white-space: normal; }
    .rostertable2 td.attcol select { max-width: 9.5em; }
    .daybar label { flex: 0 0 auto; }
    .daybar select { flex: 1 1 10em; min-width: 0; }
    .daybar #postBtn { margin-left: 0; flex: 1 1 100%; min-height: 44px; }
    /* Report: the Columns button lets people trim the table; whatever is left scrolls inside its own box. */
    .reporttable tr.recrow > td { padding: 4px 8px 12px 12px; }
    .reporttable .rectable { min-width: 0; }
}

/* --- Group page (group.html, group.js) ----------------------------------------------------------------- */
/* The kind-of-person bubble beside each name (replaced the Type column). */
.typebubble {
    display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 9px; border: 1px solid var(--leather);
    font-size: 11px; font-weight: 700; line-height: 16px; letter-spacing: .02em; vertical-align: 1px; cursor: default;
}
.typebubble.tb-emp { color: var(--leather); background: #fff; }
.typebubble.tb-stu { color: #fff; background: var(--leather); }
.typebubble.tb-par { color: var(--leather); background: var(--sunlight); border-color: var(--sunlight); }
.typebubble.tb-grp, .typebubble.tb-acct { color: var(--muted); background: var(--panel); border-color: var(--line); }
@media print {
    .typebubble { border-color: #000 !important; color: #000 !important; background: none !important; }
}
/* Add members: opened from the gear; Done (top right) puts it away. */
.addpanel { position: relative; }
.addpanel .adddone { position: absolute; top: 8px; right: 10px; }
.addpanel > summary { padding-right: 90px; }

@media (max-width: 640px) {
    /* Title, badges and the gear: wrap rather than squeeze; the gear stays top right. */
    .pagehead .titleblock { flex: 1 1 0; min-width: 0; }
    .pagehead h1 { overflow-wrap: anywhere; }
    /* Tabs scroll sideways inside their own strip when there are more than fit. */
    .tabs.grouptabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .tabs.grouptabs a { flex: 0 0 auto; padding: 10px 12px; }
    /* Roster: the table fits the screen; filter box on its own line, the rest below. */
    .tablewrap table.rostertable { min-width: 0; }
    .rostertable th, .rostertable td { padding: 7px 6px; }
    .rostertoolbar > button { flex: 1 1 auto; min-height: 44px; }
    .roleselect { max-width: 8.5em; }
}

/* --- Group board: posts first, new/edit post in a pop-up (group.html #composeDialog, group-board.js) ------- */
.boardpostshead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
.boardpostshead .tilehead { margin: 0; }
.boardpostshead .boardcomments { margin: 0; padding: 0; border-top: 0; }
/* The posts column is the whole Board tab now: no tall empty box above the first post. */
.boardmain .boardlayout.noeditor .boardcol { min-height: 0; padding: 12px 16px 14px; }
.boardmain .boardposts { margin-top: 10px; }

.confirmDialog.boarddialog { max-width: 720px; width: calc(100% - 32px); max-height: 92vh; overflow-y: auto; }
.boarddialog .boardcompose { margin: 0; }
.boarddialog .tilehead { font-size: 17px; margin: 0 0 12px; }
.boarddialog input[type="text"] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.boarddialog .boardeditor { min-height: 220px; max-height: 50vh; overflow-y: auto; }
.boarddialog .boardcalcheck { margin: 10px 0 6px; }
.boarddialog #composeStatus:empty { display: none; }
@media (max-width: 640px) {
    /* Phones: the pop-up fills the screen, so the keyboard leaves room to write. */
    .confirmDialog.boarddialog { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; border-radius: 0; padding: 16px; }
    .boarddialog .boardeditor { min-height: 160px; max-height: none; }
    .boarddialog .confirmButtons button { flex: 1 1 0; min-height: 44px; }
}
.boardpostshead .newpostbtn { margin-left: auto; }
.boardpostshead .boardcomments + .newpostbtn { margin-left: 0; }
.boardpostshead .boardcomments { margin-left: auto; }
@media (pointer: coarse) { .boardpostshead .newpostbtn { min-height: 44px; } }

/* --- Row shading on rosters: every other row tinted so a row is easy to follow across ----------------------
   Group roster and member list (.rostertable), course roster and Attendance tab (.rostertable2), and the
   course Report tab (.reporttable, which marks its rows .stripe so an opened record row does not break the
   pattern). Absent rows on the Attendance tab keep their own red tint. Off when printing. */
.rostertable tbody tr:nth-child(even),
.rostertable2:not(.reporttable) tbody tr:nth-child(odd),
.reporttable tbody tr.stripe { background: var(--stripe); }
.rostertable tbody tr:nth-child(n):hover,
.rostertable2 tbody tr:nth-child(n):hover { background: var(--stripe-hover); }
.reporttable tbody tr.recrow:nth-child(n):hover { background: none; }
/* Courses / My Courses, Groups and My groups pages (the tables that turn into cards on phones), and the home
   page's My classes and My groups tiles. */
table.cardtable tbody tr:nth-child(even) { background: var(--stripe); }
table.cardtable tbody tr:nth-child(n):hover { background: var(--stripe-hover); }
.tilelist.striped li { padding: 6px 8px; border-bottom: 0; }
.tilelist.striped li:nth-child(even) { background: var(--stripe); }
.tilelist.striped li:hover { background: var(--stripe-hover); }
@media (max-width: 640px) {
    table.cardtable tr { padding-left: 8px; padding-right: 8px; }
    table.cardtable tbody tr:nth-child(n):hover { background: inherit; }
    table.cardtable tbody tr:nth-child(even):hover { background: var(--stripe); }
}
@media print {
    table.cardtable tbody tr:nth-child(even),
    .rostertable tbody tr:nth-child(even),
    .rostertable2 tbody tr:nth-child(odd),
    .reporttable tbody tr.stripe,
    .rostertable tbody tr:hover, .rostertable2 tbody tr:hover { background: none; }
}

/* Group "Add members": the "Include acct listings" tick under the search box */
.ps-allresults { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--muted); }

/* Development sign-in (devlogin/; a dev Mac only): the picker on the sign-in page and the warning bar on every page. */
body.devlogin-on .signin { margin-top: 6vh; }
.devlogin { margin-top: 28px; padding: 14px 16px; border: 2px dashed #a3271f; border-radius: 8px; text-align: left; }
.devlogin h2 { margin: 0 0 4px; font-size: 18px; color: #a3271f; }
.devlogin-note { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.devlogin input[type="search"] { box-sizing: border-box; width: 100%; margin: 0 0 10px; padding: 6px 8px; font: inherit; }
.devlogin-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.devlogin-list li { margin: 0 0 6px; }
.devlogin-list button.secondary { width: 100%; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 12px; text-align: left; }
.devlogin-meta { font-size: 12px; color: var(--muted); font-weight: normal; }
.devlogin-banner {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    padding: 6px 12px; background: #a3271f; color: #fff; font-size: 13px; font-weight: 600; text-align: center;
}
/* No global [hidden] rule in this file, and a.button sets display, so say it here for the sign-in page. */
.signin a.button[hidden], .devlogin [hidden] { display: none; }

/* ---- Demographic updates (demographics.html, demographic-requests.html; V064) ---------------------------------- */
.demo-person { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px 14px; margin: 0 0 16px; background: var(--bg); }
.demo-person h2 { margin: 0 0 2px; font-size: 17px; }
.demo-person .demo-role { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.demo-fields { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 6px 14px; margin: 0; }
.demo-fields dt { color: var(--muted); font-size: 14px; padding-top: 5px; }
.demo-fields dd { margin: 0; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; min-height: 30px; }
.demo-val { padding-top: 5px; white-space: pre-line; }
.demo-val.demo-empty { color: var(--muted); }
.demo-edit { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 4px; line-height: 0; border-radius: 4px; }
.demo-edit:hover, .demo-edit:focus-visible { background: var(--tint); }
.demo-changed .demo-val { background: var(--tint); border-radius: 4px; padding: 5px 6px 2px; }
.demo-changed dt::after { content: " \2022"; color: var(--fire); }
.demo-editor { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; }
.demo-editor input[type=text], .demo-editor input[type=email], .demo-editor input[type=tel], .demo-editor select { min-height: 32px; }
.demo-addr { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 620px; }
.demo-addr .a-street { grid-column: span 4; } .demo-addr .a-unit { grid-column: span 2; }
.demo-addr .a-city { grid-column: span 3; } .demo-addr .a-state { grid-column: span 1; } .demo-addr .a-zip { grid-column: span 2; }
.demo-addr label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
.demo-addr input, .demo-addr select { width: 100%; box-sizing: border-box; }
.demo-suggest { border: 1px solid var(--tint-line); background: var(--tint); border-radius: 6px; padding: 8px 10px; width: 100%; max-width: 620px; box-sizing: border-box; }
.demo-suggest p { margin: 0 0 6px; }
.demo-err { color: #a3271f; font-size: 13px; width: 100%; margin: 0; }
.demo-household { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 8px; font-size: 14px; }
.demo-household label { display: block; margin: 2px 0; }
.demo-em { width: 100%; border-collapse: collapse; margin-top: 6px; }
.demo-em th, .demo-em td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
.demo-em tr.demo-em-removed td { text-decoration: line-through; color: var(--muted); }
.demo-em tr.demo-em-changed td { background: var(--tint); }
.demo-em input { width: 100%; box-sizing: border-box; min-width: 80px; }
.demo-bar { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 16px; margin: 0 -16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; z-index: 5; }
.demo-compare { width: 100%; border-collapse: collapse; }
.demo-compare th, .demo-compare td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.demo-compare td.demo-old { color: var(--muted); }
.demo-compare td.demo-new { font-weight: 600; }
.demo-compare td.demo-arrow { color: var(--muted); width: 1.5em; text-align: center; }
.demo-tag { display: inline-block; font-size: 11px; border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; margin-left: 4px; color: var(--muted); font-weight: 400; }
.demo-st-APPLIED, .demo-st-DONE, .demo-st-APPROVED { color: #1a7a3c; font-weight: 600; }
.demo-st-FAILED, .demo-st-REJECTED, .demo-st-PARTIAL { color: #a3271f; font-weight: 600; }
.demo-st-MANUAL, .demo-st-SUBMITTED, .demo-st-PENDING { color: var(--fire); font-weight: 600; }
.demo-notice { border: 1px solid var(--tint-line); background: var(--tint); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }
.demo-notice a { font-weight: 600; }
@media (max-width: 640px) {
    .demo-fields { grid-template-columns: 1fr; }
    .demo-fields dt { padding-top: 6px; }
    .demo-addr .a-street, .demo-addr .a-unit, .demo-addr .a-city, .demo-addr .a-zip { grid-column: span 6; }
    .demo-addr .a-state { grid-column: span 6; }
    .demo-em thead { display: none; }
    .demo-em td { display: block; border: 0; padding: 2px 4px; }
    .demo-em tr { display: block; border-bottom: 1px solid var(--line); padding: 4px 0; }
}

/* Demographic updates review: the expandable request rows (demographic-requests.html). */
.demo-exp { border: 0; background: none; cursor: pointer; padding: 2px 6px 2px 0; color: var(--accent); font-size: 13px; line-height: 1; }
.demo-exp[aria-expanded="true"] .demo-tri { display: inline-block; transform: rotate(90deg); }
.demo-tri { display: inline-block; transition: transform .12s; }
tr.demo-open > td { background: var(--tint); }
tr.demo-expand > td { background: var(--panel); padding: 10px 14px 14px; }
.demo-review .demo-meta { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.demo-review .demo-meta strong { color: var(--ink); font-weight: 600; }
.demo-review .demo-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.demo-review .demo-acts textarea { flex: 1 1 260px; min-height: 34px; }
.demo-review td.demo-btns { white-space: nowrap; }
.demo-review td.demo-btns button { margin-right: 6px; }
.demo-review button.demo-mini { padding: 3px 10px; font-size: 13px; min-height: 0; }
.demo-review .demo-editor { margin-top: 6px; }

/* Admin > Settings > Community search: who may search for whom (js/search-visibility-settings.js). */
.vistable { border-collapse: collapse; margin: 8px 0 12px; }
.vistable th, .vistable td { border: 1px solid var(--box-line, var(--line)); padding: 8px 14px; text-align: center; }
.vistable thead th { background: var(--panel); font-size: 13px; }
.vistable th.vishead { text-align: left; background: var(--panel); white-space: nowrap; }
.vistable .viscell { padding: 0; }
.visbtn { display: block; width: 100%; min-width: 96px; height: 44px; border: 0; background: none; cursor: pointer;
    font-size: 22px; font-weight: 700; line-height: 1; color: #1e7b34; }
.visbtn:hover, .visbtn:focus-visible { background: var(--tint); }
.vistable.busy { opacity: .6; pointer-events: none; }
@media (max-width: 640px) { .visbtn { min-width: 64px; } .vistable th, .vistable td { padding: 6px 8px; } }

/* The teacher's name in a student's schedule: record link and the small envelope (js/teacher-mail.js). */
.teachercell { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.teachercell .teachermail { padding: 2px; min-width: 24px; min-height: 24px; color: var(--muted); cursor: pointer; }
.teachercell .teachermail:hover, .teachercell .teachermail:focus-visible { color: var(--accent); }
.teacherMail .tmcopy { display: flex; margin: 0 0 8px; }
.teacherMail textarea { width: 100%; box-sizing: border-box; }

/* A student or parent on the Community search page: just the search and the employee card, no selected-people list. */
.commlayout.portalview { grid-template-columns: 1fr; }
.pcard .litebody { padding: 4px 14px 14px; }
.pcard .litebody dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.pcard .litebody dt { color: var(--muted); font-size: 13px; }
.pcard .litebody dd { margin: 0; overflow-wrap: anywhere; }
.pcard .litebody .litephoto { float: right; width: 120px; max-width: 30%; height: auto; margin: 0 0 8px 14px; border-radius: 6px; border: 1px solid var(--line); }
.pcard .litebody .litecourses h4 { margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.pcard .litebody .litecourses ul { margin: 0; padding-left: 18px; }
.pcard .litebody::after { content: ""; display: table; clear: both; }

/* API keys tab */
.scopelist { border: 1px solid var(--border, #ccc); border-radius: 6px; padding: 8px 12px; flex-basis: 100%; }
.scopelist legend { font-size: 13px; padding: 0 4px; }
.scopeitem { display: inline-block; margin: 2px 14px 2px 0; font-size: 13px; }
#issuedKey { font-family: ui-monospace, Menlo, Consolas, monospace; }
