/* スマートフォン・タブレット向け */

@media (max-width: 767.98px) {
    /* iOS: フォーカス時の自動ズーム防止 */
    input.form-control,
    input.form-control-lg,
    select.form-select,
    select.form-control,
    textarea.form-control {
        font-size: 16px !important;
    }

    main.py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 1.5rem !important;
    }

    .container,
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* ナビ */
    .navbar-brand {
        font-size: 0.95rem !important;
        max-width: calc(100vw - 4rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand-short {
        display: inline !important;
    }

    .brand-full {
        display: none !important;
    }

    /* 管理画面タブ：横スクロール */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        white-space: nowrap;
        border-bottom: 2px solid #dee2e6;
        padding-bottom: 2px;
    }

    .nav-tabs .nav-item {
        flex-shrink: 0;
    }

    .nav-tabs .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    /* テーブル横スクロール */
    .table-responsive-mobile {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .table-responsive.table-responsive-mobile > .table,
    .table-responsive-mobile > .table.table-wide {
        min-width: 720px;
    }

    .table-responsive.table-responsive-mobile > .table:not(.table-wide) {
        min-width: 480px;
    }

    .chat-thread {
        max-height: 50vh;
    }

    .reply-draft-cell {
        min-width: 0 !important;
        max-width: none !important;
    }

    .reply-draft-cell textarea {
        min-height: 100px;
        font-size: 16px !important;
    }

    /* ボタン・フッター */
    .card-footer.d-flex,
    .card-footer .d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .card-footer .btn,
    .card-footer .form-select {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }

    .btn-group-mobile-stack {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-group-mobile-stack .btn {
        width: 100%;
    }

    /* 予約フォーム */
    .form-page-header h1 {
        font-size: 1.35rem;
    }

    .form-page-header {
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
    }

    .privacy-notice {
        padding: 0.75rem 1rem;
    }

    .privacy-notice p {
        font-size: 0.8rem;
        text-align: left;
    }

    .section-header h3 {
        font-size: 1rem;
    }

    .form-check-label .plan-price,
    .form-check-label .float-end {
        float: none !important;
        display: block;
        margin-top: 0.25rem;
    }

    .form-check {
        align-items: flex-start;
    }

    .form-check-input {
        margin-top: 0.2rem;
        flex-shrink: 0;
    }

    .price-summary .row {
        font-size: 0.95rem;
    }

    .policy-box {
        padding: 1rem;
        font-size: 0.9rem;
    }

    /* カレンダー */
    .shift-calendar {
        max-width: 100%;
        overflow: visible;
    }

    .shift-days {
        grid-auto-rows: minmax(40px, auto);
    }

    .shift-day {
        min-height: 40px;
        border-radius: 6px;
    }

    .shift-day .day-num {
        font-size: 0.85rem;
    }

    .shift-day .day-label {
        font-size: 0.55rem;
        line-height: 1.1;
        text-align: center;
        padding: 0 2px;
    }

    .shift-legend {
        gap: 0.75rem;
        font-size: 0.8rem;
    }

    .res-cal-grid {
        max-width: 100% !important;
    }

    .res-cal-day {
        min-height: 64px;
        font-size: 0.7rem;
    }

    .res-cal-day .count {
        font-size: 0.6rem;
    }

    /* バッジの折り返し */
    .alert .badge {
        display: inline-block;
        margin-bottom: 0.35rem;
        white-space: normal;
        text-align: left;
        max-width: 100%;
    }

    /* お問い合わせ詳細：2カラム → 1カラム */
    .inquiry-layout .col-lg-8,
    .inquiry-layout .col-lg-4 {
        margin-bottom: 1rem;
    }
}

@media (min-width: 768px) {
    .brand-short {
        display: none !important;
    }

    .brand-full {
        display: inline !important;
    }
}

/* タッチ操作 */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .shift-day,
    .nav-link {
        min-height: 44px;
    }

    /* ラジオ・チェックは正円/正方形を維持（min-height だけ指定すると楕円になる） */
    .form-check {
        display: flex;
        align-items: flex-start;
        gap: 0.65rem;
        min-height: 44px;
    }

    .form-check-input {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
        max-width: 22px;
        max-height: 22px;
        margin-top: 0.1rem;
        flex-shrink: 0;
        float: none;
    }

    .form-check-label {
        flex: 1;
        padding-left: 0;
        margin-top: 0.05rem;
    }

    .shift-day {
        min-height: 48px;
    }
}
