@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');

html{
  --saltbox-body-filter:none;
  --saltbox-shell-width:min(1180px,calc(100% - 64px));
  --saltbox-copy-size:15px;
  --saltbox-copy-line:1.8;
  --saltbox-doc-line:1.9;
  --saltbox-entry-line:1.92;
  --saltbox-density-gap:28px;
}

html.pref-contrast-elevated{
  --saltbox-body-filter:contrast(1.06);
}

html.pref-color-inversion{
  --saltbox-body-filter:none;
  --red:#d8a89b;
  --red-hi:#efc6b8;
  --red-lo:#241a17;
  --off:#13120f;
  --sheet:#181612;
  --border:#2b2823;
  --border-strong:#3c3932;
  --muted:#c3baad;
  --label:#9b9184;
  --text:#f5efe4;
  --bg:#0d0d0b;
}

html.pref-color-inversion.pref-contrast-elevated{
  --saltbox-body-filter:contrast(1.06);
}

html.pref-text-large{
  --saltbox-copy-size:17px;
  --saltbox-doc-line:2;
  --saltbox-entry-line:2;
}

html.pref-line-relaxed{
  --saltbox-copy-line:1.96;
  --saltbox-doc-line:2.04;
  --saltbox-entry-line:2.08;
}

html.pref-longform{
  --saltbox-copy-line:2.06;
  --saltbox-doc-line:2.16;
  --saltbox-entry-line:2.14;
}

html.pref-reading-wide{
  --saltbox-shell-width:min(1360px,calc(100% - 64px));
}

html.pref-density-spacious{
  --saltbox-density-gap:36px;
}

body{
  filter:var(--saltbox-body-filter);
  transform-origin:center top;
}

html.pref-color-inversion body{
  background:var(--bg);
  color:var(--text);
}

html.pref-color-inversion body::before{
  background:
    repeating-linear-gradient(to bottom,rgba(255,255,255,0.016) 0 1px,transparent 1px 3px),
    radial-gradient(circle at 12% 16%,rgba(255,255,255,0.018),transparent 34%),
    radial-gradient(circle at 85% 80%,rgba(216,168,155,0.024),transparent 38%);
  opacity:0.14;
  mix-blend-mode:screen;
}

html.pref-color-inversion body::after{
  background:
    radial-gradient(circle at 1px 1px,rgba(255,255,255,0.04) 0 0.8px,transparent 0.9px),
    linear-gradient(90deg,transparent 0,rgba(255,255,255,0.04) 50%,transparent 100%);
  opacity:0.05;
}

html.pref-reduced-motion *,
html.pref-reduced-motion *::before,
html.pref-reduced-motion *::after{
  animation-duration:0.001ms !important;
  animation-iteration-count:1 !important;
  transition-duration:0.001ms !important;
  scroll-behavior:auto !important;
}

html.pref-font-dyslexia body,
html.pref-font-dyslexia input,
html.pref-font-dyslexia button,
html.pref-font-dyslexia select,
html.pref-font-dyslexia textarea{
  font-family:'Atkinson Hyperlegible','Inter',sans-serif !important;
}

html.pref-font-dyslexia .font-report,
html.pref-font-dyslexia .archive-column.font-report,
html.pref-font-dyslexia .archive-block-text.font-report,
html.pref-font-dyslexia .pastore-response-text,
html.pref-font-dyslexia .page-title,
html.pref-font-dyslexia .title,
html.pref-font-dyslexia .funes-title,
html.pref-font-dyslexia .funes-work-title{
  font-family:'Atkinson Hyperlegible','Inter',sans-serif !important;
  letter-spacing:0 !important;
}

.shell-main{
  width:var(--saltbox-shell-width);
}

.page-grid,
.page-hero,
.page-section,
.page-card,
.dash-grid,
.dash-stack,
.record-stat-grid,
.entry-blocks{
  gap:var(--saltbox-density-gap);
}

.page-dek,
.section-copy,
.aside-copy,
.text-stack p,
.page-doc p,
.faq-answer p,
.dek,
.record-hero-note,
.dash-note,
.vault-info-copy,
.page-card p,
.route-block p,
.settings-row-copy{
  font-size:var(--saltbox-copy-size);
  line-height:var(--saltbox-copy-line);
}

.archive-block-text,
.archive-fieldlog-body,
.archive-column,
.archive-quote-copy{
  line-height:var(--saltbox-entry-line);
}

.archive-column.font-report,
.archive-block-text.font-report{
  font-size:calc(24px + (var(--saltbox-copy-size) - 15px) * 0.65);
}

.pastore-response-text{
  line-height:var(--saltbox-doc-line);
  font-size:calc(10.5px + (var(--saltbox-copy-size) - 15px) * 0.18);
}

html.pref-reading-wide .page-dek,
html.pref-reading-wide .text-stack,
html.pref-reading-wide .page-doc,
html.pref-reading-wide .faq-item,
html.pref-reading-wide .dash-list,
html.pref-reading-wide .settings-panel{
  max-width:none;
}

.saltbox-sensitive-media{
  position:relative;
  overflow:hidden;
}

.saltbox-sensitive-toggle{
  position:absolute;
  right:14px;
  bottom:14px;
  z-index:2;
  min-height:34px;
  padding:0 14px;
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(8,8,8,0.58);
  color:#f6efe2;
  font-family:'IBM Plex Mono',monospace;
  font-size:9px;
  letter-spacing:2px;
  text-transform:uppercase;
  cursor:pointer;
  backdrop-filter:blur(8px);
}

.saltbox-sensitive-media.is-protected img,
.saltbox-sensitive-media.is-protected video{
  filter:blur(24px) saturate(0.58);
  transform:scale(1.015);
  transition:filter 0.22s ease,transform 0.22s ease;
}

.saltbox-sensitive-media:not(.is-protected) .saltbox-sensitive-toggle[hidden]{
  display:none;
}

html.pref-color-inversion .site-header,
html.pref-color-inversion #main > header{
  background:rgba(15,14,12,0.96);
  border-bottom-color:var(--border);
}

html.pref-color-inversion .nav-menu{
  background:rgba(19,18,15,0.98);
  border-color:var(--border);
  box-shadow:0 12px 32px rgba(0,0,0,0.32);
}

html.pref-color-inversion .hero-aside,
html.pref-color-inversion .page-card,
html.pref-color-inversion .page-panel,
html.pref-color-inversion .page-doc,
html.pref-color-inversion .dept-card,
html.pref-color-inversion .faq-item,
html.pref-color-inversion .note-card,
html.pref-color-inversion .data-table,
html.pref-color-inversion .dash-stat,
html.pref-color-inversion .dash-item,
html.pref-color-inversion .record-stat-card,
html.pref-color-inversion .dash-balance,
html.pref-color-inversion .record-editor-panel,
html.pref-color-inversion .record-editor-sidebar,
html.pref-color-inversion .modal,
html.pref-color-inversion .modal-entry-workspace{
  background:rgba(18,17,14,0.9) !important;
  border-color:var(--border) !important;
}

html.pref-color-inversion .hero-aside{
  background:linear-gradient(180deg,rgba(20,19,16,0.96),rgba(14,13,11,0.88)) !important;
}

html.pref-color-inversion .note-card.is-pastore-note{
  background:linear-gradient(180deg,rgba(54,33,28,0.98),rgba(31,21,18,0.94)) !important;
  border-color:rgba(216,168,155,0.24) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.03);
}

html.pref-color-inversion .note-card.is-pastore-note .section-label{
  color:#f0c6b8;
}

html.pref-color-inversion .shell-account-link,
html.pref-color-inversion .shell-account-btn,
html.pref-color-inversion .shell-account-portal,
html.pref-color-inversion .shell-account-gear,
html.pref-color-inversion .shell-account-badge,
html.pref-color-inversion .head-account-link,
html.pref-color-inversion .head-account-btn,
html.pref-color-inversion .head-account-portal,
html.pref-color-inversion .head-account-gear,
html.pref-color-inversion .head-account-badge,
html.pref-color-inversion .settings-control,
html.pref-color-inversion .settings-action-btn,
html.pref-color-inversion .btn-submit{
  background:rgba(17,16,14,0.92) !important;
  color:var(--text) !important;
  border-color:var(--border) !important;
}

html.pref-color-inversion .shell-account-portal,
html.pref-color-inversion .head-account-portal{
  color:var(--red) !important;
  border-color:rgba(216,168,155,0.24) !important;
}

html.pref-color-inversion #main{
  background:var(--bg);
  color:var(--text);
}

html.pref-color-inversion #intro{
  background:var(--bg);
}

html.pref-color-inversion #main::before{
  background:
    repeating-linear-gradient(to bottom,rgba(255,255,255,0.016) 0 1px,transparent 1px 3px),
    radial-gradient(circle at 16% 12%,rgba(255,255,255,0.018),transparent 34%),
    radial-gradient(circle at 84% 88%,rgba(216,168,155,0.024),transparent 38%);
  opacity:0.16;
  mix-blend-mode:screen;
}

html.pref-color-inversion #main::after{
  background:
    radial-gradient(circle at 1px 1px,rgba(255,255,255,0.04) 0 0.8px,transparent 0.9px),
    linear-gradient(90deg,transparent 0,rgba(255,255,255,0.05) 49%,transparent 100%);
  opacity:0.05;
}

html.pref-color-inversion .notice{
  background:#2a1b18;
  border-bottom-color:rgba(216,168,155,0.2);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.02);
}

html.pref-color-inversion .ntag{
  color:#f0c6b8;
}

html.pref-color-inversion .ntext{
  color:#e7d8ca;
}

html.pref-color-inversion .vault-strip-btn,
html.pref-color-inversion .yield-ledger,
html.pref-color-inversion .entry-econ-btn,
html.pref-color-inversion .status-chip.is-extracted,
html.pref-color-inversion .community-pill.extracted{
  background:#f4ede2 !important;
  color:#15120f !important;
  border-color:#d6cabd !important;
}

html.pref-color-inversion body.vault-body{
  background:#f4ede2;
  color:#171310;
}

html.pref-color-inversion .vault-page::before{
  border-color:rgba(0,0,0,0.08);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,0.45);
}

html.pref-color-inversion .vault-page::after{
  background:linear-gradient(90deg,transparent 0%,rgba(0,0,0,0.1) 18%,rgba(0,0,0,0.04) 82%,transparent 100%);
}

html.pref-color-inversion .vault-exit,
html.pref-color-inversion .vault-line,
html.pref-color-inversion .vault-response{
  color:rgba(23,19,16,0.72);
}

html.pref-color-inversion .vault-session-note{
  color:rgba(23,19,16,0.2);
}

html.pref-color-inversion .vault-input{
  background:rgba(255,255,255,0.72);
  border-color:rgba(0,0,0,0.14);
  color:#171310;
  caret-color:#171310;
}

html.pref-color-inversion .vault-input:focus{
  border-color:rgba(0,0,0,0.22);
  background:rgba(255,255,255,0.88);
  box-shadow:0 0 0 1px rgba(0,0,0,0.04);
}

html.pref-color-inversion .vault-submit{
  border-color:rgba(0,0,0,0.14);
  background:rgba(0,0,0,0.02);
  color:#171310;
}

html.pref-color-inversion .vault-submit:hover{
  border-color:rgba(0,0,0,0.22);
  background:rgba(0,0,0,0.06);
}

html.pref-color-inversion .vault-logo,
html.pref-color-inversion .vault-watermark{
  filter:none !important;
}

.pastore-sheet-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:0 10px;
  border:1px solid rgba(24,20,17,0.12);
  background:rgba(255,255,255,0.52);
  color:#857c70;
  font-family:'IBM Plex Mono',monospace;
  font-size:8px;
  letter-spacing:1.8px;
  text-transform:uppercase;
  cursor:pointer;
}

.pastore-sheet-toggle:hover{
  border-color:rgba(24,20,17,0.22);
  color:#161310;
}

.pastore-sheet-body{
  position:relative;
}

.pastore-sheet.is-collapsed{
  min-height:auto !important;
}

.pastore-sheet.is-collapsed .pastore-sheet-header{
  margin-bottom:0;
  padding-bottom:0;
  border-bottom:none;
}

.pastore-sheet.is-collapsed .pastore-sheet-body{
  display:none;
}

.settings-panel{
  display:grid;
  gap:18px;
}

.settings-group{
  display:grid;
  gap:16px;
}

.settings-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(180px,220px);
  gap:18px;
  align-items:start;
  padding:16px 0;
  border-top:1px solid var(--border);
}

.settings-row:first-child{
  border-top:none;
  padding-top:0;
}

.settings-row-head{
  display:grid;
  gap:6px;
}

.settings-row-title{
  font-size:15px;
  font-weight:600;
  color:var(--text);
}

.settings-row-copy{
  margin:0;
  color:var(--muted);
}

.settings-control{
  width:100%;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  font-family:'IBM Plex Mono',monospace;
  font-size:11px;
  letter-spacing:1.2px;
  text-transform:uppercase;
  padding:12px 13px;
}

.settings-status{
  min-height:20px;
  font-family:'IBM Plex Mono',monospace;
  font-size:9px;
  letter-spacing:1.7px;
  text-transform:uppercase;
  color:var(--muted);
}

.settings-status.is-saved{
  color:var(--red);
}

.settings-action-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.settings-action-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:0 14px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  text-decoration:none;
  font-family:'IBM Plex Mono',monospace;
  font-size:10px;
  letter-spacing:1.8px;
  text-transform:uppercase;
  cursor:pointer;
}

.settings-action-btn:hover{
  border-color:var(--border-strong);
}

.settings-action-btn.is-dark{
  background:#12110f;
  border-color:#12110f;
  color:#f8f4ec;
}

.settings-local-note{
  margin-top:4px;
  color:var(--muted);
}

@media (max-width: 840px){
  .settings-row{
    grid-template-columns:1fr;
  }

  .settings-control{
    max-width:none;
  }
}
