/* static/css/homePage.css */

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;

    overflow: hidden;
}
* {
    box-sizing: border-box;
}

/* ##########################
        Color Setting
########################## */ 
:root {
  /* Drop Zone */
  --bg-drop-zone:        rgb(34,34,34);
  --bg-drop-zone-hover: rgb(51,51,51);
  --text-drop-zone:     rgb(255,255,255);
  --bg-drop-upload-btn: rgb(23,23,23);
  --text-drop-upload-btn: rgb(255, 255, 255);
  --border-drop-upload-btn: 1px solid rgb(255, 255, 255);
  --bg-start-detect-btn: rgb(23,23,23);
  --text-start-detect-btn: rgb(255,255,255);
  --border-start-detect-btn: 1px solid rgb(255, 255, 255);

  /* Landing Page */
  --landing-bg: #000;
  --landing-text: #fff;
  --landing-text-soft: rgba(255,255,255,0.85);
  --landing-text-muted: rgba(255,255,255,0.68);

  --landing-footer-border: rgba(255,255,255,0.08);
  --landing-divider: rgba(255,255,255,0.35);

  --landing-scroll-track: #000;
  --landing-scroll-thumb: rgb(65,65,65);
  --landing-scroll-thumb-hover: rgb(90,90,90);

  --landing-back-text: rgba(255,255,255,0.85);
  --landing-back-hover-text: #fff;
  --landing-back-hover-bg: rgba(255,255,255,0.08);
  --landing-back-active-bg: rgba(255,255,255,0.14);

  /* Grayscale Setting Modal */
  --bg-settings-modal: rgb(0,0,0);
  --bg-settings-close-btn: rgb(0,0,0);
  --border-settings-close-btn: 2px solid rgb(255,255,255);
  --cross-settings-close-btn: rgb(255,255,255);
  --text-settings-title: rgb(255,255,255);
  --text-settings-row-label: rgb(255,255,255);
  --bg-mode-btn: rgb(0,0,0);
  --border-mode-btn: 2px solid rgb(0,0,0);
  --text-mode-btn: rgb(255,255,255);
  --bg-mode-btn-active: rgb(0,0,0);
  --border-mode-btn-active: 2px solid rgb(255,255,255);
  --text-mode-btn-active: rgb(255,255,255);
  --bg-inp-resolution: rgb(0,0,0);
  --border-inp-resolution: 2px solid rgb(255,255,255);
  --text-inp-resolution: rgb(255,255,255);
  --text-unit: rgb(255,255,255);
  --bg-grayscale-parameter-wrapper: rgb(0,0,0,0.78);
  --border-grayscale-parameter-wrapper: 1px solid rgba(255,255,255,0.18);
  --bg-scrollbar: rgba(255,255,255,0.25);
  --border-scrollbar: 1px solid rgba(255,255,255,0.25);
  --bg-settings-start-btn: rgb(0,0,0);
  --border-settings-start-btn: 2px solid rgb(255,255,255);
  --text-settings-start-btn: rgb(255,255,255);
}

[data-theme="light"] {
  /* Drop Zone */
  --bg-drop-zone:        rgb(255,255,255);
  --bg-drop-zone-hover: rgb(200,200,200);
  --text-drop-zone:     rgb(0,0,0);
  --bg-drop-upload-btn: rgb(97, 136, 155);
  --text-drop-upload-btn: rgb(255, 255, 255);
  --border-drop-upload-btn: none;
  --bg-start-detect-btn: rgb(97, 136, 155);
  --text-start-detect-btn: rgb(255, 255, 255);
  --border-start-detect-btn: none;

  /* Landing Page */
  --landing-bg: #fff;
  --landing-text: #000;
  --landing-text-soft: rgba(0,0,0,0.85);
  --landing-text-muted: rgba(0,0,0,0.68);
  /* Light mode：由上到下的漸層 */
  --landing-logo-gradient: linear-gradient(
      to bottom,
      rgb(46, 60, 64) 0%,
      rgb(52, 66, 71) 25%,
      rgb(61, 77, 85) 50%,
      rgb(73, 91, 100) 75%,
      rgb(82, 103, 114) 100%
  );

  --landing-footer-border: rgba(0,0,0,0.10);
  --landing-divider: rgba(0,0,0,0.35);

  --landing-scroll-track: #fff;
  --landing-scroll-thumb: rgb(170,170,170);
  --landing-scroll-thumb-hover: rgb(130,130,130);

  --landing-back-text: #000;
  --landing-back-hover-text: #000;
  --landing-back-hover-bg: rgba(0,0,0,0.08);
  --landing-back-active-bg: rgba(0,0,0,0.14);

  /* Grayscale Setting Modal */
  --bg-settings-modal: rgb(255,255,255);
  --bg-settings-close-btn: rgb(255,255,255);
  --border-settings-close-btn: 2px solid rgb(209,209,209);
  --cross-settings-close-btn: rgb(209,209,209);
  --text-settings-title: rgb(110,156,176);
  --text-settings-row-label: rgb(110,156,176);
  --bg-mode-btn: rgb(255,255,255);
  --border-mode-btn: 2px solid rgb(187,187,187);
  --text-mode-btn: rgb(75,75,75);
  --bg-mode-btn-active: rgb(110,156,176);
  --border-mode-btn-active: 2px solid rgb(110,156,176);
  --text-mode-btn-active: rgb(255,255,255);
  --bg-inp-resolution: rgb(255,255,255);
  --border-inp-resolution: 2px solid rgb(187,187,187);
  --text-inp-resolution: rgb(75,75,75);
  --text-unit: rgb(110,156,176);
  --bg-grayscale-parameter-wrapper: rgb(255,255,255);
  --border-grayscale-parameter-wrapper: 1px solid rgba(255,255,255,0.18);
  --bg-scrollbar: rgb(255,255,255);
  --border-scrollbar: 1px solid rgb(187,187,187);
  --bg-settings-start-btn: rgb(255,255,255);
  --border-settings-start-btn: 2px solid rgb(209,209,209);
  --text-settings-start-btn: rgb(110,156,176);
}

/* ########################################################
   STAINAI LANDING PAGE
######################################################## */
#landing-page {
    position: fixed;

    top: 0;
    left: 200px;

    width: calc(100vw - 200px);
    height: 100vh;
    height: 100dvh;

    overflow-y: auto;
    overflow-x: hidden;

    background: var(--landing-bg);
    color: var(--landing-text);

    font-family: 'PingFangHKWeb', sans-serif;

    z-index: 10;

    box-sizing: border-box;
}

/* ========================================================
   Landing Page Scrollbar - Dark Mode
======================================================== */
/* Chrome / Edge / Safari */
#landing-page::-webkit-scrollbar {
    width: 8px;
}
#landing-page::-webkit-scrollbar-track {
    background: var(--landing-scroll-track);
}
#landing-page::-webkit-scrollbar-thumb {
    background: var(--landing-scroll-thumb);
    border-radius: 999px;
    border: 2px solid var(--landing-scroll-track);
}
#landing-page::-webkit-scrollbar-thumb:hover {
    background: var(--landing-scroll-thumb-hover);
}
/* Firefox */
#landing-page {
    scrollbar-width: thin;
    scrollbar-color:
        var(--landing-scroll-thumb)
        var(--landing-scroll-track);
}



/* Main centered content */
.landing-content {
    width: min(100%, 1100px);

    margin: 0 auto;

    padding:
        clamp(55px, 7vh, 90px)
        clamp(40px, 6vw, 90px)
        45px;

    box-sizing: border-box;
}


/* ========================================================
   HERO
======================================================== */

.landing-hero {
    text-align: center;
}


/* Welcome + icon */
.landing-welcome-row {
    position: relative;
    isolation: isolate;

    display: flex;
    flex-direction: row;

    align-items: center;
    justify-content: center;

    gap: 30px;
}

[data-theme="light"] .landing-welcome-row::before {
    content: "";
    position: absolute;

    top: calc(-1 * clamp(55px, 7vh, 90px));

    /* 背景結束於 logo 下方、標語上方 */
    bottom: -12px;

    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 200px);

    background: var(--landing-logo-gradient);

    z-index: -1;
    pointer-events: none;
}


.landing-welcome-title {
    font-size: clamp(30px, 3vw, 45px);
    font-weight: 300;

    line-height: 1.1;

    color: rgba(255, 255, 255, 0.78);

    margin-bottom: 8px;
}


/* StainAI-Web logo */
.landing-homepage-logo {
    width: clamp(140px, 15vw, 190px);
    height: auto;

    object-fit: contain;
    display: block;
}


/* Left Welcome to StainAI-Web image */
.landing-welcome-icon {
    width: clamp(280px, 30vw, 400px);
    height: auto;

    object-fit: contain;
    display: block;
}


/* Tagline */
.landing-tagline {
    margin-top: 25px;

    font-size: clamp(17px, 1.5vw, 23px);
    font-weight: 400;

    line-height: 1.25;

    color: var(--landing-text-soft);
}


/* ========================================================
   START STAINAI BUTTON
   Same size / radius as #drop-upload-btn
======================================================== */

#start-stainai-btn {
    display: flex;

    justify-content: center;
    align-items: center;

    width: 200px;
    height: 35px;

    margin: 28px auto;

    padding: 0;

    background: linear-gradient(90deg, rgb(82, 102, 111) 0%, rgb(72, 92, 105) 50%, rgb(43, 55, 61) 100%);

    color: #fff;

    border: none;
    border-radius: 15px;

    font-family: 'PingFangHKWeb', sans-serif;
    font-size: 16px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background 0.18s ease,
        transform 0.18s ease;
}


#start-stainai-btn:hover {
    background: rgb(112, 153, 172);
}


#start-stainai-btn:active {
    transform: scale(0.98);
}


/* Description */
.landing-description {
    width: min(100%, 850px);

    margin: 0 auto;

    font-size: clamp(14px, 1.2vw, 18px);

    line-height: 1.5;

    color: var(--landing-text-soft);
}


/* ========================================================
   WHOLE BRAIN ANIMATION
======================================================== */
.landing-brain-section {
    display: flex;

    justify-content: center;
    align-items: center;

    margin: 55px 0 45px;
}

.landing-brain-gif {
    display: block;

    width: min(100%, 900px);
    height: auto;

    object-fit: contain;

    background: transparent;
}



/* Temporary placeholder */
.landing-brain-placeholder {
    width: min(80%, 700px);
    aspect-ratio: 2.1 / 1;

    display: flex;

    justify-content: center;
    align-items: center;

    border: 1px dashed rgba(255, 255, 255, 0.22);

    color: rgba(255, 255, 255, 0.25);

    font-size: 14px;
}


/* Use this after GIF is ready */
.landing-brain-gif {
    display: block;

    width: min(80%, 700px);
    height: auto;

    object-fit: contain;
}


/* ========================================================
   CORE FUNCTIONALITY
======================================================== */

.landing-features-section {
    width: 100%;
}


.landing-section-title {
    margin: 0 0 45px;

    text-align: center;

    font-size: clamp(27px, 2.5vw, 38px);
    font-weight: 500;

    color: rgb(126, 170, 190);
}
[data-theme="light"] .landing-section-title {
    color: rgb(97, 140, 148);
}


.landing-features-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    column-gap: clamp(35px, 5vw, 75px);
    row-gap: 55px;
}


/* Individual feature */
.landing-feature {
    min-width: 0;

    text-align: left;
}


.landing-feature-icon {
    display: block;

    width: 55px;
    height: 55px;

    object-fit: contain;

    margin-bottom: 10px;
}


.landing-feature h3 {
    margin: 0 0 10px;

    font-size: 17px;
    font-weight: 600;

    line-height: 1.25;

    color: var(--landing-text);
}


.landing-feature p {
    margin: 0;

    font-size: 14px;

    line-height: 1.35;

    color: var(--landing-text-muted);
}


/* ========================================================
   FOOTER
======================================================== */

.landing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 30px;
    margin-top: 85px;
    padding: 35px 0 20px;

    border-top: 1px solid var(--landing-footer-border);
}

.landing-footer > .landing-footer-item {
    flex: 0 0 auto;
}

.landing-footer > .landing-github {
    width: auto;
}

/* Common footer item */
.landing-footer-item {
    display: flex;

    align-items: center;

    color: var(--landing-text);

    font-size: 14px;
    line-height: 1.2;

    min-width: 0;
}


/* ==========================
   Howard University
========================== */

.landing-howard {
    display: flex;
    align-items: center;
}


/* Howard official logo */
.landing-howard-logo {
    display: block;

    width: 150px;
    height: auto;

    object-fit: contain;

    flex-shrink: 0;

    transform: translateY(-6px);
}


/* Divider */
.landing-footer-divider {
    width: 1px;
    height: 46px;

    margin: 0 20px;

    background: var(--landing-divider);

    flex-shrink: 0;
}


.landing-lab-name {
    white-space: nowrap;

    font-size: 14px;
    line-height: 1.25;
}


/* ==========================
   GitHub
========================== */

.landing-footer-link {
    color: var(--landing-text);

    text-decoration: none;
}


.landing-footer-link:hover {
    color: var(--landing-text);

    text-decoration: none;
}


.landing-github {
    display: flex;
    align-items: center;

    width: 120px;
}
/* Fixed visual box for both SVG versions */
.landing-github-logo-wrapper {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 120px;
    height: 45px;

    flex-shrink: 0;
}
.landing-github-logo {
    position: absolute;

    left: 50%;
    top: 50%;

    width: 120px;
    height: auto;

    transform: translate(-50%, -50%);

    object-fit: contain;
}
/* Dark mode */
.github-logo-dark {
    display: block;
}
.github-logo-light {
    display: none;
}
/* Light mode */
[data-theme="light"] .github-logo-dark {
    display: none;
}
[data-theme="light"] .github-logo-light {
    display: block;
}


/* ==========================
   Contact
========================== */
.landing-contact {
    align-self: flex-start;
    justify-content: flex-start;
    align-items: flex-start;
}
.landing-contact-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.landing-contact-btn {
    display: inline-block;

    padding: 0;
    margin: 0;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;

    color: var(--landing-text);
    background: transparent;

    border: none;

    text-decoration: none;
    cursor: pointer;
}
.landing-contact-btn:hover,
.landing-contact-btn:focus,
.landing-contact-btn:active {
    color: var(--landing-text);
    background: transparent;
    text-decoration: none;
    outline: none;
}
.landing-cookie-note {
    margin: 5px 0 0 0;

    font-size: 10px;
    font-weight: 400;
    line-height: 1.2;

    color: var(--landing-text-muted);
}


/* ========================================================
   RESPONSIVE
======================================================== */

@media (max-width: 1000px) {

    .landing-features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 700px) {

    .landing-content {
        padding-left: 25px;
        padding-right: 25px;
    }


    .landing-welcome-row {
        flex-direction: column;
        gap: 15px;
    }

    .landing-welcome-icon {
        width: min(85vw, 360px);
        height: auto;
    }

    .landing-homepage-logo {
        width: 150px;
        height: auto;
    }


    .landing-features-grid {
        grid-template-columns: 1fr;
    }
}

/* Reference button */
.landing-reference {
    align-self: flex-start;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    scroll-margin-block: 24px;
}

.landing-reference-title {
    margin: 0;
    padding: 0;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;

    color: rgb(138, 188, 219);
}
[data-theme="light"] .landing-reference-title {
    color: rgb(105, 153, 178)
}

.landing-reference-note {
    margin: 5px 0 0;

    font-size: 10px;
    font-weight: 400;
    line-height: 1.2;

    color: var(--landing-text-muted);
}

.landing-reference-arrow {
    margin-top: 5px;
    font-size: 16px;
    color: rgb(138, 188, 219);
}

/* Superscript 1 */
.landing-reference-citation {
    margin-left: 2px;
    color: rgb(138, 188, 219);
    text-decoration: none;
}
[data-theme="light"] .landing-reference-citation {
    color: rgb(105, 153, 178)
}

.landing-reference:focus-visible,
.landing-reference-citation:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

/* Footer layout on smaller screens */
@media (max-width: 1200px) {
    .landing-footer {
        flex-wrap: wrap;
        gap: 25px 40px;
    }
}

@media (max-width: 700px) {
    .landing-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 25px;
    }
}

/* ==========================
   Homepage light / dark icons
========================== */
/* Default: dark mode */
#landing-page .homepage-icon-dark {
    display: block;
}

#landing-page .homepage-icon-light {
    display: none;
}
/* Light mode */
[data-theme="light"] #landing-page .homepage-icon-dark {
    display: none;
}

[data-theme="light"] #landing-page .homepage-icon-light {
    display: block;
}
/* Light mode: full-width footer banner */
[data-theme="light"] .landing-footer {
    position: relative;
    isolation: isolate;

    background: transparent;
    border-top: none;

    /* Match dark-mode footer text colors */
    --landing-text: #ffffff;
    --landing-text-soft: rgba(255, 255, 255, 0.85);
    --landing-text-muted: rgba(255, 255, 255, 0.68);

    --landing-divider: rgba(255, 255, 255, 0.35);
    --landing-footer-border: rgba(255, 255, 255, 0.15);

    color: #ffffff;
}
/* Extend the gradient across the entire homepage width */
[data-theme="light"] .landing-footer::before {
    content: "";
    position: absolute;

    top: 0;
    bottom: -45px;

    left: 50%;
    width: 200vw;
    transform: translateX(-50%);

    background: linear-gradient(
        to bottom,
        rgb(81, 102, 113) 0%,
        rgb(69, 87, 95) 50%,
        rgb(46, 60, 64) 100%
    );

    z-index: -1;
    pointer-events: none;
}





/* #########################
         Drop Zone
######################### */
#drop-zone {
    position: relative;

    margin-left: 200px;

    width: calc(100vw - 200px);
    max-width: calc(100vw - 200px);

    height: 100vh;
    height: 100dvh;
    min-height: 0;

    overflow: hidden;

    background: var(--bg-drop-zone);
    color: var(--text-drop-zone);

    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-align: center;
    font-family: 'PingFangHKWeb', sans-serif;
    transition: background 0.2s;

    box-sizing: border-box;
}
#drop-zone.hover {
    background: var(--bg-drop-zone-hover);
}
#drop-zone.blur {
    filter: blur(4px);
}
#drop-zone p {
    font-size: 30px;
    margin: 0;
}
#drop-upload-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 200px;
    height: 35px;
    margin: 30px;
    background: var(--bg-drop-upload-btn);
    color: var(--text-drop-upload-btn);
    border: var(--border-drop-upload-btn);
    border-radius: 15px;
    font-weight: 500;
    font-size: 20px;
    font-family: 'PingFangHKWeb', sans-serif;
}
/* ========================================================
   Back to Landing Page Button
======================================================== */
#back-to-landing-btn {
    position: absolute;

    top: 25px;
    left: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 8px 14px;

    background: transparent;
    color: var(--landing-back-text);

    border: none;
    border-radius: 8px;

    font-family: 'PingFangHKWeb', sans-serif;
    font-size: 16px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}
#back-to-landing-btn:hover {
    background: var(--landing-back-hover-bg);
    color: var(--landing-back-hover-text);
}
#back-to-landing-btn:active {
    background: var(--landing-back-active-bg);
}
#back-to-landing-btn .back-arrow {
    font-size: 22px;
    line-height: 1;
}





/* ##############################
    Grayscale Parameter Modal
############################## */

/* Main Settings */
.settings-overlay{
  position: fixed;
  inset: 0;
  z-index: 10000;                      /* in the highest layer */
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-modal{
  width: 1200px;
  height: 700px;
  background: var(--bg-settings-modal);
  border-radius: 18px;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Close Button */
.settings-close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;

  appearance: none;
  -webkit-appearance: none;

  border: var(--border-settings-close-btn);
  background: var(--bg-settings-close-btn);
  color: var(--cross-settings-close-btn);

  box-shadow: none;
  outline: none;

  cursor: pointer;
}
.settings-close:focus{
  outline: none;
}

/* ---------
Left Side
--------- */
.settings-left{
  flex: 1;
  display:flex;
  width: 700px;
  height: 700px;
  align-items:center;
  justify-content:center;
  position: relative;
  overflow: hidden;
  cursor: grabbing;
  touch-action: none;
}
.settings-left:active{
  cursor: grabbing;
}
/* Preview Image */
#settings-preview-img,
#settings-preview-canvas{
  transform-origin: 0 0;
  will-change: transform;
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
}
#settings-preview-canvas{
  position: absolute;
  inset: 0;
  margin: auto;
  display: none;
}

/* ---------
Right Side 
--------- */

/* right side main settings */
.settings-right{
  width: 500px;
  padding: 40px;
  overflow: auto;
}
.settings-title {
  width: 420px;
  height: 50px;
  font-size: 30px;
  font-family: 'PingFangHKWeb', sans-serif;
  justify-content: center;        /* horizontal */
  align-items: center;            /* vertical */
  text-align: center;
  color: var(--text-settings-title);
}
#settings-title {
  margin: 0 0 80px 0;
  font-weight: 600;
}
#settings-image-name {
  font-size: 25px;
  margin: 0 0 10px 0;
  justify-content: flex-start;        /* horizontal */
  text-align: left;
}
.settings-row{
  width: 420px;
  height: 30px;
  margin: 0 0 20px 0;
  display: grid;
  grid-template-columns: 180px 240px;   /* left side(label) width, right side(slider) width */
  align-items: center;
}
.settings-row label{
  margin: 0;
  font-family: 'PingFangHKWeb', sans-serif;
  font-size: 18px;
  color: var(--text-settings-row-label);
  white-space: nowrap;
}
.settings-row input[type="range"],
.settings-row input[type="number"] {
  width: 100%;
}


/* Resolution Input Wrapper */
.resolution-wrapper{
  display: flex;
  align-items: center;
  text-align: center;
  gap: 10px;
}
#inp-resolution {
  width: 115px;
  height: 30px;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: var(--bg-inp-resolution);
  border: var(--border-inp-resolution);
  color: var(--text-inp-resolution);
  border-radius: 10px;
}
#inp-resolution::-webkit-outer-spin-button,
#inp-resolution::-webkit-inner-spin-button {
  /* Hide spinners (Chrome/Edge/Safari) */
  -webkit-appearance: none;
  margin: 0;
}
#inp-resolution[type="number"] {
  /* Hide spinners (Firefox) */
  -moz-appearance: textfield;
  appearance: textfield;
}
.unit{
  font-size: 18px;
  color: var(--text-unit);
}


/* Grayscale Parameter Wrapper */
.grayscale-parameter-wrapper {
  width: 420px;
  padding: 20px 20px;
  margin-top: 14px;

  background-color: var(--bg-grayscale-parameter-wrapper);
  border: var(--border-grayscale-parameter-wrapper);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.10) inset,  /* bright inner border */
    0 10px 30px rgba(0,0,0,0.55),            /* panel shadow */
    0 0 22px rgba(255,255,255,0.18);         /* border glow */
  backdrop-filter: blur(8px);
}
#settings-preview-osd {
  width: 100%;
  height: 100%;
  display: none;
  background: #000;
}
#settings-preview-osd.active {
  display: block;
}
.grayscale-parameter-wrapper .settings-row{
  width: 100%;
  margin: 0 0 16px 0;
  grid-template-columns: 180px 200px;
}
.grayscale-parameter-wrapper .settings-row:last-child{
  margin-bottom: 0;
}
.slider-with-value{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.slider-with-value .scrollbar{
  flex: 1;
}
.value-input{
  width: 64px;
  height: 28px;
  text-align: center;

  background: var(--bg-inp-resolution);   /* reuse your style tokens */
  border: var(--border-inp-resolution);
  color: var(--text-inp-resolution);
  border-radius: 10px;

  outline: none;
}
.value-input:focus{
  box-shadow: 0 0 0 2px rgba(120,220,220,0.25);
}


/* grayscale parameter slider settings */
.scrollbar{
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border: var(--border-scrollbar);
  border-radius: 999px;
  cursor: pointer;
  outline: none;

  /* Use --pct to control fill ratio (JS only updates the variable, no need to change background-size) */
  --pct: 0%;

  background: linear-gradient(
    to right,
    rgba(120,220,220,0.95) 0%,
    rgba(120,220,220,0.95) var(--pct),
    var(--bg-scrollbar) var(--pct),
    rgba(255,255,255,0.25) 100%
  );
}
.scrollbar::-webkit-slider-runnable-track{
  /* Track - Chrome/Edge */
  height: 6px;
  background: transparent;
  border-radius: 999px;
}
.scrollbar::-moz-range-track{
  /* Track - Firefox */
  height: 6px;
  background: var(--bg-scrollbar);
  border-radius: 999px;
}
.scrollbar::-moz-range-progress{
  /* Track - Firefox */
  height: 6px;
  background: rgba(120,220,220,0.95);
  border-radius: 999px;
}
.scrollbar::-webkit-slider-thumb{
  /* Thumb - Chrome/Edge */
  -webkit-appearance: none;
  appearance: none;

  width: 14px;
  height: 14px;
  border-radius: 50%;

  background: rgba(120,220,220,0.95);
  border: 0;
  box-shadow: none;

  /* Put thumb in the middle*/
  margin-top: -4px;

  /* default: hidden */
  opacity: 0;
  transition: opacity 120ms ease, box-shadow 120ms ease;
}
.scrollbar:hover::-webkit-slider-thumb{
  /* Thumb - Chrome/Edge */
  opacity: 1;
  box-shadow: 0 0 8px rgba(120,220,220,0.55);
}
.scrollbar:active::-webkit-slider-thumb,
.scrollbar:focus::-webkit-slider-thumb{
  /* Thumb - Chrome/Edge */
  opacity: 1;
  box-shadow: 0 0 10px rgba(120,220,220,0.75);
}
.scrollbar::-moz-range-thumb{
  /* Thumb - Firefox */
  width: 14px;
  height: 14px;
  border-radius: 50%;

  background: rgba(120,220,220,0.95);
  border: 0;
  box-shadow: none;

  opacity: 0;
  transition: opacity 120ms ease, box-shadow 120ms ease;
}
.scrollbar:hover::-moz-range-thumb{
  opacity: 1;
  box-shadow: 0 0 8px rgba(120,220,220,0.55);
}
.scrollbar:active::-moz-range-thumb,
.scrollbar:focus::-moz-range-thumb{
  opacity: 1;
  box-shadow: 0 0 10px rgba(120,220,220,0.75);
}
.scrollbar:hover::-webkit-slider-thumb,
.scrollbar:focus::-webkit-slider-thumb{
  /* hover/focus */
  box-shadow: 0 0 6px rgba(120,220,220,0.65);
}
.scrollbar:hover::-moz-range-thumb,
.scrollbar:focus::-moz-range-thumb{
  /* hover/focus */
  box-shadow: 0 0 6px rgba(120,220,220,0.65);
}


/* Reset, Start Detection Button */
.settings-actions{
  display:flex;
  gap: 10px;
  margin-top: 30px;
}
#settings-reset-btn,
#settings-start-btn {
  flex: 1;
  height: 30px;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: var(--bg-settings-start-btn);
  border: var(--border-settings-start-btn);
  color: var(--text-settings-start-btn);
  border-radius: 10px;
}