table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border: 1px dotted #ccc;
    padding: 6px;
    text-align: center;
}

td a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

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

.form-popup {
    display: none;
    position: fixed;
    background: var(--block-color);
    border: 1px solid var(--text-color);
    box-shadow: 5px 5px var(--shadow-color);
    padding: 2em;
    top: 30%;
    left: 30%;
    z-index: 1000;
}

h1,
h2,
h3 {
    margin: 1em 2em;
    text-align: center;
}

.infoBox {
    width: 80%;
    margin: 1em auto;
    padding: 1em;
    border: 1px solid var(--text-color);

    box-shadow: 5px 5px;
}

.ashBox {
    background-color: rgb(178, 190, 181);
}

.blockBox {
    background-color: var(--block-color);
}

.amberBox {
    background-color: rgb(255, 191, 0, 0.3);
}

ul {
    margin: 0px 1.5em;
}

li {
    padding: 5px 0px;
}

p {
    padding: 5px 0px;
}

#helper-bot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    text-align: center;
    cursor: pointer;
}

#helper-img {
    width: 80px;
    height: auto;
}

#chat-box {
    position: absolute;
    bottom: 100px;
    right: 0;
    width: 260px;
    background: #fff9c4;
    border: 2px solid #fbc02d;
    border-radius: 10px;
    padding: 1em;
    box-shadow: 5px 5px var(--shadow-color);
    font-family: sans-serif;
}

#chat-box.hidden {
    display: none;
}

.chat-question {
    font-weight: bold;
    margin-bottom: 0.5em;
}

.chat-options button {
    display: block;
    width: 100%;
    margin-bottom: 0.3em;
    padding: 0.4em;
    background-color: #fdd835;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.chat-options button:hover {
    background-color: #ffee58;
}

@media (max-width: 768px) {
    .infoBox {
        width: 95%; /* Use relative width */
        max-width: 750px; /* Max width limit */
    }

    .alertBox {
        width: 90%;
        max-width: 550px;
    }

    .schedulerTable {
        width: 95%;
        max-width: 750px;
        font-size: 12px;
        margin: 5px auto;
    }

    .form-popup {
        top: 1em;
        left: 1em;
    }

    #helper-img {
        width: 40px;
    }
}

@media (max-width: 600px) {
    .infoBox {
        width: 95%;
        max-width: 550px;
    }

    .alertBox {
        width: 90%;
        max-width: 450px;
    }

    .schedulerTable {
        width: 95%;
        max-width: 550px;
    }
}

@media (max-width: 480px) {
    .infoBox {
        width: 95%;
        max-width: 450px;
    }

    .alertBox {
        width: 90%;
        max-width: 350px;
    }

    .schedulerTable {
        width: 95%;
        max-width: 450px;
    }
}

/* Very small devices (around 390px) */
@media (max-width: 390px) {
    html {
        font-size: 15px;
    }

    .infoBox {
        width: 95%;
        max-width: 390px;
    }

    .alertBox {
        width: 90%;
        max-width: 350px;
    }

    .schedulerTable {
        width: 95%;
        max-width: 390px;
        overflow-x: auto; /* ensure horizontal scroll if needed */
        display: block;
    }
}

   .consultation-page {
        max-width: var(--content-width);
        margin: 0 auto;
        padding: 1rem 1rem 2.5rem 1rem;
    }

    .consultation-hero h1 {
        margin-bottom: 0.75rem;
    }

    .consultation-content {
        padding-top: 0.25rem;
    }

    .consultation-note {
        color: var(--text-color);
        font-family: var(--font-body);
    }

    .consultation-note p:last-child {
        margin-bottom: 0;
    }

    .consultation-note ul {
        margin-top: 0.6rem;
        margin-bottom: 0.6rem;
        padding-left: 1.2rem;
    }

    .consultation-note li + li {
        margin-top: 0.45rem;
    }

    .consultation-table-wrap {
        margin-top: 1rem;
        border: 1px solid var(--line-color);
        border-radius: 14px;
        overflow: auto;
        background: #fff;
        box-shadow: 5px 5px var(--shadow-color);
        -webkit-overflow-scrolling: touch;
    }

    .consultation-table {
        min-width: 760px;
        border-collapse: separate;
        border-spacing: 0;
        font-family: var(--font-body);
    }

    .consultation-table th,
    .consultation-table td {
        text-align: center;
        vertical-align: middle;
        padding: 0.85rem 0.7rem;
        min-width: 92px;
        border-bottom: 1px solid #ece5d9;
    }

    .consultation-table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #f6f2e8;
        font-family: var(--font-heading);
        font-weight: 700;
    }

    .consultation-table .date-col {
        position: sticky;
        left: 0;
        z-index: 1;
        background: #fcfaf5;
        text-align: left;
        white-space: nowrap;
        min-width: 115px;
        font-family: var(--font-heading);
        font-weight: 700;
    }

    .consultation-table thead .date-col {
        z-index: 3;
        background: #eee7d8;
    }

    .consultation-table td.empty {
        background: #fbfbfb;
    }

    .consultation-table td.empty a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 2.2rem;
        min-height: 2.2rem;
        border-radius: 999px;
        text-decoration: none;
        background: #fff;
        border: 1px solid var(--line-color);
        color: var(--text-color);
        font-family: var(--font-heading);
        font-weight: 700;
        font-size: 1rem;
        transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
    }

    .consultation-table td.empty a:hover,
    .consultation-table td.empty a:focus-visible {
        background: #f7faff;
        border-color: var(--link-color);
        color: var(--text-color);
        text-decoration: none;
    }

    .consultation-table td.empty a:active {
        transform: translateY(1px);
    }

    .consultation-table td.disabled {
        background: #f1f1f1;
    }

    .consultation-table td.occupied {
        background: #d8d6d1;
        color: #4b4b4b;
        font-family: var(--font-mono);
        font-size: 0.86rem;
        font-weight: 600;
        text-align: center;
    }

    .consultation-table td.occupied span {
        display: inline-block;
        padding: 0.22rem 0.42rem;
        border-radius: 999px;
        background: rgba(255,255,255,0.52);
    }

    .consultation-popup-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.28);
        display: none;
        z-index: 1500;
    }

    .form-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        width: min(92vw, 560px);
        max-height: 90vh;
        overflow-y: auto;
        transform: translate(-50%, -50%);
        z-index: 1600;
        display: none;
        padding: 1.1rem;
        border: 1px solid var(--line-color);
        border-radius: 16px;
        background: var(--block-color);
        box-shadow: 5px 5px var(--shadow-color);
    }

    .form-popup form {
        margin: 0;
    }

    .form-popup h2 {
        margin-top: 0;
    }

    .consultation-success a {
        word-break: break-word;
    }

    .consultation-empty {
        text-align: center;
        padding: 1.2rem;
        color: var(--muted-color);
        font-family: var(--font-mono);
    }

    .consultation-message {
        padding: 0.95rem 1rem;
        border-radius: 12px;
        background: rgba(255,255,255,0.72);
        border: 1px solid #e7e0d2;
    }

    .consultation-message-alert {
        background: #fff6f5;
        border-color: #f0c9c3;
        color: var(--alert-color);
    }

    .mobile-hint {
        margin-top: 0.75rem;
        font-size: 0.88rem;
    }

    @media (max-width: 768px) {
        .consultation-page {
            padding: 0.8rem 0.8rem 2rem 0.8rem;
        }

        .consultation-table {
            min-width: 680px;
        }

        .consultation-table th,
        .consultation-table td {
            padding: 0.8rem 0.65rem;
            min-width: 84px;
            font-size: 0.92rem;
        }

        .consultation-table .date-col {
            min-width: 105px;
            font-size: 0.9rem;
        }

        .form-popup {
            width: min(94vw, 560px);
            padding: 1rem;
        }
    }

    @media (max-width: 480px) {
        .consultation-page {
            padding: 0.7rem 0.7rem 1.5rem 0.7rem;
        }

        .consultation-table {
            min-width: 620px;
        }

        .consultation-table th,
        .consultation-table td {
            padding: 0.72rem 0.55rem;
            min-width: 78px;
            font-size: 0.88rem;
        }

        .consultation-table .date-col {
            min-width: 98px;
        }

        .mobile-hint {
            font-size: 0.82rem;
        }
    }

