html {
    font-size: 36px;
}
body {
    margin: 0;
    font-family: "M PLUS Rounded 1c", sans-serif;
    /* background-color: #f4f4f4; */
    background-color: #fff;
    color: #333;
}

header {
    background-color: #0e4d95;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px; /* ヘッダーの下に隙間を追加 */
}
#company-logo img {
    width: auto;
    height: 1.4rem;
    display: flex;
    align-items: center;
}
#floor-map img {
    width: 100vw;
    height: auto;
    display: flex;
    align-items: center;
    padding-top: 200px;
    /* transform: rotate(90deg); */
    /* padding: 10px; */
}

#current-time {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

/* #stop-icon i {
    font-size: 1.4rem;
    padding: 0 10px;
    color: #fff;
    cursor: pointer;
} */

main {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 120px);
}
/* .main-container {
    width: 100%;
    max-width: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
} */
.button-section {
    /* position: absolute;
    top: 140px; */
    display: flex;
    flex-flow: column;
    text-align: center;
    gap: 5em;
    /* margin: 0 0 1em; */
}

/* button#action-button {
    font-size: 2rem;
    font-family: "M PLUS Rounded 1c", sans-serif;
    padding: 20px 40px;
    border-radius: 100px;
    border: none;
    background-color: #0e4d95;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.5);
} */

button#patrol-button,
button#setting-button {
    width: 500px; /* ボタンの幅を固定 */
    font-size: 2rem;
    font-family: "M PLUS Rounded 1c", sans-serif;
    padding: 20px 40px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    /* transition: background-color 0.3s; */
    /* animation: pururun 1.5s infinite; */
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.5);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}
button#patrol-button {
    border: 5px solid #0e4d95;
    background-color: #fff;
    color: #0e4d95;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.5);
}

button#setting-button {
    background-color: #98a1b3;
    color: #fff;
    border: 5px solid #848c9b;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.5);
}

/* button#action-button:active, */
button#patrol-button:active,
button#cleaning-button:active,
button#product-button:active,
button#stop-button:active {
    transform: scale(0.95);
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
}

button#patrol-button:active,
button#cleaning-button:active,
button#product-button:active {
    background-color: #083b6b;
}

button#stop-button {
    background-color: #e04444;
}

button#stop-button:active {
    background-color: #c83232;
}

@keyframes pururun {
    0% {
        transform: scale(1, 1);
    }
    50% {
        transform: scale(0.9, 0.95);
    }
    100% {
        transform: scale(1, 1);
    }
}
.speech-bubble {
    position: relative;
    max-width: 300px;
    padding: 15px;
    border-radius: 15px;
    background-color: #a6d785;
    color: #fff;
    font-size: 1.2rem;
    margin: 10px 0;
}

.speech-bubble::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 20px;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    border-top-color: #a6d785;
    border-bottom: 0;
    margin-left: -15px;
    margin-bottom: -15px;
}

.speech-bubble.left {
    align-self: flex-start;
    background-color: #8bbf5b;
}

.speech-bubble.left::after {
    left: auto;
    right: 20px;
    border-top-color: #8bbf5b;
}

.speech-bubble.right {
    align-self: flex-end;
    background-color: #a6d785;
}

.speech-bubble.right::after {
    left: 20px;
    border-top-color: #a6d785;
}
.security-area {
    display: none;
    background-color: #ffdd59;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
}
.security-area img {
    pointer-events: none;
}

.security {
    width: 100%;
    height: auto;
}
.video-frame {
    width: 100%;
    height: auto;
}

.cleaning-area {
    display: none;
    /* background-color: #18b064; */
    height: 100vh;
    pointer-events: none;
}
.cleaning-img {
    width: 100%;
    height: auto;
    margin: auto 0;
}
.battery-low-area {
    display: none;
    /* background-color: #18b064; */
    height: 100vh;
}
.battery-low-img {
    width: 100%;
    height: auto;
    margin: auto 0;
}
.pending-area {
    display: none;
    /* background-color: #18b064; */
    /* height: 100vh; */
    position: fixed;
    inset: 0;
    z-index: 99999;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}
.pending-img {
    width: 100%;
    height: auto;
    margin: auto 0;
}

/* オーバーレイ（非表示時は display: none） */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* active クラスで表示 */
.modal-overlay.active {
    display: flex;
}

/* モーダル本体 */
.modal {
    background: #fff;
    padding: 40px 50px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-align: center;
    /* max-width: 320px; */
    width: 50%;
}

.modal-text {
    /* margin-bottom: 20px; */
    font-size: 1.2rem;
}

.modal-buttons {
    display: flex;
    /* justify-content: space-between; */
    gap: 40px;
}

.modal-buttons .btn {
    flex: 1;
    padding: 8px 0;
}

/* 共通ボタンスタイル */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

/* テーマカラー適用 */
.btn.confirm {
    background-color: #0e4d95;
    color: #fff;
}

.btn.cancel {
    background-color: #ccc;
    color: #333;
}

.content {
    position: absolute;
    /* position: relative;
    z-index: 10;
    text-align: center;
    width: 100%;
    max-width: 950px;
    margin-top: 45px; */
}

#image-area .popup-img {
    width: 95vw;
}

#image-area img {
    width: 100vw;
}
#image-area video {
    width: 100vw;
}
.server-text-area {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 40px 25px 25px 25px;
    margin: 2.5vw;
    /* max-width: 650px; */
    /* width: 100%; */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-height: 350px;
    text-align: left;
}

.server-text {
    font-size: 42px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.typing-cursor {
    display: inline-block;
    background-color: #333;
    width: 2px;
    animation: blink 1s infinite;
}
@keyframes continuousPulse {
    0%,
    100% {
        transform: scale(1);
        color: #0f65a7;
    }
    50% {
        transform: scale(1.03);
        color: #1a7bc4;
    }
}
@keyframes blink {
    0%,
    50% {
        opacity: 1;
    }
    51%,
    100% {
        opacity: 0;
    }
}

/* パスワード入力パネル */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.password-panel {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 60px 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    max-width: 650px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.password-panel h3 {
    font-size: 38px;
    margin-top: 10px;
    margin-bottom: 40px;
    color: #333;
}

.password-input-container {
    margin-bottom: 30px;
}

.password-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.password-input {
    width: 100%;
    padding: 25px 80px 25px 30px;
    font-size: 40px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.3s ease;
    text-align: center;
    letter-spacing: 2px;
}

.password-toggle-button {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    color: #6b7280;
    font-size: 32px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-button:hover {
    color: #0f65a7;
}

.password-toggle-button:active {
    transform: translateY(-50%) scale(0.95);
}

.password-input:focus {
    border-color: #0f65a7;
}

.password-input[type="text"] {
    letter-spacing: 2px;
}

.password-input.error {
    border-color: #dc3545;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-10px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(10px);
    }
}

.password-input-wrapper .password-input.error {
    animation: shake 0.5s ease;
}

.password-error {
    color: #dc3545;
    font-size: 32px;
    margin-top: 15px;
    min-height: 40px;
    font-weight: 600;
}

.password-attempts {
    color: #6b7280;
    font-size: 28px;
    margin-top: 15px;
    font-weight: 500;
}

.password-submit-button {
    width: 100%;
    padding: 25px 40px;
    background: linear-gradient(135deg, #0f65a7 0%, #0d5591 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.password-submit-button:hover {
    background: linear-gradient(135deg, #0d5591 0%, #0a4575 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 101, 167, 0.3);
}

.password-submit-button:active {
    transform: translateY(0);
}

.password-submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* コントロールパネル */
.control-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

/* バツアイコンのスタイル */
.close-button {
    position: absolute;
    top: 25px;
    right: 25px;
    background: transparent;
    border: none;
    font-size: 40px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: #000;
}

.control-panel {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.control-panel h3 {
    font-size: 46px;
    margin-bottom: 50px;
    color: #333;
}

.control-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-button {
    padding: 30px 30px;
    border: none;
    border-radius: 10px;
    font-size: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.control-button.stop {
    background: #ffe6e6;
    color: #cc3333;
    border: 1px solid #ff9999;
}

.control-button.start {
    background: #e6ffe6;
    color: #339933;
    border: 1px solid #99ff99;
}

.control-button.refresh {
    background: #e6f3ff;
    color: #3366cc;
    border: 1px solid #99ccff;
}

.control-button.homepose {
    background: #fff3e0;
    color: #cc6633;
    border: 1px solid #ffcc99;
}

.control-button.initpose {
    background: #e6f7fa;
    color: #17a2b8;
    border: 1px solid #b8e3ea;
}

.control-button.setting {
    background: #f0f0f0;
    color: #666666;
    border: 1px solid #cccccc;
}

.control-button.exit {
    background: #edf0f5;
    color: #3b4a66;
    border: 1px solid #b8c1d1;
}

.control-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.spinner {
    margin-left: 12px;
    display: inline-block;
    font-size: 28px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
.control-button:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.control-button:active {
    transform: translateY(0);
}

@media (max-width: 700px) {
    .server-text-area {
        padding: 20px;
        max-width: 90%;
    }

    .server-text {
        font-size: 16px;
    }

    .control-panel {
        padding: 30px 20px;
    }
}

.startup-popup,
.exit-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.startup-content,
.exit-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 800px;
    max-width: 90%;
}

.startup-content h2,
.exit-content h2 {
    font-size: 46px;
    margin-bottom: 60px;
    color: #374151;
}

.button-container {
    display: flex;
    justify-content: center; /* 真ん中寄せ */
    gap: 20px; /* ボタンの間隔 */
}

.start-button-common {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: none;
    padding: 20px 30px;
    font-weight: 600;
    font-size: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 340px;
}

.startup-button {
    background: #0f65a7;
    color: white;
}

.exit-button {
    background: #e74c3c;
    color: white;
}

.setting-button,
.exit-cancel-button {
    background: #f3f4f6;
    color: #374151;
}

.startup-button:hover {
    background: #0d5591;
}

.exit-button:hover {
    background: #c0392b;
}

.setting-button:hover,
.exit-cancel-button:hover {
    background: #e5e7eb;
}

.startup-button:disabled,
.setting-button:disabled,
.exit-button:disabled,
.exit-cancel-button:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 設定メニュー全体 */
.settingMenu {
    text-align: left; /* ラベルや入力欄を左寄せ */
    width: 100%;
    max-width: 600px; /* モバイルで見やすい幅 */
    margin: 0 auto;
}

.settingMenu i {
    color: #0f65a7;
    margin-right: 10px;
}
/* 設定画面の見出し */
.settingMenu h2 {
    font-size: 46px;
    margin-bottom: 30px;
    /* color: #333; */
    color: #374151;
}

/* プルダウン */
.settingMenu label {
    font-size: 32px;
    font-weight: 600;
    color: #374151;
}

/* ボタンコンテナ(既存と同じでもOK) */
.settingMenu .button-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.settingMenu select {
    font-size: 24px;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    width: 100%;
    background: #f9fafb;
    color: #111827;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.settingMenu select:hover {
    border-color: #9ca3af;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 50px 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
    gap: 50px;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* ローディング画面 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 70px;
    margin-bottom: 300px;
}

.spinner-search {
    width: 130px;
    height: 130px;
    border: 14px solid #e5e7eb;
    border-top: 14px solid #4f7396;
    border-radius: 50%;
    animation: spinner 1s linear infinite;
}

@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
.loading-search-keyword {
    font-size: 48px;
    color: #5c6471;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    padding: 0 30px;
    line-height: 1.4;
}
.loading-keyword {
    font-size: 62px;
    color: #4b515b;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    /* padding: 0 30px; */
    line-height: 1.4;
    margin-bottom: 100px;
}

.loading-text {
    font-size: 52px;
    color: #6b7280;
    font-weight: 500;
    letter-spacing: 2px;
}

/* 結果画面 */
#result-screen {
    justify-content: center;
    gap: 35px;
}

.result-intro {
    text-align: center;
    padding: 30px;
}

.result-intro-text {
    font-size: 48px;
    color: #313131;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    max-width: 920px;
    /* max-height: 1300px; */
    overflow-y: auto;
    /* padding: 20px; */
    flex: 1;
}

/* スクロールバーのカスタマイズ */
.result-list::-webkit-scrollbar {
    width: 12px;
}

.result-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.result-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.result-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.result-item {
    background-color: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    padding: 40px 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    position: relative;
}

.result-item::before {
    content: "→";
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 52px;
    color: #d1d5db;
    transition: all 0.3s ease;
}

/* .result-item:hover {
    border-color: #4f7396;
    background-color: #f9fafb;
    transform: translateX(10px);
    box-shadow: 0 6px 20px rgba(79, 115, 150, 0.15);
}

.result-item:hover::before {
    color: #4f7396;
    right: 50px;
} */

.result-item:active {
    transform: translateX(5px);
}

.category-name {
    font-size: 48px;
    color: #374151;
    font-weight: 600;
    margin-bottom: 22px;
    letter-spacing: 0.3px;
}

.aisle-number {
    font-size: 58px;
    color: #4f7396;
    font-weight: 700;
}

.primary-button {
    background: linear-gradient(135deg, #4f7396 0%, #3d5a7a 100%);
    color: #fff;
}

.primary-button:hover {
    background: linear-gradient(135deg, #3d5a7a 0%, #2d4a6a 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(63, 90, 122, 0.3);
}

.primary-button:active {
    transform: translateY(0);
}

.secondary-button {
    background-color: #9ca3af;
    color: #fff;
    font-size: 42px;
    padding: 35px 100px;
}

.secondary-button:hover {
    background-color: #6b7280;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.25);
}

/* ボタン共通 */
.main-button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    border-radius: 20px;
    font-size: 48px;
    font-weight: 600;
    padding: 45px 120px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    letter-spacing: 1px;
}

/* マップ表示エリアのスタイル修正 */
#map-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 40vh;
    /* max-width: 920px; */
    margin-bottom: 70px;
}

#map-preview .map-container {
    width: 100%;
    /* max-width: 920px; */
    height: 100%;
    /* max-height: 518px; */
    position: relative;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    background-color: #fff;
    /* border: 2px solid #333; */
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#map-preview .map-container:active {
    cursor: grabbing;
}

#map-preview .map-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: 0 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

#map-preview .map-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

#map-preview .map-control-btn {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 28px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#map-preview .map-control-btn:active {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
}

/* 案内質問セクション */
.navigation-question {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-top: 10px;
}

/* #navigation-message {
    display: none;
} */

.navigation-text {
    font-size: 50px;
    color: #374151;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.navigation-text-nav {
    font-size: 120px;
    color: #374151;
    font-weight: bold;
    letter-spacing: 5px;
}

.navigation-buttons {
    display: flex;
    gap: 40px;
    margin-bottom: 170px;
}

.btn-wide {
    min-width: 280px;
    padding: 45px 80px;
}

.selected-category {
    font-size: 60px;
    color: #2b2e35;
    margin-bottom: 25px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* デバイス設定パネルのスタイル */

.control-button.device-setting {
    background: #e0f2f7;
    color: #0277bd;
    border: 1px solid #81d4fa;
}

.control-button.device-setting:hover {
    background: #b3e5fc;
}

/* デバイス設定オーバーレイ */
.device-settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.device-settings-panel {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 60px 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.device-settings-panel h3 {
    font-size: 46px;
    margin-top: 10px;
    margin-bottom: 50px;
    color: #333;
    text-align: center;
}

.device-settings-content {
    display: flex;
    flex-direction: column;
    gap: 50px;
    margin-bottom: 40px;
}

.device-section {
    background: #f9fafb;
    border-radius: 15px;
    padding: 35px;
    border: 2px solid #e5e7eb;
}

.device-section h4 {
    font-size: 38px;
    color: #374151;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.device-section h4 i {
    color: #0f65a7;
}

.device-control {
    margin-bottom: 30px;
}

.device-control:last-child {
    margin-bottom: 0;
}

.device-control label {
    display: block;
    font-size: 32px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 15px;
}

.device-select {
    width: 100%;
    padding: 20px 25px;
    font-size: 32px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    background: white;
    color: #111827;
    cursor: pointer;
    transition: border-color 0.3s ease;
    outline: none;
}

.device-select:hover {
    border-color: #9ca3af;
}

.device-select:focus {
    border-color: #0f65a7;
}

.volume-slider {
    width: 100%;
    height: 18px;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e7eb;
    border-radius: 10px;
    outline: none;
    transition: background 0.3s ease;
}

.volume-slider:hover {
    background: #d1d5db;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 50px;
    height: 50px;
    background: #0f65a7;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 101, 167, 0.3);
    transition: all 0.3s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #0d5591;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(15, 101, 167, 0.5);
}

.volume-slider::-moz-range-thumb {
    width: 50px;
    height: 50px;
    background: #0f65a7;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(15, 101, 167, 0.3);
    transition: all 0.3s ease;
}

.volume-slider::-moz-range-thumb:hover {
    background: #0d5591;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(15, 101, 167, 0.5);
}

.device-settings-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.device-button {
    padding: 25px 40px;
    border: none;
    border-radius: 12px;
    font-size: 36px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 250px;
}

.device-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.refresh-button {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #d1d5db;
}

.refresh-button:hover:not(:disabled) {
    background: #e5e7eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.apply-button {
    background: linear-gradient(135deg, #0f65a7 0%, #0d5591 100%);
    color: white;
}

.apply-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #0d5591 0%, #0a4575 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 101, 167, 0.3);
}

.device-button:active:not(:disabled) {
    transform: translateY(0);
}

/* スクロールバーのカスタマイズ(デバイス設定パネル用) */
.device-settings-panel::-webkit-scrollbar {
    width: 12px;
}

.device-settings-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.device-settings-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.device-settings-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* レスポンシブ対応 */
@media (max-width: 700px) {
    .device-settings-panel {
        padding: 40px 30px;
    }

    .device-settings-panel h3 {
        font-size: 36px;
        margin-bottom: 30px;
    }

    .device-section h4 {
        font-size: 30px;
    }

    .device-control label {
        font-size: 26px;
    }

    .device-select {
        font-size: 26px;
        padding: 15px 20px;
    }

    .device-button {
        font-size: 28px;
        padding: 20px 30px;
        min-width: 200px;
    }

    .device-settings-buttons {
        flex-direction: column;
    }

    .volume-slider::-webkit-slider-thumb {
        width: 40px;
        height: 40px;
    }

    .volume-slider::-moz-range-thumb {
        width: 40px;
        height: 40px;
    }
}

/* 数字キーパッドのスタイル */

.numpad {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 25px;
    background: #f9fafb;
    border-radius: 15px;
    border: 2px solid #e5e7eb;
}

.numpad-row {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.numpad-key {
    flex: 1;
    padding: 25px;
    font-size: 42px;
    font-weight: 600;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.numpad-key:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.numpad-key:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background: #e5e7eb;
}

.numpad-clear {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    font-size: 32px;
}

.numpad-clear:hover {
    background: #fecaca;
    border-color: #f87171;
}

.numpad-backspace {
    background: #fff7ed;
    color: #ea580c;
    border-color: #fed7aa;
    font-size: 32px;
}

.numpad-backspace:hover {
    background: #ffedd5;
    border-color: #fdba74;
}

/* パスワード入力フィールドがアクティブな時 */
.password-input.numpad-active {
    border-color: #0f65a7;
    box-shadow: 0 0 0 3px rgba(15, 101, 167, 0.1);
}

/* 読み取り専用入力フィールドのカーソルを変更 */
.password-input[readonly] {
    cursor: pointer;
    background: white;
}

/* レスポンシブ対応 */
@media (max-width: 700px) {
    .numpad {
        padding: 20px;
        gap: 12px;
    }

    .numpad-row {
        gap: 12px;
    }

    .numpad-key {
        padding: 20px;
        font-size: 36px;
        min-height: 75px;
    }

    .numpad-clear,
    .numpad-backspace {
        font-size: 28px;
    }
}

/* タッチデバイス向けの調整 */
@media (hover: none) and (pointer: coarse) {
    .numpad-key {
        padding: 30px;
        min-height: 100px;
    }

    .numpad-key:active {
        background: #dbeafe;
        border-color: #3b82f6;
    }
}

#return-to-list-button {
    margin-top: 30px;
    margin-bottom: 50px;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner-back {
    width: 60px;
    height: 60px;
    font-size: 28px;
    border: 6px solid #e5e7eb;
    border-radius: 50%;
    border-top: 6px solid #4f7396;
    animation: spinner 1s linear infinite;
    margin: 0 auto 20px;
}

/* .spinner {
    margin-left: 12px;
    display: inline-block;
    font-size: 28px;
    animation: spin 1s linear infinite;
} */

/* 案内中の質問ボタン - 画像の上にオーバーレイ表示 */
.navigation-overlay {
    /* position: absolute; */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none; /* オーバーレイ自体はクリックを通過 */
}

.navigation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* 上寄せに変更 */
    padding-top: 130px; /* 上からの距離 */
    z-index: 100;
    pointer-events: none;
}

.question-overlay-button {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 25px 80px;
    background: #d55300;
    color: white;
    border: 3px solid #bd4902;
    border-radius: 200px;
    font-size: 75px;
    font-weight: 600;
    cursor: pointer;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-width: 380px;
}

.question-overlay-button i {
    font-size: 48px;
}
.exit-sub-text {
    font-size: 36px;
    margin-bottom: 35px;
    color: #374151;
    font-weight: bold;
}
