/* The Keltes console in the look of keltes.com (register D-252, D-255, D-435).
   The website's design as brand/website/src/styles/global.css sets it since
   theme A (D-425): the green #197a56 with its brighter #29ba74, beige #f5f4f1,
   white surfaces with a soft neutral shadow, neutral greys for text and lines,
   corners of 8 and 12 px, sentence case throughout, no capitals for labels.
   Libre Baskerville for headings and the law's own words, Inter for the rest:
   the website's own font files, which the console serves from
   brand/website/public/fonts, so the page asks no other host (both under the
   SIL Open Font License). The word mark is the fixed logo file. Made for a
   laptop screen, and it fits a phone's without sideways scrolling. One
   stylesheet for every screen (register D-262): the New client and Run,
   Deliver and Demo screens keep no file of their own. */
@font-face { font-family: "Libre Baskerville"; src: url("/fonts/libre-baskerville.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("/fonts/libre-baskerville-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --green: #197a56;
  --green-bright: #29ba74;
  --green-50: #eef7f1;
  --bg: #f5f4f1;
  --surface: #ffffff;
  --ink: #222222;
  --ink-2: #4d4d4d;
  --muted: #5e5e5e;
  --red: #b42318;   /* only for a figure BELOW THE BAR on the Quality screen, always beside the words (D-253) */
  --line: #dedede;
  --rest: #e9e9e9;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.05), 0 18px 44px rgba(0, 0, 0, 0.09);
  --serif: "Libre Baskerville", "Baskerville", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
/* What a script hides stays hidden, whatever the element's own display. */
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
/* A date field is reached by Tab in parts, which :focus-visible misses. */
input[type="date"]:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--green); color: var(--surface); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); margin: 0; text-wrap: balance; }
p { margin: 0; }

.shell { width: min(1040px, 100% - 64px); margin-inline: auto; }
@media (max-width: 640px) { .shell { width: calc(100% - 32px); } }

/* ------------------------------------------------------------ header */
/* The logo, the six screens and Sign out (D-257). On a narrow screen the
   screens take a row of their own (D-262). */
.site-header { background: var(--bg); }
.site-header .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 2rem; min-height: 76px; padding-block: 0.75rem; }
.home { display: block; margin-right: auto; }
.logo { display: block; width: 6.25rem; height: auto; }
.screens { display: flex; flex-wrap: wrap; gap: 0 1.75rem; font-size: 0.95rem; }
a.screen { color: var(--ink-2); padding: 0.4rem 0 0.6rem; text-decoration: none; border-bottom: 2px solid transparent; }
a.screen:hover { color: var(--ink); }
a.screen[aria-current="page"] { color: var(--green); border-bottom-color: var(--green-bright); }
/* Sign out, in place of the line "On this Mac only", which configuration
   can now make untrue (register D-257). */
button.signout {
  font-size: 0.875rem; font-weight: 550; letter-spacing: 0; white-space: nowrap;
  padding: 0.55rem 0.85rem; border-radius: 8px; background: transparent; color: var(--ink-2); border-color: #c4c4c4;
}
button.signout:hover:not(:disabled) { color: var(--green); border-color: var(--green); box-shadow: none; transform: none; }
.signin { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; max-width: 46rem; }
.signin p { flex: 1 1 18rem; }
@media (max-width: 860px) {
  .screens { order: 3; width: 100%; gap: 0 1rem; }
}
/* Two even rows of three on a phone, not one link alone on the second. */
@media (max-width: 520px) {
  .screens { display: grid; grid-template-columns: repeat(3, max-content); }
}

main { padding: clamp(2rem, 5vw, 3.5rem) 0 5rem; }
.page-head { max-width: 46rem; margin-bottom: 2rem; }
h1 { font-size: clamp(2.2rem, 1.6rem + 1.8vw, 3rem); line-height: 1.08; letter-spacing: -0.018em; }
.lead { margin-top: 1rem; font-size: 1.15rem; line-height: 1.55; color: var(--ink-2); }

/* ------------------------------------------------------------- forms */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.4rem, 3vw, 2rem); }
.open label { display: block; font-weight: 600; margin-bottom: 0.6rem; }
.open-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.open-row input { flex: 1 1 14rem; min-width: 0; }
input[type="text"], input[type="email"], input[type="url"], input[type="date"], select, textarea {
  font: inherit; font-size: 0.98rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 0.95rem;
}
.open-row input { background: var(--bg); border-color: transparent; }
input[type="date"] { padding: 0.45rem 0.8rem; }
textarea { width: 100%; resize: vertical; line-height: 1.55; }

button {
  display: inline-flex; align-items: center; justify-content: center; font: 500 0.95rem/1 var(--sans);
  cursor: pointer; border-radius: 8px; padding: 0.8rem 1.4rem; border: 1px solid var(--green);
  background: var(--green); color: var(--surface); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
button:hover:not(:disabled) { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
button:disabled { cursor: default; background: var(--rest); border-color: var(--rest); color: var(--muted); }
button.choice { background: var(--surface); color: var(--green); border-color: var(--line); padding: 0.6rem 1.15rem; }
button.choice[aria-pressed="true"] { background: var(--green); color: var(--surface); border-color: var(--green); }
button.undo, button.undo:hover:not(:disabled) {
  background: none; border: none; color: var(--green); text-decoration: underline; text-underline-offset: 0.18em;
  padding: 0 0.3rem; box-shadow: none; transform: none; font-size: inherit;
}
button.apply { margin-right: 0.5rem; }

.hint { color: var(--muted); font-size: 0.9rem; margin-top: 0.6rem; }
#message { min-height: 1.5em; margin: 1.25rem 0; }
#message:empty { margin: 0.5rem 0; }
#message[data-kind="problem"] {
  position: relative; background: var(--surface); color: var(--ink); font-weight: 600;
  padding: 1rem 1.4rem 1rem 1.9rem; border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
#message[data-kind="problem"]::before {
  content: ""; position: absolute; left: 0.85rem; top: 0.95rem; bottom: 0.95rem; width: 3px; border-radius: 3px; background: var(--green);
}

/* The website's figure of how Keltes works, shown until a review is open. */
.flow { margin: 2.5rem 0 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.75rem, 4vw, 2.75rem); }
/* Once a review is open the figure goes and the heading stays, without
   its line, so that the cards' h2 stand under the page's h1. */
main:has(#review:not([hidden])) .flow, main:has(#review:not([hidden])) .page-head .lead { display: none; }
main:has(#review:not([hidden])) .page-head { margin-bottom: 1.25rem; }
main:has(#review:not([hidden])) h1 { font-size: 2rem; }
main:has(#review:not([hidden])) .open { padding: 1rem 1.4rem; }
main:has(#review:not([hidden])) .open .hint { display: none; }
.flow ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 4rem; }
.flow li { position: relative; flex: 1 1 0; min-width: 0; }
.flow .icon { width: 60px; height: 60px; }
.flow p { margin-top: 1rem; font-size: 0.98rem; line-height: 1.5; color: var(--ink-2); }
.flow .arrow { position: absolute; top: 22px; right: -3.1rem; width: 2.1rem; height: 1rem; }
.flow .paper, .flow .draft { fill: var(--surface); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.flow .draft { stroke-dasharray: 4 3; }
.flow .ink, .flow .tick, .flow .arrow path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.flow .ink { stroke: var(--ink); stroke-width: 2; }
.flow .tick { stroke: var(--surface); stroke-width: 2.5; }
.flow .seal { fill: var(--green); }
.flow .arrow path { stroke: var(--green); stroke-width: 2; }
@media (max-width: 760px) {
  .flow ol { flex-direction: column; gap: 1.75rem; }
  .flow .arrow { display: none; }
}

/* ------------------------------------------------------------ review */
/* The stamp: the website's notice, white with a short green rule. */
.stamp {
  position: relative; background: var(--surface); color: var(--ink); font-weight: 600;
  padding: 1.05rem 1.4rem 1.05rem 1.9rem; border-radius: var(--radius-sm); box-shadow: var(--shadow); margin: 0 0 1rem;
}
.stamp::before { content: ""; position: absolute; left: 0.85rem; top: 1rem; bottom: 1rem; width: 3px; border-radius: 3px; background: var(--green); }
.panel .stamp { background: var(--bg); box-shadow: none; }
#stamps:not(:empty) { margin-bottom: 1rem; }
.meta { color: var(--muted); font-size: 0.92rem; margin: 0 0 1rem; overflow-wrap: anywhere; }

.toolbar {
  position: sticky; top: 0.75rem; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem;
  background: var(--surface); padding: 0.7rem 0.75rem 0.7rem 1.4rem; border-radius: 12px; box-shadow: var(--shadow-lift);
  font-size: 0.95rem;
}
@media (max-width: 760px) { .toolbar { border-radius: var(--radius-sm); } .meter { margin-left: 0; } }
.meter { margin-left: auto; display: flex; align-items: center; gap: 0.85rem; }
.counter { font-family: var(--serif); font-size: 1rem; white-space: nowrap; }
.track { display: block; width: 9rem; height: 6px; border-radius: 999px; background: var(--rest); overflow: hidden; }
#bar { display: block; height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width 0.3s ease; }
.toolbar button { padding: 0.7rem 1.3rem; }
.check { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink-2); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--green); width: 1.05rem; height: 1.05rem; }
.signed { margin: 0.9rem 0 0 1.4rem; color: var(--muted); font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.signed input[type="date"] { font-size: 0.9rem; padding: 0.3rem 0.6rem; border-radius: 8px; }

.problems { color: var(--ink-2); padding-left: 1.25rem; font-size: 0.95rem; }
.problems:empty { display: none; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.5rem, 3vw, 2rem); margin: 1.25rem 0; }
.card.done { padding-block: 1rem; box-shadow: none; background: rgba(255, 255, 255, 0.6); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; }
.card-head h2 { font-size: 1.35rem; line-height: 1.25; }
.card.done .card-head h2 { font-size: 1.1rem; }
.tag {
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0;
  padding: 0.2rem 0.65rem; border-radius: 6px; background: var(--bg); color: var(--ink-2);
}
.tag.gap { background: var(--green); color: var(--surface); }
.outcome { color: var(--green); font-size: 0.92rem; font-weight: 600; margin-left: auto; }
.statement { margin-top: 1rem; font-size: 1.02rem; line-height: 1.65; }
.passage { margin: 1rem 0 0; border-left: 3px solid var(--green); padding: 0.1rem 0 0.1rem 1rem; font-family: var(--serif); font-size: 0.96rem; line-height: 1.7; }
.passage.none { font-family: var(--sans); color: var(--muted); font-size: 0.95rem; border-left-color: var(--line); }
.where { display: block; margin-top: 0.35rem; font-family: var(--sans); font-size: 0.82rem; color: var(--muted); }
.more { margin-top: 1rem; }
.more > summary { cursor: pointer; color: var(--green); font-size: 0.92rem; list-style: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; border-radius: 50%; border: 1px solid var(--line); font-size: 0.85rem; line-height: 1; }
.more[open] > summary::before { content: "\2212"; }
.more[open] { background: var(--bg); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; }
.line { margin: 0.6rem 0 0; }
.label { display: block; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-bottom: 0.15rem; }
.law { font-family: var(--serif); font-size: 0.95rem; line-height: 1.7; }
.law .label { font-family: var(--sans); }
.reason, .note { color: var(--ink-2); font-size: 0.92rem; }

.decide { border-top: 1px solid var(--line); margin-top: 1.4rem; padding-top: 1.2rem; }
.decide h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--ink); margin: 0 0 0.6rem; }
.choices { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.6rem; }
.change { margin: 0.5rem 0; }
.state { margin: 0.75rem 0 0; color: var(--ink-2); font-size: 0.95rem; }
.state.pending { color: var(--green); font-weight: 600; }
.edit { margin-top: 1rem; padding: 1.1rem 1.25rem; background: var(--bg); border-radius: var(--radius-sm); }
.edit label { display: block; margin-bottom: 0.75rem; }
.edit select { margin-left: 0.5rem; }
.substance { border: none; padding: 0; margin: 0 0 1rem; }
.substance legend { padding: 0; margin-bottom: 0.4rem; }
.radio { display: inline-flex; align-items: center; gap: 0.4rem; margin-right: 1.25rem; }
.empty { color: var(--muted); text-align: center; padding: 2rem 0; }

/* ----------------------------------------------------------- clients */
/* One row per client, the five steps of its job (D-253). */
.table-panel { padding: 0.5rem 0.25rem; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line); }
tr:last-child > th, tr:last-child > td { border-bottom: 0; }
thead th { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
a { color: var(--green); text-underline-offset: 0.18em; }
.words { display: block; }
.detail { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.client { min-width: 10em; }
.client .words { font-family: var(--serif); font-size: 1.05rem; }
.step.not_recorded .words { white-space: nowrap; }
.step.done .words { color: var(--green); font-weight: 600; }
.step.waiting .words, .step.not_recorded .words { color: var(--muted); }
.step.problem { box-shadow: inset 3px 0 0 var(--ink); }
.step.problem .words { font-weight: 700; }
#clients + .hint, #not-recorded { margin-top: 1rem; }

/* ----------------------------------------------------------- quality */
/* Red where below the bar, green where it is met (D-253). */
.about { color: var(--ink-2); font-size: 0.95rem; }
.about p { margin: 0 0 0.4rem; }
.verdict-line { font-family: var(--serif); font-size: 1.2rem; margin: 1.5rem 0; }
.verdict-line.below { color: var(--red); }
.verdict-line.meets { color: var(--green); }
.deliverable { margin-top: 2rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.5rem, 3vw, 2rem); }
.deliverable h2 { font-size: 1.45rem; margin: 0; }
.gold { margin: 1.25rem 0 0; overflow-x: auto; }
.gold h3 { font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; color: var(--muted); margin: 0 0 0.4rem; }
.figures th[scope="row"] { font-weight: 400; }
.figure.below .words, .figure.below .value { color: var(--red); font-weight: 700; }
.figure.below th[scope="row"] { box-shadow: inset 3px 0 0 var(--red); }
.figure.meets .words, .figure.meets .value { color: var(--green); font-weight: 600; }
.figure.no_data .words, .figure.cannot_judge .words { color: var(--muted); }

/* ------------------------------------------------- shared by the screens */
/* A label above its field, a row of buttons, a list of what the review
   says, the notice with a short green rule and the warning with a dark one:
   one rule each for every screen (D-262). */
.panel + .panel, #result .panel + .panel { margin-top: 1.25rem; }
.panel h2 { font-size: 1.45rem; margin: 0 0 0.75rem; }
.panel h3 { font-size: 1.1rem; margin: 1.5rem 0 0.6rem; }
.panel > label, .field > label, .field-name { display: block; font-weight: 600; margin: 0 0 0.45rem; }
select { max-width: 100%; }
.panel select { min-width: min(18rem, 100%); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
section.panel > .actions { margin: 0.9rem 0; }
.summary { padding-left: 1.25rem; margin: 1rem 0 0; }
.summary:empty { display: none; }
a.button {
  display: inline-flex; align-items: center; text-decoration: none; font: 500 0.95rem/1 var(--sans);
  border-radius: 8px; padding: 0.8rem 1.4rem; border: 1px solid var(--green); background: var(--green); color: var(--surface);
}
.files a.button { color: var(--surface); margin-top: 0.5rem; }
button.secondary { background: var(--surface); color: var(--green); border-color: var(--line); }
.notice, .warning {
  position: relative; margin-top: 1.25rem; padding: 0.8rem 1rem 0.8rem 1.4rem; border-radius: var(--radius-sm);
  background: var(--bg); font-size: 0.95rem;
}
.notice { color: var(--ink-2); }
.warning { margin: 0.5rem 0 0.75rem; color: var(--ink); font-weight: 600; font-size: inherit; }
.notice::before, .warning::before {
  content: ""; position: absolute; left: 0.6rem; top: 0.8rem; bottom: 0.8rem; width: 3px; border-radius: 3px; background: var(--green);
}
.warning::before { background: var(--ink); }
.ticks { border: none; padding: 2.4rem 1.25rem 1rem; position: relative; margin: 0; background: var(--bg); border-radius: var(--radius-sm); }
.ticks legend { position: absolute; top: 1rem; left: 1.25rem; padding: 0; font-weight: 600; }
.ticks .check { display: flex; align-items: flex-start; margin: 0.45rem 0; color: var(--ink); }
.ticks .check input { margin-top: 0.3rem; flex: none; }
.explanation { white-space: pre-wrap; margin: 0.5rem 0; font-size: 0.93rem; color: var(--ink-2); }
.explanation:empty { display: none; }
/* New client's preflight verdict only: the Quality screen's verdict cells
   keep their own weights (D-262 amended). */
p.verdict { font-weight: 600; margin: 0 0 0.5rem; }
p.verdict[data-cleared="true"] { color: var(--green); }

/* ------------------------------------------------- new client and run */
/* The form, preflight and the review's progress (D-254). */
.run-form { display: grid; gap: 1.25rem; }
.run-form > * { min-width: 0; }
.field input[type="text"] { width: 100%; max-width: 30rem; }
.field .hint { margin-top: 0.35rem; }
.drop {
  position: relative; border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 1.4rem; background: var(--bg);
  color: var(--ink-2); text-align: center;
}
.drop[data-over="true"] { border-color: var(--green); }
.drop:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pick { color: var(--green); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.run-state { font-weight: 600; margin-top: 0.5rem; }
.run-state[data-state="finished"] { color: var(--green); }
.progress { padding-left: 1.25rem; }
#next { margin-top: 1rem; }
.preflight-record { margin-top: 1rem; color: var(--ink-2); }
.preflight-record > summary { cursor: pointer; color: var(--green); font-size: 0.92rem; }

/* ------------------------------------------------------------ deliver */
/* The replay, the checks and the record (D-260). A check that does not
   pass is marked by its words and a plain dark rule, never by colour
   alone. */
.choose-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 0.5rem; }
.choose-row select { min-width: min(20rem, 100%); }
.choose .hint + .hint { margin-top: 0.2rem; }
#message + #result { margin-top: 1.25rem; }
.screen-checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.screen-check { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.1rem 1rem; padding: 0.7rem 1rem; border-radius: var(--radius-sm); background: var(--bg); border-left: 3px solid var(--green); }
.screen-check.failed { border-left-color: var(--ink); }
.screen-check .mark { font-size: 0.75rem; font-weight: 600; letter-spacing: 0; color: var(--green); padding-top: 0.2rem; }
.screen-check.failed .mark { color: var(--ink); }
.screen-check .words { color: var(--ink); }
.screen-check .detail { grid-column: 2; color: var(--ink-2); font-size: 0.92rem; overflow-wrap: anywhere; }
.paragraphs { padding-left: 1.4rem; margin: 0; display: grid; gap: 0.8rem; }
.paragraphs:empty { display: none; }
.paragraphs .quoted { display: block; font-family: var(--serif); font-size: 0.95rem; color: var(--ink-2); }
.send, .never-send { padding-left: 1.25rem; margin: 0.5rem 0 0; }
.send li + li { margin-top: 0.6rem; }
.send .path { display: block; overflow-wrap: anywhere; font-weight: 500; }
.send .digest { display: block; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.82rem; color: var(--ink-2); overflow-wrap: anywhere; }
#result .signed { margin: 1rem 0; }
.delivered { margin-top: 0.75rem; font-weight: 600; }
.delivered[data-state="recorded"] { color: var(--green); }
.delivered[data-state="not_recorded"] { font-weight: 400; color: var(--muted); }

/* --------------------------------------------------------------- demo */
/* The demonstration, stamped at the top of the page (D-261). */
main > .stamp { margin-bottom: 2rem; }
.command { margin: 0.75rem 0 0; padding: 0.9rem 1rem; border-radius: var(--radius-sm); background: var(--bg); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.82rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.files { padding-left: 1.25rem; margin: 0.5rem 0 0; }
.files:empty { display: none; }
.files li + li { margin-top: 0.5rem; }
.files a { font-weight: 600; color: var(--green); }
.files .path { display: block; color: var(--ink-2); font-size: 0.88rem; overflow-wrap: anywhere; }

/* ------------------------------------------- sign-in, portal, workspace */
/* The two factors, the client's portal and the operator's Workspace
   screen (D-263). */
.signin-code, #step-ask { max-width: 46rem; }
.signin-code > p, #enrol > p { margin: 0 0 0.75rem; }
.key { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.2rem; letter-spacing: 0.06em;
  background: var(--bg); border-radius: var(--radius-sm); padding: 0.8rem 1rem; overflow-wrap: anywhere; }
#enrol { margin-bottom: 1.5rem; }
.code-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.9rem 1rem; margin-top: 0.5rem; }
.code-form .field { flex: 1 1 16rem; min-width: 0; }
.code-form input { width: 100%; max-width: 22rem; }
#code { font-size: 1.2rem; letter-spacing: 0.2em; max-width: 12rem; }
.entity + .entity { margin-top: 1.25rem; }
.entity h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.upload { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.9rem 1rem; margin: 0.5rem 0 0.5rem; }
.upload .field { flex: 1 1 18rem; min-width: 0; }
.upload input[type="file"] { font: inherit; font-size: 0.95rem; max-width: 100%; }
.job { display: block; font-weight: 600; color: var(--ink-2); }
.job.finished { color: var(--green); }
.outbox { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.9rem; }
.outbox li.expired .words { color: var(--muted); }
.outbox .command { margin-top: 0.4rem; }

/* The queue of jobs on the Workspace screen and the client's phases (D-264). */
.job.on_hold { color: var(--ink); }
.job-state { font-weight: 600; }
.job-state.published { color: var(--green); }
td .reason { margin: 0.35rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.publish { display: grid; gap: 0.75rem; min-width: min(22rem, 100%); }
.publish .files { margin: 0; }
.publish .digest { display: block; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.78rem; color: var(--ink-2); overflow-wrap: anywhere; }
.files .digest { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.82rem; color: var(--ink-2); overflow-wrap: anywhere; }
.remediation, .published-files, .continuous { overflow-wrap: anywhere; }
.entity-ticks { display: grid; gap: 0.4rem; justify-items: start; }
.entity-profile { display: grid; gap: 0.4rem; justify-items: start; margin-top: 0.6rem; }
.entity-profile .field > label { font-weight: 500; font-size: 0.88rem; margin-bottom: 0.2rem; }
.entity-profile select { min-width: 0; max-width: 100%; }
/* Messages, invoices and the outbox's notifications
   (D-265): a message is text with its line breaks, never markup; Keltes's
   messages carry the green rule of a notice, the client's the neutral one. */
.thread { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.7rem; }
.thread li { border-left: 3px solid var(--line); padding: 0.2rem 0 0.2rem 0.9rem; }
.thread li.from-keltes { border-left-color: var(--green); }
.thread .words { font-weight: 600; margin-right: 0.6rem; }
.thread .body { margin-top: 0.25rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.write { display: grid; gap: 0.6rem; justify-items: start; margin-top: 0.9rem; }
.write .field { width: 100%; }
.conversation + .conversation { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rest); }
.conversation h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.invoice { display: block; font-weight: 600; color: var(--ink-2); }
.invoice.paid { color: var(--green); }
.outbox li.notice .words { overflow-wrap: anywhere; }
.outbox li.notice .detail { display: block; }
.outbox li.notice.sent .words { color: var(--ink-2); }
.outbox li.notice .reason { margin: 0.35rem 0; }
/* Liquid glass, here and there, as on keltes.com (D-442): the header and the sticky toolbar of Decide
   float over the page as frosted glass with a light along their top edge; panels and cards stay white,
   so what is read stays on paper. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header { position: sticky; top: 0; z-index: 5; background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(245, 244, 241, 0.4)); -webkit-backdrop-filter: blur(24px) saturate(1.8) brightness(1.05); backdrop-filter: blur(24px) saturate(1.8) brightness(1.05); border-bottom: 1px solid rgba(255, 255, 255, 0.6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 0 rgba(25, 122, 86, 0.08), 0 12px 30px -20px rgba(12, 43, 21, 0.28); }
  .toolbar { top: 5.5rem; background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.64)); -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 18px 40px -22px rgba(12, 43, 21, 0.35); }
}

/* ------------------------------------------------------------ sign in (D-471) */
/* One card on the beige desk, as a form stands on keltes.com: white paper,
   the green rule along its top, the serif heading, one action at a time. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.auth-page main.auth { display: grid; justify-items: center; padding-block: clamp(2rem, 9vh, 5.5rem) 4rem; }
.auth-card { width: min(28rem, 100%); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border-top: 3px solid var(--green); padding: clamp(1.75rem, 5vw, 2.5rem); }
.auth-card h1 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); margin-bottom: 0.75rem; }
.auth-lead { color: var(--ink-2); font-size: 1rem; line-height: 1.55; margin-bottom: 1.5rem; }
.auth-form { display: grid; gap: 0.55rem; }
.auth-form + .auth-form { margin-top: 1.25rem; }
.auth-form label { font-size: 0.9rem; font-weight: 550; color: var(--ink); }
.auth-form input { width: 100%; }
.auth-form button, .auth-wide { width: 100%; margin-top: 0.5rem; justify-content: center; }
.code-input { font-size: 1.5rem; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-foot { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.auth-foot a { color: var(--green); font-weight: 550; }
.auth-card #message:not(:empty) { margin-top: 1.25rem; font-size: 0.95rem; }
.qr { display: flex; justify-content: center; padding: 1rem; margin-bottom: 1rem; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); }
.qr svg { width: 200px; height: 200px; }
.auth-card details.more { margin-bottom: 1.25rem; font-size: 0.9rem; }
.auth-card .key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; word-break: break-all; }
.auth-card #message:empty { display: none; }
.auth-form input.code-input { width: 100%; max-width: none; }

/* ------------------------------------------------------------ keltes.com's light and hover (D-472) */
/* Buttons as on keltes.com: they rise, take a halo of light green, and a band of light crosses them
   once. A quiet choice or the sign-out keeps its own look and only lifts. */
button, a.button { position: relative; overflow: hidden; isolation: isolate;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease, background-color 0.3s ease, color 0.2s ease, border-color 0.2s ease; }
button:not(.choice):not(.signout):hover:not(:disabled), a.button:hover { transform: translateY(-2px);
  box-shadow: 0 12px 24px -14px rgba(32, 114, 78, 0.7), 0 0 0 5px #dcefe3; }
button:active:not(:disabled) { transform: translateY(0) scale(0.98); }
a.button { display: inline-flex; align-items: center; justify-content: center; padding: 0.6rem 1.1rem; border-radius: 8px;
  background: var(--green); color: var(--surface); font: 500 0.9rem/1 var(--sans); text-decoration: none; }
.job-actions { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
/* Fields take the site's quiet focus: a green line and a light green halo. */
input[type="text"]:focus, input[type="email"]:focus, input[type="url"]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 4px #dcefe3; }
/* The header as on keltes.com: glass over what scrolls under it. */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(245, 244, 241, 0.78);
  -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(25, 122, 86, 0.08), 0 12px 32px -20px rgba(12, 43, 21, 0.3); }
/* Keltes's light: a short glow runs along the top of each sheet, then rests; the sheets after the
   first take turns. Never under reduced motion. */
.panel, .auth-card { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  .panel::before, .auth-card::before { content: ""; position: absolute; left: 12px; right: 12px; top: -1px; height: 2px;
    border-radius: 2px; background: linear-gradient(90deg, rgba(41, 186, 116, 0), rgba(41, 186, 116, 0.85) 50%, rgba(41, 186, 116, 0)) no-repeat;
    background-size: 30% 100%; background-position: -43% 0; animation: k-light 7s cubic-bezier(0.45, 0, 0.55, 1) infinite; pointer-events: none; }
  .auth-card::before { top: -3px; height: 3px; left: 0; right: 0; animation-duration: 4.5s; }
  .panel:nth-of-type(even)::before { animation-delay: 3.5s; }
  /* A sheet arrives once, as the site's do. */
  .panel, .auth-card { animation: k-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
}
@keyframes k-light { 0% { background-position: -43% 0; } 32% { background-position: 143% 0; } 100% { background-position: 143% 0; } }
@keyframes k-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* Back to keltes.com from every screen (D-472), the last item of the bar, quiet as the site's links. */
.to-site { font-size: 0.875rem; font-weight: 550; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.to-site::after { content: " \2197"; color: var(--green); }
.to-site:hover { color: var(--green); }
@media (max-width: 860px) { .to-site { order: 2; } }

/* ------------------------------------------------------------ controls (D-473) */
/* Every field, button and file choice in one calm hand, as keltes.com's own form: a field is a white
   well with a soft line and a green focus; a button is Keltes green, rises a pixel and takes a soft
   shadow, with no band of light; a file is chosen in a dashed drop area. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select, textarea {
  min-height: 3rem; padding: 0.75rem 1rem; font: 400 0.95rem/1.4 var(--sans); color: var(--ink); background: #fff;
  border: 1px solid #d6d6d2; border-radius: 10px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover, select:hover, textarea:hover { border-color: #b9b9b4; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus, select:focus, textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(25, 122, 86, 0.12); }
input::placeholder, textarea::placeholder { color: #9a9a96; }
.field { display: grid; gap: 0.45rem; min-width: 0; }
.field > label, .auth-form > label { font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.field > input, .field > select, .field > textarea { width: 100%; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem 1.25rem; }
.name-form { display: grid; gap: 1.1rem; }
.name-form h2 { margin-bottom: 0.25rem; }
.name-form > button, form.upload > button { justify-self: start; }
form.upload { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
input[type="file"] { display: block; width: 100%; padding: 1.1rem 1.25rem; font: 400 0.9rem/1.4 var(--sans); color: var(--muted);
  background: #fafaf8; border: 1.5px dashed #cfcfca; border-radius: 12px; cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease; }
input[type="file"]:hover { border-color: var(--green); background: #f3f8f5; }
input[type="file"]:focus-visible { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(25, 122, 86, 0.12); }
input[type="file"]::file-selector-button { margin-right: 1rem; padding: 0.6rem 1.1rem; font: 560 0.875rem/1 var(--sans); color: var(--ink);
  background: #fff; border: 1px solid #d6d6d2; border-radius: 8px; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease; }
input[type="file"]::file-selector-button:hover { border-color: var(--green); color: var(--green); }
button:not(.choice):not(.signout), a.button { min-height: 2.875rem; padding: 0.7rem 1.35rem; border-radius: 10px;
  font: 560 0.925rem/1 var(--sans); letter-spacing: -0.005em; box-shadow: none; }
button:not(.choice):not(.signout):hover:not(:disabled), a.button:hover { background: #166c4c; border-color: #166c4c; transform: translateY(-1px);
  box-shadow: 0 10px 20px -12px rgba(25, 122, 86, 0.6); }
button.signout { border-radius: 10px; }
.auth-form input.code-input { min-height: 3.5rem; font: 500 1.6rem/1 var(--sans); letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-again { justify-self: center; margin-top: 0.4rem; font-size: 0.875rem; color: var(--muted); }
.auth-again:hover { color: var(--green); }
/* The entity's parts, each under a quiet rule, with air between a field and what precedes it. */
.panel.entity > * + * { margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.panel.entity > h2 + * { border-top: 0; padding-top: 0; margin-top: 1.25rem; }
.panel form:not(.upload):not(.name-form):not(.auth-form) > * + * { margin-top: 0.9rem; }
.panel form:not(.upload):not(.name-form) .hint + label, .panel form:not(.upload):not(.name-form) p + label { display: block; margin-top: 1.1rem; }
.panel h3 { font-family: var(--sans); font-size: 1rem; font-weight: 650; margin-bottom: 0.6rem; }
