/* The shell of every signed-in page (and the sign-in page): the Night Shift header with its profile menu, the page's water art, the
   three-column footer and the Feedback pop-up (Issues #4674, #4675, #4676). Roles from tokens.css only; the fixed navy, the footer fills and the
   water lines are pictures (static/brand/hdr-night.svg, hdr-water.svg, footer-light.svg, footer-dark.svg, water-c-*.svg) because they are
   the same in both themes or exact colours that are not tokens yet. */

/* The page: the prototype's ground (#EAEFF4 in light, the ground role in dark) with the bend of water in the bottom right corner.
   The footer has its own solid fill and covers it. The text is the prototype's 13px on 18px IBM Plex Sans (shell.css body). */
body { font: 400 13px/18px var(--ox-font-data); background: var(--ox-night-page-light) url(/static/brand/water-c-light.svg) center / cover no-repeat fixed; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body { background-color: var(--ox-ground); background-image: url(/static/brand/water-c-dark.svg); }
  :root:not([data-theme="light"]) .site-footer { background-image: url(/static/brand/footer-dark.svg); }
}
:root[data-theme="dark"] body { background-color: var(--ox-ground); background-image: url(/static/brand/water-c-dark.svg); }
:root[data-theme="dark"] .site-footer { background-image: url(/static/brand/footer-dark.svg); }

/* The page title and the card of the prototype (shell.css h1, .box, .nt): 19px on 24px Figtree in the ink colour with no rule under it,
   and a white (surface) card with a 14px corner and the soft shadow. */
main h1 { margin: 0; font: 700 19px/24px var(--ox-font-ui); color: var(--ox-ink); }
.box, details.panel { background: var(--ox-surface); border-radius: var(--ox-radius-lg); box-shadow: var(--ox-night-card-shadow); padding: 12px 14px; }
.nt { font-size: 12px; line-height: 16px; color: var(--ox-muted); }
/* Buttons (shared by admin and member pages): 12.5px, the go fill for the primary, the grey fill for the quiet one. */
.btn { font-size: 12.5px; color: var(--ox-ink); background: var(--ox-fill); }
.btn:hover { background: var(--ox-fill-hover); }
.btn.primary, .btn.go { color: var(--ox-on-go); background: var(--ox-go); }
.btn.primary:hover, .btn.go:hover { color: var(--ox-on-go); background: var(--ox-go); filter: brightness(1.12); text-decoration: none; }
.btn.quiet { color: var(--ox-ink); background: var(--ox-fill); }
.btn.quiet:hover { background: var(--ox-fill-hover); }
h3.bt { margin: 0 0 8px; font: 700 13.5px/18px var(--ox-font-ui); color: var(--ox-ink); }

/* Header: navy in both themes, water lines rising off the top before the profile. The navy is the token that holds #22304A in each theme
   (--ox-current in light, --ox-surface-overlay in dark), as a plain colour: browser_check.py reads only rgb() backgrounds, so a color-mix()
   ground was read as white and the white links failed contrast. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-header { background-color: var(--ox-surface-overlay); }
}
:root[data-theme="dark"] .site-header { background-color: var(--ox-surface-overlay); }
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  color: white;
  background-color: var(--ox-current);
  background-image: url(/static/brand/hdr-water.svg), url(/static/brand/hdr-night.svg);
  background-position: right 250px center, center;
  background-size: auto 100%, 100% 100%;
  background-repeat: no-repeat;
  box-shadow: var(--ox-night-hdr-shadow);
}
.header-bar { max-width: none; margin: 0; min-height: 56px; padding: 0 var(--ox-space-4); gap: var(--ox-space-1) var(--ox-space-3); font-family: var(--ox-font-ui); }
/* The brand: the ShiftMate logo with the version or channel line under it (the prototype's header). The org badge stays in the page for
   screen readers and is not drawn. */
.brand { display: flex; flex-direction: column; align-items: flex-start; flex: none; gap: 1px; }
.site-header .site-name, .site-header .site-name:hover { display: block; padding: 2px 0; margin: -2px 0; line-height: 0; color: var(--ox-night-ink); text-decoration: none; }
.brand-logo { display: block; height: 22px; width: auto; }
.brand .org-badge { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.site-header .brand .badge, .site-header .brand a.badge:hover { padding: 0; border-radius: 0; background: transparent; color: var(--ox-night-hdr-link); font: 500 10.5px/12px var(--ox-font-ui); text-decoration: none; }
.site-header .brand a.badge:hover { text-decoration: underline; }
.site-header a:focus-visible, .site-header button:focus-visible { outline: 3px solid var(--ox-focus); outline-offset: 2px; box-shadow: 0 0 0 2px white; }

.site-nav { margin: 0 0 0 var(--ox-space-3); padding: 0; max-width: none; }
.main-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
/* The links are the prototype's 34px pills (9px corner, 12px of side padding); the link itself keeps a 44px target and the pill is its ::before. */
.main-links a { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 44px; padding: 0 var(--ox-space-3); color: var(--ox-night-hdr-link); font-weight: 500; text-decoration: none; }
.main-links a::before { content: ""; position: absolute; z-index: -1; inset: 5px 0; border-radius: 9px; }
.main-links a:hover { color: var(--ox-night-hdr-link); text-decoration: none; }
.main-links a:hover::before { background: var(--ox-night-hdr-hover); }
.main-links a[aria-current="page"], .main-links a[aria-current="page"]:hover { color: white; font-weight: 600; }
.main-links a[aria-current="page"]::before { background: var(--ox-night-hdr-current); }

/* The profile (prototype footer.js): the name opens My Information; the arrow opens a menu of My Information, Settings and Sign Out.
   The name and the arrow are 44px targets whose visible hover shapes (40px and 32px tall) are their ::before. */
.profile { position: relative; margin-left: auto; display: flex; align-items: center; gap: 2px; }
.profile-name, .profile-name:hover { position: relative; isolation: isolate; display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 8px 0 4px; color: white; text-decoration: none; }
.profile-name::before { content: ""; position: absolute; z-index: -1; inset: 2px 0; border-radius: 10px; }
a.profile-name:hover::before { background: var(--ox-night-hdr-name-hover); }
.profile-initials { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 12px/1 var(--ox-font-ui); color: white; background: var(--ox-night-hdr-avatar); }
.profile-text b { display: block; font: 600 13px/16px var(--ox-font-ui); color: white; }
.profile-text small { display: block; font: 400 12px/14px var(--ox-font-data); color: var(--ox-night-hdr-role); }
.profile-toggle { position: relative; isolation: isolate; display: grid; place-items: center; width: 28px; min-width: 28px; min-height: 44px; padding: 0; border: 0; background: transparent; color: white; cursor: pointer; }
.profile-toggle::before { content: ""; position: absolute; z-index: -1; inset: 6px 0; border-radius: 8px; }
.profile-toggle:hover::before, .profile-toggle[aria-expanded="true"]::before { background: var(--ox-night-hdr-toggle); }
.profile-toggle svg { width: 14px; height: 14px; display: block; transition: transform 0.15s; }
.profile-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .profile-toggle svg { transition: none; } }
/* The menu is the prototype's card: 200px wide, 12px corner, 6px of padding, a hairline ring and a soft drop. Its items are the prototype's
   (icon, 9px gap, 10px of side padding, 8px corner) and the prototype's 34px tall; the 44px touch target is the invisible ::after,
   5px past the row above and below (as Settings' section list does; Patrick, 11/2/2026). */
.profile-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; padding: 6px; background: var(--ox-surface); color: var(--ox-ink); border-radius: 12px; box-shadow: 0 0 0 1px var(--ox-night-hair-light), var(--ox-night-menu-drop); font: 500 13px/18px var(--ox-font-ui); }
.profile-menu a, .profile-menu button { position: relative; display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.profile-menu a::after, .profile-menu button::after { content: ""; position: absolute; inset: -5px 0; }
.profile-menu a:hover, .profile-menu button:hover { background: var(--ox-night-fill-light); color: inherit; text-decoration: none; }
.profile-menu a:focus-visible, .profile-menu button:focus-visible { outline: 2px solid var(--ox-focus); outline-offset: -2px; box-shadow: none; background: var(--ox-night-fill-light); color: inherit; text-decoration: none; }
.profile-menu svg { flex: none; width: 15px; height: 15px; color: var(--ox-muted); }
.profile-menu hr { border: 0; border-top: 1px solid var(--ox-night-hair-light); margin: 5px 4px; }
.profile-menu form { margin: 0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .profile-menu { box-shadow: 0 0 0 1px var(--ox-night-hair-dark), var(--ox-night-menu-drop); }
  :root:not([data-theme="light"]) .profile-menu a:hover, :root:not([data-theme="light"]) .profile-menu button:hover { background: var(--ox-night-fill-dark); }
  :root:not([data-theme="light"]) .profile-menu a:focus-visible, :root:not([data-theme="light"]) .profile-menu button:focus-visible { outline: 2px solid var(--ox-focus); background: var(--ox-night-fill-dark); }
  :root:not([data-theme="light"]) .profile-menu hr { border-top-color: var(--ox-night-hair-dark); }
}
:root[data-theme="dark"] .profile-menu { box-shadow: 0 0 0 1px var(--ox-night-hair-dark), var(--ox-night-menu-drop); }
:root[data-theme="dark"] .profile-menu a:hover, :root[data-theme="dark"] .profile-menu button:hover { background: var(--ox-night-fill-dark); }
:root[data-theme="dark"] .profile-menu a:focus-visible, :root[data-theme="dark"] .profile-menu button:focus-visible { outline: 2px solid var(--ox-focus); background: var(--ox-night-fill-dark); }
:root[data-theme="dark"] .profile-menu hr { border-top-color: var(--ox-night-hair-dark); }

@media (max-width: 719px) {
  .site-header { background-position: right 120px center, center; }
  .site-nav { order: 3; width: 100%; margin: 0 0 var(--ox-space-1); }
  .main-links a { padding: 0 var(--ox-space-2); }
  .profile-text small { display: none; }
}

/* Footer: the links on the left, Feedback and the theme in the middle, Powered by Oxbow on the right, on a solid fill. */
.site-footer {
  position: relative;
  z-index: 1;
  color: var(--ox-muted);
  background: var(--ox-shallows) url(/static/brand/footer-light.svg) center / 100% 100% no-repeat;
  border-top: 1px solid var(--ox-line);
}
/* The sizes are the prototype's footer (footer.js): 12px text on 18px lines, 10px and 16px of padding, a 16px wordmark. */
.footer-bar { max-width: none; margin: 0; padding: 10px var(--ox-space-4); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px 18px; align-items: center; font-size: 12px; line-height: 18px; color: var(--ox-muted); }
.footer-bar a { color: var(--ox-org-hue-2-text); }
.footer-bar a:hover { color: var(--ox-org-hue-2-text); }
.footer-left { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; min-width: 0; }
.footer-left .footer-links { margin: 0; gap: 12px; }
.footer-center { display: flex; align-items: center; justify-content: center; gap: 10px; }
.footer-powered { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 0; min-width: 0; }
.footer-powered a { display: inline-flex; align-items: center; }
.footer-powered img { height: 16px; width: auto; display: block; }
.footer-feedback { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px; font-weight: 500; text-decoration: none; white-space: nowrap; background: color-mix(in srgb, var(--ox-ink) 5.5%, transparent); }
.footer-feedback:hover { text-decoration: underline; }
/* The pill and the theme switch are 5.5% of the ink in light and 7% in dark (the prototype's fill). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .footer-feedback, :root:not([data-theme="light"]) .footer-center .theme-switch { background: color-mix(in srgb, var(--ox-ink) 7%, transparent); }
}
:root[data-theme="dark"] .footer-feedback, :root[data-theme="dark"] .footer-center .theme-switch { background: color-mix(in srgb, var(--ox-ink) 7%, transparent); }
.footer-bar a:focus-visible, .footer-bar button:focus-visible { outline: 3px solid var(--ox-focus); outline-offset: 2px; }

/* The theme choice: sun, half and moon (the buttons keep their words for screen readers; static/theme.js sets and remembers the choice). */
.footer-center .theme-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: color-mix(in srgb, var(--ox-ink) 5.5%, transparent); }
.footer-center .theme-switch[hidden] { display: none; }
.footer-center .theme-switch .btn { display: grid; place-items: center; position: relative; width: 30px; min-width: 30px; height: 24px; min-height: 24px; padding: 0; border: 0; border-radius: var(--ox-radius-sm); font-size: 0; line-height: 0; color: var(--ox-muted); background: transparent; }
.footer-center .theme-switch .btn:hover { background: color-mix(in srgb, var(--ox-ink) 8%, transparent); }
.footer-center .theme-switch .btn[aria-pressed="true"] { color: var(--ox-ink); background: var(--ox-surface); box-shadow: var(--ox-shadow-1); font-weight: 400; }
.footer-center .theme-switch .btn::before { content: ""; width: 15px; height: 15px; background: currentColor; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.footer-center .theme-switch [data-theme-choice="light"]::before { -webkit-mask-image: url(/static/brand/theme-sun.svg); mask-image: url(/static/brand/theme-sun.svg); }
.footer-center .theme-switch [data-theme-choice="auto"]::before { -webkit-mask-image: url(/static/brand/theme-half.svg); mask-image: url(/static/brand/theme-half.svg); }
.footer-center .theme-switch [data-theme-choice="dark"]::before { -webkit-mask-image: url(/static/brand/theme-moon.svg); mask-image: url(/static/brand/theme-moon.svg); }

@media (max-width: 979px) {
  .footer-bar { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .footer-left, .footer-powered { justify-content: center; }
}

/* "Feedback or a bug": a pop-up on every page (static/feedback.js fetches the form from /feedback?popup=1 into one <dialog class="popup">). */
.feedback-popup { width: 100%; max-width: min(480px, calc(100vw - 2 * var(--ox-space-4))); }
.feedback-popup form { margin: 0; }
.feedback-popup .fb-note { font-size: 14px; color: var(--ox-muted); }
.feedback-popup fieldset { border: 0; margin: 0 0 var(--ox-space-4); padding: 0; min-width: 0; }
.feedback-popup legend { padding: 0; font-size: 14px; font-weight: 600; margin-bottom: var(--ox-space-1); }
.fb-kinds { display: flex; flex-wrap: wrap; gap: var(--ox-space-2); }
.fb-kind { position: relative; margin: 0; }
.fb-kind input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.fb-kind span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--ox-space-3); border-radius: var(--ox-radius-md); font-weight: 500; background: var(--ox-neutral-bg); border: 2px solid transparent; }
.fb-kind input:checked + span { background: var(--ox-surface); border-color: var(--ox-lake); font-weight: 700; }
.fb-kind input:focus-visible + span { outline: 3px solid var(--ox-focus); outline-offset: 2px; }
.feedback-popup select, .feedback-popup textarea { margin-bottom: var(--ox-space-4); }
.feedback-popup .fb-check { display: flex; align-items: flex-start; gap: var(--ox-space-2); font-weight: 400; margin-bottom: var(--ox-space-4); }
.feedback-popup .fb-check input { margin-top: 4px; }
.fb-actions { display: flex; justify-content: flex-end; gap: var(--ox-space-2); }
.feedback-popup .done, .feedback-popup .alert { margin-bottom: var(--ox-space-4); }
.profile-menu { max-height: calc(100vh - 80px); overflow-y: auto; }
.profile-menu .menu-group, .nav-menu .menu-group { display: block; padding: 6px 10px 2px; color: var(--ox-muted); font: 600 11px/16px var(--ox-font-ui); letter-spacing: .04em; text-transform: uppercase; }

/* Header menus (Calendars, Trades): the profile menu's card, opened under the link on hover or keyboard focus. */
.main-links .nav-drop { position: relative; }
.main-links .nav-drop > a svg { width: 12px; height: 12px; margin-left: 4px; color: inherit; }
.nav-menu { display: none; position: absolute; left: 0; top: 100%; z-index: 30; min-width: 200px; padding: 6px; background: var(--ox-surface); color: var(--ox-ink); border-radius: 12px; box-shadow: 0 0 0 1px var(--ox-night-hair-light), var(--ox-night-menu-drop); font: 500 13px/18px var(--ox-font-ui); }
.nav-drop:hover > .nav-menu, .nav-drop:focus-within > .nav-menu { display: block; }
/* The rows are the prototype's 34px; the 44px target is the invisible ::after (5px past the row above and below). */
.main-links .nav-menu a { display: flex; align-items: center; min-height: 34px; padding: 0 10px; border-radius: 8px; color: inherit; font-weight: 500; white-space: nowrap; }
.main-links .nav-menu a::before { display: none; }
.main-links .nav-menu a::after { content: ""; position: absolute; inset: -5px 0; }
.nav-menu hr { border: 0; border-top: 1px solid var(--ox-night-hair-light); margin: 5px 4px; }
:root[data-theme="dark"] .nav-menu hr { border-top-color: var(--ox-night-hair-dark); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-menu { box-shadow: 0 0 0 1px var(--ox-night-hair-dark), var(--ox-night-menu-drop); }
  :root:not([data-theme="light"]) .main-links .nav-menu a:hover { background: var(--ox-night-fill-dark); }
  :root:not([data-theme="light"]) .nav-menu hr { border-top-color: var(--ox-night-hair-dark); }
}
/* On a narrow screen the nav is its own row: a menu opens under the whole row, from its left edge, so the last one (Admin) stays on screen. */
@media (max-width: 719px) {
  .site-nav { position: relative; }
  .main-links .nav-drop { position: static; }
}
.main-links .nav-menu a:hover { background: var(--ox-night-fill-light); color: inherit; }
.main-links .nav-menu a[aria-current="page"] { color: inherit; font-weight: 600; }
:root[data-theme="dark"] .nav-menu { box-shadow: 0 0 0 1px var(--ox-night-hair-dark), var(--ox-night-menu-drop); }
:root[data-theme="dark"] .main-links .nav-menu a:hover { background: var(--ox-night-fill-dark); }

/* A page with no card of its own (changelog, feedback, error pages, request an invite): its content in the prototype's white card, 12px under the title or the card above. */
.box.pc { margin-top: 12px; }
.box.pc > :last-child { margin-bottom: 0; }
.box.pc form + p { margin-top: 12px; }

/* Selected filter chips and toggles, one quiet look everywhere (Round 5): a light tint of the action colour, a 1.5px edge in the action colour
   (3:1 against the page in both themes), the ink colour for the text (well over 4.5:1) and a check mark so the state is not colour alone. */
:root { --sel-fill: color-mix(in srgb, var(--ox-go) 13%, var(--ox-surface)); --sel-edge: var(--ox-go); --sel-ink: var(--ox-ink); }
.chip.on, .ho-chip.on { background: var(--sel-fill); color: var(--sel-ink); box-shadow: inset 0 0 0 1.5px var(--sel-edge); font-weight: 600; }
.chip.on::before, .ho-chip.on::before, .chip input:checked + span::before { content: "\2713" / ""; font-weight: 700; margin-right: 4px; }
