@font-face {
  font-family: "Instrument Sans";
  src: url("brand/InstrumentSans-Variable-Latin.e35fad09c70b.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("brand/IBMPlexMono-Regular-Latin.ce5d303b9bab.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f4f1e9;
  --ink: #171815;
  --surface: #fbf9f3;
  --muted: #5e6057;
  --line: #d9d5c9;
  --edge: #918f82;
  --soft: #ebe8dd;
  --accent: #3a4b37;
  --accent-soft: #e2e6d9;
  --attention: #7e3b22;
  --attention-soft: #f0e0d1;
  --sidebar: 13.25rem;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--sans); }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .68; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.9rem, 1.55rem + 1.3vw, 2.7rem); font-weight: 650; letter-spacing: -.035em; line-height: 1.1; }
h2 { font-size: 1.2rem; font-weight: 620; letter-spacing: -.017em; line-height: 1.28; }
h3 { font-size: 1rem; }
p + p { margin-top: .7rem; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 1rem; left: 1rem; z-index: 5; padding: .6rem 1rem; background: var(--surface); }
.symbol-bank { position: absolute; width: 0; height: 0; overflow: hidden; }
.data { font: 400 .875rem/1.5 var(--mono); font-variant-numeric: tabular-nums; }
.muted, .secondary, .empty { color: var(--muted); }
.secondary { display: block; margin-top: .15rem; font-size: .875rem; }
.attention { color: var(--attention); }
.plain { color: var(--muted); background: none; border: 0; padding: .45rem 0; font-size: .9rem; text-decoration: underline; text-decoration-color: var(--edge); text-underline-offset: .2em; }
.plain:hover { color: var(--ink); }
.reading-width, .prose { max-width: 67ch; }
.prose { margin-top: 1.6rem; overflow-wrap: anywhere; }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar); display: flex; flex-direction: column;
  padding: 2.45rem 1.25rem 1.55rem;
  border-right: 1px solid var(--line);
}
.desktop-brand { display: flex; align-items: center; min-height: 2.5rem; margin: 0 0 2.35rem .55rem; }
.desktop-brand img { display: block; }
.primary-nav { display: grid; gap: .25rem; }
.primary-nav a {
  display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem;
  min-height: 2.75rem; border-radius: .375rem; color: var(--muted);
  font-weight: 560; text-decoration: none;
}
.primary-nav a:hover, .primary-nav a[aria-current] { background: var(--soft); color: var(--ink); }
.primary-nav svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.desktop-signout { margin: auto 0 0 .7rem; }
.mobile-header { display: none; }
.workspace { max-width: calc(65rem + var(--sidebar)); margin-left: var(--sidebar); padding: 2.6rem clamp(1.5rem, 5vw, 4.8rem) 4rem; }
.today-date { margin-bottom: 2rem; color: var(--muted); font: .9rem/1.4 var(--mono); }
.agenda + .agenda { margin-top: 2.35rem; }
.section-head, .toolbar, .detail-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; flex-wrap: wrap;
}
.section-head { min-height: 2.25rem; margin-bottom: .45rem; }
.detail-head { margin-bottom: 1.2rem; align-items: start; }
.detail-section { margin-top: 1.9rem; }
.detail-section > h2, .detail-section > h3 { margin-bottom: .6rem; }
.action-group, .form-actions, .metadata, .row-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .85rem;
}
.form-actions { margin-top: 1.5rem; }
.metadata { color: var(--muted); font-size: .9rem; }
.row-meta { justify-content: end; }
.toolbar { margin-bottom: .9rem; }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows > li { border-bottom: 1px solid var(--line); }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .7rem .15rem; min-height: 3.1rem; text-decoration: none; color: var(--ink);
  overflow-wrap: anywhere;
}
.row > * { min-width: 0; }
a.row:hover, a.row[aria-current] { background: var(--soft); }
.row strong { font-weight: 610; }
.empty { padding: .75rem .15rem; font-size: .95rem; }
.pill {
  display: inline-block; padding: .12rem .52rem; border-radius: 1rem;
  background: var(--accent-soft); color: var(--accent); font-size: .83rem; line-height: 1.55;
}
.pill.attention { color: var(--attention); background: var(--attention-soft); }
.tabs { display: flex; flex-wrap: wrap; column-gap: 1.65rem; border-bottom: 1px solid var(--line); margin-bottom: 1.35rem; }
.tabs a {
  padding: .3rem .03rem .68rem; color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent; font-weight: 560;
}
.tabs a[aria-current], .tabs a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.filters a { padding: .16rem .55rem; border-radius: .3rem; text-decoration: none; color: var(--muted); }
.filters a[aria-current], .filters a:hover { background: var(--soft); color: var(--ink); }
.search { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.search input { width: min(13rem, 100%); }
.button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 2.65rem;
  max-width: 100%; padding: .46rem .82rem; border: 1px solid transparent; border-radius: .38rem;
  font-weight: 600; font-size: .94rem; line-height: 1.3; text-decoration: none; text-align: center;
}
.primary { background: var(--ink); color: var(--surface); }
.primary:hover { background: var(--accent); }
.subtle { background: transparent; color: var(--ink); border-color: var(--edge); }
.subtle:hover { background: var(--soft); }
.full-width { width: 100%; }
.related-link { display: inline-block; margin-top: .75rem; }
.pagination { display: flex; align-items: center; gap: .8rem; margin-top: 1.2rem; }

.form-column { max-width: 43rem; }
.form-column h1 { margin-bottom: 1.5rem; }
.field { margin-bottom: .9rem; min-width: 0; }
.field label, .field legend { display: block; font-size: .94rem; font-weight: 600; margin-bottom: .22rem; }
.field fieldset, fieldset.field { border: 0; padding: 0; }
.field [type="checkbox"] { margin-right: .35rem; }
.field-help { margin-top: .23rem; font-size: .875rem; color: var(--muted); }
input:not([type="checkbox"], [type="radio"]), textarea, select {
  width: 100%; min-width: 0; min-height: 2.65rem; border: 1px solid var(--edge);
  border-radius: .35rem; background: var(--surface); padding: .48rem .65rem; color: var(--ink);
}
.search input { width: min(14rem, 34vw); }
textarea { resize: vertical; min-height: 5.5rem; }
input[disabled], select[disabled] { color: var(--muted); background: var(--soft); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
.errorlist { color: var(--attention); font-size: .88rem; padding-left: 1.25rem; margin: .35rem 0 .75rem; }
.notice-stack { margin-bottom: 1rem; }
.notice { padding: .65rem .85rem; border-left: 2px solid var(--accent); background: var(--accent-soft); margin-bottom: .4rem; }
.notice.error { border-color: var(--attention); background: var(--attention-soft); color: var(--attention); }
.details { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: .42rem 1rem; margin: 1.25rem 0; }
.details:empty { display: none; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr)); gap: .75rem; margin: 1.3rem 0; }
.metrics > div { padding: .85rem .9rem; border-top: 1px solid var(--line); background: var(--surface); }
.metrics dt { font-size: .9rem; color: var(--muted); }
.metrics dd { font: 400 1.65rem/1.2 var(--mono); margin: .35rem 0; }
.metrics small { font-size: .92rem; }
.history article { border-bottom: 1px solid var(--line); padding: .7rem 0; }
.history article p { margin-top: .3rem; }
.line-fields { border: 1px solid var(--line); border-radius: .38rem; padding: .65rem; margin: .7rem 0; min-width: 0; }
.line-fields legend { padding: 0 .3rem; color: var(--muted); font-size: .9rem; }
.line-grid { display: grid; grid-template-columns: 1fr 1fr 6rem; gap: .65rem; }
.checkline { color: var(--muted); font-size: .9rem; }
.payload { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1rem; background: var(--surface); border: 1px solid var(--line); font: .95rem/1.55 var(--sans); }
.image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 13rem)); gap: .9rem; margin-top: .7rem; }
.image-grid figure { margin: 0; min-width: 0; }
.image-grid img { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: contain; background: var(--soft); }
.image-grid figcaption { font-size: .86rem; color: var(--muted); margin-top: .3rem; overflow-wrap: anywhere; }
.guest .workspace { display: grid; place-content: center; min-height: 87svh; margin: 0 auto; padding: 1.5rem; }
.guest .workspace .notice-stack { width: min(24rem, calc(100vw - 3rem)); }
.auth-panel { width: min(24rem, calc(100vw - 3rem)); }
.auth-panel h1 { margin: 1.8rem 0 1.15rem; }
.auth-panel p { margin-bottom: 1.05rem; }
.auth-panel button { margin-top: .35rem; }
.auth-logo { display: block; }

@media (max-width: 48rem) {
  .sidebar { position: static; width: auto; border: 0; padding: 0; }
  .desktop-brand, .desktop-signout { display: none; }
  .mobile-header {
    display: flex; justify-content: space-between; align-items: center;
    height: 3.6rem; margin: 0 1.05rem; border-bottom: 1px solid var(--line);
  }
  .mobile-header img { display: block; }
  .primary-nav {
    z-index: 3; position: fixed; inset: auto 0 0;
    grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .2rem;
    padding: .3rem .3rem max(.3rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
    background: var(--paper);
  }
  .primary-nav a {
    display: flex; flex-direction: column; gap: .08rem; justify-content: center;
    padding: .23rem .1rem; min-height: 3.05rem; font-size: .8rem;
  }
  .workspace { margin-left: 0; padding: 1.25rem 1.05rem calc(5rem + env(safe-area-inset-bottom)); }
  .today-date { margin-bottom: 1.45rem; }
  .agenda + .agenda { margin-top: 1.65rem; }
  .tabs { column-gap: 1.25rem; margin-bottom: .95rem; }
  .tabs a { min-height: 2.6rem; }
  .row { padding-block: .65rem; }
  .row-meta { gap: .3rem .45rem; }
}

@media (max-width: 28rem) {
  .toolbar .search { order: 1; width: 100%; flex-wrap: nowrap; }
  .search input { width: 100%; }
  .search button, .search a { flex-shrink: 0; }
  .metadata:empty { display: none; }
  .details { grid-template-columns: minmax(0, 6.2rem) minmax(0, 1fr); }
  .line-grid { grid-template-columns: 1fr; gap: 0; }
  .section-head { column-gap: .45rem; }
}
