/* Invoice Desk
   Palette: cool paper + customs-stamp green. Type: Archivo, condensed for headings and data.
   One loud element: the quotation-number stamp. Everything else stays quiet. */

:root {
  --paper: #eef1ef;
  --surface: #ffffff;
  --sunk: #f6f8f7;
  --ink: #15201d;
  --ink-2: #56635f;
  --rule: #d3dad7;
  --stamp: #0b6e5b;
  --stamp-ink: #ffffff;
  --stamp-wash: #e1f0ec;
  --attention: #9a5b00;
  --attention-wash: #fbf0dc;
  --danger: #b42318;
  --focus: #1f5fd1;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --narrow: 82; /* wdth axis for headings and figures */
  --r-sm: 4px;
  --r-md: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111614;
    --surface: #181e1c;
    --sunk: #1d2421;
    --ink: #e5ebe8;
    --ink-2: #9aa8a3;
    --rule: #2d3734;
    --stamp: #3cb398;
    --stamp-ink: #0c1512;
    --stamp-wash: #183029;
    --attention: #e0a23a;
    --attention-wash: #2e2414;
    --danger: #f2766b;
    --focus: #7aa7ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111614;
  --surface: #181e1c;
  --sunk: #1d2421;
  --ink: #e5ebe8;
  --ink-2: #9aa8a3;
  --rule: #2d3734;
  --stamp: #3cb398;
  --stamp-ink: #0c1512;
  --stamp-wash: #183029;
  --attention: #e0a23a;
  --attention-wash: #2e2414;
  --danger: #f2766b;
  --focus: #7aa7ff;
  color-scheme: dark;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
}

h1,
h2,
legend {
  font-stretch: calc(var(--narrow) * 1%);
  font-variation-settings: "wdth" var(--narrow);
}

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

[hidden] {
  display: none !important;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ── buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font: 600 13px/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--ink-2);
}
.btn.primary {
  background: var(--stamp);
  border-color: var(--stamp);
  color: var(--stamp-ink);
}
.btn.primary:hover {
  filter: brightness(1.08);
}
.btn.danger {
  color: var(--danger);
}
.btn.danger:hover {
  border-color: var(--danger);
}
.btn.subtle {
  min-height: 28px;
  padding: 0 10px;
  background: transparent;
  font-weight: 500;
}
.btn:disabled {
  opacity: 0.5;
  cursor: progress;
}

.icon-btn {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--sunk);
  color: var(--danger);
}

/* ── top bar ──────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand strong {
  font-size: 16px;
  font-weight: 700;
  font-variation-settings: "wdth" 75;
}
.brand span {
  color: var(--ink-2);
  font-size: 12px;
}

.session {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.session-name {
  overflow: hidden;
  max-width: 260px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-counts {
  display: flex;
  gap: 12px;
  margin-right: auto;
  color: var(--ink-2);
}
.count.tone-done {
  color: var(--stamp);
}
.count.tone-attention {
  color: var(--attention);
}

.connection {
  margin-left: auto;
  padding: 6px 10px 6px 22px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  font: 12px var(--font);
  position: relative;
  cursor: pointer;
}
.connection::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--rule);
}
.connection.ok::before {
  background: var(--stamp);
}
.connection.bad {
  color: var(--danger);
}
.connection.bad::before {
  background: var(--danger);
}
.session:not([hidden]) + .connection {
  margin-left: 0;
}

/* ── main areas ───────────────────────────────────────────────────── */
.main {
  flex: 1;
  min-height: 0;
  display: flex;
}

.intake {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.intake-box {
  width: min(640px, 100%);
  padding: 48px;
  border: 1.5px dashed var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
}
.intake h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 650;
  font-variation-settings: "wdth" 75;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.intake p {
  max-width: 52ch;
  margin: 0 0 28px;
  color: var(--ink-2);
  font-size: 15px;
}
.intake-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}
.intake .btn.primary {
  min-height: 42px;
  padding: 0 20px;
  font-size: 14px;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  cursor: pointer;
}
.toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--stamp);
}

.drop-overlay {
  position: fixed;
  inset: 12px;
  z-index: 10;
  display: grid;
  place-items: center;
  border: 2px dashed var(--stamp);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  color: var(--stamp);
  font-size: 22px;
  font-weight: 650;
  pointer-events: none;
}

.desk {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 264px 1fr;
}

/* ── queue ────────────────────────────────────────────────────────── */
.queue {
  overflow-y: auto;
  border-right: 1px solid var(--rule);
  background: var(--surface);
}
.queue ol {
  margin: 0;
  padding: 6px;
  list-style: none;
}
.queue-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.queue-item:hover {
  background: var(--sunk);
}
.queue-item[aria-current="true"] {
  background: var(--sunk);
  border-left-color: var(--ink);
}
.queue-item img {
  width: 44px;
  height: 58px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #fff;
}
.queue-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.queue-title {
  display: flex;
  gap: 8px;
  font-weight: 600;
}
.queue-title span {
  overflow: hidden;
  color: var(--ink-2);
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-sub {
  color: var(--ink-2);
  font-size: 12px;
}
.queue-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 12px;
}
.tone-attention .queue-status {
  color: var(--attention);
  font-weight: 600;
}
.tone-busy .queue-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid var(--rule);
  border-top-color: var(--stamp);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.queue-index {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--sunk);
  color: var(--ink-2);
  font-weight: 650;
  font-variation-settings: "wdth" 75;
}

/* The stamp: the one bold element. A quotation number, boxed like ink on a manifest. */
.stamp {
  display: inline-block;
  padding: 1px 6px;
  border: 1.5px solid var(--stamp);
  border-radius: 3px;
  color: var(--stamp);
  font-size: 11px;
  font-weight: 700;
  font-variation-settings: "wdth" 75;
  letter-spacing: 0.04em;
  transform: rotate(-2deg);
}
.tone-done .queue-status {
  color: var(--stamp);
}
.tone-attention .stamp {
  border-color: var(--attention);
  color: var(--attention);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── review ───────────────────────────────────────────────────────── */
.review {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.review-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.review-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.1;
}
.review-head h2 span {
  color: var(--ink-2);
  font-weight: 400;
}
.review-status {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 13px;
}
.review-status.tone-done {
  color: var(--stamp);
}
.review-status.tone-attention {
  color: var(--attention);
  font-weight: 600;
}
.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.banners:empty {
  display: none;
}
.banners {
  padding: 12px 20px 0;
}
.banner {
  padding: 10px 14px;
  border-left: 3px solid var(--ink-2);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.banner ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
.banner li + li {
  margin-top: 2px;
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.review-meta {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 12px;
}

.banner + .banner {
  margin-top: 8px;
}
.banner p {
  margin: 0;
}
.banner.attention,
.banner.warn {
  border-left-color: var(--attention);
  background: var(--attention-wash);
}
.banner.ok {
  border-left-color: var(--stamp);
  background: var(--stamp-wash);
}
.banner-sub {
  margin-top: 4px !important;
  color: var(--ink-2);
  font-size: 13px;
}

.review-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 1.15fr);
}

.sheet {
  margin: 0;
  overflow: auto;
  padding: 20px;
  background: var(--paper);
}
.sheet-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.sheet img {
  display: block;
  width: 100%;
  border: 1px solid var(--rule);
  background: #fff;
  box-shadow: 0 1px 0 var(--rule), 0 8px 24px -16px rgb(0 0 0 / 0.35);
}
.sheet.zoomed .sheet-zoom {
  width: auto;
  cursor: zoom-out;
}
.sheet.zoomed img {
  width: auto;
  max-width: none;
}

/* Excel block preview: looks like the spreadsheet, real row numbers and column letters. */
.sheet-xls {
  padding: 16px;
}
.review-body:has(.sheet-xls) {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
}
table.xls {
  border-collapse: collapse;
  background: var(--surface);
  font-size: 12px;
  font-variation-settings: "wdth" 87;
}
.xls th,
.xls td {
  padding: 4px 6px;
  border: 1px solid var(--rule);
  white-space: nowrap;
  text-align: left;
}
.xls thead th,
.xls tbody th {
  background: var(--sunk);
  color: var(--ink-2);
  font-weight: 500;
  text-align: center;
}
.xls td {
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xls td.n {
  text-align: right;
}
.xls tr.flagged td,
.xls tr.flagged th {
  background: var(--attention-wash);
  color: var(--attention);
  font-weight: 600;
}

.order {
  min-width: 0;
  overflow-y: auto;
  padding: 20px 24px 40px;
  border-left: 1px solid var(--rule);
  background: var(--surface);
}
.order.empty {
  display: grid;
  place-items: center;
  color: var(--ink-2);
  text-align: center;
}
.order.empty p {
  max-width: 36ch;
}

fieldset {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  min-width: 0;
}
legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 15px;
  font-weight: 650;
}

.grid-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.grid-fields legend {
  grid-column: 1 / -1;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field.wide {
  grid-column: 1 / -1;
}
.field > span {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}
.field small {
  color: var(--ink-2);
  font-size: 11px;
}

input[type="text"],
select,
textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--sunk);
  color: var(--ink);
  font: inherit;
}
input[type="text"]:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  background: var(--surface);
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 25%, transparent);
}
input[aria-invalid="true"] {
  border-color: var(--danger);
}
.num,
input.num {
  text-align: right;
}

.table-wrap {
  position: relative; /* contains the .sr header labels inside the scroller */
  overflow-x: auto;
  margin: 0 -4px 8px;
}
table.lines {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  table-layout: fixed;
}
/* column widths: description takes what's left */
.lines th:nth-child(2) {
  width: 138px;
}
.lines:not(.charges) th:nth-child(3),
.lines:not(.charges) th:nth-child(4) {
  width: 76px;
}
.lines:not(.charges) th:nth-child(5) {
  width: 84px;
}
.lines.charges th:nth-child(3) {
  width: 100px;
}
.lines th {
  padding: 0 4px 6px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.lines th.num {
  text-align: right;
}
.lines td {
  padding: 5px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 55%, transparent);
  vertical-align: middle;
}
.lines td.num {
  padding-right: 8px;
  white-space: nowrap;
  font-weight: 600;
}
.lines td:last-child,
.lines th:last-child {
  width: 32px;
  padding-right: 0;
}
.lines select {
  padding-right: 4px;
  text-overflow: ellipsis;
}
.lines td.none {
  padding: 12px 4px;
  color: var(--ink-2);
}

.totals {
  margin: 4px 0 24px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--sunk);
}
.totals dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 8px;
}
.totals dt {
  color: var(--ink-2);
  font-size: 12px;
}
.totals dd {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  font-variation-settings: "wdth" var(--narrow);
}
.verdict {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
}
.verdict.ok {
  color: var(--stamp);
}
.verdict.attention {
  color: var(--attention);
  font-weight: 600;
}

.remarks {
  margin: 0 0 20px;
  color: var(--ink-2);
}

.raw summary {
  color: var(--ink-2);
  cursor: pointer;
}
.raw textarea {
  margin-top: 10px;
  font: 12px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
  resize: vertical;
}
.raw-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.raw-msg {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

/* ── responsive ───────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .review-body {
    display: block;
    overflow-y: auto;
  }
  .sheet {
    max-height: 60vh;
  }
  .order {
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 760px) {
  body {
    height: auto;
  }
  .topbar {
    flex-wrap: wrap;
    padding: 10px 16px;
  }
  .session {
    order: 3;
    flex-basis: 100%;
    flex-wrap: wrap;
  }
  .desk {
    display: block;
  }
  .queue {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .queue ol {
    display: flex;
    overflow-x: auto;
    gap: 4px;
  }
  .queue li {
    flex: 0 0 210px;
  }
  .review-head,
  .banners {
    padding-left: 16px;
    padding-right: 16px;
  }
  .sheet,
  .order {
    padding: 16px;
  }
  .grid-fields,
  .totals dl {
    grid-template-columns: 1fr;
  }
  .intake-box {
    padding: 28px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tone-busy .queue-status::before {
    animation: none;
  }
}

/* ── app shell: navigation, user, pages ───────────────────────────── */
body.booting .main,
body.booting .topbar > :not(.brand) {
  visibility: hidden;
}
a.brand {
  color: inherit;
  text-decoration: none;
}
.nav {
  display: flex;
  gap: 2px;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
}
.nav a:hover {
  background: var(--sunk);
  color: var(--ink);
}
.nav a[aria-current] {
  background: var(--sunk);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink);
}
.badge {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 9px;
  background: var(--attention);
  color: var(--surface);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 13px;
}
.session:not([hidden]) ~ .connection {
  margin-left: 0;
}
a.session-name {
  color: inherit;
  text-decoration: none;
}
a.session-name:hover {
  text-decoration: underline;
}

.view-desk {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
}
.view-page {
  flex: 1;
  overflow-y: auto;
}
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}
.page.narrow {
  max-width: 760px;
}
.page h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 650;
  font-variation-settings: "wdth" 75;
  line-height: 1.1;
}
.page-lead {
  max-width: 70ch;
  margin: 0 0 20px;
  color: var(--ink-2);
}
.page-loading,
.empty-note {
  padding: 28px 24px;
  color: var(--ink-2);
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
}
.page-head p {
  margin: 0;
}
.crumbs {
  margin: 0 0 8px;
  color: var(--ink-2);
  font-size: 13px;
}
.crumbs a {
  color: inherit;
}
.section-title {
  margin: 32px 0 4px;
  font-size: 18px;
  font-weight: 650;
  font-variation-settings: "wdth" var(--narrow);
}
.muted {
  color: var(--ink-2);
  font-size: 12px;
}
.why {
  max-width: 48ch;
  color: var(--attention);
  font-size: 12px;
}
.warn-text {
  color: var(--attention) !important;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--stamp);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* data tables on pages */
table.grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}
.grid th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
}
.grid td {
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent);
  vertical-align: top;
}
.grid tr:last-child td {
  border-bottom: 0;
}
.grid .num {
  text-align: right;
  white-space: nowrap;
}
.grid a {
  color: inherit;
}
.grid.files tr.has-open td:first-child {
  box-shadow: inset 3px 0 0 var(--attention);
}
.grid.invoices tbody tr {
  cursor: pointer;
}
.grid.invoices tbody tr:hover,
.grid.invoices tbody tr.selected {
  background: var(--sunk);
}
.grid.invoices tbody tr.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--ink);
}
.grid .stamp {
  text-decoration: none;
}
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--sunk);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill.tone-done {
  background: var(--stamp-wash);
  color: var(--stamp);
}
.pill.tone-attention {
  background: var(--attention-wash);
  color: var(--attention);
}

/* alerts grouped by file */
.alert-file {
  margin-bottom: 24px;
}
.alert-file > header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 8px;
}
.alert-file h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  font-variation-settings: "wdth" var(--narrow);
}
.alert-file header p {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 12px;
}

/* activity log */
.timeline {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--rule);
}
.timeline .ev {
  position: relative;
  display: grid;
  grid-template-columns: 170px 100px 1fr;
  gap: 4px 12px;
  padding: 8px 0 8px 16px;
}
.timeline .ev::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule);
}
.timeline .ev-quotation::before {
  background: var(--stamp);
}
.timeline .ev-bad::before {
  background: var(--attention);
}
.timeline .ev-bad p {
  color: var(--attention);
}
.timeline time,
.ev-actor {
  color: var(--ink-2);
  font-size: 12px;
  padding-top: 2px;
}
.ev-actor {
  font-weight: 600;
}
.timeline p {
  margin: 0;
}

/* settings */
.settings fieldset {
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
}
.settings legend {
  padding: 0 6px;
  margin-left: -6px;
}
.settings fieldset > .muted {
  margin: -4px 0 14px;
}
.setting + .setting {
  margin-top: 14px;
}
.settings-actions {
  display: flex;
  gap: 8px;
}
.settings-status {
  margin-top: 14px;
}
.settings-status p {
  margin: 4px 0;
}

/* login */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 16px;
}
.login {
  width: min(380px, 100%);
}
.login-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px 28px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
}
.login-card h1 {
  margin: 12px 0 0;
  font-size: 26px;
  font-weight: 650;
  font-variation-settings: "wdth" 75;
}
.login-card input {
  width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--sunk);
  color: var(--ink);
  font: inherit;
}
.login-card .btn.primary {
  justify-content: center;
  min-height: 40px;
}
.login-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}
input[type="password"] {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--sunk);
  color: var(--ink);
  font: inherit;
}

@media (max-width: 900px) {
  .nav a {
    padding: 6px 8px;
  }
  .user span {
    display: none;
  }
  .timeline .ev {
    grid-template-columns: 1fr;
  }
  .grid {
    display: block;
    overflow-x: auto;
  }
}
@media (max-width: 760px) {
  .nav {
    order: 2;
    flex-basis: 100%;
  }
  .page {
    padding: 20px 16px 48px;
  }
}
