/* ===== DESIGN TOKENS CSS ===== */
/* Import design tokens */
@import url("design-tokens.f77396b86738.css");
@import url("ui-utilities.7fe909c12b5e.css");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== GENERAL CARD CLASSES ===== */

.card {
    background: var(--surface-white);
    border: 1px solid var(--border-passive);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-card);
}

.card:hover {
    border-color: var(--border-interactive);
    background: var(--charcoal-04);
    box-shadow: none;
}

.card-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-muted);
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-muted);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-content {
    padding: var(--spacing-lg);
}

.card-interactive {
    cursor: pointer;
    min-height: calc(var(--spacing-xl) + var(--spacing-lg));
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.card-interactive:hover {
    border-color: var(--border-interactive);
    background: var(--charcoal-04);
    box-shadow: none;
}

.card-interactive.selected {
    border-color: var(--border-interactive);
    background: var(--charcoal-06);
    box-shadow: none;
}

.card-interactive.expanded {
    min-height: auto;
    max-height: 400px;
    transition: all 0.4s ease;
}

/* ===== GENERAL FORM CLASSES ===== */
/* Add boxes (molecules, measurements, properties) styling */

.form {
    background: var(--surface-white); /* White background for add boxes */
    padding: var(--spacing-form-y) calc(var(--spacing-md) + var(--spacing-xs)); /* INTERNAL PADDING - Space inside the add box around content */
    border-radius: var(--radius-xl); /* Rounded corners */
    margin-bottom: 0; /* Space below the add box */
    border: 1px solid var(--border-passive); /* Border around the add box */
    box-shadow: none;
    display: flex; /* Flexbox layout for vertical centering */
    flex-direction: column; /* Vertical layout */
    justify-content: center; /* Vertically center content */
    min-height: calc(var(--spacing-xl) * 2 + var(--spacing-md)); /* Minimum height for proper centering */
}

/* Reduce min-height when solvent filter is collapsed to allow full collapse */
.form:has(.solvent-filter-wrapper.collapsed) {
    min-height: auto;
}

/* Form header styling (title above form fields) - now used as column headers */
.form-header {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--text-body);
    font-size: var(--font-size-workspace-section);
    font-weight: var(--font-weight-workspace-section);
    line-height: var(--line-height-workspace-section);
    letter-spacing: var(--letter-spacing-workspace-section);
    padding: var(--spacing-inset) 0;
}

.form-row {
    display: flex;
    gap: var(--spacing-md);
    align-items: end;
    margin-bottom: var(--spacing-md);
    margin-top: calc(var(--spacing-lg) + var(--spacing-xs)); /* Space for spanning labels above */
}

/* Remove bottom margin when this row contains collapsed solvent filter to allow full collapse */
.form-row:has(.solvent-filter-wrapper.collapsed) {
    margin-bottom: 0;
}

.form-field {
    flex: 1;
    min-height: calc(var(--spacing-xl) + var(--spacing-sm));
    min-width: 0; /* Allow flex item to shrink below content size */
    max-width: 100%; /* Respect parent container width */
}

/* Remove min-height when form-field contains collapsed solvent filter */
.form-field:has(.solvent-filter-wrapper.collapsed) {
    min-height: 0;
}

.form-field label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-workspace-meta);
    font-weight: var(--font-weight-workspace-label);
    color: var(--text-secondary);
    letter-spacing: normal;
}

.form-field input, 
.form-field select, 
.form-field textarea {
    width: 100%;
    height: var(--property-field-height);
    min-height: var(--property-field-height);
    padding: 0 var(--spacing-inset);
    border: 1px solid var(--border-passive);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-family-sans);
    color: var(--text-label);
    background: var(--surface-raised);
    transition:
        background-color var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out),
        color var(--duration-fast) var(--ease-out);
    resize: none;
    overflow: hidden;
    box-sizing: border-box;
}

.form-field textarea {
    min-height: var(--property-field-height);
    height: auto;
    padding: var(--spacing-inset);
    line-height: 1.4;
}

.form-field input:focus, 
.form-field select:focus, 
.form-field textarea:focus {
    outline: none;
    border-color: var(--border-passive);
    box-shadow: none;
    background-color: var(--surface-raised);
}

/* ===== GENERAL LIST CLASSES ===== */

.column-list-frame {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 var(--spacing-md) var(--spacing-md);
    overflow: hidden;
}

.list--overlay-scrollbar {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: var(--spacing-sm) 0 0;
    overflow: hidden;
}

.list-scroll-viewport {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
}

.list-scroll-viewport::-webkit-scrollbar {
    display: none;
}

.list--overlay-scrollbar .list-scroll-viewport > * {
    box-sizing: border-box;
    width: 100%;
}

.column-list-frame > .list-scrollbar-rail {
    position: absolute;
    top: var(--spacing-sm);
    bottom: var(--spacing-md);
    right: 0;
    width: var(--spacing-md);
    pointer-events: none;
    z-index: 1;
}

.list-scrollbar-rail.is-hidden {
    display: none;
}

.list-scrollbar-thumb {
    position: absolute;
    left: calc((var(--spacing-md) - var(--scrollbar-size)) / 2);
    width: var(--scrollbar-size);
    border-radius: var(--radius-scrollbar);
    background: var(--scrollbar-thumb-bg);
    border: 1px solid var(--scrollbar-thumb-border);
    opacity: 0;
    pointer-events: auto;
    transition: opacity var(--duration-fast) var(--ease-out);
    cursor: default;
}

.column:hover .column-list-frame > .list--overlay-scrollbar.is-scrollbar-visible + .list-scrollbar-rail .list-scrollbar-thumb,
.column-list-frame > .list--overlay-scrollbar.is-scrolling + .list-scrollbar-rail .list-scrollbar-thumb {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .list-scrollbar-thumb {
        transition: none;
    }
}

.list-item {
    background: var(--surface-white);
    border: 1px solid var(--border-passive);
    border-radius: var(--radius-xl);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-inset);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
    min-height: calc(var(--spacing-xl) + var(--spacing-lg));
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.list-item:hover {
    border-color: var(--border-interactive);
    background: var(--surface-highlight);
    box-shadow: none;
}

.list-item.selected {
    border-color: var(--border-interactive);
    background: var(--surface-selected);
    box-shadow: none;
}

.list-item.expanded {
    min-height: auto;
    max-height: 400px;
    transition: all 0.4s ease;
}

.list-item-title {
    font-size: var(--font-size-workspace-title);
    font-weight: var(--font-weight-workspace-title);
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: var(--line-height-workspace-title);
    overflow: hidden;
    min-width: 0;
}

.list-item-title-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.solvent-badge {
    /* Legacy alias — prefer .row-chip.row-chip--tag */
    display: inline-flex;
    align-items: center;
    height: auto;
    padding: var(--chip-padding-y) var(--chip-padding-x);
    font-size: var(--chip-font-size);
    font-weight: var(--chip-font-weight);
    border-radius: var(--chip-radius);
    border: var(--chip-border-width) solid var(--chip-tag-border);
    background: var(--chip-tag-bg);
    color: var(--chip-tag-text);
    flex-shrink: 0;
}

.list-item-subtitle {
    font-size: var(--font-size-workspace-nav);
    color: var(--text-secondary);
    font-weight: var(--font-weight-workspace-nav);
    line-height: var(--line-height-normal);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item-main-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    min-width: 0;
}

.list-item-body {
    width: 100%;
}

.list-item-body--progress {
    width: calc(100% - var(--list-item-progress-reserve));
}

.list-item-column {
    width: 100%;
}

.list-item-column .list-item-main-wrapper {
    width: 100%;
    padding-right: 0;
}

.list-item-column .list-item-expanded-content {
    width: 100%;
}

.list-item-progress-bar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--progress-bar-width);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    box-sizing: border-box;
}

.progress-segment {
    flex: 1 1 0;
    min-height: 1px;
}

.progress-segment.filled {
    background-color: var(--progress-complete);
}

.progress-segment.empty {
    background-color: var(--progress-gap);
}

.list-item-content {
    transition: color var(--duration-normal) var(--ease-out),
                opacity var(--duration-normal) var(--ease-out);
    flex: 1;
    min-width: 0;
}

.list-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--chip-gap);
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
    z-index: 2;
}

/* ===== LIST ROW CHIPS ===== */

.row-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto;
    padding: var(--chip-padding-y) var(--chip-padding-x);
    font-family: var(--font-family-sans);
    font-size: var(--chip-font-size);
    font-weight: var(--chip-font-weight);
    line-height: 1;
    border-radius: var(--chip-radius);
    border: var(--chip-border-width) solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

.row-chip--tag {
    background: var(--chip-tag-bg);
    border-color: var(--chip-tag-border);
    color: var(--chip-tag-text);
    cursor: default;
    user-select: none;
}

button.row-chip {
    cursor: pointer;
    background-color: transparent;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    transition:
        background-color 0.3s ease,
        border-color 0.3s ease;
}

button.row-chip .row-chip-icon,
button.row-chip .row-chip-icon * {
    transition:
        stroke 0.3s ease,
        color 0s,
        background-color 0s,
        border-color 0s,
        box-shadow 0s;
}

.row-chip-icon {
    display: block;
    width: var(--chip-icon-size);
    height: var(--chip-icon-size);
    flex-shrink: 0;
    fill: none;
    stroke-width: var(--chip-icon-stroke);
    stroke-linecap: round;
    stroke-linejoin: round;
}

.row-chip--edit,
.row-chip--delete,
.row-chip--accept,
.row-chip--reject,
.row-chip--back {
    padding: var(--chip-icon-padding-y) var(--chip-icon-padding-x);
}

.row-chip--edit {
    border-color: var(--action-edit-border);
}

.row-chip--edit .row-chip-icon,
.row-chip--edit .row-chip-icon * {
    stroke: var(--action-edit-text);
}

.row-chip--edit:hover:not(:disabled) {
    background-color: var(--action-edit-bg-hover);
    border-color: var(--action-edit-bg-hover);
}

.row-chip--edit:hover:not(:disabled) .row-chip-icon,
.row-chip--edit:hover:not(:disabled) .row-chip-icon * {
    stroke: var(--action-edit-text-hover);
}

.row-chip--edit:active:not(:disabled) {
    background-color: var(--action-edit-bg-active);
    border-color: var(--action-edit-bg-active);
}

.row-chip--edit:active:not(:disabled) .row-chip-icon,
.row-chip--edit:active:not(:disabled) .row-chip-icon * {
    stroke: var(--action-edit-text-hover);
}

.row-chip--delete {
    border-color: var(--action-delete-border);
}

.row-chip--delete .row-chip-icon,
.row-chip--delete .row-chip-icon * {
    stroke: var(--action-delete-text);
}

.row-chip--delete:hover:not(:disabled) {
    background-color: var(--action-delete-bg-hover);
    border-color: var(--action-delete-bg-hover);
}

.row-chip--delete:hover:not(:disabled) .row-chip-icon,
.row-chip--delete:hover:not(:disabled) .row-chip-icon * {
    stroke: var(--action-delete-text-hover);
}

.row-chip--delete:active:not(:disabled) {
    background-color: var(--action-delete-bg-active);
    border-color: var(--action-delete-bg-active);
}

.row-chip--delete:active:not(:disabled) .row-chip-icon,
.row-chip--delete:active:not(:disabled) .row-chip-icon * {
    stroke: var(--action-delete-text-hover);
}

.row-chip--accept:active:not(:disabled) {
    background-color: var(--accept-deep);
    border-color: var(--accept-deep);
}

.row-chip--accept:active:not(:disabled) .row-chip-icon,
.row-chip--accept:active:not(:disabled) .row-chip-icon * {
    stroke: var(--surface-inverted);
}

.row-chip--reject,
.row-chip--back {
    border-color: var(--reject);
}

.row-chip--reject .row-chip-icon,
.row-chip--reject .row-chip-icon *,
.row-chip--back .row-chip-icon,
.row-chip--back .row-chip-icon * {
    stroke: var(--reject);
}

.row-chip--reject:hover:not(:disabled),
.row-chip--back:hover:not(:disabled) {
    background-color: var(--reject);
    border-color: var(--reject);
}

.row-chip--reject:hover:not(:disabled) .row-chip-icon,
.row-chip--reject:hover:not(:disabled) .row-chip-icon *,
.row-chip--back:hover:not(:disabled) .row-chip-icon,
.row-chip--back:hover:not(:disabled) .row-chip-icon * {
    stroke: var(--surface-inverted);
}

.row-chip--reject:active:not(:disabled),
.row-chip--back:active:not(:disabled) {
    background-color: var(--reject-deep);
    border-color: var(--reject-deep);
}

.row-chip--reject:active:not(:disabled) .row-chip-icon,
.row-chip--reject:active:not(:disabled) .row-chip-icon *,
.row-chip--back:active:not(:disabled) .row-chip-icon,
.row-chip--back:active:not(:disabled) .row-chip-icon * {
    stroke: var(--surface-inverted);
}

.row-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.row-chip--accept {
    border-color: var(--accept);
}

.row-chip--accept .row-chip-icon,
.row-chip--accept .row-chip-icon * {
    stroke: var(--accept);
}

.row-chip--accept:hover:not(:disabled) {
    background-color: var(--accept);
    border-color: var(--accept);
}

.row-chip--accept:hover:not(:disabled) .row-chip-icon,
.row-chip--accept:hover:not(:disabled) .row-chip-icon * {
    stroke: var(--surface-inverted);
}

.queue-item .list-item-actions {
    width: auto;
    flex-shrink: 0;
}

.molecule-item .molecular-structure,
.queue-item .molecular-structure {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--spacing-md);
    min-height: 200px;
    max-height: 250px;
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-passive);
    overflow: hidden;
    box-sizing: border-box;
}

.molecule-item .molecular-structure img,
.queue-item .molecular-structure img {
    max-width: calc(100% - 30px);
    max-height: calc(100% - 30px);
    width: auto;
    height: auto;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.list-item-expanded-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    margin-top: 0;
}

.list-item.expanded .list-item-expanded-content {
    max-height: 300px;
    opacity: 1;
    margin-top: var(--spacing-inset);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-xl);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

/* ===== SPECIFIC ITEM CLASSES ===== */

/* Molecule-specific styles */
.molecule-item {
    /* Inherits from .list-item */
}

.molecule-name-edit {
    width: 66%;
}

/* Measurement-specific styles */
.measurement-item {
    /* Inherits from .list-item */
}

/* Property-specific styles */
.property-item {
    /* Inherits from .list-item */
}

.property-form {
    background: var(--surface-raised);
    border: 1px solid var(--border-passive);
    border-radius: var(--radius-xl);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-inset);
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
    position: relative;
    overflow: visible;
}

.property-form:hover {
    background: var(--surface-highlight);
}

.property-form:focus-within {
    background: var(--surface-selected);
}

/* Two classes on purpose: the generic ".property-form label" rule further down
   sets display:block and would otherwise win on specificity, collapsing this row
   and dropping the trailing chip onto its own line. Headers that label an input
   are <label>, the rest are <div>, so the typography is repeated here. */
.property-form .property-label-row {
    display: flex;
    align-items: center;
    gap: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    max-width: 100%;
    width: 100%;
    flex-wrap: nowrap;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: normal;
}

.property-label-left {
    display: flex;
    align-items: center;
    gap: var(--radius-md);
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.property-label-text {
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Override chip and download button in label row: always flush right at the edge.
   Matches the solvent badge styling for visual consistency. */
.property-label-row .row-chip--tag,
.property-label-row .row-chip--edit {
    margin-left: auto;
    flex-shrink: 0;
}

.property-label-row .row-chip--tag {
    cursor: default;
    pointer-events: none;
}

.property-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--chip-padding-y) + var(--chip-font-size) + 2 * var(--chip-border-width));
    height: calc(var(--chip-padding-y) + var(--chip-font-size) + 2 * var(--chip-border-width));
    flex-shrink: 0;
    border-radius: var(--radius-circle);
    border: var(--chip-border-width) solid var(--chip-tag-border);
    background: var(--chip-tag-bg);
    box-sizing: border-box;
    font-family: var(--font-family-sans);
    font-size: var(--chip-font-size);
    font-weight: var(--chip-font-weight);
    line-height: 1;
    color: var(--chip-tag-text);
    cursor: default;
    user-select: none;
    vertical-align: middle;
    position: relative;
    /* Ensure the tooltip can position relative to the property-form block */
    isolation: isolate;
}

/* An upright lowercase "i" is a bare stroke and reads as noise inside the small
   circle. The Unicode info symbol ℹ provides better visual clarity at small sizes. */
.property-info-glyph {
    font-weight: 400;
    font-size: var(--chip-font-size);
    line-height: 1;
    display: inline-block;
}

.property-info-icon:focus {
    outline: none;
}

.property-info-icon:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.property-info-tooltip {
    display: none;
    position: fixed;
    /* Use fixed positioning and JS to position it correctly, preventing any overflow */
    z-index: 1000;
    max-width: 280px;
    width: max-content;
    padding: var(--spacing-sm) var(--spacing-form-y);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-muted);
    background: var(--surface-white);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.45;
    white-space: normal;
    text-transform: none;
    box-shadow: var(--shadow-tooltip);
    z-index: 20;
    pointer-events: none;
}

.property-info-icon:hover .property-info-tooltip,
.property-info-icon:focus-within .property-info-tooltip {
    display: block;
}

/* Position tooltips with JS to prevent overflow */
.property-info-tooltip.is-positioned {
    display: block;
}

.property-form.hidden-property {
    opacity: 0.6;
    background: var(--surface-muted);
    border-color: var(--border-muted);
}

.property-form.hidden-property label {
    color: var(--text-secondary);
}

.property-form.hidden-property input:disabled,
.property-form.hidden-property select:disabled,
.property-form.hidden-property textarea:disabled {
    background: var(--border-soft);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Solvent filter boxes */
.solvent-filter-label {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: var(--radius-md);
    margin-bottom: 0;
    position: relative;
    z-index: 1;
    flex-shrink: 0; /* Prevent label from shrinking */
}

.solvent-filter-toggle {
    font-size: 10px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.solvent-filter-label.collapsed .solvent-filter-toggle {
    transform: rotate(-90deg);
}

.solvent-filter-wrapper {
    display: grid;
    grid-template-rows: 1fr;
    margin-top: 2px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
    transition: grid-template-rows 0.3s ease, opacity 0.3s ease;
    padding-top: var(--spacing-xs);
    padding-bottom: 2px;
    box-sizing: border-box;
}

.solvent-filter-wrapper.collapsed {
    grid-template-rows: 0fr;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.solvent-filter-wrapper > .solvent-filter-container {
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.solvent-filter-container::-webkit-scrollbar {
    height: 6px;
}

.solvent-filter-container::-webkit-scrollbar-track {
    background: var(--neutral-scrollbar-track);
    border-radius: var(--radius-scrollbar);
}

.solvent-filter-container::-webkit-scrollbar-thumb {
    background: var(--neutral-scrollbar-thumb);
    border-radius: var(--radius-scrollbar);
}

.solvent-filter-container::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-scrollbar-thumb-hover);
}

.solvent-filter-container {
    display: flex;
    gap: var(--spacing-xs);
    width: max-content;
    align-items: stretch;
    flex-wrap: nowrap;
}

.property-form input,
.property-form select,
.property-form textarea,
.property-form .file-upload,
.property-form .result-display,
.property-form .number-pair-container input {
    width: 100%;
    height: var(--property-field-height);
    min-height: var(--property-field-height);
    padding: 0 var(--spacing-inset);
    border: 1px solid var(--border-passive);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-family-sans);
    color: var(--text-label);
    background: var(--surface-raised);
    transition: all 0.2s ease;
    resize: none;
    overflow: hidden;
    box-sizing: border-box;
}

.property-form textarea,
.property-form .result-display:has(img) {
    height: auto;
    min-height: var(--property-field-height);
    padding: var(--spacing-inset);
    line-height: 1.4;
}

.property-form .result-display:has(img) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.property-form .result-display.result-text,
.property-form .result-display.result-number {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.property-form .file-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

/* The picker sits on top of the button so the click is a real user gesture
   on <input type="file">. A hidden input opened with .click() fills
   input.files but browsers then omit those files from FormData. */
.property-form .file-upload-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
    z-index: 2;
}

.property-form .file-upload-fill {
    position: absolute;
    inset: 0;
    width: 100%;
    background: color-mix(in srgb, var(--text-secondary) 28%, var(--surface-muted));
    pointer-events: none;
    z-index: 0;
    transform: scaleX(0);
    transform-origin: left center;
}

.property-form .file-upload-label {
    position: relative;
    z-index: 1;
}

.file-upload-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    width: 100%;
}

.file-upload-row .file-upload {
    min-width: 0;
}

.property-form .file-upload.is-uploading {
    pointer-events: none;
}

.property-form .file-upload.is-disabled .file-upload-input {
    display: none;
    pointer-events: none;
}

.property-form .number-pair-container input {
    width: 50%;
    flex: 1;
}

.property-form input:focus,
.property-form select:focus,
.property-form textarea:focus,
.property-form .number-pair-container input:focus {
    outline: none;
    border-color: var(--border-passive);
    box-shadow: none;
    background-color: var(--surface-raised);
}

.property-form input:disabled,
.property-form select:disabled,
.property-form textarea:disabled,
.property-form input[readonly],
.property-form textarea[readonly] {
    background-color: var(--surface-raised);
    border-color: var(--border-passive);
    color: var(--text-body);
    cursor: default;
    opacity: 1;
}

.property-form label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: normal;
}

/* ===== BODY STYLING ===== */
/* Main page background and layout */
body {
    --header-height: 64px;
    font-family: var(--font-family-sans);
    background: var(--surface-page);
    height: 100vh; /* Full viewport height */
    overflow: hidden; /* Prevent scrolling on main body */
}

/* ===== HEADER STYLING ===== */
.header {
    background: var(--surface-white);
    border-bottom: 1px solid var(--border-passive);
    width: 100%;
    box-sizing: border-box;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    padding: var(--spacing-xs) var(--spacing-lg);
    width: 100%;
    box-sizing: border-box;
    color: var(--text-primary);
}

/* Auth pages — header without inner wrapper */
.header:not(:has(.header-inner)) {
    display: flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-lg);
    min-height: var(--header-height);
    color: var(--text-primary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.header-brand:focus-visible {
    outline: 2px solid var(--border-interactive);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.header-brand-name {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-chrome-brand);
    font-weight: var(--font-weight-chrome-brand);
    line-height: var(--line-height-chrome-brand);
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-logo {
    height: 56px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    display: block;
}

.header-nav,
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-nav-link,
.header-nav-link:link,
.header-nav-link:visited {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-chrome-nav);
    font-weight: var(--font-weight-chrome-nav);
    line-height: 1;
    color: var(--text-label);
    text-decoration: none;
    padding: var(--spacing-xs) 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease-out, border-color 0.15s ease-out;
}

.header-action,
.header-action:link,
.header-action:visited {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-chrome-utility);
    font-weight: var(--font-weight-chrome-utility);
    line-height: 1;
    color: var(--text-label);
    text-decoration: none;
    padding: var(--spacing-xs) 0;
    transition: color 0.15s ease-out;
}

.header-nav-link:hover,
.header-nav-link:focus-visible,
.header-action:hover,
.header-action:focus-visible {
    color: var(--text-primary);
}

.header-nav-link.is-active {
    color: var(--text-primary);
    font-weight: var(--font-weight-chrome-nav);
    border-bottom-color: var(--text-primary);
}

.header-action:focus-visible,
.header-nav-link:focus-visible {
    outline: 2px solid var(--border-interactive);
    outline-offset: 2px;
}

/* Main content container (three columns) */
.container {
    display: flex;
    height: calc(100vh - var(--header-height, 64px));
    padding-top: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    padding-left: var(--spacing-md); /* Left padding */
    padding-right: var(--spacing-md); /* Right padding */
    width: 100%;
    max-width: var(--layout-max-width);
    margin-inline: auto;
    box-sizing: border-box;
}

.column {
    flex: 1;
    background: var(--surface-panel);
    margin: var(--spacing-xs);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-passive);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.column-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.column-add-section {
    padding: var(--spacing-inset) var(--spacing-md);
    flex-shrink: 0;
}

.column-items-section {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md) var(--spacing-md);
    overflow-y: auto;
}


.form-row {
    display: flex;
    gap: var(--spacing-md);
    align-items: end;
    margin-bottom: var(--spacing-md);
    margin-top: calc(var(--spacing-lg) + var(--spacing-xs)); /* Space for spanning labels above */
}

.form-field {
    flex: 1; /* Take up available space */
    min-height: calc(var(--spacing-xl) + var(--spacing-sm)); /* Minimum height for field container */
    position: relative; /* For absolute positioning of labels */
}

/* Form field group - contains select and button together */
.form-field-group {
    display: flex; /* Horizontal layout for select and button */
    gap: var(--spacing-md); /* Space between select and button */
    align-items: center; /* Vertically center select and button */
}

/* Form field group select styling */
.form-field-group select {
    flex: 1;
}

/* Form field group button styling */
.form-field-group .btn {
    height: var(--property-field-height);
    padding: 0 calc(var(--spacing-md) + var(--spacing-xs));
    border: none;
    border-radius: var(--radius-lg);
    background: var(--charcoal);
    color: var(--surface-inverted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition:
        background-color var(--duration-fast) var(--ease-out),
        color var(--duration-fast) var(--ease-out);
    white-space: nowrap;
    box-shadow: none;
}

.form-field-group .btn:hover:not(:disabled) {
    background: var(--action-blue-deep);
    box-shadow: none;
    transform: none;
}

/* Form field label styling - spans across entire row */
.form-field label {
    display: block; /* Block display for label */
    margin-bottom: 5px; /* Space below label */
    font-size: 12px; /* Small font size for labels */
    font-weight: 600; /* Semi-bold weight */
    color: var(--text-secondary); /* Gray color for labels */
    letter-spacing: -0.02em;
    letter-spacing: normal; /* Letter spacing */
    position: absolute; /* Absolute positioning */
    top: -20px; /* Position above the form row */
    left: 0; /* Start from left edge */
    right: 0; /* Extend to right edge */
    z-index: 1; /* Above other elements */
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Show ellipsis for long text */
}

.column-add-section .form-header {
    padding: var(--spacing-sm) 0;
}

.column-add-section .form-header:not(.form-header--flush) {
    margin-bottom: var(--spacing-xs);
}

.column-add-section .form-row {
    margin-top: calc(var(--spacing-md) + var(--spacing-sm) + var(--spacing-xs));
}

.column-add-section .form-field label {
    top: auto;
    bottom: 100%;
    margin-bottom: var(--spacing-sm);
}

/* Form input fields styling (text inputs, selects, textareas) */
.form-field input, .form-field select, .form-field textarea {
    width: 100%;
    height: var(--property-field-height);
    min-height: var(--property-field-height);
    padding: 0 var(--spacing-inset);
    border: 1px solid var(--border-passive);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-family-sans);
    color: var(--text-label);
    background: var(--surface-raised);
    transition:
        background-color var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out),
        color var(--duration-fast) var(--ease-out);
    resize: none;
    overflow: hidden;
    box-sizing: border-box;
}

.form-field textarea {
    min-height: var(--property-field-height);
    height: auto;
    padding: var(--spacing-inset);
    line-height: 1.4;
}

.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: none;
    border-color: var(--border-passive);
    box-shadow: none;
    background-color: var(--surface-raised);
}

.btn {
    height: var(--property-field-height);
    background: var(--charcoal);
    color: var(--surface-inverted);
    border: none;
    padding: 0 calc(var(--spacing-md) + var(--spacing-xs));
    border-radius: var(--radius-lg);
    font-family: var(--font-family-sans);
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: normal;
    transition:
        background-color var(--duration-fast) var(--ease-out),
        color var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out);
    min-width: 100px;
    box-sizing: border-box;
    box-shadow: none;
}

.btn:hover:not(:disabled):not(.btn-success) {
    background: var(--action-blue-deep);
    box-shadow: none;
    transform: none;
}

.btn:active:not(:disabled):not(.btn-success) {
    background: var(--action-blue-deep);
    transform: none;
    box-shadow: none;
}

.sort-text {
    color: var(--text-secondary);
    font-size: var(--font-size-workspace-meta);
    font-weight: var(--font-weight-workspace-meta);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease-out, background-color 0.15s ease-out;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    letter-spacing: normal;
}

.sort-text:hover {
    color: var(--charcoal);
    background: var(--charcoal-04);
}

.btn-success {
    background: transparent;
    color: var(--accept);
    border: 1px solid var(--accept);
}

.btn-success:hover:not(:disabled),
.btn-success:active:not(:disabled) {
    background: transparent;
    color: var(--accept-deep);
    border-color: var(--accept-deep);
}

/* Properties column actions: save and evaluate, side by side */
.save-section {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-sm);
    position: relative; /* tooltip anchor, so both hints span the full row width */
}

.save-section .btn {
    flex: 1;
    min-width: 0;
}

.save-section .btn:hover:not(:disabled) + .property-info-tooltip,
.save-section .btn:focus-visible + .property-info-tooltip {
    display: block;
}

.save-section .btn:active + .property-info-tooltip,
.save-section .btn.is-busy + .property-info-tooltip {
    display: none !important;
}

.save-section .btn:disabled {
    opacity: 1;
    background: var(--surface-muted);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.save-section .btn:disabled.is-busy {
    cursor: wait;
}

.btn-danger {
    background: var(--reject);
    color: var(--cream-highlight);
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: var(--reject-deep);
    opacity: 0.9;
    box-shadow: none;
}

/* File upload styling — color/cursor; dimensions in .property-form block */
.file-upload {
    color: var(--text-secondary);
    cursor: pointer;
}

.file-upload:hover {
    color: var(--text-label);
}

/* Number pair (range) input styles */
.number-pair-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
}

.number-pair-separator {
    display: none; /* Hide the "to" text */
}

/* Verification pending page styles - using existing auth-card styling */

.file-error {
    color: var(--progress-gap); /* Red color for errors */
    font-size: 12px; /* Small font size */
    margin-top: 5px; /* Space above error */
    font-weight: 500; /* Medium weight */
}

.file-content {
    background: var(--surface-muted); /* Light gray background */
    border: 1px solid var(--border-soft); /* Light border */
    border-radius: var(--radius-sm); /* Rounded corners */
    padding: var(--spacing-form-y); /* Internal padding */
    margin-top: var(--spacing-form-y); /* Space above content */
    font-family: var(--font-family-mono); /* Monospace font */
    font-size: 12px; /* Small font size */
    max-height: 200px; /* Maximum height */
    overflow-y: auto; /* Scrollable if content is long */
    white-space: pre-wrap; /* Preserve line breaks */
}

/* Spectrum display styling */
/* Repeating spectrum rows: one uploaded file plus its per-row inputs.
   Rows carry no frame of their own — they are separated by whitespace, and their
   inputs line up with every other field in the column. */
.spectrum-rows {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.spectrum-row .file-name-text {
    word-break: break-all;
}

/* Secondary line under a row's name, e.g. how many spectra a series holds. */
.spectrum-row .file-detail-text {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Picker on plots that draw one row at a time. */
.property-form .plot-row-select {
    margin-bottom: var(--spacing-sm);
}

.spectrum-row .property-label-row {
    margin-top: var(--spacing-xs);
}

/* One editable result per row, labelled by the row: the per-row counterpart of a
   computed field. Each entry is wrapped so the gap falls between entries; a bare
   flex column would space a label from its own input exactly as far as from the
   next entry, and the pairs would stop reading as pairs. */
.row-results-table {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.row-results-entry .property-label-row {
    margin-top: 0;
    margin-bottom: var(--spacing-xs);
}

.spectrum-display {
    text-align: center; /* Center the plot */
}

.spectrum-display img {
    max-width: 100%; /* Responsive image */
    height: auto; /* Maintain aspect ratio */
}

.molecule-details {
    background: var(--charcoal-03);
    border-radius: var(--radius-md);
    padding: var(--spacing-inset);
    border: 1px solid var(--border-passive);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    font-size: 13px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: normal;
    letter-spacing: normal;
    font-size: 11px;
}

.detail-value {
    color: var(--text-label);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

.smiles-display {
    font-family: var(--font-family-mono);
    background: var(--border-soft);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 12px;
}


.property-form {
    background: var(--surface-raised);
    border: 1px solid var(--border-passive);
    border-radius: var(--radius-xl);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-inset);
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
    min-height: calc(var(--spacing-xl) + var(--spacing-lg));
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.property-form:hover {
    background: var(--surface-highlight);
}

.property-form:focus-within {
    background: var(--surface-selected);
}

.property-form input:focus,
.property-form select:focus,
.property-form textarea:focus,
.property-form .number-pair-container input:focus {
    outline: none;
    border-color: var(--border-passive);
    box-shadow: none;
    background-color: var(--surface-raised);
}

.property-form label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: normal;
}

.file-upload .file-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

.file-upload:hover {
    border-color: var(--border-passive);
    background-color: var(--surface-raised);
    color: var(--text-label);
}

.file-upload.dragover {
    border-color: var(--border-passive);
    background-color: var(--surface-highlight);
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-xl);
}

.error {
    background: var(--alert-error-bg);
    color: var(--alert-error-text);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
}

.success {
    background: var(--alert-success-bg);
    color: var(--alert-success-text);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-xl);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

/* ===== GENERAL DIALOG CLASSES ===== */

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-scrim);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-modal);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.dialog h3 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--progress-gap);
    font-size: 18px;
    font-weight: 600;
}

.dialog p {
    margin: 0 0 var(--spacing-lg) 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.dialog-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.dialog-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.dialog-btn.danger {
    background: var(--progress-gap);
    color: var(--surface-white);
}

.dialog-btn.danger:hover {
    background: var(--progress-gap-deep);
}

.dialog-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dialog-btn.danger:disabled:hover {
    background: var(--progress-gap);
}

.dialog-btn.secondary:disabled:hover {
    background: var(--text-secondary);
}

.dialog-btn.secondary {
    background: var(--text-secondary);
    color: var(--surface-white);
}

.dialog-btn.secondary:hover {
    background: var(--neutral-disabled);
}

.dialog .property-form {
    margin-bottom: 1rem;
}

.link-btn {
    border: 0;
    background: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

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

.link-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Unsaved Changes Warning Dialog - now uses general classes */
.unsaved-changes-overlay {
    /* Inherits from .dialog-overlay */
}

.unsaved-changes-dialog {
    /* Inherits from .dialog */
}

.unsaved-changes-dialog h3 {
    /* Inherits from .dialog h3 */
}

.unsaved-changes-dialog p {
    /* Inherits from .dialog p */
}

.unsaved-changes-buttons {
    /* Inherits from .dialog-buttons */
}

.unsaved-changes-btn {
    /* Inherits from .dialog-btn */
}

.unsaved-changes-btn.discard {
    /* Inherits from .dialog-btn.danger */
}

.unsaved-changes-btn.cancel {
    /* Inherits from .dialog-btn.secondary */
}

/* Disabled section styling */
.disabled-section {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.3);
}

/* Authentication styles */
body:has(.auth-container) {
    overflow-y: auto !important;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 64px);
    padding: var(--spacing-panel);
    overflow-y: auto;
}

.auth-card {
    background: var(--surface-raised);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-auth-card);
    width: 100%;
    max-width: 500px;
}

.auth-card h2 {
    margin: 0 0 var(--spacing-lg) 0;
    color: var(--text-body);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.auth-form .form-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-panel);
}

.auth-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-panel);
}

.auth-form .form-row .form-field {
    margin-bottom: 0;
    gap: var(--spacing-sm);
}

.auth-form .form-field label {
    font-weight: 500;
    color: var(--text-body);
    font-size: 14px;
}

.auth-form .form-field input,
.auth-form .form-field select,
.auth-form .form-field textarea {
    padding: var(--spacing-inset);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    font-size: 14px;
    background-color: var(--surface-white);
    color: var(--text-body);
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.form-field-input {
    padding: var(--spacing-inset);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    font-size: 14px;
    background-color: var(--surface-white);
    color: var(--text-body);
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.auth-form .form-field input:focus,
.auth-form .form-field select:focus,
.auth-form .form-field textarea:focus {
    outline: none;
    border-color: var(--action-blue);
    box-shadow: var(--shadow-focus);
}


.auth-form .btn {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-inset) var(--spacing-lg);
    background-color: var(--action-blue);
    color: var(--cream-highlight);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.auth-form .btn:hover {
    background-color: var(--action-blue-deep);
}

.form-submit {
    background-color: var(--action-blue) !important;
    border-color: var(--action-blue) !important;
    margin-top: 30px !important;
    padding: calc(var(--spacing-inset) + var(--spacing-xs)) var(--spacing-lg) !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    border-radius: var(--radius-md) !important;
}

.auth-form .btn {
    margin-top: 30px !important;
}

.auth-links {
    margin-top: 24px;
    text-align: center;
}

.auth-links p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-links a {
    color: var(--action-blue);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.alert {
    padding: var(--spacing-inset) var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
    font-size: 14px;
}

.alert-success {
    background-color: var(--alert-success-bg);
    color: var(--alert-success-text);
    border: 1px solid var(--alert-success-border);
}

.alert-error {
    background-color: var(--alert-error-bg);
    color: var(--alert-error-text);
    border: 1px solid var(--alert-error-border);
}

.alert-info {
    background-color: var(--alert-info-bg);
    color: var(--alert-info-text);
    border: 1px solid var(--alert-info-border);
}

.field-errors {
    color: var(--progress-gap);
    font-size: 12px;
    margin-top: var(--spacing-xs);
}

.field-errors ul {
    margin: 0;
    padding-left: var(--spacing-md);
}

/* User groups management styles */
.user-groups-section {
    margin-bottom: 32px;
}

.user-groups-section h3 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-body);
    font-size: 18px;
    font-weight: 600;
}

.groups-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-lg);
    background-color: var(--surface-muted);
}

.group-info h4 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--text-body);
    font-size: 16px;
    font-weight: 600;
}

.group-info p {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.group-info small {
    color: var(--text-muted);
    font-size: 12px;
}

.group-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-sm {
    padding: var(--radius-md) var(--spacing-inset);
    font-size: 12px;
}

.btn-danger {
    background-color: var(--progress-gap);
    color: var(--cream-highlight);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-danger:hover {
    background-color: var(--progress-gap-deep);
}

/* Analysis result display — matches property input boxes, read-only */
.result-display {
    font-family: var(--font-family-sans);
    background: var(--surface-raised);
    color: var(--text-label);
    display: flex;
    align-items: center;
    cursor: default;
    user-select: text;
}

.result-number,
.result-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-label);
    line-height: normal;
}

.result-display img {
    border-radius: var(--radius-lg);
    box-shadow: none;
    max-width: 100%;
    height: auto;
}

.property-form .spectrum-display {
    width: 100%;
    height: auto;
    min-height: var(--property-field-height);
    border: 1px solid var(--border-passive);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    padding: var(--spacing-inset);
    box-sizing: border-box;
}

/* Unified native select — custom chevron + matched text/arrow insets */
select,
.form-field select,
.form-field-group select,
.property-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    height: var(--property-field-height);
    min-height: var(--property-field-height);
    padding-left: var(--spacing-inset);
    padding-right: calc(var(--spacing-inset) + 20px);
    border: 1px solid var(--border-passive);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-family-sans);
    color: var(--text-label);
    line-height: normal;
    cursor: pointer;
    box-sizing: border-box;
    background-color: var(--surface-raised);
    background-image: var(--select-chevron);
    background-repeat: no-repeat;
    background-position: right var(--spacing-inset) center;
    background-size: 12px 12px;
}

select:focus,
.form-field select:focus,
.form-field-group select:focus,
.property-form select:focus {
    outline: none;
    border-color: var(--border-passive);
    box-shadow: none;
    background-color: var(--surface-raised);
}

select:disabled,
.form-field select:disabled,
.form-field-group select:disabled,
.property-form select:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Standard text/number/date inputs — match property field controls */
.form-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.property-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.molecule-name-edit {
    height: var(--property-field-height);
    min-height: var(--property-field-height);
    padding: 0 var(--spacing-inset);
    border: 1px solid var(--border-passive);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-family-sans);
    color: var(--text-label);
    background: var(--surface-raised);
    box-sizing: border-box;
    transition:
        background-color var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out),
        color var(--duration-fast) var(--ease-out);
}

.form-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.property-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.molecule-name-edit:focus {
    outline: none;
    border-color: var(--border-passive);
    box-shadow: none;
    background-color: var(--surface-raised);
}

.form-field input[type="number"],
.property-form input[type="number"] {
    -moz-appearance: textfield;
}

.form-field input[type="number"]::-webkit-outer-spin-button,
.form-field input[type="number"]::-webkit-inner-spin-button,
.property-form input[type="number"]::-webkit-outer-spin-button,
.property-form input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
