html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* スマホ専用調整ここから */
@media (max-width: 576px) {
    h2, h4 {
        font-size: 1.2rem;
    }

    .card {
        padding: 1rem;
    }

    .btn {
        font-size: 0.9rem;
    }

    footer .container {
        font-size: 0.85rem;
    }
}
@media (max-width: 576px) {
    .form-control,
    .form-select,
    .btn {
        font-size: 1rem;
    }

    .btn-lg {
        font-size: 1.1rem;
        padding: 0.75rem;
    }
}

/* スマホ専用調整ここまで */

/* ===============================
   Funect Portal - Dashboard Layout
   =============================== */

.admin-dashboard .tile-link {
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

    .admin-dashboard .tile-link:hover {
        transform: translateY(-2px);
        box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,.08);
    }

.admin-dashboard .tile-icon {
    width: 54px;
    height: 54px;
    background: #f3f5f7;
    border-radius: 50%;
}

.admin-dashboard .tile-disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* コードやURLの選択しやすさ */
.selectable {
    user-select: all;
    background: #fafafa;
    padding: 2px 6px;
    border-radius: 4px;
}

/* コピー後アニメーション */
.copy-btn.copied {
    filter: brightness(1.15);
    transition: filter .2s ease;
}

/* 見出しやカード間のバランス */
.admin-dashboard h2.h4 {
    font-weight: 600;
}

.admin-dashboard .card {
    border: 1px solid #e7e7e7;
    border-radius: 0.75rem;
}

    .admin-dashboard .card h3 {
        font-size: 1.1rem;
        font-weight: 600;
    }

/* モバイル調整（既存ルールを継承） */

@media (max-width: 576px) {
    .admin-dashboard .tile-icon {
        width: 46px;
        height: 46px;
    }

    .admin-dashboard .tile-link .fw-semibold {
        font-size: 0.95rem;
    }

    .admin-dashboard .card {
        padding: 1rem;
    }

    .admin-dashboard code.small {
        word-break: break-all;
    }
}
/* 行内情報（ラベル＋値＋コピー） */
.inline-info {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: nowrap; /* PCは必ず1行 */
}

    /* ラベルの見た目（小さめ・ややグレー） */
    .inline-info .label {
        white-space: nowrap;
        font-weight: 600;
        color: #6c757d;
        font-size: .9rem;
    }

    /* 長い値でも1行のまま横スクロールで崩さない */
    .inline-info .code-scroll {
        display: inline-block;
        max-width: 100%;
        overflow: auto; /* スマホで横スクロール可 */
        white-space: nowrap; /* 折り返さない */
        background: #fafafa;
        padding: 2px 6px;
        border-radius: 4px;
    }

/* スマホ微調整 */
@media (max-width: 576px) {
    .inline-info {
        gap: .4rem;
    }
}
/* 運用状況のステータス表示 */
.status-ok {
    color: #198754; /* Bootstrap text-success と同じ緑 */
    font-weight: 600;
}

.status-ng {
    color: #dc3545; /* Bootstrap text-danger と同じ赤 */
    font-weight: 600;
}
/* ===== ステータス全体 ===== */
.status-grid {
    display: grid;
    grid-template-columns: 120px auto; /* ← 左列を固定幅にするのがポイント */
    row-gap: .6rem;
    align-items: center;
}

/* 左：ラベル */
.status-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-weight: 500;
    color: #333;
}

/* 右：状態 */
.status-value {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

/* ランプ */
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

    .dot.ok {
        background: #28a745;
    }

    .dot.warn {
        background: #adb5bd;
    }

    .dot.ng {
        background: #dc3545;
    }

/* テキスト色 */
.status-text {
    font-size: .85rem;
    font-weight: 600;
}

.ok-text {
    color: #28a745;
}
/* ← 稼働中を緑に */
.warn-text {
    color: #6c757d;
}

.ng-text {
    color: #dc3545;
}

/* ===== Dashboard Tiles - 1行横並び・高さ統一 ===== */
.admin-dashboard {
    margin-top: 0.25rem !important;
}

#dashboard-action-tiles .tile-link {
    height: 140px;
    transition: all 0.2s ease;
    border-radius: 0.75rem;
}

.setup-entry-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

/* ============================================================
   Portal - カルテページ専用スタイル
   ============================================================ */
.karte-page .input-group-sm .btn {
    padding-left: .6rem;
    padding-right: .6rem;
}

.karte-page .karte-search-input {
    border-radius: 999px;
    padding-inline: 12px;
    font-size: .9rem;
}

    .karte-page .karte-search-input::placeholder {
        color: #9ca3af;
        opacity: 1;
    }

/* 施術画像サムネ */
.karte-page .karte-photo-thumb-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: 8px;
}

.karte-page .karte-photo-thumb {
    max-width: 120px;
    max-height: 120px;
    object-fit: cover;
}

/* 星表示 */
.karte-page .karte-rating-star {
    font-size: 1.1rem;
}

    .karte-page .karte-rating-star.filled {
        color: #f59e0b;
    }

    .karte-page .karte-rating-star.empty {
        color: #d1d5db;
    }

.karte-mobile-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 三本線ボタン */
.karte-menu-btn {
    appearance: none;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #212529;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: none;
    flex: 0 0 42px;
}

    .karte-menu-btn:hover {
        background: #f8f9fa;
        border-color: #ced4da;
    }

    .karte-menu-btn:focus-visible {
        outline: 2px solid rgba(13, 110, 253, .25);
        outline-offset: 2px;
    }

    .karte-menu-btn i,
    .karte-menu-btn .karte-menu-icon {
        font-size: 1.2rem;
        line-height: 1;
    }

/* 新規登録リンク */
.karte-new-link {
    appearance: none;
    border: 0;
    background: #fff;
    color: #212529;
    min-height: 42px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: none;
}

    .karte-new-link:hover {
        background: #f8f9fa;
        color: #0d6efd;
    }

    .karte-new-link:focus-visible {
        outline: 2px solid rgba(13, 110, 253, .25);
        outline-offset: 2px;
    }

    .karte-new-link i {
        font-size: 1rem;
        color: #0d6efd;
    }

@media (max-width: 767.98px) {
    .karte-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(88vw, 360px);
        height: 100vh;
        background: #fff;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform .2s ease;
        padding: 12px;
        overflow-y: auto;
        box-shadow: 0 0 20px rgba(0,0,0,.15);
        border-right: 1px solid #dee2e6;
    }

        .karte-sidebar.is-open {
            transform: translateX(0);
        }

    .karte-mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
        z-index: 1040;
    }

        .karte-mobile-backdrop.is-open {
            opacity: 1;
            visibility: visible;
        }

    .karte-detail {
        width: 100%;
    }
}

/* ============================================================
   Portal - 問い合わせンメニュー専用スタイル
   ============================================================ */
.dropdown-toggle::after {
    display: none;
}

.dropdown-item:hover {
    background: #f6f7f9;
}

.navbar-brand {
    font-size: 1.2rem;
}
#helpMenu:hover {
    background-color: #f5f8ff;
    transform: scale(1.05);
    transition: 0.15s ease;
}
@media (max-width: 576px) {
    #helpMenu i {
        font-size: 1.6rem;
    }
}

/* 左ペインの製品リスト：選択時の文字色を白くする */
.list-group-item.active,
.list-group-item.active .small,
.list-group-item.active .text-muted {
    color: #fff !important;
}

    /* アイコンも白にしたい場合はこれ */
    .list-group-item.active i {
        color: #fff !important;
    }
.product-list-pane .input-group-sm .btn {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

/* ============================================================
   Portal - メニュー表専用スタイル
   ============================================================ */
.menu-sheet-card {
    background-color: #f8f7f5;
}

.menu-category-title {
    font-size: 1.3rem;
    letter-spacing: .15em;
}

.menu-category-body {
    padding-left: .25rem;
}

.menu-row + .menu-row {
    border-top: 1px solid #e5e7eb;
}

/* ============================================================
   Portal - 設定画面トップ専用スタイル
   ============================================================ */
.list-group-item i {
    opacity: .75;
    font-size: 1.1rem;
}

.settings-parent i {
    font-size: 1.2rem;
}
.settings-sublist {
    display: none;
}

.settings-group.settings-open .settings-sublist {
    display: block;
}

.admin-dashboard .tile-disabled {
    opacity: .6;
    cursor: not-allowed;
    pointer-events: none;
    background: #f8f9fa;
}

    .admin-dashboard .tile-disabled .fw-semibold {
        color: #6c757d;
    }

    .admin-dashboard .tile-disabled .tile-icon {
        background: #eceff1;
    }

.options-editor-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem;
    align-items: center;
}

.options-editor-actions {
    display: flex;
    gap: .25rem;
    flex-wrap: nowrap;
}

    .options-editor-actions .btn {
        min-width: 38px;
    }

@media (max-width: 767.98px) {
    .options-editor-row {
        grid-template-columns: 1fr;
    }

    .options-editor-actions {
        justify-content: flex-end;
    }
}

/* ============================================================
   Portal - 製品情報ページ専用スタイル
   ============================================================ */
.product-mobile-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-menu-btn {
    appearance: none;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #212529;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: none;
    flex: 0 0 42px;
}

    .product-menu-btn:hover {
        background: #f8f9fa;
        border-color: #ced4da;
    }

    .product-menu-btn:focus-visible {
        outline: 2px solid rgba(13, 110, 253, .25);
        outline-offset: 2px;
    }

    .product-menu-btn i {
        font-size: 1.2rem;
        line-height: 1;
    }

.product-new-link {
    appearance: none;
    border: 0;
    background: #fff;
    color: #212529;
    min-height: 42px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}

    .product-new-link:hover {
        background: #f8f9fa;
        color: #0d6efd;
        text-decoration: none;
    }

    .product-new-link i {
        font-size: 1rem;
        color: #0d6efd;
    }

@media (max-width: 767.98px) {
    .product-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(88vw, 360px);
        height: 100vh;
        background: #fff;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform .2s ease;
        padding: 12px;
        overflow-y: auto !important;
        box-shadow: 0 0 20px rgba(0, 0, 0, .15);
        border-right: 1px solid #dee2e6;
        max-height: none !important;
    }

        .product-sidebar.is-open {
            transform: translateX(0);
        }

    .product-mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .35);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
        z-index: 1040;
    }

        .product-mobile-backdrop.is-open {
            opacity: 1;
            visibility: visible;
        }

    .product-detail {
        width: 100%;
    }
}

/* ============================================================
   Portal - Billing page
   ============================================================ */
.billing-reason-alert {
    background: #fde7ef;
    border: 1px solid #f5bfd0;
    color: #7a2946;
    border-radius: 0.5rem;
}

@media (max-width: 576px) {
    .app-content {
        padding-bottom: 6rem;
    }

    main[role="main"] {
        padding-bottom: 4rem !important;
    }

        main[role="main"] > *:last-child {
            margin-bottom: 4rem !important;
        }

    footer {
        margin-top: 1.5rem;
    }
}