/* Apex clinic system. Workshop palette (setup/08 s9, 3 Oct 2026): orange buttons
   carry graphite text, never white; tracker colours are the shared set. */
:root {
  --orange: #EF7A1E; --orange-text: #A84A00; --graphite: #22272B; --concrete: #EDEFF0;
  --steel: #5B636A; --line: #D3D8DB; --white: #fff; --pine: #1D4A3A;
  --green: #1B6B3A; --green-bg: #E3F2E8; --amber: #6E4E00; --amber-bg: #FFF3C4;
  --red: #A3241C; --red-bg: #FBE3E0;
  --hour: 120px;              /* diary: height of one hour; twice the old 64px so a 30-minute card shows the
                                 service and its warnings, like VetOne's diary (Ellie Kendall's review, 4 Nov 2026) */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
       color: var(--graphite); background: var(--concrete); }
a { color: var(--orange-text); }
h1 { font-size: 1.35rem; margin: .2rem 0 .8rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
small, .muted { color: var(--steel); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px 48px; }

/* top bar */
.top { background: var(--graphite); color: var(--white); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 4px; padding-bottom: 0; min-height: 48px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--orange); text-decoration: none; margin-right: 12px; letter-spacing: .02em; }
.top nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.top nav a { color: #dfe3e6; text-decoration: none; padding: 12px 10px; border-bottom: 3px solid transparent; }
.top nav a.on { color: var(--white); border-bottom-color: var(--orange); }
/* the triage call from every page (Ellie Kendall's review, 4 Nov 2026) */
.top nav a.call { align-self: center; background: var(--red); color: var(--white); font-weight: 600; border-radius: 5px;
                  padding: 6px 10px; margin: 0 6px; border-bottom: 0; }
.top nav a.call.on { box-shadow: 0 0 0 2px var(--orange); }
.top .who { color: #b9c0c5; font-size: .85rem; display: flex; gap: 8px; align-items: center; }
.top .who button { background: none; border: 1px solid #555d63; color: #dfe3e6; padding: 3px 8px; border-radius: 4px; cursor: pointer; }
.testbar { background: var(--amber-bg); color: var(--amber); text-align: center; font-size: .85rem; padding: 4px; }

/* panels, tables, forms */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 12px 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--steel); font-weight: 600; }
.scroll { overflow-x: auto; }
label { display: block; font-size: .85rem; color: var(--steel); margin: 8px 0 2px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number],
input[type=password], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
textarea { min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 140px; }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; color: var(--graphite); font-size: .95rem; }
.check input { width: auto; }
.btn, button.btn { display: inline-block; background: var(--orange); color: var(--graphite); border: 0; border-radius: 6px;
       padding: 9px 14px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.plain { background: var(--white); border: 1px solid var(--line); font-weight: 500; }
.btn.small { padding: 4px 9px; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.danger { background: var(--red-bg); color: var(--red); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.inline { display: inline; }
.tight { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tight input[type=time] { width: auto; padding: 5px 6px; }
.tight input[type=text] { padding: 5px 8px; }

/* messages and badges */
.flash { padding: 10px 14px; border-radius: 6px; margin: 10px 0; background: var(--white); border-left: 4px solid var(--steel); }
.flash.error { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.flash.warn { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
.flash.ok { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .78rem; font-weight: 600;
         background: var(--concrete); color: var(--steel); white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.alert { background: var(--red-bg); color: var(--red); border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-weight: 600; }
.labels { display: flex; gap: 6px; flex-wrap: wrap; }

/* the diary */
.daynav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.daynav h1 { margin: 0 8px 0 0; }
.daynav form { display: flex; gap: 6px; }
.diary { display: grid; background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.diary .head { background: var(--white); padding: 8px 6px; font-weight: 600;
               border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-size: .9rem; min-width: 150px; }
.diary .head small { display: block; font-weight: 400; }
.diary .times { position: relative; border-right: 1px solid var(--line); width: 52px; }
.diary .times div { position: absolute; right: 6px; font-size: .75rem; color: var(--steel); transform: translateY(-50%); }
.diary .times div:first-child { transform: none; }
.diary .col { position: relative; border-left: 1px solid var(--line); min-width: 150px;
              background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line) calc(var(--hour) - 1px), var(--line) var(--hour)),
                                repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) / 2 - 1px), #eef0f2 calc(var(--hour) / 2 - 1px), #eef0f2 calc(var(--hour) / 2)); }
.diary .off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, #f1f3f4, #f1f3f4 6px, #e6e9eb 6px, #e6e9eb 12px); }
.diary .free { position: absolute; left: 0; right: 0; display: block; text-decoration: none; }
.diary .free:hover { background: rgba(239, 122, 30, .12); }
.diary .appt, .diary .block { position: absolute; left: 3px; right: 3px; border-radius: 5px; padding: 3px 6px; font-size: .8rem;
              overflow: hidden; text-decoration: none; color: var(--graphite); line-height: 1.25; }
.diary .appt { background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--steel); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.diary .appt b { display: block; }
.diary .appt.cancelled { opacity: .45; text-decoration: line-through; }
.diary .appt.dna { background: var(--red-bg); }
.diary .appt.completed { background: #f6faf7; }
.diary .appt.arrived { background: var(--amber-bg); }
.diary .appt.problem { outline: 2px dashed var(--amber); outline-offset: -2px; }
.diary .appt.alerted::after { content: "!"; position: absolute; top: 2px; right: 5px; color: var(--red); font-weight: 800; }
.diary .block { background: #e9ecee; color: var(--steel); border: 1px dashed #c6ccd0; }
/* a booked card is filled with its service's colour (day.html), so free time stands out white */
.diary .appt .when { font-weight: 400; color: var(--steel); }
/* a details whose summary is a button, not a small link (Ellie Kendall's review, 4 Nov 2026) */
details.opener { margin-top: 10px; }
details.opener > summary { list-style: none; display: inline-block; cursor: pointer; }
details.opener > summary::-webkit-details-marker { display: none; }
details.opener[open] > summary { margin-bottom: 8px; }
/* the dog's RAG as a dot (the left bar is the service), and problems in words (usability review 21 Oct 2026) */
.rag { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.rag.green { background: var(--green); } .rag.amber { background: #D9A400; } .rag.red { background: var(--red); }
.diary .appt .flags { display: block; }
.flag { font-weight: 700; margin-right: 6px; }
.flag.stop { color: var(--red); } .flag.warn { color: var(--amber); }
.diary .now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--red); z-index: 3; }
.tankbar { margin: 8px 0; }

/* slots */
.slots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.slotperson { font-weight: 600; margin: 10px 0 6px; border-left: 5px solid var(--steel); padding-left: 8px; }
.slots form button { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; cursor: pointer; font: inherit; text-align: left; }
.slots form button:hover { border-color: var(--orange); }
.slots small { display: block; }

/* a visit's next steps: done ones ticked, the one to do now marked (usability review 21 Oct 2026) */
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
ol.steps li { counter-increment: step; padding: 7px 8px 7px 34px; position: relative; border-left: 3px solid transparent;
              border-bottom: 1px solid var(--line); }
ol.steps li:last-child { border-bottom: 0; }
ol.steps li::before { content: counter(step); position: absolute; left: 6px; top: 6px; width: 20px; height: 20px;
                      border-radius: 50%; background: var(--concrete); color: var(--steel); font-size: .75rem;
                      font-weight: 700; text-align: center; line-height: 20px; }
ol.steps li.done { color: var(--steel); }
ol.steps li.done::before { content: "\2713"; background: var(--green-bg); color: var(--green); }
ol.steps li.now { border-left-color: var(--orange); background: #FFF8F1; }
ol.steps li.now > span { font-weight: 600; }
ol.steps li.now::before { background: var(--orange); color: var(--graphite); }
ol.steps li .btn { margin-left: 6px; }
details.asks { margin: 4px 0 6px; font-size: .9rem; }
details.asks summary { cursor: pointer; color: var(--orange-text); }
details.asks p { margin: 6px 0; }
table.reviews td { padding: 4px 6px; }

/* tracker */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.board .lane { border-radius: 8px; padding: 10px; }
.board .lane.red { background: var(--red-bg); } .board .lane.amber { background: var(--amber-bg); } .board .lane.green { background: var(--green-bg); }
.board .card { background: var(--white); border-radius: 6px; padding: 8px 10px; margin: 8px 0; }

.note-text { white-space: pre-wrap; font-family: inherit; background: var(--concrete); padding: 10px; border-radius: 6px; margin: 6px 0; }
.kv td:first-child { color: var(--steel); width: 38%; }

/* who does what */
.matrix td, .matrix th { text-align: center; vertical-align: middle; }
.matrix td:first-child, .matrix th:first-child { text-align: left; min-width: 150px; }
.matrix select { width: auto; min-width: 74px; padding: 6px; }
.matrix select[data-v="1"] { background: var(--green-bg); color: var(--green); font-weight: 700; border-color: var(--green); }
.matrix select[data-v="2"] { background: var(--concrete); }

/* protocols */
.draftbar { position: sticky; top: 48px; z-index: 10; background: var(--amber-bg); color: var(--amber); border: 2px solid var(--amber);
            border-radius: 6px; padding: 8px 12px; margin: 10px 0; font-weight: 700; }
.doc { line-height: 1.55; overflow-wrap: break-word; }
.doc td, .doc th { min-width: 7em; }
.doc h1 { font-size: 1.4rem; } .doc h2 { font-size: 1.2rem; border-top: 1px solid var(--line); padding-top: 14px; }
.doc table { display: block; overflow-x: auto; font-size: .9rem; margin: 10px 0; }
.doc th { text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--graphite); background: var(--concrete); }
.doc blockquote { margin: 10px 0; padding: 6px 12px; border-left: 4px solid var(--line); color: var(--steel); }
.doc code { background: var(--concrete); padding: 0 4px; border-radius: 3px; }
:target { scroll-margin-top: 110px; }

/* red flags (protocol 05) */
.triage .q { padding: 10px 0; border-bottom: 1px solid var(--line); }
.triage .q:last-child { border-bottom: 0; }
label.opt { display: flex; gap: 8px; align-items: baseline; color: var(--graphite); font-size: .95rem; margin: 6px 0 0 4px; }
label.opt input { flex: none; }

@media (max-width: 640px) {
  /* the menu wraps onto rows under the name and Log out, so every item shows (review 20 Oct, UI 8);
     not sticky here, or the rows would take a third of the screen */
  .top { position: static; }
  .top .wrap { flex-wrap: wrap; justify-content: space-between; }
  .top nav { order: 3; flex: 1 0 100%; flex-wrap: wrap; }
  .top nav a { padding: 8px 8px; white-space: nowrap; }
  .top .who > a { display: none; }
  .brand { margin-right: 6px; }
  .badge { white-space: normal; }     /* a long contraindication must not widen the page (UI 7) */
  .panel { overflow-x: auto; }        /* a table too wide for a phone scrolls in its panel, not the page */
  .diary .head, .diary .col { min-width: 132px; }
  .matrix td:first-child, .matrix th:first-child { min-width: 96px; }
  .matrix td, .matrix th { padding: 6px 3px; }
  .matrix th { font-size: .7rem; letter-spacing: 0; }
  .matrix select { min-width: 0; width: 64px; padding: 5px 2px; font-size: .85rem; }
}
/* reports to vets: the text exactly as sent; parts still to fill stand out */
.letter pre { white-space: pre-wrap; font-family: inherit; margin: 0; line-height: 1.5; }
input.todo, select.todo, textarea.todo { background: var(--amber-bg); border-color: var(--amber); }

/* Help (help.py): the staff guide. A contents column beside the how-tos; blue only for the numbered
   markers, so a number on a screenshot and the point under it read as one thing (30 Oct 2026). */
.help { --mark: #1F5FD1; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.help [hidden] { display: none !important; }
.help-toc { position: sticky; top: 60px; max-height: calc(100vh - 72px); overflow-y: auto; padding: 4px 4px 20px 0; font-size: .92rem; }
.help-toc label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--steel); }
.help-toc input { margin: 4px 0 10px; }
.help-toc ul { list-style: none; margin: 0; padding: 0; }
.help-toc > ul > li { margin-top: 10px; }
.help-toc > ul > li > a { display: block; border-left: 3px solid var(--orange); padding-left: 8px; color: var(--graphite); text-decoration: none; }
.help-toc li li a { display: block; padding: 2px 0 2px 11px; color: var(--steel); text-decoration: none; }
.help-toc li li a:hover { color: var(--orange-text); }
.help-main { min-width: 0; }
.help-main > p { max-width: 70ch; }
.help .legend .num, .help ol.callouts li::before { display: inline-block; width: 24px; height: 24px; line-height: 24px; border-radius: 50%;
  background: var(--mark); color: var(--white); font-weight: 700; font-size: .82rem; text-align: center; }
.help h2 { margin: 2rem 0 .7rem; font-size: 1.3rem; display: flex; align-items: baseline; gap: 10px; }
.help h2::before { content: ""; width: 12px; height: 12px; background: var(--orange); flex: none; }
.help .howto { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px 18px; margin: 0 0 14px; scroll-margin-top: 60px; }
.help .howto header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.help .howto h3 { margin: 0; font-size: 1.12rem; }
.help .who { display: flex; flex-wrap: wrap; gap: 5px; }
.help .chip { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.help .chip.reception { background: #E3E8EC; color: #33424E; }
.help .chip.physio { background: #DDF0F2; color: #0B5F6B; }
.help .chip.lead { background: #EEE4F5; color: #5E3B7C; }
.help .chip.director { background: #ECE6DD; color: #5A4528; }
.help .howto p, .help .howto li { max-width: 72ch; }
.help .summary { margin: 8px 0 10px; }
.help ul.do { padding-left: 20px; }
.help ul.do li::marker { color: var(--orange); }
.help figure.shot { margin: 12px 0 6px; }
.help figure.shot a { display: inline-block; max-width: 100%; line-height: 0; }
.help figure.shot img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.help ol.callouts { list-style: none; counter-reset: c; margin: 8px 0 12px; padding: 0; display: grid; gap: 6px; }
.help ol.callouts li { counter-increment: c; position: relative; padding-left: 34px; }
.help ol.callouts li::before { content: counter(c); position: absolute; left: 0; top: 0; }
.help p.cap { color: var(--steel); font-size: .92rem; }
.help .note { border-radius: 6px; padding: 9px 12px; margin: 10px 0 4px; }
.help .note b:first-child { text-transform: uppercase; font-size: .72rem; letter-spacing: .08em; margin-right: 4px; }
.help .note.tip { background: var(--green-bg); color: var(--green); }
.help .note.warn { background: var(--amber-bg); color: var(--amber); }
.help .note a { color: inherit; }
.help .start { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.help .start .howto { margin: 0 0 14px; }
.help .start ol { padding-left: 22px; margin: 8px 0 0; }
.help .start ol li { margin: 4px 0; }
.help table.roles td, .help table.roles th { vertical-align: top; }
@media (max-width: 900px) {
  .help { grid-template-columns: minmax(0, 1fr); }
  .help-toc { position: static; max-height: none; }
  .help-toc li li { display: none; }
  .help-toc.searching li li { display: block; }
  .help .start { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .top, .actions, .daynav form, .no-print { display: none !important; }
  .draftbar { position: static; }
  body { background: var(--white); }
  .panel { border: 0; }
  .letter.owner { break-before: page; }
}

/* a VetOne note read through mvo-api (vetone/entry.html): VetOne's own HTML, cleaned there */
.vetone-note { overflow-x: auto; }
.vetone-note img { max-width: 100%; height: auto; }
.vetone-note pre { white-space: pre-wrap; }
.vetone-note .noimg { color: var(--steel); font-style: italic; }

/* the owners' booking pages (online/*.html): one column, phone first */
body.owner { background: var(--concrete); }
.owner-top { background: var(--graphite); color: var(--white); }
.owner-top .narrow { padding-top: 12px; padding-bottom: 12px; }
.owner-top .brand { margin-right: 8px; }
.narrow { max-width: 680px; margin: 0 auto; padding: 0 16px 32px; }
.owner main h1 { margin-top: 1rem; }
.owner fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; padding: 12px 14px; }
.owner fieldset.panel { margin: 12px 0; }
/* floated, a legend sits inside its box instead of across the top border, so a long question lines up */
.owner legend { float: left; width: 100%; padding: 0; margin: 0 0 4px; font-weight: 600; line-height: 1.35; }
.owner legend + * { clear: both; }
.owner .check { align-items: flex-start; }
.owner .check input { margin: 4px 0 0; }   /* the button lines up with the question above it */
.owner .times { display: flex; flex-wrap: wrap; gap: 8px; }
.owner .times .btn { min-width: 76px; text-align: center; }
.owner .steps { padding-left: 1.2rem; }
.owner footer { margin-top: 24px; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
