/* Listing Reviewer — one small stylesheet, no build step. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e3e6ea;
  --border-strong: #cfd4da;
  --text: #1d2733;
  --muted: #627080;
  --brand: #16324f;
  --brand-2: #234b73;
  --accent: #2f6fb3;
  --high: #c0392b;
  --high-bg: #fdecea;
  --medium: #b9770e;
  --medium-bg: #fef5e7;
  --low: #5d6d7e;
  --low-bg: #eef1f4;
  --ok: #1e8449;
  --ok-bg: #e9f7ef;
  --ins: #d4f4dd;
  --del: #fbdada;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
h3 { font-size: 1.02rem; margin: 0 0 8px; }
p { margin: 0 0 10px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ---- top bar ---- */
.topbar { background: var(--brand); color: #fff; }
.topbar-inner { max-width: 1320px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 22px; height: 54px; }
.logo { font-weight: 700; color: #fff; font-size: 1.05rem; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 26px; height: 26px; border-radius: 6px; background: #fff; color: var(--brand); display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.nav a { color: rgba(255,255,255,.78); padding: 7px 11px; border-radius: 6px; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { color: #fff; background: rgba(255,255,255,.16); }
.userbox { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.userbox a { color: rgba(255,255,255,.85); }
.userbox button { background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; }

/* ---- layout ---- */
.page { max-width: 1320px; margin: 0 auto; padding: 22px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.section { margin-top: 18px; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---- flash ---- */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 10px; border: 1px solid; }
.flash.ok { background: var(--ok-bg); border-color: #b7e1c6; color: #145a32; }
.flash.error { background: var(--high-bg); border-color: #f2b8b0; color: #7b241c; }
.notice { background: var(--medium-bg); border: 1px solid #f5cba7; border-radius: var(--radius); padding: 10px 14px; }
.notice.info { background: #eaf2fb; border-color: #c4dbf2; }

/* ---- buttons & forms ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 6px; border: 1px solid var(--border-strong); background: #fff; color: var(--text); cursor: pointer; font: inherit; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: #f3f5f7; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--high); border-color: #f2b8b0; }
.btn.small { padding: 4px 9px; font-size: .88rem; }
.btn.link { border: none; background: none; color: var(--accent); padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  font: inherit; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; color: var(--text); max-width: 100%;
}
textarea { width: 100%; min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bcd5ef; border-color: var(--accent); }
label { font-weight: 600; display: block; margin-bottom: 4px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: normal; margin: 0; }
.field { margin-bottom: 14px; }
.field .hint { color: var(--muted); font-size: .88rem; margin-top: 3px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { min-width: 220px; }
form.inline { display: inline; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: .86rem; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafbfc; }
table.data td.title-cell { max-width: 520px; }
.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- badges ---- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge.high { background: var(--high-bg); color: var(--high); border-color: #f5c6c0; }
.badge.medium { background: var(--medium-bg); color: var(--medium); border-color: #f5d7a8; }
.badge.low { background: var(--low-bg); color: var(--low); border-color: #dde2e7; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe5cd; }
.badge.neutral { background: #eef1f4; color: var(--muted); }
.badge.mp { background: var(--brand); color: #fff; }
.count { display: inline-flex; min-width: 22px; justify-content: center; padding: 0 6px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.count.high { background: var(--high); color: #fff; }
.count.medium { background: var(--medium); color: #fff; }
.count.low { background: #aab4bf; color: #fff; }
.health { font-weight: 700; }
.health.good { color: var(--ok); } .health.mid { color: var(--medium); } .health.bad { color: var(--high); }

/* ---- stats ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 12px; }
.stat { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; }
.stat .n { font-size: 1.35rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .82rem; }
.stat.high .n { color: var(--high); } .stat.medium .n { color: var(--medium); } .stat.low .n { color: var(--low); }
.bar { height: 6px; background: #edf0f3; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ok); }
.mp-card h2 { display: flex; align-items: center; gap: 8px; }

/* ---- chips ---- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: #fff; color: var(--text); font-size: .88rem; }
.chip:hover { text-decoration: none; background: #f3f5f7; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip b { font-weight: 700; }

/* ---- compare table ---- */
table.compare { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.compare th { text-align: left; color: var(--muted); font-size: .86rem; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.compare td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; word-wrap: break-word; }
table.compare td.label { width: 170px; font-weight: 600; }
table.compare td.state { width: 150px; }
table.compare tr.mismatch td { background: #fff8f7; }
table.compare tr.mismatch td.label { box-shadow: inset 3px 0 0 var(--high); }
table.compare tr.group td { background: #f3f5f8; font-weight: 700; color: var(--brand); padding: 6px 10px; font-size: .86rem; text-transform: uppercase; letter-spacing: .03em; }
.val ol { margin: 0; padding-left: 18px; }
.val ol li + li { margin-top: 6px; }
.val .empty { color: var(--muted); font-style: italic; }
ins { background: var(--ins); text-decoration: none; border-radius: 2px; }
del { background: var(--del); color: #8b1f1f; border-radius: 2px; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
details.edit summary { cursor: pointer; color: var(--accent); font-size: .88rem; list-style: none; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit[open] { margin-top: 6px; }
details.edit form { margin-top: 6px; }
.meta { color: var(--muted); font-size: .8rem; margin-top: 4px; }

/* ---- finding rows ---- */
.finding-msg { color: var(--muted); font-size: .9rem; margin-top: 3px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---- listing header ---- */
.listing-head { display: flex; gap: 18px; align-items: flex-start; }
.listing-head img { width: 110px; height: 110px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.listing-head .info { flex: 1; min-width: 0; }
.tagline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; color: var(--muted); }

/* ---- empty state / steps ---- */
.empty-state { text-align: center; padding: 40px 20px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 14px 40px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.steps li.done::before { content: "✓"; background: var(--ok); }

/* ---- pagination ---- */
.pager { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin-top: 12px; }

/* ---- login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; }
.login-card input { width: 100%; }

.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; background: #fafbfc; }
.dropzone.drag { border-color: var(--accent); background: #eef5fc; }

@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 8px 16px; gap: 6px 12px; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 4px; }
  .userbox { margin-left: auto; }
  .page { padding: 16px 16px 48px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  table.compare td.label { width: 110px; }
  table.compare td.state { width: 96px; }
  .listing-head { flex-direction: column; }
  .userbox .who { display: none; }
}
