@import "fonts.css";

/* ============================================================
   CSS custom properties
   ============================================================ */
:root {
    --color-primary:        #02758A;
    --color-primary-light:  #0097B2;
    --color-accent:         rgb(114, 180, 191);
    --color-bg:             rgb(240, 253, 255);
    --color-bg-light:       #e2fbff;
    --color-bg-medium:      #cfecf1;
    --color-bg-section:     rgb(213, 237, 241);
    --color-header:         rgb(160, 205, 213);
    --color-danger:         #c30d12;
    --color-success:        #6aef90;
    --font-main:            'Poppins', Arial, sans-serif;
    --font-mono:            'Fira Code', monospace;
    --shadow-light:         0 0em 1em -0.5em #95b6b6;
    --shadow-button:        0 10px 20px -8px #c5d6d6;
    --radius-sm:            0.3em;
    --radius-md:            0.4em;
    --radius-pill:          2em;
    --ui-scale:             1;
}

/* ============================================================
   Base
   ============================================================ */
body.body-snv-indels {
    margin-bottom: 1em;
}

body {
    font-family: var(--font-main);
    text-align: center;
    margin: 2em;
    margin-top: 0.5em;
    background-color: var(--color-bg);
    /* Scales with viewport (vmin) so smaller windows shrink type; still clamped for readability */
    font-size: calc(clamp(14px, 0.55vmin + 0.55rem, 18px) * var(--ui-scale));
}

h2 {
    font-family: var(--font-main);
    font-weight: 600;
    cursor: default;
    margin: 0.5em;
    font-size: 1.4em;
}

.hgvs-info {
    color: color(srgb 0.535 0.535 0.535);
    font-size: 1.5em;
    margin: 0;
    font-weight: 600;
    margin-left: 1em;
}


ul a {
    text-decoration: none;
}


div#PCR, div#qPCR{
    width: 40%;
}

input#Transcript-ID, input#Gene-ID, textarea, input#pos_pcr, input#pos_qpcr {
    padding: 0.4em;
    width: 95%;
    border: 1px solid #ccc;
    text-align: center;
    border-radius: 5px;
    font-size: 1.3em;
    word-wrap: break-word;
    max-width: 95%;
    font-family: var(--font-main);
}

textarea {
    resize: none;
    width:92%;
}

/* Match sequence placeholder / text size to dual_input fields (Genomic / Transcript rows) */
#Sequence textarea#sequence {
    font-size: clamp(0.85em, 2.6vmin, 1.3em);
}

.resize {
    height: 100%;
}

.copy-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: color(srgb 0.4033 0.6913 0.74);
    cursor: pointer;
    font-size: 1.3em;
    font-weight: 600;
    text-decoration: none;
    color: white;
    box-shadow: var(--shadow-button);
    border: none;
    border-radius: var(--radius-pill);
    margin: 0.5em;
    padding: 0.6em 1.3em;
    font-family: var(--font-main);
}

.copy-button:hover {
    transform: scale(1.02);
    box-shadow: 0 0.3em 0.8em -0.1em #2734384d;
    background-color: color(srgb 0.4745 0.7975 0.855);
    transition: transform 0.3s ease;
}

.submit-button {
    font-size: 1.6em;
    display: block;
    font-weight: 600;
    border-radius: 4em;
    border: none;
    cursor: pointer;
    margin: 0;
    background-color: white;
    margin-top: 0.8em;
    color: #52afa2;
    box-shadow: 0 0 0.4em 0.01em color(srgb 0.774 0.8522 0.86 / 0.69) inset;
    padding: 0.5em 1.3em;
}

.submit-button:hover {
    background-color: #3ca697 !important;
    transform: scale(1.02);
    box-shadow: 0 0.3em 0.8em -0.1em #2734384d;
    color: white !important;
    transition: transform 0.3s ease;
}

/* Load Example + Reset + Generate Primers (SNV/InDel index) */
.snv-submit-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75em 1em;
    margin-top: 0.8em;
}

.snv-submit-row .submit-button,
.snv-submit-row .example-button,
.snv-submit-row .reset-button {
    margin-top: 0;
}

.example-button {
    background-color: rgb(153, 199, 207);
    cursor: pointer;
    display: block;
    font-size: 1.3em;
    font-weight: 600;
    color: white;
    box-shadow: var(--shadow-button);
    border: none;
    border-radius: var(--radius-pill);
    margin-top: 2.52em;
    padding: 0.4em 1.5em;
    font-family: var(--font-main);
}

.reset-button, .back-button {
    background-color: #c30d1299;
    font-weight: 600;
    box-shadow: var(--shadow-button);
    cursor: pointer;
    display: block;
    font-size: 1.3em;
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    margin-top: 2.52em;
    padding: 0.4em 1.5em;
    font-family: var(--font-main);
}

.back-button {
    margin: 0.5em;
}

.error-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
    margin: 0.5em;
}

.reset-button:hover, .back-button:hover {
    background-color: #ed898c;
}

.example-button:hover {
    background-color: rgb(172, 231, 242);
}

input[type="radio"] {
    opacity: 0;
    pointer-events: none;
    height: 0;
    margin: 0;
    padding: 0;
    width: 0;
}

input[type="radio"] + label {
    position: relative;
    font-family: var(--font-main);
    font-size: 1.3em;
    cursor: pointer;
    color: color(srgb 0.3477 0.5336 0.57);
    border-radius: var(--radius-md);
}

input[type="radio"] + label:not(.primer-selector) {
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.2em 1em;
}


input[type="radio"] + label.primer-selector {
  color: black;
}

input[type="radio"] + label:not(.primer-selector):hover {
    transition: all 0.2s ease;
    background-color: rgb(195, 226, 231);
}

/* Erstelle einen benutzerdefinierten Radio-Button */
input[type="radio"] + label:not(.primer-selector)::before {
    content: "";
    height: 0.9em;
    color: color(srgb 0.4969 0.6803 0.715);
    width: 0.9em;
    outline: 0.1em solid rgb(87, 163, 176);
    border-radius: 50%;
    display: inline-block;
}

/* Wenn der Radio-Button ausgewählt ist */
input[type="radio"]:not(.primer-selector):checked + label:not(.primer-selector) {
    color: black;
    transition: all 0.2s ease;
}

/* Stil für den "aktivierten" Kreis */
input[type="radio"]:checked + label:not(.primer-selector)::before {
    background-color: rgb(87, 163, 176);
    outline: 0.1em solid color(srgb 0.6327 0.8214 0.855)
}


input[type="radio"] + label.primer-selector::before {
  content: "";
  height: 1em;
  margin-right: 0.7em;
  width: 1em;
  border: 2px solid rgb(45, 133, 120);
  border-radius: 50%;
}

label.primer-selector {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

/* Selected radio button indicator */
input[type="radio"]:checked + label.primer-selector::before {
    animation: clickEffect 0.2s ease-out;
    background-color: rgb(45, 133, 120);
    outline: 0.1em solid white;
}

@keyframes clickEffect {
    0%   { transform: scale(1); }
    50%  { transform: scale(0.8); }
    100% { transform: scale(1); }
}

div#in {
    display: grid;
    position: relative;
    /* min(100%, 22rem) prevents column min-width from forcing horizontal overflow on narrow viewports */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5em;
    box-sizing: border-box;
}

.dual_input {
    display: flex;
    justify-content: center;
    padding: 0.4em;
    width: 92%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid #ccc;
    background-color: white;
    border-radius: 0.5em;
}

.dual_input input {
    text-align: center;
    padding: 0;
    background-color: white;
    min-width: 0;
    font-size: clamp(0.85em, 2.6vmin, 1.3em);
}

div.column {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    width: 20%;
    min-width: 0;
    flex-shrink: 0;
    font-weight: 600;
    font-size: clamp(0.85em, 2.6vmin, 1.3em);
    border-right: 1px solid #ccc;
    color: rgb(87, 163, 176);
}

.snv_column{
    display:flex;
    flex-direction: row;
    width: 80%;
    min-width: 0;
    flex: 1 1 auto;
}

input#IndelChrom, input#IndelStart, input#IndelEnd,
input#IdIndelStart, input#IdIndelEnd, input#sv_chromosome,
input#sv_chromosome, input#sv_start_position {
    width: 100%;
    padding-bottom: 0.4em;
    border: none;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box;
}

input#IndelStart, input#IndelEnd, input#IndelIns,
input#IdIndelEnd, input#IdIndelIns,
input#sv_start_position, input#sv_end_position {
    padding-top: 0.4em;
}

/* SilicoPCR primer fields: no inner underline (dual_input already provides the box). */
input#forward_primer, input#reverse_primer {
    width: 100%;
    border: none;
    outline: none;
    box-sizing: border-box;
    padding: 0.4em;
    font-family: var(--font-main);
    /* Match Reference genome toggle labels (#genome-button .knobs → 1.3em). */
    font-size: 1.3em;
}

#Silico_PCR_Primers div.column {
    font-size: 1.3em;
}

input#Position, input#genom_pos {
    width: 65%;
    border: none;
    border-right: 1px solid #ccc;
    padding-left: 0.4em;
    padding-right: 0.4em;
    margin-right: 1px;
    font-family: var(--font-main);
}

input#new_base, input#IDnew_base, input#sv_end_position {
    width: 35%;
    border: none;
    box-sizing: border-box;
}

.settings div {
    display: flex;
    justify-content: center;
}

.divider {
    width: 100%;
    height: 4px;
    background-color: rgba(4, 150, 176, 0.63);
    margin: 20px 0;
}

.settings-container {
    margin: 0.5em 1em 2em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.input-warning-banner {
    max-width: 64em;
    margin: 0.5em auto 0.75em;
    padding: 0.75em 1em;
    border-radius: var(--radius-md);
    background: lightsalmon;
    border: 1px solid color(srgb 0.82 0.42 0.08 / 0.45);
    color: color(srgb 0.26 0.11 0.03);
    line-height: 1.45;
    box-shadow: var(--shadow-light);
}

.ui-scale-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.35em 0.5em;
    border-radius: var(--radius-pill);
    background-color: white;
    box-shadow: var(--shadow-light);
}

.ui-scale-btn {
    appearance: none;
    border: none;
    background-color: rgb(153, 199, 207);
    color: white;
    font-weight: 700;
    font-family: var(--font-main);
    border-radius: 999px;
    padding: 0.45em 0.9em;
    cursor: pointer;
    box-shadow: var(--shadow-button);
}

.ui-scale-btn:hover:enabled {
    transform: scale(1.02);
    transition: transform 0.2s ease;
    background-color: rgb(172, 231, 242);
}

.ui-scale-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

#primer-settings {
    appearance: none;
    background-color: rgb(210, 249, 250);
    color: rgb(24, 128, 117);
    font-size: 1.3em;
    padding: 0.3em 1em;
    font-family: var(--font-main);
    cursor: pointer;
}

select#primer-settings:hover {
    background-color: rgb(224, 251, 252);
}

.primer-parameters {
    margin: 0.2em;
    font-size: 1.1em;
}

#Identifier, #Genomic_Position, #Sequence, #Structural_Variant, #Silico_PCR_Primers {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow: visible;
    border-radius: var(--radius-md);
    text-align: center;
    align-items: center;
    transform: scale(1);
    transition: all 0.2s ease;
    min-width: 0;
    background-color: var(--color-bg-section);
}

/* Prevent long labels/text from breaking layout on narrow screens */
label, h2, .hover-label, .info-li {
    overflow-wrap: anywhere;
}

/* Info icon and overlay */
.info-icon, .output-info-icon {
    position: absolute;
    bottom: 1em;
    right: 1em;
    background-color: rgb(232, 247, 250);
    color: color(srgb 0.2429 0.5607 0.615);
    border-radius: 50%;
    width: 2em;
    height: 2em;
    text-align: center;
    line-height: 2em;
    font-weight: bold;
    cursor: pointer;
    z-index: 11;
}

.output-info-icon {
    position: relative;
    background-color: rgb(208, 240, 246);
    bottom: 0;
    right: 0;
}

.info-icon:hover, .output-info-icon:hover {
    background-color: color(srgb 0.5005 0.7303 0.77);
    color: white;
}

.info-li {
    text-align: left;
    margin: 1em;
    padding-left: 1em;
}

/* Overlay – hidden by default */
.info-overlay, .output-info-overlay {
    display: none;
    position: absolute;
    color: #000;
    border-radius: var(--radius-md);
    box-sizing: border-box;
    z-index: 10;
}

.info-overlay {
    top: 0;
    padding: 1em;
    width: 100%;
    height: 100%;
    background: rgb(214, 237, 241);
}

.output-info-overlay {
    padding: 0;
    left: 30em;
    width: min(40em, 80vw);
    height: auto;
    background-color: rgba(214, 237, 241, 0.97);
}

.info-icon:hover + .info-overlay,
.output-info-icon:hover + .output-info-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
}


.highlight {
    background-color: rgb(195, 226, 231) !important;
    box-shadow: 0 0.3em 1.1em -0.4em rgba(39, 52, 56, 0.30);
    outline: 0.12em solid rgba(87, 163, 176, 0.35);
    transition: all 0.2s ease;
}

/* Dim unselected input containers */
.grey-transparent {
    opacity: 0.3;
    color: rgb(127, 165, 174);
    transition: all 0.2s ease;
}

.highlight-target {
    background-color: rgba(241, 129, 123, 0.587);
    word-break: break-word;
}

.highlight-mutation {
    background-color: rgba(242, 90, 82, 0.658);
    color: black;
    word-break: break-word;
    font-weight: bold;
    box-shadow: inset 0 -2px 0 0 rgba(200, 40, 32, 0.95);
}

/* AS-PCR: variant site stays visible when a primer highlight overlaps it */
.highlight-primer .highlight-mutation,
.highlight-mutation.highlight-primer {
    background-color: rgba(242, 90, 82, 0.82);
    box-shadow: inset 0 0 0 2px rgba(200, 40, 32, 0.9);
}

/* AS-PCR SNV: allele base inside [SNV:ref>alt] should look like primer (blue) */
.highlight-mutation .highlight-primer {
    background-color: #89cad5;
    box-shadow: none;
    display: inline-block;
    padding: 0 0.12em;
    border-radius: 0.12em;
}

.highlight-vcf {
    background-color: color(srgb 0.88 0.82 0.98);
    box-shadow: inset 0 0 0 1px color(srgb 0.55 0.42 0.78 / 0.55);
    font-weight: 600;
    cursor: help;
}

.highlight-snp {
    background-color: color(srgb 1 0.9 0.55);
    box-shadow: inset 0 0 0 1px color(srgb 0.92 0.68 0.18 / 0.55);
    font-weight: 600;
    cursor: help;
}

.highlight-snp-conflict {
    background-color: color(srgb 1 0.78 0.38);
    box-shadow: inset 0 0 0 1px color(srgb 0.85 0.45 0.08 / 0.65);
    font-weight: 700;
    cursor: help;
}

.highlight-primer {
    background-color: #89cad5;
}

.green {
    background-color: var(--color-success);
    padding: 0 0.5em;
}

.red {
    background-color: rgba(255, 143, 143, 1);
    padding: 0 0.5em;
}


.ID_h2 {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0.5em 0.5em 0 0;
    background-color: var(--color-header);
    color: white;
    padding: 0.3em 0.2em;
}

/* Identifier section: prevent flex children from overflowing narrow containers */
.identifier-transcript-row {
    display: flex;
    width: 95%;
    max-width: 100%;
    margin-top: 0.2em;
    min-width: 0;
    box-sizing: border-box;
}

.identifier-transcript-row .ID_h2 {
    border-radius: 0.5em 0 0 0.5em;
    width: min(12em, 40%);
    flex: 0 1 auto;
    /* Match dynamic scaling of inputs in this section */
    font-size: clamp(0.85em, 2.6vmin, 1.3em);
    line-height: 1.25;
}

/* "Check against" / "Reference" headers — same viewport-linked sizing */
#Identifier .identifier-two-col-wrap .ID_h2 {
    font-size: clamp(0.85em, 2.6vmin, 1.3em);
    line-height: 1.25;
}

/* Option labels (Genome, Transcriptome, cDNA, CDS) — match section typography */
#Identifier .identifier-two-col-wrap input[type="radio"] + label:not(.primer-selector) {
    font-size: clamp(0.85em, 2.6vmin, 1.3em);
    line-height: 1.25;
}

.identifier-transcript-row input#Transcript-ID {
    flex: 1 1 12em;
    min-width: 0;
    width: auto;
    max-width: 100%;
    border: none;
    box-shadow: 0 0 1em -0.5em #8baaaa;
    border-radius: 0 0.5em 0.5em 0;
    font-size: clamp(0.85em, 2.6vmin, 1.3em);
}

.identifier-two-col-wrap {
    display: flex;
    width: 95%;
    max-width: 100%;
    gap: 1em;
    margin-top: 1em;
    min-width: 0;
    box-sizing: border-box;
    /* Keep "Check against" and "Reference" on one row within the Identifier card */
    flex-wrap: nowrap;
    align-items: stretch;
}

.identifier-two-col-wrap .identifier-col {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}

@media (max-width: 700px) {
    .identifier-transcript-row {
        flex-direction: column;
        align-items: stretch;
    }
    .identifier-transcript-row .ID_h2 {
        width: 100%;
        border-radius: 0.5em 0.5em 0 0;
    }
    .identifier-transcript-row input#Transcript-ID {
        border-radius: 0 0 0.5em 0.5em;
    }
}

input::placeholder, textarea::placeholder {
    color: rgb(206, 206, 206);
    font-family: var(--font-main);
    text-align: center;
    opacity: 1;
}

* {
    -webkit-tap-highlight-color: transparent;
}

*:focus {
    outline: none;
}

.checkbox {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
}

.toggle-button-cover, .toggle-PCR-button-cover {
    position: relative;
    box-sizing: border-box;
}

.button-cover {
    box-shadow: var(--shadow-light);
    border-radius: var(--radius-md);
    height: 3em;
    width: 15em;
    background-color: white;
    cursor: pointer;
}

.PCR-button-cover {
    width: 11em;
}

/* ============================================================
   Toggle switch base styles
   ============================================================ */
.button-cover,
.PCR-button-cover,
.knobs,
.layer {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    flex-direction: column;
    text-align: center;
    display: flex;
    justify-content: center;
}

.button {
    position: relative;
    height: 2.5em;
    overflow: hidden;
}

.button.r,
.button.r .layer {
    border-radius: 10%;
}

.button.b2 {
    border-radius: 2px;
}

.knobs {
    z-index: 2;
}

.layer {
    width: 100%;
    background-color: #ebf7fc;
    transition: 0.3s ease all;
    z-index: 1;
}

/* ============================================================
   Genome / PCR toggle knob shared styles
   ============================================================ */
#genome-button .knobs:before,
#genome-button .knobs:after,
#genome-button .knobs span,
#PCR-button .knobs:before,
#PCR-button .knobs:after,
#PCR-button .knobs span {
    position: absolute;
    top: 0.1em;
    bottom: 0.1em;
    width: 5em;
    font-size: 1.3em;
    font-weight: 500;
    text-align: center;
    line-height: 1;
    padding: 3%;
    border-radius: var(--radius-sm);
    transition: 0.4s cubic-bezier(0.18, 0.89, 0.35, 1.15) all;
}

/* Genome button */
#genome-button .knobs:before {
    content: "GRCh37";
    left: 0.2em;
    top: 0.25em;
    z-index: 2;
    color: white;
}

#genome-button .knobs:after {
    content: "GRCh38";
    top: 0.25em;
    color: color(srgb 0.6649 0.8122 0.84);
    z-index: 2;
    right: 0.1em;
}

#genome-button .knobs span {
    left: 0.5em;
    right: 0.5em;
    background-color: var(--color-accent);
    box-shadow: 0 0em 1em -0.5em #334747;
    z-index: 1;
    width: 4.5em;
}

#genome-button .checkbox:checked + .knobs:before {
    left: 0;
    color: color(srgb 0.6649 0.8122 0.84);
}

#genome-button .checkbox:checked + .knobs:after {
    right: 0.2em;
    color: white;
}

#genome-button .checkbox:checked + .knobs span {
    left: 5.8em;
    background-color: var(--color-accent);
}

#genome-button .checkbox:checked ~ .layer {
    background-color: #fcebeb;
}

/* PCR button */
#PCR-button .knobs:before {
    content: "PCR";
    left: -0.5em;
    top: 0.25em;
    color: white;
    z-index: 2;
}

#PCR-button .knobs:after {
    content: "qPCR";
    top: 0.25em;
    color: color(srgb 0.3416 0.6391 0.69 / 0.52);
    z-index: 2;
    right: -0.5em;
}

#PCR-button .knobs span {
    left: 0.5em;
    right: 0.5em;
    width: 3.2em;
    background-color: var(--color-accent);
    box-shadow: 0 0em 1em -0.5em #334747;
    z-index: 1;
}

#PCR-button .checkbox:checked + .knobs:before {
    left: -0.5em;
    color: color(srgb 0.3416 0.6391 0.69 / 0.52);
}

#PCR-button .checkbox:checked + .knobs:after {
    right: -0.4em;
    color: white;
}

#PCR-button .checkbox:checked + .knobs span {
    left: 4.4em;
    width: 3em;
    background-color: var(--color-accent);
}

#PCR-button .checkbox:checked ~ .layer {
    background-color: #fcebeb;
}

/* ============================================================
   Primer-settings toggle
   ============================================================ */
#primer-settings-button .knobs:before,
#primer-settings-button .knobs:after,
#primer-settings-button .knobs span {
    position: absolute;
    top: 0.1em;
    bottom: 0.1em;
    width: 5em;
    font-size: 1.3em;
    font-weight: 500;
    text-align: center;
    line-height: 1;
    padding: 3%;
    border-radius: var(--radius-sm);
    transition: 0.4s cubic-bezier(0.18, 0.89, 0.35, 1.15) all;
}

#primer-settings-button .knobs:before {
    content: "default";
    left: 0.2em;
    z-index: 2;
    color: white;
}

#primer-settings-button .knobs:after {
    content: "custom";
    color: color(srgb 0.6649 0.8122 0.84);
    z-index: 2;
    right: 0.1em;
}

#primer-settings-button .knobs span {
    left: 0.5em;
    right: 0.5em;
    background-color: var(--color-accent);
    box-shadow: 0 0em 1em -0.5em #334747;
    z-index: 1;
    width: 4.5em;
}

#primer-settings-button .checkbox:checked + .knobs:before {
    left: 0;
    color: color(srgb 0.6649 0.8122 0.84);
}

#primer-settings-button .checkbox:checked + .knobs:after {
    right: 0.2em;
    color: white;
}

#primer-settings-button .checkbox:checked + .knobs span {
    left: 5.8em;
    background-color: var(--color-accent);
}

#primer-settings-button .checkbox:checked ~ .layer {
    background-color: #fcebeb;
}

.toggle-primer-settings-button-cover {
    position: relative;
    box-sizing: border-box;
}

/* ============================================================
   Hover label above input sections
   ============================================================ */
.hover-label {
    position: absolute;
    width: 11em;
    height: 4em;
    z-index: -1;
    top: -1.9em;
    left: 50%;
    transform: translateX(-50%);
    background-color: #d6edf1;
    color: color(srgb 0.343 0.6385 0.6902);
    padding: 0.3rem 0.6rem;
    border-radius: 1em 1em 0 0;
    font-size: 1.3em;
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    will-change: opacity, transform;
}

.hover-label-highlight {
    background-color: rgb(195, 226, 231) !important;
}

/* ============================================================
   Output / results table
   ============================================================ */
.output-table tr:nth-child(even) { background-color: var(--color-bg-light); }
.output-table tr:nth-child(odd)  { background-color: var(--color-bg-medium); }
.output-table tr:hover           { background-color: #bae6d9; }

tr.selectable-row.selected {
    background-color: #9ad6c4;
    transition: transform 0.3s ease;
}

.output-li {
    list-style-type: none;
    font-size: 1.1em;
    padding: 0.3em 1em;
}

.output-h2 {
    font-size: 1rem;
    margin: 0.1em;
}

input#primer-selection {
    font-size: 0.5rem;
}

div#primer-info {
    padding-left: 0.5em;
    padding-right: 0.5em;
}

h1 {
    padding: 0;
}

.output-table-div {
    display: flex;
    justify-content: center;
}

p.output-legend {
    font-size: 1.3em;
    margin: 0;
    color: color(srgb 0.5362 0.7911 0.8346);
}

/* ============================================================
   Tooltip
   ============================================================ */
.tooltip {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    white-space: nowrap;
    overflow-wrap: break-word;
}

.tooltip[data-overflow="right"] {
    left: auto;
    right: 0;
    transform: none;
}

.tooltip[data-overflow="left"] {
    left: 0;
    transform: none;
}

/* ============================================================
   Loading overlay
   ============================================================ */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: min(28em, 92vw);
    padding: 1.75em 2em;
    border-radius: var(--radius-md);
    background: linear-gradient(
        180deg,
        var(--color-bg) 0%,
        var(--color-bg-section) 100%
    );
    color: color(srgb 0.15 0.35 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid color(srgb 0.55 0.72 0.78);
}

.loader-title {
    margin: 0 0 0.35em;
    font-family: var(--font-main);
    font-size: 1.35em;
    font-weight: 600;
    color: var(--color-primary);
}

.loader-lead {
    margin: 0 0 1em;
    font-size: 0.95em;
    line-height: 1.45;
    color: color(srgb 0.25 0.4 0.45);
}

.loader-steps {
    margin: 0 auto 1em;
    padding: 0;
    list-style: none;
    text-align: left;
    font-size: 0.9em;
    line-height: 1.5;
    width: fit-content;
    max-width: 100%;
    align-self: center;
}

.loader-step {
    position: relative;
    padding: 0.45em 0 0.45em 1.6em;
    border-bottom: 1px solid color(srgb 0.75 0.88 0.9 / 0.6);
}

.loader-step:last-child {
    border-bottom: none;
}

.loader-step::before {
    content: "";
    position: absolute;
    left: 0.35em;
    top: 0.85em;
    width: 0.45em;
    height: 0.45em;
    border-radius: 50%;
    background: var(--color-primary-light);
}

.loader-footnote {
    margin: 0;
    font-size: 0.82em;
    line-height: 1.4;
    color: color(srgb 0.35 0.48 0.52);
    font-style: italic;
}

.spinner {
    border: 5px solid var(--color-bg-medium);
    border-top: 5px solid var(--color-primary);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 1.1em auto;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================
   Sequence display
   ============================================================ */
.sequence-container {
    font-family: var(--font-mono);
    margin: 2em auto;
    display: flex;
    justify-content: center;
    width: 95%;
    overflow-x: auto;
    padding: 1em 0;
}

.seq-lines {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-block;
    min-width: min-content;
}

.seq-line {
    display: flex;
    align-items: flex-start;
    gap: 1.5ch;
    white-space: nowrap;
    margin-bottom: 0.1em;
}

.seq-num {
    display: inline-block;
    width: 6ch;
    text-align: right;
    color: #88aeb5;
    font-weight: 600;
    flex: 0 0 auto;
    user-select: none;
}

.seq-chunk {
    display: inline-block;
    font-size: calc(clamp(14px, 0.85vw + 10px, 18px) * var(--ui-scale));
    font-variant-ligatures: none;
    text-align: left;
    letter-spacing: 0.05ch;
}

/* ============================================================
   Responsive adjustments
   ============================================================ */
@media (max-width: 900px) {
    body {
        margin: 1em;
    }

    div#in {
        grid-template-columns: 1fr;
    }

    #Identifier, #Genomic_Position, #Sequence, #Structural_Variant, #Silico_PCR_Primers {
        width: 100%;
    }

    .seq-chunk {
        font-size: calc(clamp(14px, 0.85vw + 10px, 18px) * var(--ui-scale));
    }
}

@media (max-width: 600px) {
    body {
        /* Allow slightly smaller text so inputs stay within their containers */
        font-size: calc(clamp(12px, 0.65vmin + 0.45rem, 16px) * var(--ui-scale));
        margin: 0.8em;
    }

    div#in {
        gap: 1rem;
    }

    h2 {
        font-size: 1.25em;
    }

    .dual_input {
        width: 100%;
    }
}






.documentation-page {
    width: 92%;
    margin: 0 auto 3em auto;
}

.documentation-hero {
    text-align: center;
    padding-bottom: 1em;
}

.documentation-intro {
    max-width: 55em;
    margin: 0 auto;
    font-size: 1.2em;
    line-height: 1.6;
}

.documentation-layout {
    display: flex;
    align-items: flex-start;
    gap: 2em;
    margin-top: 2em;
}

.documentation-sidebar {
    width: 16em;
    flex-shrink: 0;
    position: sticky;
    top: 2em;
    background-color: rgb(213, 237, 241);
    border-radius: 1em;
    padding: 1.2em 1em;
    box-sizing: border-box;
    box-shadow: 0 0em 1em -0.5em #95b6b6;
}

.documentation-sidebar h2 {
    margin-top: 0;
    margin-bottom: 0.8em;
}

.documentation-link {
    display: flex;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    margin: 0.5em 0;
    text-decoration: none;
}

.documentation-content {
    flex: 1;
    min-width: 0;
}

.documentation-card {
    background-color: rgb(213, 237, 241);
    border-radius: 1em;
    padding: 1.5em;
    margin-bottom: 1.5em;
    text-align: left;
    box-shadow: 0 0em 1em -0.5em #95b6b6;
}

.documentation-card p,
.documentation-card li {
    font-size: 1.15em;
    line-height: 1.7;
}

.documentation-list {
    text-align: left;
    padding-left: 1.5em;
    margin: 1em 0;
}

.documentation-actions {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
    margin-top: 1.2em;
}

.documentation-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
    padding: 0.5em 1em;
}

.documentation-steps {
    padding-left: 1.4em;
    margin: 0.75em 0 1.2em 0;
}

.documentation-card h3 {
    margin-top: 1.1em;
}

.doc-callout {
    padding: 0.8em 1em;
    border-radius: 0.9em;
    margin: 0.9em 0 1.1em 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.45);
}

.doc-callout-note {
    border-color: color(srgb 0.55 0.72 0.78);
    background: color(srgb 0.94 0.97 0.98);
}

.doc-codebox {
    border-radius: 1em;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1em;
    margin: 0.9em 0 1.1em 0;
    overflow: auto;
}

.doc-codebox-title {
    font-weight: 700;
    margin-bottom: 0.6em;
}

.doc-pre {
    margin: 0;
    font-size: 1em;
    line-height: 1.5;
}

.doc-figure {
    margin: 1.1em 0 0.2em 0;
}

.doc-figure-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 2px dashed rgba(0, 0, 0, 0.25);
    border-radius: 1em;
    padding: 0.4em;
    background: rgba(255, 255, 255, 0.55);
    box-sizing: border-box;
}

.doc-figure-image--contain {
    object-fit: contain;
}

.doc-figure-image--cover {
    object-fit: cover;
}

.doc-figure-image--max-h-sm {
    max-height: 25em;
}

.doc-figure-image--max-h-md {
    max-height: 40em;
}

.doc-figure-image--max-h-lg {
    max-height: 55em;
}

.doc-figure-placeholder {
    border: 2px dashed rgba(0, 0, 0, 0.25);
    border-radius: 1em;
    padding: 1.4em 1em;
    min-height: 8.5em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3em;
    background: rgba(255, 255, 255, 0.55);
    color: rgba(0, 0, 0, 0.65);
    text-align: center;
    font-weight: 700;
}

.doc-figure-placeholder small {
    font-weight: 500;
}

.doc-figure figcaption {
    margin-top: 0.6em;
    font-size: 1.05em;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.75);
}

@media (max-width: 1000px) {
    .documentation-layout {
        flex-direction: column;
    }

    .documentation-sidebar {
        width: 100%;
        position: static;
    }
}
