/* The evidence vocabulary and the shared controls.
   These look the same on the landing page, in the app, in email. See principles section 8. */

/* ---- Buttons: slide-fill, like a stamp coming down ---- */
.btn {
  --b-bg: transparent; --b-fg: currentColor; --b-line: currentColor; --b-fill: currentColor; --b-fill-fg: var(--ink);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: var(--s3);
  min-height: 52px; padding: 0 var(--s6);
  font: 600 .9375rem/1 var(--f-ui); letter-spacing: .01em; text-decoration: none;
  color: var(--b-fg); background: var(--b-bg);
  border: 1px solid var(--b-line); border-radius: var(--radius);
  transition: color var(--t-base) var(--ease-out);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--b-fill); transform: translateX(-101%);
  transition: transform var(--t-base) var(--ease-out);
}
.btn:hover, .btn:focus-visible { color: var(--b-fill-fg); }
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn .arr { transition: transform var(--t-base) var(--ease-out); }
.btn:hover .arr { transform: translateX(4px); }

.btn--brass { --b-bg: var(--brass); --b-fg: var(--ink); --b-line: var(--brass); --b-fill: var(--paper); --b-fill-fg: var(--ink); }
.btn--ghost-room { --b-fg: var(--paper); --b-line: var(--rule-dark); --b-fill: var(--paper); --b-fill-fg: var(--ink); }
.btn--ink { --b-bg: var(--ink); --b-fg: var(--paper); --b-line: var(--ink); --b-fill: var(--room); --b-fill-fg: var(--paper); }

/* ---- Citation chip [n] ---- */
.cite {
  display: inline-block; vertical-align: .32em; margin: 0 .12em;
  min-width: 1.75em; padding: 0 .38em;
  position: relative; font: 500 .8rem/1.6 var(--f-mono); text-align: center; text-decoration: none;
  color: var(--cited); background: transparent;
  border: 1px solid var(--cited); border-radius: 2px;
  transition: background var(--t-fast) ease, color var(--t-fast) ease;
}
button.cite { cursor: pointer; }
/* Touch target: the chip looks small, the tappable area is not. */
.cite::after { content: ""; position: absolute; inset: -12px -5px; }
.cite:hover, .cite:focus-visible, .cite[aria-expanded="true"] { background: var(--cited); color: var(--paper); }

/* Unconfirmed: still clickable, visibly not verified. */
.cite--unconfirmed { color: var(--inference); border-color: var(--inference); border-style: dashed; text-decoration: underline wavy 1px; text-underline-offset: 3px; }

/* ---- Inference and hypothesis tags ---- */
.tag {
  display: inline-block; vertical-align: .18em; margin-left: .35em;
  font: 600 .75rem/1.6 var(--f-ui); letter-spacing: .1em; text-transform: uppercase;
  padding: 0 .5em; border-radius: 2px; border: 1px solid currentColor;
}
.tag--inference { color: var(--inference); }
.tag--hypothesis { color: var(--hypothesis); }
.is-inference { border-left: 2px solid var(--inference); padding-left: var(--s4); }
.is-hypothesis { border-left: 2px dotted var(--hypothesis); padding-left: var(--s4); }

/* ---- Silent notice ---- */
.silent {
  border-left: 3px solid var(--silent); padding: var(--s1) 0 var(--s1) var(--s4);
}
.silent strong {
  display: block; font: italic 500 1.25rem/1.3 var(--f-display); color: var(--silent);
}
.silent > span { display: block; margin-top: var(--s1); font-size: var(--fs-small); color: var(--ink-dim); }

/* ---- Receipt line ---- */
.receipt {
  display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4);
  font: 400 .78rem/1.6 var(--f-mono); font-variant-numeric: tabular-nums;
}
.receipt b { font-weight: 500; }
.receipt .sep { opacity: .45; }

/* ---- Source sheet (the viewer) ---- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(8, 20, 18, .62);
  opacity: 0; pointer-events: none; transition: opacity var(--t-base) ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 100; top: 0; right: 0; bottom: 0;
  width: min(560px, 100%); display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  box-shadow: -18px 0 48px rgba(8, 20, 18, .35);
  transform: translateX(104%); visibility: hidden;
  transition: transform var(--t-base) var(--ease-out), visibility 0s linear var(--t-base);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.sheet.open { transform: none; visibility: visible; transition-delay: 0s; }
.sheet__head { padding: var(--s5) var(--s5) var(--s4); border-bottom: 3px double var(--ink); position: relative; }
.sheet__head h2 { font: 500 1.35rem/1.25 var(--f-display); padding-right: var(--s8); }
.sheet__head p { margin-top: var(--s2); font: 400 .78rem/1.5 var(--f-mono); color: var(--ink-dim); }
.sheet__close {
  position: absolute; top: var(--s4); right: var(--s4); width: 44px; height: 44px;
  display: grid; place-items: center; background: none; border: 1px solid var(--rule); border-radius: var(--radius);
  font-size: 1.25rem; line-height: 1;
}
.sheet__close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sheet__body { flex: 1; overflow: auto; padding: var(--s5); }
.sheet__body .state { display: inline-block; margin-bottom: var(--s4); font: 600 var(--fs-label)/1 var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--cited); }
.passage {
  font: 400 .9rem/1.8 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--paper-2); padding: var(--s4); border-radius: var(--radius);
}
.passage mark { background: var(--brass-soft); color: var(--ink); padding: .08em .15em; box-shadow: 0 0 0 1px var(--brass); }
.sheet__note { margin-top: var(--s4); font-size: var(--fs-small); color: var(--ink-dim); }
