/* FPA Document Viewer — staff pages. White ground, FPA black, square edges, DINOT.
   DINOT web fonts (FPA holds a full licence) are served from assets/fonts/. */

@font-face {
  font-family: "DINOT";
  src: url("../fonts/DINOT-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DINOT";
  src: url("../fonts/DINOT-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DINOT";
  src: url("../fonts/DINOT-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #231f20;
  --muted: #5c5d60;
  --rule: #adafb2;
  --band: #f2f2f2;
  --ph: #a7a9ac;
  --bg: #ffffff;
  --font: "DINOT", "DIN OT", "DIN Next", "D-DIN", Arial, Helvetica, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
}

a:hover {
  color: var(--muted);
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 {
  font-size: 34.67px;
  line-height: 1.15;
  font-weight: 700;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
}

p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 0;
}

input,
select {
  font: inherit;
  color: var(--ink);
  border-radius: 0;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
  line-height: 1.45;
}

.tiny {
  font-size: 11px;
}

.eyebrow,
.label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-tight {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stack-xs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row-gap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
}

.grow {
  flex-grow: 1;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.error {
  background: #fbebeb;
  border-left: 0;
  padding: 10px 14px;
  font-size: 14px;
}

.notice {
  background: var(--band);
  padding: 12px 16px;
}

label {
  font-size: 14px;
  font-weight: 500;
}

input[type=text],
input[type=password],
input[type=number],
input[type=search],
select {
  height: 44px;
  border: 1px solid var(--ink);
  background: #fff;
  padding: 0 12px;
  font-size: 15px;
  min-width: 0;
}

input[type=file] {
  font-size: 14px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--ink);
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: #ffffff;
  color: #000000;
}

.btn:disabled {
  opacity: .5;
  cursor: default;
}

/*
.btn-line {
  background: #fff;
  color: var(--ink);
}


.btn-line:hover {
  background: var(--band);
  color: var(--ink);
}
  */

.btn-small {
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 400;
}

.btn-big {
  height: 56px;
  justify-content: space-between;
  font-size: 16px;
}

.linkbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  background: none;
  border: 0;
  padding: 0;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding-left: max(16px, min(53px, 3.7vw));
  padding-right: max(16px, min(53px, 3.7vw));
}

/* Header */
.top {
  border-bottom: 1px solid var(--ink);
}

.top-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  min-height: 72px;
}

.top-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 48px;
}

.top-logo {
  width: 180px;
  height: auto;
  display: block;
}

.nav {
  display: flex;
  gap: 32px;
  align-self: stretch;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 72px;
  border-bottom: 3px solid transparent;
  padding-top: 3px;
  text-decoration: none;
  font-size: 16px;
  color: var(--muted);
}

.nav a[aria-current=page] {
  border-bottom-color: var(--ink);
  color: var(--ink);
  font-weight: 700;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.page {
  padding-top: 40px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.titlerow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  border: 1px solid var(--ink);
  padding: 0 14px;
  width: 280px;
  max-width: 100%;
  color: var(--muted);
}

.searchbox input {
  border: 0;
  height: 44px;
  padding: 0;
  flex-grow: 1;
  outline-offset: 4px;
}

/* Library */
.libgrid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-start;
}

.tablebox {
  flex: 999 1 640px;
  min-width: 0;
  overflow-x: auto;
}

.doctable {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

.doctable th,
.ptable th,
.ctable th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--ink);
}

.doctable th.num,
.ptable th.num,
.ctable th.num {
  text-align: right;
}

.doctable td {
  padding: 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

.doctable tr {
  cursor: pointer;
}

.doctable tr:hover td {
  background: #fafafa;
}

.doctable tr.sel td {
  background: var(--band);
}

.c-cover {
  width: 64px;
}

.doctable td.c-cover {
  padding-left: 8px;
  padding-right: 0;
}

.thumb {
  width: 44px;
  height: 57px;
  object-fit: cover;
  display: block;
  background: var(--ph);
}

.dtitle {
  font-size: 16px;
  font-weight: 700;
}

.rowbtns {
  display: inline-flex;
  gap: 8px;
}

.empty {
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidepanel {
  flex: 1 1 340px;
  max-width: 100%;
  border: 1px solid var(--ink);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 16px;
}

.pagepick {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.pagepick input {
  width: 100px;
}

.pagethumb {
  width: 54px;
  height: auto;
  display: block;
  background: var(--ph);
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  font-size: 14px;
  font-weight: 500;
  padding: 0;
  margin-bottom: 8px;
}

.seg {
  display: flex;
  flex-wrap: wrap;
}

.seg button {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: #fff;
  font-size: 14px;
  margin-left: -1px;
}

.seg button:first-child {
  margin-left: 0;
}

.seg button[aria-pressed=true] {
  background: var(--ink);
  color: #fff;
}

.linkout {
  background: var(--band);
  padding: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-all;
}

.manage {
  border-top: 1px solid var(--rule);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.manage-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

/* Dialogs */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(35, 31, 32, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.dialog {
  width: 560px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dialog h2 {
  font-size: 29.33px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.bullets {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
}

.callout {
  background: var(--band);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.45;
}

.progress {
  height: 8px;
  background: var(--band);
  position: relative;
}

.progress i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--ink);
  transition: width .2s;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  z-index: 60;
}

/* Statistics */
.doc-head {
  display: flex;
  align-items: center;
  gap: 20px;
}

.doc-cover {
  width: 52px;
  height: auto;
  display: block;
  background: var(--ph);
}

.stats select {
  min-width: 220px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.tile {
  border-top: 2px solid var(--ink);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.big {
  font-size: 53.33px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--rule);
}

.block-head h2 {
  margin-bottom: 12px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.tabs button {
  height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  padding: 0;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tabs button[aria-selected=true] {
  border-bottom-color: var(--ink);
  color: var(--ink);
  font-weight: 700;
}

#stBody {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.chartbox {
  overflow-x: auto;
  padding-top: 10px;
}

.chart {
  min-width: 640px;
  display: flex;
  gap: 12px;
}

.ptablebox {
  overflow: auto;
  max-height: 620px;
  border-bottom: 1px solid var(--rule);
}

.ptablebox thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.yaxis {
  width: 40px;
  height: 220px;
  position: relative;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.yaxis span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
}

.plot {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.plotarea {
  height: 220px;
  position: relative;
}

.gridline {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--band);
}

.gridline.base {
  border-top-color: var(--ink);
}

.bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.bars div {
  flex: 1 1 0;
  min-width: 0;
  background: var(--ink);
  position: relative;
}

.bars div:hover {
  background: var(--muted);
}

.xlabels {
  display: flex;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}

.xlabels div {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  overflow: visible;
}

.cols {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  align-items: flex-start;
}

.col-wide {
  flex: 999 1 560px;
  min-width: 0;
}

.col-narrow {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.col-half {
  flex: 1 1 420px;
  min-width: 0;
}

.ptable,
.ctable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.ptable {
  min-width: 520px;
}

.ptable td,
.ctable td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--band);
}

.ptable td:first-child,
.ctable td:first-child,
.ptable th:first-child,
.ctable th:first-child {
  padding-left: 0;
}

.ptable td:last-child,
.ctable td:last-child,
.ptable th:last-child,
.ctable th:last-child {
  padding-right: 0;
}

.avgcell {
  width: 50%;
}

.avgbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avgtrack {
  flex-grow: 1;
  height: 10px;
  background: var(--band);
  position: relative;
}

.avgtrack i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--ink);
  min-width: 1px;
}

.avgbar span {
  width: 52px;
  text-align: right;
}

.stackbar {
  display: flex;
  height: 24px;
  background: var(--band);
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
}

.legend div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend .sw {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.legend .nm {
  flex-grow: 1;
}

.hbars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hbar {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr) 40px;
  gap: 12px;
  align-items: center;
  font-size: 15px;
}

.hbar .tr {
  height: 10px;
  position: relative;
}

.hbar .tr i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--ink);
}

.tag {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--muted);
  color: var(--muted);
  padding: 1px 6px;
  white-space: nowrap;
}

/* Sign-in */
.signin-page {
  min-height: 100vh;
}

.signin {
  display: flex;
  min-height: 100vh;
}

.signin-main {
  width: 620px;
  max-width: 100%;
  padding: max(24px, min(53px, 4vw));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
}

.signin-logo {
  width: 260px;
  height: auto;
  display: block;
}

.signin-body {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 460px;
}

.signin-body h1 {
  font-size: 53.33px;
  line-height: 1.125;
}

.lead {
  font-size: 18.67px;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.signin-side {
  flex-grow: 1;
  background-image: url('../img/login_bg_01.webp');
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}

@media (max-width: 820px) {
  .signin-side {
    display: none;
  }

  .signin-body h1 {
    font-size: 40px;
  }
}

/* Setup page */
.plain .setup {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.setup-logo {
  width: 200px;
}

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.checks .bad {
  color: #a01c1c;
  font-weight: 700;
}

.checks .note {
  color: var(--muted);
}

@media (max-width: 600px) {
  h1 {
    font-size: 28px;
  }

  .big {
    font-size: 40px;
  }

  .nav {
    gap: 20px;
  }

  .top-logo {
    width: 140px;
  }

  .top-inner {
    padding-top: 16px;
    gap: 4px 32px;
  }

  .nav a {
    min-height: 52px;
  }

  .hbar {
    grid-template-columns: minmax(0, 120px) minmax(0, 1fr) 32px;
  }

  .dialog {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress i {
    transition: none;
  }
}

/* Statistics downloads */
.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.print-only {
  display: none;
}

/* "Save as PDF": a clean A4 report of the statistics page */
@media print {
  @page {
    size: A4 portrait;
    margin: 14mm;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    font-size: 11px;
  }

  .nav,
  .top-right,
  .actions,
  .toast,
  .stats select {
    display: none !important;
  }

  .top {
    border-bottom: 1px solid var(--ink);
  }

  .top-inner {
    min-height: 0;
    padding: 0 0 8px;
  }

  .wrap {
    padding: 0;
    max-width: none;
  }

  .page {
    padding: 12px 0 0;
    gap: 16px;
  }

  .print-only {
    display: block;
  }

  .print-meta {
    font-size: 11px;
    color: var(--muted);
    margin-top: -8px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 16px;
  }

  #stBody {
    gap: 22px;
  }

  .tiles {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .big {
    font-size: 30px;
  }

  .tabs button[aria-selected=false] {
    display: none;
  }

  .tabs button {
    height: auto;
    padding-bottom: 6px;
  }

  .chart {
    min-width: 0;
  }

  .cols {
    gap: 24px;
  }

  .col-wide,
  .col-narrow,
  .col-half {
    flex-basis: 100%;
  }

  .col-narrow {
    flex-direction: row;
    gap: 24px;
  }

  .col-narrow>* {
    flex: 1 1 0;
  }

  .ptablebox {
    max-height: none;
    overflow: visible;
    border-bottom: 0;
  }

  .ptablebox thead th {
    position: static;
  }

  .ptable {
    min-width: 0;
  }

  .ptable td,
  .ctable td {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .tile,
  .block-head,
  tr,
  .hbar,
  .legend div {
    break-inside: avoid;
  }

  .block-head,
  h2 {
    break-after: avoid;
  }

  a {
    text-decoration: none;
  }

  .ptable tr.zero {
    display: none;
  }
}