body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 20px;
}

body.dark {
    background-color: #121212;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.board {
    height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    gap: 20px;
}

.list {
    flex: 1;
    background-color: white;
    padding: 0;
    border-radius: 12px;
    overflow: auto;

    display: flex;
    flex-direction: column;
    overflow: visible;
    min-width: 0;
    height: 100%;
    position: relative;
}

.dark .list {
    background-color: #1e1e1e;
}

.list h2 {
    text-align: left;
    color: #000000;
    border-bottom: 2px solid #eee;
    margin: 0 0 20px;
    padding-bottom: 10px;
    flex: 0 0 auto;
    font-size: 35px;
}

.dark .list h2 {
    color: #ffffff;
    border-bottom: 2px solid #333;
}

.orders {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0px 20px 10px 20px;

    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;

    align-content: start;
    align-items: start;
}

.order {
    background-color: #ffffff;
    border: 2px solid silver;
    border-radius: 8px;
    text-align: center;
    padding: 5px 0;
    font-weight: bold;
    font-size: 50px;
    color: #000000;
    height: auto;

    /* allow wrapping */
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;

    /* center content vertically and horizontally */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.dark .order {
    background-color: #2a2a2a;
    border: 2px solid #444;
    color: #ffffff;
}

/* Right list different color */

/*Blue theme for "ready" orders */
.ready .order {
    background-color: rgb(255, 255, 255);
    color: rgb(33, 150, 243);
    background-image: linear-gradient(45deg, rgba(33, 150, 243, 0.15), rgba(110, 193, 228, 0.2));
    border: 2px solid rgb(33, 150, 243);
}

.bold-bg .ready .order, .dark .bold-bg .ready .order {
    background-color: #2196f3;
    color: #ffff;
}

.dark .ready .order {
    background-color: #000000;
    color: #ffff;
}

/* Green theme for "ready" orders */
.ready.green .order {
    background-color: rgb(255, 255, 255);
    color: #0bc2a3;
    background-image: linear-gradient(45deg, rgb(33 243 165 / 15%), rgb(110 228 196 / 20%));
    border: 2px solid #0bc2a3;
}

.bold-bg .ready.green .order, .dark .bold-bg .ready.green .order {
    background-color: #0bc2a3;
    color: #ffff;
}

.dark .ready.green .order {
    background-color: #000000;
    color: #ffff;
}

.ready .orders {
    grid-template-columns: repeat(3, 1fr);
}

.prepared {
    flex: 0 0 60%;
    max-width: 60%;
}

.ready {
    flex: 0 0 40%;
    max-width: 40%;
}

.orders.col-1 {
    grid-template-columns: repeat(1, 1fr);
}

.orders.col-2 {
    grid-template-columns: repeat(2, 1fr);
}

.orders.col-3 {
    grid-template-columns: repeat(3, 1fr);
}

.orders.col-4 {
    grid-template-columns: repeat(4, 1fr);
}

.orders.col-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* 1) Hygiene: sizing + kill any tiny x-overflow */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

/* 2) Let flex/grid items shrink instead of forcing min-content width */
.list, .orders {
    min-width: 0;
}

/* 3) Keep 60/40 without overflowing when gap is 20px (subtract 10px each) */
.board {
    gap: 20px;
}

/* already have this, shown for clarity */
.prepared {
    flex: 0 0 calc(60% - 10px);
    max-width: calc(60% - 10px);
}

.ready {
    flex: 0 0 calc(40% - 10px);
    max-width: calc(40% - 10px);
}

.orders.font-20 .order {
    font-size: 20px;
}

.orders.font-25 .order {
    font-size: 25px;
}

.orders.font-30 .order {
    font-size: 30px;
}

.orders.font-35 .order {
    font-size: 35px;
}

.orders.font-40 .order {
    font-size: 40px;
}

.orders.font-45 .order {
    font-size: 45px;
}

.orders.font-50 .order {
    font-size: 50px;
}

.orders.font-55 .order {
    font-size: 55px;
}

.orders.font-60 .order {
    font-size: 60px;
}

.orders.font-65 .order {
    font-size: 65px;
}

.orders.font-70 .order {
    font-size: 70px;
}

.orders.font-75 .order {
    font-size: 75px;
}

.orders.font-80 .order {
    font-size: 80px;
}

.orders.font-85 .order {
    font-size: 85px;
}

.orders.font-90 .order {
    font-size: 90px;
}

.orders.font-95 .order {
    font-size: 95px;
}

.orders.font-100 .order {
    font-size: 100px;
}

.orders.font-150 .order {
    font-size: 150px;
}

.orders.font-200 .order {
    font-size: 200px;
}

.orders.font-250 .order {
    font-size: 250px;
}

.orders.font-300 .order {
    font-size: 300px;
}

.orders.font-350 .order {
    font-size: 350px;
}

.orders.font-400 .order {
    font-size: 400px;
}

.orders.font-450 .order {
    font-size: 450px;
}

.orders.font-500 .order {
    font-size: 500px;
}

/* Sticky header that stays at the top of the list */
.orders-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background: inherit;
    padding: 20px 20px 0px 20px;
    border-top-right-radius: 12px;
    border-top-left-radius: 12px;
}

/* Base (light) */
.orders {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .35) transparent;

    /* Keep layout stable when scrollbar appears */
    scrollbar-gutter: stable both-edges;
}

/* WebKit (Chrome/Edge/Safari/Opera) */
.orders::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.orders::-webkit-scrollbar-track {
    background: transparent;
}

.orders::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, .35);
    border-radius: 8px;
    border: 2px solid transparent;
    /* makes the thumb appear thinner */
    background-clip: content-box;
}

.orders:hover::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, .55);
}

/* Dark mode overrides (when body has .dark) */
.dark .orders {
    scrollbar-color: rgba(255, 255, 255, .35) transparent;
}

.dark .orders::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, .35);
}

.dark .orders:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, .6);
}

/* Optional: even slimmer on touch devices */
@media (pointer: coarse) {
    .orders::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
}

.list.list.is-scrolled .orders-header h2 {
    border-bottom: 0px solid transparent;
    margin-bottom: 0px;
}

.list.is-scrolled .orders-header {
    box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .35);
}

.dark .list.is-scrolled .orders-header {
    box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .7);
}

.settings-btn {
    position: absolute;
    top: 0;
    right: 0;
    margin: 25px 20px 0 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    cursor: pointer;
    border-radius: 50%;
    border-width: initial;
    border-style: none;
    border-color: initial;
    border-image: initial;
    transition: background-color 0.3s;
}

/*center icon inside button*/
.settings-btn i {
    font-size: 16px;
}

.settings-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.dark .settings-btn {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Adjust button hover color in dark mode */
.dark .settings-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.settings-dropdown {
    position: absolute;
    top: 60px;
    right: 20px;
    background-color: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 250px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.dark .settings-dropdown {
    background-color: #2a2a2a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.settings-dropdown h5 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: bold;
    color: #2c2c2c;
}

.dark .settings-dropdown h5 {
    color: #ffffff;
}

.main-checkbox-item {
    cursor: pointer;
    position: relative;
    width: 100%;
    padding: 10px 10px 0px 0px;
    margin: 0px 0px 5px;
}

.main-checkbox-item span {
    position: absolute;
    top: 0px;
    left: 0px;
    margin-left: 30px;
    margin-top: 15px;
    font-size: 14px;
}

.main-checkbox {
    align-items: center;
    justify-content: center;
    position: relative;
    width: 25px;
    height: 25px;
    cursor: pointer;
    color: rgb(255, 255, 255);
    text-align: center;
    border-radius: 50%;
    border-width: 2px;
    border-style: solid;
    border-color: rgb(171, 171, 171);
    border-image: initial;
}

.main-checkbox-item.checked .main-checkbox {
    background-color: rgb(33, 150, 243);
    background-image: linear-gradient(45deg, rgb(33, 150, 243), rgb(110, 193, 228));
    border-width: initial;
    border-style: none;
    border-color: initial;
    border-image: initial;
}

.main-checkbox-item .fa-circle {
    visibility: hidden;
    font-size: 11px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-right: -50%;
    transform: translate(-50%, -50%);
}

.main-checkbox-item.checked .fa-circle {
    visibility: visible;
}

.settings-section {
    margin-bottom: 25px;
}

.order-loader {
    display: none;
    border: 4px solid transparent;
    border-top: 4px solid #1e1e1e;
    border-right: 4px solid #1e1e1e;
    border-bottom: 4px solid #1e1e1e;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dark .order-loader {
    border-top: 4px solid #ffffff;
    border-right: 4px solid #ffffff;
    border-bottom: 4px solid #ffffff;
}

.loading .order-loader {
    display: block;
}

.settings-section[section="general-settings"] {
    border-top: 1px solid #ccc;
    padding-top: 10px;
    margin-bottom: 0px;
}

.settings-section[section="general-settings"] a {
    display: block;
    padding: 10px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

.settings-section[section="general-settings"] a:hover {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 7px;
}

.settings-section[section="general-settings"] i {
    position: absolute;
    right: 15px;
}