:root {
    --major-color: #23ABAB;
    --sub-color: #A9D9D4;
}

body {
    font-size: 16px;
    line-height: 1.8rem;
    padding: 30px 0 150px;
    color: #1c1c1c;
}

body.nav-top {
    padding-top: 90px;
}

#top-nav {
    border: 1px none;
    background-color: white;
    box-shadow: 0 2px 4px #e4f2f0;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10;
}

#top-nav .text-primary:after {
    content: ' ';
    display: block;
    background-color: #23abab;
    border: 1px none;
    border-radius: 8px;
    height: 5px;
    width: 100%;
    position: absolute;
    top: 40px;
    left: 0;
}

#top-nav .btn {
    font-size: 18px;
}

.period-header {
    width: 100%;
    height: 90px;
}

.period-header.fixed > div {
    position: fixed;
    top: 49px;
    left: 15px;
    width: 100%;
    z-index: 9;
}

.footer {
    position: fixed;
    background-color: #fff;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 10px 0 50px;
    z-index: 11;
}

h1 {
    font-size: 24px;
    margin-bottom: 1rem;
}

h1 .rounded-circle {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
}

h1 .rounded-circle img {
    position: relative;
    top: -1px;
}

.fs-18 {
    font-size: 18px;
}

a {
    -webkit-transition: .5s;
    -o-transition: .5s;
    transition: .5s;
    outline: none;
    color: black;
}

a:hover {
    text-decoration: none
}

.btn-primary {
    color: #fff;
    background-color: #23abab !important;
    border-color: #23abab;
}

.btn-primary.focus, .btn-primary:focus {
    border-color: #23abab;
}

.btn-primary:hover {
    color: #fff !important;
}

.border-primary {
    border-color: #23abab !important;
}

.text-primary,
a.text-primary:focus, a.text-primary:hover {
    color: #23abab !important;;
}

a.text-primary:focus,
a.text-primary:hover {
    color: #fff;
}

.btn-outline-primary {
    border-width: 2px;
    border-color: #23abab;
    color: #23abab;
}

.btn-outline-primary:hover {
    color: #fff !important;
}

.btn-outline-primary:not(:disabled):not(.disabled).active,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.show > .btn-outline-primary.dropdown-toggle,
.btn-outline-primary:hover {
    color: #fff !important;
    background-color: #23abab;
    border-color: #23abab;
}

.btn-primary.disabled-btn{
    background-color: gray !important;
    border-color: gray !important;
    color: white;
}

.bg-primary {
    background-color: #23abab !important;
}

.text-danger {
    color: #EE4E0A !important;
}

.btn-outline-danger {
    border-width: 2px;
    border-color: #EE4E0A;
    color: #000;
}

.btn-outline-danger:hover {
    color: #fff !important;
}

.btn-outline-danger:not(:disabled):not(.disabled).active, .btn-outline-danger:not(:disabled):not(.disabled):active, .show > .btn-outline-danger.dropdown-toggle {
    color: #fff !important;
    background-color: #EE4E0A;
    border-color: #EE4E0A;
}

.btn-danger {
    color: #fff;
    background-color: #EE4E0A;
    border-color: #EE4E0A;
}

.bg-danger {
    background-color: #EE4E0A !important;
}

.border-danger {
    border-color: #EE4E0A !important;
}

.btn-outline-danger {
    border-width: 2px;
    border-color: #EE4E0A;
    color: black;
}

.dotted-left {
    border-left: 1px dotted #6c757d;
    box-sizing: border-box;
}

.dotted-bottom {
    border-bottom: 1px dotted #23abab;
    box-sizing: border-box;
}

.row-box {
    align-items: flex-start;
    border: 1px solid #23abab;
    border-radius: 4px;
    display: flex;
    padding: 15px 0;
    box-sizing: border-box;
    margin: 0;
}

.patient-group {
    margin-bottom: 2rem;
}

.patient-group-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.patient-group-divider {
    border: 0;
    border-top: 1px solid #23abab;
    margin: 0 0 1rem;
}

.row-box > div {
    padding-left: 10px;
    padding-right: 10px;
}

.row-box .border-bottom,
.row-box .dotted-left {
    border-color: #23abab !important;
}

.cb {
    position: relative;
    overflow: hidden;
}

.cb input[type=radio] {
    position: absolute;
    left: -9999px;
}

.cb label {
    display: inline-block;;
    background-color: white;
    border: 1px solid #acacac;
    border-radius: 2px;
    height: 26px;
    width: 26px;
    cursor: pointer;
    padding: 0 4px;
    box-sizing: border-box;
}

.cb input[type=radio]:checked + label {
    background-color: #23abab;
}

.queue_number {
    height: 50px;
    line-height: 50px;
    font-size: 48px;
}

.form-control.is-invalid, .was-validated .form-control:invalid {
    border-color: #EE4E0A;
}

.invalid-feedback {
    color: #EE4E0A;
}

.stars {
    display: inline-block;
}

.stars .btn {
    float: right;
}

.stars .btn span {
    display: inline-block;
    font-size: 20px;
}

.stars .btn span:nth-child(1) {
    color: #9BA4AB;
}

.stars .btn span:nth-child(2) {
    color: #F7AF32;
    display: none;
}

.stars .btn:hover span:nth-child(1),
.stars .btn:hover + .btn span:nth-child(1),
.stars .btn:hover + .btn + .btn span:nth-child(1),
.stars .btn:hover + .btn + .btn + .btn span:nth-child(1),
.stars .btn:hover + .btn + .btn + .btn + .btn span:nth-child(1) {
    display: none;
}

.stars .btn:hover span:nth-child(2),
.stars .btn:hover + .btn span:nth-child(2),
.stars .btn:hover + .btn + .btn span:nth-child(2),
.stars .btn:hover + .btn + .btn + .btn span:nth-child(2),
.stars .btn:hover + .btn + .btn + .btn + .btn span:nth-child(2) {
    display: inline-block;
}

.stars input[type="hidden"][value="1"] + button + button + button + button + button span:nth-child(1),
.stars input[type="hidden"][value="2"] + button + button + button + button + button span:nth-child(1),
.stars input[type="hidden"][value="2"] + button + button + button + button span:nth-child(1),
.stars input[type="hidden"][value="3"] + button + button + button + button + button span:nth-child(1),
.stars input[type="hidden"][value="3"] + button + button + button + button span:nth-child(1),
.stars input[type="hidden"][value="3"] + button + button + button span:nth-child(1),
.stars input[type="hidden"][value="4"] + button + button + button + button + button span:nth-child(1),
.stars input[type="hidden"][value="4"] + button + button + button + button span:nth-child(1),
.stars input[type="hidden"][value="4"] + button + button + button span:nth-child(1),
.stars input[type="hidden"][value="4"] + button + button span:nth-child(1),
.stars input[type="hidden"][value="5"] + button + button + button + button + button span:nth-child(1),
.stars input[type="hidden"][value="5"] + button + button + button + button span:nth-child(1),
.stars input[type="hidden"][value="5"] + button + button + button span:nth-child(1),
.stars input[type="hidden"][value="5"] + button + button span:nth-child(1),
.stars input[type="hidden"][value="5"] + button span:nth-child(1) {
    display: none !important;
}

.stars input[type="hidden"][value="1"] + button + button + button + button + button span:nth-child(2),
.stars input[type="hidden"][value="2"] + button + button + button + button + button span:nth-child(2),
.stars input[type="hidden"][value="2"] + button + button + button + button span:nth-child(2),
.stars input[type="hidden"][value="3"] + button + button + button + button + button span:nth-child(2),
.stars input[type="hidden"][value="3"] + button + button + button + button span:nth-child(2),
.stars input[type="hidden"][value="3"] + button + button + button span:nth-child(2),
.stars input[type="hidden"][value="4"] + button + button + button + button + button span:nth-child(2),
.stars input[type="hidden"][value="4"] + button + button + button + button span:nth-child(2),
.stars input[type="hidden"][value="4"] + button + button + button span:nth-child(2),
.stars input[type="hidden"][value="4"] + button + button span:nth-child(2),
.stars input[type="hidden"][value="5"] + button + button + button + button + button span:nth-child(2),
.stars input[type="hidden"][value="5"] + button + button + button + button span:nth-child(2),
.stars input[type="hidden"][value="5"] + button + button + button span:nth-child(2),
.stars input[type="hidden"][value="5"] + button + button span:nth-child(2),
.stars input[type="hidden"][value="5"] + button span:nth-child(2) {
    display: inline-block !important;;
}

.form-control.is-valid, .was-validated .form-control:valid,
.form-control.is-invalid, .was-validated .form-control:invalid {
    background-position: right calc(0.375em + 0.5rem) center;
    background-position-x: right calc(0.375em + 0.5rem);
    background-position-y: center;
}

@media (max-width: 400px) {
    body {
        font-size: 15px;
    }

    .row-cancel > div {
        padding-left: 8px;
        padding-right: 8px;
    }
}

.edit-button{
    position: absolute;
    top: 0;
    right: 15px;
    z-index: 99;
    border: #23abab 2px solid;
    color: #23abab;
    padding: .375rem .75rem;
    height: calc(1.5em + .75rem + 2px);
    font-size: 1rem;
    line-height: 1.5;
    border-radius: .25rem;
    cursor: pointer;
}


.edit-button:hover{
    background-color: #23abab;
    color: white;
}

.popup-background {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    /* background-color: rgba(0, 0, 0, 0.5); */
    z-index: 1;
}

.popup-background .popup {
    position: fixed;
    width: 300px;
    padding: 20px;
    background: white;
    border-radius: 5px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: #23abab 2px solid;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.img-thumbnail{
    aspect-ratio: 1;
    object-fit: cover;
    object-position: top;
}

.limited-text-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

#appointment-page .custom-checkbox .custom-control-label[for="agree"]:before{
    top: 0;
    left: -2rem;
    width: 1.5rem;
    height: 1.5rem;
    border: black solid 3px;
}

.text-small{
    font-size: .85em;
}
.text-tiny{
    font-size: .7em;
}
.text-big{
    font-size: 1.4em;
}
.text-huge{
    font-size: 1.8em;
}

#appointment-page .comment{
    p{
        line-height: 1.6;
        margin-bottom: 10px;
    }

    a{
        color: blue;
        text-decoration: underline;
        &:hover{
            color: blue;
            text-decoration: none;
        }
    }
}

.dept-notice{
    p{
        margin-bottom: 0;
    }
    br{
        display: none;
    }
}

/* LINE WebView：自訂 select（取代原生 picker） */
select.webview-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.webview-select-wrapper {
    position: relative;
}

.webview-select-trigger {
    position: relative;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 8px 10px;
    padding-right: 1.75rem;
    cursor: pointer;
}

.webview-select-trigger.text-muted {
    color: #6c757d;
}

.webview-select-trigger.is-invalid {
    border-color: #EE4E0A;
}

.webview-select-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
}

.webview-select-overlay.is-open {
    display: block;
}

.webview-select-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
}

.webview-select-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 70vh;
    background: #fff;
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.webview-select-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.webview-select-sheet-title {
    font-weight: 600;
    font-size: 1rem;
    padding-right: 8px;
}

.webview-select-close {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: #6c757d;
    padding: 0 4px;
    cursor: pointer;
}

.webview-select-options {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.webview-select-option {
    display: block;
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f1f3f5;
    background: #fff;
    text-align: left;
    padding: 14px 16px;
    font-size: 1rem;
    line-height: 1.4;
    color: #212529;
    cursor: pointer;
}

.webview-select-option.is-selected {
    color: #23abab;
    font-weight: 600;
}

.webview-select-option:active {
    background-color: #f8f9fa;
}

body.webview-select-open {
    overflow: hidden;
}

/* LINE WebView：fixed footer 易攔截觸控，改 sticky 並保留在文件流內 */
body.line-webview#appointment-page .footer,
body.line-webview#cancel-page .footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
}

/* 預約掛號頁面 */
#appointment-page .dept-info-box {
    border: 1px solid var(--major-color);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    margin: 1rem auto 1.5rem;
    max-width: 90%;
}

#appointment-page .dept-info-name {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: bold;
}

#appointment-page .dept-info-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0;
}

#appointment-page .hide {
    display: none;
}

#appointment-page #popup-area {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    width: 100%;
    height: 100%;
}

#appointment-page #popup-area .filter {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: rgba(0, 0, 0, .4);
    width: 100%;
    height: 100%;
}

#appointment-page #popup-area .popup-box {
    background-color: white;
    margin: 20% auto;
    width: clamp(360px, 80%, 720px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0 0 rgba(0, 0, 0, 0.02);
    border-radius: 15px;
    margin-bottom: 20px;
    background-clip: padding-box;
    overflow: auto;
}

@media (max-width: 480px) {
    #appointment-page #popup-area .popup-box {
        margin: 80% auto;
    }
}

#appointment-page #popup-area .popup-box > * {
    width: 100%;
}

#appointment-page #popup-area .popup-box .popup-title {
    background-color: var(--major-color);
    color: white;
    padding: 1rem;
    margin-top: 0;
}

#appointment-page #popup-area .popup-box .popup-content {
    max-height: 50vh;
    overflow: auto;
}

#appointment-page #popup-area .popup-box .popup-content p {
    padding-left: 16px;
}

#appointment-page #popup-area .popup-box .close-popup {
    display: flex;
    flex-direction: row;
    height: 1rem;
    margin: 1rem 0;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

#appointment-page #popup-area .popup-box .close-popup > button {
    height: 1rem;
    width: 1rem;
    margin-right: 5px;
    background-color: white;
    border: 2px #797979 solid;
    box-shadow: none;
}

#appointment-page #popup-area .popup-box .close-popup > p {
    font-size: 1rem;
    line-height: 1rem;
    margin-left: -10px;
    margin-bottom: 0;
}

#appointment-page .btn-words-4,
#appointment-page .btn-words-5,
#appointment-page .btn-words-6 {
    padding: .375rem 0;
}

#appointment-page .btn-words-6 {
    font-size: 15px;
    line-height: 1.6;
}

#appointment-page .btn-many-words {
    padding: .25rem 0;
    margin-top: -1px;
    font-size: 14px;
    line-height: 15px;
}

#appointment-page #popup-area .popup-box .popup-full-call {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: left;
    flex-wrap: wrap;
    padding: 12px 16px 16px;
    border-top: 1px solid #eee;
    margin-top: 8px;
}

#appointment-page #popup-area .popup-box .popup-full-call-content {
    margin: 0;
}

#appointment-page #popup-area .popup-box .popup-full-call-number {
    margin: 0;
}

#appointment-page #popup-area .popup-box .popup-full-call-number a {
    color: var(--major-color);
    font-weight: bold;
}