:root {
  --bg: #ffffff;
  --fg: #1b1f24;
  --muted: #5b6470;
  --line: #e2e5e9;
  --accent: #1f4e8c;
  --accent-fg: #ffffff;
  --warn-bg: #fff4e0;
  --warn-fg: #7a4b00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --fg: #e8eaed;
    --muted: #9aa3ad;
    --line: #2c3238;
    --accent: #6ea0e6;
    --accent-fg: #0d1117;
    --warn-bg: #3a2d12;
    --warn-fg: #f3cf8c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 600; margin-right: auto; }
.who { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.bar form { margin: 0; }

main { max-width: 720px; margin: 0 auto; padding: 24px 16px; }

h1 { font-size: 24px; margin: 0 0 16px; }

.button, button {
  display: inline-block;
  padding: 8px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-fg);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

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

.opportunities { list-style: none; padding: 0; margin: 0; }
.opportunities li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.opportunities .name { font-weight: 600; }
.paused {
  display: block;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: 14px;
}

a { color: var(--accent); }
.brand { color: inherit; text-decoration: none; }

.crumbs { color: var(--muted); font-size: 14px; margin-bottom: 8px; overflow-wrap: anywhere; }

.folders, .documents { list-style: none; padding: 0; margin: 0; }
.folders li, .documents li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.locked { color: var(--muted); }
.folders .note { display: block; font-size: 14px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.toolbar .disabled { color: var(--muted); }
.toolbar form { margin: 0; }
.toolbar input[type="number"] { width: 64px; font: inherit; }
.zoom a { display: inline-block; padding: 0 6px; text-decoration: none; font-weight: 600; }

main:has(.canvas) { max-width: none; }
.canvas { overflow: auto; background: var(--line); padding: 12px; border-radius: 6px; }
.page {
  display: block;
  margin: 0 auto;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
.page.z50 { width: min(100%, 450px); }
.page.z75 { width: min(100%, 675px); }
.page.z100 { width: min(100%, 900px); }
.page.z125 { width: 1125px; max-width: none; }
.page.z150 { width: 1350px; max-width: none; }
.page.z200 { width: 1800px; max-width: none; }

.thumbs {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.thumbs img { width: 100%; height: auto; border: 1px solid var(--line); display: block; }
.thumbs span { display: block; text-align: center; color: var(--muted); font-size: 14px; }

.nda-pages { display: grid; gap: 16px; background: var(--line); padding: 12px; border-radius: 6px; margin-bottom: 24px; }
.nda-form { display: grid; gap: 14px; max-width: 560px; }
.nda-form label { display: grid; gap: 4px; font-weight: 600; }
.nda-form input[type="text"] { font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.nda-form .agree { grid-template-columns: auto 1fr; align-items: start; gap: 10px; font-weight: 400; }
.nda-form .agree input { margin-top: 5px; }
.nda-form button:disabled { opacity: 0.5; cursor: not-allowed; }
.error { padding: 8px 12px; border-radius: 6px; background: var(--warn-bg); color: var(--warn-fg); }
.accepted { padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line); }
.nda-form .optional { font-weight: 400; color: var(--muted); }
.nda-form fieldset { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin: 0; }
.nda-form legend { font-weight: 600; padding: 0 4px; }

main:has(.report) { max-width: 1200px; }
.status { font-size: 13px; font-weight: 400; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; margin-left: 6px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px 18px; border-bottom: 1px solid var(--line); margin-bottom: 16px; padding-bottom: 8px; }
.tabs a { text-decoration: none; }
.tabs a.current { font-weight: 600; color: var(--fg); }
.tabs .export { margin-left: auto; }
h2 { font-size: 18px; margin: 24px 0 8px; overflow-wrap: anywhere; }
.report { overflow-x: auto; margin-bottom: 12px; }
.report table { border-collapse: collapse; width: 100%; font-size: 14px; }
.report th, .report td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.report th { font-weight: 600; color: var(--muted); }
.report .num { text-align: right; font-variant-numeric: tabular-nums; }
.report tr.denied td { background: var(--warn-bg); color: var(--warn-fg); }
.report table.per-page { width: auto; }
