/* Working paper frame and the form, button and panel styles its tabs share. */
.wp-page { gap: 20px; }

.wp-banner {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--hero); color: var(--hero-text); border-radius: var(--radius-hero); padding: 20px 24px;
}
.wp-banner-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wp-tile {
  flex: none; width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08); color: #FFFFFF;
  font-family: var(--font-head); font-size: 22px; font-weight: 700;
}
.wp-banner-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wp-banner h1 { font-size: 22px; color: #FFFFFF; }
.wp-eyebrow { font-size: 12px; color: var(--hero-muted); }
.wp-banner-stats { display: flex; flex-wrap: wrap; gap: 24px; }
.wp-banner-stat { display: flex; flex-direction: column; }
.wp-banner-stat b { font-family: var(--font-head); font-size: 17px; color: #FFFFFF; }
.wp-banner-stat b.wp-approval { color: var(--highlight); }

.wp-tabs-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 16px; border-bottom: 1px solid var(--border); }
.wp-tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.wp-switch { padding-bottom: 6px; }
.wp-switch-select {
  background: var(--surface); border: 1px solid var(--border-input); border-radius: var(--radius);
  padding: 5px 8px; font-size: 12px; font-weight: 500; color: var(--text-2); max-width: 240px;
}
.wp-tab {
  display: flex; align-items: baseline; gap: 6px;
  padding: 10px 14px; margin-bottom: -1px;
  color: var(--text-muted); text-decoration: none;
  border-bottom: 2px solid transparent;
}
.wp-tab:hover { color: var(--text); }
.wp-tab[aria-current='page'] { color: var(--navy); font-weight: 600; border-bottom-color: var(--navy); }
.wp-tab-ref { font-size: 11px; color: #667085; }
.wp-tab-count {
  font-size: 11px; font-weight: 600; color: var(--text-2);
  background: var(--border-soft); border-radius: 999px; padding: 0 7px;
}
.wp-body { display: flex; flex-direction: column; gap: 20px; }

/* Buttons */
.button {
  padding: 9px 16px; border-radius: 8px; font-weight: 600;
  border: 1px solid var(--border-input); background: var(--surface); color: var(--text-2);
}
.button:hover { background: var(--border-soft); }
.button--primary { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
.button--primary:hover { background: var(--link-hover); }
.button--danger { background: var(--late-fg); border-color: var(--late-fg); color: #FFFFFF; }
.button--danger:hover { background: #912018; border-color: #912018; }
/* Disabled is shown by the cursor and fading as well as the colour. */
.button:disabled, .button[aria-disabled='true'] { cursor: not-allowed; opacity: 0.6; }
.button:disabled:hover, .button[aria-disabled='true']:hover { background: var(--surface); }
.button--primary:disabled:hover, .button--primary[aria-disabled='true']:hover { background: var(--navy); }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .field-label { font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--text); background: var(--surface);
  padding: 8px 10px; border: 1px solid var(--border-input); border-radius: var(--radius);
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--navy); }

/* Why a reviewer sent an item back */
.sent-back-note {
  margin: 0; padding: 10px 12px; border-left: 3px solid var(--late-fg); border-radius: var(--radius);
  background: var(--late-bg); color: var(--text); line-height: 1.5;
}

/* Upload target */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 20px; border: 1.5px dashed #B9C6D6; border-radius: 8px; background: #F7F9FC;
}
.dropzone:focus-within { outline: 2px solid var(--navy); outline-offset: 2px; }
.dropzone.is-over { border-color: var(--navy); background: var(--navy-tint); }

.panel {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 18px 20px;
}

/* Strip of label and value pairs */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
}
.facts > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-left: 1px solid var(--border); }
.facts > div:first-child { border-left: 0; }
.facts dt { font-size: 12px; color: var(--text-label); }
.facts dd { margin: 0; font-weight: 600; }

.tag--issue { color: #9A5B00; background: #FEF3DC; }

.type-chip {
  width: 34px; flex: none; text-align: center; padding: 8px 0; border-radius: var(--radius);
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; background: #F2F4F7; color: #344054;
}
.type-chip--pdf { background: #FDE8E6; color: #B42318; }
.type-chip--xlsx { background: #DDF5E9; color: #146C43; }
.type-chip--docx { background: #E8EEF6; color: #1E3A5F; }

.dropzone { cursor: pointer; color: var(--text-2); }
.dropzone-lead { font-weight: 500; }
.dropzone-lead b { font-weight: 700; color: var(--navy); }
.dropzone-note { font-size: 12px; color: #667085; }
.dropzone--off { cursor: not-allowed; opacity: 0.75; }

[hidden] { display: none !important; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: var(--radius-sm);
  background: var(--navy-tint); color: var(--navy); text-decoration: none;
}
.chip:hover { text-decoration: underline; }

/* Checklist tab */
.cl-root { display: flex; flex-direction: column; gap: 16px; }
.cl-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cl-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-filter {
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: var(--radius);
  border: 1px solid var(--border-input); background: var(--surface); color: var(--text-2);
}
.cl-filter[aria-pressed='true'] { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
.cl-filter-count { font-weight: 500; opacity: 0.85; }
.cl-filter-box input {
  width: 240px; max-width: 100%; padding: 6px 10px;
  border: 1px solid var(--border-input); border-radius: var(--radius); background: var(--surface);
}

.cl-main { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cl-list { flex: 999 1 520px; min-width: 0; overflow: hidden; }
.cl-panel { flex: 1 1 340px; min-width: 0; position: sticky; top: 16px; max-height: calc(100vh / var(--zoom) - 32px); overflow-y: auto; }
.cl-group { border-bottom: 1px solid var(--border); }
.cl-group:last-of-type { border-bottom: 0; }
.cl-group-head {
  width: 100%; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 20px; border: 0; background: var(--surface-head); text-align: left;
}
.cl-group-head[aria-expanded='true'] { background: #F3F7FF; }
.cl-group-head:hover { background: var(--navy-tint); }
.cl-group-ref { font-weight: 700; color: var(--navy); }
.cl-group-text { display: flex; flex-direction: column; min-width: 0; }
.cl-group-title { font-weight: 600; }
.cl-group-sub { font-size: 12px; color: var(--text-muted); }
.cl-group-bar { display: flex; align-items: center; gap: 8px; }
.cl-group-bar .bar { width: 64px; height: 5px; }
.cl-group-count { font-size: 12px; color: #475467; }
.cl-tasks { list-style: none; margin: 0; padding: 0; }
.cl-row {
  width: 100%; display: grid; grid-template-columns: 64px minmax(0, 1fr) 150px; gap: 14px; align-items: center; text-align: left;
  padding: 11px 20px; border: 0; border-top: 1px solid var(--border-soft); background: var(--surface); color: var(--text);
}
.cl-row:hover { background: var(--surface-head); }
.cl-row[aria-current='true'] { background: #F3F7FF; box-shadow: inset 3px 0 0 var(--navy); }
.cl-ref { font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.cl-title { color: var(--text-2); }
.cl-row .tag { justify-self: start; }
.cl-empty { padding: 20px; color: var(--text-muted); }

.cl-panel-head { display: flex; flex-direction: column; gap: 6px; }
.cl-panel-eyebrow { font-size: 12px; font-weight: 600; color: var(--navy); }
.cl-panel h2 { font-size: 17px; line-height: 1.3; }
.cl-panel .field input, .cl-panel .field textarea { font-weight: 400; }
.cl-panel textarea { resize: vertical; }
.cl-none { color: #667085; font-weight: 400; }
.cl-why { border-top: 1px solid var(--border-soft); padding-top: 12px; }
.cl-why summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.cl-why p { margin-top: 8px; color: #475467; }
.cl-review-line { color: var(--text-2); font-weight: 500; }
.cl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }
.cl-helper { font-size: 12px; color: var(--text-muted); }

@media (max-width: 900px) {
  .cl-panel { position: static; max-height: none; }
}

/* Facts strip colours (always paired with the number, never colour alone) */
.facts dd { font-family: var(--font-head); font-size: 18px; }
.facts dd.fact-ok { color: var(--done-fg); }
.facts dd.fact-bad { color: var(--late-fg); }
.facts > div { padding: 14px 20px; gap: 4px; }
.facts dt { color: var(--text-muted); font-size: 13px; }

/* Selectable table rows */
.table .row-button {
  padding: 0; border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; text-align: left;
}
.table .row-button:hover { text-decoration: underline; }
.table tbody tr.is-selected { background: #F3F7FF; box-shadow: inset 3px 0 0 var(--navy); }
.table a.cell-link { position: relative; z-index: 1; }

/* Evidence tab */
.ev-root { display: flex; flex-direction: column; gap: 20px; }
.ev-list-head { padding: 16px 20px 14px; display: flex; flex-direction: column; gap: 12px; }
.ev-list-title { display: flex; flex-direction: column; gap: 2px; }
.ev-table { min-width: 620px; }
.ev-doc { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ev-doc .type-chip { width: auto; padding: 3px 5px; border-radius: var(--radius-sm); }
.ev-title { font-weight: 500; }
.type-chip--none { background: var(--border-soft); color: #667085; }
.ev-head { display: flex; flex-direction: column; gap: 4px; }
.ev-head h2 { font-size: 17px; }
.ev-file { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.ev-preview {
  height: 260px; border-radius: 8px; background: #EEF1F5; border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-muted); text-align: center; padding: 16px; overflow: hidden;
}
.ev-preview b { color: var(--text-2); }
.ev-preview-note { font-size: 12px; }
.ev-preview-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ev-preview-frame { width: 100%; height: 100%; border: 0; background: #FFFFFF; }
.ev-preview .dropzone { width: 100%; padding: 12px; }
.ev-details { margin: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; }
.ev-details dt { color: var(--text-muted); }
.ev-details dd { margin: 0; font-weight: 500; }
.ev-open { display: contents; }
a.button { text-decoration: none; display: inline-block; }

/* Corrections tab */
.journal-table { min-width: 820px; }
.journal-new { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.journal-panel { gap: 16px; }
.journal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.seg-group { display: flex; padding: 2px; background: var(--border-soft); border-radius: var(--radius); }
.seg { font-size: 12px; font-weight: 600; border: 0; border-radius: var(--radius-sm); padding: 5px 10px; background: transparent; color: var(--text-muted); }
.seg[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-input); }
.seg:disabled { cursor: not-allowed; opacity: 0.8; }
.journal-lines { width: 100%; min-width: 720px; border-collapse: collapse; }
.journal-lines th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-muted); padding: 0 6px 6px 0; }
.journal-lines td { padding: 4px 6px 4px 0; }
.journal-lines th.cell-num, .journal-lines td.cell-num { text-align: right; }
.journal-lines input, .journal-lines select {
  width: 100%; font: inherit; padding: 7px 9px; border: 1px solid var(--border-input); border-radius: var(--radius); background: #FFFDF5;
}
.journal-lines input.amount { text-align: right; font-variant-numeric: tabular-nums; }
.journal-lines input[aria-invalid='true'] { border-color: var(--late-fg); background: var(--late-bg); }
.journal-lines tfoot td { padding-top: 10px; border-top: 1px solid var(--border); }
.journal-lines--read td, .journal-lines--read th { padding-right: 12px; }
.journal-errors { color: var(--late-fg); font-weight: 500; min-height: 0; }
.journal-errors:empty { display: none; }
.journal-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.icon-button { border: 0; background: transparent; color: #667085; padding: 4px; border-radius: var(--radius-sm); display: inline-flex; }
.icon-button:hover { color: var(--late-fg); }
.text-button { border: 0; background: transparent; padding: 0; font-weight: 600; color: var(--navy); }
.text-button:hover { text-decoration: underline; }
.fact-pair { display: flex; align-items: center; gap: 8px; }
.fact-pair .tag { font-family: var(--font-body); }
.field--inline { flex-direction: row; align-items: center; gap: 8px; }

/* Working paper overview (A0) */
.wp-hero {
  background: var(--hero); color: var(--hero-text); border-radius: var(--radius-hero);
  padding: 24px 28px 18px; display: flex; flex-direction: column; gap: 18px; overflow: hidden;
}
.wp-hero :focus-visible { outline-color: var(--highlight); }
.wp-hero-top { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.wp-tile--big { width: 52px; height: 52px; font-size: 26px; border-radius: 10px; }
.wp-hero-text { flex: 1 1 420px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero-button { border: 0; font: inherit; font-weight: 600; }
.wp-hero-eyebrow { font-size: 12px; font-weight: 500; letter-spacing: 0.04em; color: var(--hero-muted); }
.wp-hero h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.015em; color: #FFFFFF; }
.wp-hero p { color: var(--hero-soft); max-width: 64ch; }
.wp-hero-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px;
  padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.wp-hero-facts { margin: 0; display: flex; flex-wrap: wrap; gap: 14px 32px; }
.wp-hero-facts > div { display: flex; flex-direction: column; gap: 2px; }
.wp-hero-facts dt { font-size: 12px; color: var(--hero-muted); }
.wp-hero-facts dd { margin: 0; font-family: var(--font-head); font-size: 18px; font-weight: 600; color: #FFFFFF; }

.rail { list-style: none; margin: 0; padding: 0; position: relative; width: 420px; max-width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rail::before {
  content: ''; position: absolute; left: 12.5%; right: 12.5%; top: 22px; height: 10px;
  background: repeating-linear-gradient(90deg, #2A4462 0 3px, transparent 3px 12px);
}
.rail-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rail-step:not(:last-child)::after {
  content: ''; position: absolute; left: 50%; width: 100%; top: 23px; height: 8px;
  border-top: 2px solid #3E5A7C; border-bottom: 2px solid #3E5A7C;
}
.rail-step.is-done:not(:last-child)::after { border-color: #6EE7B7; }
.rail-caption { height: 16px; font-size: 11px; font-weight: 600; color: var(--highlight); white-space: nowrap; }
.rail-caption--done { color: #6EE7B7; }
.rail-dot { position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%; background: var(--hero); border: 3px solid #5F7896; }
.rail-dot--done { background: #6EE7B7; border-color: #6EE7B7; }
.rail-dot--next { border-color: var(--highlight); }
.rail-label { font-size: 12px; color: #D5DFEB; text-align: center; }

/* Lists of linked rows inside cards */
.wp-card { min-width: 0; }
.cl-main > .wp-card:first-child { flex: 999 1 520px; }
.cl-main > .wp-card:not(:first-child) { flex: 1 1 340px; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-row, .people-row, .explain-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 20px; border-top: 1px solid var(--border-soft); color: var(--text); text-decoration: none;
}
a.link-row:hover { background: var(--surface-head); color: var(--text); }
.link-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.link-row-title { font-weight: 500; }
.link-row-sub { font-size: 12px; color: var(--text-muted); }
.people-can { font-size: 12px; color: #475467; text-align: right; }
.link-row--finding { grid-template-columns: 70px minmax(0, 1fr) 160px 110px; }
.finding-ref { font-weight: 700; color: var(--navy); }

/* Summary tab and the figure tables */
.wp-amount { white-space: nowrap; }
.wp-gap { color: var(--soon-fg); font-weight: 600; }
.wp-corr { color: var(--navy); font-weight: 600; }
.wp-zero { color: #667085; }
.wp-strong { font-weight: 600; }
.fact-wait { color: var(--soon-fg); }
.table tbody tr.is-flagged { background: #FFFBF3; }
.table tbody tr.is-changed { background: #F7FAFF; }
.summary-table, .restated-table { min-width: 980px; }
.table .group-row th, .table .group-row td {
  text-align: center; font-size: 11px; font-weight: 600; color: #475467; background: var(--surface-head);
  padding: 6px 8px 0; border-bottom: 0;
}
.table .group-row th { border-bottom: 1px solid var(--border-input); }
.summary-table th .term-label, .summary-table th { white-space: nowrap; }
.wp-balance { font-size: 12px; color: var(--text-muted); }
.wp-balance b { font-weight: 600; }
.explain-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
.explain-row .button { padding: 7px 12px; white-space: nowrap; }
.cell-num { text-align: right; }

/* Account detail tab */
.detail-table { min-width: 820px; }
.expand { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; font: inherit; color: var(--navy); }
.expand-mark { width: 12px; color: #667085; }
.rows-row td { padding: 0 20px 12px 44px; background: var(--surface-head); }
.table tbody tr.rows-row:hover { background: var(--surface-head); }
.asset-rows { width: 100%; border-collapse: collapse; }
.asset-rows th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-muted); padding: 8px 12px 4px 0; }
.asset-rows td { padding: 6px 12px 6px 0; border-top: 1px solid var(--border-soft); }
.asset-rows th.cell-num, .asset-rows td.cell-num { text-align: right; }
.table tfoot td { font-weight: 600; background: var(--surface-head); padding: 11px 14px; border-top: 1px solid var(--border); }
.table tfoot td:first-child { padding-left: 20px; }
.paste-panel { border-color: #B9CCF5; }
.paste-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.paste-box { font-family: var(--font-body); font-size: 12px; font-weight: 400; resize: vertical; }
.paste-preview { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.paste-preview:empty { display: none; }
.paste-table tr.is-bad { background: #FFF6F5; }
.paste-sample { margin: 8px 0; padding: 10px 12px; background: var(--surface-head); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; font-size: 12px; }
.add-row .journal-fields { align-items: start; }
.add-row input[aria-invalid], .journal-lines input[aria-invalid] { border-color: var(--late-fg); }

/* Last year restated tab */
.note-label { display: flex; flex-direction: column; gap: 4px; font-weight: 400; }
.note-title { font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--text); }
.field textarea[readonly] { background: var(--surface-head); }
.ladder-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ladder-plain li { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.ladder-plain b { font-weight: 600; }
