/* Study 05: controls layered over the accepted graph and optical material. */
.runs-study .run-heading { gap: 10px; }
.runs-study #catalog-open { width: 40px; height: 44px; flex-shrink: 0; }
.run-picker { display: flex; align-items: center; gap: 9px; padding: 0 8px; min-height: 44px; border: 0; border-radius: 7px; background: transparent; white-space: nowrap; }
.run-picker:hover, .run-picker[aria-expanded='true'] { background: var(--field); }
.run-picker > .icon:first-child { color: var(--muted); width: 17px; height: 17px; }
.run-picker .disclosure { width: 13px; height: 13px; transform: rotate(90deg); color: var(--muted); transition: transform 160ms; }
.run-picker[aria-expanded='true'] .disclosure { transform: rotate(-90deg); }
.runs-study #run-context { display: inline; font-size: 13px; font-weight: 550; color: var(--ink); }
.runs-study .nav-run-state { margin: 0; font-size: 11px; white-space: nowrap; }
.run-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.run-actions > button { min-height: 44px; }
.run-actions .primary { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; padding: 0 16px; }
.run-actions .icon { width: 16px; height: 16px; }
.stop-control { width: 44px; height: 44px; color: var(--muted); }
.stop-control:hover { color: var(--ink); }
.archive-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; border-top: 1px solid var(--line); margin-top: 5px; font-size: 11px; color: var(--muted); }
.archive-line button { display: flex; align-items: center; gap: 6px; font-size: 11px; min-height: 40px; padding: 4px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--accent); }
.archive-line button:hover { background: var(--field); }
.archive-line .icon { width: 14px; height: 14px; }
.runs-study .nav-detail, .runs-study .nav-tree { top: var(--panel-top, 128px); height: calc(100% - var(--panel-top, 128px) - 74px); }
.run-popover { position: absolute; z-index: 6; inset: auto; margin: 0; padding: 0; width: 368px; max-width: none; max-height: none; color: var(--ink); border-radius: 12px; overflow: hidden; }
.run-popover[open] { display: flex; flex-direction: column; }
.run-popover > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px 20px; gap: 12px; flex-shrink: 0; }
.run-popover h2 { font-size: 15px; font-weight: 550; letter-spacing: -.015em; }
.run-popover .icon-button { flex-shrink: 0; width: 44px; height: 44px; }
.run-popover .popover-scroll { overflow: auto; overscroll-behavior: contain; min-height: 0; flex: 1; scrollbar-width: thin; }
.run-popover form { display: flex; flex-direction: column; min-height: 0; }
.form-content { padding: 6px 20px 22px; font-size: 13px; line-height: 1.65; }
.run-popover footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
.run-popover footer button { min-height: 44px; font-size: 13px; padding: 8px 16px; }
.popover-note { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 18px; }
.run-popover::backdrop { background: rgb(10 20 30 / .24); }
.run-popover.entering, .run-popover.leaving { animation: rise var(--duration) cubic-bezier(.2,.8,.25,1) both; }
.run-popover.leaving { animation-direction: reverse; }
.history-scroll { padding: 0 10px 12px; }
.history-zone { font-size: 11px; color: var(--muted); margin: 18px 10px 8px; }
.definition-row, .history-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 10px; min-height: 64px; background: transparent; border: 0; border-radius: 7px; text-align: left; }
.definition-row { border-bottom: 1px solid var(--line); border-radius: 0; }
.definition-row > .icon:first-child { width: 17px; height: 17px; color: var(--muted); }
.definition-row strong { display: block; font-size: 13px; font-weight: 500; }
.definition-row small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.history-main { flex: 1; min-width: 0; }
.history-row-top, .history-row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.history-row-top { margin-bottom: 6px; }
.history-row strong { font-size: 13px; font-weight: 550; }
.history-row time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.history-row-bottom { color: var(--muted); font-size: 11px; }
.selected-check { margin-left: auto; flex-shrink: 0; width: 14px; height: 14px; color: var(--accent); visibility: hidden; }
[aria-current='true'] > .selected-check { visibility: visible; }
.history-row[aria-current='true'], .definition-row[aria-current='true'] { background: color-mix(in srgb, var(--accent) 10%, var(--field)); box-shadow: inset 2px 0 0 var(--accent); border-radius: 7px; }
@media (hover: hover) { .history-row:hover, .definition-row:hover { background: var(--field); } }
.schedule-switch { position: relative; display: flex; gap: 14px; align-items: center; min-height: 44px; cursor: pointer; margin-bottom: 20px; }
.schedule-switch input { position: absolute; right: 0; width: 44px; height: 32px; margin: 0; opacity: 0; cursor: pointer; }
.switch-track { margin-left: auto; width: 38px; height: 22px; border: 1px solid var(--muted); border-radius: 12px; background: var(--field); flex-shrink: 0; }
.switch-track::before { content: ''; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); margin: 3px; transition: transform 160ms, background 160ms; }
.schedule-switch input:checked + .switch-track { border-color: var(--accent); background: var(--accent-wash); }
.schedule-switch input:checked + .switch-track::before { transform: translateX(16px); background: var(--accent); }
.schedule-switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 3px; }
#schedule-fields { padding: 0; margin: 0; border: 0; min-width: 0; }
#schedule-fields:disabled { opacity: .5; }
.field-label { display: block; color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 18px; }
.weekdays label { position: relative; cursor: pointer; }
.weekdays input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.weekdays span { display: grid; place-items: center; height: 44px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--muted); }
.weekdays input:checked + span { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: var(--accent-wash); box-shadow: inset 0 -2px var(--accent); }
.weekdays input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -3px; }
.field-label input, .field-label select { display: block; box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--ink); padding: 8px 10px; font-family: inherit; font-size: 16px; margin-top: 7px; }
.time-field { margin-bottom: 16px; }
.schedule-next { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; font-size: 12px; }
.form-error, .danger { color: #a23832; }
body[data-theme='dark'] .form-error, body[data-theme='dark'] .danger { color: #ffaaa3; }
.launch-summary { margin: 0; }
.launch-summary div + div { margin-top: 20px; }
.launch-summary dt { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.launch-summary dd { margin: 0; }
.active-run-note { margin-top: 20px; padding: 12px; border-left: 2px solid var(--line); background: var(--field); font-size: 12px; }
@media (max-width: 1024px) {
  .runs-study .nav-workspace { height: clamp(490px, 64svh, 650px); }
  .runs-study .nav-detail, .runs-study .nav-tree { top: auto; height: min(600px, 85dvh); }
  .run-popover { position: fixed; inset: auto 8px max(8px, env(safe-area-inset-bottom)); width: calc(100vw - 16px); max-height: calc(100dvh - 24px); border-radius: 15px; }
  .history-panel { max-height: min(630px, calc(100dvh - 24px)); }
  .runs-study .study-header nav { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 700px) {
  .runs-study .run-heading { gap: 4px; flex-wrap: wrap; }
  .runs-study #catalog-open { width: 32px; }
  .run-picker { padding: 0 4px; gap: 6px; }
  .run-picker > .icon:first-child { display: none; }
  .runs-study .nav-run-state { margin-left: auto; font-size: 10px; gap: 6px; }
  .run-actions { width: 100%; margin: 2px 0 0; padding-top: 6px; border-top: 1px solid var(--line); gap: 6px; }
  #schedule-open { flex: 1; min-width: 0; padding: 8px; font-size: 12px; }
  #start-open { padding: 0 12px; font-size: 12px; }
  .stop-control { width: 40px; }
  .runs-study .study-header { align-items: flex-start; gap: 8px; }
  .runs-study .study-title h1 { font-size: 19px; }
  .runs-study .study-header nav { gap: 0; }
  .runs-study .study-header nav .quiet-link { font-size: 11px; padding: 0; }
  .archive-line { font-size: 10px; }
  .form-content { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) { .run-popover.entering, .run-popover.leaving { animation: none; } .run-picker .disclosure, .switch-track::before { transition: none; } }
.queue-line { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.queue-line[hidden], .demo-finish[hidden] { display: none; }
.queue-line button { color: var(--ink); border: 0; background: transparent; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.demo-finish { margin-top: 8px; font-size: 12px; }
#concurrency-study select, #concurrency-study input { width: 100%; margin-top: 8px; min-height: 44px; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--field); color: var(--ink); font: inherit; }
@media (max-width: 600px) { .queue-line { align-items: flex-start; flex-wrap: wrap; gap: 2px 10px; } #concurrency-open { flex: 0 0 40px; } }
