﻿/* mod-ops: Overview, Notifications, Calendar, Training Schedule, Announcements, Settings. Prefix: op-.
   Colors come from the shared variables only, so light and dark both keep 4.5:1 text contrast. */

/* ---------- event type colors (each pairs a background and a text color). Color is never the only cue: every chip, tag, and filter
   also carries the type's symbol, and the type's name is always in the text (see TYPE_ICON in mod-ops.js). Types 4 and 7 used to be two greens
   that looked alike, so the graduation ceremony is now a dark slate with light text and a gold edge (fixed palette colors, the same in both
   themes). --op-edge is the chip's left bar and the filter's border; it defaults to the text color. ---------- */
.op-t0 { --op-bg: var(--info-bg); --op-fg: var(--info); }
.op-t1 { --op-bg: var(--warn-bg); --op-fg: var(--warn); }
.op-t2 { --op-bg: var(--exam-bg); --op-fg: var(--exam); }
.op-t3 { --op-bg: var(--tag-volunteer-bg); --op-fg: var(--tag-volunteer); }
.op-t4 { --op-bg: var(--good-bg); --op-fg: var(--good-fg); }
.op-t5 { --op-bg: var(--gold); --op-fg: var(--navy); }
.op-t6 { --op-bg: var(--surface-2); --op-fg: var(--info); }
.op-t7 { --op-bg: var(--navy-3); --op-fg: var(--cream); --op-edge: var(--gold); }
.op-t8 { --op-bg: var(--bad-bg); --op-fg: var(--bad-fg); }
.op-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; line-height: 1.5; background: var(--op-bg); color: var(--op-fg); max-width: 100%; overflow-wrap: anywhere; }
.op-tag svg { width: 12px; height: 12px; flex: none; }

/* a button that looks like a text link; long unbroken text (a web address in a title) wraps instead of pushing the page sideways */
.op-linkbtn { background: none; border: 0; padding: 0; margin: 0; font-weight: 700; text-align: left; cursor: pointer; color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; overflow-wrap: anywhere; max-width: 100%; }
.op-linkbtn:hover { text-decoration-color: var(--gold); }
.op-wrap { overflow-wrap: anywhere; }
.op-quiet { padding: 4px 0 8px; }
.op-pad { padding: 16px 20px; }
.op-time { white-space: nowrap; }

/* ---------- icon discs ---------- */
.op-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text); }
.op-ico.good { background: var(--good-bg); color: var(--good-fg); }
.op-ico.bad { background: var(--bad-bg); color: var(--bad-fg); }
.op-ico.review { background: var(--warn-bg); color: var(--warn); }
.op-ico.info { background: var(--info-bg); color: var(--info); }
.op-ico.exam { background: var(--exam-bg); color: var(--exam); }
.op-ico.gold { background: var(--gold); color: var(--navy); }

/* ---------- Overview ----------
   Two colours the page borrows from the portal's own tokens and no more. Amber (a recruit with no FTO, the number of recruits who need one) is the
   dark gold on a light page, where the bright gold would be only 2:1 on the cream cards, and the bright gold on the dark theme, where it is 7:1 on
   the navy cards. Violet (the number of evaluations to review) is --exam, which the portal already uses for evaluations in both themes. The dark values
   are for the screen only, like the portal's own dark tokens, so paper prints the light ones. */
.op-overview { --op-amber: var(--gold-ink); --op-amber-bg: var(--warn-bg); }
@media screen { :root[data-theme="dark"] .op-overview { --op-amber: var(--gold); } }

/* the shortcuts that create things sit on the right of the page head and wrap under the title when the pane is narrow; on a phone each is a full row */
.op-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 480px) { .op-actions .btn { flex: 1 1 100%; justify-content: flex-start; } }
.op-nopipe { padding: 0 2px; }

/* the recruit pipeline: six nodes in a row, each a link. The line to the next node is gold where the phase has recruits, the portal's line colour where it has none. */
.op-pipe-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.op-pipe-card { container: op-pipe / inline-size; }
.op-pipe { list-style: none; margin: 0; padding: 26px 12px 14px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.op-pipe > li { min-width: 0; }
.op-node { position: relative; display: flex; flex-direction: column; align-items: center; height: 100%; padding: 0 4px 8px; text-align: center; text-decoration: none; color: inherit; border-radius: 12px; }
.op-node:hover { background: var(--hover); }
.op-node::before { content: ''; position: absolute; top: 22px; left: 50%; right: -50%; height: 3px; background: var(--line); }
.op-node.has::before { background: linear-gradient(90deg, var(--gold), var(--line)); }
.op-pipe > li:last-child .op-node::before { display: none; }
.op-numeral { position: relative; z-index: 1; display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); font-family: var(--font-head); font-size: 19px; font-weight: 600; }
.op-numeral svg { width: 22px; height: 22px; }
.op-node.has .op-numeral { border-color: var(--gold); }
.op-node.grad .op-numeral { color: var(--good-fg); }
.op-node.grad.empty .op-numeral { color: var(--muted); }
.op-total { font-family: var(--font-head); font-size: 48px; font-weight: 600; line-height: 1; margin-top: 12px; font-variant-numeric: tabular-nums; }
.op-node.empty .op-total { color: var(--muted); }
.op-pname { margin-top: 3px; font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--muted); }
.op-avs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 12px; min-height: 28px; }
.op-init { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--line); color: var(--text); font-size: 10px; font-weight: 700; }
.op-init.need { border-color: var(--op-amber); }
.op-init.more { background: transparent; border-color: transparent; color: var(--muted); font-size: 11px; }
.op-need { margin-top: 10px; display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--op-amber); background: var(--op-amber-bg); color: var(--op-amber); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.op-pipe-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding: 12px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.op-legend { display: contents; }
.op-ring { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; border: 2px solid var(--op-amber); vertical-align: -1px; }
.op-ring.ok { border-color: var(--line); }
.op-gone { margin-left: auto; display: inline-block; padding: 3px 0; line-height: 18px; color: var(--text); }
/* Two rows of three below 900px of screen, and wherever the card itself is narrower than 740px (a screen of 1100px has a menu beside the page, so the card
   is 790px there and the six fit; at 1000px they do not). The phone list below wins when both apply. */
@container op-pipe (max-width: 740px) {
  .op-pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
  .op-pipe > li:nth-child(3n) .op-node::before { display: none; }
}
@media (max-width: 900px) {
  .op-pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
  .op-pipe > li:nth-child(3n) .op-node::before { display: none; }
}
/* A phone: one row for each phase (the numeral, the name and the count, the initials, the flag), Graduated last, and the line runs down between the numerals. */
@container op-pipe (max-width: 480px) {
  .op-pipe { grid-template-columns: minmax(0, 1fr); row-gap: 0; padding: 6px 12px 10px; }
  .op-node { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-areas: "dot name n" "dot avs avs" "dot need need"; align-items: center; justify-items: start; column-gap: 14px; row-gap: 6px; padding: 12px 8px; text-align: left; }
  .op-node::before { top: 58px; bottom: -12px; left: 30px; right: auto; width: 3px; height: auto; }
  .op-node.has::before { background: linear-gradient(180deg, var(--gold), var(--line)); }
  .op-pipe > li:nth-child(3n) .op-node::before { display: block; }
  .op-pipe > li:last-child .op-node::before { display: none; }
  .op-numeral { grid-area: dot; align-self: start; }
  .op-pname { grid-area: name; margin-top: 0; font-size: 14px; color: var(--text); }
  .op-total { grid-area: n; margin-top: 0; font-size: 34px; }
  .op-avs { grid-area: avs; justify-content: flex-start; margin-top: 0; min-height: 0; }
  .op-avs:empty { display: none; }
  .op-need { grid-area: need; margin-top: 0; }
}

/* the row of three cards: equal height, one column from 1100px down (what waits on this person first). The notification center, when it is on, is a
   fourth card under the three, the whole width. */
.op-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.op-cards > .card { display: flex; flex-direction: column; min-width: 0; }
.op-cards > .op-nc { grid-column: 1 / -1; }
@media (max-width: 1100px) { .op-cards { grid-template-columns: minmax(0, 1fr); } }

/* Needs your attention: a big number, what it counts, who, and the button that acts on it */
.op-attn-list { flex: 1; display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.op-attn-row { display: flex; align-items: center; flex: 1; gap: 18px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.op-attn-row:last-child { border-bottom: 0; }
.op-attn-n { flex: none; min-width: 40px; font-family: var(--font-head); font-size: 54px; font-weight: 600; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.op-attn-n.amber { color: var(--op-amber); }
.op-attn-n.exam { color: var(--exam); }
.op-attn-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.op-attn-what { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.op-attn-txt small { margin-bottom: 5px; color: var(--muted); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }

/* Coming up: three events. The title link is 24px tall at least (the line is 18px, with 3px above and below). */
.op-mini .plink { display: inline-block; padding: 3px 0; line-height: 18px; }

/* People: the roster count, a meter of how many are active, and the three positions (links for the Command Team, plain text for everyone else) */
.op-people { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px; container: op-people / inline-size; }
.op-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.op-big b { font-family: var(--font-head); font-size: 54px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.op-big span { font-weight: 600; color: var(--muted); }
.op-meter { height: 8px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.op-meter i { display: block; height: 100%; border-radius: 5px; background: var(--gold); }
.op-meter-line { margin-top: -4px; }
.op-trio { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; }
.op-trio li { min-width: 0; border-right: 1px solid var(--line); }
.op-trio li:last-child { border-right: 0; }
.op-pos { display: block; padding: 8px 2px; text-align: center; text-decoration: none; color: inherit; }
a.op-pos:hover { background: var(--hover); }
a.op-pos:focus-visible { outline-offset: -3px; }
.op-trio li:first-child .op-pos { border-radius: 9px 0 0 9px; }
.op-trio li:last-child .op-pos { border-radius: 0 9px 9px 0; }
.op-pos b { display: block; font-family: var(--font-head); font-size: 24px; font-weight: 600; line-height: 1.1; }
.op-pos > span { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
/* "SUPERVISORS" needs about 78px, so the three cells only fit side by side while the card's own width is about 260px or more (a screen between 1101px and
   1250px has a card of 230px to 300px). Narrower than that the three counts are three rows, the label on the left and the number on the right: no word is ever cut. */
@container op-people (max-width: 260px) {
  .op-trio { grid-template-columns: minmax(0, 1fr); }
  .op-trio li { border-right: 0; border-bottom: 1px solid var(--line); }
  .op-trio li:last-child { border-bottom: 0; }
  .op-pos { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; padding: 6px 14px; text-align: left; }
  .op-pos b { display: inline; font-size: 22px; }
  .op-trio li:first-child .op-pos { border-radius: 9px 9px 0 0; }
  .op-trio li:last-child .op-pos { border-radius: 0 0 9px 9px; }
}
@media (forced-colors: active) {
  .op-node::before, .op-node.has::before { forced-color-adjust: none; background: CanvasText; }
  .op-numeral, .op-init, .op-need, .op-ring { border-color: CanvasText; }
  .op-meter { border: 1px solid CanvasText; }
  .op-meter i { forced-color-adjust: none; background: Highlight; }
}

.op-feed { list-style: none; margin: 0; padding: 0; }
.op-feed-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.op-feed-item:last-child { border-bottom: 0; }
.op-feed-main { min-width: 0; }
.op-feed-line { overflow-wrap: anywhere; }
.op-feed-sub { font-size: 14px; overflow-wrap: anywhere; }
.op-time { padding-top: 2px; }
/* "4 steps": how many rows were folded into the line (its title, and the words after it for a screen reader, list them) */
.op-steps { display: inline-block; margin-left: 6px; padding: 0 7px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.6; color: var(--muted); vertical-align: 1px; white-space: nowrap; }
.op-feed-line .plink { display: inline-block; max-width: 100%; padding: 3px 0; line-height: 18px; }
/* These two links are boxes (for their tap height), so the portal's usual underline, a bottom border, would sit under the box: far below the words on a
   phone, and one rule under a sentence that wraps. They are underlined as text instead, as on the Personnel roster. */
.op-feed-line .plink, .op-overview .op-gone { border-bottom: 0; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.op-feed-line .plink:hover, .op-overview .op-gone:hover { text-decoration-color: var(--gold); }
.op-feed-note { margin: 0; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; }
@media (max-width: 520px) {
  .op-feed-item { grid-template-columns: 32px minmax(0, 1fr); padding: 12px 16px; }
  .op-feed-item .op-time { grid-column: 2; padding-top: 0; }
}
.op-nc .card-head { flex-wrap: wrap; }
.op-nc .card-head .row { gap: 6px; }
.op-center .op-sec-title { font-family: var(--font-body); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; margin: 4px 0 4px; }
.op-center .op-sec-title:not(:first-child) { margin-top: 18px; }
.op-more-link { display: inline-block; margin-top: 6px; padding: 3px 0; line-height: 18px; font-weight: 600; font-size: 14px; }
.op-tasks { list-style: none; margin: 0; padding: 0; }
.op-task { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.op-task.op-unread { align-items: center; }
.op-tasks li:last-child > .op-task { border-bottom: 0; }
.op-task:hover .op-task-text { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.op-task .op-ico { width: 28px; height: 28px; }
.op-task-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* a task's sentence takes the whole row width, and the word for its kind sits under it, small, instead of beside it */
.op-task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.op-task-body .op-task-text { flex: none; max-width: 100%; }
.op-task .pill { flex: none; }
.op-tasks-full .op-task { padding: 12px 20px; }
.op-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--gold); }
.op-unread .op-task-text { font-weight: 700; }
.op-mini li { flex-wrap: wrap; }
.op-mini .grow { overflow-wrap: anywhere; }
.op-date { display: grid; place-items: center; width: 46px; height: 50px; flex: none; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; line-height: 1.1; }
.op-date b { font-family: var(--font-head); font-size: 19px; color: var(--text); font-weight: 600; }

/* ---------- Notifications ---------- */
.op-tabs .tabs { flex-wrap: wrap; }
@media (max-width: 560px) {
  .op-tabs .tabs a { flex: 1 1 0; min-width: 0; text-align: center; padding: 10px 4px; font-size: 13px; }
}
/* the list clips to the card's rounded bottom corners, so an unread last row (a filled background and a gold bar) cannot square them off */
.op-notes { list-style: none; margin: 0; padding: 0; overflow: hidden; border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
.op-note { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.op-note:last-child { border-bottom: 0; }
.op-note-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 4px 0; }
.op-note-link:hover .op-task-text { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.op-note.op-unread { background: var(--hover); box-shadow: inset 4px 0 0 var(--gold); }
.op-note:not(.op-unread) .op-dot { background: transparent; border: 1px solid var(--line); }
.op-note .btn { flex: none; }
@media (max-width: 560px) {
  .op-note { flex-wrap: wrap; padding: 10px 16px; }
  .op-note-link { flex-basis: 100%; flex-wrap: wrap; }
  .op-note-link .op-time { flex-basis: 100%; padding-left: 22px; }
}

/* ---------- Calendar ---------- */
.op-cal-head { flex-wrap: wrap; }
.op-cal-nav { gap: 8px; }
.op-flip svg { transform: scaleX(-1); }
.op-cal-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.op-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.op-filter { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 3px 11px; min-height: 30px; font-size: 12px; font-weight: 700; cursor: pointer; }
.op-filter svg { width: 13px; height: 13px; flex: none; }
.op-filter.op-typed { background: var(--op-bg); color: var(--op-fg); border-color: var(--op-edge, var(--op-fg)); }
.op-filter[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 1px; }
.op-filter:not(.op-typed)[aria-pressed="true"] { background: var(--btn-dark); color: var(--btn-dark-fg); border-color: var(--btn-dark); }
.op-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.op-grid th { padding: 8px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.op-cell { height: 112px; vertical-align: top; padding: 4px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.op-cell.op-out { background: var(--bg); }
.op-cell.op-out .op-daynum { color: var(--muted); }
.op-cell.op-today { background: var(--hover); box-shadow: inset 0 0 0 2px var(--gold); }
.op-daynum { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--text); font-weight: 700; font-size: 13px; cursor: pointer; }
button.op-daynum:hover { background: var(--surface-2); }
.op-daynum.op-static { cursor: default; }
.op-today .op-daynum { background: var(--gold); color: var(--navy); }
.op-cell-ev { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
/* A chip shows the type's symbol, the time, and the whole title. The title wraps (a cell may grow taller), so nothing is cut off, at any
   width and with wide text spacing. */
.op-chip { display: flex; align-items: flex-start; gap: 5px; width: 100%; min-width: 0; max-width: 100%; min-height: 24px; padding: 3px 6px; border: 0; border-left: 3px solid var(--op-edge, var(--op-fg)); border-radius: 5px; background: var(--op-bg); color: var(--op-fg); font-size: 12px; font-weight: 600; line-height: 1.3; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.op-chip:hover { filter: brightness(0.95); }
/* a grid cell clips what leaves it, and a chip fills the cell, so the focus ring is drawn inside the control instead of around it */
.op-cell .op-chip:focus-visible, .op-cell .op-daynum:focus-visible, .op-cell .op-more:focus-visible { outline-offset: -3px; }
.op-chip-ico { flex: none; display: inline-flex; padding-top: 1px; }
.op-chip-ico svg { width: 12px; height: 12px; }
.op-chip-main { flex: 1; min-width: 0; }
.op-chip-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.op-chip-check { font-weight: 800; }
.op-chip-type { display: block; font-size: 12px; font-weight: 600; }
.op-tag-sub { margin-top: 4px; }
.op-more { background: none; border: 0; padding: 1px 4px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; text-decoration: underline; }
.op-cal-compact { display: none; }
.op-mlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.op-mday { font-family: var(--font-body); font-size: 14px; text-transform: none; margin-bottom: 6px; }
/* a column is 280px wide at most, and never wider than the card: a fixed 280px minimum pushed the page sideways on a 320px phone */
.op-mchips { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 6px; }
.op-mchips > *, .op-mlist > li { min-width: 0; }
.op-cal-compact .op-chip { min-height: 44px; font-size: 14px; padding: 8px 10px; align-items: center; }
.op-cal-compact .op-chip-ico svg { width: 16px; height: 16px; }
/* Up to 1100px a grid cell is under 110px wide, too narrow to read an event title in, so the month becomes the list of its days. */
@media (max-width: 1100px) {
  .op-cal-wide { display: none; }
  .op-cal-compact { display: block; }
}
@media (max-width: 640px) {
  .op-cal-body { padding: 14px 16px 16px; }
  /* nine 44px filter buttons one under another would fill a phone screen: two to a row, with "All types" across the top */
  .op-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .op-filters .op-filter:first-child { grid-column: 1 / -1; }
  .op-filter { justify-content: flex-start; text-align: left; border-radius: 14px; }
}
.op-agenda-list li { flex-wrap: wrap; }
.op-agenda-list .grow { overflow-wrap: anywhere; }
.op-daylist li { justify-content: space-between; flex-wrap: wrap; padding-left: 0; padding-right: 0; overflow-wrap: anywhere; }

/* event modal */
.op-att { list-style: none; margin: 0; padding: 0; }
.op-att-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.op-att-row:last-child { border-bottom: 0; }
.op-att-who { min-width: 0; overflow-wrap: anywhere; }
.op-att-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.op-att-btns .op-excused { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.op-att-btns .op-excused:hover { background: var(--warn-bg); filter: brightness(0.95); }
.op-att-sum { margin-top: 8px; }
.checks[aria-labelledby="f-fm-attendeeIds-l"] { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }
.checks[aria-labelledby="f-fm-attendeeIds-l"] .check span { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Training Schedule ---------- */
.op-sched-controls { border-bottom: 0; }
.op-evlist { list-style: none; margin: 0; padding: 0; }
.op-ev-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 8px 16px; align-items: start; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.op-ev-row:last-child { border-bottom: 0; }
.op-ev-time { display: flex; flex-direction: column; line-height: 1.35; }
.op-ev-main { min-width: 0; }
.op-ev-title { overflow-wrap: anywhere; }
.op-ev-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 4px; overflow-wrap: anywhere; }
.op-ev-meta > .muted { min-width: 0; overflow-wrap: anywhere; }
.op-ev-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 720px) {
  .op-ev-row { grid-template-columns: 74px minmax(0, 1fr); padding: 12px 16px; }
  .op-ev-acts { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- Announcements ---------- */
.op-chipbar { padding-top: 14px; padding-bottom: 14px; }
.op-ann-tools { border-bottom: 1px solid var(--line); }
.op-chipbar .chip { min-height: 32px; }
.op-pinned { border-color: var(--gold); box-shadow: inset 4px 0 0 var(--gold), var(--shadow); }
/* Every card has the same two fixed rows: the category and the date on top, who posted it and the buttons at the foot. The tags wrap inside their
   own column, so the date stays at the top right and the buttons (Delete last) stay at the bottom right, however long the category or the author line is. */
.op-ann-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: start; }
.op-ann-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.op-ann-date { white-space: nowrap; padding-top: 3px; }
/* Pinned is an outlined badge with a pin: every category already has its own filled color, and a second filled pill read as a copy of it. */
.op-pin { display: inline-flex; align-items: center; gap: 5px; padding: 1px 10px; border: 1px solid var(--text); border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.6; color: var(--text); white-space: nowrap; }
.op-pin svg { width: 12px; height: 12px; flex: none; }
.op-ann-title { font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: 19px; font-weight: 700; margin: 12px 0 8px; line-height: 1.25; overflow-wrap: anywhere; }
.op-ann-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.op-ann-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.op-ann-foot > :first-child { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
/* Edit, Pin, and Delete sit together at the right. When the author line and the buttons do not fit on one row, the buttons drop under it and stay at the right. */
.op-ann-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }

/* ---------- Settings ---------- */
.op-msg { font-size: 13px; font-weight: 600; color: var(--muted); }
.op-msg.bad { color: var(--bad-fg); }
.op-tools { display: flex; flex-direction: column; gap: 22px; }
.op-tool { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.op-tool > div:first-child { flex: 1 1 260px; min-width: 0; }
.op-tool .field, .op-tool > .btn { flex: 0 1 320px; min-width: 0; }
.op-tool h3 { margin-bottom: 2px; }
.op-danger { display: flex; flex-direction: column; gap: 18px; border: 1px solid var(--bad); border-radius: 12px; padding: 16px; }
.op-danger > h3 { color: var(--bad-fg); text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; }
.op-donly { border-top: 1px solid var(--line); }
.op-donly h3 { margin-bottom: 6px; }
.op-list { margin: 0; padding-left: 20px; }
.op-list li { margin: 4px 0; }
/* The permission matrix is wider than a phone, so it scrolls sideways (the shared hint line under it says so). The Section column stays in
   view while it does, so a pill is never separated from the row it belongs to. A collapsed border does not travel with a sticky cell, so the
   column's right edge is drawn with a shadow. */
.op-matrix th:first-child, .op-matrix td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.op-matrix th:first-child { background: var(--surface-2); z-index: 2; }
.op-matrix td:first-child { min-width: 112px; max-width: 180px; }
.op-matrix-note { border-top: 1px solid var(--line); }

/* ---------- Tap targets on phones and touch screens: 44px, the size of a thumb ---------- */
@media (max-width: 640px), (pointer: coarse) {
  .op-linkbtn { display: inline-flex; align-items: center; min-height: 44px; }
  .op-ev-acts .btn, .op-note .btn, .op-ann-foot .btn, .op-att-btns .btn, .op-cal-nav .btn, .op-chipbar .chip, .op-filter, .op-sched-controls .seg button, .op-overview .btn-sm { min-height: 44px; }
  .op-more-link, .op-overview .op-gone { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ---------- Print ----------
   The shared print rules ask the browser to keep every fill, but a browser may ignore that (or the person may have turned "Background graphics"
   off in a browser that lets them), so nothing here may rest on its fill. Every chip, tag, and filter prints dark text on a light ground with its
   own outline, which reads the same with the fill printed or dropped. The dark chip (the graduation ceremony) and the pressed "All types" filter
   are cream on navy on screen; on paper they are dark text on a light ground like the others. The event type is always in the words and in the
   symbol, never in the color alone. A dark theme prints with these light colors (styles.css keeps its dark tokens on screen only). */
@media print {
  .op-t7 { --op-bg: var(--surface-2); --op-fg: var(--navy); --op-edge: var(--navy); }
  .op-tag { border: 1px solid var(--op-edge, var(--op-fg)); }
  .op-chip { border: 1px solid var(--op-edge, var(--op-fg)); border-left-width: 4px; }
  .op-filter:not(.op-typed)[aria-pressed="true"] { background: var(--surface-2); color: var(--text); border-color: var(--text); font-weight: 800; }
  .op-date { border: 1px solid var(--line); }
}
