/* ShiftMate page styles. Uses only the variables in tokens.css. Rounded corners, circles and arcs drawn with CSS only, no shadows. */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 400 13px/18px var(--ox-font-data);   /* the prototype's page text (shell.css has the same line, so a page without shell.css reads alike) */
  color: var(--ox-ink);
  background: var(--ox-ground);
  overflow-wrap: break-word;
}

h1, h2, h3 { font-weight: 700; color: var(--ox-ink); margin: 0 0 var(--ox-space-4); }
h1 { font-size: 19px; line-height: 24px; font-family: var(--ox-font-ui); }
h2 { font-size: 15px; line-height: 20px; font-family: var(--ox-font-ui); }
p { margin: 0 0 var(--ox-space-4); }

a { color: var(--ox-lake); }
a:hover { color: var(--ox-lake); text-decoration-thickness: 2px; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--ox-focus);
  outline-offset: 2px;
}

/* Skip link (#3612): off screen until it has focus, then top left above the header */
.skip-link { position: absolute; left: var(--ox-space-3); top: -100px; z-index: 10; padding: var(--ox-space-2) var(--ox-space-4); background: var(--ox-surface); color: var(--ox-org-hue-2-text); border-radius: var(--ox-radius-md); }
.skip-link:focus { top: var(--ox-space-2); }
main:focus { outline: none; }

/* The page's water art (the bend in the corner) is the body's background, in shell.css. */

/* Header */
.site-header { background: var(--ox-ground); }
@media (max-width: 719px) {
  .site-header::before { content: ""; display: block; height: 3px; background: var(--ox-org-stripe); }
}
.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ox-space-2) var(--ox-space-3);
  max-width: 960px;
  margin: 0 auto;
  padding: var(--ox-space-4);
}

.site-name { font-size: 20px; font-weight: 700; color: var(--ox-lake); text-decoration: none; }
.site-name:hover { color: var(--ox-lake); text-decoration: underline; }
.org-badge { display: inline-block; font-size: 12px; line-height: 1.4; font-weight: 700; color: var(--ox-org-accent-text); background: var(--ox-org-accent-tint);
  padding: var(--ox-space-1) var(--ox-space-3); border-radius: var(--ox-radius-full); }

a.badge { text-decoration: none; }
.badge {
  display: inline-block;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--ox-on-lake);
  background: var(--ox-org-hue-2);
  padding: var(--ox-space-1) var(--ox-space-3);
  border-radius: var(--ox-radius-full);
}

/* The Night Shift header, its profile menu, the three-column footer and the Feedback pop-up are in shell.css. */

/* Main and footer: the prototype's page area: 12px on 16px of padding, at most 1240px wide (the width its pages give their main), centred. */
main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1240px;
  min-width: 0;
  margin: 0 auto;
  padding: 12px var(--ox-space-4);
}

.narrow {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: 480px;
  background: var(--ox-surface);
  border-radius: var(--ox-radius-lg);
  padding: var(--ox-space-6);
}
.narrow::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -70px;
  right: -70px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 20px solid var(--ox-org-hue-2-tint);
  box-shadow: 0 0 0 20px var(--ox-org-hue-2-tint);
  pointer-events: none;
}

/* The footer is in shell.css. A link on a tinted red banner takes the banner's text colour. */
.age-banner.red a, .age-banner.red a:hover { color: inherit; }

/* The hidden attribute wins over any display rule below (a hidden field kept for password managers). */
[hidden] { display: none !important; }

/* Forms */
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: var(--ox-space-1); }

input[type="email"], input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="url"], input[type="time"], select, textarea {
  display: block;
  width: 100%;
  font-family: var(--ox-font-ui);
  font-size: 13px;
  line-height: 18px;
  color: var(--ox-ink);
  background: var(--ox-fill);
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 10px;
}
textarea { min-height: 96px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { color: var(--ox-muted); -webkit-text-fill-color: var(--ox-muted); opacity: 1; }
/* A touch-sized floor for every text-like field, whatever page or rule styles it (#255). Not checkboxes, radios or buttons. */
input:is([type="text"], [type="date"], [type="time"], [type="number"], [type="email"], [type="password"], [type="search"],
  [type="tel"], [type="url"], [type="datetime-local"], [type="month"]), input:not([type]), select, textarea { min-height: 30px; }
/* WebKit sizes a file input from its own button and text (347 px at 360 px on /settings); keep it inside the screen (#4468). */
input[type="file"] { max-width: 100%; }
.inline-form { margin: var(--ox-space-4) 0 0; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

input.code-input { font-size: 24px; letter-spacing: 0.3em; text-align: center; }

.btn {
  position: relative;   /* the ::after below is the 44 px tap area around the 32 px button */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  font-family: var(--ox-font-ui);
  font-size: 13px;
  line-height: 17px;
  font-weight: 600;
  color: var(--ox-on-lake);
  background: var(--ox-lake);
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.btn::after { content: ""; position: absolute; inset: -6px -2px; }

/* Messages */
.alert {
  color: var(--ox-org-hue-4-text);
  background: var(--ox-org-hue-4-tint);
  border: 2px solid var(--ox-org-hue-4);
  padding: var(--ox-space-3) var(--ox-space-4);
  margin-bottom: var(--ox-space-6);
  border-radius: var(--ox-radius-md);
  font-weight: 600;
}

.done {
  color: var(--ox-org-hue-3-text);
  background: var(--ox-org-hue-3-tint);
  border: 2px solid var(--ox-org-hue-3);
  padding: var(--ox-space-3) var(--ox-space-4);
  margin-bottom: var(--ox-space-6);
  border-radius: var(--ox-radius-md);
  font-weight: 600;
}

.test-box {
  color: var(--ox-org-hue-2-text);
  background: var(--ox-org-hue-2-tint);
  border: 2px solid var(--ox-org-hue-2);
  padding: var(--ox-space-3) var(--ox-space-4);
  margin-bottom: var(--ox-space-6);
  border-radius: var(--ox-radius-md);
  font-weight: 600;
}

/* Workflow placeholders: cheerful, but not clickable */
.workflow-list {
  list-style: none;
  margin: 0 0 var(--ox-space-6);
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;   /* 4 buttons a line on wide screens, 2 on tablets, 1 on phones (Patrick, 9/29) */
  gap: var(--ox-space-4);
}

.workflow {
  display: block;
  width: 100%;
  height: 100%;
  text-align: left;
  font-family: var(--ox-font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ox-ink);
  background: var(--ox-org-hue-2-tint);
  border: 0;
  border-radius: var(--ox-radius-lg);
  padding: var(--ox-space-6);
  cursor: default;
  opacity: 1;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.workflow::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -46px;
  right: -46px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 16px solid var(--section);
  opacity: 0.25;
  pointer-events: none;
}

/* Each section has one color (design/oxbow/oxbow-tokens.json, named in workflows.json): its buttons, its heading and the accent of its pages. */
.c-org-hue-2 { --section: var(--ox-org-hue-2); --section-tint: var(--ox-org-hue-2-tint); }
.c-lake { --section: var(--ox-lake); --section-tint: var(--ox-shallows); }
.c-success { --section: var(--ox-success); --section-tint: var(--ox-success-bg); }
.c-neutral { --section: var(--ox-neutral); --section-tint: var(--ox-neutral-bg); }
.c-warning { --section: var(--ox-warning); --section-tint: var(--ox-warning-bg); }
.c-org-accent { --section: var(--ox-org-accent); --section-tint: var(--ox-org-accent-tint); }

.workflow:disabled { color: var(--ox-ink); }
.workflow { background: var(--section-tint); border: 2px solid var(--section); padding: calc(var(--ox-space-4) - 2px); }

.workflow-name { display: block; font-size: 16px; font-weight: 700; line-height: 1.3; margin-bottom: var(--ox-space-2); color: var(--ox-ink); }

.workflow-summary { display: block; font-size: 14px; }

/* A workflow that works is a link: it lifts a little on hover and shows its focus ring. */
a.workflow { text-decoration: none; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
a.workflow:hover { transform: translateY(-2px); box-shadow: var(--ox-shadow-1); }
a.workflow:focus-visible { outline: 3px solid var(--ox-focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { a.workflow { transition: none; } a.workflow:hover { transform: none; } }
a.nav-item { text-decoration: none; cursor: pointer; font-weight: 600; }
a.nav-item:hover { text-decoration: underline; }

.workflow-note {
  display: inline-block;
  margin-top: var(--ox-space-3);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--ox-ink);
  background: var(--ox-surface);
  padding: var(--ox-space-1) var(--ox-space-3);
  border-radius: var(--ox-radius-full);
}

@media (min-width: 720px) {
  h1 { font-size: 32px; }
  .footer-bar { padding-left: var(--ox-space-8); padding-right: var(--ox-space-8); }
}

/* Read by screen readers, not shown: the page's main heading */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (min-width: 560px) { .workflow-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .workflow-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Tables and small parts shared by the 0.02.20 pages */
/* position: relative keeps absolutely placed text inside (.sr-only labels in a table's last column); without it they
   sit outside the scrolling box and push the whole page wider on a phone (#237, #238). */
.table-scroll { position: relative; overflow-x: auto; background: var(--ox-surface); border-radius: var(--ox-radius-md); margin-bottom: var(--ox-space-4); }
.plain-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.plain-table th, .plain-table td { text-align: left; vertical-align: top; padding: var(--ox-space-2) var(--ox-space-3); border-bottom: 1px solid var(--ox-org-hue-2-tint); }
.plain-table thead th { color: var(--ox-org-hue-2-text); background: var(--ox-org-hue-2-tint); }
.plain-table form { margin: 0; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--ox-org-hue-2-text); background: var(--ox-org-hue-2-tint);
  border-radius: var(--ox-radius-full); padding: 0 var(--ox-space-2); }
.narrow-form { max-width: 480px; }
.unit { font-size: 13px; color: var(--ox-muted); }
.setting-value { white-space: nowrap; }
.setting-value input[type="number"] { display: inline-block; width: 110px; margin: 0 var(--ox-space-2) 0 0; padding: var(--ox-space-2); }
.setting-value select { width: auto; margin: 0; padding: var(--ox-space-2); }
.phrase-box { font-size: 18px; font-weight: 700; background: var(--ox-surface); border: 2px dashed var(--ox-org-hue-2);
  border-radius: var(--ox-radius-md); padding: var(--ox-space-3) var(--ox-space-4); }
details.panel { background: var(--ox-surface); border-radius: var(--ox-radius-md); padding: var(--ox-space-3) var(--ox-space-4); margin-bottom: var(--ox-space-6); }
details.panel > summary { cursor: pointer; font-weight: 700; color: var(--ox-org-hue-2-text); }
details.panel[open] > summary { margin-bottom: var(--ox-space-3); }

/* The schedule age banner (0.02.30; docs/archive/plans/plan-0.02.30.md, 2.4) */
.age-line { color: var(--ox-muted); font-size: 12.5px; margin: 0 0 10px; }
.age-banner {
  color: var(--ox-ink);
  border: 0;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 18px;
  font-weight: 400;
}
.age-banner.yellow { background: var(--ox-warning-bg); box-shadow: inset 0 0 0 1px var(--ox-warning-line); }
.age-banner.orange { background: var(--ox-warning-bg); box-shadow: inset 0 0 0 1px var(--ox-warning-line); }
.age-banner.red { color: var(--ox-org-hue-4-text); background: var(--ox-org-hue-4-tint); box-shadow: inset 0 0 0 1px var(--ox-org-hue-4); }
.confirm-box {
  position: relative;
  max-width: 34rem;
  border: 2px solid var(--ox-org-hue-4);
  border-radius: var(--ox-radius-lg);
  background: var(--ox-surface);
  padding: var(--ox-space-6);
  margin: 0 auto var(--ox-space-6);
}
.feed-link-box ol { padding-left: var(--ox-space-6); }

/* Home: each section under its coloured heading. */
.section-heading { border-bottom: 3px solid var(--section); padding-bottom: var(--ox-space-1); }

/* The pop-up piece (templates/_popup.html, static/popup.js). */
.popup { max-width: min(560px, calc(100vw - 2 * var(--ox-space-4))); width: 100%; border: 2px solid var(--ox-org-hue-2); border-radius: var(--ox-radius-lg); padding: var(--ox-space-6); background: var(--ox-surface); color: var(--ox-ink); }
.popup::backdrop { background: var(--ox-scrim); }
.popup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ox-space-3); margin-bottom: var(--ox-space-3); }
.popup-head h2 { margin: 0; font-size: 20px; }
.popup-close { font: inherit; font-size: 24px; line-height: 1; min-width: 44px; min-height: 44px; background: transparent; border: 0; border-radius: 50%; color: var(--ox-ink); cursor: pointer; }
.popup-close:hover { background: var(--ox-org-hue-2-tint); }
.popup-close:focus-visible, .info-btn:focus-visible { outline: 3px solid var(--ox-focus); outline-offset: 2px; }
.info { position: relative; display: inline-block; vertical-align: middle; margin-left: var(--ox-space-1); }
/* A small muted circled i (the prototype's .ib), with a 44 px tap area around it. */
.info-btn { position: relative; font: inherit; font-size: 9px; font-weight: 600; font-style: italic; line-height: 1; display: inline-grid; place-items: center; width: 14px; height: 14px; min-width: 14px; min-height: 14px; padding: 0; border-radius: 50%; border: 1px solid currentColor; background: none; color: var(--ox-muted); opacity: 0.85; cursor: pointer; vertical-align: 4px; }
.info-btn::after { content: ""; position: absolute; inset: -15px; }
.info-btn:hover, .info-btn[aria-expanded="true"] { opacity: 1; color: var(--ox-lake); }
.info-pop { position: absolute; z-index: 60; isolation: isolate; left: 0; top: calc(100% + var(--ox-space-2)); width: max-content; max-width: min(320px, 80vw); font-size: 14px; font-style: normal; font-weight: 400; line-height: 1.5; padding: var(--ox-space-3) var(--ox-space-4); border: 2px solid var(--ox-org-hue-2); border-radius: var(--ox-radius-md); background: var(--ox-surface-overlay); color: var(--ox-ink); box-shadow: var(--ox-shadow-1); text-align: left; }
.info:has(.info-btn[aria-expanded="true"]) { z-index: 60; }   /* an open tip stacks above the calendar cards around it */
.info-pop[hidden] { display: none; }

/* The legal texts (#4227): the footer's four links, and the text box of the acceptance pop-up (tokens only; Dionysus restyles in #4256). */
.footer-links { display: flex; flex-wrap: wrap; gap: var(--ox-space-2) var(--ox-space-4); list-style: none; margin: var(--ox-space-1) 0 0; padding: 0; }
.legal-scroll { max-height: 60vh; overflow: auto; background: var(--ox-ground); border: 2px solid var(--ox-line-strong); border-radius: var(--ox-radius-sm);
  padding: var(--ox-space-3) var(--ox-space-4); margin-bottom: var(--ox-space-3); }
.legal-scroll:focus-visible { outline: 3px solid var(--ox-focus); outline-offset: 2px; }
.legal-scroll h3, .legal-scroll h4 { font-size: 18px; margin-top: var(--ox-space-4); }
[data-legal-end] { display: block; height: 1px; }

/* A page in a section keeps the section's color in --section (set on <body> by base.html); the prototype's page title has no rule under it (shell.css). */

/* Preview As (#420): the banner on every page while an Owner previews as an example person */
.preview-banner { display: flex; flex-wrap: wrap; gap: var(--ox-space-3); align-items: center; justify-content: space-between;
  padding: var(--ox-space-2) var(--ox-space-4); background: var(--ox-warning-bg); color: var(--ox-ink); border-bottom: 2px solid var(--ox-warning-line); }
.preview-banner p { margin: 0; }
.preview-banner form { margin: 0; }
/* A colleague's cell behind a preference (Bundle #4887; static/popup.js ShiftMateCell, ask_colleagues.js cellEl): the sentence as a
   button whose second line is "Show number anyway"; a 44px target */
.cell-reveal { display: inline-flex; flex-direction: column; align-items: flex-start; min-height: 44px; padding: var(--ox-space-1) var(--ox-space-2); border: 1px solid var(--ox-line-strong); border-radius: var(--ox-radius-sm); background: var(--ox-surface); color: var(--ox-ink); font: inherit; text-align: left; cursor: pointer; }
.cell-reveal .cell-anyway { font-size: 13px; color: var(--ox-lake); text-decoration: underline; }
