/* The portal's layout. Every colour and font comes from brand.css: none is named here.
   Sized to be read on an external screen from across a table. Served locally, no CDN. */

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 2rem; }
main.wrap { padding-top: 2.5rem; padding-bottom: 5rem; }

a { color: var(--ink); text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: var(--radius-sm); }

/* --- Type ------------------------------------------------------------------------ */

h1, h2 { font-family: var(--font-display); font-variation-settings: "opsz" 144; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 2.6rem; font-weight: 600; line-height: 1.08; }
h2 { font-size: 1.6rem; font-weight: 600; line-height: 1.15; margin-top: 3rem; }
h2 + p, h2 + table, h2 + .table-scroll { margin-top: 1rem; }
.kicker {
  margin: 0 0 0.6rem;
  font: 400 0.72rem/1.4 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-text);
}
.small { color: var(--ink-soft); font-size: 0.8rem; }
.mono { font-family: var(--font-mono); font-size: 0.85em; }
.lede { font-size: 1.1rem; color: var(--ink-soft); margin: 0.75rem 0 0; }

/* --- The black bar: which property this is, and that the data is not real -------- */

.topbar {
  background: var(--ink);
  color: var(--on-ink);
  font: 500 0.72rem/1.4 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.topbar .wrap { display: flex; justify-content: space-between; gap: 1.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.topbar .property { color: var(--amber); white-space: nowrap; }
.topbar .notice { color: var(--on-ink-soft); text-align: right; }

/* --- Header ---------------------------------------------------------------------- */

header.site { border-bottom: 1px solid var(--rule); }
header.site .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; }
.brand img { height: 28px; width: auto; display: block; }
.brand .product {
  padding-left: 0.9rem;
  border-left: 1px solid var(--rule);
  font: 600 1.15rem/1 var(--font-display);
  letter-spacing: -0.01em;
}
header.site nav { display: flex; gap: 1.25rem; }
header.site nav a { white-space: nowrap; font-weight: 600; text-decoration: none; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
header.site nav a:hover { border-bottom-color: var(--rule); }
header.site nav a[aria-current="page"] { border-bottom-color: var(--amber); }
.who { margin-left: auto; display: flex; align-items: center; gap: 1rem; min-width: 0; }
.who .btn, .who button { white-space: nowrap; }
.who form { display: flex; align-items: center; gap: 0.75rem; margin: 0; }

/* --- Buttons and fields ---------------------------------------------------------- */

button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.35rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font: 600 0.95rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--ink-deeper); }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); padding: 0.4rem 1rem; font-size: 0.85rem; }
button.ghost:hover, .btn.ghost:hover { background: var(--ink); color: var(--on-ink); }
.btn.big { padding: 0.85rem 1.75rem; font-size: 1.05rem; }

input[type="text"], input[type="password"], input[type="date"], input[type="file"] {
  font: 500 1rem/1.3 var(--font-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
}
input:focus { border-color: var(--ink); outline: none; }
input[type="file"] { width: 100%; max-width: 34rem; padding: 0.9rem; border-style: dashed; }
input[type="file"]::file-selector-button {
  font: 600 0.85rem/1 var(--font-body);
  margin-right: 1rem;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
label { font-weight: 600; }
label input { display: block; margin-top: 0.4rem; }
.errorlist { list-style: none; margin: 0.4rem 0 0; padding: 0; color: var(--failed); font-weight: 600; }

.card { background: var(--sand-deep); border-radius: var(--radius-md); padding: 1.75rem; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

/* --- Status: unmistakable, and never colour alone -------------------------------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.85rem 0.25rem 0.7rem;
  border-radius: 999px;
  font: 700 0.8rem/1.3 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  background: var(--running);
}
.status::before { content: "…"; font-weight: 800; }
.status.done { background: var(--done); }
.status.done::before { content: "✓"; }
.status.held { background: var(--held); color: var(--ink); }
.status.held::before { content: "Ⅱ"; }
.status.failed { background: var(--failed); }
.status.failed::before { content: "✕"; }
.status.big { font-size: 1.05rem; padding: 0.4rem 1.2rem 0.4rem 1rem; }

/* --- Messages, and the panel at the top of a run --------------------------------- */

.msg {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border-left: 6px solid var(--done);
  border-radius: var(--radius-sm);
  background: var(--done-soft);
  font-weight: 500;
  white-space: pre-wrap;
}
.msg.warning { border-color: var(--held); background: var(--held-soft); }
/* A rejected file lists its columns in aligned rows, so errors are set in mono. */
.msg.error { border-color: var(--failed); background: var(--failed-soft); font: 500 0.88rem/1.6 var(--font-mono); }

.verdict {
  margin-top: 1.75rem;
  padding: 1.5rem 1.75rem;
  border-left: 10px solid var(--running);
  border-radius: var(--radius-md);
  background: var(--sand-deep);
}
.verdict.done { border-color: var(--done); background: var(--done-soft); }
.verdict.held { border-color: var(--held); background: var(--held-soft); }
.verdict.failed { border-color: var(--failed); background: var(--failed-soft); }
.verdict .line { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.verdict .why { margin: 1.1rem 0 0; font-size: 1.3rem; font-weight: 600; line-height: 1.4; }
.verdict .why + .why { margin-top: 0.6rem; }
.verdict.failed .why { font-size: 1.05rem; }
.verdict .btn { margin-top: 1.25rem; }

/* --- Tables ---------------------------------------------------------------------- */

table { border-collapse: collapse; width: 100%; background: var(--paper); border-radius: var(--radius-md); overflow: hidden; }
th, td { text-align: left; padding: 0.85rem 1.1rem; vertical-align: top; border-bottom: 1px solid var(--rule); }
tr:last-child > td, tr:last-child > th { border-bottom: 0; }
th {
  background: var(--sand-deep);
  font: 500 0.68rem/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
td.num { text-align: right; font-family: var(--font-mono); }
td .small { display: block; margin-top: 0.2rem; }
td form { display: flex; align-items: center; gap: 0.75rem; margin: 0; }
table.facts th { width: 16rem; }
table.values { max-width: 44rem; }
table.values th.num { text-align: right; width: auto; }
.name { font-weight: 700; font-size: 1.05rem; }

/* The files behind a report: made to be read aloud, one file per row. */
/* A file name is never broken in the middle: on a narrow screen the table scrolls. */
table.files .file, table.files td:first-child { font: 500 1.05rem/1.35 var(--font-mono); white-space: nowrap; }
table.files td:first-child .small { font-family: var(--font-body); white-space: normal; }
table.files .when { font-weight: 600; white-space: nowrap; }
table.files td { padding-top: 1.1rem; padding-bottom: 1.1rem; }
table.files th, table.files td { padding-left: 0.85rem; padding-right: 0.85rem; }
.table-scroll { overflow-x: auto; }

/* --- Reports page ---------------------------------------------------------------- */

.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.25rem; margin-top: 1.75rem; }
.report-grid .card h2 { margin: 0; font-size: 1.7rem; }
.report-grid .card form { display: flex; align-items: end; gap: 0.75rem; margin-top: 1.25rem; }
.report-grid .card label { font-size: 0.8rem; color: var(--ink-soft); }

/* --- Login ----------------------------------------------------------------------- */

.login { max-width: 27rem; margin: 3rem auto 0; }
.login input[type="text"], .login input[type="password"] { width: 100%; }
.login form p { margin: 1.1rem 0 0; }
.login button { margin-top: 1.5rem; }

@media (max-width: 760px) {
  html { font-size: 16px; }
  header.site .wrap { flex-wrap: wrap; gap: 0.75rem 1.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
}
