/* MacPaw Brand Book palette (🩷 MacPaw Brand Book, 2026-07):
   Pink #FF00AA (core) · Positive #34C759 · Warning #FFCC00 · Negative #FF0033
   Greys F2F2F2→1A1A1A · light surfaces, capsule buttons, heavy headings. */
:root {
  --bg: #ffffff; --panel: #f2f2f2; --panel2: #ffffff; --ink: #000000;
  --muted: #666666; --accent: #ff00aa; --accent2: #cc0088;
  --line: #e5e5e5; --ok: #34c759; --warn: #ffcc00; --bad: #ff0033;
  --pink-soft: #ffe5f6;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: .2px; color: var(--ink); font-size: 17px; }
.brand .paw { color: var(--accent); margin-right: 2px; }
.brand .by { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }
.topbar nav { display: flex; gap: 16px; align-items: center; }
.who { color: var(--muted); font-size: 13px; }

.wrap { max-width: 960px; margin: 0 auto; padding: 28px 22px 80px; }
h1 { font-size: 28px; font-weight: 800; margin: 0 0 6px; }
h2 { font-size: 18px; font-weight: 800; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--bad); }
.back { display: inline-block; margin-bottom: 14px; }

.card { background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; margin: 0 0 14px; }
.card.narrow { max-width: 420px; margin: 40px auto; }

.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input, textarea { background: var(--panel2); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; padding: 9px 12px; font: inherit; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; }

/* Brand pill buttons */
.btn { display: inline-block; background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
  font: inherit; font-size: 14px; cursor: pointer; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: #ffffff; border-color: var(--accent);
  font-weight: 700; }
.btn.primary:hover { background: var(--accent2); border-color: var(--accent2); }
.btn.ghost { background: transparent; }
.btn.big { align-self: flex-start; padding: 12px 24px; }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #ffffff; border-color: var(--bad); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn.primary:disabled:hover, .btn.primary[aria-disabled="true"]:hover {
  background: var(--accent); border-color: var(--accent); }

.sessions { list-style: none; padding: 0; margin: 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.row-main .sid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.row-main .meta { margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.row-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* Brand pill badges (full-color, like the Greys & Web semantic chips) */
.badge { font-size: 12px; padding: 2px 10px; border-radius: 999px;
  border: 1px solid transparent; font-weight: 600; }
.s-ready { background: var(--ok); color: #ffffff; }
.s-proc { background: var(--panel2); color: var(--muted); border-color: var(--line); }
.s-rec { background: var(--pink-soft); color: var(--accent2); }
.s-fail { background: var(--bad); color: #ffffff; }
.s-done { background: var(--accent); color: #ffffff; }
.s-std { background: var(--panel2); color: var(--muted); border-color: var(--line); }

.progress { color: var(--muted); margin: 6px 0 16px; font-size: 14px; }
.qa .q .qtext { color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.saved-line { min-height: 16px; }
.saved { color: var(--ok); font-size: 12px; font-weight: 600; }

.pager { display: flex; align-items: center; gap: 10px; }
.pager .spacer { flex: 1; }

.reveal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .reveal-grid { grid-template-columns: 1fr; } }
.col .role { font-size: 17px; font-weight: 700; color: var(--accent2); margin-bottom: 12px; }
.pf-sec { margin: 10px 0; }
.pf-sec h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); }
.pf-sec ul { margin: 0; padding-left: 18px; }
.pf-sec li { margin: 2px 0; }
.pf-dl { margin: 0; }
.pf-dl dt { font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); margin-top: 8px; }
.pf-dl dd { margin: 2px 0 0; font-size: 14px; }
.tbl.queries { table-layout: fixed; }
.tbl.queries .t-time { width: 140px; }
.tbl.queries .t-query { width: 55%; }
.tbl.queries td { vertical-align: top; overflow-wrap: anywhere; }
.query-cell summary { display: block; cursor: pointer; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.query-text { margin-top: 6px; max-height: 320px; overflow-y: auto;
  white-space: pre-wrap; overflow-wrap: anywhere; }

/* Stage N Part 3 — emotion chips + accuracy ratings */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.chip { flex-direction: row; align-items: center; gap: 6px; color: var(--ink);
  font-size: 13px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; position: relative; }
.chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.rate-row { display: flex; align-items: center; gap: 12px; margin: 5px 0; }
.rate-label { width: 110px; font-size: 13px; color: var(--muted); }
.rate-opts { display: flex; gap: 10px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Confirmation modal (delete session, …) */
.modal-overlay { position: fixed; inset: 0; background: rgba(26, 26, 26, .55);
  display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-overlay[hidden] { display: none; }
.modal { max-width: 420px; margin: 16px; }
.modal-actions { display: flex; gap: 12px; margin-top: 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.stat { text-align: center; }
.stat-n { font-size: 28px; font-weight: 800; color: var(--accent); }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
.bar-label { width: 90px; font-size: 13px; color: var(--muted); }
.bar { flex: 1; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; height: 14px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); }
.bar-n { width: 44px; text-align: right; font-size: 13px; }

.consent-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.consent-main .clabel { font-weight: 700; }
.consent-choices { display: flex; gap: 12px; flex-shrink: 0; }
.choice { flex-direction: row; align-items: center; gap: 5px; color: var(--ink); font-size: 13px; }

.banner { background: var(--pink-soft); border: 1px solid var(--accent);
  color: var(--accent2); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px;
  font-weight: 600; }
.banner-cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

.new-profile { border-color: var(--ok); }
.new-profile pre { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; overflow-x: auto; font-size: 13px; }
.copy-row { display: flex; gap: 10px; }
.inline-form { flex-direction: row; flex-wrap: wrap; align-items: center; }
.inline-form input { width: auto; flex: 1; min-width: 180px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px 10px; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl tr.hl td { background: var(--pink-soft); }

.sources { list-style: none; padding: 0; margin: 0 0 8px; }
.sources li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.src { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--ink); }
.src input { width: auto; margin-top: 3px; }

.stage1 h2 { margin-bottom: 4px; }
.stage1 .row-actions { margin-top: 10px; }

.annot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px; }
.annot-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.annot-row input[type="text"] { flex: 1; min-width: 180px; }

.card.center { text-align: center; margin-top: 60px; }
.card.center h1 { font-size: 22px; }
.spinner { width: 44px; height: 44px; margin: 8px auto 16px;
  border-radius: 50%; border: 4px solid var(--pink-soft);
  border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Logout is a POST form (CSRF-safe); render its submit button as a nav link. */
.topbar nav .logout-form { margin: 0; display: flex; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit;
  color: var(--accent2); cursor: pointer; }

fieldset.opts { border: 0; margin: 0; padding: 0; }
fieldset.opts legend { padding: 0; }
fieldset.opts .choice { display: flex; gap: .5rem; align-items: center; margin: .35rem 0; }
fieldset.opts .other-text { width: 100%; margin-top: .35rem; }

.choice-card { cursor: pointer; }
.choice-card input[type="radio"] { margin-right: .5rem; }
.review-item .claim { margin: 0 0 .5rem; }
.review-item.removed .claim { text-decoration: line-through; opacity: .6; }
.review-reason { margin-top: .5rem; padding-left: 1.25rem; }
.pdf-frame { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: 12px; }
.actions-row { display: flex; gap: 6px; align-items: center; }
.actions-row form { margin: 0; }

/* CloudResearch Connect study (AIR-568) */
.s-skip { background: var(--panel2); color: var(--bad); border-color: var(--bad); }
.study .head-row form { margin: 0; }
.app-download h2, .app-download p { margin: 0; }
.app-download p { margin-top: 4px; }
.study .hint { background: var(--pink-soft); border-radius: 10px; padding: 8px 12px;
  color: var(--accent2); font-weight: 600; }
.study-grid td { vertical-align: top; }
.study-grid .btn.small { margin-left: 6px; }
.mono-sm { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.steps { padding-left: 20px; }
.steps li { margin: 0 0 14px; }
.steps .row-actions { margin-top: 8px; }
.creds { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px;
  align-items: center; margin: 0; }
.creds dt { color: var(--muted); font-size: 13px; }
.creds dd { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.creds code, .code-pill { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 10px; font-size: 14px; overflow-wrap: anywhere; }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.health .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.health.ok .dot { background: var(--ok); }
.grid-cell { font-size: 12px; min-width: 110px; }
.grid-cell .line { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin: 2px 0; }
.grid-cell form { margin: 2px 0 0; }
.table-scroll { overflow-x: auto; }
.filters { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.filters label { flex-direction: column; }
select { background: var(--panel2); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; padding: 8px 10px; font: inherit; }
.project-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px; align-items: end; }
.project-form .check { flex-direction: row; align-items: center; gap: 6px; }
@media (max-width: 600px) {
  .row { flex-direction: column; align-items: flex-start; }
  .study .head-row, .app-download .head-row { flex-direction: column; align-items: flex-start; }
}
