/* LINE LIFF mobile styles. The shared MVC layout loads this file only when opted in.
   Scope selectors under body.liff-page; keep data-driven values in markup bindings. */
body.liff-page {
    --liff-content-max-width: 520px;
}

body.liff-page .app-container {
    max-width: var(--liff-content-max-width);
}

/* Shared MVC/LIFF status components. Scoped by the opt-in page stylesheet. */
body.liff-page .tc-callout {
    border: 1px solid #dbe3ec;
    border-left: 4px solid #64748b;
    border-radius: .75rem;
    padding: .875rem 1rem;
    margin-block: .75rem;
    background: #f8fafc;
    color: #334155;
}

body.liff-page .tc-callout-info { border-left-color: #0284c7; background: #f0f9ff; }
body.liff-page .tc-callout-success { border-left-color: #198754; background: #f0fdf4; }
body.liff-page .tc-callout-warning { border-left-color: #d97706; background: #fffbeb; }
body.liff-page .tc-callout-error { border-left-color: #dc3545; background: #fff5f5; }

body.liff-page .tc-notification-host {
    position: fixed;
    z-index: 1090;
    inset: max(.75rem, env(safe-area-inset-top)) .75rem auto;
    display: grid;
    gap: .65rem;
    width: min(100% - 1.5rem, 520px);
    margin-inline: auto;
    pointer-events: none;
}

body.liff-page .tc-toast,
body.liff-page .tc-error-card {
    pointer-events: auto;
    border: 1px solid #cbd5e1;
    border-radius: .85rem;
    background: #fff;
    color: #1e293b;
    box-shadow: 0 .5rem 1.5rem rgba(15, 23, 42, .16);
}

body.liff-page .tc-notification-host > .tc-callout { pointer-events: auto; }

body.liff-page .tc-toast { display: flex; align-items: flex-start; gap: .75rem; padding: .9rem 1rem; }
body.liff-page .tc-toast-success { border-left: 5px solid #198754; }
body.liff-page .tc-toast-info { border-left: 5px solid #0284c7; }
body.liff-page .tc-toast-warning { border-left: 5px solid #d97706; }
body.liff-page .tc-toast-error { border-left: 5px solid #dc3545; }
body.liff-page .tc-toast-message { flex: 1; min-width: 0; overflow-wrap: anywhere; }
body.liff-page .tc-toast-close { border: 0; background: transparent; color: #475569; font-size: 1.35rem; line-height: 1; padding: 0 .2rem; }
body.liff-page .tc-error-card { padding: 1rem; border-color: #fecaca; }
body.liff-page .tc-error-title { margin: 0 0 .4rem; font-size: 1.05rem; font-weight: 700; color: #991b1b; }
body.liff-page .tc-error-message,
body.liff-page .tc-error-code,
body.liff-page .tc-error-reference { margin: .35rem 0; overflow-wrap: anywhere; }
body.liff-page .tc-error-code { font-weight: 700; }
body.liff-page .tc-error-reference { color: #475569; font-size: .9rem; }
body.liff-page .tc-error-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
body.liff-page .tc-error-copy,
body.liff-page .tc-error-dismiss,
body.liff-page .tc-callout-dismiss { min-height: 44px; border-radius: .6rem; padding: .55rem .85rem; }
body.liff-page .tc-error-copy { border: 1px solid #b91c1c; background: #b91c1c; color: #fff; }
body.liff-page .tc-error-dismiss { border: 1px solid #cbd5e1; background: #fff; color: #334155; }
body.liff-page .tc-callout-dismiss { margin-top: .5rem; border: 1px solid #cbd5e1; background: #fff; color: #334155; }

/* QT order page: fixed visual treatments formerly expressed inline. */
body.liff-page .liff-order-icon,
body.liff-page .liff-rollcall-icon {
    width: 42px;
    height: 42px;
}

body.liff-page .liff-order-member-card {
    background: linear-gradient(135deg, #1e7e34, #28a745);
}

body.liff-page .liff-order-empty-icon {
    font-size: 3.5rem;
}

body.liff-page .liff-order-progress,
body.liff-page .rollcall-stat-progress {
    height: 6px;
}

body.liff-page .liff-order-popular-badge {
    font-size: 10px;
}

body.liff-page .liff-order-duration {
    font-size: 11px;
}

body.liff-page .liff-order-quantity-button {
    width: 34px;
    height: 34px;
}

body.liff-page .liff-order-quantity-value {
    min-width: 32px;
}

body.liff-page .liff-order-month-picker,
body.liff-page .liff-rollcall-select {
    width: 100%;
}

/* Shared inline option picker used by LIFF dropdowns. */
body.liff-page .liff-rollcall-shepherd-badge {
    font-size: 10px;
}

body.liff-page .liff-tap-select {
    position: relative;
    width: 100%;
    z-index: 1;
}

body.liff-page .liff-tap-select.is-open {
    z-index: 1201;
}

body.liff-page .liff-tap-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    min-height: 40px;
    padding: .375rem .75rem;
    font-family: inherit;
    font-size: inherit;
    color: #606266;
    cursor: pointer;
    text-align: left;
    background-color: #fff;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    touch-action: manipulation;
}

body.liff-page .liff-tap-select-trigger:disabled {
    color: #6c757d;
    background-color: #e9ecef;
    cursor: not-allowed;
}

body.liff-page .liff-tap-select-value,
body.liff-page .liff-tap-select-option-content {
    min-width: 0;
    flex: 1 1 auto;
}

body.liff-page .liff-tap-select-trigger:focus-visible,
body.liff-page .liff-tap-select-option:focus-visible {
    outline: 2px solid #409eff;
    outline-offset: 1px;
}

body.liff-page .liff-tap-select-menu {
    position: absolute;
    top: calc(100% + .25rem);
    right: 0;
    display: flex;
    flex-direction: column;
    width: max(100%, 14rem);
    max-width: 92vw;
    max-height: min(55vh, 24rem);
    padding: .25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background-color: #fff;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
    z-index: 1202;
    touch-action: pan-y;
}

body.liff-page .liff-tap-select-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    min-height: 44px;
    padding: .5rem .625rem;
    color: #606266;
    text-align: left;
    background-color: #fff;
    border: 0;
    border-radius: 4px;
    touch-action: manipulation;
}

body.liff-page .liff-tap-select-option.is-selected {
    color: #1e7e34;
    font-weight: 700;
    background-color: #e8f5e9;
}

body.liff-page .liff-tap-select-option:disabled {
    color: #9aa0a6;
    background-color: #f8f9fa;
    cursor: not-allowed;
}

@media (hover: hover) and (pointer: fine) {
    body.liff-page .liff-tap-select-option:hover {
        background-color: #f5f7fa;
    }
}

body.liff-page .liff-rollcall-dashboard {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
}

body.liff-page .rollcall-stat-row {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-top: .65rem;
}

body.liff-page .rollcall-stat-name {
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .05em;
}

body.liff-page .rollcall-stat-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: .4rem;
    width: 100%;
}

body.liff-page .rollcall-stat-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    text-align: center;
    padding: .35rem .25rem;
    border-radius: .5rem;
    white-space: nowrap;
    background-color: rgba(255, 255, 255, 0.15);
}

body.liff-page .rollcall-stat-value strong {
    font-size: 1.15rem;
    line-height: 1;
}

body.liff-page .rollcall-stat-value small {
    font-size: .8rem;
    opacity: .9;
}

body.liff-page .rollcall-stat-value.bg-white {
    /* Bootstrap's .bg-white utility is !important; keep these stat tiles opaque. */
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.liff-page .rollcall-stat-progress {
    width: 100%;
    margin-top: .15rem;
    background-color: rgba(255, 255, 255, 0.2);
}

body.liff-page .rollcall-member-name {
    min-width: 0;
    flex: 1 1 8rem;
}

body.liff-page .rollcall-category-toggle {
    flex: 0 0 auto;
}

body.liff-page .rollcall-category-toggle .btn {
    font-size: .75rem;
    line-height: 1.2;
    white-space: nowrap;
}

body.liff-page .rollcall-shepherd-state {
    background-color: #fff3cd;
    /* Override Bootstrap .border-0 on this status alert so the state border remains visible. */
    border: 1px solid #ffecb5 !important;
}

/* Override Bootstrap .shadow-sm so the state-colored inset stripe is not lost. */
body.liff-page .rollcall-shepherd-paused {
    box-shadow: inset 4px 0 0 #dc3545, 0 .125rem .25rem rgba(0, 0, 0, .075) !important;
}

body.liff-page .rollcall-shepherd-active {
    box-shadow: inset 4px 0 0 #198754, 0 .125rem .25rem rgba(0, 0, 0, .075) !important;
}

body.liff-page .rollcall-options {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: .75rem;
    width: 100%;
}

body.liff-page .rollcall-option-row {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    min-width: 0;
}

body.liff-page .rollcall-option-label {
    font-weight: 700;
    color: #46566b;
    font-size: .95rem;
    white-space: nowrap;
}

body.liff-page .rollcall-option-row .btn-group {
    width: 100%;
    min-width: 0;
}

body.liff-page .rollcall-option-row .btn-group .btn {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    /* Bootstrap px-2/py-2 utilities are !important; these compact paddings win intentionally. */
    padding-inline: .25rem !important;
    padding-block: .4rem !important;
    font-size: .85rem;
}

body.liff-page .rollcall-option-status {
    display: none;
}

body.liff-page .rollcall-bulk-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: .35rem;
}

body.liff-page .rollcall-search {
    min-width: 0;
}

body.liff-page .liff-rollcall-empty-icon {
    font-size: 3rem;
}

@media (max-width: 575.98px) {
    body.liff-page .rollcall-stat-metrics {
        gap: .25rem;
    }

    body.liff-page .rollcall-stat-value {
        padding: .3rem .15rem;
        gap: .15rem;
    }

    body.liff-page .rollcall-stat-value strong {
        font-size: 1.05rem;
    }

    body.liff-page .rollcall-stat-value small {
        font-size: .75rem;
    }

    body.liff-page .rollcall-options {
        flex-direction: row;
        gap: .5rem;
    }

    body.liff-page .rollcall-option-row {
        flex-direction: column;
        width: auto;
    }

    body.liff-page .rollcall-option-label {
        font-size: .9rem;
    }

    body.liff-page .rollcall-option-row .btn-group .btn {
        /* Bootstrap px-2/py-2 utilities are !important; tighten both paddings on mobile. */
        padding-inline: .15rem !important;
        padding-block: .35rem !important;
        font-size: .8rem;
    }

    body.liff-page .rollcall-toolbar {
        flex-direction: row;
        align-items: center;
    }

    body.liff-page .rollcall-bulk-actions {
        justify-content: flex-end;
    }

    body.liff-page .rollcall-bulk-actions .btn {
        font-size: .75rem;
        /* Bootstrap px-2 is !important; reduce the bulk-action button width on mobile. */
        padding-inline: .35rem !important;
        padding-block: .25rem;
    }
}

@media (max-width: 359.98px) {
    /* Degrade the four metric tiles to two columns on extra-narrow phones to prevent clipping. */
    body.liff-page .rollcall-stat-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Full-time staff LIFF hub & booking styles */
body.liff-page .staff-liff {
    min-height: 100vh;
    background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 180px);
}

body.liff-page .staff-header-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #dcfce7;
    color: #15803d;
    font-size: 1.3rem;
}

body.liff-page .staff-profile-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    border-radius: 1rem;
    padding: 1.1rem 1.25rem;
}

body.liff-page .staff-avatar-badge {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e7e34, #22c55e);
    color: #ffffff;
    font-size: 1.25rem;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.25);
}

body.liff-page .staff-service-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.1rem 1.25rem;
    text-decoration: none !important;
    color: inherit;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

body.liff-page .staff-service-card:hover {
    color: inherit;
    text-decoration: none;
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

body.liff-page .staff-service-card:active {
    transform: scale(0.985);
    background: #f8fafc;
}

body.liff-page .staff-service-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 1.35rem;
}

body.liff-page .staff-service-icon.venue {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

body.liff-page .staff-service-icon.zoom {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #e0e7ff;
}

body.liff-page .staff-service-icon.sheet-music {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ede9fe;
}

body.liff-page .staff-service-icon.grace-meal {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #ffedd5;
}

body.liff-page .staff-service-icon.attendance {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
}

body.liff-page .stepper-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 1.1rem;
    color: #334155;
    padding: 0;
    line-height: 1;
    user-select: none;
    touch-action: manipulation;
}

body.liff-page .stepper-btn:active:not(:disabled) {
    background: #e2e8f0;
    transform: scale(0.92);
}

body.liff-page .stepper-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

body.liff-page .stepper-value {
    min-width: 32px;
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
}

body.liff-page .staff-service-chevron {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #94a3b8;
    font-size: 1.1rem;
    margin-left: 0.5rem;
    transition: transform 0.15s ease, color 0.15s ease;
}

body.liff-page .staff-service-card:active .staff-service-chevron {
    transform: translateX(2px);
    color: #475569;
}

body.liff-page .staff-back-button,
body.liff-page .back-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #ffffff;
    color: #334155;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    font-size: 1.15rem;
}

body.liff-page .staff-back-button:active,
body.liff-page .back-button:active {
    background: #f1f5f9;
}

body.liff-page .booking-row + .booking-row {
    border-top: 1px solid #e2e8f0;
}

body.liff-page .form-control-lg,
body.liff-page .form-select-lg {
    font-size: 1rem;
    min-height: 48px;
}

/* M4 staff service query: presentation only. Every rule requires this page's
   opt-in root; other LIFF pages retain their existing framework styles. */
body.liff-page .liff-service-query {
    font-size: var(--tc-font-size-body, 1rem);
    line-height: 1.6;
    color: var(--tc-color-text, #1e293b);
    overflow-wrap: anywhere;
}

body.liff-page .liff-service-query .liff-service-query-heading,
body.liff-page .liff-service-query .card,
body.liff-page .liff-service-query .card-header,
body.liff-page .liff-service-query .card-body,
body.liff-page .liff-service-query .liff-service-query-assignment > * {
    min-width: 0;
}

body.liff-page .liff-service-query h1 {
    font-size: var(--tc-font-size-page-title, 1.375rem);
    line-height: 1.4;
}

body.liff-page .liff-service-query h2 {
    font-size: 1.0625rem;
    line-height: 1.5;
}

body.liff-page .liff-service-query .small,
body.liff-page .liff-service-query .badge {
    font-size: var(--tc-font-size-supporting, .9375rem);
    line-height: 1.5;
}

body.liff-page .liff-service-query .badge {
    white-space: normal;
    text-align: start;
}

body.liff-page .liff-service-query .btn,
body.liff-page .liff-service-query .form-control,
body.liff-page .liff-service-query a[target="_blank"] {
    min-height: var(--tc-target-min-size, 2.75rem);
    min-width: var(--tc-target-min-size, 2.75rem);
    max-width: 100%;
    font-size: var(--tc-font-size-body, 1rem);
}

body.liff-page .liff-service-query .btn {
    padding: .5rem .75rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

body.liff-page .liff-service-query .liff-service-query-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--tc-target-min-size, 2.75rem);
    flex-shrink: 0;
}

body.liff-page .liff-service-query .form-control {
    min-width: 0;
    width: 100%;
}

body.liff-page .liff-service-query a[target="_blank"] {
    padding-block: .5rem;
    text-underline-offset: .2em;
}

body.liff-page .liff-service-query :is(a, button, input):focus-visible {
    outline: 3px solid var(--tc-focus-color, #0d6efd);
    outline-offset: 3px;
}

body.liff-page .liff-service-query .liff-service-query-assignment {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    padding: .875rem 1rem;
}

body.liff-page .liff-service-query .liff-service-query-member {
    text-align: end;
}

@media (max-width: 575.98px) {
    body.liff-page .liff-service-query .liff-service-query-assignment {
        grid-template-columns: minmax(0, 1fr);
        gap: .375rem;
    }

    body.liff-page .liff-service-query .liff-service-query-member {
        text-align: start;
    }
}
