/* First Call for recruiters. The palette, type, cards and buttons are Role Call's (sales-agents/app/static/styles.css
   and admin.css), trimmed to what these pages use, with the forms, the brief, the report and the transcript added. */

:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --surface-3: #e8e4db;
  --ink: #1d1c1a;
  --ink-2: #57544e;
  --ink-3: #807c74;
  --line: #e3dfd6;
  --line-strong: #d3cec3;
  /* The brand runs from warm yellow to coral. It is used sparingly, as in Role Call. */
  --brand-a: #ffd266;
  --brand-b: #fe5d41;
  --brand-grad: linear-gradient(120deg, var(--brand-a), var(--brand-b));
  --primary: #1d1c1a;
  --primary-hover: #36332f;
  --primary-ink: #ffffff;
  --accent: #b43e26;
  --accent-soft: #fbe9e3;
  --focus: color-mix(in srgb, #1d1c1a 45%, transparent);
  --danger: #c0412e;
  --danger-hover: #a53625;
  --ok: #2f7d4f;
  --ok-soft: #e4f1e8;
  --warn: #a8701a;
  --warn-soft: #f7ecd8;
  --info: #2f5f8a;
  --info-soft: #e5eef6;
  --shadow: 0 1px 2px rgb(28 25 20 / 6%), 0 8px 24px -12px rgb(28 25 20 / 18%);
  --shadow-lift: 0 2px 4px rgb(28 25 20 / 6%), 0 18px 40px -18px rgb(28 25 20 / 28%);
  --radius: 16px;
  --radius-sm: 10px;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "New York", ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* app.js measures the top bar and the candidate page's navigation and sets these two on the root element. */
  --topbar-h: 66px;
  --pagenav-h: 0px;
  /* The space between the cards on a page, and around the in-page navigation. */
  --gap: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111213;
    --surface: #1a1b1d;
    --surface-2: #222326;
    --surface-3: #2b2c30;
    --ink: #edebe7;
    --ink-2: #b4b0a9;
    --ink-3: #8f8b84;
    --line: #2c2d31;
    --line-strong: #3a3b40;
    --primary: #edebe7;
    --primary-hover: #ffffff;
    --primary-ink: #111213;
    --accent: #ff8a6b;
    --accent-soft: #3a221b;
    --focus: color-mix(in srgb, #edebe7 55%, transparent);
    --danger: #e0664f;
    --danger-hover: #ea7f6b;
    --ok: #5cbf86;
    --ok-soft: #1c2c23;
    --warn: #e3a94b;
    --warn-soft: #33291a;
    --info: #8db8e0;
    --info-soft: #1b2733;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px -12px rgb(0 0 0 / 60%);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 30%), 0 18px 40px -18px rgb(0 0 0 / 70%);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px;
}
/* A summary spans its whole row, so its focus ring is a thin line rather than a heavy box. */
summary:focus-visible { outline: 1.5px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }
.icon { display: contents; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 60; padding: 8px 14px; border-radius: 10px;
  background: var(--primary); color: var(--primary-ink); text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 32px 24px 56px; }
.wrap.narrow { max-width: 880px; }
.wrap.wide { max-width: 1320px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1320px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
/* The mark: two overlapping circles in the brand's two colours, drawn here because the app ships no image. */
.brand-mark {
  position: relative; display: block; width: 30px; height: 22px; flex: none;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; top: 0; width: 22px; height: 22px; border-radius: 50%;
}
.brand-mark::before { left: 0; background: var(--brand-a); }
.brand-mark::after { right: 0; background: color-mix(in srgb, var(--brand-b) 85%, transparent); }
.brand-mark.large { width: 60px; height: 44px; margin: 0 auto; }
.brand-mark.large::before, .brand-mark.large::after { width: 44px; height: 44px; }
.brand-name { font-weight: 700; letter-spacing: -0.015em; white-space: nowrap; }
.brand-tag {
  font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
  padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
}
.grad {
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

.nav {
  display: flex; gap: 2px; padding: 3px; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
}
.nav a {
  display: inline-flex; align-items: center; white-space: nowrap; text-decoration: none;
  padding: 6px 12px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 560;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.me { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; min-width: 0; }
.me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; flex: none;
  border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.icon-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px; border-radius: 11px; cursor: pointer; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 560; font-size: 14px; transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn.quiet-danger { color: var(--danger); }
.btn.wide { width: 100%; min-height: 44px; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- sign-in ---------- */

.view-login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(60vmax 60vmax at 0% 0%, color-mix(in srgb, var(--brand-a) 16%, transparent), transparent 60%),
    radial-gradient(60vmax 60vmax at 100% 100%, color-mix(in srgb, var(--brand-b) 12%, transparent), transparent 60%),
    var(--bg);
}
.login-card {
  position: relative; overflow: hidden;
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; padding: 40px 32px 28px; box-shadow: var(--shadow-lift); text-align: center;
  animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
}
.login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--brand-grad); }
.login-card h1 { font-weight: 750; font-size: 34px; letter-spacing: -0.03em; margin-top: 18px; line-height: 1.1; }
.login-kicker { margin-top: 6px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--ink-3); }
.login-card form { text-align: left; display: grid; gap: 14px; margin-top: 26px; }
.login-note { color: var(--ink-3); font-size: 12.5px; margin-top: 18px; text-wrap: balance; }

/* ---------- page heads ---------- */

.eyebrow { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.page-title { font-family: var(--serif); font-size: clamp(30px, 5vw, 42px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin-top: 4px; }
.page-title:focus { outline: none; }
.page-head { display: grid; gap: 6px; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.page-head .lede { color: var(--ink-2); max-width: 70ch; text-wrap: pretty; }
/* The role and the contact details, on one line in quiet text. The links are ordinary links in the same colour. */
.page-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; color: var(--ink-2); font-size: 14.5px; }
.page-meta .sep { color: var(--ink-3); }
.page-meta a { color: inherit; text-decoration-color: var(--line-strong); overflow-wrap: anywhere; }
.page-meta a:hover { color: var(--ink); text-decoration-color: currentColor; }
.kept-note { color: var(--ink-2); font-size: 13.5px; max-width: 80ch; text-wrap: pretty; }
.back {
  display: inline-flex; gap: 6px; margin-bottom: 16px; padding: 4px 0; color: var(--ink-2); font-size: 14px; text-decoration: none;
}
.back:hover { color: var(--ink); }

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; margin-bottom: 24px;
  border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--ink); font-size: 14px;
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}

/* ---------- the candidates list ---------- */

.block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.block-head h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }

.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 11px 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 650; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .name { font-weight: 640; color: var(--ink); text-decoration: none; }
.table .sub { display: block; font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.table .cell-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.link-row { cursor: pointer; transition: background .12s; }
@media (hover: hover) {
  .link-row:hover { background: var(--surface-2); }
  .link-row:hover a.name { text-decoration: underline; }
}
.empty-note { padding: 28px 18px; text-align: center; color: var(--ink-3); font-size: 14.5px; text-wrap: balance; }

/* A candidate's state in the list, and the short labels for the link, the call and the report in a candidate's
   header: quiet labels in words, as Role Call's badges. The words carry the meaning; the colour only repeats it, and
   a failure also has a dashed border. */
.state, .status {
  display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; line-height: 1.4; white-space: nowrap;
  padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.state.busy, .status.busy { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.state.live, .status.live { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 28%, transparent); }
.state.ready, .status.ready { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.state.failed, .status.failed { border-style: dashed; border-color: var(--danger); color: var(--danger); background: transparent; }
.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- forms ---------- */

.form-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  display: grid; gap: 18px;
}
/* align-content keeps a field's label and control together when the field beside it is taller. */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
label, .label { font-size: 13.5px; font-weight: 620; color: var(--ink); }
.optional { font-weight: 450; color: var(--ink-3); }
.hint { font-size: 13px; color: var(--ink-2); max-width: 72ch; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; min-height: 42px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--bg);
  /* 16px: Safari on an iPhone zooms the whole page in when a smaller field is tapped (as in Role Call). */
  padding: 9px 13px; font-size: 16px; color: var(--ink); line-height: 1.45;
}
textarea { resize: vertical; min-height: 84px; }
textarea.grow { min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[readonly] { background: var(--surface-2); }
input[type="file"] { font-size: 14px; max-width: 100%; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 7px 14px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 560; cursor: pointer;
}
input[type="file"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 9px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.tick { display: flex; gap: 10px; align-items: flex-start; font-weight: 560; cursor: pointer; }
.tick input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--primary); }
.tick input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.form-error {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; color: var(--ink);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}
.form-status { font-size: 14px; color: var(--ink-2); }
.docs-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.docs-fields legend, .group-legend { font-size: 13.5px; font-weight: 620; margin-bottom: 10px; }

/* ---------- the candidate page ---------- */

/* The header, the in-page navigation and the cards share one gap. Each card has the same padding, so every heading
   starts at the same left edge as the text under it. */
.panels { display: grid; gap: var(--gap); }
.candidate-head .page-head { gap: 10px; padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.candidate-head .page-meta { margin-top: -2px; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  display: grid; gap: 14px; min-width: 0;
  /* A jump from the in-page navigation stops below the top bar and the navigation, with the same gap as between
     the cards. */
  scroll-margin-top: calc(var(--topbar-h) + var(--pagenav-h) + var(--gap));
}
.panel > h2 { font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.panel > h2:focus { outline: none; }

/* The in-page navigation under the candidate's header. It sticks flush under the top bar, at the height that app.js
   measures, with an opaque background so that nothing shows through it, and a hairline under it. The link for the
   section in view is underlined. On a narrow screen the links scroll sideways rather than wrap. */
.page-nav {
  position: sticky; top: var(--topbar-h); z-index: 9;
  min-width: 0; background: var(--bg); box-shadow: inset 0 -1px 0 var(--line);
}
.page-nav ul {
  list-style: none; margin: 0 0 0 -6px; padding: 0; display: flex; gap: 14px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.page-nav ul::-webkit-scrollbar { display: none; }
.page-nav li { flex: none; }
.page-nav a {
  position: relative; display: block; padding: 11px 6px 12px; white-space: nowrap; text-decoration: none;
  color: var(--ink-2); font-size: 14px; font-weight: 560;
}
.page-nav a::after {
  content: ""; position: absolute; left: 6px; right: 6px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0;
  background: transparent;
}
.page-nav a:hover { color: var(--ink); }
.page-nav a[aria-current] { color: var(--ink); }
.page-nav a[aria-current]::after { background: var(--ink); }
.page-nav a:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; border-radius: 8px; }

.panel > .intro { color: var(--ink-2); font-size: 14.5px; max-width: 72ch; }
.panel h3 { font-size: 15px; font-weight: 680; }

.facts { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--ink-2); font-size: 14.5px; }

/* The documents: four fixed columns in every row (kind, name, time, buttons), so that they line up. A long name
   ends in an ellipsis, and its title gives it in full. */
.doc-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.doc-row {
  display: grid; grid-template-columns: 148px minmax(0, 1fr) 116px 270px; align-items: center; column-gap: 14px;
  min-height: 54px; padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.doc-row:last-child { border-bottom: 0; }
.doc-kind {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-name { min-width: 0; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-when { font-size: 13px; color: var(--ink-3); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.doc-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.doc-actions .btn { width: 100%; padding: 0 8px; }

/* The upload form: the kind, the file and the button on one line, with their bottoms level. */
.upload {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 16px; border-radius: 12px;
  background: var(--surface-2);
}
.upload .kind-field { flex: 0 0 220px; }
.upload .file-field { flex: 1 1 240px; }
.upload select { background-color: var(--surface); }
.upload > .btn { min-height: 42px; flex: none; }

/* A file picker: a button that opens the hidden file input, and the name of the chosen file beside it. */
.file-pick { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 42px; }
.file-pick .btn { flex: none; min-height: 42px; }
.file-name { min-width: 0; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-name.empty { color: var(--ink-3); }

.progress {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); font-size: 14.5px;
}
.spinner {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--warn) 30%, transparent); border-top-color: var(--warn);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.problem {
  padding: 12px 14px; border-radius: 12px; font-size: 14.5px;
  background: var(--accent-soft); border: 1px dashed color-mix(in srgb, var(--danger) 50%, transparent);
}

/* The brief's two parts. The reporter's part has its own frame and a heading in words, never colour alone. */
.brief-meta { font-size: 13.5px; color: var(--ink-3); }
.brief-version { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.brief-notes::before { content: "·"; content: "·" / ""; margin-right: 8px; }
.brief-part { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 12px; min-width: 0; }
.brief-part.for-reporter { border-style: dashed; border-color: var(--line-strong); background: var(--surface-2); }
.part-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.part-head p { flex: 1 1 100%; font-size: 13.5px; color: var(--ink-2); }
.lock {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface);
}
.lock svg { width: 13px; height: 13px; }

/* The brief's long lists fold away under their names. A chevron at the end of the row, as in Role Call, replaces
   the browser's triangle, so the name starts at the same edge as the text under it. */
.brief-sections { display: grid; gap: 12px; min-width: 0; }
.fold { min-width: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.for-reporter .fold { border-top-color: var(--line-strong); }
.fold > summary, details.checks > summary {
  display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer;
  font-size: 14.5px; font-weight: 680; padding: 2px 0;
}
.fold > summary::-webkit-details-marker, details.checks > summary::-webkit-details-marker { display: none; }
.fold > summary::after, details.checks > summary::after {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 6px 3px auto;
  border-right: 1.75px solid var(--ink-3); border-bottom: 1.75px solid var(--ink-3);
  transform: rotate(45deg); transition: transform .2s;
}
.fold[open] > summary::after, details.checks[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
.fold[open] > summary { margin-bottom: 10px; }

/* Read-only JSON, as headings and text. */
.kv { margin: 0; display: grid; gap: 10px; min-width: 0; }
.kv > div { display: grid; gap: 2px; min-width: 0; }
.kv dt { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 650; color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.kv ul, .kv ol, .fold > ul, .fold > ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.kv .items, .fold > .items { list-style: none; padding: 0; gap: 8px; }
.items > li { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.for-reporter .items > li { background: var(--bg); }
.item-label { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.none { color: var(--ink-3); }

/* The editor for the interviewer's part. */
.editor { display: grid; gap: 16px; }
.editor fieldset.group { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; }
.editor fieldset.group > legend { font-size: 13.5px; font-weight: 680; padding: 0 6px; }
.editor .readonly-value { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; }
.editor .item-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.editor-actions { position: sticky; bottom: 0; padding: 12px 0 2px; background: linear-gradient(transparent, var(--surface) 30%); }
/* A problem that the server found in a field, shown beside the field. */
.field-error { font-size: 13.5px; font-weight: 600; color: var(--danger); }
.editor .invalid > textarea, .editor .invalid > input { border-color: var(--danger); }
.editor fieldset.group.invalid { border-color: var(--danger); }
.form-error { display: grid; gap: 6px; }
.form-error ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* The candidate's link: the address ends in an ellipsis inside its box, with Copy the link beside it. */
.linkbox { display: flex; align-items: center; gap: 8px; min-width: 0; }
.linkbox input {
  flex: 1 1 auto; width: auto; min-width: 0; font-family: var(--mono); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.linkbox .btn { flex: none; min-height: 42px; }

.calls { display: grid; gap: 14px; }
.call { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.call .notice { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.timeline li { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 10px; font-size: 14px; color: var(--ink-2); }
.timeline .offset { font-family: var(--mono); font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.write-brief { display: grid; gap: 10px; padding-top: 4px; }
.call h4 { margin-bottom: 6px; }
.summary { font-family: var(--serif); font-size: 18px; line-height: 1.45; max-width: 70ch; }

/* The activity log: When and Who have fixed widths and stay on one line, and What takes the rest. Its type is a
   little smaller than the prose around it. */
.audit { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13.5px; line-height: 1.45; }
.audit .col-when { width: 156px; }
.audit .col-who { width: 148px; }
.audit th {
  text-align: left; padding: 9px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 650;
  color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.audit td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.audit tbody tr:last-child td { border-bottom: 0; }
.audit .when, .audit .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audit .when { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.audit .who { color: var(--ink-3); }
.audit .what { overflow-wrap: anywhere; }

/* ---------- the report beside the transcript ---------- */

.report-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.report-col, .transcript-col {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; min-width: 0;
}
.transcript-col {
  position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto;
}
.col-head { font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 12px; }
.report-extra { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.report-extra h3 { font-size: 15px; font-weight: 680; }
details.checks[open] > summary { margin-bottom: 10px; }

/* Markdown from the server, rendered by app.js as plain elements. */
.md { display: grid; gap: 10px; min-width: 0; color: var(--ink); }
.md h2, .md h3, .md h4, .md h5, .md h6 { font-weight: 680; letter-spacing: -0.005em; margin-top: 8px; }
.md h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.md h3 { font-size: 17px; }
.md h4, .md h5, .md h6 { font-size: 15px; }
.md p, .md li { font-size: 15px; line-height: 1.55; max-width: 72ch; }
.md ul, .md ol { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.md strong { font-weight: 680; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.md table { width: 100%; border-collapse: collapse; font-size: 14px; }
.md th, .md td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.md th { background: var(--surface-2); font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.md tr:last-child td { border-bottom: 0; }

.quotes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.quotes li { display: grid; gap: 6px; padding: 10px 14px; border-left: 3px solid var(--line-strong); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.quotes q { font-style: italic; }

.turns { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.turn { display: grid; gap: 4px; padding: 10px 14px; border-radius: 14px; max-width: 92%; scroll-margin-top: 90px; }
.turn.interviewer { background: var(--surface-2); justify-self: start; border-top-left-radius: 6px; }
.turn.candidate { justify-self: end; border: 1px solid var(--line-strong); border-top-right-radius: 6px; }
.turn.highlight { outline: 2px solid var(--brand-b); outline-offset: 2px; }
.turn-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 12.5px; }
.speaker { font-weight: 680; color: var(--ink); }
.turn-time { font-family: var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.turn-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.section-mark { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.section-mark:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.section-mark h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 650; color: var(--ink-3); }

/* ---------- the confirmation dialog and the toast ---------- */

dialog.confirm {
  width: min(480px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift);
}
dialog.confirm::backdrop { background: rgb(20 18 15 / 45%); }
dialog.confirm h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; margin-bottom: 10px; }
.confirm-body { display: grid; gap: 8px; color: var(--ink-2); margin-bottom: 20px; }
.confirm-body ul { margin: 0; padding-left: 20px; }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: 24px; margin-inline: auto; width: fit-content; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow-lift); max-width: 560px;
  animation: rise .25s ease both;
}

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

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

/* ---------- smaller screens ---------- */

@media (max-width: 1000px) {
  .report-grid { grid-template-columns: minmax(0, 1fr); }
  .transcript-col { position: static; max-height: none; overflow: visible; }
}

/* Below the narrow page's full width, a document row has two lines: the kind over the name, with the time and the
   buttons beside them. */
@media (max-width: 879px) {
  .doc-row {
    grid-template-columns: minmax(0, 1fr) 116px 270px; grid-template-areas: "kind when actions" "name when actions";
    row-gap: 2px;
  }
  .doc-kind { grid-area: kind; }
  .doc-when { grid-area: when; }
  .doc-name { grid-area: name; }
  .doc-actions { grid-area: actions; }
}

@media (max-width: 640px) {
  .wrap { padding: 20px 16px 40px; }
  .topbar-inner { padding: 10px 16px; gap: 10px; }
  .brand-name, .me-name { display: none; }
  .panel, .form-card, .report-col, .transcript-col { padding: 18px 16px; }
  :root { --gap: 16px; }
  /* A table row becomes a small card, as on Role Call's results page. */
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table, .table tbody { display: block; }
  .table tr { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { display: block; padding: 0; border: 0; }
  .table .cell-main { flex: 0 0 100%; }
  .turn { max-width: 100%; }
  .timeline li { grid-template-columns: 4em minmax(0, 1fr); }

  /* The role and the contact details take a line each. */
  .page-meta { flex-direction: column; align-items: flex-start; gap: 2px; }
  .page-meta .sep { display: none; }

  /* A document row becomes three lines: the kind and the time, the name, then the three buttons side by side. */
  .doc-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "kind when" "name name" "actions actions";
    row-gap: 6px; padding: 12px 14px;
  }

  /* The upload form and the link box stack. */
  .upload { flex-direction: column; align-items: stretch; }
  .upload .kind-field, .upload .file-field { flex: none; }
  .upload > .btn { align-self: flex-start; }
  .linkbox { flex-wrap: wrap; }
  .linkbox input { flex-basis: 100%; }

  /* An activity row becomes two lines: when and who, then what happened. */
  .audit, .audit tbody { display: block; }
  .audit colgroup { display: none; }
  .audit thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .audit tr { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .audit tbody tr:last-child { border-bottom: 0; }
  .audit td { padding: 0; border: 0; }
  .audit .what { grid-column: 1 / -1; margin-top: 2px; }
}
