:root {
  --navy-900: #031634;
  --navy-800: #0a2347;
  --navy-700: #143560;
  --accent: #116154;      /* JNC green, from the company website */
  --accent-light: #2fb39b; /* for focus rings and marks on dark navy */
  --accent-dark: #0c4a40;
  --paper: #f4f6f8;
  --card: #ffffff;
  --ink: #14212e;
  --ink-soft: #55657a;
  --line: #d5dce4;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --ok: #1e7a46;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

:focus-visible {
  outline: 3px solid var(--accent-light);
  outline-offset: 2px;
}

/* ---------- Header band ---------- */
.band {
  background: var(--navy-900);
  color: #fff;
  padding: 40px 20px 72px;
  text-align: center;
  border-bottom: 4px solid var(--accent);
}
.band .logo { display: block; width: min(300px, 70%); height: auto; margin: 0 auto 12px; }
.band .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--accent-light);
  color: var(--accent-light);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.band h1 {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
}
.band p {
  margin: 8px 0 0;
  color: #c4d2e2;
}

/* ---------- Main card ---------- */
main {
  width: 100%;
  max-width: 760px;
  margin: -40px auto 40px;
  padding: 0 16px;
  flex: 1;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 6px 24px rgba(11, 27, 46, 0.08);
}
.panel + .panel { margin-top: 16px; }
.panel h2 { margin: 0 0 4px; font-size: 1.15rem; }
.hint { margin: 0 0 16px; color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- The three access buttons ---------- */
.access {
  display: grid;
  gap: 12px;
}
.access-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 18px 20px;
  min-height: 72px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.access-btn .title { font-size: 1.1rem; font-weight: 700; }
.access-btn .sub { font-size: 0.9rem; color: var(--ink-soft); }
.access-btn:hover { border-color: var(--navy-700); background: #f8fafc; }
.access-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: #e8f4f1;
}
.access-btn:active { transform: scale(0.99); }

/* ---------- Sign-in form ---------- */
#signin[hidden], #signin form[hidden] { display: none; }
.field { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.input-row { display: flex; gap: 8px; }
input[type="text"], input[type="password"] {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
input:focus { border-color: var(--navy-700); }

.btn {
  font: inherit;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 46px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--navy-800); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy-700); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.message {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.message[hidden] { display: none; }
.message.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f3b8b3; }

.footnote {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.proto-note {
  max-width: 760px;
  margin: 0 auto 24px;
  padding: 0 16px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- Section pages ---------- */
.topbar {
  background: var(--navy-900);
  color: #fff;
  border-bottom: 3px solid var(--accent);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar .brand { display: inline-flex; border: 0; padding: 0; }
.topbar .brand img { display: block; height: 32px; width: auto; }
.topbar .who { color: #c4d2e2; font-size: 0.9rem; }
.topbar a, .topbar button {
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid #4a6280;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
}
.topbar a:hover, .topbar button:hover { border-color: var(--accent-light); }
.topbar .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.page main { margin-top: 32px; }
.todo { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.link-cards { display: grid; gap: 12px; margin-top: 16px; }
.link-cards a {
  display: block;
  padding: 16px 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.link-cards a:hover { border-color: var(--navy-700); background: #f8fafc; }
.link-cards a span { display: block; font-weight: 400; font-size: 0.9rem; color: var(--ink-soft); }

@media (min-width: 640px) {
  .access { grid-template-columns: repeat(3, 1fr); }
  .access-btn { min-height: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Admin: create account ---------- */
.field-grid { display: grid; gap: 0 16px; }
.field-error { color: var(--danger); font-size: 0.85rem; margin: 4px 0 0; }
.field-note { color: var(--ink-soft); font-size: 0.85rem; margin: 4px 0 0; }
input[aria-invalid="true"] { border-color: var(--danger); }
.static-value { margin: 0 0 16px; padding: 10px 14px; background: var(--paper); border-radius: 8px; border: 1px solid var(--line); }
.notice {
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: #e8f4f1;
  border: 1px solid #a9d3c9;
}
.notice[hidden] { display: none; }
.notice h3 { margin: 0 0 8px; font-size: 1.05rem; }
.notice dl { margin: 0 0 12px; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; }
.notice dt { color: var(--ink-soft); }
.notice dd { margin: 0; overflow-wrap: anywhere; }
.secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 6px;
  user-select: all;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
td.email { overflow-wrap: anywhere; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; background: var(--paper); border: 1px solid var(--line); }
.pill.super { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (min-width: 640px) { .field-grid { grid-template-columns: 1fr 1fr; } }

.step-label { margin: 0 0 8px; font-weight: 700; color: var(--navy-800); }
#step-one { margin-bottom: 20px; }
#step-one[hidden], #create-form[hidden], #instructor-fields[hidden] { display: none; }
select {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
select:focus { border-color: var(--navy-700); }
select[aria-invalid="true"] { border-color: var(--danger); }

/* ---------- Admin home ---------- */
.page main.wide { max-width: 1040px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; }
.tab {
  font: inherit; font-weight: 600; padding: 10px 18px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-soft); cursor: pointer; min-height: 44px;
}
.tab:hover { color: var(--ink); background: var(--paper); }
.tab[aria-selected="true"] { background: var(--navy-700); color: #fff; }
[role="tabpanel"][hidden], #panel-create[hidden] { display: none; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .num { display: block; font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--navy-800); font-variant-numeric: tabular-nums; }
.stat .lbl { color: var(--ink-soft); font-size: 0.9rem; }
.stat.attention .num { color: var(--danger); }
.stat.attention.clear .num { color: var(--ok); }
.two-col { display: grid; gap: 16px; }
.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; overflow-wrap: anywhere; }
.activity li:last-child { border-bottom: 0; }
.activity time { display: block; color: var(--ink-soft); font-size: 0.8rem; }
.empty { margin: 0; padding: 20px; text-align: center; color: var(--ink-soft); background: var(--paper); border-radius: 8px; border: 1px dashed var(--line); }
.empty[hidden] { display: none; }
.back-row { margin-bottom: 12px; }
@media (min-width: 800px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ---------- Students ---------- */
@media (min-width: 640px) { .access.four { grid-template-columns: repeat(4, 1fr); } }
.sheet-section { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px 4px; margin: 0 0 16px; min-width: 0; }
.sheet-section legend { font-weight: 700; padding: 0 6px; color: var(--navy-800); }
.field.wide { grid-column: 1 / -1; }
textarea {
  width: 100%; font: inherit; padding: 12px 14px; min-height: 84px; resize: vertical;
  border: 2px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
textarea:focus { border-color: var(--navy-700); }
textarea[aria-invalid="true"], input[type="date"][aria-invalid="true"] { border-color: var(--danger); }
input[type="date"], input[type="email"], input[type="tel"] { width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.progress { margin-bottom: 16px; }
.progress p { margin: 0 0 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
td a { color: var(--navy-800); font-weight: 600; }
.doc-need { color: var(--danger); font-weight: 600; }
.doc-ok { color: var(--ok); font-weight: 600; }
.muted { color: var(--ink-soft); }

/* ---------- Student profile ---------- */
.pill.expired { background: var(--danger-bg); color: var(--danger); border-color: #f3b8b3; }
.pill.soon { background: #fff4d6; color: #7a5200; border-color: #e8cf86; }
.pill.valid { background: #e8f4f1; color: var(--ok); border-color: #a9d3c9; }
.student-name { margin: 0 0 8px; font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.2; }
.snapshot { margin: 16px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.snapshot > div { background: var(--paper); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.snapshot dt { color: var(--ink-soft); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.snapshot dd { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.prompts { border: 2px solid var(--accent); }
.prompt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.prompt { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 12px 14px; background: #f1f8f6; border: 1px solid #a9d3c9; border-radius: 8px; }
.prompt-info { display: grid; gap: 2px; min-width: 0; flex: 1 1 260px; }
.prompt-info .reminder { color: #7a5200; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; margin: 0; cursor: pointer; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.file-btn { position: relative; display: inline-flex; align-items: center; margin: 0; background: var(--accent); color: #fff; }
.file-btn:hover { background: var(--accent-dark); }
.file-btn:focus-within { outline: 3px solid var(--accent-light); outline-offset: 2px; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.thumb { display: block; max-width: 96px; max-height: 72px; border-radius: 6px; border: 1px solid var(--line); }
.saved { color: var(--ok); font-weight: 600; align-self: center; }
.saved[hidden] { display: none; }
#profile[hidden], #not-found[hidden], #prompts[hidden] { display: none; }

/* Student page tabs and training file */
.tabs + [role="tabpanel"], .tabs + .panel { margin-top: 16px; }
.snap-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sheet-section { font-size: 1rem; margin: 18px 0 6px; color: var(--navy-900); }
.tick-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.prompt.bad { background: var(--danger-bg); border-color: #f3b8b3; }
.prompt.warn { background: #fff4d6; border-color: #e8cf86; }
.bad-text { color: var(--danger); font-weight: 600; }
.sub-note { margin: 0 0 12px; }
.gate { border: 2px solid var(--danger); }
.gate.clear { border-color: var(--accent); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); }
.checks li.fail { background: var(--danger-bg); border-color: #f3b8b3; }
.checks li.pass { background: #e8f4f1; border-color: #a9d3c9; }
.sig-pad { width: 100%; max-width: 480px; height: 160px; border: 2px dashed var(--line); border-radius: 8px; background: #fff; touch-action: none; display: block; }
.sig-img { max-width: 320px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.debrief { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 4px; }
.debrief + .debrief { margin-top: 10px; }
.debrief.open { border-left: 4px solid #e8cf86; }
.debrief.closed { border-left: 4px solid var(--accent); }
.exam-grid { display: grid; gap: 14px; }
.exam { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.exam h3 { margin: 0 0 8px; font-size: 1rem; }
.hours { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.hours div { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.hours dt { font-size: 0.8rem; color: var(--muted, #555); } .hours dd { margin: 0; font-size: 1.4rem; font-weight: 700; }
.draft-note { background: #fff4d6; border: 1px solid #e8cf86; border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; }
.rules-head { margin: 20px 0 6px; color: var(--navy-900); text-transform: uppercase; font-size: 0.95rem; letter-spacing: 0.03em; }
dl.rules { display: grid; grid-template-columns: 3.2rem 1fr; gap: 8px 8px; margin: 0 0 12px; }
dl.rules dt { font-weight: 700; } dl.rules dd { margin: 0; }
.band-row th { background: var(--navy-900); color: #fff; text-align: center; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.04em; }
tfoot th, tfoot td { font-weight: 700; background: var(--paper); }
details.block { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 8px; }
details.block summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tick-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 2px; }
.sub-list { margin: 0 0 6px 40px; padding-left: 16px; color: var(--ink-soft, #444); font-size: 0.9rem; }
.debrief-notes { white-space: pre-wrap; }
.exam-meta { margin-top: 8px; }
.popup-back { position: fixed; inset: 0; background: rgba(3, 22, 52, 0.55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.popup { background: #fff; border-radius: 12px; padding: 20px 22px; max-width: 460px; width: 100%; border-top: 6px solid #e8cf86; box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
.popup.bad { border-top-color: var(--danger); }
.popup h2 { margin: 0 0 8px; font-size: 1.2rem; }
.review { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; display: grid; gap: 6px; }
.review + .review { margin-top: 8px; }
.review.pending { border-left: 4px solid #e8cf86; }
.review.signed { border-left: 4px solid var(--accent); }

/* =====================  Student profile redesign  ===================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn.small, .file-btn.small { padding: 6px 12px; min-height: 36px; font-size: 0.9rem; }
#profile .panel { margin-top: 14px; }
#profile > .panel:first-of-type { margin-top: 0; }

/* Name bar: stays at the top of the screen while scrolling */
.profile-head {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  background: var(--navy-900); color: #fff;
  padding: 12px 18px; border-radius: var(--radius);
  border-bottom: 4px solid var(--accent);
  box-shadow: 0 4px 14px rgba(3, 22, 52, 0.25);
  margin-bottom: 14px;
}
.profile-head h1 { margin: 0; font-size: clamp(1.25rem, 3.5vw, 1.7rem); line-height: 1.2; }
.profile-head .head-id { margin-left: auto; color: #c4d2e2; font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* Notifications */
#profile .prompts { border: 2px solid var(--navy-700); padding: 14px 16px; }
#profile .prompts h2 { margin: 0 0 10px; font-size: 1.05rem; color: var(--navy-900); }
.prompt.todo { background: #eef3fa; border-color: #c3d1e6; }
.prompt.warn { background: #fff4d6; border-color: #e8cf86; }
.prompt.bad { background: var(--danger-bg); border-color: #f3b8b3; }
.all-clear { margin: 0; color: var(--ok); font-weight: 600; }
.prompt .pill { margin-left: 6px; vertical-align: middle; }

/* Three equal tabs; Training file opens its own page */
.tabs3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.tab3 {
  font: inherit; font-weight: 700; text-align: center; text-decoration: none;
  padding: 14px 10px; min-height: 52px; display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--navy-800); border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.tab3:hover { border-color: var(--accent); }
.tab3[aria-selected="true"] { background: var(--navy-700); border-color: var(--navy-700); color: #fff; box-shadow: inset 0 -4px 0 var(--accent-light); }
.tab3-link { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab3-link:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.tab3-link::after { content: "\2192"; margin-left: 8px; }
@media (max-width: 560px) { .tabs3 { grid-template-columns: 1fr; } }

/* Information sheet: locked until Edit is pressed */
.sheet-panel { padding: 16px 18px; }
.sheet-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sheet-bar h2 { margin: 0; font-size: 1.15rem; color: var(--navy-900); }
.sheet-actions { display: flex; align-items: center; gap: 8px; }
.sheet { display: grid; gap: 14px; }
.sheet-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.sheet-card h3 {
  margin: 0; padding: 8px 14px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--navy-900); color: #fff; border-left: 6px solid var(--accent-light);
}
.sheet-card:nth-child(2) h3 { background: var(--navy-700); }
.sheet-card:nth-child(3) h3 { background: var(--accent); border-left-color: var(--accent-light); }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; padding: 14px; }
.fld { min-width: 0; }
.fld.wide { grid-column: 1 / -1; }
.fld label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin: 0 0 3px; }
.fld input, .fld textarea {
  width: 100%; font: inherit; font-size: 0.95rem; padding: 7px 10px; min-height: 36px;
  border: 1.5px solid var(--accent); border-radius: 6px; background: #fff; color: var(--ink);
}
.fld textarea { resize: vertical; min-height: 56px; }
.fld input:focus, .fld textarea:focus { border-color: var(--navy-700); outline: 3px solid var(--accent-light); outline-offset: 0; }
.fld input[aria-invalid="true"], .fld textarea[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-bg); }
.fld-hint { margin: 3px 0 0; font-size: 0.8rem; color: var(--ink-soft); }
.fld .field-error { margin: 3px 0 0; }
/* locked cells */
.sheet.locked .fld input, .sheet.locked .fld textarea { background: var(--paper); border-color: #e1e7ee; cursor: default; resize: none; }
.sheet.locked .fld input:focus, .sheet.locked .fld textarea:focus { outline: none; }

.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.two-up .panel { margin-top: 0 !important; }
.card-title { margin: 0 0 8px; font-size: 1rem; color: var(--navy-900); padding-bottom: 6px; border-bottom: 3px solid var(--accent); display: inline-block; }
#profile select { width: 100%; max-width: 240px; }

/* Documents table */
.docs-table th[scope="row"] { text-align: left; white-space: nowrap; }
.docs-table td, .docs-table th { vertical-align: top; }
.docs-table input { width: 100%; min-width: 130px; font: inherit; padding: 6px 8px; border: 1.5px solid var(--accent); border-radius: 6px; }
.file-cell { min-width: 150px; }
.file-cell .file-btn { margin-top: 6px; }
.row-actions { white-space: nowrap; }
.row-actions .btn { margin-right: 6px; }


/* ---------- Training file: tables, checklists as on the paper file, debrief sheet ---------- */
.grid-table { border: 1px solid var(--line); }
.grid-table th, .grid-table td { border: 1px solid var(--line); padding: 8px 10px; vertical-align: middle; }
.grid-table thead th { background: var(--paper); color: var(--navy-800); }
.grid-table .band-row th { background: var(--navy-900); color: #fff; border-color: var(--navy-900); text-align: center; }
.grid-table td.center, .grid-table th.center { text-align: center; }
.grid-table tbody tr:nth-child(even) td { background: #fafbfc; }
.grid-table .band-row + tr td, .grid-table tbody tr td { background-clip: padding-box; }
.tick-ok { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; }
.hours-table th.grp { background: var(--navy-700); color: #fff; text-align: center; border-color: var(--navy-700); }
.hours-table .sep { border-left: 3px solid var(--navy-700); }
.hours-table td { text-align: center; font-variant-numeric: tabular-nums; }
.hours-table thead tr:nth-child(2) th { text-align: center; }
.hours { margin-bottom: 16px; }

.sig-cols { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .sig-cols { grid-template-columns: 1fr 1fr; } }
.sig-col { border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.sig-col h3 { margin: 0 0 8px; color: var(--navy-700); }
.decl { background: var(--paper); border-left: 4px solid var(--accent); padding: 10px 12px; border-radius: 6px; }

.doc-list { display: grid; gap: 14px; }
details.docblock { border: 1px solid #b9c4d1; background: #fff; }
details.docblock > summary {
  list-style: none; cursor: pointer; background: var(--navy-700); color: #fff; padding: 10px 14px; min-height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 12px; position: relative;
}
details.docblock > summary::-webkit-details-marker { display: none; }
.doc-title { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; text-align: center; }
.doc-state { position: absolute; right: 12px; font-size: 0.8rem; background: rgba(255,255,255,0.16); padding: 2px 10px; border-radius: 999px; }
.doc-state.done { background: var(--accent); }
@media (max-width: 640px) { .doc-state { position: static; } details.docblock > summary { flex-wrap: wrap; } }
.doc-body { display: grid; grid-template-columns: 1fr; }
@media (min-width: 760px) { .doc-body { grid-template-columns: minmax(0, 1fr) 280px; } }
.doc-items { display: grid; align-content: start; }
.doc-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px; border-bottom: 1px solid #b9c4d1; }
.doc-row:last-child { border-bottom: 0; }
.doc-text { padding: 6px 10px; font-size: 0.92rem; }
.doc-sub { margin: 4px 0 2px; padding-left: 28px; color: var(--ink-soft, #333); font-size: 0.88rem; }
.doc-box { border-left: 1px solid #b9c4d1; display: grid; place-items: center; }
.doc-box input { width: 20px; height: 20px; accent-color: var(--accent); }
.doc-sign { border-left: 1px solid #b9c4d1; padding: 14px; display: grid; gap: 14px; align-content: start; }
@media (max-width: 759px) { .doc-sign { border-left: 0; border-top: 1px solid #b9c4d1; } }
.doc-sig-label { font-weight: 700; font-size: 0.8rem; text-align: center; text-transform: uppercase; letter-spacing: 0.04em; color: var(--navy-800); margin-bottom: 4px; }
.doc-sig-val { text-align: center; border-bottom: 1px solid #8a97a6; padding-bottom: 4px; min-height: 28px; }
.doc-sig-blank { border-bottom: 1px solid #8a97a6; height: 30px; }
.doc-sign .sig-img, .doc-sign .sig-pad { max-width: 100%; }
.small { font-size: 0.85rem; }

.flight-item { border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; background: #fff; overflow: hidden; }
.flight-item.closed { border-left: 4px solid var(--accent); }
.flight-item.open { border-left: 4px solid #e8cf86; }
.flight-item > summary {
  list-style: none; cursor: pointer; padding: 12px 14px; display: grid; gap: 4px 14px; align-items: center;
  grid-template-columns: 90px 110px minmax(0, 1fr) 70px auto;
}
.flight-item > summary::-webkit-details-marker { display: none; }
.flight-item > summary::after { content: ""; display: none; }
.flight-item[open] > summary { background: var(--paper); border-bottom: 1px solid var(--line); }
.fi-no { font-weight: 800; color: var(--navy-800); }
.fi-hours { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
@media (max-width: 640px) { .flight-item > summary { grid-template-columns: 1fr auto; } .fi-lesson { grid-column: 1 / -1; } }
.ds { padding: 6px 14px 14px; display: grid; gap: 4px; }
.ds-sec { padding-top: 10px; }
.ds-sec h4 { margin: 0 0 6px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: #fff; background: var(--navy-700); padding: 4px 10px; border-radius: 4px; }
.ds-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .ds-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .ds-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ds-item { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; background: #fff; }
.ds-label { font-size: 0.75rem; color: var(--ink-soft, #555); }
.ds-val { font-weight: 600; overflow-wrap: anywhere; }
.ds-notes { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; }
.ds-sig { margin-top: 8px; }

/* Flight entry on the home screen */
.fl { margin-bottom: 10px; min-width: 0; }
.fl label { display: block; font-size: 0.8rem; font-weight: 700; margin-bottom: 3px; color: var(--navy-800); }
.fl input, .fl select, .fl textarea { padding: 8px 10px; border-radius: 6px; border-width: 1px; width: 100%; font: inherit; }
.fs { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 4px; margin: 0 0 12px; min-width: 0; }
.fs legend { background: var(--navy-700); color: #fff; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 12px; border-radius: 4px; }
.fl-row { display: grid; gap: 0 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .fl-row.r4 { grid-template-columns: 90px 150px 1fr 1fr; } .fl-row.r3 { grid-template-columns: 1.4fr 1fr 1fr; } }
.fl-sub { margin: 16px 0 6px; color: var(--navy-700); }
.message.ok { background: #e8f4f1; color: var(--accent-dark); border: 1px solid #a9d3c9; }
.exam-table input, .exam-table select { padding: 6px 8px; border-width: 1px; border-radius: 6px; width: 100%; min-width: 90px; font: inherit; }
.exam-table input[type="checkbox"] { width: 20px; min-width: 0; height: 20px; accent-color: var(--accent); }
details.docblock > summary { padding-left: 130px; padding-right: 130px; }
@media (max-width: 640px) { details.docblock > summary { padding-left: 14px; padding-right: 14px; } }
.sig-col .check { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-weight: 600; }
.sig-col .check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.hours-table td { white-space: nowrap; padding: 8px 6px; }
.exam-table col, .exam-table td { min-width: 0; }

/* ---------- Big steppers and equal-size flight fields ---------- */
.stepper { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; gap: 6px; align-items: stretch; }
.step-btn {
  font: inherit; font-size: 1.6rem; font-weight: 700; line-height: 1; min-height: 52px; border: 2px solid var(--navy-700); background: #fff; color: var(--navy-700);
  border-radius: 10px; cursor: pointer; touch-action: manipulation; user-select: none;
}
.step-btn:hover { background: var(--navy-700); color: #fff; }
.step-btn:active { background: var(--accent); border-color: var(--accent); color: #fff; }
.fl .stepper input, .no-spin { text-align: center; font-size: 1.15rem; font-weight: 700; min-height: 52px; -moz-appearance: textfield; appearance: textfield; }
.no-spin::-webkit-inner-spin-button, .no-spin::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.fl input, .fl select { min-height: 52px; }
@media (min-width: 760px) {
  .fl-row.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fl-row.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.aircraft-form { display: grid; gap: 12px; grid-template-columns: 1fr; align-items: end; margin-bottom: 14px; }
@media (min-width: 640px) { .aircraft-form { grid-template-columns: 1fr 1fr auto; } }
.aircraft-form .btn { min-height: 52px; }
#view > p.hint { margin-top: 14px; }
.lesson-picker { display: grid; gap: 8px; }
.lesson-picker select { min-height: 52px; }
.fl.lessons > label { margin-bottom: 2px; }
.fl.lessons .hint { margin: 0 0 8px; }
.fl-row.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.countdown { margin-bottom: 0; }
.cd-box { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-height: 52px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; background: #fff; }
.cd-num { font-size: 1.3rem; font-weight: 800; color: var(--navy-800); }
.cd-sub { font-size: 0.85rem; color: var(--ink-soft, #555); }
.countdown.warn .cd-box { background: #fff4d6; border-color: #e8cf86; }
.countdown.bad .cd-box { background: var(--danger-bg); border-color: #f3b8b3; }
.countdown.bad .cd-num { color: var(--danger); }
.check-fs { border-color: #e8cf86; background: #fffdf5; }
.fl .check { display: flex; gap: 10px; align-items: center; font-size: 0.95rem; }
.fl .check input[type="checkbox"] { width: 24px; min-height: 0; height: 24px; flex: none; padding: 0; accent-color: var(--accent); }
.stats-table th[scope="row"] { text-transform: none; letter-spacing: 0; font-size: 0.95rem; font-weight: 600; color: var(--ink); background: #fff; text-align: left; }
.stats-table th:last-child, .stats-table td.stat-n { width: 120px; text-align: center; }
.stat-n { font-size: 1.3rem; font-weight: 800; color: var(--navy-800); font-variant-numeric: tabular-nums; }
.stat-n.bad { color: var(--danger); } .stat-n.ok { color: var(--ok, #1f7a4d); }

/* ---------- Instructor view of a student file ---------- */
.file-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.file-actions .tab3 { text-decoration: none; text-align: center; display: grid; place-items: center; }
.tab3-plain { background: #fff; border: 2px solid var(--navy-700); color: var(--navy-700); }
.tab3-plain:hover { background: var(--navy-700); color: #fff; }
.file-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.file-side { order: -1; }
@media (min-width: 900px) {
  .file-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .file-side { order: 0; position: sticky; top: 14px; }
}
.file-main .panel, .file-side .panel { margin-top: 0; }
.count-badge { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--navy-700); color: #fff; font-size: 0.85rem; vertical-align: middle; margin-left: 6px; }
.count-badge.bad { background: var(--danger); }
.prompt-list.compact .prompt { padding: 8px 12px; }
.prompt-list.compact .prompt span { font-size: 0.85rem; }
.file-side .btn.small { margin-top: 10px; width: 100%; min-height: 44px; }

/* ---------- Needs attention pattern + building mode ---------- */
.attn-toggle { margin-top: 10px; width: 100%; min-height: 44px; }
.view-as { color: #fff; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 6px; }
.view-as select { width: auto; max-width: 230px; padding: 6px 8px; min-height: 36px; border-width: 1px; font-size: 0.85rem; }
.profile-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 14px; }
.profile-side { order: -1; }
.profile-side .panel { margin-top: 0; }
.profile-side .prompt { flex-wrap: wrap; }
.profile-side .prompt-action { width: 100%; }
@media (min-width: 1000px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .profile-side { order: 0; position: sticky; top: 84px; }
}
.profile-main .tabs3 { margin-top: 0; }
.prompt[hidden], .attn-toggle[hidden], .count-badge[hidden] { display: none !important; }

/* ---------- Guided solo checks ---------- */
.progress { height: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 14px 0 6px; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }
.progress-text { margin: 0 0 12px; font-weight: 700; color: var(--navy-800); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: s; }
.step { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.step.ok { background: #e8f4f1; border-color: #a9d3c9; display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 56px; }
.step.bad { border-color: #f3b8b3; background: var(--danger-bg); }
.step-open > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 56px; }
.step-open > summary::-webkit-details-marker { display: none; }
.step-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; flex: none; }
.step.bad .step-icon { background: var(--danger); }
.step-state { margin-left: auto; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft, #555); }
.step-body { padding: 0 14px 14px 56px; display: grid; gap: 6px; justify-items: start; }
.step-body p { margin: 0; }
.flow-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #fff4d6; border: 1px solid #e8cf86; border-left: 6px solid #d9a400; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }

/* ---------- Name containers hold the buttons and scroll with the page ---------- */
.profile-head .head-tabs { flex: 1 1 100%; margin: 4px 0 0; }
.profile-head .head-tabs .tab3 { min-height: 46px; }
.name-card { border-top: 4px solid var(--accent); }
.name-card .student-name { margin: 0 0 4px; }
.name-card .hint { margin: 0 0 12px; }
.name-card .file-actions { margin: 0; grid-template-columns: 1fr; }
.file-grid { align-items: start; gap: 14px; }
.file-main { display: grid; gap: 14px; align-content: start; }
.file-side { display: grid; gap: 14px; align-content: start; }
.file-side .panel, .file-main .panel { margin: 0; }
@media (min-width: 900px) { .file-side { position: sticky; top: 14px; } }

/* Documents table: tidy status, clear column lines */
.docs-table { border-collapse: collapse; width: 100%; }
.docs-table th, .docs-table td { border: 1px solid var(--line); padding: 12px 14px; }
.docs-table thead th { background: var(--paper); }
.docs-table td, .docs-table th { vertical-align: middle; }
.docs-table .status-cell { min-width: 190px; }
.st-line { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 8px; }
.st-line:last-child { margin-bottom: 0; }
.st-line .pill { white-space: nowrap; }
.st-date { font-size: 0.88rem; color: var(--ink-soft, #555); padding-left: 4px; }
.docs-table .pill { white-space: nowrap; border-radius: 999px; }
.docs-table .file-cell { min-width: 150px; }

/* Instructor file: horizontal name bar across the top, sticky */
.name-card { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; margin: 0 0 14px; padding: 14px 20px; box-shadow: 0 4px 14px rgba(3,22,52,.12); }
.name-card .name-text { min-width: 0; }
.name-card .student-name { margin: 0; }
.name-card .hint { margin: 2px 0 0; }
.name-card .file-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.name-card .file-actions .tab3 { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; white-space: nowrap; }
.name-card .tab3-link::after { margin-left: 8px; }
@media (min-width: 900px) { .file-side { position: static; } }
.name-card { flex-wrap: nowrap; }
.name-card .name-text { flex: 1 1 auto; }
.name-card .file-actions { flex: none; }
@media (max-width: 700px) { .name-card { flex-wrap: wrap; } }
a.prompt-action, a.prompt-action:hover { text-decoration: none; color: #fff; text-align: center; display: block; }
.name-card .student-name { white-space: nowrap; }
.name-card .name-text { flex: 1 1 0; }

.panel hr.split { border: 0; border-top: 2px solid var(--line); margin: 20px 0 16px; }

.review-done { margin-top: 12px; } .review-done > summary { cursor: pointer; font-weight: 700; padding: 10px 0; min-height: 44px; display: flex; align-items: center; }

.hours-line { margin: 0 0 14px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 8px; font-weight: 700; color: var(--navy-800, #143560); }
.name-card .file-actions .tab3 { min-height: 64px; padding: 0 34px; font-size: 1.1rem; }
.name-card.plain { position: static; }
.rg-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .rg-head h2 { margin: 0; }
.rg-sign { display: grid; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--line); }
.rg-sign label { display: grid; gap: 6px; font-weight: 600; } .rg-sign textarea { font: inherit; padding: 10px; border: 1.5px solid var(--line); border-radius: 8px; }
.review-group .flight-item { margin-top: 8px; }
.review-notes { margin: 8px 0; padding: 10px 14px; background: var(--paper); border-left: 5px solid var(--accent); border-radius: 8px; }
.review-flights h4 { margin: 12px 0 6px; }

.fl input.auto-field { background: var(--paper); font-weight: 800; font-size: 1.15rem; text-align: center; cursor: not-allowed; color: var(--navy-900); }

/* ---------- Dual check form: laid out like the CAA 0152 sheet ---------- */
.dc-sheet { background: #fff; border: 2px solid var(--navy-900); border-radius: 6px; padding: 14px; margin-top: 12px; max-width: 900px; }
.dc-mast { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .78rem; border-bottom: 2px solid var(--navy-900); padding-bottom: 8px; }
.dc-mast-l, .dc-mast-r { display: grid; gap: 1px; } .dc-mast-r { text-align: right; } .dc-mast strong { font-size: 1rem; }
.dc-title { text-align: center; margin: 12px 0; } .dc-title h3 { margin: 0; font-size: 1.15rem; letter-spacing: .02em; } .dc-title p { margin: 2px 0 0; font-weight: 800; }
.dc-head { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--navy-900); }
.dc-cell { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--navy-900); margin: -1px 0 0 -1px; min-height: 58px; align-content: center; }
.dc-label { font-size: .72rem; font-weight: 800; letter-spacing: .05em; color: var(--navy-700); }
.dc-val { font-weight: 700; } .dc-cell input, .dc-cell select { font: inherit; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 6px; min-height: 40px; width: 100%; }
.dc-legend { margin: 12px 0; text-align: center; font-size: .85rem; } .dc-key { margin: 0 0 6px; font-weight: 700; }
.dc-scale-key { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .dc-scale-key div { border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: var(--paper); }
.dc-note { margin: 6px 0 0; font-style: italic; color: var(--ink-soft, #555); }
.dc-colhead { display: grid; grid-template-columns: 1fr auto; background: var(--navy-900); color: #fff; font-weight: 800; padding: 8px 10px; letter-spacing: .06em; }
.dc-band { background: #dfe8f3; border: 1px solid var(--navy-900); border-top: 0; text-align: center; font-weight: 800; padding: 6px; font-size: .85rem; letter-spacing: .04em; }
.dc-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-top: 0; padding: 4px 8px; }
.dc-row.done { background: #f3faf8; } .dc-aspect { padding: 6px 0; }
.dc-opts { display: flex; gap: 6px; }
.dc-opt { font: inherit; font-weight: 800; min-width: 46px; min-height: 46px; border: 2px solid var(--navy-700); background: #fff; color: var(--navy-700); border-radius: 8px; cursor: pointer; }
.dc-opt.on { background: var(--navy-700); color: #fff; box-shadow: inset 0 -4px 0 var(--accent-light); } .dc-opt.neg.on { background: var(--danger); border-color: var(--danger); box-shadow: none; }
.dc-row.airm .dc-opt { min-width: 62px; }
.dc-sheet textarea { width: 100%; margin-top: 12px; font: inherit; padding: 8px; border: 1.5px solid var(--line); border-radius: 8px; }
.dc-result { margin: 8px 0 0; font-weight: 700; } .dc-result.unsatisfactory { color: var(--danger); } .dc-result.satisfactory { color: var(--ok); }
.dc-sigs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 14px; border-top: 2px solid var(--navy-900); padding-top: 12px; } .dc-sig { display: grid; gap: 6px; align-content: start; }
.dc-comments { margin: 10px 0 0; }
.dc-sheet.readonly .dc-opt:disabled { opacity: .35; cursor: default; } .dc-sheet.readonly .dc-opt.on { opacity: 1; }
@media (max-width: 700px) { .dc-head, .dc-sigs { grid-template-columns: 1fr; } .dc-row { grid-template-columns: 1fr; } .dc-scale-key { grid-template-columns: 1fr 1fr; } }

/* Home after sign-in */
.home-actions { grid-template-columns: 1fr; } @media (min-width: 640px) { .home-actions { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
a.access-btn { text-decoration: none; color: inherit; display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; }
.access-btn.cfi-block { background: #fff4d6; border-color: #d9a400; border-width: 2px; }
.access-btn.cfi-block .title { color: #7a5200; } .access-btn.cfi-block:hover { background: #ffecb3; border-color: #b88700; }
.demo-row { display: flex; gap: 8px; flex-wrap: wrap; } .demo-btn { min-height: 44px; }

.target { outline: 3px solid var(--accent-light); outline-offset: -3px; background: #fff9e0 !important; animation: pulse-target 1.6s ease-out 2; }
@keyframes pulse-target { from { box-shadow: 0 0 0 6px rgba(47,179,155,.45); } to { box-shadow: 0 0 0 0 rgba(47,179,155,0); } }
@media (prefers-reduced-motion: reduce) { .target { animation: none; } }

/* Exercise picker, briefing and lesson toggles on the flight form */
.ex-picker .chips{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.5rem}
.ex-picker .chip{display:inline-flex;align-items:center;gap:.4rem;padding:.3rem .3rem .3rem .7rem;border:1px solid var(--line,#c9d1da);border-radius:999px;background:#eef3f8;font-weight:600}
.ex-picker .chip-name{font-weight:400;color:#556}
.ex-picker .chip button{border:0;background:#d5dde6;border-radius:50%;width:1.6rem;height:1.6rem;cursor:pointer;font-size:1.1rem;line-height:1}
.pick-wrap{position:relative}
.pick-list{position:absolute;z-index:20;left:0;right:0;top:100%;background:#fff;border:1px solid #c9d1da;border-radius:8px;box-shadow:0 6px 18px rgba(0,0,0,.15);max-height:16rem;overflow:auto}
.pick-item{display:block;width:100%;text-align:left;padding:.7rem .9rem;border:0;border-bottom:1px solid #eef1f4;background:none;cursor:pointer;font:inherit}
.pick-item:hover,.pick-item:focus{background:#eef3f8}
.brief-count{font-weight:600}
.briefing-fs .docblock{margin:.6rem 0}
.lesson-list{display:grid;gap:.5rem}
.lesson-row{display:flex;align-items:center;justify-content:space-between;gap:.8rem;padding:.6rem .8rem;border:1px solid #c9d1da;border-radius:8px}
.lesson-row.done{background:#f1f2f4;color:#8a929b}
.lesson-btn[aria-pressed=true]{background:#1f8a4c;color:#fff;border-color:#1f8a4c}
.briefed{font-size:.85rem}
.cfi-reviewed{text-align:right;margin:.6rem 0 0;color:#8a929b;font-size:.85rem;font-style:italic}

/* Signed CFI review groups: collapsible, signature on the right */
.review-group{padding:0}
.review-group>summary{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap;cursor:pointer;padding:.7rem 1rem;min-height:44px}
.review-cols{display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:1rem;padding:0 1rem 1rem;align-items:start}
.review-sig{border:1px solid var(--line,#c9d1da);border-radius:8px;padding:.6rem;background:#fff}
.review-sig .sig-img{max-width:100%;height:auto;display:block}
.review-group .review-notes{margin:0 0 .6rem;padding:.5rem .8rem}
.review-group .review-flights h4{margin:.4rem 0}
.review-group .flight-item>summary{padding:.35rem .7rem;min-height:0}
@media(max-width:700px){.review-cols{grid-template-columns:1fr}}

.caa-window{margin:0 0 1rem;padding:.8rem 1rem;border:1px solid #c9d1da;border-left:5px solid #1f8a4c;border-radius:8px;background:#f7fafc}
.caa-window.soon{border-left-color:#d9a400}.caa-window.expired{border-left-color:#c0392b}
.caa-window .caa-line{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;font-size:1.05rem}

/* Student record (PDF) */
.rec-modes{display:flex;gap:.5rem;flex-wrap:wrap;margin:.5rem 0}
.rec-modes .btn[aria-pressed=true]{background:#14365f;color:#fff;border-color:#14365f}
.record{background:#fff;color:#111;padding:20px 24px;border:1px solid #c9d1da;border-radius:8px;font-size:12px;line-height:1.4}
.record h1{font-size:20px;margin:.3rem 0}.record h2{font-size:15px;margin:0 0 .5rem;padding:.35rem .6rem;background:#14365f;color:#fff;border-radius:4px}
.record h3{font-size:13px;margin:.7rem 0 .3rem}
.rec-org{font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#14365f}.rec-name{font-size:18px;font-weight:700;margin-bottom:.5rem}
.rec-sec{margin:0 0 1.2rem}.rec-head{margin-bottom:1.2rem;padding-bottom:.6rem;border-bottom:2px solid #14365f}
.rec-kv{display:grid;gap:.35rem .8rem;margin:.3rem 0}.rec-kv.c2{grid-template-columns:repeat(2,1fr)}.rec-kv.c3{grid-template-columns:repeat(3,1fr)}.rec-kv.c4{grid-template-columns:repeat(4,1fr)}
.rec-item{border:1px solid #dde3ea;border-radius:4px;padding:.25rem .5rem}.rec-k{font-size:10px;color:#667;text-transform:uppercase;letter-spacing:.03em}.rec-v{font-weight:600;white-space:pre-wrap;overflow-wrap:anywhere}
.rec-table{width:100%;border-collapse:collapse;margin:.4rem 0;font-size:11px}.rec-table th,.rec-table td{border:1px solid #c9d1da;padding:.25rem .4rem;text-align:left;vertical-align:top}.rec-table th{background:#eef3f8}
.rec-table.small{font-size:10px}
.rec-flight,.rec-signrow,.rec-doc{border:1px solid #dde3ea;border-radius:6px;padding:.4rem .7rem;margin:.5rem 0}
.rec-notes{margin:.4rem 0;padding:.4rem .6rem;background:#f4f6f8;border-left:4px solid #14365f;white-space:pre-wrap;min-height:1.4em}
.rec-sigrow{display:flex;gap:1rem;flex-wrap:wrap;margin:.4rem 0}.rec-sig{width:210px}.rec-sig img{width:100%;height:70px;object-fit:contain;border:1px solid #c9d1da;border-radius:4px;background:#fff;display:block}
.rec-nosig{height:70px;border-bottom:1px solid #556}
.rec-doc img{max-width:100%;max-height:420px;display:block;margin-top:.3rem}
.rec-note{color:#445}.rec-grey{text-align:right;color:#8a929b;font-style:italic;font-size:11px}
@media print{
  body.page{background:#fff}.no-print,.topbar,.back-row{display:none!important}
  main.wide{max-width:none;margin:0;padding:0}.record{border:0;padding:0}
  .rec-flight,.rec-signrow,.rec-doc,tr{break-inside:avoid}.record h2,.record h3{break-after:avoid}
  .record h2{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}

.caa-boxes{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:.8rem;margin:0 0 1rem}
.caa-box{padding:.8rem 1rem;border:1px solid #c9d1da;border-radius:8px;background:#f7fafc}
.caa-expiry{border-left:5px solid #1f8a4c}.caa-expiry.soon{border-left-color:#d9a400}.caa-expiry.expired{border-left-color:#c0392b}
.caa-label{font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#14365f}
.caa-big{font-size:1.5rem;font-weight:800;margin:.2rem 0}
.caa-sub{color:#556}
@media(max-width:600px){.caa-boxes{grid-template-columns:1fr}}

/* Certificate (landscape A4, from the school template) */
.cert{position:relative;width:100%;max-width:1123px;aspect-ratio:297/210;margin:1rem auto;overflow:hidden;background:#e8e8e8;color:#222;font-family:Inter,"Segoe UI",Arial,sans-serif;container-type:inline-size;border:1px solid #c9d1da}
.cert>*{position:absolute}.cert .cert-bg{left:0;top:0;width:100%;height:100%;object-fit:cover}
.cert-title{left:0;right:0;top:27%;text-align:center;font-weight:800;font-size:5.4cqw;color:#111;letter-spacing:.01em}
.cert-certify{left:0;right:0;top:41%;text-align:center;font-size:2.2cqw;color:#555;letter-spacing:.04em}
.cert-name{left:5%;right:5%;top:47%;text-align:center;font-weight:700;font-size:3.6cqw;color:#111}
.cert-line{left:20%;right:20%;top:57%;border-top:2px solid #222}
.cert-done{left:0;right:0;top:60%;text-align:center;font-size:2.3cqw;color:#444}
.cert-course{left:0;right:0;top:67%;text-align:center;font-size:2.3cqw;color:#444}
.cert-logo{left:6%;bottom:9%;width:21%;height:auto}
.cert-sig-line{right:7%;width:22%;bottom:25%;border-top:2px solid #222}
.cert-sig-label{right:7%;width:22%;bottom:20.5%;font-size:1.6cqw;color:#333;padding-left:1cqw}
.cert-date{right:7%;width:22%;bottom:15%;text-align:center;font-size:1.7cqw}
.cert-date-line{right:7%;width:22%;bottom:13.5%;border-top:2px solid #222}
.cert-date-label{right:7%;width:22%;bottom:9.5%;text-align:center;font-size:1.6cqw;color:#333}
.cert-no{right:3%;bottom:3.5%;font-size:1.3cqw;font-style:italic;color:#444}
.survey-q{margin:.7rem 0}.survey-q textarea{width:100%}
.survey-q .dc-opts{display:flex;gap:.4rem;flex-wrap:wrap}
@media print{
  @page{size:A4 landscape;margin:0}
  body.print-cert .panel,body.print-cert .back-row,body.print-cert .topbar{display:none!important}
  body.print-cert main.wide{max-width:none;margin:0;padding:0}
  body.print-cert .cert{margin:0;border:0;max-width:none;width:100vw}
}

/* Student record: plain, compact, no gaps */
.record h2{background:none;color:#000;border-bottom:2px solid #000;border-radius:0;padding:0 0 .15rem;margin:0 0 .4rem;font-size:14px;text-transform:uppercase;letter-spacing:.03em}
.rec-sec{margin:0 0 .8rem}
.rec-head{border-bottom:2px solid #000}
.rec-flight,.rec-signrow,.rec-doc{padding:.25rem .5rem;margin:.3rem 0}
.rec-sig img,.rec-nosig{height:50px}.rec-sig{width:170px}
@media print{ .rec-flight,.rec-signrow,.rec-doc{break-inside:auto} .record h2{background:none!important;color:#000!important} @page{margin:12mm} }

/* Responsive safety: nothing may push the page wider than the screen */
.profile-main,.profile-head,.file-main,.file-side,.panel,.file-grid>*{min-width:0}
.table-wrap{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
.file-actions{display:flex;flex-wrap:wrap;gap:10px}
.file-actions .tab3{flex:1 1 150px;text-align:center}
.rec-table{table-layout:fixed;word-break:break-word}
.record{overflow-wrap:anywhere}
select,input:not([type=checkbox]):not([type=radio]),textarea{max-width:100%}
.panel p,.panel li,.hint{overflow-wrap:anywhere}
@media(max-width:640px){
  .fl-row,.fl-row.r3,.fl-row.r4{grid-template-columns:1fr!important}
  .fl-row.r4{grid-template-columns:1fr 1fr!important}
  .rec-kv.c3,.rec-kv.c4{grid-template-columns:1fr 1fr}
  .panel{padding-left:14px;padding-right:14px}
  .btn{max-width:100%}
  .actions{flex-wrap:wrap}
}
.name-card{flex-wrap:wrap!important}
.name-card .name-text{flex:1 1 220px!important;min-width:0}
.name-card .student-name{white-space:normal!important}
.name-card .file-actions{flex:1 1 auto!important;min-width:0;justify-content:flex-end}
.name-card .file-actions .tab3{white-space:normal!important;padding:0 16px!important;flex:0 1 auto}
@media(max-width:700px){.name-card .file-actions{justify-content:stretch}.name-card .file-actions .tab3{flex:1 1 140px}}
.profile-main .table-wrap,.docs-table{max-width:100%}
.table-wrap{display:block;width:100%}

/* completion review rows: text grows, Fix button stays on the right */
.checks li > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.checks li > .btn { flex: 0 0 auto; margin-left: auto; white-space: nowrap; }
@media (max-width: 560px) { .checks li { flex-wrap: wrap; } .checks li > .btn { margin-left: 28px; } }

/* introductory flight row */
.intro-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; background: #fff; }
.intro-row .hint, .intro-row .message { flex: 1 1 100%; margin: 0; }
.intro-row input[type=date] { width: auto; }
.intro-row.target { outline: 3px solid #e0a100; background: #fff8e1; }

/* ---------- Theme: navy page fading lighter down the page, white containers, green buttons ---------- */
:root { --fade-top: #031634; --fade-mid: #0b2a52; --fade-bottom: #2c5388; }
html { background: var(--fade-bottom); }
body { background: linear-gradient(180deg, var(--fade-top) 0%, var(--fade-mid) 45%, var(--fade-bottom) 100%) no-repeat; background-color: var(--fade-bottom); }
.topbar { background: transparent; border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
.band { background: transparent; border-bottom: 0; }
.proto-note { color: #b9c9dd; }
.proto-note code { color: #dbe6f3; }
.back-row .btn { background: #fff; }
.panel, .card, .tabs { box-shadow: 0 1px 2px rgba(3, 22, 52, 0.18), 0 6px 18px rgba(3, 22, 52, 0.12); }
@media print { html, body { background: #fff !important; } }
.two-col { margin: 16px 0; align-items: stretch; }
.two-col > .panel { margin-top: 0; }
.panel + .two-col + .panel, .two-col + .panel { margin-top: 0; }

/* bigger logo in the top bar; home page: two stand-alone buttons only */
.topbar .brand img { height: 48px; }
.home-page .topbar .brand img { height: 64px; }
.home-page .topbar .who { font-size: 1.05rem; color: #fff; font-weight: 600; }
.home-main { max-width: 760px; }
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
.home-btn { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 170px; padding: 24px; background: #fff; color: var(--ink); border-radius: var(--radius); font-size: 1.5rem; font-weight: 700; text-decoration: none; box-shadow: 0 1px 2px rgba(3,22,52,.18), 0 8px 24px rgba(3,22,52,.18); border: 2px solid transparent; }
.home-btn:hover, .home-btn:focus-visible { border-color: var(--accent); }
@media (max-width: 600px) { .home-actions { grid-template-columns: 1fr; } .home-btn { min-height: 110px; } .topbar .brand img { height: 40px; } .home-page .topbar .brand img { height: 48px; } }

/* instructor page: view switch, defined table, name buttons, floating upload button */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.view-switch { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.view-btn { font: inherit; font-size: 1.15rem; font-weight: 700; padding: 12px 22px; border-radius: var(--radius); border: 2px solid transparent; background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 1px 2px rgba(3,22,52,.18), 0 6px 18px rgba(3,22,52,.12); }
.view-btn:hover { border-color: var(--accent); }
.view-btn[aria-pressed="true"] { background: var(--navy-700); color: #fff; }
.defined-table { border-collapse: collapse; border: 2px solid var(--navy-700); }
.defined-table th, .defined-table td { border: 1px solid #9fb0c6; padding: 10px 12px; }
.defined-table thead th { background: var(--navy-700); color: #fff; border-color: var(--navy-800); text-transform: uppercase; letter-spacing: .04em; font-size: .8rem; }
.defined-table tbody tr:nth-child(even) { background: #f3f6fa; }
.name-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 2px solid var(--navy-700); border-radius: 8px; background: #fff; color: var(--navy-700); font-weight: 700; text-decoration: none; }
.name-btn::after { content: '\203A'; font-size: 1.2em; line-height: 1; }
.name-btn:hover, .name-btn:focus-visible { background: var(--navy-700); color: #fff; }
.float-btn { position: fixed; right: 20px; bottom: 20px; z-index: 50; background: var(--accent); color: #fff; font-weight: 700; font-size: 1.05rem; padding: 16px 26px; border-radius: 999px; text-decoration: none; box-shadow: 0 6px 20px rgba(3,22,52,.45); }
.float-btn:hover, .float-btn:focus-visible { background: var(--accent-dark); }
/* notifications: coloured edge fading to white at the centre */
.prompt { --edge: #2fb39b; background: #fff !important; border: 1px solid var(--edge) !important; box-shadow: inset 0 0 22px 2px var(--edge); }
.prompt.bad { --edge: #e57368; }
.prompt.warn { --edge: #e6b422; }
.prompt.todo { --edge: #7f9fd1; }
@media print { .float-btn { display: none; } }
.view-btn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent-light); }
.table-search, .table-wrap + input, input[type=search], .grid-search { }
.search-row { margin-bottom: 12px; }
.search-row input[type=search] { width: 100%; max-width: 360px; padding: 10px 14px; border: 2px solid #9fb0c6; border-radius: 8px; font: inherit; background: #fff; }
.search-row input[type=search]:focus { border-color: var(--accent); }

/* ===== Student file page: clean, aligned, one palette (navy, white, green for actions) ===== */
body.file-page .back-row .btn { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); box-shadow: none; font-weight: 600; }
body.file-page .back-row .btn:hover { background: rgba(255,255,255,.22); }
body.file-page .panel { border: 1px solid #dbe3ec; border-radius: 14px; box-shadow: 0 10px 30px rgba(3,22,52,.28); border-top: 1px solid #dbe3ec; }
body.file-page .name-card { position: static; display: flex !important; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; padding: 24px 28px; margin: 0 0 20px; border-left: 6px solid var(--accent); }
body.file-page .name-card .name-text { flex: 1 1 280px; min-width: 0; }
body.file-page .name-card .eyebrow { margin: 0 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
body.file-page .name-card .student-name { margin: 0; font-size: 2rem; line-height: 1.15; color: var(--navy-900); white-space: normal; }
body.file-page .name-card .name-sub { margin: 6px 0 0; color: var(--ink-soft); }
body.file-page .name-card .file-actions { display: flex; flex-wrap: wrap; gap: 10px; flex: 0 1 auto; justify-content: flex-end; margin: 0; }
body.file-page .name-card .file-actions .tab3 { flex: 0 0 auto; min-height: 46px; height: 46px; padding: 0 20px; font-size: .98rem; font-weight: 600; border-radius: 10px; border: 1.5px solid #c5d1e0; background: #fff; color: var(--navy-800); display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
body.file-page .name-card .file-actions .tab3:hover { border-color: var(--navy-700); background: #f3f6fa; }
body.file-page .name-card .file-actions .tab3-link { background: var(--accent); border-color: var(--accent); color: #fff; }
body.file-page .name-card .file-actions .tab3-link:hover { background: var(--accent-dark); }
body.file-page .file-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
body.file-page .file-main, body.file-page .file-side { min-width: 0; display: grid; gap: 20px; }
body.file-page .file-side .panel, body.file-page .file-main .panel { margin: 0; padding: 22px 24px; }
@media (max-width: 860px) { body.file-page .file-grid { grid-template-columns: 1fr; } body.file-page .name-card .file-actions { justify-content: flex-start; width: 100%; } body.file-page .name-card .file-actions .tab3 { flex: 1 1 calc(50% - 10px); } }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: #fff; border: 1px solid #dbe3ec; border-radius: 14px; padding: 16px 18px; box-shadow: 0 10px 30px rgba(3,22,52,.28); }
.stat-v { font-size: 1.8rem; font-weight: 800; color: var(--navy-800); line-height: 1.1; }
.stat-k { margin-top: 4px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
@media (max-width: 560px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
body.file-page .file-main h2, body.file-page .file-side h2 { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid #e3e9f0; font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; color: var(--navy-700); }
body.file-page .file-side .prompts { border: 1px solid #dbe3ec; }
body.file-page .file-side .prompts h2 { display: flex; align-items: center; gap: 8px; }
body.file-page .ds-notes { background: #f7f9fc; border: 1px solid #e3e9f0; border-radius: 10px; padding: 14px 16px; }
body.file-page .ds-item { background: #f7f9fc; border: 1px solid #e3e9f0; border-radius: 10px; }
body.file-page hr.split { border: 0; border-top: 1px solid #e3e9f0; margin: 22px 0; }
body.file-page .fl-sub { margin: 18px 0 8px; font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; color: var(--navy-700); }
/* notifications: softer, one consistent look everywhere */
.prompt { box-shadow: inset 0 0 16px 1px var(--edge); }
.prompt.bad { --edge: #ee9a92; }
.prompt.warn { --edge: #ecd08a; }
.prompt.todo { --edge: #a9c0e2; }
.prompt .pill { background: #fff; }
body.file-page .name-card .file-actions { flex: 1 1 100%; justify-content: flex-start; padding-top: 18px; border-top: 1px solid #e3e9f0; }
body.file-page .name-card { gap: 4px 28px; }

/* student file page v2: name beside the back button, thin tab bar, hours inside the last flight card */
body.file-page .file-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-bottom: 14px; }
body.file-page .file-top .student-name { margin: 0; font-size: 2rem; line-height: 1.15; color: #fff; }
body.file-page .file-top .name-sub { color: #b9c9dd; font-size: .95rem; }
body.file-page .file-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; margin: 0 0 20px; background: #fff; border: 1px solid #dbe3ec; border-radius: 12px; box-shadow: 0 6px 18px rgba(3,22,52,.25); }
body.file-page .file-tabs .tab3 { flex: 0 0 auto; height: 38px; min-height: 38px; padding: 0 18px; font-size: .92rem; font-weight: 600; border-radius: 8px; border: 1px solid #c5d1e0; background: #fff; color: var(--navy-800); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
body.file-page .file-tabs .tab3:hover { border-color: var(--navy-700); background: #f3f6fa; }
body.file-page .file-tabs .tab3-link { background: var(--accent); border-color: var(--accent); color: #fff; }
body.file-page .file-tabs .tab3-link::after { content: none; }
body.file-page .file-tabs .tab3-link:hover { background: var(--accent-dark); }
@media (max-width: 560px) { body.file-page .file-tabs .tab3 { flex: 1 1 calc(50% - 8px); } body.file-page .file-top .student-name { font-size: 1.6rem; } }
body.file-page .panel .stat-row { gap: 10px; margin: 0 0 18px; }
body.file-page .panel .stat { box-shadow: none; background: #f7f9fc; border: 1px solid #e3e9f0; border-radius: 10px; padding: 12px 14px; }
body.file-page .panel .stat-v { font-size: 1.4rem; }

body.file-page .file-top { gap: 10px 24px; }
body.file-page .file-top .back-btn { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); font-weight: 600; }
body.file-page .file-tabs { gap: 8px; }
body.file-page .file-tabs .tab3 { flex: 1 1 0; min-width: 150px; }
body.file-page .panel .stat-row { margin: 0; }
body.file-page .file-top { justify-content: space-between; }
body.file-page .file-top .back-btn { margin-left: auto; }

/* ===== shared student-file header on every file page ===== */
body.file-page .file-tabs .tab3[aria-current="page"] { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
body.file-page .file-tabs .tab3 { min-width: 0; padding: 0 10px; }
body.file-page .back-row, body.file-page #profile-head, body.file-page main .panel .student-name, body.file-page #training > .panel:first-child, body.file-page #view > .panel.name-card, body.file-page .name-card.plain { display: none !important; }
body.file-page #view > .panel.no-print:first-child { display: none; }
body.file-page .file-top .file-name { display: block !important; }
body.file-page main > .panel > h2, body.file-page .panel > h2, body.file-page .sheet-bar h2 { font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; color: var(--navy-700); }
body.file-page .tabs { background: #fff; border: 1px solid #dbe3ec; border-radius: 12px; padding: 6px; }
body.file-page .tab[aria-selected="true"], body.file-page .tab3[aria-selected="true"] { background: var(--navy-700); color: #fff; }
body.file-page .prompts { border: 1px solid #dbe3ec; }
@media print { body.file-page .file-top, body.file-page .file-tabs { display: none !important; } }
body.file-page .back-btn, body.file-page .back-btn:hover { text-decoration: none !important; }
body.file-page .tabs { margin-top: 16px; }
body.file-page #notify:not(:empty) { margin-bottom: 16px; }
@media (max-width: 760px) { body.file-page .file-tabs .tab3 { flex: 1 1 calc(33.33% - 8px); white-space: normal; height: auto; min-height: 40px; padding: 6px 8px; text-align: center; } }
@media (max-width: 480px) { body.file-page .file-tabs .tab3 { flex: 1 1 calc(50% - 8px); } }

/* documentation tab: the documents show any problem, so no Needs attention panel and the table gets the full width */
.profile-grid.no-side { grid-template-columns: minmax(0, 1fr) !important; }
.profile-grid.no-side .profile-side { display: none; }

/* ===== site-wide tab bars: same look as the student-file bar ===== */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; background: #fff; border: 1px solid #dbe3ec; border-radius: 12px; box-shadow: 0 6px 18px rgba(3,22,52,.25); }
.tabs .tab { flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; text-align: center; font: inherit; font-size: .92rem; font-weight: 600; white-space: nowrap; border: 1px solid #c5d1e0; border-radius: 8px; background: #fff; color: var(--navy-800); cursor: pointer; }
.tabs .tab:hover { border-color: var(--navy-700); background: #f3f6fa; }
.tabs .tab[aria-selected="true"] { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
@media (max-width: 760px) { .tabs .tab { flex: 1 1 calc(50% - 8px); white-space: normal; height: auto; min-height: 40px; padding: 6px 8px; } }
.tabs { gap: 6px; padding: 6px; }
.tabs .tab { padding: 0 8px; font-size: .88rem; }
/* spacing: tab bars never touch the container below */
.tabs { margin-bottom: 18px; }
.tabs + *, .tabs + [role="tabpanel"], .tabs + .panel, .file-main > .tabs + *, .file-side > .tabs + * { margin-top: 0; }

/* ===== Student information sheet + card titles: match the snapshot look ===== */
.sheet-panel { padding: 24px; }
.sheet-bar { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid #e3e9f0; }
.sheet { gap: 22px; }
.sheet-card { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.sheet-card h3, .sheet-card:nth-child(2) h3, .sheet-card:nth-child(3) h3 {
  background: transparent; color: var(--navy-700); border: 0; border-left: 0; padding: 0 0 8px; margin: 0 0 12px;
  font-size: .8rem; letter-spacing: .12em; border-bottom: 1px solid #e3e9f0;
}
.sheet-grid { padding: 0; gap: 14px 16px; }
.fld label { display: block; font-size: .72rem; color: #5b6b80; margin: 0 0 5px; }
.fld input, .fld textarea { border: 1px solid #c5d1e0; border-radius: 8px; background: #fff; min-height: 40px; padding: 8px 12px; }
.fld input:focus, .fld textarea:focus { border-color: var(--navy-700); outline: 3px solid rgba(20,52,92,.15); }
.sheet.locked .fld input, .sheet.locked .fld textarea { background: #f7f9fc; border-color: #e3e9f0; color: var(--navy-900); font-weight: 600; }
.card-title { display: block; border: 0; border-bottom: 1px solid #e3e9f0; padding: 0 0 10px; margin: 0 0 14px; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-700); }
.two-up .panel { padding: 22px 24px; }
.two-up select, #profile select { min-height: 40px; border: 1px solid #c5d1e0; border-radius: 8px; padding: 0 12px; background: #fff; font: inherit; }
.two-up > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.fld textarea { min-height: 40px; field-sizing: content; }
.sheet.locked .fld textarea { min-height: 40px; }
/* exam result file cell: stacked, not squashed */
.file-cell { min-width: 150px; }
.file-cell > * { display: block; }
.file-cell .muted { margin: 0 0 8px; font-size: .88rem; }
.file-cell .file-btn, .file-cell .btn { display: inline-flex; width: auto; min-height: 36px; padding: 0 14px; margin: 0; background: #fff; color: var(--navy-800); border: 1px solid #c5d1e0; }
.file-cell .file-btn:hover { border-color: var(--navy-700); background: #f3f6fa; }
.exam-table td, .exam-table th { padding: 10px 12px; vertical-align: middle; }
/* exam table: fixed, proportioned columns */
.exam-table { table-layout: fixed; width: 100%; min-width: 760px; }
.exam-table th, .exam-table td { padding: 10px 10px; vertical-align: middle; }
.exam-table th:nth-child(1) { width: 23%; text-align: left; }
.exam-table th:nth-child(2) { width: 9%; }
.exam-table th:nth-child(3) { width: 13%; }
.exam-table th:nth-child(4) { width: 8%; }
.exam-table th:nth-child(5) { width: 10%; }
.exam-table th:nth-child(6) { width: 17%; }
.exam-table th:nth-child(7) { width: 10%; }
.exam-table th:nth-child(8) { width: 10%; }
.exam-table td:nth-child(2), .exam-table td:nth-child(4), .exam-table td:nth-child(5), .exam-table td:nth-child(7), .exam-table td:nth-child(8),
.exam-table th:nth-child(2), .exam-table th:nth-child(4), .exam-table th:nth-child(5), .exam-table th:nth-child(7), .exam-table th:nth-child(8) { text-align: center; }
.exam-table td:nth-child(3) { white-space: nowrap; }
.exam-table td:nth-child(6) { text-align: left; }
.exam-table .file-cell { min-width: 0; }
.exam-table .file-cell .thumb { max-width: 100%; height: 44px; object-fit: contain; }
.exam-table .file-cell .file-btn { min-height: 34px; padding: 0 10px; font-size: .85rem; }
.exam-table .row-actions { white-space: normal; }
.exam-table th:nth-child(1) { width: 20%; } .exam-table th:nth-child(7) { width: 13%; }
/* sticky notification panel: sit close to the top while scrolling */
body.file-page .profile-side, body.file-page .file-side { top: 16px; }

/* ===== Documents table: proportioned, tidy, safe in edit mode ===== */
.docs-table { table-layout: fixed; width: 100%; min-width: 820px; }
.docs-table th, .docs-table td { padding: 12px 12px; vertical-align: middle; text-align: left; }
.docs-table th:nth-child(1) { width: 13%; }
.docs-table th:nth-child(2) { width: 21%; }
.docs-table th:nth-child(3) { width: 18%; }
.docs-table th:nth-child(4) { width: 19%; }
.docs-table th:nth-child(5) { width: 15%; }
.docs-table th:nth-child(6) { width: 14%; }
.docs-table td, .docs-table th[scope="row"] { overflow-wrap: anywhere; white-space: normal; }
.docs-table td:nth-child(3) { white-space: nowrap; overflow-wrap: normal; font-weight: 600; color: var(--navy-900); }
.docs-table td:nth-child(3).muted { font-weight: 400; }
/* status: pill then date, stacked evenly */
.docs-table .st-line { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 0 0 8px; }
.docs-table .st-line:last-child { margin-bottom: 0; }
.docs-table .st-date { font-size: .85rem; color: var(--ink-soft); }
/* expiry: date, then pill beneath, same left edge */
.docs-table td:nth-child(4) > div { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
/* file: thumbnail, then button, with space between */
.docs-table .file-cell { min-width: 0; }
.docs-table .file-cell > * { display: block; }
.docs-table .file-cell a { margin: 0 0 10px; }
.docs-table .file-cell .thumb { width: 100%; max-width: 110px; height: auto; max-height: 48px; object-fit: contain; }
.docs-table .file-cell .muted { margin: 0 0 10px; }
.docs-table .file-btn { display: inline-flex; width: auto; padding: 0 14px; min-height: 36px; }
/* actions: buttons stacked, full cell width */
.docs-table .row-actions { white-space: normal; }
.docs-table .row-actions .btn { display: flex; width: 100%; max-width: 110px; justify-content: center; margin: 0 0 8px; }
.docs-table .row-actions .btn:last-child { margin-bottom: 0; }
/* edit mode inputs fit their cell */
.docs-table input[type="text"], .docs-table input[type="date"] { width: 100%; min-width: 0; min-height: 40px; box-sizing: border-box; border: 1px solid #c5d1e0; border-radius: 8px; padding: 0 10px; background: #fff; }
.docs-table label.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .88rem; }
.docs-table .field-error { margin: 8px 0 0; }
.docs-table input[type="checkbox"] { width: 18px; min-width: 18px; height: 18px; min-height: 0; flex: none; padding: 0; }
.docs-table label.check { white-space: normal; }
@media (max-width: 860px) { .docs-table { min-width: 760px; } }
.profile-main, .profile-grid > *, #panel-docs, #panel-docs .panel { min-width: 0; max-width: 100%; }
.table-wrap { position: relative; }
/* attachment icon + viewer */
.clip-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid #c5d1e0; border-radius: 10px; background: #fff; color: var(--navy-700); cursor: pointer; margin: 0 0 8px; }
.clip-btn:hover { border-color: var(--navy-700); background: #f3f6fa; }
.docs-table .file-cell .clip-btn { display: inline-flex; }
.attach-back { position: fixed; inset: 0; z-index: 200; background: rgba(3,22,52,.7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.attach-box { background: #fff; border-radius: 14px; max-width: 760px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.attach-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #e3e9f0; color: var(--navy-900); }
.attach-body { padding: 18px; overflow: auto; text-align: center; }
.attach-body img { max-width: 100%; height: auto; border: 1px solid #e3e9f0; border-radius: 8px; }

/* ===== Ratings (advanced training) ===== */
.add-rating { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.add-rating select { min-width: 260px; flex: 1 1 260px; min-height: 42px; border: 1px solid #c5d1e0; border-radius: 8px; padding: 0 12px; background: #fff; font: inherit; }
.rt-wrap { display: grid; gap: 18px; margin-top: 0; }
.rt-wrap .panel { margin-top: 0; }
.rt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rt-wrap h3 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-700); margin: 22px 0 10px; padding-bottom: 8px; border-bottom: 1px solid #e3e9f0; }
.rt-table { width: 100%; }
.rt-table th[scope="row"] { text-align: left; font-weight: 600; }
.rt-note { display: block; font-weight: 400; font-size: .82rem; color: var(--ink-soft); margin-top: 2px; }
.rt-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rt-prog { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.rt-bar { flex: 1; height: 10px; background: #e8eef5; border-radius: 999px; overflow: hidden; }
.rt-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.rt-ok { color: #1a7f4b; font-weight: 700; }
.rt-target { width: 90px; min-height: 36px; border: 1px solid #c5d1e0; border-radius: 8px; padding: 0 8px; }
.rt-edit { margin-top: 12px; }
.rt-source { margin-top: 10px; }
.rt-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; margin-bottom: 8px; }
.rt-form input, .rt-form textarea, .rt-table input[type="date"], .rt-table input[type="number"] { min-height: 40px; border: 1px solid #c5d1e0; border-radius: 8px; padding: 0 10px; font: inherit; width: 100%; box-sizing: border-box; background: #fff; }
.rt-form textarea { padding: 8px 10px; }
.nowrap { white-space: nowrap; }
.rt-table td input { min-width: 120px; }
/* seven file tabs fit one row */
body.file-page .file-tabs { gap: 6px; padding: 6px; }
body.file-page .file-tabs .tab3 { flex: 1 1 auto; min-width: 0; padding: 0 10px; font-size: .86rem; }
@media (max-width: 760px) { body.file-page .file-tabs .tab3 { flex: 1 1 calc(50% - 8px); white-space: normal; height: auto; min-height: 40px; } }
.rt-table th[scope="row"] { text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--navy-900); }
.rt-form-grid { align-items: end; }
.rt-form .field label { font-size: .85rem; font-weight: 600; }

/* ===== Briefing blocks: soft rounded containers ===== */
details.docblock { border: 1px solid #dbe3ec; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(3,22,52,.06); }
details.docblock > summary { background: var(--navy-700); border-radius: 0; min-height: 48px; transition: background .15s; }
details.docblock > summary:hover { background: var(--navy-800); }
details.docblock:not([open]) > summary { border-radius: 11px; }
.doc-title { letter-spacing: .08em; font-size: .9rem; }
.doc-state { padding: 4px 12px; }
.doc-list { gap: 10px; }
.doc-row { border-bottom-color: #e3e9f0; }

/* ===== Introductory flight row: even columns filling the container ===== */
.intro-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(250px, 1.4fr) auto; align-items: center; gap: 14px 20px; padding: 14px 18px; border: 1px solid #dbe3ec; border-radius: 12px; background: #f7f9fc; margin-bottom: 12px; }
.intro-title { font-size: 1rem; color: var(--navy-900); }
.intro-row .check { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; }
.intro-row .intro-date { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; white-space: nowrap; }
.intro-row input[type=date] { width: auto; flex: 1; min-height: 40px; border: 1px solid #c5d1e0; border-radius: 8px; padding: 0 10px; background: #fff; }
.intro-row .btn { justify-self: end; min-width: 90px; }
.intro-row .message { grid-column: 1 / -1; }
@media (max-width: 760px) { .intro-row { grid-template-columns: 1fr; } .intro-row .btn { justify-self: stretch; } }
/* name buttons: one size for every name */
.name-btn { display: flex; align-items: center; justify-content: space-between; width: 280px; max-width: 100%; box-sizing: border-box; }
.who-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.home-notify { width: 100%; max-width: 760px; margin: 0 auto 24px; }
/* instructor profile */
.ins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.ins-tile { border: 1px solid #e3e9f0; background: #f7f9fc; border-radius: 12px; padding: 14px 16px; }
.ins-k { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5b6b80; }
.ins-v { font-size: 1.5rem; font-weight: 700; color: var(--navy-900); margin-top: 4px; font-variant-numeric: tabular-nums; }
.ins-total { background: var(--navy-700); border-color: var(--navy-700); }
.ins-total .ins-k, .ins-total .ins-v { color: #fff; }
.ins-sim { border-style: dashed; }
.ins-h3 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-700); margin: 22px 0 10px; padding-bottom: 8px; border-bottom: 1px solid #e3e9f0; }
.ins-history { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
/* docs table: centred cells, slim edit column */
.docs-table th, .docs-table td, .docs-table th[scope="row"] { text-align: center; }
.docs-table th:nth-child(1) { width: 15%; }
.docs-table th:nth-child(2) { width: 22%; }
.docs-table th:nth-child(3) { width: 19%; }
.docs-table th:nth-child(4) { width: 22%; }
.docs-table th:nth-child(5) { width: 10%; }
.docs-table th:nth-child(6) { width: 96px; }
.docs-table .st-line, .docs-table td:nth-child(4) > div { align-items: center; }
.docs-table .file-cell { display: flex; flex-direction: column; align-items: center; }
.docs-table .file-cell a, .docs-table .file-cell .muted, .docs-table .file-cell > * { margin-left: auto; margin-right: auto; }
.docs-table .row-actions .btn { max-width: 76px; padding: 0 8px; margin-left: auto; margin-right: auto; }
.docs-table label.check { justify-content: center; }
.docs-table { min-width: 760px; }
.docs-table .file-cell { display: table-cell; flex-direction: initial; align-items: initial; }
.docs-table .file-cell > * { display: inline-flex; vertical-align: middle; }
.docs-table .file-cell a, .docs-table .file-cell .muted { margin: 0; }
.docs-table .row-actions .btn { display: inline-flex; align-items: center; margin: 0 0 8px; max-width: 72px; min-height: 36px; }
.docs-table .row-actions .btn:last-child { margin-bottom: 0; }
.docs-table th:nth-child(1) { width: 15%; } .docs-table th:nth-child(5) { width: 11%; } .docs-table th:nth-child(6) { width: 92px; }
.docs-table { min-width: 720px; }
.docs-table .file-btn { white-space: nowrap; }
.docs-table th:nth-child(2) { width: 20%; } .docs-table th:nth-child(5) { width: 120px; } .docs-table th:nth-child(6) { width: 92px; }
#instructor-rows td:nth-child(2) { white-space: nowrap; }
.docblock .doc-items > .actions { display: flex; justify-content: flex-end; padding: 12px 0 4px; margin: 0; border-top: 1px solid #e3e9f0; width: 100%; box-sizing: border-box; }

.tick-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.tick-box { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #c9d3df; border-radius: 12px; padding: 10px 14px; background: #fff; font-weight: 600; cursor: pointer; }
.tick-box input { width: 18px; height: 18px; margin: 0; }
.tick-box:has(input:checked) { border-color: var(--navy-700); background: #eef3fa; }

.completed-table td.moves p { margin: 0 0 6px; font-size: .88rem; color: #4a5a70; }
.completed-table td.row-actions { white-space: nowrap; }
.completed-table td.row-actions .btn { display: inline-flex; margin: 0 0 6px; text-decoration: none; }
body.print-cert .tabs, body.print-cert .file-tabs, body.print-cert .add-rating { display: none !important; }
.fin-table td { vertical-align: middle; }
.fin-table .fin-st { width: 90px; }
.fin-table .fin-act { width: 230px; text-align: right; white-space: nowrap; }
.fin-table .fin-act input[type=date] { width: 150px; margin-right: 8px; }
.plain-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }

.table-wrap[hidden] { display: none; }
.completed-table .name-btn { width: 210px; }
.completed-table td { vertical-align: top; }
.completed-table { table-layout: fixed; width: 100%; }
.completed-table th:nth-child(1) { width: 200px; } .completed-table th:nth-child(2) { width: 130px; } .completed-table th:nth-child(3) { width: 170px; } .completed-table th:nth-child(4) { width: 150px; } .completed-table th:nth-child(6) { width: 168px; }
.completed-table .name-btn { width: 100%; }
.completed-table td.moves p { word-break: normal; overflow-wrap: break-word; }
.completed-table td.row-actions { white-space: normal; }
.completed-table td.row-actions .btn { display: flex; justify-content: center; width: 100%; box-sizing: border-box; }
#view > .two-up { margin-bottom: 18px; }
.syl-lesson { border-top: 1px solid var(--line, #dfe5ee); padding: 14px 0; }
.syl-lesson h4 { margin: 0; font-size: 1.05rem; color: var(--navy-700); }
.syl-obj li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 4px 0; }
.syl-obj .pill { margin-left: auto; }
.rt-form-grid input[type=number], .rt-form-grid select, .rt-form-grid input[type=date] { width: 100%; min-height: 44px; font: inherit; }
.tick-row { display: grid; gap: 8px; margin: 6px 0 12px; }
.tick-row .check { display: flex; gap: 8px; align-items: flex-start; }
.syl-table td:first-child { text-align: center; width: 64px; }
.syl-table td:nth-child(n+3) { text-align: center; white-space: nowrap; }
.syl-table .syl-obj { margin: 6px 0 0; padding: 0; list-style: none; font-size: 0.92rem; color: var(--muted, #44536a); }
.syl-table .syl-obj li { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; margin: 3px 0; }
.syl-table .band-row th { text-align: left; }
.rt-form-grid label.check { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.rt-form-grid label.check input { width: 22px; min-height: 22px; flex: none; }

/* Ratings: tighter containers, even gaps, softer heading bars */
.rt-wrap > div:not(.tabs), #rating-panel > div:not(.tabs) { display: grid; gap: 14px; align-content: start; }
.rt-wrap { gap: 14px; }
.rt-wrap .tabs { margin-bottom: 0; }
.rt-wrap .panel { padding: 18px 20px; }
.rt-wrap .panel > :last-child, .rt-wrap .rt-form > :last-child { margin-bottom: 0; }
.rt-wrap .panel > h2 { margin-bottom: 2px; }
.rt-wrap .panel .hint { margin-bottom: 12px; }
.rt-head h2 { margin: 0; }
.rt-head .hint { margin: 2px 0 0 !important; }
.rt-wrap .rt-form h3.fl-sub { margin: 4px 0 8px; }
.rt-wrap .syl-table .syl-obj { margin-top: 4px; }
#rating-panel .panel + .panel { margin-top: 0; }
.band-row th, .grid-table .band-row th { background: #dde7f2; color: var(--navy-800); border-color: #c9d6e6; text-align: left; letter-spacing: .06em; }
.hours-table th.grp { background: #dde7f2; color: var(--navy-800); border-color: #c9d6e6; }
#rating-tabs { margin-bottom: 14px; }
#rating-panel .tabs + *, .rt-wrap > .tabs:first-child { margin-top: 0; }

/* Advanced file: drop-down tabs */
body.file-page .file-tabs .tab3-menu { position: relative; flex: 0 0 auto; }
body.file-page .file-tabs .tab3-menu > .tab3 { cursor: pointer; font-family: inherit; }
body.file-page .file-tabs .tab3 .caret { margin-left: 8px; font-size: .85em; line-height: 1; }
body.file-page .file-tabs .tab3[aria-current="page"] { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.tab3-menu .menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 280px; background: #fff; border: 1px solid #c5d1e0; border-radius: 12px; box-shadow: 0 12px 28px rgba(3,22,52,.28); padding: 6px; }
.tab3-menu .menu-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 8px; color: var(--navy-800); text-decoration: none; font-weight: 600; font-size: .95rem; }
.tab3-menu .menu-item:hover, .tab3-menu .menu-item:focus { background: #eef3f9; outline: none; }
.tab3-menu .menu-tag { font-size: .75rem; font-weight: 600; color: #6b7c93; background: #eef3f9; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.tab3-menu .menu-tag.done { color: #14653f; background: #e3f4ea; }
.tab3-menu .menu-all { border-top: 1px solid #e3e9f0; border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 13px; font-weight: 500; color: #4a5d78; }
.tab3-menu .menu-empty { margin: 0; padding: 10px 12px; color: #6b7c93; }
.rt-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.rt-title h2 { margin: 0; }
.panel > .tabs[aria-label="Ratings"] { box-shadow: none; border: 0; padding: 0; margin: 0 0 16px; background: transparent; }

/* No notifications: the page uses the full width */
.file-grid:has(.file-side #notify:empty) { grid-template-columns: minmax(0, 1fr); }
.file-grid:has(.file-side #notify:empty) .file-side { display: none; }
.profile-grid:has(.profile-side #notify:empty) { grid-template-columns: minmax(0, 1fr); }
.profile-grid:has(.profile-side #notify:empty) .profile-side { display: none; }

/* Advanced file: the row of rating containers under the name */
body.file-page .rating-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; margin: 0 0 10px; background: #fff; border: 1px solid #dbe3ec; border-radius: 12px; box-shadow: 0 6px 18px rgba(3,22,52,.25); }
.rating-row .rt-chip { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-height: 52px; padding: 6px 18px; border: 1.5px solid #c5d1e0; border-radius: 10px; background: #fff; color: var(--navy-800); text-decoration: none; cursor: pointer; }
.rating-row .rt-chip:hover { border-color: var(--navy-700); background: #f3f6fa; }
.rating-row .rt-chip-name { font-weight: 700; font-size: .95rem; }
.rating-row .rt-chip-sub { font-size: .75rem; color: #6b7c93; }
.rating-row .rt-chip[aria-current="true"] { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.rating-row .rt-chip[aria-current="true"] .rt-chip-sub { color: #c9d8ec; }
.rating-row .rt-add { border-style: dashed; }
.rating-row .rt-add .rt-chip-name { color: var(--accent-dark); }
.rating-row .rt-add[aria-current="true"] .rt-chip-name { color: #fff; }

/* File header: the file type sits top right; Back to students floats bottom right */
body.file-page .file-top { justify-content: space-between; }
body.file-page .file-top .file-kind, body.file-page .file-top button.file-kind { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 20px; border-radius: 10px; border: 1.5px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: #fff; font: inherit; font-weight: 700; }
body.file-page .file-top button.file-kind { cursor: pointer; background: #fff; color: var(--navy-800); border-color: #fff; }
body.file-page .file-top button.file-kind:hover { background: #eef3f9; }
body.file-page .file-top .file-kind .caret { font-size: .85em; }
.file-kind-menu { position: relative; }
.menu.menu-right { left: auto; right: 0; min-width: 300px; }
.tab3-menu .menu-item.current { background: #e8eef7; }
.back-float { position: fixed; right: 20px; bottom: 20px; z-index: 40; text-decoration: none; box-shadow: 0 8px 22px rgba(3,22,52,.4); background: var(--navy-700); border: 1.5px solid #fff; color: #fff; }
.back-float:hover { background: var(--navy-800); }
@media print { .back-float { display: none !important; } }
body.file-page main { padding-bottom: 90px; }
.ds-sigs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.ds-sigs .ds-sig { margin-top: 0; }
.ds-sigs .sig-img { max-width: 100%; }
@media (max-width: 480px) { .ds-sigs { grid-template-columns: 1fr; } }
.syl-sub{margin:4px 0 2px 18px;padding-left:16px;list-style:decimal;font-weight:400}
.syl-obj .syl-sub{list-style:disc!important;padding-left:22px;margin:4px 0}.syl-obj .syl-sub li{display:list-item!important;padding:1px 0;border:0}

/* Admin syllabus: hours required table */
.hours-req th[scope=row] { text-align: left; font-weight: 600; width: 38%; }
.hours-req td.num { font-weight: 700; font-size: 1.05rem; white-space: nowrap; width: 18%; }
.hours-req tfoot th, .hours-req tfoot td { background: #eef3f9; border-top: 2px solid #14365f; }

/* Tutorial */
.tut-steps { list-style: none; counter-reset: t; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.tut-steps li { counter-increment: t; position: relative; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 16px 16px 16px 64px; }
.tut-steps li::before { content: counter(t); position: absolute; left: 16px; top: 16px; width: 32px; height: 32px; border-radius: 50%; background: var(--navy-700); color: #fff; font-weight: 700; display: grid; place-items: center; }
.tut-steps h3 { margin: 0 0 4px; font-size: 1.02rem; color: var(--navy-800); }
.tut-steps p { margin: 0 0 12px; color: var(--ink-soft); }
.tut-steps li > :last-child { margin-bottom: 0; }
.tut-steps a.btn { text-decoration: none; }
.sheet-progress-box { margin-bottom: 16px; }
.sheet-progress-box p { margin: 0 0 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet-progress-box .bar { height: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.sheet-progress-box .bar span { display: block; height: 100%; width: 0; background: var(--navy-700); transition: width .3s; }
.admin-head[hidden] { display: none; }
/* Admin overview containers */
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.overview-lists { display: grid; gap: 12px; margin-bottom: 16px; }
details.ov-block { border-radius: 12px; overflow: hidden; border: 1px solid #b9c4d1; background: #fff; }
details.ov-block > summary { padding-left: 14px; padding-right: 90px; justify-content: flex-start; }
details.ov-block > summary .doc-title { text-align: left; }
details.ov-block > summary::before { content: "\25B8"; font-size: 1rem; transition: transform .15s; }
details.ov-block[open] > summary::before { transform: rotate(90deg); }
.ov-body { padding: 14px; }
.ov-body .hint { margin-bottom: 10px; }
.ov-table td.center, .ov-table th.center { text-align: center; }
.ov-body .empty { margin: 10px 0 0; }
@media (max-width: 640px) { details.ov-block > summary { padding-right: 14px; } }
.head-actions .btn-ghost { background: #fff; color: var(--navy-800); border-color: #fff; text-decoration: none; }
.sub-line { font-size: .8rem; font-weight: 400; color: var(--ink-soft); }
.doc-need .sub-line { color: var(--danger); }
.ov-table td { white-space: nowrap; }
.ov-table td:nth-child(5), .ov-table td:nth-child(8) { white-space: normal; }
.ov-table td:nth-child(5), .ov-table td:nth-child(8) { white-space: nowrap; }
.ov-table .name-btn { width: auto; min-width: 0; display: inline-flex; padding: 8px 14px; gap: 10px; }
.ov-table th, .ov-table td { padding: 8px 7px; }
.ov-table td:nth-child(8) { white-space: normal; min-width: 92px; }
.ov-table th { font-size: .72rem; letter-spacing: .04em; }

.ov-switch { margin: 16px 0; }
.ov-switch .tab[aria-pressed="true"] { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.ov-count { display: inline-block; min-width: 1.4em; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: rgba(20,54,95,.12); font-size: .85em; text-align: center; }
.ov-switch .tab[aria-pressed="true"] .ov-count { background: rgba(255,255,255,.25); }
.ov-pane[hidden] { display: none; }

.tabs.tabs-many { gap: 4px; padding: 6px; }
.tabs.tabs-many .tab { padding: 0 6px; font-size: .8rem; }
.grid-table td input[type="date"] { width: 9.5rem; }

/* Guided tour */
.tour-layer { position: fixed; inset: 0; z-index: 10000; pointer-events: none; }
.tour-layer.tour-dim { background: rgba(3, 22, 52, .62); pointer-events: auto; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(3, 22, 52, .62), 0 0 0 3px #fff; transition: all .2s ease; pointer-events: none; }
.tour-card { position: fixed; width: min(380px, calc(100vw - 24px)); box-sizing: border-box; background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 14px 40px rgba(3, 22, 52, .45); pointer-events: auto; color: #14365f; }
.tour-card .tour-count { margin: 0 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5b6b80; }
.tour-card .tour-title { margin: 0 0 8px; font-size: 1.1rem; }
.tour-card .tour-text { margin: 0 0 14px; line-height: 1.5; color: #2a3a4f; }
.tour-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.tour-actions .btn:first-child { margin-right: auto; }
.tour-welcome { width: min(460px, calc(100vw - 24px)); }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

.rec-modes.syl-modes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.rec-modes.syl-modes .btn { flex: 0 0 calc((100% - 40px) / 5); justify-content: center; text-align: center; }
@media (max-width: 900px) { .rec-modes.syl-modes .btn { flex-basis: calc((100% - 10px) / 2); } }

.home-btn.home-profile { grid-column: 1 / -1; justify-self: center; width: calc(50% - 10px); box-sizing: border-box; }
@media (max-width: 600px) { .home-btn.home-profile { width: 100%; } }

.fl-row.r1 { grid-template-columns: minmax(0, 1fr); }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin: 6px 0; border: 1px solid var(--line, #d8dee9); border-radius: 12px; background: #fff; cursor: pointer; }
.check-row input { margin-top: 4px; flex: 0 0 auto; }
.check-row span { display: flex; flex-direction: column; gap: 2px; }
.check-row small { display: block; }
.fl .lbl { display: block; font-weight: 600; margin-bottom: 4px; }
.check-row input[type="checkbox"] { width: 22px; min-width: 22px; height: 22px; min-height: 0; padding: 0; flex: none; accent-color: var(--accent); }
.check-row strong { font-weight: 600; }
.ov-btn[hidden] { display: none; }
.fl label.check-row { display: flex; font-weight: 400; margin-bottom: 6px; }
.check-row small.fld-hint { font-weight: 400; }
td .btn.small { white-space: nowrap; }

.gate-card { border: 1px solid var(--line, #d8dee9); border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: #fff; }
.gate-card h4 { margin: 0 0 4px; }
.sig-pair .sig-pad, .debrief-page .sig-img { max-width: 100%; }
.debrief-page .sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media print { .topbar, .tabs, .sheet-actions, #notify { display: none !important; } }
.pick-list{max-height:min(26rem,60vh)}
.pick-item.locked{opacity:.55;cursor:not-allowed;background:#f6f7f9}
.pick-item.locked:hover,.pick-item.locked:focus{background:#f6f7f9}
.pick-lock{display:block;margin-top:2px;color:#8a4b00;font-size:.78rem}

/* signing blocks: top row matches so the pads line up */
.sig-top { display: grid; gap: 10px; grid-template-columns: 1fr; align-items: end; }
.sig-top.three { grid-template-columns: 1fr 1fr 1fr; }
.sig-top .field, .sig-top .fl { margin: 0; min-width: 0; }
.sig-top input { width: 100%; min-width: 0; }
.sig-top .field-error { margin: 0; }
@media (max-width: 520px) { .sig-top.three { grid-template-columns: 1fr; } }

.checks-one .chk-sub { padding: 14px 0; border-top: 1px solid var(--line); }
.checks-one .chk-sub:first-of-type { border-top: 0; padding-top: 0; }
.checks-one .chk-sub h3 { margin: 0 0 6px; color: var(--navy-700); font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; }
.checks-one .chk-sub .hint { margin: 0 0 8px; }
.checks-one .chk-sub .pill { white-space: nowrap; }

.sig-top input[readonly] { background: #f3f5f8; color: var(--navy-700); cursor: default; }

/* exam picker and exam table */
.pick-student { max-width: 520px; width: calc(100% - 32px); }
.pick-student input { width: 100%; margin: 4px 0 10px; }
.ps-list { max-height: 320px; overflow: auto; display: grid; gap: 6px; margin-bottom: 12px; }
.ps-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 14px; font: inherit; cursor: pointer; color: var(--navy-700); }
.ps-item:hover, .ps-item:focus-visible { border-color: var(--navy-700); background: #f3f5f8; }
.exam-table select { min-width: 150px; }
.exam-table td.file-cell { min-width: 150px; }
.exam-table td:nth-child(2) { min-width: 200px; }
.exam-table td select { width: 100%; min-width: 0; }
.exam-table td:nth-child(3) { white-space: nowrap; }
.exam-table { table-layout: auto; }
.exam-table td:nth-child(2) { width: 210px; }
.exam-table td select { width: 100%; min-width: 180px; }
.pick-student input[type=search] { font: inherit; font-size: 1rem; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; box-sizing: border-box; }

/* Backup and archive panel, account actions */
.bk-block { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.bk-block:first-of-type { border-top: 0; padding-top: 4px; }
.bk-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.bk-row select, .bk-row input[type=text] { font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 0; max-width: 100%; }
.bk-row input[type=file] { max-width: 100%; }
.acct-actions { white-space: nowrap; }
.acct-actions .btn + .btn { margin-left: 6px; }
@media (max-width: 700px) { .acct-actions { white-space: normal; } }
.bk-row select { flex: 1 1 220px; }
