/* --- カラーマトリクス図のスタイル --- */
:root {
    --y-width: 4rem;   /* 左列の幅 */
    --x-width: 7rem;   /* 右列の幅 */
    --header-h: 4rem;    /* ヘッダー（横軸規格名）の高さ */
    --row-h: 6.5rem;     /* データ行（縦軸規格名とマトリクス）の高さ */
}

/* 全体コンテナ */
#chart-area {
    overflow: visible;
    background-color: #f6f6f6;
    margin: 1rem auto;
    padding: 1rem;
    border-radius: 1rem;
    font-size: 1rem;
}

#chart-area #inner {
    display: flex;
    align-items: flex-start;
}

/* --- 左側固定列 --- */
#chart-area .table-fix {
    width: var(--y-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

#chart-area .titleb.cell {
    background-color: #999;
    color: #fff;
    width: var(--y-width) !important;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: solid #fff 1px;
    box-sizing: border-box;
}

#chart-area .table-fix .titleb.cell:first-child {
    height: var(--header-h) !important;
}

#chart-area .table-fix .titleb.cell:not(:first-child) {
    height: var(--row-h) !important;
}

/* --- 右側スクロールエリア --- */
#chart-area .table-scroll-wp {
    flex-grow: 1;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ヘッダー行（As, BAs...） */
#chart-area .table-scroll-row {
    display: flex;
}

#chart-area .table-scroll-row .title.cell {
    padding: 5px;
    width: var(--x-width) !important;
    height: var(--header-h) !important;
    background-color: #ddd;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: solid #fff 1px;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* メインデータ行 */
#chart-area .main {
    display: flex;
    height: var(--row-h) !important;
}

#chart-area .main .cell {
    width: var(--x-width) !important;
    height: var(--row-h) !important;
    border: solid #fff 1px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --- セル内部の要素 --- */
#chart-area .cell-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#chart-area .color-box {
    position: relative;
    z-index: 1;
    width: 3.2rem;
    height: 3.2rem;
    display: block;
    border: 1px solid #ccc;
    cursor: pointer;
    margin: 0 !important;
}

#chart-area .cell-checkbox {
    position: absolute;
    top: 0;
    left: 0;
    width: 1.1rem;
    height: 1.1rem;
    z-index: 2;
}

#chart-area .stock-msg {
    position: absolute;
    top: calc(50% + 1.4rem);
    left: 50%;
    transform: translateX(-50%);
    display: block;
    width: 100%;
    font-size: 0.65rem;
    line-height: 1.1;
    color: #d9534f;
    text-align: center;
    margin-top: 0.4rem;
    font-weight: bold;
    white-space: normal;
    pointer-events: none;
}

#chart-area .cell.out-of-stock {
    background-color: #eee;
}

#chart-area .cell.out-of-stock .color-box {
    opacity: 0.3;
}

.clr { clear: both; }

.add-cart-all-button-wrap {
    width: 100%;
    margin: 0 auto;
}