body { font-family: sans-serif; background-color: #2e3440; color: #d8dee9; padding: 20px; }
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; padding: 15px; margin-bottom: 20px; background-color: #3b4252; border-radius: 8px; align-items: center; }
.file-input-group { border-right: 1px solid #4c566a; padding-right: 20px;}
/* details, summaryタグのスタイルを追記 */
details {
    width: 100%;
}
summary {
    cursor: pointer;
    font-weight: bold;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}
summary:hover {
    background-color: #434c5e;
}
.details-content {
    margin-top: 10px;
    padding: 15px;
    background-color: rgba(0,0,0,0.1);
    border-radius: 5px;
    border: 1px solid #4c566a;
}
button { font-size: 1em; padding: 10px 15px; cursor: pointer; color: #eceff4; border: none; border-radius: 5px; transition: background-color: 0.2s; }
#apply-button { background-color: #5e81ac; }
#reset-button { background-color: #d08770; }
#verify-button { background-color: #a3be8c; color: #2e3440; }
#event-log-display { width: 100%; max-width: 800px; padding: 15px; margin: 20px auto; background-color: #3b4252; border-radius: 8px; text-align: center; }
#event-log-output { font-weight: bold; font-size: 1.2em; padding: 5px 10px; background-color: #2e3440; border-radius: 4px; min-width: 200px; display: inline-block; transition: all 0.2s ease; }
#event-log-output.detected { color: #a3be8c; }
#event-log-output.unregistered { color: #ebcb8b; }
h2 { text-align: center; }
.coords-toggle-container {
    text-align: center;
    margin-bottom: 15px;
}
#coords-display {
    width: 90%;
    max-width: 800px;
    margin: 0 auto 20px auto;
    padding: 15px;
    background-color: #3b4252;
    border-radius: 8px;
    color: #d8dee9;
    white-space: pre-wrap; /* 改行をそのまま表示 */
    word-break: break-all;
    text-align: left;
    font-family: monospace;
    line-height: 1.5;
}
#keyboard-container { margin-top: 20px; display: grid; gap: 8px; justify-content: center; }
.key { width: 60px; height: 60px; background-color: #4c566a; border-radius: 5px; border: 1px solid #3b4252; display: flex; justify-content: center; align-items: center; font-size: 14px; font-weight: bold; text-align: center; word-break: break-word; transition: all 0.1s ease; user-select: none; }
.key.pressed { background-color: #88c0d0; color: #2e3440; transform: scale(0.95); box-shadow: 0 0 15px rgba(136, 192, 208, 0.6); }
#result { margin-top: 30px; border-top: 2px solid #4c566a; padding-top: 20px;}
#verification-display { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.hidden { display: none !important; }
.mcu-view { text-align: center; }
.mcu-label { font-weight: bold; margin-bottom: 5px; }
.image-container { position: relative; display: inline-block; }
.image-container img { height: 200px; width: auto; display: block; }
.pin { position: absolute; width: 20px; height: 20px; background-color: #d08770; border-radius: 50%; box-shadow: 0 0 10px #d08770, 0 0 15px #d08770; opacity: 0; }
.pin.blinking { animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* 表面 */
#l-pin-d0, #r-pin-d0   { top: 40px; left: -10px; } /* 追加 */
#l-pin-d1, #r-pin-d1   { top: 60px; left: -10px; } /* 修正 */
#l-pin-d2, #r-pin-d2   { top: 80px; left: -10px; } /* 修正 */
#l-pin-d3, #r-pin-d3   { top: 101px; left: -10px; } /* 修正 */
#l-pin-d4, #r-pin-d4   { top: 123px; left: -10px; } /* 追加 */
#l-pin-d5, #r-pin-d5   { top: 139px; left: -10px; } /* 追加 */
#l-pin-d6, #r-pin-d6   { top: 160px; left: -10px; } /* 修正 */

#l-pin-d10, #r-pin-d10 { top: 101px; right: -10px; } /* 修正 */
#l-pin-d9, #r-pin-d9   { top: 120px; right: -10px; } /* 修正 */
#l-pin-d8, #r-pin-d8   { top: 139px; right: -10px; } /* 修正 */
#l-pin-d7, #r-pin-d7   { top: 160px; right: -10px; } /* 修正 */

#r-pin-3v3 { top: 80px; right: -10px; } /* 追加 */
#r-pin-gnd { top: 60px; right: -10px; } /* 追加 */

/* 裏面 */
#l-pin-back-left, #r-pin-back-left { bottom: 12px; left: 30px; width: 8px; height: 20px; border-radius: 3px;}
#l-pin-back-right, #r-pin-back-right { bottom: 12px; left: 45px; width: 8px; height: 20px; border-radius: 3px;}
#l-pin-back-bat, #r-pin-back-bat { bottom: 94px; right: 43px; width: 20px; height: 8px; border-radius: 3px;}


#message-container { width: 100%; display: flex; justify-content: space-around; margin-top: 20px; }
#left-side-messages, #right-side-messages { width: 48%; }
#message-container h3 { color: #88c0d0; border-bottom: 1px solid #4c566a; padding-bottom: 5px; }
#message-container ul { list-style-type: none; padding: 0; }
#message-container li { background-color: #434c5e; padding: 8px; border-radius: 4px; margin-bottom: 5px; font-size: 0.9em; }

/* --- Header --- */
header {
    width: 100%;
    padding: 10px 20px;
    background-color: #3b4252;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
body {
    padding-top: 70px; /* ヘッダーの高さ分だけコンテンツを下げる */
}
#app-title {
    font-size: 1.5em;
    font-weight: bold;
}
#menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2em;
    color: #d8dee9;
}

/* --- Sidebar Menu --- */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background-color: #3b4252;
    padding: 20px;
    padding-top: 80px; /* ヘッダーの高さ分下げる */
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1001;
    overflow-y: auto;
}
#sidebar.open {
    transform: translateX(0);
}
#sidebar details {
    margin-bottom: 15px;
    border-bottom: 1px solid #4c566a;
    padding-bottom: 10px;
}
#sidebar summary {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    padding: 5px;
}
#sidebar .menu-item {
    display: block;
    color: #88c0d0;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
}
#sidebar .menu-item:hover {
    background-color: #4c566a;
}
#key-code-list {
    font-family: monospace;
    font-size: 0.9em;
    padding-left: 15px;
}
.dev-mode {
    padding: 10px 5px;
}

/* --- Overlay --- */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
#overlay.active {
    opacity: 1;
    visibility: visible;
}

#unassigned-keys-message {
    text-align: center;
    color: #ebcb8b; /* 黄色っぽい警告色 */
    margin-top: 15px;
    padding: 10px;
    background-color: #434c5e;
    border-radius: 5px;
    min-height: 1.5em;
}

/* --- メインコンテンツのレイアウト --- */

#checklist-container {
    flex-shrink: 0;
    width: 280px;
    padding: 15px;
    background-color: #3b4252;
    border-radius: 8px;
    margin-top: 20px; /* h2の高さに合わせる */
}
#checklist-container h3 {
    margin-top: 0;
    border-bottom: 1px solid #4c566a;
    padding-bottom: 10px;
}
#checklist-container ul {
    list-style-type: none;
    padding: 0;
}
#checklist-container li {
    margin-bottom: 10px;
}

#super-reload-btn {
    background-color: #bf616a; /* Red color for emphasis */
    margin-left: 10px;
}

#checklist-container.hidden {
    display: none;
}

#checklist-container {
    width: 90%;
    max-width: 800px;
    margin: 20px auto;
    padding: 15px;
    background-color: #3b4252;
    border-radius: 8px;
}

/* --- How-to-use Modal --- */
.modal {
    position: fixed;
    z-index: 1002; /* サイドバーのオーバーレイより手前に表示 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #3b4252;
    margin: auto;
    padding: 20px 30px;
    border: 1px solid #4c566a;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-content h2 {
    text-align: left;
    margin-top: 0;
    color: #eceff4;
}
.modal-content ol {
    padding-left: 20px;
}
.modal-content li {
    margin-bottom: 10px;
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-btn:hover,
.close-btn:focus {
    color: #eceff4;
}

#how-to-use-btn {
    font-size: 1.2em;
    font-weight: bold;
}

/* style.css の末尾などに追記 */
.sidebar-divider {
    border: none;
    height: 1px;
    background-color: #4c566a;
    margin: 15px 0;
}

.checkbox-options {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 10px;
}

/* --- サイドバーフッター --- */
#sidebar-footer {
    margin-top: 450px; /* 上の要素との余白 */
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #4c566a; /* 上のセクションとの区切り線 */
}
#sidebar-footer a {
    color: #d8dee9;
    text-decoration: underline;
}

/* --- お問い合わせリンク --- */
.contact-link {
    font-size: 0.9em; /* 少し小さいテキスト */
    display: block;
    margin-top: -10px; /* 区切り線との余白を詰める */
    margin-bottom: 15px;
    padding: 0 15px;
    color: #81a1c1; /* 少し薄い色 */
}