

    :root {
        --clr-submit-btn: rgba(77, 44, 169, 0.9);  /*#63686be6;*/
        --clr-submit-btn--hover: #6610f2; /*#3d3b3b;*/
        --clr-chevron-btn--hover: #5d6061e6;
        --clr-text-btn: #fff;
        --clr-border-box: #fff;
        --clr-dark-theme: #fff;
        --clr-dark-theme-background: #000;
        --clr-light-theme: #000;
        --clr-light-theme-background: #fff;
        --clr-chatbot--online: #34bd34;
        --clr-textcolor-default: #000;

        --scrollbar-thumb: #007bff;  
        --scrollbar-thumb-hover: #0056b3;
        --scrollbar-width: 16px;  

        --bg-color: #ffffff;
        --text-color: #000000;
        --border-color: rgba(0,0,0,0.2);
    }

    .no-select {
        user-select: none;       /* Standard */
        -webkit-user-select: none; /* For Safari */
        -ms-user-select: none;     /* For old IE/Edge */
    }

    .dark-theme {
        color: var(--clr-dark-theme);
        background: var(--clr-dark-theme-background);
    }

    .light-theme {
        color: var(--clr-light-theme);
        background: var(--clr-light-theme-background);
    }

    /* Hamburger icon */
    .hamburger-icon {
        font-size: 18px; 
        margin-right: 15px; 
        vertical-align: middle; 
    }

    .label-heading {
        font-weight: bold;
    }

    .success-message {
        color: green;
        font-weight: bold;
    }

    i.fa-chevron-up {
        line-height: 2.4;
    }
    
    /* ============= Reset & Base ============= */
    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    html, body {
        height: 100%;
    }

    body {
        font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
        line-height: 1.5; /* Improve readability */
        color: #333; /* Default text color for better contrast */
    }

    body::-webkit-scrollbar {
    width: var(--scrollbar-width);
    height: var(--scrollbar-width); 
    }

    body::-webkit-scrollbar-track {
    background: transparent;
    }


    body::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 3px solid transparent;         
    background-clip: padding-box;          
    }

    /* slightly darker on hover */
    body::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
    }

     body::-webkit-scrollbar-corner {
    background: transparent;
    }


    html {
    scrollbar-width: thin; /* auto / thin / none */
    scrollbar-color: var(--scrollbar-thumb) transparent;
    }

    body {
    --sb-alpha: 1; 
    }

    footer {
        margin: 6% 4%; 
        padding-bottom: 3rem;
        user-select: none;
    }

    body.custom-subtle-scrollbar::-webkit-scrollbar-thumb {
        background-color: rgba(0, 123, 255, 0.65);
    }
    body.custom-subtle-scrollbar:hover::-webkit-scrollbar-thumb {
        background-color: rgba(0, 86, 179, 1);
    }

    :focus {
        outline: 3px solid rgba(0,123,255,0.25);
        outline-offset: 2px;
    }

    .heading {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        margin: 2.5rem 0;
    }

    .heading * {
        user-select: none;
    }

    /********************* GRID HEADINGS ***********************/
    .grid-column-header {
        display: grid;
        grid-template-columns: 77px 5fr repeat(4, 5fr);
        /*grid-template-columns: 50px 6fr repeat(4, 4fr);*/
        column-gap: 5px;
        font-weight: bold;
        align-items: center;
        user-select: none;
    }

    .grid-column-header > div {
        background-color: #63686b59;
        padding: 10px 12px;
        border-radius: 4px;
        min-height: 50px;
        cursor: pointer;
    }

    .row-label {
        font-weight: bold;
        background-color: #63686b33;
        display: flex;
        align-items: flex-start;
        grid-column: 1;
        padding: 8px;
        border: transparent !important;
        cursor: pointer;
        user-select: none;
    }


    /************************************************************/

    div#loaded-template {
        margin: 0 auto;
        width: 90%;
        text-align: center;
        user-select: none;
    }

    .checkbox-column {
        display: flex;
        flex-direction: column; 
        align-items: flex-end;
        grid-column: auto;
        gap: 5px;
    }

    .mt-vh-4 {
        margin-top: 3.5vh !important;
    }

    .HideMe {
        visibility: hidden;
    }

    label {
        margin-right: 10px;
        margin-top: 0.5rem;
    }

    label.last-row--checkbox {
        margin-right: 0;
    }

    .line, .close-btn { display: none; }

    .close-btn {
        cursor: pointer;
    }

    .heading-btn {
        margin: 0;
        flex-grow: 1; /* Ensures the heading takes up available space on the left */
        position: relative;
        top: 0;
        left: 0;
        text-align: left; /* Ensures text stays aligned to the left */
    }

    p.heading-btn {
        font-weight: bold;
    }

    p.marking-guide--introduction,
    p.marking-guide--info {
        display: inline-block;
        margin: 0 auto;
    }

    
    .style-section {
        display: none;
        width: 100%;
        text-align: center;
        margin: 15px 0;
        position: relative;
    }

    .style-label {
        position: relative;
        display: block;
        width: 100%;
        font-weight: bold;
        text-transform: uppercase;
        margin: 10px 0 15px;
        color: white;
    }

    /* Create Heading Line */
    .style-label::before,
    .style-label::after {
        content: "";
        position: absolute;
        top: 50%;
        width: 36%;                
        height: 1px;
        background-color: var(--line-color, white); /* Default is white */
        transform: translateY(-50%);
    }

    .style-label::before {
        left: 0;
    }

    .style-label::after {
        right: 0;
    }

    .btn:disabled {
        background: #ab9c9c !important;
    }

    .add-btn,
    .edit-btn,
    .close-btn,
    .save-btn,
    .cancel-btn,
    .bold-btn,
    .plain-btn,
    .italic-btn,
    .underline-btn,
    .reset-btn,
    .criterion-btn,
    .controls button,
    .actions button {
        cursor: pointer;
        background: var(--clr-submit-btn);
        color: var(--clr-text-btn);  
        border: 1px solid var(--clr-border-box);
    }

    .add-btn {
        background: var(--clr-submit-btn);
        color: var(--clr-text-btn);
        border: 1px solid var(--clr-border-box);
        border-radius: 5px;

        font-weight: bold;
        display: flex;
        align-items: stretch;
         
        min-height: 42px;
        padding: 2px;

        box-sizing: border-box;

        cursor: pointer;

        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;

        transition: 
            background 0.2s ease,
            transform 0.1s ease,
            box-shadow 0.2s ease;
    }

    /* Make the FULL button clickable */
    .add-btn label {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;

        gap: 8px;

        width: 100%;
        height: 100%;

        padding: 0 16px;
        margin: 0;

        cursor: pointer;
    }

    /* Checkbox sizing */
    .add-btn input[type="checkbox"] {
        cursor: pointer;
    }

    /* Hover effect */
    .add-btn:hover {
        filter: brightness(1.05);
        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    }

    /* Click effect */
    .add-btn:active,
    .edit-btn:active,
    .close-btn:active,
    .cancel-btn:active,
    .save-btn:active,
    .bold-btn:active,
    .plain-btn:active,
    .italic-btn:active,
    .underline-btn:active {
        transform: scale(0.98);
    }

    /* Active/checked state */
    .add-btn.active {
        background: var(--clr-submit-btn);
        color: white;
    }

    .edit-btn {
        margin-right: 10px;
    }

    .bold-btn,
    .plain-btn,
    .italic-btn,
    .underline-btn {
        margin: 0 2px;
    }
    
    .criterion-btn {
        margin-left: 10px;
    }

    .submit-btn {
        font-weight: bold !important;
        border-radius: 0.5rem;
        box-shadow: 1px 4px 5px rgba(0,0,0,0.5); 
    }

    .add-btn:hover,
    .edit-btn:hover,
    .close-btn:hover,
    .bold-btn:hover,
    .plain-btn:hover,
    .italic-btn:hover,
    .underline-btn:hover,
    .criterion-btn:hover,
    .controls button:hover,
    .actions button:hover {
        color: var(--clr-text-btn);
    }

    .add-btn:hover,
    .close-btn:hover,
    .edit-btn:hover,
    .bold-btn:hover,
    .plain-btn:hover,
    .italic-btn:hover,
    .underline-btn:hover,
    .submit-btn:hover,
    .reset-btn:hover,
    .marking-btn:hover,
    .criterion-btn:hover,
    .controls button:hover,
    .actions button:hover {
        background: var(--clr-submit-btn--hover);
        
    }

    /* Button alignment */

    .btn {
        cursor: pointer;
        background: var(--clr-submit-btn);
        color: var(--clr-text-btn);
        border: 1px solid var(--clr-border-box);
        padding: 8px; /* Adjust button size as needed */
    }

    .btn:hover {
        background: var(--clr-submit-btn--hover);
        color: var(--clr-text-btn);
    }

    .ai-btn {
        padding: 0 20px;
    }

    .feedback-btn {
      display: grid;
      grid-column: 1 / -1;   /* span across all 4 columns */ 
      justify-self: end !important; /* push to right edge "Chrome Knows This"*/
      margin: 3rem 0;
      margin-left: auto;  /* Used for Safari and Firefox, unknown justify-self at this point in writing */
      margin-right: 0;
      max-width: 280px;
      border: 2px solid transparent;
    }

    #updatebtn,
    #rubricBtn {
        display: none;
    }

    .submit-btn,
    .marking-btn,
    .reset-btn,
    .light-theme-btn,
    .update-btn,
    .criterion-btn {
      padding: 10px 25px;
      /*margin-left: 25px;*/
      background: var(--clr-submit-btn);
      color: #fff;
      border: none;
      border-radius: 5px;
      cursor: pointer;
      min-width: 200px;
    }

    .rubric-btn,
    .dark-theme-btn {
      padding: 10px 25px;
      margin-left: 10px;
      background: var(--clr-submit-btn);
      color: #fff;
      border: none;
      border-radius: 5px;
      cursor: pointer;
      min-width: 200px;  
    }

    .submit-btn:hover,
    .reset-btn:hover,
    .marking-btn:hover,
    .light-theme-btn:hover,
    .dark-theme-btn:hover,
    .criterion-btn:hover {
      background: var(--clr-submit-btn--hover);
      color: var(--clr-text-btn);
      font-weight: 500;
    }

    #logout {
       display: none;
    }

    #password {
        width:100%;
        padding: 8px 40px 8px 8px;
    }
    
    #togglePassword {
        position: absolute;
        right: 15px;
        top: 60%;
        transform: translateY(-50%);
        border: none;
        background: none;
        cursor: pointer;
        font-size: 16px;
    }

    .guide-heading {
        margin: 2% 5% 1% 5%;
        border-radius: 0.5rem;
        border: 1px solid #fff;
        padding: 2rem 3rem 2rem 3rem;
    }

    .guide-card {
        margin: 0 5%;
        border-radius: 0.5rem;
        border: 1px solid #fff;
        padding: 2rem 3rem 6rem 3rem;
        
    }

    .guide-card h2 {
        text-decoration: underline;
        text-underline-offset: 8px;
    }


    /* ============================ COLOUR THEME PICKER ============================= */

    /* Set Colors Box Settings */
    .checkbox-column,
    .editing {
        background: var(--bg-color);
        color: var(--text-color) !important;
        border: 1px solid var(--border-color) !important;
        --line-color: var(--text-color) !important;
    }

    .style-label {
        background: var(--bg-color);
        color: var(--text-color) !important;
        --line-color: var(--text-color) !important;
    }


    .color-picker-wrapper {
        position: absolute;
        top: 26%;
        right: 8vw;
         
    }


    .theme-picker-btn {
        padding: 10px 16px;

        background: #f5f5f5; /* solid background */
        color: #222;

        border: 1px solid #ccc;
        border-radius: 8px;

        opacity: 1 !important;

        cursor: pointer;
        font-weight: 600;

        box-shadow: 0 2px 8px rgba(0,0,0,0.18);

        transition:
            background 0.2s ease,
            box-shadow 0.2s ease,
            transform 0.1s ease;

    }

    .theme-picker-btn:hover {
        background: #ffffff;

        box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    }

    .theme-picker-btn:active {
        transform: scale(0.98);
    }

    .color-picker-row {
        display: none;

        position: absolute;
        top: 110%;
        left: 0;

        gap: 10px;

        padding: 12px;

        border-radius: 10px;

        background: white;
        border: 1px solid #ccc;

        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        transform: translateY(-8px);

        transition: all 0.3s ease;
        
        pointer-events: none;
         
    }

    /* Show when active */
    .color-picker-row.show {
        display: flex;
        transform: translateY(0);
        pointer-events: auto;
    }


    
    /* Colour Picker Boxes - Styling */
    .color-box {
        width: 32px;
        height: 32px;

        border-radius: 8px;

        cursor: pointer;

        border: 2px solid rgba(255,255,255,0.4);

        transition:
            transform 0.15s ease,
            box-shadow 0.2s ease,
            filter 0.2s ease;

        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    }

    /* Hover effect */
    .color-box:hover {
        transform: scale(1.12);
        filter: brightness(1.08);

        box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    }

    /* Click effect */
    .color-box:active {
        transform: scale(0.94);
    }

    /* Selected theme */
    .color-box.active-theme {
        border: 2px solid white;

        box-shadow:
            0 0 0 2px rgba(0,0,0,0.25),
            0 4px 14px rgba(0,0,0,0.3);
    }

    .theme-dark {
        background: #2C3E50;
    }

    .theme-blue {
        background: #3498DB;
    }

    .theme-purple {
        background: #8E7CC3;
    }

    .theme-green {
        background: #6B8E75;
    }

    .theme-sand {
        background: #C2A878;
    }


    .theme-picker-btn {
        padding: 10px 16px;

        border: 1px solid #ccc;
        border-radius: 8px;

        background: #f5f5f5;

        cursor: pointer;
        font-weight: 600;

        box-shadow: 0 2px 8px rgba(0,0,0,0.18);

        transition:
            box-shadow 0.2s ease,
            transform 0.1s ease;
    }

    .theme-picker-btn:hover {
        box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    }

    .theme-picker-btn:active {
        transform: scale(0.98);
    }

    .new-badge {
        position: absolute;
        top: -10px;
        right: -10px;

        background: #ff3b30;
        color: white;

        font-size: 11px;
        font-weight: bold;

        padding: 4px 6px;
        border-radius: 6px;

        box-shadow: 0 2px 6px rgba(0,0,0,0.2);

        animation: pulse 1.5s infinite;
    }

    @keyframes pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.1); }
        100% { transform: scale(1); }
    }


    /* ======================= CHATBOT USER-PROFILE-NAME CSS ======================== */


    #userProfileName,
    #controls {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;

        padding: 12px;
        margin-top: auto;

        background: rgba(0, 0, 0, 0.25);
        backdrop-filter: blur(6px);

        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    #userProfileName input,
    #controls input {
        width: 70%;
        padding: 10px 12px;

        border: none;
        border-radius: 8px;

        outline: none;

        font-size: 14px;

        background: #fff;
        color: #0e0d0d;
    }

    #userProfileName button,
    #controls button {
        padding: 10px 14px;

        border: none;
        border-radius: 8px;

        cursor: pointer;

        background-color: var(--clr-submit-btn);
        color: #fff;

        font-weight: 600;

        transition: 0.2s ease;
    }

    #userProfileName button:hover,
    #controls button:hover {
        filter: brightness(1.1);
    }


    /* ======================= SETTINGS CSS ======================== */

    #settingbutton {
        position: fixed;
        top: 28vh;
        right: 0.8em;
        z-index: 1100;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--clr-submit-btn);
        border-radius: 0.25rem;
        width: 3rem;
        height: 3rem;
        color: white;
        cursor: pointer;
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
        transition: background-color 0.3s ease, transform 0.2s ease;
    }

    #settingbutton:hover { 
        background-color: var(--clr-submit-btn--hover);  
    }

    #settingbutton svg { 
        width: 1.5rem; 
        height: 1.5rem; 
    }

    #liveCustomizer {
        transition: opacity 0.5s ease;  
        opacity: 1;  
    }

    .live-customizer {
        position: fixed;
        top: calc(28vh + 3.5rem);  /* below the button (button height + gap) */
        right: 0.8em;              /* aligned with button */
        width: fit-content;
        max-width: 90vw;
        background: #fff;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        border-radius: 0.5rem;
        z-index: 1090;
        padding: 1rem 2rem;
        opacity: 0;
        transform: translateX(-20px);
        pointer-events: none;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .live-customizer.active {
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    .live-customizer h5 {
        color: #000;
        text-align: center;
        margin-bottom: 1rem;
    }

    .live-customizer .close-btn { 
        position: absolute; 
        top: 1rem; 
        right: 1rem; 
        background: #343a40; 
        color: #fff; 
        border: none; 
        border-radius: 50%; 
        width: 2rem;
        height: 2rem; 
        cursor: pointer; 
        display: flex; 
        align-items: center; 
        justify-content: center; 
    }

    .live-customizer .modes {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* two equal columns */
        gap: 0.8rem; /* spacing between buttons */
    }

    .live-customizer .modes button {
        border: 1px solid transparent;  
        transition: background-color 0.2s, color 0.2s; 
        box-sizing: border-box;  
    }

    .live-customizer .modes button:hover {
        border-color: #000; /* changes color but size stays same */
    }

    /* .live-customizer .modes button:nth-last-child(-n+2) {} */
    .live-customizer .modes button:last-child {
        grid-column: 1 / -1;
        justify-self: center;
        width: auto;
        margin: 0.25rem 0;
    }

   
    .inline-span button:focus-visible {
        outline: none; /* remove default focus ring */
        border: 2px solid #ff6600; /* highlight border */
        border-radius: 4px;
        box-shadow: 0 0 6px rgba(255, 102, 0, 0.6); /* subtle glow */
        transition: box-shadow 0.2s ease, border 0.2s ease;
    }

     
    .inline-span input[type="checkbox"]:focus-visible {
        width: 14px; /* make sure border is visible */
        height: 14px;
        transition: box-shadow 0.2s ease, border 0.2s ease;
    }



    /* ======================================================= */

    /* ============= Save Template Input Box ============= */

    /* Modal Styles */
    .modal {
        display: none; /* Hidden by default */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.1);
        justify-content: center;
        align-items: center;
        z-index: 1000;
    }

    .modal-content {
        display: none;
        background-color: #fff;
        position: absolute;
        top: 40%;
        left: 35%;
        padding: 20px;
        border-radius: 5px;
        width: 600px;
        text-align: center;
        box-shadow: 5px 5px 5px #0000008a;
    }

    .modal-actions {
        margin-top: 10px;
    }

    .modal input {
        width: 100%;
        padding: 10px;
        margin-bottom: 10px;
    }

    .modal button {
        padding: 10px;
        margin: 5px;
        cursor: pointer;
        border-radius: 0.25rem;
    }

    .modal button:disabled {
        cursor: not-allowed;
        background-color: #ccc;
    }

    /* ======================================================= */

    /* ====================== Templates Menu ================= */

    .dropdown {
        position: absolute;
        top: 25%;
    }
    /*.dropdown {
        position: absolute;
        top: 7vh;
        left: 5vw;
        z-index: 10;
        border-radius: 0.5rem;
        box-shadow: 1px 4px 5px rgba(0,0,0,0.5); 
    }*/

    /*.loginBtn {
        position: absolute;
        top: 7vh;
        right: 5vw;
        z-index: 10;
        border-radius: 0.5rem;
        box-shadow: 1px 4px 5px rgba(0,0,0,0.5);
    }*/

    .login-box {
        display: none;
        position: absolute;
        top: 110%;
        right: 0;
        background: #fff;
        border: 1px solid #ccc;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.5);
        width: 360px;
        z-index: 9999;
    }

    .login-box input {
        width: 100%;
        padding: 8px;
        margin-top: 8px;
        border: 1px solid #ccc;
        border-radius: 5px;
        font-size: 14px;
    }

    .login-box button[type="submit"] {
        width: 100%;
        margin-top: 10px;
        padding: 8px;
        background-color: var(--clr-submit-btn);
        color: #fff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background 0.3s;
    }

    .login-box button[type="submit"]:hover {
        background-color: var(--clr-submit-btn--hover);
    }

    .error-message {
        color: red;
        font-size: 0.9em;
        margin-top: 5px;
    }

    .dropdown .dropdown-btn, .login-Btn {
        background-color: var(--clr-submit-btn);
        color: white;
        border: none;
        padding: 10px 25px;
        font-size: 16px;
        cursor: pointer;
        border-radius: 5px;
    }

    .dropdown .dropdown-btn:hover {
        background-color: var(--clr-submit-btn--hover);
    }

    .dropdown .dropdown-content {
        display: none;
        position: absolute;
        background-color: #f9f9f9;
        /*width: 100%;*/
        width: 230px;
        overflow: hidden;
        box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
        z-index: 1;
        border-radius: 5px;
    }

    .dropdown .dropdown-content a {
        color: black;
        padding: 12px 32px;
        text-decoration: none;
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dropdown .dropdown-content a:hover {
        /*background-color: #dad3d3;*/
    }

    /* Show the dropdown menu when the button is clicked */
    .dropdown:hover .dropdown-content {
        display: block;
    }

    .dropdown:hover .dropdown-btn {
        background-color: var(--clr-submit-btn--hover); 
    }


    .dialog-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 999;
    }

    .dialog-box {
        background: white;
        padding: 1.5rem 2rem;
        border-radius: 12px;
        text-align: center;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
        max-width: 300px;
    }

    .dialog-box p {
        margin-bottom: 1rem;
        font-size: 1rem;
    }

    .dialog-box button {
        background-color: var(--clr-submit-btn);
        color: white;
        border: none;
        border-radius: 8px;
        padding: 0.5rem 1rem;
        cursor: pointer;
    }

    .dialog-box button:hover {
        background-color: var(--clr-submit-btn--hover);
    }

    /* ======================================================= */


    /* ============= Page Wrapper on top of video ============= */

    .background-image {
        position: relative;
        min-height: 90vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
        z-index: 0;
    }

    .background-image::before {
        content: "";
        position: absolute;
        inset: 0;
        /*background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.6));*/
        z-index: -1;
    }

    .grid-container {
      display: grid;
      grid-template-columns: 77px 5fr repeat(4, 5fr);
      /*grid-template-columns: 50px 6fr repeat(4, 4fr);*/
      grid-template-rows: repeat(11, auto); /* 1 header row + 10 data rows */
      gap: 5px;
      margin-top: 5px;
      width: 95vw;
      max-width: 95vw;
    }

    .grid-item {
      border: 1px solid #ddd;
      padding: 10px;
      border-radius: 0.25rem;
    }

    .grid-item.checkbox-column {
        display: flex;
        flex-direction: column;
    }

    .inline-span {
        display: flex;
        gap: 0.5rem; /* spacing between checkbox and buttons */
        margin-top: auto; /* ensures it sits at the bottom */
        padding-top: 1.25rem;
    }

    .edit-btn {
        cursor: pointer;
    }

    .marking-guide--info,
    .editable {
        display: none;
        margin-top: 5px;
        padding: 5px;
        border: 1px solid transparent;
        min-height: 3vh;
        cursor: text;
        width: 100%;
        box-sizing: border-box;
    }

    p.editable.editing {
        /*white-space: pre-wrap;*/
    }

    /* When the .editable paragraph is in editing mode, show it as a block element */
    .marking-guide--info.editing,
    .editable.editing {
        display: block; /* Show when editing */
        border: 1px solid var(--clr-light-theme);
        border-radius: 0.25rem;
    }

    .marking-guide--info.empty::before,
    .editable.empty::before {
        content: attr(data-placeholder);
        color: #aaa;
    }

    .fs-3 {
        font-size: 1.16rem;
    }

    .editable-input {
        margin-top: 5px;
        padding: 5px;
        width: 100%;
        box-sizing: border-box;
    }


    .header {
      font-size: 1.2rem;
      font-weight: bold;
      text-align: left;
    }

   /* Back to top container handles positioning */
#back-to-top {
  position: fixed;
  bottom: 80px;    
  right: 20px;     
  z-index: 9999;
  display: none;   
}

/* Button styles */
#back-to-top .btn {
  width: 44px;
  height: 44px;
  line-height: 44px;
  text-align: center;
  font-size: 18px;
  border-radius: 50%;
  background-color: var(--clr-submit-btn) !important;
  color: black;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  transition: transform 0.2s ease-in-out, background-color 0.3s;
}

/* Hover effect */
#back-to-top .btn:hover {
  transform: scale(1.1);
  background-color: var(--clr-chevron-btn--hover) !important;
}



/* =============================================================== */

/* ====================== New Template Generator ================= */


    h4, #info {
        text-align: center;
    }

    .grid-wrap {
        display: flex;
        flex-direction: column; /* stack elements vertically */
        gap: 12px; /* spacing between grid, controls, and info box */
    }

    .template-container {
        display: flex;
        flex-direction: column;
        position: relative;
        top: 25vh;
        max-width: 55%;
        max-height: 60%;
        background-color: #fff;
        border: 1px solid grey;
        box-shadow: 1px 4px 5px grey;
        padding: 12px;
        margin: 20px auto;
        border-radius: 0.25rem;
    }

    
    /* Top row: left and right side-by-side */
    .top-box {
        display: flex;
        gap: 16px;
    }

    /* Left: grid */
    .left-box {
        flex: 1; 
        background-color: #fdf8f88f; 
    }

    /* Right: settings panel */
    .right-box {
        flex: 1;  
    }

    /* Controls at bottom */
    .controls {
        display: flex;
        flex-wrap: wrap;
        gap: 9px;
        align-items: center;
        margin-top: 2rem;
        width: 100%;
        justify-content: center; /* center controls */
    }

    /* Optional: manual settings panel styling */
    .manual-template--settings {
        border: 1px solid #ccc;
        padding: 12px;
        background-color: #fafafa;
        box-shadow: 1px 2px 4px #aaa;
        margin-right: 20px;
    }

    
    .controls label {
      font-size: 14px;
      color:#333
    }

    .controls input[type=number] {
      width:70px;
      padding:6px;
      border-radius:6px;
      border:1px solid #d0d5df
    }
    
    .template-grid-box {
        display: flex;
        justify-content: center; /* horizontal centering */
        align-items: center;     /* vertical centering */
        flex-direction: column;  /* keep legend below the grid */
        gap: 8px;                /* spacing between grid and legend */
        width: 100%;
        height: 100%;
    }

    #template-grid {
        display: grid;
        grid-template-columns: repeat(var(--cols), var(--cell-size));
        grid-template-rows: repeat(var(--rows), var(--cell-size));
        gap: var(--gap);
        margin-top: 10px;
    }
    
    .cell{width:var(--cell-size);height:var(--cell-size);border-radius:4px;background:#fff;box-shadow:inset 0 0 0 1px rgba(16,24,40,0.3);cursor:crosshair;transition:background .12s}
    .cell.dark{background:rgba(0,0,0,.75)}
    .legend{font-size:13px;color:#444;margin-top:8px}

    .markingtemp-backdrop {
        /* display: none;   hidden by default */
        position: absolute; /* relative to template-container */
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        justify-content: center;
        align-items: center;
        z-index: 1000;
    }

    .markingtemp {
        background: white;
        padding: 20px;
        border-radius: 6px;
        max-width: 400px;
        margin: 20% 40%;
        width: 90%;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    #markingtempBody {
        text-align: center;
    }

    .actions {
        display: flex;
        justify-content: center; /* center buttons horizontally */
        gap: 12px;              /* optional spacing between buttons */
        margin-top: 12px;       /* optional spacing above the buttons */
    }

    button#markingtempCancel,
    button#markingtempCreate {
        padding: 10px;
        border-radius: 5px;
    }

    input#templateName {
        font-size: 1.25rem;
        padding: 5px;
        margin: 0 auto;
        margin-top: 20px;
        margin-bottom: 20px;
    }


/* =============================================================== */



/* ============================ Chat Bot ========================= */


.chatTitleBox {
    display: flex;  
    justify-content: space-between;  
    align-items: center;  
    padding: 10px;  
    width: inherit;
    background-color: var(--clr-submit-btn);  
    border-bottom: 1px solid #ddd;  
}

/* chat bubble */
#chatBubble {
    position: fixed;
    bottom: 10px;
    right: 3px;
    width: 80px;
    height: 50px;
    border-radius: 50%;
    /*background-color: var(--clr-submit-btn);*/
    /*color: white;*/
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /*box-shadow: 0 4px 8px rgba(0,0,0,0.3);*/
    z-index: 999;
}

/* Expanded chat window */
#chatWindow {
    position: fixed;
    bottom: 80px;
    right: 80px;
    width: 360px;
    height: 85%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 998;
}

/* Chat header */
#chatHeader {
    color: white;
    font-weight: bold;
    font-size: 1rem;
    margin: 0 auto;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#exitDiv {
    display: none;  
    align-items: center;
    padding-right: 30px;
}

#exitChatBot {
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;

    padding: 8px 14px;
    border-radius: 8px;

    background-color: #1c3c12; /* red = exit/destructive */
    border: 1px solid rgba(255, 255, 255, 0.15);

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

    transition: all 0.2s ease;
    user-select: none;
}

#exitChatBot:hover {
    background-color: #167742;
    transform: translateY(-1px);
}

#exitChatBot:active {
    transform: translateY(0px);
    background-color: #8ac659;
}

/* Chat body */
#chatBox {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #fafafa;
    color: var(--clr-textcolor-default);
}

/* Chat controls */
#controls {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid #ddd;
    color: var(--clr-textcolor-default);
}

.bold-placeholder {
    font-weight: 500;
}

/* Message bubbles */
.msg { padding:6px 10px; margin:6px 0; display:inline-block; border-radius:10px; max-width:85%; }
.me { background:#d4f0ff; align-self:flex-end; }
.bot { background:#e8e8e8; align-self:flex-start; }
.msg.me { margin-left: 30px; }
.msg.bot { margin-left: 10px; }
#typingIndicator { font-style: italic; opacity: 0.6; margin: 5px 0; }

input#messageInput {
    width: 75%;
    padding-left: 5px;
}


.faq-container {
    position: absolute;
    top: 35;
    left: 0;
    max-height: 74%;
    overflow-y: auto;
    background-color: #f7f7f7;  /* Light background for the FAQs */
    padding: 10px;
    z-index: 100;
    user-select: none;
}

/* Custom scrollbar styling for Webkit browsers (Chrome, Safari) */
.faq-container::-webkit-scrollbar {
    width: 8px;  
}

.faq-container::-webkit-scrollbar-thumb {
    background-color: #007bff;  
    border-radius: 4px;   
}

.faq-container::-webkit-scrollbar-track {
    background-color: #f1f1f1;  
}

/* Custom scrollbar for Firefox */
.faq-container {
    scrollbar-width: thin;
    scrollbar-color: #007bff #f1f1f1;  
}

.faq-question {
    padding: 10px;
    background-color: #e3d7fbc7;
    margin: 5px 0;
    cursor: pointer;
    font-weight: bold;
    border-radius: 5px;
    white-space: pre-line;
}

.faq-answer {
    padding: 10px;
    margin: 5px 0 10px;
    background-color: #f9f9f9;
    border-left: 4px solid #ccc;
    display: none;  
}

.faq-header {
    text-align: center;  
    margin-bottom: 10px;
    cursor: pointer;   
}

#userNameDiv {
    margin: 5px 0;
    font-weight: 500;
}

.passive {
    background-color: #6dba78;
    color: #fff;
}

.scheduled {
    background-color: #e59b23;
    color: #fff;
}


/* ======================== MAINTENANCE BUBBLE ======================== */


/* Hidden by default */
.maintenance-bubble {
    position: fixed;
    bottom: 90px;
    right: 10px;
    background: #ffcc00;
    color: #000;
    font-weight: normal;
    text-align: center;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: normal !important;
    font-family: Arial, sans-serif;
    max-width: 230px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;

    transition: opacity 0.5s ease;
}

/* Visible State */
.maintenance-bubble.show {
    opacity: 1;
    visibility: visible;
}

/* Bubble Tail */
.maintenance-bubble::after {
    content: "";
    position: absolute;
    bottom: -7px;
    right: 30px;

    width: 14px;
    height: 14px;

    background: #ffcc00;

    transform: rotate(45deg);
}


/* =============================================================== */

/* ======================== MEDIA QUERIES ======================== */


/* For iPad and smaller screens */
@media only screen and (max-width: 1200px) and (max-height: 800px) {
   
    .dropdown {
        left: 2vw;
    }

    .loginBtn {
        right: 2vw;
    }

    .color-picker-wrapper {
        position: absolute;
        top: 17%;
        right: 2vw;
    }

}

/* For iPad and smaller screens */
@media only screen and (max-width: 1024px) {
    .heading {
        margin: 2.5rem 25%;
        max-width: 50%;
        user-select: none;
    }

}

/* For larger desktops (1024px and above) */
@media only screen and (min-width: 1025px) {
    .heading {
        margin: 2.5rem 16%;
        max-width: 80%;
        user-select: none;
    }
}
