/* FTEP Tracking: how every screen looks (design Part 1, 1.8; Part 5, 5.3).
   Built to WCAG 2.1 Level AA: dark text on a light background, strong contrast,
   nothing by color alone, large touch targets, a focus mark that is easy to see.
   No light gray text.

   The colors are the FTEP build's own, measured from the released forms, manuals and
   program documents (his word, 27 November 2026: "i want the color code of this app to match
   FTEP Build"; design Part 12, F3). To change a color, change it here, in this one block:
     --main        the releases' deep red: the top bar, the tabs, buttons, links, headings' rules
     --main-dark   the same, darker: borders, and a button under the pointer
     --main-wash   the releases' pale rose: the strip, table headings, a statement
     --paper       the releases' warm off-white: behind every page
     --warn        a warning (a triangle item, FAIL, NOT MET, late, a refusal): a brighter red
                   than the main color, always with its words, never by color alone
     --warn-wash   behind a warning
   No light gray anywhere (his rule; the check's A16): a plain box is white, inside its line.

   A warning never reads as an ordinary panel, in color or without it (design 12.8; A16):
     - only a warning has the thick edge down its left side; an ordinary panel has it along its
       top;
     - a warning starts with its word, in white on the warning red (.warn-word).
   Until that day the screens were bright blue and red, so two kinds of box are still named
   "blue" and "red" in the pages: .blue is the main color's box, .red is a warning's. */
:root {
  --ink: #111111; --paper: #faf8f6; --main: #8c1d26; --main-dark: #6b141c; --main-wash: #f6edee;
  --warn: #c8102e; --warn-wash: #fde8ea; --line: #1a1a1a; --ok: #0b5a2a;
}
* { box-sizing: border-box; }
/* Room is kept clear above the Save bar, so nothing in use hides under it. */
html { font-size: 112.5%; scroll-padding-bottom: 7rem; scroll-padding-top: 4rem; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: var(--paper);
  line-height: 1.5; }
a { color: var(--main); }
a:hover { color: var(--main-dark); }
:focus-visible { outline: 4px solid #ffbf00; outline-offset: 2px; box-shadow: 0 0 0 6px var(--ink); }
.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: 0.75rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

header.top { background: var(--main); color: #fff; padding: 0.6rem 1rem; display: flex; flex-wrap: wrap;
  gap: 0.5rem 1.25rem; align-items: center; }
header.top .name { font-weight: bold; font-size: 1.15rem; margin-right: auto; }
header.top .name small { display: block; font-weight: normal; font-size: 0.8rem; }
header.top .who { font-size: 0.95rem; display: flex; flex-wrap: wrap; gap: 0.3rem 0.7rem; align-items: center; }
header.top .who a, header.top .who button { color: #fff; background: var(--main-dark); border: 2px solid #fff;
  border-radius: 6px; padding: 0.4rem 0.8rem; font-size: 0.95rem; font-weight: normal; text-decoration: none;
  min-height: 44px; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; margin: 0; }
header.top .who a[aria-current], header.top .who a:hover, header.top .who button:hover { background: #fff;
  color: var(--main-dark); }

/* The tabs (design Part 9). Each role has its own row at the top of every screen. They are
   plain links in a list. A row that does not fit wraps onto a second line: nothing hides
   behind a button and nothing scrolls sideways. The lit tab is white, bold and underlined,
   so it is never marked by color alone. Each tab is at least 44 by 44 for a thumb. */
nav.tabs ul, nav.subtabs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
nav.tabs a, nav.subtabs a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  min-width: 44px; padding: 0.5rem 0.9rem; font-size: 1rem; font-weight: bold; text-decoration: none;
  border-radius: 8px 8px 0 0; }
header.top nav.tabs { width: 100%; margin-bottom: -0.6rem; }
header.top nav.tabs a { color: #fff; background: var(--main-dark); border: 2px solid #fff; border-bottom-width: 0;
  padding-bottom: calc(0.5rem + 2px); }
header.top nav.tabs a:hover { background: #fff; color: var(--main-dark); }
header.top nav.tabs a[aria-current] { background: var(--paper); color: var(--main-dark); text-decoration: underline; }
/* The second row, inside a page: a trainee's six tabs, and the two logs. */
nav.subtabs { margin: 0.5rem 0 1rem 0; border-bottom: 4px solid var(--main); }
nav.subtabs a { color: var(--main-dark); background: var(--main-wash); border: 2px solid var(--main-dark);
  border-bottom-width: 0; }
nav.subtabs a:hover { background: #fff; }
nav.subtabs a[aria-current] { background: var(--main); color: #fff; border-color: var(--main);
  text-decoration: underline; }
/* The strip above a trainee's tabs: whose page this is, on every one of them. */
.strip { display: flex; flex-wrap: wrap; gap: 0.15rem 1.2rem; align-items: center; border: 2px solid var(--main);
  border-top-width: 8px; border-radius: 8px; padding: 0.5rem 0.9rem; margin: 0.4rem 0 0.2rem 0;
  background: var(--main-wash); }
.strip .whose { font-size: 1.25rem; font-weight: bold; }

/* The builder's "Switch to" box, in the made-up demo only. */
.demo-switch { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: center; width: 100%;
  background: #fff; color: var(--ink); border: 3px solid var(--warn); border-radius: 6px; padding: 0.3rem 0.7rem; }
.demo-switch label { margin: 0; }
.demo-switch select { width: auto; max-width: 100%; }
.demo-switch button { margin: 0; }

main { max-width: 62rem; margin: 0 auto; padding: 1rem 1rem 6rem 1rem; }
h1 { font-size: 1.7rem; margin: 0.6rem 0 0.4rem 0; }
h2 { font-size: 1.3rem; margin: 1.6rem 0 0.5rem 0; border-bottom: 3px solid var(--main); padding-bottom: 0.2rem; }
h3 { font-size: 1.08rem; margin: 1.1rem 0 0.3rem 0; }
p { margin: 0.4rem 0 0.8rem 0; }
.lead { font-size: 1.05rem; }

.card { border: 2px solid var(--line); border-radius: 8px; padding: 0.9rem 1rem; margin: 0.9rem 0; background: #fff; }
.card.blue { border-color: var(--main); border-top-width: 8px; }
.card.red { border-color: var(--warn); border-left-width: 12px; background: var(--warn-wash); }
.card.plain { background: #fff; }
/* The word a warning starts with: white on the warning red, 5.9 to 1. */
.warn-word { display: inline-block; background: var(--warn); color: #fff; font-weight: bold; font-size: 0.85rem;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 0.1rem 0.55rem; border-radius: 4px;
  margin: 0 0.35rem 0.15rem 0; vertical-align: baseline; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.4rem 1rem; margin: 0.5rem 0; }
.facts div b { display: block; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.big { font-size: 1.6rem; font-weight: bold; }

.msg { border: 2px solid var(--ok); border-top-width: 8px; background: #e8f5ec; padding: 0.7rem 1rem;
  margin: 0.8rem 0; border-radius: 6px; font-weight: bold; }
.msg.error, .refusal { border: 2px solid var(--warn); border-left-width: 12px; background: var(--warn-wash);
  padding: 0.7rem 1rem; margin: 0.8rem 0; border-radius: 6px; }
.refusal h2, .refusal h3 { border: 0; margin-top: 0; color: var(--warn); }
.refusal ul { margin: 0.3rem 0 0 1.2rem; padding: 0; }
.tag { display: inline-block; border: 2px solid var(--line); border-radius: 999px; padding: 0.05rem 0.6rem;
  font-size: 0.85rem; font-weight: bold; background: #fff; }
.tag.red { border-color: var(--warn); color: var(--warn); }
.tag.blue { border-color: var(--main); color: var(--main-dark); }

label { font-weight: bold; display: block; margin: 0.7rem 0 0.2rem 0; }
.hint { font-weight: normal; font-size: 0.92rem; display: block; margin: 0.1rem 0 0.25rem 0; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: 0.6rem 0.7rem; border: 2px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink); min-height: 44px; }
textarea { min-height: 5.5rem; resize: vertical; line-height: 1.45; }
textarea.narrative { min-height: 14rem; font-size: 1.05rem; }
input.pin { max-width: 12rem; font-size: 1.5rem; letter-spacing: 0.3em; text-align: center; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 1rem; }
/* A row whose hint lines differ in length: each label takes the room above, so the boxes
   themselves sit on one line (his word at his look, 22 November 2026). */
.row2.even > div { display: flex; flex-direction: column; }
.row2.even > div > label { flex: 1 0 auto; }
/* A date box is drawn a little taller than a drop-down: here every box is the same height. */
.row2.even > div > input, .row2.even > div > select { height: 3.1rem; }

button, .button { font: inherit; font-weight: bold; padding: 0.7rem 1.2rem; min-height: 48px; border-radius: 8px;
  border: 2px solid var(--main-dark); background: var(--main); color: #fff; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; margin: 0.3rem 0.4rem 0.3rem 0; }
button:hover, .button:hover { background: var(--main-dark); color: #fff; }
button.red, .button.red { background: var(--warn); border-color: #8f0b21; }
button.quiet, .button.quiet { background: #fff; color: var(--main-dark); }
button.small { min-height: 44px; padding: 0.4rem 0.8rem; font-size: 0.95rem; }
form.inline { display: inline; }

table.list { border-collapse: collapse; width: 100%; margin: 0.5rem 0; }
table.list th, table.list td { border: 1px solid var(--line); padding: 0.45rem 0.55rem; text-align: left;
  vertical-align: top; }
table.list th { background: var(--main-wash); }
/* "position: relative" keeps a screen reader's words (.sr) on a button inside a wide table
   within the table's own box, so they never widen the page (found 22 November 2026). */
.scroll { overflow-x: auto; position: relative; }
/* The released library: every column on the screen at a desk width, the last one too. A long
   file name breaks onto the next line instead of pushing the table wide. On a narrow screen
   the table scrolls sideways inside its own box, and the page does not. */
table.library { table-layout: fixed; min-width: 44rem; }
table.library td { overflow-wrap: anywhere; }
/* Settings: the rotation pattern's boxes, and a release shown inside the program's page. */
table.pattern { max-width: 34rem; }
table.pattern caption { text-align: left; font-weight: bold; padding-bottom: 0.3rem; }
table.pattern th[scope=row] { background: #fff; white-space: nowrap; }
/* A long file name breaks onto the next line instead of pushing the page wide. */
.wrap { overflow-wrap: anywhere; }
iframe.release { width: 100%; height: 80vh; min-height: 30rem; border: 2px solid var(--line); border-radius: 6px;
  background: #fff; }
/* Words for a screen reader only: which record a button is for. */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* The Daily Evaluation screen (F3) */
.formhead { border: 2px solid var(--line); border-radius: 8px; padding: 0.6rem 1rem; background: var(--main-wash); }
.instructions p { margin: 0.35rem 0; }
.instructions .r { color: var(--warn); font-weight: bold; }
fieldset { border: 2px solid var(--line); border-radius: 8px; margin: 0.8rem 0; padding: 0.5rem 0.8rem 0.8rem 0.8rem; }
legend { font-weight: bold; padding: 0 0.4rem; font-size: 1.05rem; }
fieldset.dim { border-left-width: 8px; }
fieldset.dim.tri-on { border-color: var(--warn); background: var(--warn-wash); }
.group-title { background: var(--main); color: #fff; padding: 0.45rem 0.8rem; border-radius: 6px; margin: 1.4rem 0 0.4rem 0;
  font-size: 1rem; letter-spacing: 0.06em; text-transform: uppercase; }
.picks { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: stretch; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pick span { display: inline-flex; min-width: 48px; min-height: 48px; padding: 0 0.7rem; align-items: center;
  justify-content: center; border: 2px solid var(--line); border-radius: 8px; font-weight: bold; font-size: 1.1rem;
  background: #fff; }
.pick input:checked + span { background: var(--main); color: #fff; border-color: var(--main-dark);
  box-shadow: inset 0 0 0 3px #fff; text-decoration: underline; }
.pick input:focus-visible + span { outline: 4px solid #ffbf00; outline-offset: 2px; box-shadow: 0 0 0 6px var(--ink); }
.pick input:disabled + span { background: #fff; color: var(--ink); border-style: dashed; text-decoration: line-through; }
.pick.tri span { border-color: var(--warn); color: var(--warn); }
.pick.tri input:checked + span { background: var(--warn); color: #fff; border-color: #8f0b21; }
.pick.fail input:checked + span { background: var(--warn); border-color: #8f0b21; }
.under { margin-top: 0.5rem; }
.under[hidden] { display: none; }
.sticky { position: sticky; bottom: 0; background: #fff; border-top: 3px solid var(--main); padding: 0.5rem 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.8rem; z-index: 5; }
#save-state { font-weight: bold; }
#signal-warning { background: var(--warn); color: #fff; font-weight: bold; padding: 0.8rem 1rem; border-radius: 6px;
  position: sticky; top: 0; z-index: 6; font-size: 1.1rem; }
#signal-warning[hidden] { display: none; }
ol.rules { columns: 2 16rem; padding-left: 1.4rem; margin: 0.3rem 0; }

/* The one box a ▲ or a FAIL opens at once: Send now, or Cancel (15 November 2026).
   With scripts it opens over the page and must be answered. Without, it sits at the top. */
dialog.notice-box { border: 4px solid var(--warn); border-radius: 10px; padding: 1rem 1.2rem; color: var(--ink);
  background: var(--warn-wash); max-width: 42rem; width: calc(100% - 2rem); }
dialog.notice-box:not(:modal) { position: static; margin: 0.9rem 0; width: auto; max-width: none; }
dialog.notice-box::backdrop { background: rgba(0, 0, 0, 0.65); }
dialog.notice-box h2 { border: 0; margin-top: 0; color: var(--warn); }
dialog.notice-box ul { margin: 0.3rem 0 0.6rem 1.2rem; padding: 0; }
dialog.notice-box li { margin-bottom: 0.3rem; }
label.check { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; }
label.check input { width: 1.5rem; height: 1.5rem; margin: 0; }
input[type=file] { font: inherit; min-height: 44px; width: 100%; }
img.trainee-photo { max-width: 12rem; max-height: 15rem; border: 3px solid var(--line); border-radius: 6px; }

/* Reading an evaluation (T1, P2, C3, E2) */
table.read { border-collapse: collapse; width: 100%; }
table.read th, table.read td { border: 1px solid var(--line); padding: 0.4rem 0.55rem; text-align: left; vertical-align: top; }
table.read th.g { background: var(--main); color: #fff; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.9rem; }
table.read td.sc { font-weight: bold; font-size: 1.15rem; white-space: nowrap; width: 7rem; }
.block { border-left: 6px solid var(--main); padding: 0.2rem 0.8rem; margin: 0.6rem 0; white-space: pre-wrap; }
.block b { display: block; }
.statement { border: 3px solid var(--main); border-radius: 8px; padding: 0.8rem 1rem; font-size: 1.15rem;
  font-weight: bold; background: var(--main-wash); margin: 0.8rem 0; }
.hidden-from { border: 3px solid var(--warn); background: var(--warn-wash); border-radius: 8px; padding: 0.7rem 1rem; }
canvas.sigpad { border: 3px solid var(--line); border-radius: 8px; width: 100%; max-width: 34rem; height: 11rem;
  touch-action: none; background: #fff; display: block; }
img.sig { max-height: 4rem; max-width: 16rem; border-bottom: 2px solid var(--line); }
.pre { white-space: pre-wrap; }

/* The Calendar tab (design Part 11). A month is a list of days. On a wide screen the list is
   laid out as seven columns, Monday first; on a narrow one it stays a list of days, so
   nothing scrolls sideways. Every mark is in words, never a color alone: an estimate says
   "an estimate" and also sits in a dashed box. */
nav.months { display: flex; flex-wrap: wrap; gap: 0.1rem 0.2rem; margin: 0.5rem 0; }
ul.month { list-style: none; margin: 0.6rem 0; padding: 0; }
ul.month > li.day { border: 2px solid var(--line); border-radius: 8px; padding: 0.3rem 0.6rem 0.5rem 0.6rem;
  margin: 0.5rem 0; background: #fff; overflow-wrap: anywhere; }
ul.month > li.blank { display: none; }
ul.month > li.today { border-color: var(--main); border-width: 4px; }
ul.month h3 { margin: 0; font-size: 1.05rem; }
ul.month h3 a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; font-weight: bold; }
ul.lines { list-style: none; margin: 0.3rem 0; padding: 0; }
ul.lines li { margin: 0.3rem 0; padding: 0.2rem 0.45rem; border-left: 5px solid var(--main); overflow-wrap: anywhere; }
ul.lines li.red { border-left-color: var(--warn); background: var(--warn-wash); }
ul.lines li.estimate { border: 2px dashed var(--line); border-radius: 6px; }
ul.lines li.entry { border-left-color: var(--ink); background: #fff; border-left-style: double; border-left-width: 8px; }
.weekdays { display: none; }
@media (min-width: 68rem) {
  .weekdays, ul.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.3rem; }
  .weekdays div { font-weight: bold; text-align: center; background: var(--main-wash); border: 1px solid var(--line);
    border-radius: 4px; padding: 0.15rem; font-size: 0.9rem; }
  ul.month > li.day { margin: 0; padding: 0.15rem 0.3rem 0.3rem 0.3rem; font-size: 0.85rem; min-height: 7rem; }
  ul.month > li.blank { display: block; }
  ul.month .tag { font-size: 0.78rem; padding: 0 0.4rem; }
  ul.month .full { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  ul.month ul.lines li { margin: 0.2rem 0; padding: 0.1rem 0.3rem; border-left-width: 4px; }
}

@media (max-width: 40rem) {
  html { font-size: 106%; }
  main { padding: 0.6rem 0.6rem 6rem 0.6rem; }
  table.list, table.read { font-size: 0.95rem; }
  /* On a phone the tabs sit closer together, so a row takes fewer lines. Still 44 high. */
  nav.tabs ul, nav.subtabs ul { gap: 0.25rem; }
  nav.tabs a, nav.subtabs a { padding-left: 0.55rem; padding-right: 0.55rem; font-size: 0.95rem; }
}
@media print { header.top, nav.subtabs, .sticky, .noprint { display: none; } }

/* Entry from paper (design Part 12): the scan of the paper beside the form it is typed from.
   Side by side on a wide screen; one above the other on a narrow one, so nothing scrolls sideways. */
.beside { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.beside > section { min-width: 0; }
.beside .scan-pane { position: sticky; top: 0.5rem; max-height: 96vh; overflow: auto; }
iframe.release.scan { height: 74vh; min-height: 24rem; }
img.scan-page { display: block; max-width: 100%; height: auto; border: 2px solid var(--line); border-radius: 6px; }
@media (max-width: 62rem) {
  .beside { grid-template-columns: minmax(0, 1fr); }
  .beside .scan-pane { position: static; max-height: none; }
  iframe.release.scan { height: 60vh; }
}

/* A fingerprint, to check a copy against: every letter and number told apart, and broken to fit. */
.mono { font-family: Consolas, "Liberation Mono", Menlo, monospace; overflow-wrap: anywhere; }

/* Rules setup (design Part 13): a color shown beside its code, inside a dark line so a pale one
   is still seen. */
.swatch { display: inline-block; width: 1.4rem; height: 1.4rem; border: 2px solid var(--line); border-radius: 4px;
  vertical-align: middle; }
table.rules td:first-child { min-width: 14rem; }
/* The task book (design Part 14): an entry's standard under its name, a little smaller, in the
   same dark ink; and a struck line struck through, with its tag beside it. */
table.book .standard { font-size: 0.92rem; }
table.book th[scope=row] { white-space: nowrap; }
table.book tr[hidden] { display: none; }
