/* Crossfoot browser validator. Builds on /site.css (ledger paper, ink, the auditor's tick, the total rule). */

.app-wrap { max-width: 1480px; }
body.app .foot { margin-top: 3rem; }
body.app[data-state='results'] main h1 { margin-top: 0; }

/* ---- empty ---- */
.empty h1 { max-width: none; }
.empty .lede { margin-bottom: 0; }
.drop {
  display: grid; justify-items: center; gap: .8rem; cursor: pointer; position: relative;
  margin: 2rem 0 2.2rem; padding: 1.1rem 1.5rem 2.2rem 3.6rem; text-align: center;
  background-color: var(--sheet); border: 1px solid #e2e1cf;
  background-image:
    linear-gradient(to right, transparent 2.3rem, var(--margin) 2.3rem, var(--margin) calc(2.3rem + 1px), transparent calc(2.3rem + 1px), transparent calc(2.3rem + 4px), var(--margin) calc(2.3rem + 4px), var(--margin) calc(2.3rem + 5px), transparent calc(2.3rem + 5px)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(2.1rem - 1px), var(--rule) calc(2.1rem - 1px), var(--rule) 2.1rem);
  background-position: 0 0, 0 3.1rem;
  background-repeat: no-repeat, repeat;
  box-shadow: 0 1px 0 rgba(23, 40, 74, .08), 0 22px 40px -28px rgba(23, 40, 74, .45);
  transition: box-shadow .15s, border-color .15s;
}
.drop:hover { border-color: var(--rule-2); box-shadow: 0 1px 0 rgba(23, 40, 74, .1), 0 26px 44px -26px rgba(23, 40, 74, .55); }
.drop-head { justify-self: stretch; display: flex; justify-content: space-between; font-size: .9rem; font-style: italic; color: var(--ink-2); border-bottom: 1px solid var(--rule); padding-bottom: .5rem; margin-bottom: 1.4rem; background: var(--sheet); }
.drop-title { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 600; letter-spacing: -.012em; font-variation-settings: 'opsz' 48; line-height: 1.1; background: var(--sheet); padding: 0 .6rem; }
.drop-or { font-size: 1.1rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: .7rem; background: var(--sheet); padding: 0 .5rem; }
.drop-kinds { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 2rem; margin-top: 1.1rem; font-size: .98rem; background: var(--sheet); padding: .2rem .6rem; }
.drop-kinds b { font-weight: 600; }
.drop-kinds code { font-size: .82rem; }

.promises { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; grid-auto-flow: column; margin: 0 0 1rem; border-top: 1px solid var(--ink); }
.promises dt { font-weight: 600; padding: .9rem 1.2rem .25rem 0; }
.promises dd { margin: 0; padding: 0 1.2rem 1rem 0; font-size: 1rem; color: var(--ink-2); line-height: 1.5; }
.promises dt:not(:first-of-type), .promises dd:not(:first-of-type) { padding-left: 1.2rem; border-left: 1px solid var(--rule); }

/* ---- loading ---- */
.loading h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); overflow-wrap: anywhere; }
.steps-paper { transform: none; max-width: 760px; margin: 1.4rem 0 1.6rem; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; align-items: baseline; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.steps li.done, .steps li.now { color: var(--ink); }
.steps li.now .sl { font-weight: 600; }
.steps li.now .st::before { content: ''; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--ink); animation: cf-pulse 1s ease-in-out infinite alternate; margin-left: .25rem; }
.steps .sv { font-family: var(--mono); font-size: .88rem; font-variant-numeric: tabular-nums; }
.steps .tm { margin-left: 0; }
@keyframes cf-pulse { from { opacity: .25; } to { opacity: 1; } }
.meter { height: 3px; background: var(--rule); margin: 1rem 0 .5rem; }
.meter span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .25s ease-out; }
.current { margin: 0; font-size: .8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.current code { background: none; padding: 0; }

/* ---- error ---- */
.err-line { display: flex; gap: .6rem; align-items: baseline; font-size: 1.15rem; color: var(--red); background: var(--sheet); border-top: 1px solid var(--red); border-bottom: 1px solid var(--rule); padding: .9rem 1rem; }
.err-line .tm { flex: none; }
.err-line span { color: var(--ink); overflow-wrap: anywhere; }

/* ---- results head + summary ---- */
.res-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem 2rem; margin-top: 2rem; }
.res-head h1 { font-size: clamp(1.45rem, 2.2vw, 2rem); margin: 0 0 .3rem; overflow-wrap: anywhere; font-variation-settings: 'opsz' 36; }
.res-head h1:focus { outline: none; }
.res-sub { margin: 0; color: var(--ink-2); font-size: 1rem; font-style: italic; }
.res-head .btn { flex: none; }

.summary { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(5, minmax(0, 1fr)); margin: 1.3rem 0 0; background: var(--sheet); border-top: 1px solid var(--ink); }
.summary > div { padding: .6rem 1rem .75rem; }
.summary > div + div { border-left: 1px solid var(--rule); }
.summary dt { font-size: .9rem; color: var(--ink-2); }
.summary dd { margin: .1rem 0 0; }
.summary .fig { display: block; font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
.summary .note { display: block; font-size: .85rem; color: var(--ink-2); margin-top: .1rem; }
.summary .verdict .fig { font-family: var(--serif); }
.summary .verdict .tm { width: 1.3em; height: 1.15em; margin: 0 .15rem 0 0; vertical-align: -.12em; }
.summary .verdict .tm.bad { width: .9em; height: .9em; vertical-align: -.02em; }
.v-ok { color: var(--tick); }
.v-bad { color: var(--red); }
.results hr.total { margin: 0 0 1.4rem; }

/* ---- workspace ---- */
.work { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.work.no-report { grid-template-columns: minmax(0, 1fr); }
.work.no-report .viewer { display: none; }
.viewer, .panel { background: var(--sheet); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.viewer { position: sticky; top: .8rem; display: flex; flex-direction: column; height: calc(100vh - 1.6rem); min-height: 520px; max-height: 1100px; }
.viewer-bar { display: flex; align-items: center; gap: .8rem; padding: .5rem .8rem; border-bottom: 1px solid var(--rule); font-size: .92rem; color: var(--ink-2); font-style: italic; }
.viewer-bar .fit { margin-left: auto; font-style: normal; padding: .3rem .6rem; font-size: .88rem; }
.viewer-bar select { font: .92rem var(--serif); color: var(--ink); background: #fff; border: 1px solid var(--rule-2); padding: .25rem .4rem; border-radius: 2px; max-width: 50%; }
#frame { flex: 1; width: 100%; border: 0; background: #fff; display: block; }
.no-frame { padding: 2rem 1.4rem; color: var(--ink-2); }

.panel { min-height: 520px; display: flex; flex-direction: column; }
.tabs { display: flex; gap: 0 1.6rem; padding: 0 1.1rem; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.tabs [role=tab] {
  font: 600 1.02rem/1.2 var(--serif); color: var(--ink-2); background: none; border: 0; cursor: pointer;
  padding: .85rem 0 .6rem; border-bottom: 3px double transparent; margin-bottom: -1px;
}
.tabs [role=tab]:hover { color: var(--ink); border-bottom-color: var(--rule-2); }
.tabs [role=tab][aria-selected=true] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .count { font: 400 .82rem var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-2); margin-left: .2rem; }
.tabs .count.bad { color: var(--red); font-weight: 600; }
.pane { padding: 1rem 1.1rem 1.2rem; flex: 1; }
.pane:focus { outline: none; }
.pro { margin: 0; padding: .8rem 1.1rem 1rem; border-top: 1px solid var(--rule); line-height: 1.45; }
.hint { color: var(--ink-2); font-style: italic; margin: .4rem 0; }
.muted { color: var(--ink-2); }
.nil { font-style: italic; color: var(--ink-2); font-family: var(--serif); }
.linkish { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; text-align: left; }
.linkish:hover { text-decoration-color: var(--ink); }

/* ---- filters + facts table ---- */
.filters { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin-bottom: .6rem; }
.filters label { display: inline-flex; align-items: center; gap: .4rem; font-size: .92rem; color: var(--ink-2); margin: 0; font-weight: 400; }
.filters select { font: .92rem var(--serif); color: var(--ink); background: #fff; border: 1px solid var(--rule-2); padding: .3rem .4rem; border-radius: 2px; max-width: 13rem; }
.filters .search { flex: 1 1 100%; position: relative; }
.filters .search input { width: 100%; font: 1rem var(--serif); color: var(--ink); background: #fff; border: 1px solid var(--rule-2); border-bottom: 1.5px solid var(--ink); padding: .55rem 2.4rem .55rem .7rem; border-radius: 2px; }
.filters .search input::placeholder { color: #7d8597; }
.filters .search input:focus + kbd, .filters .search input:not(:placeholder-shown) + kbd { display: none; }
.filters kbd { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); font: .78rem var(--mono); color: var(--ink-2); border: 1px solid var(--rule-2); border-bottom-width: 2px; padding: 0 .35rem; border-radius: 2px; background: var(--sheet); }
.filters .check input { accent-color: var(--ink); width: 1rem; height: 1rem; }
.filters .check.off { opacity: .55; }
.shown { margin: 0 0 .5rem; font-style: italic; }

.table-scroll { overflow-x: auto; }
.facts-table { font-size: .95rem; background: transparent; }
.facts-table th, .facts-table td { padding: .45rem .55rem; }
.facts-table thead th { position: sticky; top: 0; z-index: 1; }
.facts-table.no-errs .mk { display: none; }
.facts-table .mk { width: 1.6rem; padding-left: .3rem; padding-right: .1rem; }
.facts-table .mk .tm { width: .75em; height: .75em; }
.facts-table th + th, .facts-table td, .facts-table th + td { border-left: 0; }
.facts-table tbody th { font-weight: 400; }
.facts-table .lbl { display: block; line-height: 1.3; }
.facts-table .dimline { display: block; font-size: .82rem; color: var(--ink-2); font-style: italic; line-height: 1.3; margin-top: .1rem; }
.facts-table .perline { display: none; font-size: .8rem; color: var(--ink-2); margin-top: .1rem; }
.facts-table .per { font-size: .85rem; color: var(--ink-2); white-space: nowrap; }
.facts-table td.num { font-family: var(--mono); font-size: .88rem; font-variant-numeric: tabular-nums; }
.facts-table td.txt { font-family: var(--serif); font-size: .9rem; white-space: normal; text-align: left; max-width: 16rem; overflow-wrap: break-word; color: var(--ink-2); }
.facts-table td.txt .clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.facts-table .unit { color: var(--ink-2); font-size: .78rem; }
.facts-table tbody tr[data-i] { cursor: pointer; }
.facts-table tbody tr[data-i]:hover { background: rgba(23, 40, 74, .045); }
.facts-table tbody tr.sel { background: rgba(23, 40, 74, .09); box-shadow: inset 3px 0 0 var(--ink); }
.facts-table tbody tr:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.facts-table .none { padding: 1.4rem .6rem; color: var(--ink-2); font-style: italic; }

/* ---- fact ---- */
.fact h2 { font-size: 1.45rem; margin: .2rem 0 .5rem; font-variation-settings: 'opsz' 32; }
.fact-figure { margin: 0 0 .8rem; }
.fact-figure .fig { font-size: 2rem; font-weight: 600; line-height: 1.15; }
.fact-figure .unit { font: .95rem var(--mono); color: var(--ink-2); }
.fact-ok { display: flex; align-items: baseline; gap: .35rem; color: var(--tick); font-size: .95rem; margin: 0 0 .8rem; }
.fact-ok .tm { margin: 0; }
.fact-issues { list-style: none; margin: 0 0 .9rem; padding: .5rem .7rem; border-left: 3px solid var(--red); background: rgba(168, 38, 28, .045); }
.fact-issues li { display: flex; gap: .5rem; align-items: baseline; font-size: .93rem; line-height: 1.45; padding: .2rem 0; }
.fact-issues .tm { flex: none; margin: 0; }
.fact-issues code { color: var(--red); background: none; padding: 0; }
.kv { display: grid; grid-template-columns: minmax(7.5rem, 11rem) minmax(0, 1fr); margin: 0; font-size: .97rem; }
.kv dt, .kv dd { margin: 0; padding: .55rem 0; border-top: 1px solid var(--rule); }
.kv dt { color: var(--ink-2); padding-right: 1rem; }
.kv dd { overflow-wrap: anywhere; }
.kv .fig { font-family: var(--mono); font-size: 1rem; font-weight: 600; }
.kv .text-val { white-space: pre-wrap; display: block; max-height: 16rem; overflow: auto; }
.kv .shown-text { font-family: var(--mono); font-size: .9rem; background: rgba(23, 40, 74, .05); padding: .05rem .3rem; }
.kv .concept { font-size: .92rem; }
.kv .ns { display: block; font-family: var(--mono); font-size: .76rem; color: var(--ink-2); margin-top: .15rem; }
.dims { list-style: none; margin: 0; padding: 0; }
.dims li { display: grid; grid-template-columns: minmax(0, 1fr); padding: .1rem 0 .3rem; }
.dims li + li { border-top: 1px dotted var(--rule); padding-top: .3rem; }
.dims .dim { font-size: .85rem; color: var(--ink-2); }
.dims .mem { font-weight: 600; }
.fact-nav { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--rule); }
.fact-nav .btn[disabled] { opacity: .4; cursor: default; }

/* ---- validation ---- */
.verdict-line { display: flex; gap: .45rem; align-items: baseline; font-size: 1.08rem; font-weight: 600; margin: .1rem 0 1rem; }
.verdict-line .tm { flex: none; margin: 0; }
.verdict-line.ok { color: var(--tick); }
.verdict-line.bad { color: var(--red); }
.issue { border-top: 1px solid var(--rule); padding: .8rem 0 .6rem; }
.issue h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; font-size: 1rem; margin: 0 0 .35rem; }
.issue h3 code { font-size: .88rem; background: none; padding: 0; }
.issue.bad h3 code { color: var(--red); }
.issue .sev { font-weight: 400; font-size: .88rem; color: var(--ink-2); font-style: italic; }
.issue .why { font-size: .95rem; line-height: 1.5; margin: 0 0 .5rem; }
.msgs { margin: 0; padding-left: 1.4rem; font-size: .9rem; line-height: 1.45; color: var(--ink-2); }
.msgs li { padding: .2rem 0; }
.msgs .msg { overflow-wrap: anywhere; }
.msgs .where { display: flex; flex-wrap: wrap; gap: .1rem .9rem; margin-top: .15rem; color: var(--ink); }
.msgs .loc { font: .8rem var(--mono); color: var(--ink-2); }
.checked { margin-top: 1rem; border-top: 1px solid var(--rule); padding-top: .7rem; }

/* ---- drag overlay, privacy ---- */
.dropping { position: fixed; inset: 0; z-index: 20; background: rgba(242, 240, 227, .9); display: grid; place-items: center; pointer-events: none; }
.dropping span { font-size: 2rem; font-weight: 600; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); padding: .6rem 1.4rem; background: var(--sheet); }
.privacy { margin-top: 1.6rem; font-style: italic; }
body.app[data-state='empty'] .privacy { display: none; }

/* ---- smaller screens: stack ---- */
@media (max-width: 980px) {
  .work { grid-template-columns: minmax(0, 1fr); }
  .viewer { position: relative; top: 0; height: 72vh; min-height: 420px; }
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary > div:nth-child(4) { border-left: 0; }
  .summary > div:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .promises { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .promises dt:not(:first-of-type), .promises dd:not(:first-of-type) { padding-left: 0; border-left: 0; }
  .promises dt:not(:first-of-type) { border-top: 1px solid var(--rule); }
}
@media (max-width: 640px) {
  .drop { padding: .9rem .8rem 1.6rem 2.9rem; background-position: -.6rem 0, 0 3.1rem; }
  .drop-kinds { flex-direction: column; gap: .2rem; align-items: center; }
  .res-head { flex-direction: column; margin-top: 1.4rem; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary > div { padding: .5rem .7rem .6rem; }
  .summary > div:nth-child(n) { border-left: 0; border-top: 1px solid var(--rule); }
  .summary > div:nth-child(even) { border-left: 1px solid var(--rule); }
  .summary > div:nth-child(-n+2) { border-top: 0; }
  .summary .fig { font-size: 1.3rem; }
  .viewer { height: 64vh; min-height: 360px; }
  .viewer-note { font-size: .85rem; }
  .tabs { gap: 0 1.1rem; padding: 0 .8rem; }
  .pane { padding: .9rem .8rem 1rem; }
  .pro { padding: .8rem; }
  .filters label:not(.search):not(.check) { flex: 1 1 100%; min-width: 0; }
  .filters label:not(.search):not(.check) span { flex: 0 0 5.2rem; }
  .filters label:not(.search):not(.check) select { max-width: none; flex: 1; min-width: 0; }
  .facts-table .per, .facts-table thead th:nth-child(3) { display: none; }
  .facts-table .perline { display: block; }
  .facts-table td.txt { min-width: 8.5rem; max-width: 10rem; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dd { border-top: 0; padding-top: 0; }
  .kv dt { padding-bottom: .15rem; }
  .fact-nav { flex-wrap: wrap; }
  .fact-nav > span.small { order: -1; flex: 1 1 100%; }
  .fact-nav .btn { flex: 1 1 0; }
}
@media (prefers-reduced-motion: reduce) {
  .steps li.now .st::before { animation: none; }
  .meter span { transition: none; }
}
