:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #223648;
  background: #f3f6f8;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, select, input, a { -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; }
button, select, .download { border-radius: 7px; }
button, select {
  border: 1px solid #d6e0e7;
  background: #fff;
  color: #2c485c;
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}
button { cursor: pointer; }
button:hover:not(:disabled), select:hover:not(:disabled) { background: #edf6fa; border-color: #8eb4c8; }
button:disabled, select:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid #1884ae; outline-offset: 3px; }
[hidden] { display: none !important; }
a { color: #126b96; text-underline-offset: 3px; }
.workspace { width: min(1400px, calc(100% - 48px)); margin: 12px auto; }
.workspace-tabs { display: flex; gap: 6px; padding: 5px; margin: 18px 0 16px; width: fit-content; border: 1px solid #d7e3e9; border-radius: 11px; background: #eaf0f3; }
.workspace-tabs button { min-width: 120px; min-height: 42px; border-color: transparent; background: transparent; color: #587487; font-size: 14px; font-weight: 650; }
.workspace-tabs [aria-selected="true"] { color: #fff; background: #1b607e; border-color: #1b607e; box-shadow: 0 2px 5px #12394e15; }
.workspace-tabs [aria-selected="true"]:hover { background: #164f69; border-color: #164f69; }
.workspace[data-section="pond"] #download { display: none !important; }
#tank-panel, #pond-panel { min-width: 0; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 10px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
#login-dialog { width: min(380px, calc(100% - 32px)); padding: 22px; border: 1px solid #c8dce6; border-radius: 12px; color: #223648; box-shadow: 0 12px 48px #102c4130; }
#login-dialog::backdrop { background: #102c4166; }
#login-dialog h2 { font-size: 18px; margin-bottom: 18px; }
#login-dialog label { display: block; font-size: 13px; margin-bottom: 7px; }
#admin-password { display: block; width: 100%; }
.eyebrow { color: #518196; font-size: 10px; letter-spacing: .15em; font-weight: 700; margin: 0 0 4px; }
h1 { font-size: clamp(19px, 2.4vw, 22px); line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -.025em; }
.download { flex-shrink: 0; color: #17627a; border: 1px solid #b9d7df; padding: 9px 13px; background: #edf8fa; text-decoration: none; font-size: 12px; font-weight: 600; }
.download:hover { background: #dff1f5; }
.download span { padding-left: 8px; }
.experiment-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.experiment-tabs button { min-height: 38px; padding: 8px 16px; font-size: 13px; font-weight: 600; }
.experiment-tabs [aria-selected="true"] { background: #1b607e; color: #fff; border-color: #1b607e; }
.experiment-tabs [aria-selected="true"]:hover:not(:disabled) { background: #164f69; }
.recording-info { margin-bottom: 12px; padding: 12px 16px 9px; background: #edf4f6; border: 1px solid #dce7ec; border-radius: 10px; }
.recording-metadata { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(5, minmax(0, 1fr)); gap: 10px 18px; margin: 0; }
.recording-metadata dt { margin-bottom: 4px; color: #617b8a; font-size: 11px; font-weight: 500; }
.recording-metadata dd { color: #254d63; font-size: 15px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.recording-metadata time { font-size: 13px; }
.recording-metadata > div:first-child dd { font-size: 13px; }
#recording-source { margin: 9px 0 0; color: #617b8a; font-size: 10px; line-height: 1.5; }
.player-card { background: #fff; border: 1px solid #dce5eb; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 22px #17354d08; }
.video-stage { background: #10171e; position: relative; display: flex; justify-content: center; }
video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: none; background: #10171e; object-fit: contain; }
video:fullscreen { width: 100vw; height: 100vh; }
.video-message { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 28px; color: #c7d6e0; text-align: center; font-size: 14px; pointer-events: none; }
.transport { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 16px; border-bottom: 1px solid #e8eef2; }
.time-block { display: flex; align-items: center; gap: 8px; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #1a8a9a; margin-right: 3px; }
#current-time { font-weight: 700; color: #1a4c66; }
.time-divider, #duration { color: #7b8b98; }
.transport-buttons { display: flex; align-items: center; gap: 6px; }
.speed-label { font-size: 11px; color: #738693; margin-left: 9px; }
select { min-width: 60px; }
.chart-heading { padding: 8px 16px 2px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h2 { font-size: 13px; margin: 0 0 4px; font-weight: 650; }
.chart-heading p { margin: 0; font-size: 11px; color: #738693; }
.chart-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.chart-controls label { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; color: #3a6d85; }
.frequency-note { margin: 2px 16px 0; color: #738693; font-size: 11px; line-height: 1.5; }
.frequency-note:empty { display: none; }
.window-label { white-space: nowrap; background: #f0f6f9; color: #3a6d85; border: 1px solid #e0ebf0; padding: 6px 9px; border-radius: 5px; font: 11px "Cascadia Mono", Consolas, monospace; }
.chart-stage { position: relative; width: 100%; aspect-ratio: 1280 / 480; overflow: hidden; background: #fff; }
.chart-image { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.signal-layer { clip-path: inset(0 100% 0 0); }
.cursor { position: absolute; width: 1px; background: #e04b50; transform: translateX(-.5px); pointer-events: none; box-shadow: 0 0 0 .25px #e04b5030; }
.chart-loading { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: #748794; font-size: 13px; background: #fafcfd; }
.is-loading .chart-loading { display: flex; }
.is-loading .chart-image, .is-loading .cursor { visibility: hidden; }
.chart-footer { padding: 0 16px 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 10px; color: #7b8e9b; }
.chart-footer > span:first-child { display: flex; align-items: center; gap: 6px; }
.cursor-key { display: inline-block; width: 1px; height: 10px; background: #e04b50; }
.details { padding: 8px 3px 0; font-size: 11px; line-height: 1.65; color: #728490; }
.details p { margin: 0 0 6px; }
.alignment { color: #5a737e; }
summary { display: inline-block; cursor: pointer; color: #456c80; }
summary::before { content: "+ "; font-family: monospace; }
details[open] summary::before { content: "− "; }
dl { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; margin: 10px 0; }
dt { font-weight: 600; }
dd { margin: 0; overflow-wrap: anywhere; }
.source-note { max-width: 800px; }
.export-status { margin-top: 5px !important; }

@media (max-width: 1000px) {
  .recording-metadata { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .workspace { width: calc(100% - 24px); margin: 16px auto; }
  .page-header { align-items: flex-start; flex-wrap: wrap; }
  .eyebrow { font-size: 8px; }
  .download { padding: 7px 9px; font-size: 10px; }
  .recording-info { padding: 12px; }
  .recording-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transport { flex-wrap: wrap; padding: 10px 12px; }
  .transport-buttons { flex-wrap: wrap; }
  .speed-label { margin-left: 4px; }
  .chart-heading { padding: 12px 12px 5px; align-items: flex-start; flex-wrap: wrap; }
  .chart-heading p { max-width: 220px; line-height: 1.5; }
  .window-label { font-size: 9px; padding: 5px; }
  .chart-footer { padding: 2px 12px 11px; font-size: 9px; flex-wrap: wrap; }
  dl { grid-template-columns: 110px 1fr; }
}

/* Editing remains separate from the wide media stage; public viewers hide these controls. */
.experiment-navigation { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.parent-tabs { margin-bottom: 8px; }
.add-experiment { min-height: 38px; padding: 8px 14px; font-size: 13px; border-style: dashed; }
.phase-tabs { padding-bottom: 10px; border-bottom: 1px solid #dce5eb; }
.phase-tabs button { min-height: 34px; padding: 6px 14px; font-weight: 500; }
.phase-tabs [aria-selected="true"] { background: #e1eff4; color: #174f68; border-color: #9ec3d3; }
.phase-tabs [aria-selected="true"]:hover:not(:disabled) { background: #d4e8f0; }
.editor-card { background: #fff; border: 1px solid #dce5eb; border-radius: 10px; padding: 13px 16px; margin-bottom: 12px; font-size: 13px; }
.review-panel { margin-top: 12px; }
.review-panel h2 { font-size: 14px; }
.review-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.review-panel label { display: block; color: #456c80; font-size: 12px; margin-bottom: 6px; }
.review-panel textarea { display: block; width: 100%; resize: vertical; min-height: 110px; padding: 9px; border: 1px solid #bacdd7; border-radius: 6px; color: #254d63; background: #fff; font: inherit; line-height: 1.6; }
.create-experiment { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.create-experiment input { flex: 1; min-width: 160px; }
input { border: 1px solid #bacdd7; border-radius: 6px; min-height: 36px; padding: 7px 9px; background: #fff; color: #254d63; max-width: 100%; }
input:disabled { opacity: .6; }
.metadata-editor { margin-top: 12px; border-top: 1px solid #dce7ec; padding-top: 9px; font-size: 13px; }
.metadata-editor summary, .upload-editor summary { font-size: 12px; font-weight: 600; padding: 3px 0; }
.metadata-inputs, .upload-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px 18px; margin: 14px 0 10px; }
.metadata-inputs label, .upload-inputs label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #456c80; min-width: 0; }
.field-help { color: #617b8a; font-size: 11px; line-height: 1.6; margin: 8px 0 12px; }
.form-message { color: #254d63; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
span.form-message { margin-left: 8px; }
.create-experiment .form-message { flex-basis: 100%; margin: 0; }
.workspace-message { color: #254d63; padding: 10px 14px; border: 1px solid #c8dce6; background: #edf4f6; border-radius: 8px; font-size: 13px; }
.workspace-message.is-error { color: #8b3d26; background: #fff2ed; border-color: #edcebf; }
.empty-state { padding: 35px 20px; border: 1px dashed #b7cdd9; border-radius: 12px; background: #fff; text-align: center; margin-bottom: 12px; }
.empty-state h2 { font-size: 19px; }
.empty-state p { color: #617b8a; font-size: 13px; line-height: 1.6; }
.jobs-panel { margin: 16px 0; padding: 15px 16px; border: 1px solid #dce5eb; border-radius: 10px; background: #fff; }
.jobs-panel h2 { font-size: 14px; }
.jobs-panel ul { list-style: none; padding: 0; margin: 0; }
.job { border-top: 1px solid #e4edf1; padding: 12px 0 2px; margin-top: 10px; font-size: 12px; line-height: 1.6; }
.job p { color: #617b8a; margin: 4px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.job-failed strong { color: #9a3e25; }
.job-completed strong { color: #227258; }
@media (max-width: 700px) {
  .metadata-inputs, .upload-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .upload-inputs label { grid-column: 1 / -1; }
  .parent-tabs button { padding: 8px 10px; }
  .editor-card { padding: 12px; }
  span.form-message { display: block; margin: 8px 0 0; }
}
@media (max-width: 420px) {
  .metadata-inputs { grid-template-columns: 1fr; }
}
