/* =====================================================================
   Theme layer, 4 Nov 2026 (docs/ui-guidelines.md). One look for every page:
   dropdown navigation with a tab strip for the current area, wider pages,
   calmer tables, one filter bar, form panels instead of expanders.
   Loaded after app.css, so it settles the cascade for the rules there.
   ===================================================================== */
:root { --radius: 6px; --control-h: 2.3rem; --shadow: 0 10px 30px rgba(0, 40, 28, 0.16); --head: #f8f9fa; }
body { font-size: 15.5px; line-height: 1.5; }

/* -- page width ------------------------------------------------------------ */
.layout { display: block; max-width: none; }
.layout main, main { max-width: 78rem; width: 100%; margin: 0 auto; padding: 1.75rem 2rem 4rem; }
main.wide { max-width: 90rem; }
p { max-width: 75ch; }
td p, .stats p { max-width: none; }

/* -- top bar: brand, menus, search, admin and account ----------------------- */
.topbar { position: sticky; top: 0; z-index: 900; flex-wrap: nowrap; gap: 1.25rem; padding: 0 1.5rem; min-height: 3.4rem; }
.topbar a.brand { color: var(--accent-ink); font-weight: 700; font-size: 1.05rem; text-decoration: none; white-space: nowrap; }
.menus { flex: 1 1 auto; min-width: 0; }
.menubar { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 0.15rem; }
.menubar.account { flex: 0 0 auto; }
.menu { position: relative; display: flex; }
.menu-button { background: transparent; border: 0; border-radius: 0; color: var(--brand-tint); font-weight: 500;
  font-size: 0.95rem; padding: 1.05rem 0.8rem 0.95rem; display: inline-flex; align-items: center; gap: 0.45rem;
  border-bottom: 3px solid transparent; white-space: nowrap; filter: none; }
.menu-button:hover, .menu-button:focus-visible, .menu-button[aria-expanded="true"] {
  color: var(--accent-ink); background: rgba(255, 255, 255, 0.08); filter: none; }
.menu.current > .menu-button { color: var(--accent-ink); font-weight: 650; border-bottom-color: var(--gold); }
/* The area tabs in the top bar are plain links: no dropdowns at the top level. */
.menu-link { color: var(--brand-tint); font-weight: 500; font-size: 0.95rem; padding: 1.05rem 0.8rem 0.95rem;
  display: inline-flex; align-items: center; border-bottom: 3px solid transparent; white-space: nowrap; text-decoration: none; }
.menu-link:hover, .menu-link:focus-visible { color: var(--accent-ink); background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.menu.current > .menu-link { color: var(--accent-ink); font-weight: 650; border-bottom-color: var(--gold); }
.caret { width: 0.42rem; height: 0.42rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); opacity: 0.8; }
.menu-list { position: absolute; top: 100%; left: 0; min-width: 15rem; list-style: none; margin: 0; padding: 0.35rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 950; }
.menu-list.menu-right { left: auto; right: 0; }
.menu-list a, .menu-item-button { display: block; width: 100%; text-align: left; padding: 0.5rem 0.75rem; border-radius: 4px;
  color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 400; background: none; border: 0; white-space: nowrap; }
.menu-list a:hover, .menu-list a:focus, .menu-item-button:hover, .menu-item-button:focus {
  background: var(--brand-tint); color: var(--brand); filter: none; text-decoration: none; }
.menu-list a[aria-current="page"] { font-weight: 650; color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.menu-list .menu-heading { margin-top: 0.6rem; padding: 0.85rem 0.75rem 0.3rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; }
.menu-list .menu-heading:first-child { margin-top: 0; padding-top: 0.3rem; border-top: 0; }
.menu-list .soon, .subnav .soon { color: var(--muted); font-size: 0.8rem; font-weight: 400; }
.topbar .signout { margin: 0; }
.topbar .who { color: var(--accent-ink); }

/* -- the current area, as tabs under the top bar ------------------------------ */
.subnav { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 3.4rem; z-index: 800; }
.subnav > ul { list-style: none; margin: 0 auto; padding: 0 1.5rem; display: flex; gap: 0.25rem; overflow-x: auto; max-width: 90rem; }
.subnav > ul > li > a { display: block; padding: 0.7rem 0.85rem 0.6rem; color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 3px solid transparent; font-size: 0.93rem; }
.subnav > ul > li > a:hover, .subnav > ul > li > a:focus { color: var(--ink); }
.subnav > ul > li > a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }

/* -- type --------------------------------------------------------------------- */
h1 { font-size: 1.9rem; letter-spacing: -0.01em; margin: 0.25rem 0 0.75rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.crumb { margin: 0 0 0.25rem; }

/* -- tables ------------------------------------------------------------------- */
table { margin: 0.75rem 0 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate;
  border-spacing: 0; overflow: hidden; }
th { text-transform: none; letter-spacing: 0; font-size: 0.85rem; font-weight: 650; color: var(--muted);
  background: var(--head); border-bottom: 1px solid var(--line); white-space: nowrap; }
th, td { padding: 0.6rem 0.85rem; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfc; }
.roster.plain td:last-child, .roster td:last-child { display: table-cell; }
td .muted, td.notes { font-size: 0.9rem; }
td.nowrap, th.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 0.92rem; }
tfoot td { background: var(--head); font-weight: 600; }

/* -- tags --------------------------------------------------------------------- */
.tag { text-transform: none; letter-spacing: 0; font-size: 0.78rem; font-weight: 600; padding: 0.1rem 0.55rem; white-space: nowrap; }

/* -- the filter bar and list tools: one shape on every list page --------------- */
.filters { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem;
  margin: 1rem 0 0.75rem; gap: 0.6rem; align-items: center; }
.filters input[type="search"], .filters input[type="text"], .filters input[type="date"], .filters select {
  height: var(--control-h); padding: 0 0.7rem; border: 1px solid var(--line); border-radius: 4px; font: inherit;
  font-size: 0.95rem; background: var(--paper); }
.filters input[type="search"] { flex: 1 1 16rem; }
.filters label { color: var(--muted); font-size: 0.9rem; }
.filters button { height: var(--control-h); }
.listtools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.25rem 0 0.75rem; max-width: none; }

/* -- buttons and form controls ------------------------------------------------- */
button, .button { border-radius: 4px; line-height: 1.2; text-decoration: none; }
button.small, .button.small { font-size: 0.88rem; padding: 0.4rem 0.8rem; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="time"],
input[type="datetime-local"], input[type="search"], input[type="file"], input[type="url"], input[type="password"], select, textarea {
  font: inherit; font-size: 0.95rem; border: 1px solid var(--line); border-radius: 4px; padding: 0.45rem 0.6rem; background: var(--paper); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 1px; }
.stack { max-width: 40rem; }
.stack label { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.85rem; font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.stack label input, .stack label select, .stack label textarea { font-weight: 400; }
.stack label.check { flex-direction: row; align-items: center; gap: 0.5rem; }
.errorlist { color: var(--danger); margin: -0.5rem 0 0.75rem; padding-left: 1.1rem; font-size: 0.9rem; }

/* -- form panels (in place of expanding sections) ------------------------------- */
dialog.panel { border: 0; border-radius: 8px; padding: 0; width: min(38rem, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem); box-shadow: var(--shadow); color: var(--ink); }
/* Every modal sits in the middle of the window. A modal <dialog> is centred
   by margin: auto; the card class .panel (app.css) shares the name and sets a
   bottom margin, which pinned form panels to the bottom of the screen. */
dialog:modal { margin: auto; }
dialog.panel::backdrop { background: rgba(27, 31, 35, 0.45); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 1; }
.panel-head h2 { margin: 0; font-size: 1.15rem; }
.panel-close { background: none; border: 0; color: var(--muted); font-size: 1.5rem; line-height: 1; padding: 0.1rem 0.4rem; }
.panel-close:hover { color: var(--ink); filter: none; }
dialog.panel > :not(.panel-head) { margin-left: 1.25rem; margin-right: 1.25rem; }
dialog.panel > :last-child { margin-bottom: 1.25rem; }
dialog.panel form { margin-top: 1rem; }
dialog.panel .inline-form { flex-direction: column; align-items: stretch; }
dialog.panel .inline-form label { width: 100%; }
dialog.panel .stack { max-width: none; }
body.readonly .edit-only { display: none; }
.note-block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.25rem 1.25rem 0.75rem; margin: 1rem 0; }

/* -- stat tiles ------------------------------------------------------------------- */
.stats { gap: 0.85rem; }
.stat { border-radius: var(--radius); padding: 0.85rem 1rem; text-decoration: none; color: var(--ink); }
.stat .n { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 0.9rem; }

/* -- small screens ------------------------------------------------------------------ */
@media (max-width: 1100px) {
}
@media (max-width: 700px) {
  .layout main, main { padding: 1.25rem 1rem 3rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table { display: block; overflow-x: auto; }
}

/* -- page head: the title on the left, the page's actions on the right -------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; margin: 0.25rem 0 0.75rem; }
.page-head h1 { margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.lede { color: var(--muted); margin: 0 0 1rem; }

/* -- the tab strip keeps its More menu visible (no clipping) ------------------------ */
.subnav > ul { overflow: visible; flex-wrap: wrap; }
.subnav .menu-button.subnav-more { color: var(--muted); padding: 0.7rem 0.85rem 0.6rem; border-bottom: 3px solid transparent; font-size: 0.93rem; }
.subnav .menu-button.subnav-more:hover, .subnav .menu-button.subnav-more[aria-expanded="true"] { color: var(--ink); background: none; }
.subnav .menu.current > .menu-button { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
/* Fitted by static/topbar.js: one line, the tabs that do not fit moved into
   More. Without the script the strip wraps instead (above). */
.subnav.fitted > ul { flex-wrap: nowrap; }
.subnav.fitted > ul > li { flex: none; }
.subnav .menu-button.subnav-more { white-space: nowrap; }
/* A long area's dropdowns scroll rather than run off the bottom of the screen. */
.subnav .menu-list { max-height: calc(100vh - 8rem); max-height: calc(100dvh - 8rem); overflow-y: auto; overscroll-behavior: contain; }
/* With room for no tabs (a phone) the strip is one dropdown named after the
   current page, as wide as the screen allows. */
.subnav .subnav-overflow.all { flex: 1 1 auto; min-width: 0; }
.subnav .subnav-overflow.all > .menu-button { width: 100%; justify-content: space-between; color: var(--brand); font-weight: 650; border-bottom-color: var(--brand); }
.subnav .subnav-overflow.all .subnav-more-label { overflow: hidden; text-overflow: ellipsis; }

[hidden] { display: none !important; }

/* -- long record forms: two columns of fields on a wide screen ---------------------- */
.stack.fields-grid { max-width: 56rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.75rem; }
.stack.fields-grid > label:has(textarea), .stack.fields-grid > .actions, .stack.fields-grid > ul.errorlist,
.stack.fields-grid > input[type="hidden"] + label:has(textarea) { grid-column: 1 / -1; }
.stack.fields-grid small.muted { font-weight: 400; }
@media (max-width: 800px) { .stack.fields-grid { grid-template-columns: minmax(0, 1fr); } }

/* A checkbox field: the box first, then its label, on one line. */
.stack label:has(> input[type="checkbox"]) { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 0.6rem; font-weight: 500; }
.stack label:has(> input[type="checkbox"]) small { display: none; }

/* Tabs inside a page (e.g. Record changes / Events on the audit log) */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin: 0.5rem 0 1rem; }
.tabs a, .tabs span { padding: 0.55rem 0.9rem 0.5rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs [aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; }
/* On a narrow screen the tabs stay on one line and scroll sideways. */
@media (max-width: 700px) {
  .tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
  .tabs a, .tabs span { white-space: nowrap; flex: none; margin-bottom: 0; padding-left: 0.7rem; padding-right: 0.7rem; }
}

/* Manage access: give someone access, by picking them */
.grant-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; margin: 1rem 0 0.25rem;
  padding: 0.85rem 1rem; background: var(--brand-tint); border-radius: var(--radius); }
.grant-bar label { font-weight: 650; }
.grant-bar .picker { flex: 1 1 22rem; max-width: 32rem; }

/* A record's facts: label above value, in columns, not a full-width two-column table */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0; margin: 0.75rem 0 1.5rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.facts > div { padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 0; }
.facts dt { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.15rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .sub { display: block; color: var(--muted); font-size: 0.88rem; }
.facts .facts-wide { grid-column: 1 / -1; border-right: 0; }

/* Narrow screens: the tab strip wraps; its dropdowns open full width under
   it. (The top bar itself is static/topbar.css.) */
@media (max-width: 700px) {
  .subnav { position: relative; }
  .subnav > ul { padding: 0 0.5rem; gap: 0; }
  .subnav .menu-button { padding: 0.6rem 0.55rem; }
  .menu-list { max-width: calc(100vw - 2rem); }
}
@media (max-width: 700px) {
  .menu { position: static; }
  .menu-list, .menu-list.menu-right { left: 0.75rem; right: 0.75rem; min-width: 0; max-width: none; top: 100%; }
}
.menu-list a[aria-current="page"] { border: 0; }

/* People > Parents: one block per family */
.families { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 1rem; }
.family { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.85rem 1.1rem; }
.family h2 { font-size: 1.05rem; margin: 0 0 0.6rem; display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }

/* -- selects (drop-down lists): one themed look everywhere -------------------
   The browser's own select is grey and glossy on macOS and differs on every
   system. This drops it for the same border, radius and paper background as
   the text boxes, with our own chevron. Kept last in this file so it wins
   over the older per-area select rules in app.css. See docs/ui-guidelines.md,
   "Selects". A multi-line select ([multiple] or [size]) keeps the list box. */
select:not([multiple]):not([size]) {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  min-height: var(--control-h); padding: 0 2rem 0 0.7rem; line-height: 1.2;
  border: 1px solid var(--line); border-radius: 4px; color: var(--ink); cursor: pointer;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235b6570' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 0.75rem auto;
  transition: border-color 0.12s ease; }
select:not([multiple]):not([size]):hover { border-color: var(--muted); }
select:focus-visible { border-color: var(--brand); }
select:disabled { cursor: not-allowed; color: var(--muted); background-color: var(--head); opacity: 0.8; }
select option { color: var(--ink); background: var(--paper); }
.roster select:not([multiple]):not([size]), .bulk-bar select:not([multiple]):not([size]) {
  min-height: 2rem; font-size: 0.9rem; }

/* -- app launcher (the "waffle"), far left of the top bar, as in Microsoft 365.
   Links to the team's other systems: Administration Tools (apps.admintools). ------ */
.topbar .waffle { margin-left: -0.75rem; margin-right: -0.5rem; flex: 0 0 auto; align-self: stretch; }
.waffle-button { padding: 0 0.8rem; min-height: 3.4rem; border-bottom: 0; }
.waffle-button svg { fill: currentColor; display: block; }
/* Three fixed-width tiles a row. Names and descriptions wrap inside their tile
   (the menu links' nowrap would push them into their neighbours) and stop at
   two lines; the full text is in the tile's tooltip. */
.waffle-panel { width: 25rem; max-width: calc(100vw - 1rem); padding: 0.85rem; }
.waffle-head { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.6rem 0.25rem; }
.waffle-title { margin: 0; font-weight: 650; font-size: 0.95rem; color: var(--ink); }
.waffle-search { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 0.9rem; padding: 0.4rem 0.6rem;
  border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); }
.waffle-search:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.waffle-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; }
.waffle-grid > li { min-width: 0; }
.waffle-grid > li[hidden] { display: none; }
.menu-list .waffle-grid a { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; text-align: center;
  height: 100%; padding: 0.75rem 0.35rem; border-radius: var(--radius); color: var(--ink); text-decoration: none;
  white-space: normal; overflow-wrap: anywhere; }
.waffle-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 10px; flex: 0 0 auto;
  background: var(--brand); color: var(--accent-ink); }
.waffle-label, .waffle-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  max-width: 100%; overflow-wrap: break-word; }
.waffle-label { font-size: 0.85rem; font-weight: 600; line-height: 1.25; }
.waffle-desc { font-size: 0.75rem; color: var(--muted); line-height: 1.25; }
.waffle-none { margin: 0.5rem 0.25rem; color: var(--muted); font-size: 0.9rem; }
/* Not a menu item: .menu-list a would make it a full-width block and squeeze the search to nothing. */
.topbar .waffle-edit { flex: 0 0 auto; width: auto; padding: 0.3rem 0.25rem; font-size: 0.82rem; color: var(--muted); text-decoration: none; }
.topbar .waffle-edit:hover, .topbar .waffle-edit:focus-visible { color: var(--brand); text-decoration: underline; background: none; }
.waffle-foot { margin: 0.6rem 0.25rem 0; padding-top: 0.55rem; border-top: 1px solid var(--line); font-size: 0.88rem; }
@media (max-width: 700px) {
  .topbar .waffle { margin-left: -0.5rem; margin-right: 0; }
}
@media (max-width: 420px) {
  .waffle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Admin > App shortcuts: the list, and the icon picker in its panels. */
.waffle-icon.small { width: 2.1rem; height: 2.1rem; border-radius: 7px; flex: 0 0 auto; }
.shortcut-name { display: inline-flex; align-items: center; gap: 0.7rem; }
.shortcuts-table td { vertical-align: middle; }
.shortcuts-table .move-form { display: inline-flex; gap: 0.3rem; margin: 0; }
.shortcuts-table .actions-cell { text-align: right; }
.shortcuts-table .actions-cell > * { margin-left: 0.3rem; }
.stack .hint { font-weight: 400; font-size: 0.82rem; color: var(--muted); }
.icon-picker { border: 0; margin: 0 0 0.85rem; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); gap: 0.4rem; }
.icon-picker legend { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.45rem; padding: 0; }
.stack .icon-choice { position: relative; flex-direction: column; align-items: center; gap: 0.3rem; margin: 0;
  padding: 0.55rem 0.25rem 0.45rem; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  font-weight: 400; font-size: 0.78rem; text-align: center; }
.icon-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.icon-choice .waffle-icon { width: 2.4rem; height: 2.4rem; border-radius: 8px; background: var(--head); color: var(--ink); }
.stack .icon-choice:hover { border-color: var(--muted); }
.stack .icon-choice:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); font-weight: 650; }
.icon-choice:has(input:checked) .waffle-icon { background: var(--brand); color: var(--accent-ink); }
.icon-choice:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 1px; }

/* The bottom-right corner: + (quick actions: forms that open in the page modal)
   beside Ask (the AI assistant). Hidden while the assistant's panel is open. */
.corner-actions { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 960;
  display: flex; align-items: center; gap: 0.5rem; }
body.assistant-open .corner-actions { display: none; }
.corner-actions .corner-new { width: 2.65rem; height: 2.65rem; padding: 0; justify-content: center;
  border-radius: 999px; border: 0; background: var(--brand); color: var(--accent-ink); box-shadow: var(--shadow); }
.corner-actions .corner-new:hover, .corner-actions .corner-new:focus-visible,
.corner-actions .corner-new[aria-expanded="true"] { background: var(--brand); filter: brightness(1.15); color: var(--accent-ink); }
.corner-actions .corner-new[aria-expanded="true"] svg { transform: rotate(45deg); }
.corner-actions .corner-new svg { transition: transform 0.15s ease; }
.menu-list.menu-up { top: auto; bottom: calc(100% + 0.5rem); min-width: 13rem; }
@media print { .corner-actions { display: none !important; } }

/* Notifications: the bell in the top bar and its list (apps.today.notices). */
.notices-button { position: relative; }
.notices-badge { position: absolute; top: 0.55rem; right: 0.3rem; min-width: 1.05rem; height: 1.05rem; padding: 0 0.25rem;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.68rem; font-weight: 700; line-height: 1.05rem;
  text-align: center; }
.notices-badge[hidden] { display: none; }
.notices-list { width: min(26rem, calc(100vw - 2rem)); max-height: min(70vh, 34rem); overflow-y: auto; overflow-x: hidden; padding: 0.35rem 0.5rem 0.5rem; }
.notices-list .notices-none { margin: 0.5rem 0.25rem; color: var(--muted); }
.notices-list .notices-foot { margin: 0.4rem 0.25rem 0; padding-top: 0.45rem; border-top: 1px solid var(--line); font-size: 0.9rem; }
.notices-list a { display: inline; width: auto; padding: 0; white-space: normal; }
.notices-list .menu-heading { margin: 0; list-style: none; }
.notices-list:focus { outline: none; }
/* Two parts: Updates (each cleared with its ×, or Clear all) and Needs attention (stays). */
.notices-part + .notices-part { margin-top: 0.5rem; padding-top: 0.35rem; border-top: 1px solid var(--line); }
.notices-part-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin: 0.45rem 0.25rem 0.15rem; }
.notices-part-head h3 { margin: 0; font-size: 0.92rem; font-weight: 650; }
.notices-part-count { display: inline-block; min-width: 1.2rem; margin-left: 0.2rem; padding: 0 0.35rem; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 1.2rem; text-align: center; vertical-align: 0.08rem; }
.notices-part-hint { color: var(--muted); font-size: 0.8rem; }
.notices-list .notices-clear-all { background: none; border: 0; padding: 0.1rem 0.25rem; color: var(--brand); font: inherit; font-size: 0.85rem;
  cursor: pointer; border-radius: 4px; width: auto; }
.notices-list .notices-clear-all:hover, .notices-list .notices-clear-all:focus-visible { text-decoration: underline; }
.notices-updates ul { list-style: none; margin: 0; padding: 0; }
.nt-update { align-items: flex-start; }
.nt-update .notice-dot { background: var(--brand); transform: translateY(0.4rem); }
.nt-update .notice-body { flex: 1 1 auto; }
.nt-update:hover { background: var(--hover, rgba(0, 0, 0, 0.035)); }
.notices-list .notice-clear { flex: 0 0 auto; width: 1.6rem; height: 1.6rem; margin: -0.1rem 0 0; padding: 0; border: 0; border-radius: 4px;
  background: none; color: var(--muted); font-size: 1.15rem; line-height: 1; cursor: pointer; }
.notices-list .notice-clear:hover, .notices-list .notice-clear:focus-visible { color: var(--ink); background: var(--line); }
.notices-area h4 { margin: 0.6rem 0.25rem 0.25rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.notices-area ul { list-style: none; margin: 0; padding: 0; }
.nt { display: flex; gap: 0.55rem; align-items: baseline; padding: 0.35rem 0.25rem; border-radius: 4px; }
.notice-dot { flex: 0 0 auto; width: 0.55rem; height: 0.55rem; border-radius: 999px; background: var(--muted); transform: translateY(-0.05rem); }
.nt-bad .notice-dot { background: var(--danger); }
.nt-warn .notice-dot { background: var(--gold, #c69214); }
.notice-body { min-width: 0; }
.notice-detail { display: block; color: var(--muted); font-size: 0.85rem; }
.period .notices { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem 0.75rem 0.6rem; }

/* Today, This week and This month (templates/today/period.html). */
.period-section { margin-bottom: 1.75rem; }
.period-section .ov-head .count { color: var(--muted); font-weight: 400; font-size: 0.95rem; }
.period .cal-list-day h3 { margin: 0.9rem 0 0.35rem; font-size: 1rem; }
.period-week tr.is-today td { background: var(--wash); }
.period-week .tag { margin: 0 0.2rem 0.2rem 0; }
.period-jobs, .period-links { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.period-jobs li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.period-jobs li:last-child { border-bottom: 0; }
.period-jobs .muted { display: block; }
.period-links li { padding: 0.15rem 0; }
.period-links a[aria-current="page"] { font-weight: 650; }
/* Muted words and an empty state, still used outside My day (templates/projects/_add_form.html). */
.md-empty { margin: 0; color: var(--muted); }
/* The icon picker on Admin > Team notices: one tile per icon, the chosen one ringed. */
.icon-picker { display: flex; flex-wrap: wrap; gap: 0.3rem; border: 0; padding: 0; margin: 0; }
.icon-picker legend { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.25rem; }
.icon-picker .icon-group { flex: 0 0 100%; margin-top: 0.35rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.icon-picker .icon-choice { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--paper);
  font-size: 1.3rem; line-height: 1; cursor: pointer; }
.icon-picker .icon-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.icon-picker .icon-choice:hover { border-color: var(--gold); }
.icon-picker .icon-choice:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); background: var(--gold-wash); }
.icon-picker .icon-choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.icon-picker .icon-none { color: var(--muted); font-size: 1.1rem; }
.notice-icon { font-size: 1.15rem; }
.md-meta { color: var(--muted); font-size: 0.86rem; font-weight: 400; }

/* A top-bar panel shows every page at once (29 Nov 2026): a column per area,
   and per section, under its name; an area of one page is its name as a link.
   Its line (navigation.AREA_BLURBS) sits under the name. */
.mega-cols { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 0.9rem 1.25rem; align-items: start; padding: 0.75rem 1rem 1rem; }
.mega-col { min-width: 0; }
.mega-col-head { margin: 0; padding: 0.42rem 0.6rem 0.15rem; font-size: 0.93rem; font-weight: 650; color: var(--ink); line-height: 1.25; }
.mega-col-head.current { color: var(--brand); }
.topbar .mega-panel a.mega-col-link { display: block; padding: 0.42rem 0.6rem 0.15rem; border-radius: 6px; font-size: 0.93rem;
  font-weight: 650; color: var(--ink); line-height: 1.25; }
.topbar .mega-panel a.mega-col-link:hover, .topbar .mega-panel a.mega-col-link:focus-visible { background: #f1f4f3; color: var(--brand); }
.topbar .mega-panel a.mega-col-link[aria-current="page"] { background: var(--brand-tint); color: var(--brand); }
.mega-col-desc { margin: 0; padding: 0 0.6rem 0.35rem; font-size: 0.78rem; line-height: 1.35; color: var(--muted); }
