:root {
    --navy: #1f2f57;
    --red: #e00000ec;
    --line: #d9d9d9;
    --muted: #6b7280;
    --btnRadius: 999px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .18);
    --text: #111;
    --bg: #ffffff;
    --panelGray: #e5e5e5;

}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: #333;
    font-family: "Noto Sans JP", sans-serif;
    font-optical-sizing: auto;


    /* -webkit-box-sizing: border-box;

    line-height: 1.8;
    letter-spacing: 0.05em;
    font-weight: 500;
    font-style: normal;

    border: 1px solid red; */
}

a,
button,
[role="button"] {
    /* 1. デフォルトのハイライトを完全に消去 */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    /* 2. タップ時のフォーカス外枠（アクセシビリティ用）の調整 */
    outline: none;
    /* 3. ユーザー体験を損なわないための代替フィードバック */
    transition: opacity 0.2s ease;

    touch-action: manipulation;
}
/* 代替のフィードバック実装例：透明度を変化させる */
a:active {
    opacity: 0.7;
}

img {
    max-width: 100%;
}

canvas {
    display: block;
    /* border: 1px solid #000; */
    border: 1px solid #999;
    margin: auto;
    pointer-events: none;
    z-index: 1300;
    position: relative;
}

h2 {
    font-size: 18px;
    margin: 18px 0 20px;
    font-weight: 900;
}

.content {
    padding: 1rem;
    width: 96%;
    margin: auto;
}

header {
    margin-bottom: 10px;
}

header img {
    max-width: 70%;
}

header .header-title {
    font-weight: bold;
}

header .header-name {
    font-weight: bold;
    font-size: 1.5rem;
}

header .header-media {
    margin: 6px 0 10px;
    font-size: 0.9rem;
}

hr {
    width: 100vw;
    margin-left: calc(50% - 50vw);
}

.logo-box {
    margin-bottom: 6px;
}


.blocks .block {
    display: none;
}

.pattern-box label {
    display: flex;
}

.pattern-box .left-box {
    width: 50%;
    padding: 4px;
}

.pattern-box .left-box img {
    border: 1px solid #999;
}

.pattern-box .right-box {
    width: 50%;
    padding: 4px;
    display: flex;
    align-items: center;
}

.pattern-box .pattern-name-label {
    font-weight: bold;
}

.pattern-box .right-box .pattern-note {
    font-size: 0.8rem;
}

.preview-box {
    position: relative;
    margin: auto;
}

.preview-box .ruler {
    display: flex;
    align-items: center;
    font-family: monospace;
    --len: 100%;
    /* デフォルト */
}

/* .preview-box .ruler .line {
    width: var(--len);
    height: 1px;
    background: #000;
    margin: 0;
    position: relative;
    top: 0.1em;
}
.preview-box .ruler .cap {
    line-height: 1;
}

.preview-box .label {
    margin: 0 6px;
    white-space: nowrap;
}
.preview-box.wall {
    margin-top: 20px;
}
*/

.preview-options-pattern {
    z-index: 1350;
}

.preview-pattern-length-label {
    position: absolute;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.75);
    padding: 6px 10px;
    border-radius: 10px;
    display: none;
    pointer-events: none;
    top: 10px;
    left: 10px;
    font-size: 0.8rem;
}

/* .preview-pattern-length-label span {
    color: #777;
    font-size: 0.8rem;
    letter-spacing: .02em;
} */

.preview-figure {
    position: absolute;
    display: none;
    pointer-events: none;
    bottom: 0px;
    right: 10px;
    max-width: inherit;
}

.pulldown-title {
    font-weight: bold;
}


.progress-button-box {
    margin: 40px auto;
    text-align: center;
}

.progress-button-box .button {
    display: block;
    width: 100%;
    /* height: 2.5rem; */
    margin: auto;
    position: relative;

}

.progress-button-box .button.forward::after,
.progress-button-box .button.cart::after {
    content: "";
    font-size: 16px;
    line-height: 1;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;

    background-image: url("../img/forward.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left;
    filter: invert(1);
}


.progress-button-box .button.forward {
    background: var(--navy);
    color: #fff;
    margin-bottom: 10px;
}

.progress-button-box .button.cart {
    /* background: var(--red);
    color: #fff; */
    margin-bottom: 10px;
}

.progress-button-box .button.cart img {
    height: 1.5rem;
    vertical-align: middle;
    margin-right: 15px;
}

.progress-button-box .button.back {
    background: #fff;
    color: var(--navy);
    border: 2px solid var(--navy);
}

.progress-button-box .button.back::before {
    content: "";
    font-size: 20px;
    /* 大きさ */
    line-height: 1;
    /* ずれ防止 */
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;

    background-image: url("../img/back.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right;
}

#pattern-length-slider::-webkit-slider-thumb {
    box-shadow: 0 0 0 8px rgba(0, 0, 0, 0);
}

.confirm-odp-mb-note{
    font-size: 14px;
    background: #ddd;
    border-radius: 10px;
    padding: 10px;
    margin: 0 auto 20px;
    width: 80%;
}
.confirm-item {
    margin: 24px 0;
    font-size: 0.9rem;
    ;
}

.confirm-item-header {
    font-weight: bold;
    margin-bottom: 6px;
}

.confirm-note-box {
    padding: 20px;
}

.confirm-note {
    margin: 16px 0;
    font-size: 0.9rem;
    text-indent: -1em;
}

.note-modal-header {
    padding: 20px;
    text-align: center;
    color: #333;
    background: #ddd;
    font-weight: bold;
}

.note-modal-body {
    padding: 20px;
    line-height: 1.5;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}


.navy-band {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    /* padding: 12px 20px; */
    padding: 10px;
    text-align: center;
    background: var(--navy);
    color: #fff;
    font-size: 0.9rem;
}


.little-note {
    font-size: 0.9rem;
}

.large-note {
    font-size: 1.1rem;
}

.center {
    text-align: center;
}


.hidden {
    display: none;
}

.indent {
    margin-left: 1rem;
    text-indent: -1em;
}


/* ////////////////////////////////////////////////////////////// */
.miniPreview {
    width: 150px;
    height: 108px;
    border: 0;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

/* ===== 幅スライダー ===== */
.sliderCard {
    margin-top: 10px;
    border: 2px solid #111;
    padding: 14px 12px 10px;
    background: #fff;
}

.sliderTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    /* font-weight: 900; */
}

.sliderValue {
    font-size: 18px;
    font-weight: 900;
    color: #111;
}

.sliderSub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.rangeWrap {
    margin-top: 10px;
}

label{
    cursor: pointer;
}
input[type="checkbox"]{
    width: 20px;
    height: 20px;
    vertical-align: sub;
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--navy);

    height: 10px;
    border-radius: 999px;
    cursor: pointer;
}

input[type="range"].iphone {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    background: transparent;
    padding: 12px 0;
  }
  input[type="range"].iphone::-webkit-slider-runnable-track {
    height: 10px;
    background: #ddd;
    border-radius: 999px;
  }
  input[type="range"].iphone::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;

    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--navy);
    border: none;

    margin-top: -11px;
  }




.ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-weight: 900;
    font-size: 13px;
    color: #111;
    padding: 0 2px;
}

.ticks span {
    opacity: .65;
}

.ticks span.active {
    opacity: 1;
}


.price-label-box .price-label{
    font-size: 1.3rem;
    font-weight: bold;
}


/* ★ 柄未選択の時：スライダー無効＋グレー
.sliderCard.disabled {
    border-color: #cfcfcf;
    background: #f6f6f6;
}

.sliderCard.disabled .sliderTop,
.sliderCard.disabled .sliderSub,
.sliderCard.disabled .ticks {
    color: #9aa0a6;
}

.sliderCard.disabled input[type="range"] {
    filter: grayscale(1);
    opacity: .55;
    pointer-events: none;
} */



/* ===== Stepper (クリックで戻れる仕様) ===== */

/* .stepper {
    padding: 16px 18px 8px;
}

.stepLine {
    height: 2px;
    background: var(--line);
    margin: 18px 6px 12px;
}

.stepNodes {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -28px;
}

.node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 33.333%;
}

.pill {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 3px;
    border: 1px solid var(--navy);
    font-weight: 900;
    color: var(--navy);
    background: #fff;
    cursor: pointer;
    user-select: none;
}

.pill.active {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

.nodeLabel {
    font-size: 16px;
    font-weight: 900;
    color: #111;
} */

.measure-label {
    text-align: center;
    margin-bottom: -0.2rem;
    /* margin-top: 20px; */
    font-size: 0.8rem;
}

.measure-label.wall-width {
    overflow: visible;
    white-space: nowrap;
}

.measureRow {
    display: flex;
    align-items: center;
    justify-content: center;
    /* gap: 12px; */
    margin: 0 0 8px;
    color: #444;
    /* font-weight: 900; */
    font-size: 0.8rem;
}

/* .measureRow.one-panel::before,
.measureRow.one-panel::after {
    content: "|";
    color: #444;
    top: 0;
}

.measureRow.one-panel::before {
    left: 0;
} */
.measureRow.one-panel{
    border-left:1px solid #444;
    border-right:1px solid #444;
}

.measureRow.horizontal .measureLine {
    flex: 1;
    height: 1px;
    background: #444;
    margin-top: 0.8em;
    /* max-width: 160px; */
}

.measureRow.vertical {
    display: flex;
    flex-direction: column;
    position: absolute;
    z-index: 1300;
    top: 2px;
    left: -22px;
    height: 100%;
    /* background: rgba(255,255,255,0.7); */
    /* border: 2px solid #444; */
    /* border-radius: 5px; */
}

.measureRow.vertical::before,
.measureRow.vertical::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 1px;
    background: #444;
    left: 50%;
    transform: translateX(-50%);
}

.measureRow.vertical::before {
    top: 0;
    bottom: auto;
}

.measureRow.vertical::after {
    bottom: 0;
    top: auto;
}

.measureRow.vertical .measureLine {
    width: 1px;
    flex: 1;
    background: #444;
}

.measureRow.vertical .label {
    padding: 3px;
    writing-mode: sideways-lr;
    text-orientation: mixed;
}

.wall-preview-allocate {
    display: flex;
    margin: 10px 0 -12px;
}

.wall-preview-allocate div {
    border-right: 1px solid #444;
    height: 10px;
}
.wall-preview-allocate div:first-child {
    border-left: 1px solid #444;
}
/*
.content {
    padding: 6px 18px 18px;
}

h2 {
    font-size: 22px;
    margin: 18px 0 12px;
    font-weight: 900;
}

.optionList {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 6px;
}

.option {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    align-items: flex-start;
}

.radio {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #b8b8b8;
    position: relative;
}

input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.optionInner {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 12px;
    align-items: start;
}

.optionTitle {
    font-size: 20px;
    font-weight: 900;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.thumb {
    width: 210px;
    height: 140px;
    border-radius: 2px;
    border: 1px solid #e6e6e6;
    background: #f3f4f6;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.desc {
    font-size: 13px;
    line-height: 1.7;
    margin-top: 40px;
    white-space: pre-line;
    font-weight: 600;
}

.optionLabel {
    cursor: pointer;
    display: block;
}

.optionLabel[data-checked="true"] .radio {
    border-color: #111;
}

.optionLabel[data-checked="true"] .radio::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #111;
}

.measureRow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 10px 0 8px;
    color: #444;
    font-weight: 900;
    font-size: 14px;
}

.measureLine {
    flex: 1;
    height: 1px;
    background: #bdbdbd;
    max-width: 160px;
}

.previewBlock {
    margin-top: 10px;
}

.previewImg {
    width: 100%;
    display: block;
    border: 1px solid #e6e6e6;
    background: #fff;
} */

/* ===== 色選択：チップ ===== */
.colorArea {
    margin-top: 10px;
}

.chipRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 10px;
}

.chipPill {
    flex: 1;
    min-width: 0;
    height: 64px;
    border-radius: 999px;
    border: 2px solid #7a7a7a;
    background: #dfe9eb;
    position: relative;
    overflow: hidden;
    cursor: default;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
}


.paletteBtn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 10px solid rgba(255, 255, 255, .92);
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .08);
    padding: 0;
}

.iconRainbow {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: conic-gradient(#e35d5b,
            #f2c84d,
            #86c07a,
            #5aa8e6,
            #7fc7ff,
            #b56aa3,
            #e35d5b);
}

.lockBtn {
    position: absolute;
    right: 12px;
    top: 35%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    cursor: pointer;
    user-select: none;
    background: transparent;
    border: none;
    padding: 0;
}

.lockSvg {
    width: 30px;
    height: 30px;
    display: block;
}

.lockSvg .body {
    fill: #808580;
}

.lockSvg .shackle {
    stroke: #808580;
}

.lockSvg.locked .body {
    fill: #000;
}

.lockSvg.locked .shackle {
    stroke: #000;
}


.dim-palete {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* ===== グレー背景パネル（プルダウン〜シャッフル） ===== */
.tastePanel {
    margin-top: 12px;
    background: var(--panelGray);
    padding: 14px;
    border-radius: 0px;
}

/* ===== プルダウン ===== */
.selectWrap {
    border: 2px solid #111;
    background: #fff;
    position: relative;
}

.selectWrap::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #111;
    transform: translateY(-40%);
    pointer-events: none;
}

select {
    width: 100%;
    height: 56px;
    font-size: 16px;
    /* font-weight: 900; */
    padding: 0 44px 0 16px;
    border: none;
    outline: none;
    background: transparent;
    appearance: none;
}

.swapRow {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.undoRedo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.circleBtn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    /* border: 2px solid var(--navy); */
    border: none;
    /* background: #fff; */
    cursor: pointer;
    display: grid;
    place-items: center;
    user-select: none;
    padding: 0;
}

.circleBtn svg {
    width: 30px;
    height: 30px;
    fill: var(--navy);
}

.circleBtn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.btn,
.swapBtn {
    /* flex: 1;
    height: 54px;
    border-radius: var(--btnRadius);
    border: 2px solid transparent;
    background: var(--navy);
    color: #fff;
    font-size: 16px;
    cursor: pointer; */
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 241px;
    height: 50px;
    text-decoration: none;
    background-color: #002d57;
    color: #fff;
    border: 1px solid #002D57;
    border-radius: 4rem;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    padding: 0 40px;
}

.swapBtn {
    width: 250px;
    font-size: 14px;
    padding: 0;
}

/* ========= モーダルレイヤー ========= */
#loading-icon{
    z-index: 1600;
    cursor: wait;
    pointer-events: auto;
}
.dimLayer-strong,
.dimLayer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    display: none;
    z-index: 1200;
    /* プレビュー(1300)より下 */
}
.dimLayer-strong{
    z-index: 1500;
    background: rgba(255, 255, 255, .8);
    cursor: wait;
    pointer-events: auto;
}
.dimLayer {
    z-index: 1200;
}
.dimLayer-strong.open,
.dimLayer.open {
    display: block;
}

body.modal-open .colorPreviewUndim {
    position: relative;
    z-index: 1300;
    /* プレビューをDIMより上へ */
}

.modal {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, calc(100% - 24px));
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: none;

}

.modal.open {
    display: block;
}

.modal.palette,
.modal.note {
    z-index: 1400;
}

/* 最上部 */
.modal.picker {
    z-index: 1500;
}

.modalBody {
    padding: 14px 14px 10px;
    overflow: auto;
    overscroll-behavior-y: contain;
}

#pickerModal{
    overflow: hidden;
    overscroll-behavior: contain;
}
#paletteBody {
    max-height: 400px;
}

.modalFooter {
    padding: 12px 14px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid #eee;
    background: #fff;
}

.btnSmall {
    height: 44px;
    border-radius: var(--btnRadius);
    padding: 0 16px;
    border: 2px solid var(--navy);
    background: #fff;
    color: var(--navy);
    font-weight: 900;
    cursor: pointer;
    min-width: 140px;
    font-size: 14px;
}

.btnSmall.primary {
    background: var(--navy);
    color: #fff;
    border-color: transparent;
}

.paletteSection {
    padding-bottom: 14px;
}

.paletteSectionTitle {
    font-weight: 900;
    font-size: 18px;
    margin: 6px 0 10px;
}

.paletteGrid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.paletteSwatch {
    width: 100%;
    padding-top: 100%;
    border-radius: 0px;
    border: 2px solid #e5e5e5;
    background: #ccc;
    position: relative;
    cursor: pointer;
}

.paletteSwatch.selected::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 10px;
    width: 18px;
    height: 10px;
    border-left: 6px solid #111;
    border-bottom: 6px solid #111;
    transform: rotate(-45deg);
}

.paletteSwatch.selected.white::after {
    border-left: 6px solid #fff;
    border-bottom: 6px solid #fff;
}

/* ====== Picker Modal (HSL) ====== */
.pickerHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
}

.pickerTitle {
    font-weight: 900;
    /* font-size: 22px; */
    margin: 0;
}

.pickerSwatchBar {
    flex: 1;
    height: 58px;
    border-radius: 10px;
    border: 2px solid #6f6f6f;
    background: #b5a34a;
    min-width: 140px;
}

.pickerBody {
    padding: 4px 14px 8px;
    overflow: auto;
}

.hslRow {
    display: grid;
    grid-template-columns: 40px 1fr 30px 88px;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.hslLabel {
    font-weight: 900;
    /* font-size: 18px; */
}

.hslValue {
    font-weight: 900;
    /* font-size: 18px; */
    text-align: right;
    width: 100%;
}

.hslBtns {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.pmBtn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 2px solid #d0d0d0;
    background: #fff;
    font-weight: 900;
    /* font-size: 20px; */
    cursor: pointer;
    display: grid;
    place-items: center;
    line-height: 1;
}

.hslSlider {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    appearance: none;
    outline: none;
    accent-color: transparent;
}

.hslSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #fff;
    border: 2px solid #d0d0d0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
    cursor: pointer;
}

.hslSlider::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #fff;
    border: 2px solid #d0d0d0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
    cursor: pointer;
}

.sliderHue {
    background: linear-gradient(to right,
            #ff3b30, #ffcc00, #34c759, #32ade6, #007aff, #af52de, #ff3b30);
}

.sliderSat {
    background: linear-gradient(to right, #d1d5db, #22c55e);
}

.sliderLight {
    background: linear-gradient(to right, #000, #10b981, #fff);
}

.pickerFooter {
    padding: 10px 14px 14px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    border-top: 1px solid #eee;
    background: #fff;
}

.btnWide {
    flex: 1;
    height: 56px;
    border-radius: var(--btnRadius);
    font-weight: 900;
    /* font-size: 20px; */
    font-size: 14px;
    cursor: pointer;
    border: 2px solid #111;
    background: #fff;
    color: #111;
}

.btnWide.primary {
    border-color: transparent;
    background: var(--navy);
    color: #fff;
}