/* ------------------------------------------------------------------ status line */
#summary.sealline {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  margin: 0; padding: 2px 0 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: none; color: var(--ink); font-weight: 400; font-size: 0.92rem; line-height: 1.5;
}
.sealline { --tone: var(--muted); }
.sealline.is-ok { --tone: var(--ok); }
.sealline.is-bad { --tone: var(--bad); }
.sealline.is-warn, .sealline.is-pending { --tone: var(--warn); }
.sealline .sl-seal { display: block; width: 22px; height: 22px; color: var(--tone); }
.sealline-text { min-width: 0; display: grid; gap: 1px; }
.sealline-head { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.sealline-sub { font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.sealline-tally {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.02em; color: var(--ink-2);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  #summary.sealline { grid-template-columns: auto minmax(0, 1fr); row-gap: 4px; }
  .sealline-tally { grid-column: 2; }
}

/* ------------------------------------------------------------------ chain ledger */
#cards.sigchain { list-style: none; margin: -4px 0 0; padding: 0; display: block; border: 0; border-radius: 0; overflow: visible; }
#cards.sigchain:empty { display: none; }

.blk {
  --rail: 15px;
  --tone: var(--warn);
  --link: var(--line-strong);
  position: relative;
  display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 14px;
  padding-bottom: 16px;
}
.blk.is-ok { --tone: var(--ok); }
.blk.is-bad { --tone: var(--bad); }
.blk.is-broken { --link: var(--bad); }
.blk > * { grid-column: 2; min-width: 0; }

.blk::before {
  content: ""; position: absolute; left: calc(var(--rail) - 0.5px); top: 0; bottom: 0; width: 1px;
  background: var(--line-strong);
}
.blk:last-child::before { bottom: auto; height: 46px; }
.blk:first-child::after {
  content: ""; position: absolute; left: calc(var(--rail) - 4px); top: 0; width: 8px; height: 1px; background: var(--line-strong);
}

.blk-node {
  grid-column: 1; grid-row: 2; align-self: center; justify-self: center; position: relative; z-index: 1;
  min-width: 28px; height: 20px; padding: 0 3px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.68rem; font-weight: 500; line-height: 1; color: var(--tone);
  background: var(--paper); border: 1px solid var(--tone); border-radius: var(--r-xs);
}
.blk.is-bad .blk-node { background: var(--tone); color: var(--paper); }

.blk-link {
  grid-row: 1; position: relative;
  display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap;
  padding: 12px 0 8px; font-family: var(--mono); font-size: 0.7rem; line-height: 1.4; color: var(--muted);
}
.blk-link::before {
  content: ""; position: absolute; left: calc(var(--rail) - 44px - 0.5px); top: 0; bottom: 0; width: 1px; background: var(--link);
}
.blk-link::after {
  content: ""; position: absolute; left: calc(var(--rail) - 44px); top: calc(12px + 0.7em); width: 9px; height: 1px; background: var(--link);
}
.blk.is-broken .blk-link { color: var(--bad); }
.blk.is-broken .blk-link::before { width: 2px; left: calc(var(--rail) - 44px - 1px); }
.blk-link-hash { color: var(--muted); opacity: 0.85; letter-spacing: 0.01em; }
.blk.is-broken .blk-link-hash { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }

.blk-head { grid-row: 2; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; min-height: 22px; }
.blk-idx { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.blk-signer { font-weight: 600; font-size: 0.95rem; color: var(--ink); overflow-wrap: anywhere; }
.blk-role { font-size: 0.8rem; color: var(--muted); }
.blk-status {
  margin-left: auto; font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--tone); white-space: nowrap;
}
.blk-meta { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }

.blk-msg { position: relative; margin: 8px 0 0; padding-left: 16px; font-size: 0.84rem; line-height: 1.55; color: var(--ink); }
.blk-msg::before { content: "!"; position: absolute; left: 2px; top: 0; font-family: var(--mono); font-weight: 700; color: var(--tone); }
.blk-detail { margin: 2px 0 0; padding-left: 16px; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); overflow-wrap: anywhere; }

.blk-defs {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 14px;
  margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed var(--line);
  font-family: var(--mono); font-size: 0.72rem; line-height: 1.5;
}
.blk-defs dt { color: var(--muted); }
.blk-defs dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.blk-res { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.blk-res li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.blk-res-ref { padding: 0; background: none; border: 0; font: inherit; color: var(--ink); overflow-wrap: anywhere; }
.blk-word { font-weight: 600; }
.blk-word.is-ok { color: var(--ok); }
.blk-word.is-bad { color: var(--bad); }
.blk-word.is-warn { color: var(--warn); }
.blk-word.is-muted { color: var(--muted); font-weight: 400; }
.blk-word.is-plain { color: var(--ink-2); font-weight: 400; }
.blk-hint { color: var(--muted); font-family: var(--sans); font-size: 0.74rem; }

.blk-warns { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; font-size: 0.78rem; line-height: 1.55; color: var(--ink-2); }
.blk-warns li { position: relative; padding-left: 16px; overflow-wrap: anywhere; }
.blk-warns li::before { content: "!"; position: absolute; left: 2px; font-family: var(--mono); font-weight: 700; color: var(--warn); }

.blk-more { margin-top: 8px; max-width: 100%; }
.blk-more > summary {
  display: inline-flex; align-items: baseline; gap: 6px; cursor: pointer; list-style: none;
  font-family: var(--mono); font-size: 0.7rem; color: var(--muted); padding: 2px 0;
}
.blk-more > summary::-webkit-details-marker { display: none; }
.blk-more > summary::before { content: "+"; display: inline-block; width: 1ch; color: var(--ink-2); }
.blk-more[open] > summary::before { content: "−"; }
.blk-more > summary:hover { color: var(--ink); }
.blk-more > summary:focus-visible { outline: 2px solid var(--ruri); outline-offset: 2px; border-radius: var(--r-xs); }
.blk-more-n { color: var(--muted); opacity: 0.7; }
.blk-more-n::before { content: "("; }
.blk-more-n::after { content: ")"; }
.blk-fields {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 1px 0;
  margin: 6px 0 0; padding: 10px 12px; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-xs);
  font-family: var(--mono); font-size: 0.7rem; line-height: 1.55;
}
.blk-fields dt { color: var(--ruri-text); }
.blk-fields dt::after { content: ":"; margin-right: 1ch; color: var(--muted); }
.blk-fields dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-wrap; }

#doc-warnings.doc-warnings { position: relative; padding-left: 16px; color: var(--ink-2); font-size: 0.8rem; }
#doc-warnings.doc-warnings::before { content: "!"; position: absolute; left: 2px; font-family: var(--mono); font-weight: 700; color: var(--warn); }
