.access-entry { margin: 20px 0 26px; display: grid; gap: 10px; }
.access-entry input { width: 100%; }
.access-entry button { justify-self: start; }
input:not([type=radio]):not([type=checkbox]):not([type=range]), select { font: inherit; padding: 10px 12px; border: 1px solid var(--control-border); border-radius: var(--radius-control); color: var(--ink); background: var(--paper); min-width: 0; }
input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
#access-status, #submit-status, #admin-status { overflow-wrap: anywhere; }
#submission-receipt { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* Researcher workspace: one operation and one analysis question at a time. */
.researcher-page { background: var(--paper); }
.researcher-main { max-width: 1328px; padding: 24px 32px 64px; margin: auto; }
.researcher-header, .researcher-toolbar, .researcher-actions, .workspace-toolbar, .view-heading, .filter-result { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.researcher-header { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.researcher-header h1 { margin: 0; font-size: 1.75rem; }
.researcher-main h2 { font-size: 1.3rem; margin: 0; }
.researcher-main h3 { font-size: 1.1rem; margin: 0 0 8px; }
.researcher-main a { color: var(--blue); text-underline-offset: 3px; }
.researcher-page button:not(.primary) { background: var(--paper); border: 1px solid var(--control-border); border-radius: var(--radius-control); padding: 8px 14px; min-height: 44px; }
.researcher-page button:not(.primary):hover:not(:disabled) { background: var(--hover); border-color: var(--focus); }
.researcher-page button:disabled { opacity: .6; }
.researcher-page button.primary { box-shadow: none; }
.researcher-page input, .researcher-page select { caret-color: var(--blue); }
.researcher-page details { font-size: .875rem; color: var(--muted); }
.researcher-page summary { cursor: pointer; width: fit-content; padding: 10px 0; }
.researcher-page summary:hover { color: var(--blue); }
.researcher-actions { justify-content: flex-start; gap: 12px; }
.account-toolbar { margin: 12px 0; }
#signed-in-as, #updated-at { color: var(--muted); font-size: .85rem; margin: 0; }
#admin-status:empty { display: none; }
#admin-status:not(:empty) { padding: 12px 0; color: var(--blue); }
.workspace-toolbar { margin-bottom: 12px; }
.workspace-nav, .plot-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.researcher-page .workspace-nav button, .researcher-page .plot-nav button { border: 0; border-radius: 0; border-bottom: 2px solid transparent; padding: 10px 16px; background: transparent; color: var(--muted); }
.researcher-page .workspace-nav button[aria-pressed=true], .researcher-page .plot-nav button[aria-pressed=true] { border-bottom-color: var(--blue); color: var(--blue); font-weight: 600; }
.researcher-page .workspace-nav button:hover, .researcher-page .plot-nav button:hover { background: var(--soft); border-bottom-color: var(--control-border); }
.synthetic-note { font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.analysis-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; padding: 16px; background: var(--soft); border-radius: var(--radius-card); }
.analysis-filters label, .metric-control { display: grid; gap: 6px; font-size: .875rem; color: var(--muted); min-width: 0; }
.analysis-filters select, .analysis-filters input, .metric-control select { color: var(--ink); min-height: 44px; width: 100%; }
.search-filter { flex: 1 1 230px; }
#filter-scope { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 24px; margin-bottom: 16px; }
.filter-controls[open] { flex-basis: 100%; }
.filter-result { flex: 1 1 420px; margin: 0; align-items: flex-start; }
#analysis-summary { margin: 10px 0; font-size: .875rem; font-variant-numeric: tabular-nums; }
#analysis[aria-busy=true] { opacity: .65; }
.export-menu { text-align: right; }
.export-menu summary { margin-left: auto; color: var(--blue); }
.export-menu .researcher-actions { justify-content: flex-end; padding: 4px 0 12px; }
.plot-nav { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.comparison-key { display: flex; gap: 8px 24px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; margin-bottom: 16px; }
.comparison-key strong { color: var(--ink); font-weight: 600; }
.view-heading { align-items: end; margin: 16px 0 20px; }
.view-heading .chart-note { margin: 0; }
.metric-control { grid-template-columns: auto minmax(180px, 240px); align-items: center; gap: 12px; width: auto; max-width: 100%; }
.analysis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: start; }
.chart-section { min-width: 0; padding: 0 0 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.chart-note { font-size: .875rem; color: var(--muted); margin: 8px 0 16px; max-width: 74ch; }
.chart-legend { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; margin: 12px 0 16px; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 8px; }
.condition-normal::before, .condition-sfv::before, .issue-hit::before, .issue-false::before, .issue-none::before { content: ''; width: 12px; height: 12px; border-radius: 2px; flex: none; background: var(--blue); }
.condition-sfv::before { background: var(--purple); }
.issue-false::before { background: #9c4308; }
.issue-none::before { background: var(--soft); border: 1px solid var(--control-border); }
.median-key { width: 24px; border-top: 2px dashed var(--purple); }
.data-chart { display: block; width: 100%; height: auto; fill: none; stroke: none; font-variant-numeric: tabular-nums; }
#effect-chart, #difference-chart { min-height: 170px; }
#effect-chart .data-chart, #difference-chart .data-chart { max-width: 640px; }
#paired-chart, #tlx-chart, #preference-chart, #trend-chart { max-width: 850px; }
.paired-line, .plot-mark { cursor: pointer; }
.paired-line:hover line, .paired-line:focus line { stroke: var(--ink); stroke-width: 3; }
.plot-mark:hover circle:not(.plot-hit), .plot-mark:focus circle:not(.plot-hit), .paired-line:focus circle { stroke: var(--ink); stroke-width: 3; }
.plot-mark:hover rect:not(.plot-hit), .plot-mark:focus rect:not(.plot-hit) { stroke: var(--ink); stroke-width: 2; }
.plot-mark:hover rect.plot-hit, .plot-mark:focus rect.plot-hit { fill: var(--soft); }
.plot-mark:focus, .paired-line:focus { outline: none; }
.plot-scroll { max-height: 560px; overflow: auto; }
.heatmap-scroll { max-height: none; }
.heatmap-scroll .data-chart { min-width: 720px; max-width: 1000px; }
.plot-scroll:focus-visible, .table-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.plot-person-label { display: grid; gap: 6px; color: var(--muted); }
.plot-person-label select { width: 100%; }
.point-fallback { margin-top: 8px; }
#scatter-selection { margin-top: 12px; }
#scatter-selection p { flex-basis: 100%; margin: 0; }
.collection-counts { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; font-variant-numeric: tabular-nums; }
.collection-counts dt { color: var(--muted); }
.collection-counts dd { margin: 0; font-weight: 600; }
.order-key { padding-left: 18px; margin: 8px 0 0; }
.analysis-method { margin-top: 12px; }
.analysis-method p { max-width: 74ch; margin-top: 8px; }
.invite-section, #records { padding-top: 12px; }
.invite-section > p { color: var(--muted); margin: 12px 0 24px; max-width: 64ch; }
.invite-form { display: flex; gap: 12px; flex-wrap: wrap; }
#new-invite { margin-top: 24px; max-width: 750px; padding-top: 24px; border-top: 1px solid var(--line); }
#new-invite label { display: block; }
#invite-link { width: 100%; margin: 8px 0 12px; }
.researcher-toolbar { margin: 16px 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; text-align: left; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { background: var(--soft); font-size: 13px; }
#records-summary { color: var(--muted); font-size: .875rem; }
#record-detail { position: fixed; inset: 0 0 0 auto; margin: 0; border: 0; border-radius: 0; width: min(760px, 90vw); max-width: none; height: 100dvh; max-height: none; padding: 0 32px 40px; background: var(--paper); color: var(--ink); overflow: auto; }
#record-detail::backdrop { background: #172b4459; }
.detail-header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--paper); padding: 24px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.detail-header h2 { font-size: 1.15rem; overflow-wrap: anywhere; }
.detail-header button { flex: none; }
#detail-receipt { overflow-wrap: anywhere; color: var(--muted); font-size: .85rem; }
.task-detail { margin-top: 32px; }
.task-detail dl { display: grid; grid-template-columns: minmax(110px, 140px) 1fr; gap: 12px 20px; }
.task-detail dt { color: var(--muted); }
.task-detail dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.login-form { display: grid; gap: 10px; max-width: 430px; margin-top: 20px; }
#login-panel { margin-top: 32px; }
.login-form button { margin-top: 12px; justify-self: start; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.scroll-hint { display: none; }
@media(max-width: 900px) {
  .analysis-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media(max-width: 650px) {
  .researcher-main { padding: 24px 16px 48px; }
  .researcher-header { align-items: flex-start; gap: 8px; }
  .researcher-header h1 { font-size: 1.5rem; }
  .researcher-header a { font-size: .875rem; }
  .account-toolbar { align-items: center; margin: 12px 0; }
  .account-toolbar .researcher-actions { gap: 8px; }
  #updated-at { display: none; }
  .workspace-toolbar { gap: 16px; }
  .workspace-toolbar > .primary { width: 100%; }
  .workspace-nav { width: 100%; }
  .researcher-page .workspace-nav button { flex: 1; padding-inline: 8px; }
  .synthetic-note { margin-bottom: 12px; }
  .analysis-filters { gap: 12px; padding: 12px; }
  .analysis-filters label { flex: 1 1 calc(50% - 12px); }
  .analysis-filters .search-filter { flex-basis: 100%; }
  .analysis-filters > button { padding-inline: 10px; }
  #filter-scope { gap: 0 12px; }
  .filter-result { flex-basis: 100%; gap: 0; margin-bottom: 8px; }
  .export-menu { text-align: left; }
  .export-menu summary { margin-left: 0; }
  .export-menu .researcher-actions { justify-content: flex-start; }
  .plot-nav { flex-wrap: nowrap; gap: 0; }
  .researcher-page .plot-nav button { flex: 1; padding: 10px 4px; font-size: .875rem; }
  .comparison-key { margin-bottom: 20px; }
  .view-heading { margin: 16px 0; gap: 12px; }
  .metric-control { grid-template-columns: auto 1fr; width: 100%; }
  .chart-section { padding-bottom: 24px; margin-bottom: 24px; }
  .scroll-hint { display: block; }
  #paired-chart, #tlx-chart, #preference-chart, #trend-chart, #allocation-chart { overflow-x: auto; }
  #record-detail { width: 100vw; padding-inline: 16px; }
  .detail-header { padding-top: 16px; }
  .task-detail dl { grid-template-columns: 100px 1fr; gap: 12px; }
}

.filter-controls > summary { color: var(--blue); min-height: 44px; }
.filter-controls[open] { margin-bottom: 8px; }
.category-filter { display: grid; gap: 4px; color: var(--muted); font-size: .875rem; min-width: 180px; }
.category-filter select { min-height: 44px; }
#analysis-empty { padding: 28px 0 48px; }
.category-editor { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 20px 0 8px; }
.category-editor label { color: var(--muted); }
#category-status { flex-basis: 100%; margin: 0; font-size: .875rem; }
#category-status:empty { display: none; }
@media(max-width: 650px) { .category-filter { width: 100%; grid-template-columns: auto 1fr; align-items: center; gap: 12px; margin-bottom: 8px; } }
