/* ------------------------------------------------------------------
   Participant panel.
   Loaded after site.css, which supplies the tokens, buttons and pills.
   ------------------------------------------------------------------ */

.panel-body { background: var(--canvas); min-height: 100vh; display: flex; flex-direction: column; }

/* ---------------------------------------------------------- app header */
.panel-header { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.panel-header-inner { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 28px); display: flex; align-items: center; gap: 28px; min-height: 62px; }
.panel-nav { display: flex; gap: 2px; margin-right: auto; }
.panel-nav a { font-size: 0.93rem; font-weight: 500; color: var(--ink-2); text-decoration: none; padding: 8px 13px; border-radius: var(--r-sm); }
.panel-nav a:hover { background: var(--canvas-deep); color: var(--ink); }
.panel-nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-deep); font-weight: 600; }
.panel-id { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-3); }
.panel-account { display: flex; align-items: center; gap: 12px; }
.panel-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-deep); display: grid; place-items: center; font-weight: 700; font-size: 0.82rem; flex: none; }
@media (max-width: 640px) { .panel-header-inner { gap: 14px; min-height: 56px; } .panel-nav a { padding: 8px 9px; font-size: 0.88rem; } .panel-id { display: none; } }

/* ---------------------------------------------------------- page frame */
.panel-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(22px, 4vw, 40px) clamp(16px, 3vw, 28px) 72px; }
.panel-columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(20px, 3vw, 36px); align-items: start; }
/* On a phone the studies are the point of the page, so the account cards follow them. */
@media (max-width: 960px) { .panel-columns { grid-template-columns: 1fr; } }

.panel-head { margin-bottom: 22px; }
.panel-head h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); margin-bottom: 6px; }
.panel-head p { margin: 0; color: var(--ink-2); max-width: 62ch; }

.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel-card + .panel-card { margin-top: 16px; }
.panel-card-head { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel-card-head h2 { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.panel-card-body { padding: 18px; }

/* ---------------------------------------------------------- study list */
.study-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.study-search { flex: 1 1 220px; min-width: 0; }
.study-search input { width: 100%; }
/* The shared form rule sets width:100%, which would make the select claim a whole row. */
.study-toolbar select { flex: 0 0 auto; width: auto; min-width: 165px; }
.study-toggle { display: inline-flex; align-items: center; gap: 9px; font-size: 0.9rem; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.study-toggle input { width: 16px; height: 16px; accent-color: var(--brand); }

.study-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.study-list > li + li { border-top: 1px solid var(--line); }

.study-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 4px 20px; padding: 18px; align-items: start; }
.study-reward { font-family: var(--font-mono); font-size: 1.22rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; }
.study-reward small { display: block; font-family: var(--font-sans); font-size: 0.72rem; font-weight: 400; color: var(--ink-3); letter-spacing: 0; margin-top: 3px; }
.study-main h3 { margin: 0 0 5px; font-size: 1.04rem; line-height: 1.35; }
.study-main h3 a { color: var(--ink); text-decoration: none; }
.study-main h3 a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.study-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.85rem; color: var(--ink-3); margin: 0; }
.study-odds { margin: 9px 0 0; font-size: 0.85rem; color: var(--ink-2); }
.study-action { align-self: center; }
.study-blocked { color: var(--ink-3); font-size: 0.85rem; max-width: 22ch; text-align: right; align-self: center; }
.study-row.is-blocked .study-reward, .study-row.is-blocked .study-main h3 a { color: var(--ink-3); }
@media (max-width: 720px) {
  .study-row { grid-template-columns: 1fr; gap: 10px; }
  .study-reward { font-size: 1.1rem; }
  .study-reward small { display: inline; margin-left: 6px; }
  .study-blocked, .study-action { text-align: left; max-width: none; }
}

.panel-empty { padding: 44px 18px; text-align: center; color: var(--ink-2); }
.panel-empty h3 { margin-bottom: 6px; }
.panel-empty p { margin: 0 auto 18px; max-width: 46ch; }

/* ---------------------------------------------------------- sidebar */
.panel-aside { display: grid; gap: 16px; position: sticky; top: 86px; }
@media (max-width: 960px) { .panel-aside { position: static; } }
.aside-earnings { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 600; letter-spacing: -0.03em; margin: 0; }
.aside-note { margin: 4px 0 0; font-size: 0.84rem; color: var(--ink-3); }
.aside-rows { list-style: none; margin: 0; padding: 0; }
.aside-rows li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.89rem; }
.aside-rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.aside-rows dt, .aside-rows span:first-child { color: var(--ink-2); }
.aside-rows b { font-weight: 600; font-variant-numeric: tabular-nums; }

.meter { height: 6px; border-radius: 999px; background: var(--canvas-deep); overflow: hidden; margin: 12px 0 10px; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }

/* ---------------------------------------------------------- wizard */
.wizard { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; max-width: 940px; margin: 0 auto; }
@media (max-width: 840px) { .wizard { grid-template-columns: 1fr; gap: 24px; } }

.wizard-rail { list-style: none; margin: 0; padding: 0; position: sticky; top: 86px; }
@media (max-width: 840px) { .wizard-rail { position: static; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; } }
.wizard-rail li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 0.91rem; color: var(--ink-3); white-space: nowrap; }
.wizard-rail .dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; }
.wizard-rail .is-done .dot { background: var(--brand); border-color: var(--brand); }
.wizard-rail .is-done .dot::after { content: ""; width: 9px; height: 5px; border-left: 1.6px solid #fff; border-bottom: 1.6px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.wizard-rail .is-current { color: var(--ink); font-weight: 600; }
.wizard-rail .is-current .dot { border-color: var(--brand); border-width: 5px; }
@media (max-width: 840px) { .wizard-rail li { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.84rem; } }

.wizard-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: clamp(22px, 3.5vw, 36px); }
.wizard-progress { font-size: 0.82rem; color: var(--ink-3); margin: 0 0 6px; }
.wizard-panel h1 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 1.95rem); margin-bottom: 8px; }
.wizard-panel > p.blurb { color: var(--ink-2); max-width: 60ch; margin: 0 0 28px; }
.wizard-actions { display: flex; align-items: center; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.wizard-actions .spacer { margin-left: auto; }

/* ---------------------------------------------------------- forms */
.field { margin-bottom: 22px; }
.field:last-of-type { margin-bottom: 0; }
.field > label, .field > .legend { display: block; font-weight: 600; font-size: 0.94rem; margin-bottom: 7px; }
.field .help { display: block; font-size: 0.83rem; color: var(--ink-3); margin: -3px 0 8px; line-height: 1.5; }
.field .error { color: var(--block); font-size: 0.85rem; margin: 7px 0 0; }
.field.is-locked > label::after { content: "Set once"; float: right; font-weight: 400; font-size: 0.76rem; color: var(--ink-3); }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; font: inherit; font-size: 0.97rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 11px 13px; transition: border-color .14s;
}
/* Same quiet up-down indicator the marketing forms use, never a filled arrow. */
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M2 5.2 5 2.2l3 3M2 8.8l3 3 3-3' fill='none' stroke='%236f7c80' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-size: 10px 14px; background-position: right 15px center; background-repeat: no-repeat; }
textarea { min-height: 110px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--block); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 18px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; max-height: 260px; overflow-y: auto; }
.checks label { display: flex; align-items: center; gap: 9px; font-size: 0.92rem; padding: 5px 0; cursor: pointer; }
.checks input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }

.consent { display: flex; gap: 11px; align-items: flex-start; font-size: 0.9rem; color: var(--ink-2); line-height: 1.55; }
.consent input { width: 17px; height: 17px; accent-color: var(--brand); flex: none; margin-top: 2px; }

/* ---------------------------------------------------------- review list */
.review-group + .review-group { margin-top: 26px; }
.review-group h2 { font-size: 1.02rem; margin-bottom: 10px; }
.review { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.review li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 6px 18px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.review dt, .review .q { color: var(--ink-2); font-size: 0.9rem; }
.review dd, .review .a { margin: 0; font-weight: 600; font-size: 0.93rem; }
.review .a.empty { font-weight: 400; color: var(--ink-3); }
.review a.edit { font-size: 0.86rem; }
@media (max-width: 620px) { .review li { grid-template-columns: 1fr auto; } .review .q { grid-column: 1 / -1; } }

/* ---------------------------------------------------------- focused auth pages */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); background: var(--canvas); }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-pitch { display: none; } }
.auth-form-side { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 5vw, 64px); }
.auth-form { width: 100%; max-width: 430px; margin: 0 auto; }
.auth-form h1 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); margin-bottom: 8px; }
.auth-form > p.lede { color: var(--ink-2); margin-bottom: 28px; font-size: 1rem; }
.auth-alt { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--ink-2); }
.auth-pitch { background: var(--night); color: var(--night-ink); padding: clamp(32px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; }
.auth-pitch h2 { color: #fff; font-size: 1.5rem; max-width: 18ch; }
.auth-pitch ul { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 18px; }
.auth-pitch li { display: grid; gap: 3px; }
.auth-pitch b { color: #fff; font-size: 0.97rem; }
.auth-pitch span { color: var(--night-ink-2); font-size: 0.9rem; line-height: 1.55; }

/* ---------------------------------------------------------- misc */
.panel-flash { background: var(--pass-tint); border: 1px solid rgba(30, 122, 76, 0.26); color: #14562f; border-radius: var(--r-sm); padding: 12px 15px; font-size: 0.92rem; margin-bottom: 20px; }
.panel-note { background: var(--canvas-deep); border-radius: var(--r-sm); padding: 14px 16px; font-size: 0.89rem; color: var(--ink-2); line-height: 1.6; }
.panel-back { display: inline-block; font-size: 0.9rem; margin-bottom: 14px; }
