/*
 * ギターコード指板図 27a / 27b。
 * 共通 app スキンの配色・書体を使い、ここではこの画面だけの配置を定義する。
 */

body.tools-guitar-chord-page,
body.tools-ukulele-chord-page,
body.tools-guitar-scale-page,
body.tools-bass-scale-page,
body.tools-ukulele-scale-page,
body.tools-piano-chord-page,
body.tools-piano-scale-page {
    min-width: 0;
}

body.tools-guitar-chord-page #emmuChordTool,
body.tools-ukulele-chord-page #emmuChordTool,
body.tools-guitar-scale-page #emmuChordTool,
body.tools-bass-scale-page #emmuChordTool,
body.tools-ukulele-scale-page #emmuChordTool,
body.tools-piano-chord-page #emmuChordTool,
body.tools-piano-scale-page #emmuChordTool {
    --est-wood: #E7CDA5;
    --est-wood-edge: #BDA887;
    --est-string: rgba(80, 66, 46, 0.62);
    --est-nut: #2A2521;
    --est-ink: var(--eat-text);
    --est-muted: var(--eat-text2);
    --est-faint: var(--eat-mold-glyph);
    --est-card: var(--eat-plate-solid);
    --est-dot-bg: var(--eat-plate-solid);
    --est-png-bg: var(--eat-plate-solid);
    --est-png-caption: var(--eat-text);
    --est-png-credit: var(--eat-text2);
    --est-png-rule: var(--eat-hair);
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--eat-text2);
}

/*
 * tools.css の旧指板共通ルール .emmu-scale-tool > * が direct child を
 * position: relative にするため、共通背景 .eat-cover の fixed が上書きされる。
 * カバーだけはメトロノーム等と同じ固定背景に戻し、画面本体をその上へ重ねる。
 */
body.tools-guitar-chord-page #emmuChordTool > .eat-cover,
body.tools-ukulele-chord-page #emmuChordTool > .eat-cover,
body.tools-guitar-scale-page #emmuChordTool > .eat-cover,
body.tools-bass-scale-page #emmuChordTool > .eat-cover,
body.tools-ukulele-scale-page #emmuChordTool > .eat-cover,
body.tools-piano-chord-page #emmuChordTool > .eat-cover,
body.tools-piano-scale-page #emmuChordTool > .eat-cover {
    position: fixed;
}

body.tools-guitar-chord-page #emmuChordTool::before,
body.tools-ukulele-chord-page #emmuChordTool::before,
body.tools-guitar-scale-page #emmuChordTool::before,
body.tools-bass-scale-page #emmuChordTool::before,
body.tools-ukulele-scale-page #emmuChordTool::before,
body.tools-piano-chord-page #emmuChordTool::before,
body.tools-piano-scale-page #emmuChordTool::before {
    display: none;
}

#emmuChordTool .egc-screen {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding-top: 20px;
    padding-bottom: 14px;
}

#emmuChordTool button,
#emmuChordTool input {
    font-family: inherit;
}

#emmuChordTool .egc-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ─── ヘッダー ─── */

#emmuChordTool .egc-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 4px;
}

#emmuChordTool .egc-back-ic {
    width: 13px;
    height: 13px;
    fill: var(--eat-text2);
}

#emmuChordTool .egc-head-name {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 9px;
}

#emmuChordTool .egc-brand {
    flex: none;
    font-size: 11.5px;
    letter-spacing: 0.24em;
    color: var(--eat-bronze);
}

#emmuChordTool .egc-title {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0.06em;
    color: var(--eat-text);
    white-space: nowrap;
    text-overflow: ellipsis;
}

#emmuChordTool .egc-theme {
    border-color: var(--eat-plate-edge);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 1px 2px var(--eat-circle-shadow);
}

/* ─── ルートの12音パッド ─── */

#emmuChordTool .egp-notation-row {
    min-width: 0;
    display: flex;
    width: 100%;
}

#emmuChordTool .egp-notation-seg {
    width: 100%;
}

#emmuChordTool .egp-notation-seg button {
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 14px;
}

#emmuChordTool .egc-root-plate {
    min-width: 0;
    padding: 10px 12px 11px;
    display: flex;
    align-items: center;
    gap: 11px;
}

#emmuChordTool .egp-root-plate {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 9px 11px;
}

#emmuChordTool .egp-root-plate .egp-notation-row {
    grid-column: 1 / -1;
}

#emmuChordTool .egc-root-current {
    flex: none;
    width: 58px;
    overflow: visible;
    font-size: 34px;
    line-height: 1;
    color: var(--eat-text);
    text-align: center;
    white-space: nowrap;
}

#emmuChordTool .egc-root-pads {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px 5px;
}

#emmuChordTool .egc-root-pads.is-four-cols {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

#emmuChordTool .egc-root-pad {
    min-width: 0;
    padding: 6px 0;
    border: 0;
    border-radius: 9px;
    color: var(--eat-sound-rest-text);
    background: var(--eat-rest-grad);
    box-shadow: var(--eat-rest-shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    font-size: 14px;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
}

#emmuChordTool .egc-root-pad[aria-pressed="true"] {
    color: var(--eat-on-acc);
    background: linear-gradient(to bottom, var(--eat-acc-lit), var(--eat-acc) 58%, var(--eat-acc-dim));
    box-shadow: 0 3px 0 var(--eat-acc-side), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

#emmuChordTool #estRoot,
#emmuChordTool #estKey,
#emmuChordTool #epcRoot,
#emmuChordTool #eptKey,
#emmuChordTool #epcBass {
    display: none;
}

/* ─── コード種・オンコード ─── */

#emmuChordTool .egc-chord-plate {
    padding: 10px 12px 11px;
    display: grid;
    grid-template-columns: 116px repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 10px;
}

#emmuChordTool .egc-chord-current {
    width: 116px;
    overflow: visible;
    color: var(--eat-text);
    font-size: 34px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

/* ─── スケール名 ─── */

#emmuChordTool .egc-scale-plate {
    min-width: 0;
    padding: 10px 12px 11px;
    display: grid;
    grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1.35fr);
    align-items: center;
    gap: 12px;
}

#emmuChordTool .egc-scale-current {
    min-width: 0;
    overflow: visible;
    color: var(--eat-text);
    font-size: 26px;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
}

#emmuChordTool .est-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#emmuChordTool .egc-select-field > label,
#emmuChordTool .egc-select-label,
#emmuChordTool .egc-label {
    display: block;
    margin: 0 0 4px;
    font-size: 10.5px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0.2em;
    color: var(--eat-text3);
}

#emmuChordTool .efc-dd__field,
#emmuChordTool .egc-bass-trigger {
    position: relative;
    width: 100%;
    height: 40px;
    padding: 0 30px 0 12px;
    border: 0;
    border-radius: 11px;
    background: var(--eat-groove);
    box-shadow: inset 0 1px 2px var(--eat-groove-shadow);
    color: var(--eat-text);
    font-size: 16px;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
}

#emmuChordTool .efc-dd__field::after,
#emmuChordTool .egc-bass-trigger::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.6px solid var(--eat-text2);
    border-bottom: 1.6px solid var(--eat-text2);
    transform: translateY(-65%) rotate(45deg);
}

#emmuChordTool .efc-dd__label {
    color: var(--eat-text);
    font-family: "Zen Antique", "Hiragino Mincho ProN", "Noto Serif JP", serif;
    font-size: 16px;
    font-weight: 400;
    text-align: left;
}

#emmuChordTool #estBass {
    display: none;
}

#emmuChordTool .egc-bass-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 1px;
}

#emmuChordTool .egc-bass-panel[hidden] {
    display: none;
}

#emmuChordTool .egc-bass-pads {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px 5px;
}

#emmuChordTool .egc-bass-pad {
    min-width: 0;
    padding: 7px 0;
    border: 0;
    border-radius: 9px;
    color: var(--eat-sound-rest-text);
    background: var(--eat-rest-grad);
    box-shadow: var(--eat-rest-shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
}

#emmuChordTool .egc-bass-pad--none {
    width: 100%;
}

#emmuChordTool .egc-bass-pad[aria-pressed="true"] {
    color: var(--eat-on-acc);
    background: linear-gradient(to bottom, var(--eat-acc-lit), var(--eat-acc) 58%, var(--eat-acc-dim));
    box-shadow: 0 3px 0 var(--eat-acc-side), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* 下から出る選択シート。scrim は背面操作を防ぐ半透明の覆い。 */
#emmuChordTool .efc-dd__scrim {
    position: fixed;
    inset: 0;
    z-index: 8998;
    display: block;
    background: rgba(10, 8, 5, 0.46);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

#emmuChordTool .efc-dd__scrim[hidden] {
    display: none !important;
}

#emmuChordTool .efc-dd__menu--sheet {
    position: fixed;
    left: 50% !important;
    right: auto !important;
    top: auto;
    bottom: 0;
    z-index: 8999;
    width: min(100%, var(--eat-screen-max));
    min-width: 0;
    max-width: var(--eat-screen-max);
    max-height: min(72vh, 640px);
    margin: 0;
    padding: 0 16px 22px;
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(-50%);
    border: 1px solid var(--eat-plate-edge);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background: var(--eat-plate-solid);
    box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.28);
}

#emmuChordTool .efc-dd__sheet-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 -16px 8px;
    padding: 18px 20px 13px;
    background: var(--eat-plate-solid);
    border-bottom: 1px solid var(--eat-hair);
}

#emmuChordTool .efc-dd__sheet-title {
    font-family: "Zen Antique", "Hiragino Mincho ProN", "Noto Serif JP", serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--eat-text);
}

#emmuChordTool .efc-dd__sheet-sub {
    font-size: 12px;
    color: var(--eat-text2);
}

#emmuChordTool .efc-dd__group {
    margin: 12px 2px 4px;
    padding: 4px 8px;
    border-radius: 0;
    background: transparent;
    color: var(--eat-text3);
    font-family: "IBM Plex Mono", Menlo, Consolas, monospace;
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.16em;
}

#emmuChordTool .efc-dd__item {
    min-height: 44px;
    height: auto;
    margin: 0;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--eat-text2);
    font-size: 15px;
    line-height: 1.4;
    text-align: left;
}

#emmuChordTool .efc-dd__item:hover {
    background: color-mix(in srgb, var(--eat-acc) 10%, transparent);
}

#emmuChordTool .efc-dd__item--sel {
    background: color-mix(in srgb, var(--eat-acc) 14%, transparent);
    color: var(--eat-text);
    font-weight: 500;
}

#emmuChordTool .efc-dd__item-symbol {
    flex: none;
    width: 56px;
    font-family: "IBM Plex Mono", Menlo, Consolas, monospace;
    color: var(--eat-bronze);
}

#emmuChordTool .efc-dd__item-label {
    flex: 1;
    min-width: 0;
}

#emmuChordTool .efc-dd__item-check {
    flex: none;
    color: var(--eat-acc);
    font-weight: 700;
}

#emmuChordTool .efc-dd__sep {
    height: 1px;
    margin: 0 8px;
    background: var(--eat-hair);
}

/* ─── 指板 ─── */

#emmuChordTool .egc-board-plate {
    min-width: 0;
    padding: 11px;
}

#emmuChordTool .egc-board-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px 8px;
}

#emmuChordTool .egc-board-head .egc-label {
    margin: 0;
}

#emmuChordTool .egc-board-actions {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

#emmuChordTool .egc-small-btn,
#emmuChordTool .board-fs-btn {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 9px;
    background: var(--eat-rest-grad);
    color: var(--eat-sound-rest-text);
    box-shadow: var(--eat-rest-shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
}

#emmuChordTool .egc-small-btn svg,
#emmuChordTool .board-fs-btn__ic {
    width: 14px;
    height: 14px;
    display: block;
    fill: var(--eat-bronze);
}

#emmuChordTool .egc-save-msg {
    margin: -2px 2px 8px;
    color: var(--eat-text2);
    font-size: 12px;
    line-height: 1.6;
    text-align: right;
}

#emmuChordTool .est-board-wrap {
    width: 100%;
    margin: 0;
    padding: 0 0 5px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    scrollbar-width: thin;
    scrollbar-color: var(--eat-acc) var(--eat-groove);
}

#emmuChordTool .est-board-wrap::-webkit-scrollbar {
    height: 6px;
}

#emmuChordTool .est-board-wrap::-webkit-scrollbar-track {
    border-radius: 3px;
    background: var(--eat-groove);
    box-shadow: inset 0 1px 2px var(--eat-groove-shadow);
}

#emmuChordTool .est-board-wrap::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: linear-gradient(90deg, var(--eat-acc-lit), var(--eat-acc));
}

#emmuChordTool #estBoard,
#emmuChordTool #estBoard svg,
#emmuChordTool #epcBoard,
#emmuChordTool #epcBoard svg,
#emmuChordTool #eptBoard,
#emmuChordTool #eptBoard svg {
    width: max-content;
    max-width: none;
}

#emmuChordTool #estBoard svg,
#emmuChordTool #epcBoard svg,
#emmuChordTool #eptBoard svg {
    font-family: "IBM Plex Mono", Menlo, Consolas, monospace;
}

/* app スキンの重なり順を一時的に外し、指板を確実に画面全体の最前面へ出す。 */
body.board-fs-open.tools-guitar-chord-page #emmuChordTool,
body.board-fs-open.tools-guitar-chord-page #emmuChordTool .egc-screen,
body.board-fs-open.tools-ukulele-chord-page #emmuChordTool,
body.board-fs-open.tools-ukulele-chord-page #emmuChordTool .egc-screen,
body.board-fs-open.tools-guitar-scale-page #emmuChordTool,
body.board-fs-open.tools-guitar-scale-page #emmuChordTool .egc-screen,
body.board-fs-open.tools-bass-scale-page #emmuChordTool,
body.board-fs-open.tools-bass-scale-page #emmuChordTool .egc-screen,
body.board-fs-open.tools-ukulele-scale-page #emmuChordTool,
body.board-fs-open.tools-ukulele-scale-page #emmuChordTool .egc-screen,
body.board-fs-open.tools-piano-chord-page #emmuChordTool,
body.board-fs-open.tools-piano-chord-page #emmuChordTool .egc-screen,
body.board-fs-open.tools-piano-scale-page #emmuChordTool,
body.board-fs-open.tools-piano-scale-page #emmuChordTool .egc-screen {
    z-index: auto;
}

/* この画面の通常表示ルールより優先させるため、全画面時を明示する。 */
#emmuChordTool .est-board-wrap.is-fs {
    position: fixed;
    inset: 0;
    z-index: 9998;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: var(--est-card);
}

#emmuChordTool .est-board-wrap.is-fs #estBoard,
#emmuChordTool .est-board-wrap.is-fs #epcBoard,
#emmuChordTool .est-board-wrap.is-fs #eptBoard {
    width: auto;
    max-width: 100%;
}

#emmuChordTool .est-board-wrap.is-fs #estBoard svg,
#emmuChordTool .est-board-wrap.is-fs #epcBoard svg,
#emmuChordTool .est-board-wrap.is-fs #eptBoard svg {
    width: calc(100vw - 16px);
    height: auto;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
}

#emmuChordTool .est-board-wrap.is-fs.is-rot #estBoard,
#emmuChordTool .est-board-wrap.is-fs.is-rot #epcBoard,
#emmuChordTool .est-board-wrap.is-fs.is-rot #eptBoard {
    position: absolute;
    left: 50%;
    top: 50%;
    width: auto;
    max-width: none;
    transform: translate(-50%, -50%);
}

#emmuChordTool .est-board-wrap.is-fs.is-rot #estBoard svg,
#emmuChordTool .est-board-wrap.is-fs.is-rot #epcBoard svg,
#emmuChordTool .est-board-wrap.is-fs.is-rot #eptBoard svg {
    width: calc(100vh - 16px);
    max-width: none;
    max-height: calc(100vw - 64px);
    transform: rotate(90deg);
}

#emmuChordTool .est-hint {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

#emmuChordTool .egc-legend {
    display: flex;
    align-items: center;
    gap: 8px 14px;
    flex-wrap: wrap;
    padding: 7px 2px 0;
}

#emmuChordTool .egc-legend span {
    gap: 6px;
    color: var(--eat-text2);
    font-size: 11.5px;
}

#emmuChordTool .egc-legend .est-swatch {
    width: 16px;
    height: 16px;
}

/* ─── 表示設定・音 ─── */

#emmuChordTool .egc-operation-plate {
    padding: 10px 12px 11px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#emmuChordTool .egc-option-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 1.35fr 0.8fr 0.8fr;
    gap: 9px;
}

#emmuChordTool .egc-option-row--bass {
    grid-template-columns: 1.35fr 0.8fr 1.05fr 0.8fr;
}

#emmuChordTool .egp-option-row--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#emmuChordTool .est-seg {
    display: flex;
    gap: 4px;
    padding: 4px;
    flex-wrap: nowrap;
    border: 0;
    border-radius: 11px;
    background: var(--eat-groove);
    box-shadow: inset 0 1px 2px var(--eat-groove-shadow);
}

#emmuChordTool .est-seg button {
    flex: 1 1 0;
    min-width: 0;
    padding: 7px 5px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: var(--eat-text2);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    white-space: nowrap;
}

#emmuChordTool .est-seg button[aria-pressed="true"] {
    color: var(--eat-text);
    background: var(--eat-mold-top);
    border-bottom: 2px solid var(--eat-acc);
    box-shadow: 0 1px 2px var(--eat-mold-shadow);
}

#emmuChordTool .egc-sound-field > label {
    display: none;
}

#emmuChordTool .egc-sound-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

#emmuChordTool .egc-settings-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 66px;
    align-items: center;
    gap: 14px;
}

#emmuChordTool .egp-score-field {
    min-width: 0;
}

#emmuChordTool .egp-score-field > label {
    display: block;
    margin: 0 0 4px;
    color: var(--eat-text3);
    font-size: 10.5px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0.14em;
}

#emmuChordTool .egp-score-field .ept-sig {
    width: 100%;
    height: 96px;
    overflow: auto hidden;
    border: 1px solid var(--eat-hair);
    border-radius: 11px;
    background: #fff;
    box-shadow: inset 0 1px 2px var(--eat-groove-shadow);
}

#emmuChordTool .egp-score-field .ept-sig svg {
    width: auto;
    height: 96px;
    max-width: none;
}

/* プルダウンを開いている間は、後続の広告より画面全体を前へ出す。 */
#emmuChordTool.is-dropdown-open .egc-screen {
    z-index: 9000;
}

#emmuChordTool .egc-position-field .efc-dd {
    width: 100%;
    max-width: none;
}

#emmuChordTool .egc-volume-control {
    width: 66px;
    touch-action: none;
}

#emmuChordTool .egc-volume-head {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

#emmuChordTool .egc-volume-label {
    font-size: 11px;
    color: var(--eat-text2);
}

#emmuChordTool .egc-volume-value {
    font-size: 11.5px;
    color: var(--eat-text2);
}

#emmuChordTool .egc-volume-knob {
    display: block;
    width: 66px;
    height: 66px;
    margin-top: 5px;
    outline-offset: 2px;
}

#emmuChordTool .egc-sound-field > .est-seg {
    gap: 7px;
    padding: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

#emmuChordTool .egc-sound-field > .est-seg button {
    padding: 11px 4px;
    border: 0;
    border-radius: 11px;
    background: var(--eat-rest-grad);
    box-shadow: var(--eat-rest-shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    color: var(--eat-sound-rest-text);
    font-size: 13.5px;
}

#emmuChordTool .egc-sound-field > .est-seg #estStrum,
#emmuChordTool .egc-sound-field > .est-seg #epcStrum {
    flex: 1.2 1 0;
    color: var(--eat-on-acc);
    background: linear-gradient(to bottom, var(--eat-acc-lit), var(--eat-acc) 58%, var(--eat-acc-dim));
    box-shadow: 0 3px 0 var(--eat-acc-side), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

#emmuChordTool .egc-sound-field > .est-seg button[aria-pressed="true"] {
    transform: translateY(2px);
    border-bottom: 0;
    filter: brightness(0.96);
}

/* ─── ダイアトニックコード ─── */

#emmuChordTool .egc-diatonic-plate {
    min-width: 0;
    padding: 11px 12px 12px;
}

#emmuChordTool .egc-diatonic-plate > .egc-label {
    margin-bottom: 7px;
}

#emmuChordTool .egc-diatonic-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#emmuChordTool .egc-diatonic-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(92px, 0.65fr) minmax(112px, 0.8fr);
    align-items: stretch;
    gap: 8px;
}

#emmuChordTool .egc-diatonic-row > .efc-dd {
    min-width: 0;
}

#emmuChordTool .egc-diatonic-row .est-seg {
    min-width: 0;
}

#emmuChordTool .egc-diatonic-row .egc-strum-seg {
    padding: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

#emmuChordTool .egc-diatonic-row .egc-strum-seg button {
    color: var(--eat-on-acc);
    background: linear-gradient(to bottom, var(--eat-acc-lit), var(--eat-acc) 58%, var(--eat-acc-dim));
    box-shadow: 0 3px 0 var(--eat-acc-side), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

#emmuChordTool .egc-diatonic-row .egc-strum-seg button[aria-pressed="true"] {
    transform: translateY(2px);
    border-bottom: 0;
    filter: brightness(0.96);
}

/* ─── 説明 ─── */

#emmuChordTool .egc-about-plate {
    margin-top: 8px;
    padding: 12px 14px 13px;
}

#emmuChordTool .egc-about-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

#emmuChordTool .egc-about-head .egc-label {
    margin: 0;
}

#emmuChordTool .egc-alias {
    flex: none;
    max-width: 48%;
    overflow: hidden;
    color: var(--eat-bronze);
    font-size: 11.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#emmuChordTool .egc-summary {
    margin: 0 0 6px;
    color: var(--eat-text);
    font-size: 15px;
    line-height: 1.65;
}

#emmuChordTool .est-meta {
    margin: 0;
    color: var(--eat-mold-glyph);
    font-size: 13px;
    line-height: 1.8;
}

#emmuChordTool .est-meta b {
    color: var(--eat-text);
    font-weight: 500;
}

#emmuChordTool .egc-scale-notes {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0 0 10px;
    padding: 0;
    overflow-x: auto;
    background: transparent;
    box-shadow: none;
}

#emmuChordTool .egc-scale-notes .est-note {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

#emmuChordTool .egc-scale-notes .ept-note {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

#emmuChordTool .egc-scale-notes .est-chip {
    min-width: 30px;
    min-height: 30px;
    padding: 6px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

#emmuChordTool .egc-scale-notes .ept-chip {
    min-width: 30px;
    min-height: 30px;
    padding: 6px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

#emmuChordTool .egc-scale-notes small {
    color: var(--eat-text2);
    font-size: 10.5px;
}

#emmuChordTool .egc-legend .ept-swatch {
    width: 16px;
    height: 16px;
}

#emmuChordTool .est-foot {
    display: none;
}

/* 共通全画面ルールより詳細度を上げ、通常時だけ余白を戻す。 */
@media (max-width: 600px) {
    body.tools-page.tools-guitar-chord-page #emmuChordTool .est-board-wrap:not(.is-fs),
    body.tools-page.tools-ukulele-chord-page #emmuChordTool .est-board-wrap:not(.is-fs),
    body.tools-page.tools-guitar-scale-page #emmuChordTool .est-board-wrap:not(.is-fs),
    body.tools-page.tools-bass-scale-page #emmuChordTool .est-board-wrap:not(.is-fs),
    body.tools-page.tools-ukulele-scale-page #emmuChordTool .est-board-wrap:not(.is-fs),
    body.tools-page.tools-piano-chord-page #emmuChordTool .est-board-wrap:not(.is-fs),
    body.tools-page.tools-piano-scale-page #emmuChordTool .est-board-wrap:not(.is-fs) {
        position: relative;
        padding-top: 0;
    }
}

@media (max-width: 420px) {
    #emmuChordTool .egc-screen {
        padding-left: 12px;
        padding-right: 12px;
    }

    #emmuChordTool .egc-option-row--bass {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #emmuChordTool .egc-root-current {
        width: 52px;
        font-size: 30px;
    }

    #emmuChordTool .egc-chord-plate {
        grid-template-columns: 104px repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    #emmuChordTool .egc-chord-current {
        width: 104px;
        font-size: 30px;
    }

    #emmuChordTool .egc-scale-plate {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    #emmuChordTool .egc-scale-current {
        font-size: 23px;
        text-align: left;
    }

    #emmuChordTool .egc-diatonic-row {
        grid-template-columns: minmax(0, 1fr) 102px;
    }

    #emmuChordTool .egc-diatonic-row > .efc-dd {
        grid-column: 1 / -1;
    }

    #emmuChordTool .egc-root-pads {
        gap: 7px 4px;
    }

    #emmuChordTool .egc-root-pad {
        font-size: 13px;
    }

    #emmuChordTool .egc-bass-pad {
        font-size: 13px;
    }

    #emmuChordTool .egc-small-btn,
    #emmuChordTool .board-fs-btn {
        padding-left: 8px;
        padding-right: 8px;
    }
}

@media (max-width: 350px) {
    #emmuChordTool .egc-screen {
        padding-left: 8px;
        padding-right: 8px;
    }

    #emmuChordTool .egc-title {
        font-size: 16px;
    }

    #emmuChordTool .egc-brand {
        display: none;
    }

    #emmuChordTool .egc-root-plate {
        padding-left: 9px;
        padding-right: 9px;
        gap: 7px;
    }

    #emmuChordTool .egc-root-current {
        width: 46px;
        font-size: 27px;
    }

    #emmuChordTool .egc-chord-plate {
        grid-template-columns: 92px repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    #emmuChordTool .egc-chord-current {
        width: 92px;
        font-size: 27px;
    }

    #emmuChordTool .egc-scale-plate {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    #emmuChordTool .egc-scale-current {
        font-size: 21px;
    }

    #emmuChordTool .egc-root-pad {
        font-size: 12px;
    }

    #emmuChordTool .egc-board-head {
        align-items: flex-start;
    }

    #emmuChordTool .egc-board-actions {
        gap: 5px;
    }

    #emmuChordTool .egc-small-btn,
    #emmuChordTool .board-fs-btn {
        padding: 7px 8px;
        font-size: 12px;
    }

    #emmuChordTool .egc-option-row {
        gap: 5px;
    }

    #emmuChordTool .est-seg {
        gap: 2px;
        padding: 3px;
    }

    #emmuChordTool .est-seg button {
        padding-left: 2px;
        padding-right: 2px;
        font-size: 12px;
    }

    #emmuChordTool .egc-sound-field > .est-seg button {
        font-size: 12px;
    }

    #emmuChordTool .egc-diatonic-row {
        grid-template-columns: minmax(0, 1fr) 88px;
        gap: 6px;
    }

    #emmuChordTool .egc-settings-row {
        grid-template-columns: minmax(0, 1fr) 56px;
        gap: 8px;
    }

    #emmuChordTool .egc-volume-control,
    #emmuChordTool .egc-volume-knob {
        width: 56px;
    }

    #emmuChordTool .egc-volume-knob {
        height: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #emmuChordTool button {
        transition: none;
    }
}
