#modal:has(.research-export-form) { width:min(920px, calc(100% - 24px)); }
.research-export-form { display:grid; gap:12px; }
.research-export-form p { margin:0; }
.research-settings { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr)); gap:10px 14px; }
.research-settings label, .research-tier-picker { min-width:0; }
.research-settings select, .research-settings input:not([type=checkbox]), .research-tier-picker select { display:block; width:100%; margin-block-start:4px; }
.research-export-form [hidden] { display:none !important; }
.research-category { border:1px solid #d6e6ef; border-radius:12px; padding:10px 12px; background:#f7fbfd; }
.research-category summary { font-weight:700; cursor:pointer; }
.research-category[open] summary { margin-block-end:10px; }
.research-category-tools { display:flex; align-items:end; gap:8px; flex-wrap:wrap; }
.research-category-tools .research-tier-picker { display:flex; align-items:end; gap:8px; flex-wrap:wrap; }
.research-measure { display:grid; grid-template-columns:minmax(0,1fr) minmax(0, .65fr); gap:10px; border-block-start:1px solid #dceaf2; padding-block:8px; margin-block-start:6px; }
.research-measure label:first-child { min-width:0; }
.research-measure small { display:block; margin-inline-start:22px; color:#466783; line-height:1.5; }
.research-measure .pill { margin-inline-start:5px; }
.research-band { font-size:.8rem; direction:ltr; unicode-bidi:isolate; }
.research-extra-tier { display:flex; align-items:center; gap:5px; }
.research-export-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; background:white; border-block-start:1px solid #dceaf2; padding-block:10px; }
.research-export-actions p { flex-basis:100%; }
.research-preview-table { overflow:auto; max-height:265px; border:1px solid #d6e6ef; border-radius:8px; }
.research-preview-table table { width:100%; border-collapse:collapse; font-size:.8rem; }
.research-preview-table th, .research-preview-table td { padding:6px; border-block-end:1px solid #dceaf2; text-align:start; }
.research-preview-table th { position:sticky; inset-block-start:0; background:#eaf5fb; }
@media(max-width:560px) { .research-measure { grid-template-columns:1fr; } }
.research-f0 { display:grid; gap:8px; }
.research-f0 h3 { margin:0; }
.research-f0 fieldset { display:grid; gap:8px; min-width:0; margin:0; padding:0; border:0; }
.research-f0-representations { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr)); gap:4px 10px; }
#research-f0-warning:empty { display:none; }
#research-f0-warning { color:#8c3427; }
.annotation-file-card { display:grid; gap:6px; align-content:start; border:1px solid #d6e6ef; border-radius:12px; padding:12px; min-width:0; }
.annotation-file-card input { max-width:100%; }
.annotation-preview-tiers { max-height:240px; overflow:auto; }
.annotation-tier-manager { display:grid; gap:8px; }
.annotation-tier-edit { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.annotation-tier-edit input { flex:1; min-width:8em; }

dialog:has(#acoustic-figure-dialog) {width:min(1140px,calc(100% - 24px));max-height:92dvh}
.acoustic-figure-layout {display:grid;grid-template-columns:minmax(0,1.7fr) minmax(260px,1fr);gap:20px;align-items:start}
.figure-export-card {margin:12px 0;border-inline-start:3px solid #1394b8}
.figure-preview-pane {position:sticky;top:0;min-width:0;padding:14px;border:1px solid #d5e4ec;border-radius:14px;background:#edf5f9}
.figure-preview-label {display:flex;align-items:center;gap:8px;margin-block-end:12px;font-weight:750;color:#164763}
.figure-sheet {min-height:125px;max-height:58dvh;overflow:auto;background:#fff;border-radius:6px;text-align:center}
.figure-sheet img {display:block;width:100%;height:auto}
.figure-sheet img[hidden] {display:none}
.figure-sheet p {padding:20px;color:#47677c}
#acoustic-figure-status {min-height:1.25em;margin:10px 0 0;font-size:.9rem}
#acoustic-figure-warnings {margin:8px 0 0;padding-inline-start:20px;color:#7a431d;font-size:.88rem}
.figure-controls {display:grid;gap:10px}
.figure-controls details {border:1px solid #d5e4ec;border-radius:10px;padding:10px}
.figure-controls summary {cursor:pointer;font-weight:700}
.figure-controls details[open]>summary {margin-block-end:10px}
.figure-controls .research-settings {grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.figure-controls label[hidden] {display:none}
.figure-controls select,.figure-controls input:not([type=checkbox]),.figure-controls textarea {max-width:100%;min-width:0}
.figure-span {grid-column:1/-1}
.figure-tier+.figure-tier {margin-block-start:6px}
.figure-tier-body {display:grid;gap:7px;min-width:0}
.figure-tier-body label:not(.research-export-check) {display:grid;gap:4px}
.figure-tier-body input:not([type=checkbox]),.figure-tier-body select,.figure-tier-body textarea {width:100%}
.figure-secondary {display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}
@media(max-width:720px) {
  .acoustic-figure-layout {grid-template-columns:minmax(0,1fr)}
  .figure-preview-pane {position:static}
  .figure-sheet {max-height:48dvh}
}
.figure-controls .research-export-check {display:flex;align-items:center;gap:7px}
.figure-controls .research-export-check input {width:auto;margin:0;flex:none}
/* A point tier uses the same plot-width lane as interval tiers. */
.annotation-points {position:relative;flex:1;min-width:0;padding:0;overflow:hidden}
.annotation-points .annotation-point {position:absolute;top:8px;bottom:8px;border-left:2px solid #1679a7;padding:0 0 0 4px;font-size:11px;white-space:nowrap;transform:translateX(-1px)}
.annotation-point bdi {display:block;overflow:hidden;max-width:100px;text-overflow:ellipsis}

.inspection-actions {display:flex;align-items:center;gap:4px}
.inspection-actions .icon-button {width:31px;height:31px}
.inspection-actions #customize-measurements {border:1px solid #c4e0ed;border-radius:8px;background:#eff8fc;color:#135979}
.inspection-actions #customize-measurements:hover {background:#e0f2f9}
.inspection-actions .icon-button:focus-visible {outline:2px solid #0076aa;outline-offset:2px}
.inspection-list {display:grid;gap:2px;margin-block:6px}
.inspection-row {display:flex;justify-content:space-between;align-items:baseline;gap:6px;padding-block:8px;border-bottom:1px solid var(--line);font-size:11px}
.inspection-row strong {font-variant-numeric:tabular-nums;white-space:nowrap;color:#195c81}
.inspection-row strong small,.inspection-warning {color:#526f86;font-size:10px}
.inspection-category,.inspection-trajectory {padding:6px 8px;border:1px solid #d6e8f1;border-radius:8px;font-size:11px}
.inspection-category summary,.inspection-trajectory summary {cursor:pointer;font-weight:650;color:#24546d}
.inspection-category .inspection-trajectory {margin-block-start:4px}
.inspection-trajectory canvas {display:block;width:100%;height:auto;margin-block:6px;background:#f3f9fc;border-radius:4px}
.inspection-trajectory-scale {display:block;direction:ltr;text-align:center}
.inspection-audition {display:flex;justify-content:flex-end;margin-block:4px 9px}
.inspection-choice {display:flex;align-items:flex-start;gap:8px;padding:8px 6px;margin:0;border-bottom:1px solid #e5eff5}
.inspection-choice input[type=checkbox] {flex:none;width:auto;margin:3px 0 0}
.inspection-choice small {display:block;font-size:11px;font-weight:400;color:#526f86;margin-block-start:3px}
#inspection-count {align-self:center;font-size:12px;color:#285572}
.inspection-audition[hidden] {display:none}

.corpus-table-wrap {overflow:auto;max-height:44vh;margin-block:8px}
.corpus-table {width:100%;border-collapse:collapse;font-size:12px}
.corpus-table th,.corpus-table td {padding:8px 6px;text-align:start;border-bottom:1px solid #d6e8f1;vertical-align:top}
.corpus-table th {position:sticky;top:0;background:#edf7fb}
.corpus-table td {overflow-wrap:anywhere}
.corpus-table td select {min-width:110px}
.corpus-table input[type=checkbox],.corpus-confirm input {width:auto;margin:3px 0 0}
.corpus-table .corpus-error {display:block;color:#8b301f}
.corpus-table [data-corpus-open] {display:block}
.corpus-confirm {display:flex;align-items:flex-start;gap:6px;margin-block:12px}
#corpus-summary {overflow-wrap:anywhere}
#corpus-scan-form [hidden],#corpus-results[hidden] {display:none}

/* Scientific export center */
#modal:has(#scientific-export-center){width:min(1000px,calc(100% - 20px));max-height:92dvh}
#modal:has(#scientific-export-center) .modal-top{position:sticky;top:0;z-index:2;padding:12px 20px;background:#fff}
#modal:has(#scientific-export-center) #modal-body{padding:14px 20px 20px}
#scientific-export-center{color:#153047}
#scientific-export-center [hidden]{display:none!important}
.export-center-intro{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 12px;margin-block-end:12px}
.export-center-intro p,.export-option-copy p{margin:0;color:#3c5d74;line-height:1.45}
.export-center-intro a,.export-settings-body a{color:#075d83;font-weight:700;text-underline-offset:3px}
.export-center-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:10px}
.export-category{min-width:0;border:1px solid #cce0eb;border-radius:12px;background:#f5fafd;overflow:hidden}
.export-category h3{font-size:13px;font-weight:750;letter-spacing:.01em;margin:0;padding:8px 11px;color:#173b53;background:#e8f4fb;border-block-end:1px solid #d9e8f1}
.export-option{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:8px;padding:10px 11px}
.export-option+.export-option,.export-bundle{border-block-start:1px solid #d9e8f1}
.export-option-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:8px;background:#dceff7;color:#14597a}
.export-option-icon .icon{width:18px;height:18px}
.export-option-copy strong{font-size:13px;color:#13354b}
.export-option-copy p{font-size:12px;margin-block-start:3px}
.export-format{display:inline-block;padding:1px 5px;border:1px solid #bbd5e3;border-radius:5px;font:600 10px/1.4 system-ui;color:#244f67;background:#fff;white-space:nowrap;vertical-align:1px}
#scientific-export-center .button,.tonal-export-form .button{min-height:38px;white-space:normal;padding:5px 9px;font-size:12px;line-height:1.3}
#scientific-export-center .button.primary,.tonal-export-form .button.primary{background:#087da8;border-color:#087da8;color:#fff}
#scientific-export-center button:disabled{opacity:1;background:#edf2f6;border-color:#d2dce5;color:#52687a}
.export-bundle{padding:7px 11px;background:#fff}
#research-bundle-toggle[aria-expanded=true]{border-color:#16799d;background:#dceff7;color:#133d55}
.export-bundle p{margin:6px 0;color:#355a70;font-size:12px}
.export-bundle-actions{display:flex;gap:6px;flex-wrap:wrap}
.export-feedback{font-size:12px;color:#214e65;margin:8px 0}
.export-feedback:empty,#tonal-export-status:empty,#tonal-analysis-form .form-error:empty{display:none}
#scientific-export-center .research-export-form{margin-block-start:10px;gap:7px}
#scientific-export-center .research-category{padding:7px 10px;border-radius:8px}
.export-settings-body,.export-measurement-groups{display:grid;gap:7px}
.export-measurement-groups .research-category{background:#fff}
#scientific-export-center .research-measure{grid-template-columns:minmax(0,1fr);gap:4px;padding-block:4px;margin-block-start:3px}
#scientific-export-center .research-measure:has(.research-tier-picker:not([hidden])){grid-template-columns:minmax(0,1fr) minmax(0,.65fr)}
#scientific-export-center .research-measure label{font-size:12px}
#scientific-export-center input[type=checkbox],.tonal-export-form input[type=checkbox]{width:auto;margin:0 3px;vertical-align:middle;accent-color:#0a769e}
.export-check{display:flex;align-items:center;gap:5px}
#scientific-export-center .research-preview-table{max-height:none;overflow:auto}
#scientific-export-center .research-export-actions{padding-block:5px}
#scientific-export-center .research-export-actions p{color:#315a73}
#scientific-export-center .research-category:not([open])>.export-settings-body{display:none}
.tonal-export-form{display:grid;gap:8px}
.tonal-export-form p{margin:0}
.tonal-export-form fieldset{display:flex;flex-wrap:wrap;gap:6px 12px;border:1px solid #cce0eb;border-radius:8px;padding:7px}
.tonal-export-form details{padding:8px;border:1px solid #cce0eb;border-radius:8px}
.tonal-export-form summary{font-weight:700;color:#214f69;cursor:pointer}
.figure-sheet{max-height:none;overflow:visible}
@media(max-width:680px){
  .export-center-grid{grid-template-columns:minmax(0,1fr)}
  #modal:has(#scientific-export-center) #modal-body{padding:9px 10px 13px}
  #modal:has(#scientific-export-center) .modal-top{padding:8px 10px}
  .export-option{grid-template-columns:30px minmax(0,1fr) auto;padding:8px;gap:6px}
  .export-option-icon{width:30px;height:30px}
  #scientific-export-center .button,.tonal-export-form .button{min-height:44px}
  #scientific-export-center .research-measure:has(.research-tier-picker:not([hidden])){grid-template-columns:minmax(0,1fr)}
}
#scientific-export-center [data-configure-export][aria-expanded=true]{border-color:#16799d;background:#dceff7;color:#133d55}
