/* Previous failure: shrink-to-fit dashboard columns collapsed when a filter returned only short rows. */
#dashboard-screen.dashboard:not(.hidden), #priorities-screen.dashboard:not(.hidden) { width: 100%; min-width: 0; max-width: none; align-items: stretch; box-sizing: border-box; }
#dashboard-screen .dashboard-section, #dashboard-screen .project-list { width: 100%; min-width: 0; max-width: none; box-sizing: border-box; }
#dashboard-screen .dashboard-controls { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(145px, 1fr)); width: 100%; gap: 14px; align-items: end; }
#dashboard-screen .dashboard-controls > label { min-width: 0; width: auto; }
#dashboard-screen .project-card { width: 100%; min-width: 0; box-sizing: border-box; }
/* Previous failure: grid stretching made status pills look like full-width controls; keep badges content-sized. */
[data-overall-status] { --status-color: #aeb7b5; --status-tint: #aeb7b50b; --status-border: #aeb7b526; }
[data-overall-status="Open"] { --status-color: #70dcb3; --status-tint: #70dcb30b; --status-border: #70dcb326; }
[data-overall-status="On Hold"] { --status-color: #edc777; --status-tint: #edc77712; --status-border: #edc77738; }
[data-overall-status="Complete"] { --status-color: #bca4ee; --status-tint: #bca4ee0e; --status-border: #bca4ee30; }
.project-status-tag { display: inline-flex; align-items: center; gap: 7px; width: fit-content; justify-self: start; align-self: center; flex: 0 0 auto; box-sizing: border-box; border: 1px solid var(--status-border); border-radius: 6px; padding: 3px 8px; font-family: inherit; font-size: 11px; line-height: 18px; font-weight: 600; color: var(--status-color); background: var(--status-tint); white-space: nowrap; }
.project-status-tag::before, .overall-status-choice [data-overall-status]::before { content: ""; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; }
.project-status-tag[data-overall-status="Canceled"]::before, .overall-status-choice [data-overall-status="Canceled"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.project-status-tag[data-overall-status="Complete"]::before, .overall-status-choice [data-overall-status="Complete"]::before { border-radius: 1px; }
.overall-status-choice [data-overall-status=""]::before { display: none; }
.project-manager { font-size: 12px; color: #bbc2cb; margin: 4px 0 0; }
.project-overall-control { display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%; font-size: 12px; font-weight: 600; color: #c0b8ce; margin-bottom: 24px; }
.project-overall-control .custom-choice { width: auto; }
.project-overall-control .custom-choice-trigger { min-width: 128px; min-height: 34px; padding: 7px 10px; border-radius: 8px; }
.overall-status-choice .custom-choice-trigger { align-items: center; gap: 8px; color: var(--status-color); background: var(--status-tint); border-color: var(--status-border); }
.overall-status-choice .custom-choice-trigger:hover { border-color: var(--status-color); }
.overall-status-choice .custom-choice-trigger::after { content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transform-origin: center; transition: transform 150ms ease; margin: -3px 2px 0 auto; }
.overall-status-choice .custom-choice-trigger[aria-expanded="true"]::after { transform: rotate(225deg); }
.overall-status-choice .custom-choice-menu { min-width: 176px; background: #18171e; border-color: #ffffff24; padding: 5px; border-radius: 10px; }
.overall-status-choice .custom-choice-menu button { display: flex; align-items: center; gap: 9px; color: var(--status-color); padding: 10px; font-size: 12px; }
.overall-status-choice .custom-choice-menu button:hover, .overall-status-choice .custom-choice-menu button:focus-visible { background: #ffffff0c; }
.overall-status-choice .custom-choice-menu [aria-selected="true"] { background: var(--status-tint); }
.overall-status-choice .custom-choice-menu [aria-selected="true"]::after { content: "✓"; margin-left: auto; }
.project-beaker.is-complete .project-beaker-fill { height: 100%; inset: 0; background: linear-gradient(180deg, #78edc9, #2abf90); }
.project-beaker.is-complete .project-beaker-fill::before { display: none; }
.project-beaker.is-complete::before { background: #78edc9; }
.custom-choice { position: relative; width: 100%; min-width: 0; }
.custom-choice select[hidden] { display: none !important; }
.additional-chemist-dropdown select[hidden] { display: none !important; }
.additional-chemist-dropdown .project-team-search { min-height: 42px; margin-bottom: 8px; padding: 0 12px; border-radius: 10px; background: rgba(4, 8, 7, .78); font-size: .84rem; }
.custom-choice-trigger { width: 100%; min-height: 40px; display: flex; justify-content: space-between; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid #49515c; background: #20252b; color: #f5f7fa; font: inherit; cursor: pointer; }
/* Dashboard stage and sorting controls share the neutral Project Status surface. */
#dashboard-screen .custom-choice:not(.overall-status-choice) .custom-choice-trigger { color: #aeb7b5; background: #aeb7b50b; border-color: #aeb7b526; }
#dashboard-screen .custom-choice:not(.overall-status-choice) .custom-choice-trigger:hover { border-color: #aeb7b5; }
.custom-choice-trigger:focus-visible, .custom-choice-menu button:focus-visible { outline: 2px solid #71e2b9; outline-offset: 2px; }
.custom-choice-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 120; width: max-content; min-width: 100%; max-width: min(400px, 85vw); max-height: 300px; overflow: auto; padding: 6px; border: 1px solid #59616c; border-radius: 12px; background: #303640; box-shadow: 0 16px 44px #0009; box-sizing: border-box; }
.custom-choice-menu button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 7px; background: transparent; color: #f5f7fa; text-align: left; font: inherit; cursor: pointer; }
.custom-choice-menu button:hover, .custom-choice-menu button:focus-visible { background: #444d59; }
.custom-choice-menu [aria-selected="true"] { background: #224d40; color: #baf8e2; }
.custom-choice button:disabled { opacity: .5; cursor: default; }
/* Success: every enhanced picker now uses the Project Status menu treatment rather than the browser's blue native menu. */
.custom-choice-trigger { min-height: var(--control-h-md, 42px); align-items: center; gap: 12px; border-color: rgba(231, 237, 234, .16); border-radius: var(--radius-control, 12px); background: rgba(5, 6, 7, .72); color: var(--ink, #edf2ee); font-family: var(--font-ui, inherit); font-weight: 600; }
.custom-choice-trigger:hover { border-color: rgba(35, 201, 133, .55); }
.custom-choice-menu { background: #191c1e; border-color: rgba(231, 237, 234, .2); }
.custom-choice-menu button { border-radius: 9px; color: var(--ink, #edf2ee); }
.custom-choice-menu button:hover, .custom-choice-menu button:focus-visible { background: #23292a; }
.custom-choice-menu [aria-selected="true"] { background: #1b342b; color: #8de9c6; }
.custom-multi-option { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 9px; color: var(--ink, #edf2ee); cursor: pointer; }
.custom-multi-option:hover, .custom-multi-option:focus-within { background: #23292a; }
/* Previous: project-form input and label rules stretched multi-select checkboxes into large square controls. */
.project-details-form .custom-multi-option, .custom-multi-option { display: flex; align-items: center; gap: 10px; }
.project-details-form .custom-multi-option input[type="checkbox"], .custom-multi-option input[type="checkbox"] { box-sizing: border-box; flex: 0 0 16px; width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; accent-color: #8de9c6; }
/* Previous: the adjacent Change stage menu used heavier, roomier rows than the preferred Project Status menu. */
.project-stage-visual .project-overview-status-menu { padding: 5px; border-radius: 10px; border-color: #ffffff24; background: #18171e; }
.project-stage-visual .project-overview-status-menu .project-status-option { display: flex; min-height: 36px; gap: 9px; padding: 8px 10px; border: 0; border-radius: 7px; color: #b8c0bc; font-size: 12px; font-weight: 600; }
.project-stage-visual .project-overview-status-menu .project-status-option::before { content: ""; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.project-stage-visual .project-overview-status-menu .project-status-option:hover,
.project-stage-visual .project-overview-status-menu .project-status-option:focus-visible { background: #ffffff0c; color: #f5f7fa; }
.project-stage-visual .project-overview-status-menu .project-status-option[aria-selected="true"] { background: #222427; color: #8de9c6; }
.project-stage-visual .project-overview-status-menu .project-status-option[aria-selected="true"]::before { background: #8de9c6; opacity: 1; }
.project-stage-visual .project-overview-status-menu .project-status-check { margin-left: auto; }
/* Success: neutral lighter dialog surfaces distinguish editing windows from the dark workspace. */
.archive-dialog .modal-card, .modal-backdrop .modal-card, dialog.release-dialog { background: #292e35; border: 1px solid #646c79; color: #f2f5f8; box-shadow: 0 28px 90px #000a; }
.archive-dialog .modal-card input, .modal-backdrop .modal-card input, .modal-backdrop .modal-card textarea, .modal-backdrop .modal-card select,
dialog.release-dialog input, dialog.release-dialog textarea, dialog.release-dialog select { background: #1b2027; color: #f2f5f8; border-color: #58616e; }
.archive-dialog .modal-card input::placeholder, .modal-backdrop .modal-card input::placeholder, .modal-backdrop .modal-card textarea::placeholder,
dialog.release-dialog input::placeholder, dialog.release-dialog textarea::placeholder { color: #aab3bf; }
dialog.release-dialog section { border-color: #515965; }
dialog.release-dialog .muted, dialog.release-dialog .muted-copy { color: #c3cbd5; }
dialog.release-dialog header { padding-bottom: 16px; border-bottom: 1px solid #515965; }
dialog.release-dialog footer { position: sticky; bottom: -24px; z-index: 10; padding: 16px 0; background: #292e35; border-top: 1px solid #515965; }
.report-table-hint { color: #c3cbd5; font-size: 12px; }
/* Previous failure: nowrap let missing-baseline prompts overlap adjacent anniversary columns. */
.report-target-date { display: block; margin-top: 6px; font-size: 11px; line-height: 1.4; font-weight: 400; color: #b9d7ca; white-space: normal; overflow-wrap: anywhere; }
.report-table-scroll .readings-table { min-width: max-content; }
.report-table-scroll .readings-table th, .report-table-scroll .readings-table td { min-width: 120px; }
.report-table-scroll .readings-table th:first-child { position: sticky; left: 0; z-index: 2; background: #343c45; min-width: 135px; }
.report-formula-identity { display: block; padding: 11px 0; font-weight: 700; overflow-wrap: anywhere; }
.priority-workspace { width: 100%; min-width: 0; border: 1px solid #38414b; border-radius: 18px; padding: 24px; background: #14191e; box-sizing: border-box; }
.priority-view { display: grid; gap: 8px; max-width: 340px; font-size: 13px; font-weight: 600; }
.priority-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 9px; }
.priority-row { display: flex; align-items: center; gap: 18px; padding: 18px; border: 1px solid #39424c; border-radius: 12px; background: #20262d; min-width: 0; }
.priority-row[draggable="true"] { cursor: grab; }
.priority-row.is-dragging { opacity: .45; }
.priority-row.is-drop-before { box-shadow: inset 0 3px #70e8bd; }
.priority-row.is-drop-after { box-shadow: inset 0 -3px #70e8bd; }
.priority-rank { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; background: #2a463d; color: #a8f0d5; font-size: 18px; font-weight: 750; }
.priority-project { flex: 1; min-width: 0; display: grid; gap: 6px; }
.priority-project > button { padding: 0; border: 0; background: transparent; text-align: left; color: #f3f6fa; font-size: 16px; font-weight: 650; cursor: pointer; overflow-wrap: anywhere; }
.priority-project > span { color: #b7c0cc; font-size: 13px; }
.priority-move { display: flex; gap: 6px; }
.priority-move button { min-width: 34px; min-height: 36px; border: 1px solid #525d6b; border-radius: 8px; background: #303944; color: #f4f7fa; font-size: 20px; cursor: pointer; }
.priority-move button:disabled { opacity: .3; cursor: default; }
.priority-list[aria-busy="true"] { opacity: .6; pointer-events: none; }
@media(max-width: 1000px) { #dashboard-screen .dashboard-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media(max-width: 600px) { #dashboard-screen .dashboard-controls { grid-template-columns: 1fr; } .priority-workspace { padding: 14px; } .priority-row { gap: 10px; padding: 12px; } .priority-move { flex-direction: column; } .project-record-main { min-width: 0; } }
@media print { dialog.release-dialog, dialog.release-dialog footer { background: white; color: black; } .custom-choice, .report-table-hint { display: none; } }

@media print {
  .report-dialog .report-table-scroll .readings-table { min-width: 0; width: 100%; }
  .report-dialog .readings-table th, .report-dialog .readings-table td { min-width: 0; }
  .report-dialog .readings-table th:first-child { position: static; min-width: 0; background: white; color: black; }
  .report-target-date, dialog.release-dialog .muted, dialog.release-dialog .muted-copy { color: #333; }
}

/* Project list metadata: matching pills, with status above stage. */
#dashboard-screen .project-card-topline { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
#dashboard-screen .project-card-topline .project-status-tag,
#dashboard-screen .project-card-topline .status-chip {
  display: block;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-family: var(--font-data);
  font-size: 12px;
  line-height: 18px;
  font-weight: 650;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#dashboard-screen .project-card-topline .project-status-tag { color: #bca4ee; background: #bca4ee1f; border-color: #bca4ee40; }
#dashboard-screen .project-card-topline .status-chip { color: #70dcb3; background: #23c9851f; border-color: #23c98540; }
#dashboard-screen .project-card-topline .project-status-tag::before { display: none; }

/* Success: collapsed filters keep priority detail controls available without crowding the board. */
.priority-controls {margin:16px 0;border:1px solid #343d46;border-radius:14px;background:#181e24;overflow:hidden;}
/* Previous: hidden overflow clipped the status menu below the filter panel; expanded filters must let custom menus escape. */
.priority-controls[open] {overflow:visible;}
.priority-controls summary {display:flex;align-items:center;gap:10px;padding:16px 18px;cursor:pointer;font-size:14px;font-weight:600;list-style:none;color:#e3e9ee;}
.priority-controls summary::-webkit-details-marker {display:none;}
.priority-controls summary::before {content:"";width:6px;height:6px;border-right:1.5px solid #98a7b3;border-bottom:1.5px solid #98a7b3;transform:rotate(-45deg);transition:transform .15s;}
.priority-controls[open] summary::before {transform:rotate(45deg);}
.priority-controls[open] summary {border-bottom:1px solid #2e3740;}
.priority-filter-grid {display:grid;grid-template-columns:1.2fr 1.5fr 1fr .9fr 1.1fr;gap:12px;padding:18px;margin:0;align-items:end;}
.priority-filter-grid label {display:grid;gap:8px;min-width:0;font-size:12px;font-weight:500;color:#adb9c5;}
.priority-filter-grid input,.priority-filter-grid select {box-sizing:border-box;width:100%;min-width:0;height:42px;margin:0;padding:10px 12px;background:#11171c;color:#e2e8ed;border:1px solid #39444e;border-radius:8px;font:inherit;font-size:13px;}
.priority-filter-grid input::placeholder {color:#778592;}
.priority-filter-grid input:hover,.priority-filter-grid select:hover {border-color:#566773;}
.priority-display-row {display:flex;align-items:flex-end;gap:18px;flex-wrap:wrap;padding:0 18px 18px;}
.priority-controls fieldset {flex:1;min-width:0;margin:0;border:0;padding:0;}
.priority-controls legend {margin-bottom:10px;padding:0;font-size:11px;font-weight:600;letter-spacing:.04em;color:#8f9eac;}
.priority-display-options {display:flex;flex-wrap:wrap;gap:8px;}
/* Previous browser QA: inherited label grids separated checkboxes from their text and stretched the clear action. */
.priority-controls .priority-field-toggle {display:inline-flex;align-items:center;gap:8px;margin:0;padding:8px 10px;border:1px solid #36414b;border-radius:7px;background:#141a20;color:#97a5b2;font-size:12px;line-height:18px;cursor:pointer;}
.priority-controls .priority-field-toggle:has(input:checked) {border-color:#3f6557;background:#21372f;color:#c7eadb;}
.priority-controls .priority-field-toggle input {appearance:auto;flex:0 0 14px;width:14px;min-width:14px;height:14px;min-height:0;margin:0;padding:0;accent-color:#72dcae;}
.priority-controls .priority-clear {flex:0 0 auto;align-self:flex-end;min-height:36px;margin:0;padding:8px 12px;border:1px solid #3b4650;border-radius:7px;background:transparent;color:#b4c0ca;font:inherit;font-size:12px;font-weight:500;cursor:pointer;}
.priority-controls .priority-clear:hover {background:#263039;color:#f3f6f8;border-color:#596c7b;}
.priority-controls :is(summary,input,select,button):focus-visible {outline:2px solid #72dcae;outline-offset:3px;}
@media(max-width:1100px) {.priority-filter-grid {grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:700px) {.priority-filter-grid {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:480px) {.priority-filter-grid {grid-template-columns:1fr;padding:14px;} .priority-display-row {padding:0 14px 14px;} .priority-controls summary {padding:14px;}}
.priority-project {min-width:0;overflow-wrap:anywhere;}
.priority-manager-rank {color:#72dcae;}

.project-upload-dialog {width:min(540px,90vw);border:1px solid #44524a;border-radius:16px;padding:24px;background:#202622;color:#f2f6f3;}
.project-upload-dialog::backdrop {background:rgba(0,0,0,.65);}
.project-upload-dialog label {display:grid;gap:12px;}
.project-upload-dialog footer {display:flex;justify-content:flex-end;gap:12px;margin-top:20px;}

/* Success F8-023: archive uses a distinct neutral status without replacing the project stage. */
[data-overall-status="Archived"] { --status-color: #bbc3ca; --status-tint: #bbc3ca16; --status-border: #bbc3ca55; }
#project-archive-badge { margin: 0 0 10px; }
