/* QENEX Lab Portal — layered on the design system (brand-v1.css). Tenant-facing. */
:root { --gap: 16px; --radius: 10px; --line: #e3e3ec; --muted: #5b5b6b; --accent: #4f46e5; --ok: #0a7d3c; --err: #b4232a; --warn: #8a5a00; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: #16161f; background: #fafafd; }

.portal-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.whoami { display: flex; align-items: center; gap: 12px; color: var(--muted); }

main { max-width: 1040px; margin: 0 auto; padding: 24px; }
.view.centered { min-height: 70vh; display: grid; place-items: center; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.login-card { max-width: 460px; text-align: center; }
.login-card h1 { font-size: 26px; margin: 0 0 8px; }
.muted { color: var(--muted); } .fineprint { font-size: 12px; color: var(--muted); margin-top: 18px; }

.btn { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; cursor: pointer; transition: .12s; }
.btn:hover { border-color: #bbb; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-sm { padding: 4px 9px; font-size: 12px; margin-left: 4px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { border: none; background: none; padding: 10px 16px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.row-between { display: flex; justify-content: space-between; align-items: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.actions { white-space: nowrap; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.pill-done { background: #e6f6ec; color: var(--ok); }

.empty { text-align: center; color: var(--muted); padding: 48px 12px; border: 1px dashed var(--line); border-radius: var(--radius); }

.chart { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; }
.chart-title { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 70px; align-items: center; gap: 10px; margin: 5px 0; }
.bar-label { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 12px; background: linear-gradient(90deg, var(--accent), #8b83f5); border-radius: 6px; }
.bar-val { text-align: right; }

.form { display: grid; gap: 16px; max-width: 560px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.form input, .form select, .form textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-weight: 400; }
.form textarea { font-family: ui-monospace, Menlo, monospace; }
.msg { padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.msg.ok { background: #e6f6ec; color: var(--ok); } .msg.err { background: #fdecec; color: var(--err); }

.modal { position: fixed; inset: 0; background: rgba(20,20,35,.45); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal-card { background: #fff; border-radius: 14px; padding: 24px; max-width: 560px; width: 100%; max-height: 88vh; overflow: auto; }
.verify-table { margin: 8px 0 16px; } .verify-steps { padding-left: 20px; color: #333; font-size: 14px; line-height: 1.6; }
.verify-actions { margin-top: 16px; }

@media (max-width: 640px) {
  main { padding: 16px; } .bar-row { grid-template-columns: 90px 1fr 56px; }
  .actions { display: flex; flex-wrap: wrap; gap: 4px; }
}

/* ── ICH M7 surface ───────────────────────────────────────────────────────────
   The class pill carries the verdict at a glance, so its tone is semantic, not
   decorative: an incomplete assessment and a Class 5 clearance must never read
   the same. Before this block every pill rendered identically and the whole
   compliant/incomplete distinction was invisible. */
.pill.ok   { background: #e6f6ec; color: var(--ok); }
.pill.warn { background: #fdf2dc; color: var(--warn); }
.pill.err  { background: #fdecec; color: var(--err); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.small { font-size: 13px; }

.fs { border: 1px solid var(--line); border-radius: var(--radius);
      padding: 12px 14px; margin: 4px 0; }
.fs legend { padding: 0 6px; font-size: 13px; font-weight: 600;
             color: var(--muted); }

/* A SMILES string has no spaces, so it will not wrap and would otherwise push
   the whole table sideways. Break it anywhere and cap the column. */
td.mono { word-break: break-all; max-width: 22ch; }

#m7b-list { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
            font-size: 13px; width: 100%; resize: vertical; }

/* ── two defects the render test caught, 2026-08-16 ───────────────────────────

   1. `.modal { display: grid }` BEAT the UA stylesheet's `[hidden] {display:none}`,
      because any author rule outranks the UA sheet. #verify-modal therefore sat
      over the whole portal as a 1280x720 fixed overlay at z-index 50, at ALL
      times, and elementFromPoint at the page centre returned .modal-card. Every
      click in the middle of the customer surface hit an invisible scrim rather
      than the control beneath it. Nobody reported it because /portal/ is
      unlinked. This rule restores the attribute's meaning for every element,
      not just the modal, so the next component that pairs `hidden` with a
      display rule cannot resurrect it. */
[hidden] { display: none !important; }

/* 2. A pill reading "Class 3" and one reading "Incomplete" rendered in the SAME
      amber. They are different KINDS of thing: Class 3 is a usable verdict
      (alert, no data, control at TTC), while Incomplete means no verdict was
      reached at all. Treating them alike is the "green summary over an amber
      row" error wearing a different colour. State pills are therefore outlined
      rather than filled, so a verdict and a state stay distinguishable without
      relying on hue alone. */
.pill.state { background: transparent; border: 1px solid currentColor;
              font-weight: 600; }
