:root {
  --red: #CF2030;
  --red-dark: #A3171F;
  --ink: #15181D;
  --ink-2: #2B3038;
  --muted: #666E7A;
  --line: #E2E6EC;
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --critical: #A3171F;
  --high: #C2410C;
  --medium: #B45309;
  --low: #0E7490;
  --pass: #15803D;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(21,24,29,.06), 0 8px 24px rgba(21,24,29,.06);
}

* { box-sizing: border-box; }

/* a display rule on a class beats the UA rule for [hidden], so pin it */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

/* masthead */
.masthead { background: var(--ink); color: #fff; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark {
  font-weight: 800; letter-spacing: .5px; font-size: 20px;
  background: var(--red); padding: 2px 8px; border-radius: 4px;
}
.brand-sub { font-weight: 500; opacity: .85; }
.masthead-meta { font-size: 12.5px; opacity: .7; }
.masthead-meta .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.on { background: #4ADE80; }
.dot.off { background: #FBBF24; }

/* intro */
.intro { padding: 40px 0 24px; }
.intro h1 { font-size: 30px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.02em; }
.intro p { margin: 0; color: var(--muted); max-width: 62ch; }

/* panel */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 7px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input[type=text], input:not([type]), input[list] {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 7px; font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
input:focus-visible, button:focus-visible, .drop:focus-within { outline: 2px solid var(--red); outline-offset: 1px; }

.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

/* drop zone */
.drop {
  position: relative; border: 1.5px dashed #C8CFD8; border-radius: 9px;
  background: #FBFCFD; transition: border-color .15s, background .15s;
}
.drop.over, .drop:hover { border-color: var(--red); background: #FEF6F7; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop-inner { padding: 26px 16px; text-align: center; pointer-events: none; }
.drop-inner strong { display: block; font-size: 14.5px; margin-bottom: 3px; }
.drop-inner span { font-size: 12.5px; color: var(--muted); }

/* segmented */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; padding: 8px 18px; cursor: pointer; font-size: 13px; color: var(--muted);
  border-right: 1px solid var(--line);
}
.seg:last-child span { border-right: 0; }
.seg span strong { display: block; color: var(--ink); font-size: 14px; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:checked + span strong { color: #fff; }

/* actions */
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.btn {
  background: var(--red); color: #fff; border: 0; border-radius: 7px;
  padding: 11px 22px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
}
.btn:hover { background: var(--red-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.skip { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* status */
.status { margin-top: 20px; padding: 14px 16px; border-radius: 9px; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.status.err { border-color: #F3C7C7; background: #FEF4F4; color: var(--critical); }
.spinner {
  display: inline-block; width: 13px; height: 13px; margin-right: 9px; vertical-align: -2px;
  border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* report */
.report { margin: 26px 0 60px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card > h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: 0 0 14px; font-weight: 700;
}

/* scoreboard */
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 1px; background: var(--line); border-radius: 9px; overflow: hidden; }
.score { background: #fff; padding: 14px 12px; }
.score b { display: block; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; }
.score span { font-size: 11.5px; color: var(--muted); }
.score.alert b { color: var(--critical); }

/* timing bar */
.bar { height: 9px; border-radius: 5px; background: #EDEFF3; overflow: hidden; margin: 12px 0 7px; }
.bar i { display: block; height: 100%; background: var(--pass); border-radius: 5px; }
.bar i.over { background: var(--critical); }
.bar i.tight { background: var(--medium); }
.bar-note { font-size: 12.5px; color: var(--muted); }

/* findings */
.f { display: flex; gap: 13px; padding: 13px 0; border-top: 1px solid var(--line); }
.f:first-of-type { border-top: 0; padding-top: 0; }
.pill {
  flex: none; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px; color: #fff; height: fit-content; margin-top: 2px; min-width: 62px; text-align: center;
}
.pill.critical { background: var(--critical); }
.pill.high { background: var(--high); }
.pill.medium { background: var(--medium); }
.pill.low { background: var(--low); }
.pill.pass { background: var(--pass); }
.f-body h3 { margin: 0 0 3px; font-size: 14.5px; font-weight: 600; }
.f-body p { margin: 0 0 5px; color: var(--ink-2); font-size: 13.5px; }
.f-body .ev { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.f-body .fix { font-size: 13px; color: var(--ink-2); background: #F7F9FB; border-left: 2px solid var(--red); padding: 7px 11px; border-radius: 0 5px 5px 0; margin-top: 7px; }

/* house */
.house { display: grid; gap: 9px; }
.h-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.h-row:first-child { border-top: 0; padding-top: 0; }
.h-letter { font-weight: 800; font-size: 17px; color: var(--red); }
.h-row h4 { margin: 0 0 2px; font-size: 14px; }
.h-row p { margin: 0; font-size: 13px; color: var(--ink-2); }
.h-row .ev { font-size: 12.5px; color: var(--muted); font-style: italic; margin-top: 4px; }
.tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 20px; }
.tag.present { background: #DCFCE7; color: #14532D; }
.tag.weak { background: #FEF3C7; color: #78350F; }
.tag.missing { background: #FEE2E2; color: #7F1D1D; }

/* conflicts */
.conflict { border: 1px solid var(--line); border-left: 3px solid var(--high); border-radius: 0 8px 8px 0; padding: 13px 15px; margin-bottom: 10px; }
.conflict.high { border-left-color: var(--critical); }
.conflict.medium { border-left-color: var(--high); }
.conflict.low { border-left-color: var(--medium); }
.conflict h4 { margin: 0 0 5px; font-size: 14px; }
.conflict h4 small { font-weight: 500; color: var(--muted); }
.conflict blockquote { margin: 7px 0; padding-left: 11px; border-left: 2px solid var(--line); color: var(--ink-2); font-size: 13px; }
.conflict p { margin: 5px 0 0; font-size: 13px; color: var(--ink-2); }
.clear { background: #F0FDF4; border: 1px solid #BBF7D0; color: #14532D; padding: 13px 15px; border-radius: 8px; font-size: 13.5px; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
ul.plain li:first-child { border-top: 0; padding-top: 0; }
.rank { display: inline-flex; width: 19px; height: 19px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; align-items: center; justify-content: center; margin-right: 8px; vertical-align: 1px; }
.slideref { font-size: 11.5px; color: var(--muted); }

/* dense slide table */
table.slides { width: 100%; border-collapse: collapse; font-size: 13px; }
table.slides th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 8px 7px 0; font-weight: 700; }
table.slides td { padding: 7px 8px 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
table.slides td.n { font-variant-numeric: tabular-nums; color: var(--muted); width: 34px; }
table.slides td.w { font-variant-numeric: tabular-nums; width: 62px; }
table.slides tr.over td.w { color: var(--critical); font-weight: 600; }
table.slides td.p { color: var(--ink-2); }

.foot { padding: 0 16px 36px; color: var(--muted); font-size: 12.5px; }
.foot p { margin: 0; }

@media (max-width: 640px) {
  .row { grid-template-columns: 1fr; }
  .intro h1 { font-size: 25px; }
  .intro { padding: 28px 0 20px; }
  .panel, .card { padding: 17px; }
}

/* ===================================================================== */
/* sign in                                                               */
/* ===================================================================== */

.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; background: var(--ink);
}
.gate-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border-radius: 14px; padding: 30px 28px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.gate-brand { margin-bottom: 20px; }
.gate-brand .brand-sub { color: var(--ink); opacity: 1; }
.gate-card h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.01em; }
.gate-note { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.gate-card input[type=password] {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 7px; font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
.btn-wide { width: 100%; }
.gate-err {
  margin-top: 14px; font-size: 13px; color: var(--critical);
  background: #FEF4F4; border: 1px solid #F3C7C7; border-radius: 7px; padding: 9px 11px;
}

/* ===================================================================== */
/* chrome                                                                */
/* ===================================================================== */

.who { display: flex; align-items: center; gap: 12px; font-size: 13px; }
#who { opacity: .8; }
.link {
  background: none; border: 0; padding: 0; font: inherit; font-size: 13px;
  color: #fff; opacity: .65; cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.link:hover { opacity: 1; }
.link.danger { color: var(--critical); opacity: 1; text-decoration: none; }
.link.danger:hover { text-decoration: underline; }

.tabs { background: var(--surface); border-bottom: 1px solid var(--line); }
.tabs-inner { display: flex; gap: 2px; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 13px 15px; font: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--muted); cursor: pointer; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--red); }

.btn-ghost {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 7px; padding: 8px 14px; font: inherit; font-size: 13px;
  font-weight: 500; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--ink); }

/* report header row */
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: 0; font-weight: 700; padding-top: 7px;
}
.card-tools { display: flex; align-items: center; gap: 12px; }
.stamp { font-size: 12px; color: var(--muted); }

/* ===================================================================== */
/* history                                                               */
/* ===================================================================== */

.hist-scroll { overflow-x: auto; margin: -4px -6px; padding: 4px 6px; }
table.hist { width: 100%; border-collapse: collapse; font-size: 13px; }
table.hist th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 0 10px 8px 0; font-weight: 700; white-space: nowrap;
}
table.hist td { padding: 11px 10px 11px 0; border-top: 1px solid var(--line); vertical-align: top; }
table.hist td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.hist th.num { text-align: right; }
table.hist td.num.bad { color: var(--critical); font-weight: 600; }
table.hist td.file { color: var(--ink-2); max-width: 230px; word-break: break-word; }
table.hist .sub { font-size: 11.5px; color: var(--muted); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn-ghost { padding: 5px 11px; margin-right: 8px; }
.chip {
  display: inline-block; min-width: 24px; padding: 2px 7px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; text-align: center; color: #fff;
}
.chip.pass { background: #DCFCE7; color: #14532D; }
.chip.low { background: var(--low); }
.chip.medium { background: var(--medium); }
.chip.high { background: var(--high); }
.chip.critical { background: var(--critical); }

/* ===================================================================== */
/* members                                                               */
/* ===================================================================== */

.mem-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.mem-head strong { display: block; font-size: 15px; }
.mem-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.mem-filter { width: 210px; padding: 8px 11px !important; font-size: 13px !important; }
.mem-msg { font-size: 13px; padding: 9px 12px; border-radius: 7px; margin-bottom: 14px; background: #F7F9FB; border: 1px solid var(--line); }
.mem-msg.ok { background: #F0FDF4; border-color: #BBF7D0; color: #14532D; }
.mem-msg.err { background: #FEF4F4; border-color: #F3C7C7; color: var(--critical); }

.mem-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table.mem { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
table.mem th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 0 8px 8px 0; font-weight: 700;
}
table.mem td { padding: 5px 8px 5px 0; border-top: 1px solid var(--line); vertical-align: top; }
table.mem tr:first-child td { border-top: 0; }
table.mem input, table.mem textarea {
  width: 100%; padding: 7px 9px; border: 1px solid transparent; border-radius: 6px;
  font: inherit; font-size: 13px; background: #FBFCFD; color: var(--ink);
  resize: none; overflow: hidden; line-height: 1.45;
}
table.mem input:hover, table.mem textarea:hover { border-color: var(--line); }
table.mem input:focus, table.mem textarea:focus {
  border-color: var(--red); background: #fff; outline: none;
}
table.mem .m-name { min-width: 130px; font-weight: 600; }
table.mem .m-trade { min-width: 120px; }
table.mem .m-desc { min-width: 230px; }
table.mem .m-cat { min-width: 110px; }
table.mem td.row-actions { padding-top: 11px; }

/* ===================================================================== */
/* slide pictures                                                        */
/* ===================================================================== */

.opt {
  font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-left: 5px;
}
.drop.slim .drop-inner { padding: 16px; }

.strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 11px 0 4px; }
.thumb { margin: 0; width: 148px; cursor: zoom-in; }
.thumb img {
  display: block; width: 100%; border: 1px solid var(--line); border-radius: 5px;
  background: #fff; transition: border-color .12s, box-shadow .12s;
}
.thumb:hover img, .thumb:focus-visible img { border-color: var(--red); box-shadow: 0 2px 10px rgba(21,24,29,.12); }
.thumb:focus-visible { outline: none; }
.thumb figcaption { font-size: 11px; color: var(--muted); margin-top: 4px; }
.thumb-more { align-self: center; font-size: 12px; color: var(--muted); }
.pic-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }

table.slides td.pic { width: 108px; padding-right: 12px; }
table.slides td.pic img {
  display: block; width: 100px; border: 1px solid var(--line); border-radius: 4px;
  background: #fff; cursor: zoom-in;
}
table.slides td.pic img:hover, table.slides td.pic img:focus-visible { border-color: var(--red); }
table.slides.withpics td { padding-top: 10px; padding-bottom: 10px; }

.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(10,12,15,.88);
  display: flex; align-items: center; justify-content: center; padding: 28px; cursor: zoom-out;
}
.lightbox figure { margin: 0; max-width: 100%; }
.lightbox img {
  display: block; max-width: min(1100px, 92vw); max-height: 82vh; width: auto;
  border-radius: 6px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.lightbox figcaption { color: #fff; font-size: 13px; margin-top: 12px; text-align: center; }
.lightbox figcaption span { opacity: .55; margin-left: 8px; }

/* ===================================================================== */
/* print, which is how the PDF is made                                   */
/* ===================================================================== */

.print-head { display: none; }

@media print {
  @page { size: A4; margin: 15mm 14mm; }

  html, body { background: #fff !important; font-size: 10.5pt; }
  body.printing .masthead,
  body.printing .tabs,
  body.printing .foot,
  body.printing .intro,
  body.printing .panel,
  body.printing #status,
  body.printing #gate,
  body.printing .no-print,
  body.printing .report:not(.print-me) { display: none !important; }

  body.printing .print-me { display: block !important; margin: 0; }
  .wrap { max-width: none; padding: 0; }

  .print-head { display: block; margin-bottom: 16pt; }
  .ph-brand {
    font-size: 8pt; text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
    color: var(--red); margin-bottom: 4pt;
  }
  .print-head h1 { font-size: 17pt; margin: 0 0 10pt; letter-spacing: -.01em; }
  table.ph-meta { border-collapse: collapse; font-size: 9.5pt; }
  table.ph-meta th {
    text-align: left; font-weight: 600; color: var(--muted); padding: 1.5pt 14pt 1.5pt 0;
    white-space: nowrap; vertical-align: top;
  }
  table.ph-meta td { padding: 1.5pt 0; }

  .card {
    box-shadow: none; border: 0; border-top: 0.75pt solid var(--line);
    border-radius: 0; padding: 10pt 0 2pt; margin: 0 0 6pt;
    break-inside: avoid; page-break-inside: avoid;
  }
  .card > h2, .card-title { font-size: 8pt; margin-bottom: 8pt; }
  .scores { background: none; gap: 0; border-radius: 0; }
  .score { border-right: 0.75pt solid var(--line); padding: 0 12pt 0 0; margin-right: 12pt; }
  .score:last-child { border-right: 0; }
  .score b { font-size: 15pt; }
  .score span { font-size: 8pt; }
  .f, .h-row, ul.plain li, table.slides tr { break-inside: avoid; page-break-inside: avoid; }
  .pill, .tag, .chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .f-body .fix, .clear, .conflict { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .strip { gap: 7pt; margin: 7pt 0 3pt; break-inside: avoid; page-break-inside: avoid; }
  .thumb { width: 108pt; }
  .thumb img { border: 0.5pt solid var(--line); }
  .thumb figcaption { font-size: 7.5pt; }
  .lightbox { display: none !important; }
  .pic-note { font-size: 8pt; }
  table.slides { font-size: 9pt; }
  table.slides td.pic { width: 74pt; padding-right: 8pt; }
  table.slides td.pic img { width: 70pt; border: 0.5pt solid var(--line); }
  a[href]:after { content: ''; }
}

@media (max-width: 640px) {
  .mem-actions { width: 100%; }
  .mem-filter { width: 100%; }
  .tabs-inner { overflow-x: auto; }
  .tab { white-space: nowrap; }
}
