@charset "UTF-8";

label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
    padding: 15px 0 5px;
}

/* Labels immediately after legend need no top padding */
legend + * label {
    padding-top: 0;
}


select,
textarea,
input {
    appearance: none;
    background: transparent;
    border: 1px solid var(--input-border);
    border-radius: 0;
    outline: none;
    width: 100%;
    padding: 7px 10px;
    font: inherit;
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Cursor behavior */
input,
textarea {
    cursor: text;
}

select {
    cursor: pointer;
}

/* Focus styles */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    background-color: var(--input-bg);
    box-shadow: rgba(0, 0, 0, 0.45) 0px 12px 12px -10px;
}

/* schematics row/column header buttons - always link blue, no state changes */
button.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: none;
    border: none;
    padding: 0;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-link);
    cursor: pointer;
}

button.header-btn:hover {
    text-decoration: underline;
}

/* Admin-specific: all-btn for selecting all */
.all-btn {
    grid-column: 1;
    grid-row: 1;
}

.col-header {
    grid-row: 1;
}

.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--input-border);
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
}

.dropdown-header:hover {
    box-shadow: rgba(0, 0, 0, 0.45) 0px 12px 12px -10px;
}

/* .dropdown-header.active inherits from .dropdown-header */

.dropdown-text {
    font-size: 14px;
}

.dropdown-text.selected {
    font-weight: 500;
}

.dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--input-arrow);
    transform: rotate(-90deg);
    transition: transform 0.2s ease;
}

.dropdown-header.active .dropdown-arrow {
    transform: rotate(0deg);
}

.dropdown-list {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    right: 0;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: rgba(0, 0, 0, 0.50) 0px 12px 12px -5px;
}

.dropdown-list.active {
    max-height: 250px;
    opacity: 1;
    overflow-y: auto;
    scrollbar-color: var(--input-scrollbar) var(--input-scrollbar-track);
}

.dropdown-list::-webkit-scrollbar {
    width: 8px;
}

.dropdown-list::-webkit-scrollbar-track {
    background: var(--input-scrollbar-track);
}

.dropdown-list::-webkit-scrollbar-thumb {
    background: var(--input-scrollbar);
    border-radius: var(--input-scrollbar-radius);
}

.dropdown-list::-webkit-scrollbar-thumb:hover {
    background: var(--input-scrollbar-hover);
}

.dropdown-option {
    padding: 8px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}


.dropdown-option:hover {
    background: var(--input-bg);
    border: solid 1px var(--input-border-focus);
    border-left: solid 3px var(--input-border-focus);
    box-shadow: rgba(0, 0, 0, 0.20) 0px 12px 12px -5px;
}

.dropdown-option.selected {
    background: var(--input-bg);
    padding-left: 0px;
}

.dropdown-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.dropdown-option.disabled:hover {
    background: transparent;
    padding-left: 8px;
    box-shadow: none;
}

.dropdown-divider {
    height: 1px;
    background: var(--input-border-focus);
    margin: 4px 0;
}

.dropdown-action {
    font-style: italic;
    opacity: 0.8;
}

.option-name {
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 14px;
}

.option-details {
    font-size: 11px;
    display: flex;
    gap: 16px;
}

.option-detail {
    display: flex;
    align-items: center;
    gap: 4px;
}

fieldset {
    background: none;
    width: 100%;
    min-width: 0;  /* Allow shrinking in flex/grid containers */
    margin: 30px 0 5px 0;
    padding: 0;
    border: none;
    border-top: 1px solid var(--panel-border-subtle);
}


legend {
    position: relative;
    top: -3px;
    font-size: 9px;
    font-weight: 600;
    color: var(--panel-text-subtle);
    letter-spacing: 2px;
    margin: 15px 0px 15px 0;
    text-transform: uppercase;
}



/* Column layouts using CSS Grid */
.columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    row-gap: 0;
    padding: 0;
    margin: 0;
    align-items: start;
}

.columns .column label,
.columns .column .custom-dropdown,
.columns .column input {
    margin: 0;
}

.columns.col-75-25 {
    grid-template-columns: 3fr 1fr;
    column-gap: 20px;
}

.columns.col-75-25 .column:last-child {
    justify-self: end;
}

/* 1/3 - 2/3 column split */
.columns.col-33-66 {
    grid-template-columns: 1fr 2fr;
    column-gap: 20px;
    row-gap: 0;
}

/* Two-column layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    row-gap: 0;
}


.three-column {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 15px;
    row-gap: 0;
}

/* Four-column layout */
.four-column {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    column-gap: 15px;
    row-gap: 0;
}

.five-column {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    column-gap: 10px;
    row-gap: 0;
    align-items: end;
}



.btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: var(--btn-action-bg);
    color: var(--btn-action-text);
    border: 1px solid var(--btn-action-border);
    border-radius: var(--btn-action-radius);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: var(--btn-action-shadow);
}

.btn:hover {
    background: var(--btn-action-bg-hover);
    color: var(--btn-action-text-hover);
    box-shadow: var(--btn-action-shadow-hover);
}

.btn:disabled,
.btn.disabled {
    background: linear-gradient(180deg, #e6e8ec 0%, #cdd0d6 50%, #bcc0c8 100%);
    color: var(--text-disabled);
    border: 1px solid #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

/* Stop button - red variant for abort/cancel actions */
.btn-stop {
    background: var(--btn-stop-bg);
    color: var(--btn-stop-text);
    border-color: var(--btn-stop-border);
    box-shadow: var(--btn-stop-shadow);
}
.btn-stop:hover {
    background: var(--btn-stop-bg-hover);
    color: var(--btn-stop-text-hover);
}

/* Close button - square X button */
.btn-close {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    background: var(--btn-close-bg);
    color: var(--btn-close-icon);
    border-color: var(--btn-close-border);
    box-shadow: var(--btn-close-shadow);
    transition: background 0.15s ease;
}

.btn-close:hover {
    background: var(--btn-close-bg-hover);
    color: var(--btn-close-icon-hover);
}

/* Tray icon SVG styling */
.btn .tray-icon {
    stroke: var(--btn-action-text);
    stroke-width: 0.5;
    stroke-linecap: round;
    fill: none;
}

.btn:hover .tray-icon {
    stroke: var(--btn-action-text-hover);
}

.btn:disabled .tray-icon,
.btn.disabled .tray-icon {
    stroke: #999;
}

/* Computation display for calculated values */
.computation {
    padding: 8px 0;
}

.computation-result {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.computation-result .result-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-accent);
}

.computation-result .result-label {
    font-size: 11px;
    color: var(--text-body);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.computation-formula {
    font-size: 10px;
    color: var(--text-body);
    line-height: 1.4;
}

.computation-formula .formula-line {
    margin-bottom: 2px;
}

.computation-formula .formula-highlight {
    font-weight: 500;
}

.computation-formula .formula-secondary {
    margin-top: 4px;
}

.plate-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-accent);
    padding: 8px 0;
}


/* Panel action buttons - bottom row of action buttons in panels */
.panel-action-buttons {
    display: grid;
    grid-auto-flow: column;
    justify-content: end;
    gap: 15px;
    padding-top: 20px;
}

/* Input with unit suffix (%, µL, °C, etc.) */
.input-with-unit {
    display: grid;
    grid-template-columns: 1fr auto;
}

.input-with-unit input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    text-align: right;
    align-self: end;
    padding-right: 4px;
}

.input-with-unit .unit {
    display: grid;
    align-items: end;
    padding: 0 8px 7px 3px;
    background: inherit;
    border: 1px solid var(--border-default);
    border-left: none;
    font-size: 12px;
    color: var(--text-accent);
    white-space: nowrap;
}

/* Empty unit - no visible text, no space taken */
.input-with-unit .unit:empty {
    display: none;
}

.input-with-unit:has(.unit:empty) input {
    border-radius: var(--input-radius);
    border-right: 1px solid var(--border-default);
    padding-right: 10px;
}

/* Volume mode row - just the mode toggle buttons */
.volume-mode-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 12px;
    align-items: center;
}

.volume-mode-row label {
    font-size: 14px;
    margin: 0;
    text-align: center;
}

.volume-replicate-header,
.volume-replicate-row {
    display: grid;
    grid-template-columns: 125px 80px 20px;
    gap: 10px;
    align-items: center;
}

.volume-replicate-header {
    padding-bottom: 5px;
}

.volume-replicate-list {
    display: grid;
    gap: 5px;
    min-height: 125px;
    max-height: 125px;
    overflow-y: auto;
    align-content: start;
    padding: 10px 4px 10px 0;
    margin-bottom: 5px;
    border-top: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
    scrollbar-gutter: stable;
    scrollbar-color: var(--input-scrollbar) var(--input-scrollbar-track);
}

.volume-replicate-list::-webkit-scrollbar {
    width: 8px;
}

.volume-replicate-list::-webkit-scrollbar-track {
    background: var(--input-scrollbar-track);
}

.volume-replicate-list::-webkit-scrollbar-thumb {
    background: var(--input-scrollbar);
    border-radius: var(--input-scrollbar-radius);
}

.volume-replicate-list::-webkit-scrollbar-thumb:hover {
    background: var(--input-scrollbar-hover);
}

.volume-replicate-list::-webkit-scrollbar-button {
    display: none;
}

.btn-remove-row {
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    color: var(--text-on-light);
    cursor: pointer;
}

.btn-remove-row:hover {
    background-color: var(--tooltip-bg);
    color: white;
    border-radius: var(--tooltip-radius);
}

.btn-add-row {
    display: block;
    margin-top: 10px;
    margin-left: auto;
}

/* Plate mapping toggles - toggle groups in a row */
.plate-mapping-toggles {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: start;
}

.pattern-toggle-group {
    display: grid;
    gap: 5px;
}

.pattern-toggle-label {
    font-size: 11px;
    color: var(--text-body);
    font-weight: 500;
    text-align: center;
}

/* Disabled state for pattern toggles */
.pattern-toggle-group .pattern-toggle-label.disabled {
    color: #bbb;
}

/* Icon button grid - row of icon buttons */
.icon-button-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 5px;
}

.icon-btn {
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #b0b4c0;
    border-radius: var(--btn-toggle-radius);
    background: var(--btn-toggle-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.icon-btn:hover:not(.active) {
    background: var(--btn-toggle-bg-hover);
    color: var(--btn-toggle-text-hover);
    box-shadow: rgba(0, 0, 0, 0.50) 0px 12px 12px -5px;
}

.icon-btn.active {
    background: var(--btn-toggle-bg-active);
    border-color: var(--tooltip-bg);
    color: var(--btn-toggle-text-active);
}

/* Wider icon button variant for icons that need more horizontal space */
.icon-btn.wide {
    width: auto;
    padding: 0 10px;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--btn-toggle-icon);
    stroke-width: 2;
    fill: none;
    pointer-events: none;
}

.icon-btn:hover:not(.active) svg {
    stroke: var(--btn-toggle-icon-hover);
}

.icon-btn.active svg {
    stroke: var(--btn-toggle-icon-active);
}

/* Alignment toggle uses filled rectangles, not strokes */
#alignmentToggle .icon-btn svg,
#alignmentToggle .icon-btn svg rect {
    fill: var(--btn-toggle-icon);
    stroke: none;
}

#alignmentToggle .icon-btn:hover:not(.active) svg rect {
    fill: var(--btn-toggle-icon-hover);
}

#alignmentToggle .icon-btn.active svg rect {
    fill: var(--btn-toggle-icon-active);
}

#alignmentToggle .icon-btn:disabled svg rect {
    fill: #999;
}

/* Scope and Mode toggles use filled shapes (circles, paths) */
/* Only apply fill to shapes that don't have fill="none" attribute */
#criteriaScope .icon-btn svg circle:not([fill="none"]),
#criteriaScope .icon-btn svg path,
#volumeMode .icon-btn svg circle:not([fill="none"]),
#volumeMode .icon-btn svg path {
    fill: var(--btn-toggle-icon);
}

#criteriaScope .icon-btn:hover:not(.active) svg circle:not([fill="none"]),
#criteriaScope .icon-btn:hover:not(.active) svg path,
#volumeMode .icon-btn:hover:not(.active) svg circle:not([fill="none"]),
#volumeMode .icon-btn:hover:not(.active) svg path {
    fill: var(--btn-toggle-icon-hover);
}

#criteriaScope .icon-btn.active svg circle:not([fill="none"]),
#criteriaScope .icon-btn.active svg path,
#volumeMode .icon-btn.active svg circle:not([fill="none"]),
#volumeMode .icon-btn.active svg path {
    fill: var(--btn-toggle-icon-active);
}

/* Stroked elements: Globe icon (ellipse, line, circle with fill="none") and percentage-points outline */
#criteriaScope .icon-btn svg ellipse,
#criteriaScope .icon-btn svg line,
#criteriaScope .icon-btn svg circle[fill="none"],
#volumeMode .icon-btn svg circle[fill="none"] {
    fill: none !important;
    stroke: var(--btn-toggle-icon);
}

#criteriaScope .icon-btn:hover:not(.active) svg ellipse,
#criteriaScope .icon-btn:hover:not(.active) svg line,
#criteriaScope .icon-btn:hover:not(.active) svg circle[fill="none"],
#volumeMode .icon-btn:hover:not(.active) svg circle[fill="none"] {
    stroke: var(--btn-toggle-icon-hover);
}

#criteriaScope .icon-btn.active svg ellipse,
#criteriaScope .icon-btn.active svg line,
#criteriaScope .icon-btn.active svg circle[fill="none"],
#volumeMode .icon-btn.active svg circle[fill="none"] {
    stroke: var(--btn-toggle-icon-active);
}

.icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.icon-btn:disabled.active {
    background: var(--panel-card-bg);
    border-color: var(--border-default);
}

.icon-btn:disabled.active svg {
    stroke: var(--btn-toggle-icon);
}

/* ============================================================
   TEST SUMMARY
   ============================================================ */

.test-summary {
    border: 0;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    margin: 0;
    padding: 0px 25px;
}

.test-summary .summary-line {
    min-height: 25px;
    padding: 5px 0;
}

.test-summary .summary-sep {
    color: var(--input-border);
    margin: 0 8px;
}

/* ============================================================
   VOLUME VALIDATION
   ============================================================ */

/* label.validation-error is defined in tooltip.css */

/* Admin-specific: Disabled save button styling */
#protocolSaveBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   PLATE REMOVAL WARNING MODAL
   Shown when shutdown requested with plate potentially in tray
   ============================================================ */
#plateRemovalModal {
    justify-content: flex-start;
    align-items: flex-start;
    padding: 60px 0 0 220px;
    background: rgba(30, 60, 90, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.plate-removal-modal {
    background: var(--panel-card-bg);
    border: 1px solid var(--border-muted);
    border-radius: var(--modal-radius);
    padding: 24px;
    max-width: 400px;
    text-align: center;
}

.plate-removal-message {
    font-size: 16px;
    color: #222;
    margin-bottom: 20px;
    line-height: 1.6;
}

.plate-removal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ============================================================
   TAB TOGGLE (pill-style view switcher)
   ============================================================ */

.tab-toggle {
    display: inline-flex;
    background: rgba(0,0,0,0.2);
    border-radius: var(--btn-toggle-radius);
    padding: 2px;
    margin-left: 15px;
}

.tab-toggle .btn-toggle {
    background: var(--btn-toggle-bg);
    color: var(--btn-toggle-text);
    border: var(--btn-toggle-border);
    border-radius: var(--btn-toggle-radius);
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-toggle .btn-toggle:hover {
    background: var(--btn-toggle-bg-hover);
    color: var(--btn-toggle-text-hover);
}

.tab-toggle .btn-toggle.active {
    background: var(--btn-toggle-bg-active);
    color: var(--btn-toggle-text-active);
    box-shadow: var(--btn-toggle-shadow-active);
}


