:root {
  color-scheme: light;
  --night: #101f32;
  --night-raised: #1e3249;
  --petrol: #086368;
  --solar: #ffc94d;
  --wash: #f2f6f8;
  --line: #d8e3e8;
  --muted: #506378;
  color: var(--night);
  background: var(--wash);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--petrol); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 3px; }

.skip { position: fixed; inset: 12px auto auto 12px; z-index: 3; padding: 10px; background: #fff; transform: translateY(-200%); }
.skip:focus { transform: none; }

.top {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 16px; color: var(--night); font-size: 13px; font-weight: 750; text-decoration: none; }
.brand img { display: block; width: 154px; height: auto; }
.brand span { padding-inline-start: 16px; border-inline-start: 1px solid var(--line); white-space: nowrap; }
.account { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 690; min-width: 0; }
.account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.layout { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: calc(100vh - 66px); }
.layout-public { display: block; }
.sidebar { background: var(--night); color: #fff; }
.sidebar nav { position: sticky; top: 0; padding: 18px 12px; }
.sidebar p { margin: 16px 12px 7px; color: #b8c9d9; font-size: 12px; font-weight: 750; }
.sidebar a {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-block: 2px;
  padding: 0 10px;
  border-inline-start: 3px solid transparent;
  border-radius: 3px;
  color: #f1f5fa;
  font-size: 14px;
  font-weight: 630;
  text-decoration: none;
}
.sidebar a:hover, .sidebar a[aria-current], .sidebar .section-current { background: var(--night-raised); }
.sidebar a[aria-current], .sidebar .section-current { border-inline-start-color: var(--solar); }
.sidebar a:focus-visible { outline-color: var(--solar); }

main { min-width: 0; padding: clamp(18px, 3vw, 38px); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(30px, 4.5vw, 48px); line-height: 1.08; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-size: 20px; line-height: 1.2; }
.heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.heading { margin-block-end: 23px; }
.heading p { margin-block-start: 7px; color: var(--muted); overflow-wrap: anywhere; }
.panel-heading { margin-block-end: 12px; }
.panel-heading > a:not(.button), .back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; overflow-wrap: anywhere; }
.back { margin-block-end: 7px; }

.button, .quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 730;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button { background: var(--petrol); color: #fff; }
.button:hover { background: #074a4d; }
.secondary { color: var(--petrol); background: #fff; border-color: #acc3c5; }
.secondary:hover, .quiet:hover { background: #e7f2f2; }
.quiet { color: var(--petrol); background: transparent; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-block-end: 24px; }
.metrics a {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--petrol);
  border-radius: 7px;
  color: var(--night);
  background: #fff;
  font-weight: 690;
  text-decoration: none;
}
.metrics a:last-child { border-top-color: var(--solar); }
.metrics a:hover { color: var(--petrol); }
.metrics strong { font-size: clamp(26px, 3.5vw, 40px); line-height: 1; font-variant-numeric: tabular-nums; }

.panel { margin-block-end: 18px; padding: clamp(13px, 2vw, 22px); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.empty, .help, .record-date { color: var(--muted); }
.empty { padding-block: 14px; }
.records { margin: 0; padding: 0; list-style: none; }
.records li { display: grid; grid-template-columns: minmax(0, 1fr) 143px 94px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.document-records li { grid-template-columns: minmax(0, 1fr) 94px minmax(206px, auto); }
.record-title { display: grid; justify-items: start; gap: 3px; overflow-wrap: anywhere; }
.record-title > a:first-child, .record-title strong { font-weight: 750; }
.record-title span, .record-date { font-size: 13px; }
.record-title span { color: var(--muted); }
.record-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 4px; }
.project-link { font-size: 13px; }
.badge { justify-self: start; display: inline-block; padding: 4px 8px; border-radius: 4px; background: #eaf0f4; font-size: 12px; font-weight: 750; white-space: nowrap; }
.status-in_progress { color: #594000; background: #fff0c7; }
.status-complete { color: #06434a; background: #dcefed; }

.project-summary dl { display: flex; flex-wrap: wrap; gap: 22px; margin: 0; }
.project-summary dt { margin-block-end: 4px; color: var(--muted); font-size: 13px; }
.project-summary dd { margin: 0; font-weight: 690; }
.project-summary h2 { margin-block: 18px 5px; font-size: 16px; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; }

.tabs, .pagination { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs { margin-block-end: 12px; }
.tabs a, .pagination a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 8px; }
.tabs a[aria-current] { color: var(--night); font-weight: 750; text-decoration: underline 3px var(--solar); }
.pagination { margin-block-start: 10px; }
.pagination span { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-block-end: 16px; }
.filters .field { flex: 1 1 185px; }
.fields { display: grid; gap: 16px; }
.fields > .button { justify-self: start; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border-radius: 5px; border: 1px solid #8fa4b3; background: #fff; color: var(--night); font: inherit; }
.field input[type="file"] { padding: 8px; }
.field textarea { resize: vertical; }
.help { font-size: 13px; }
.help ul { padding-inline-start: 18px; }
.form-panel { max-width: 680px; }
.login-panel { max-width: 455px; margin: clamp(12px, 7vw, 80px) auto 0; padding: clamp(18px, 4vw, 32px); border: 1px solid var(--line); border-top: 4px solid var(--petrol); border-radius: 8px; background: #fff; }
.login-panel h1 { font-size: clamp(25px, 5vw, 34px); }
.login-panel p { margin-block: 10px 16px; }
.login-panel button { width: 100%; }
.form-error, .errorlist { color: #801d27; margin: 0; }
.messages { list-style: none; margin: 0 0 16px; padding: 10px 12px; background: #dcefed; border-inline-start: 4px solid var(--petrol); color: #06434a; }

@media (max-width: 890px) {
  .records li, .document-records li { grid-template-columns: minmax(0, 1fr) auto; }
  .record-date { grid-column: 1; }
  .record-actions { grid-column: 1 / -1; justify-content: start; }
}

@media (max-width: 720px) {
  .top { padding-inline: 12px; }
  .brand img { width: 124px; }
  .brand span { display: none; }
  .layout { display: block; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 0 4px; padding: 6px 8px; }
  .sidebar p { display: none; }
  .sidebar a { padding-inline: 6px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metrics a { min-height: 94px; padding: 10px; }
}
