/* ==========================================================================
   ContactWorks
   StaffWorks の UI（配色トークン・吹き出し・入力欄・絵文字・ライトボックス）を踏襲し、
   ContactWorks のブランドカラー（オレンジ／イエロー）に置き換えている。
   ========================================================================== */

.cw-app {
    --cw-bg: #f7f7f4;
    --cw-panel: #ffffff;
    --cw-line: #e4dfd5;
    --cw-field-line: #b3ab9d;
    --cw-text: #1f1b16;
    --cw-muted: #6d665c;
    /* 既定はオレンジ。管理画面の「配色」で選んだ色は、インラインの CSS 変数で上書きされる。 */
    --cw-accent: #ef6c00;
    --cw-accent-strong: #e65100;
    --cw-accent-2: #ffb300;
    --cw-accent-soft: #fff3e0;
    --cw-accent-soft-2: #fff9f0;
    --cw-accent-line: #ffcc80;
    --cw-accent-text: #bf4e00;
    --cw-subtle: #f1eee8;
    --cw-ok: #1d7a4f;
    --cw-ok-soft: #e7f5ed;
    --cw-danger: #c62f2f;
    --cw-danger-soft: #fdecec;
    --cw-radius: 14px;
    color: var(--cw-text);
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    /* 文字間は、サイトのテーマに合わせない（テーマが文字間を広げていると、フォームの文が折れやすくなるため）。 */
    letter-spacing: normal;
}

/* 見出しは、テーマが文字間と太さを直接指定していることが多いので、ここでも戻す（太さは、プラグインの本来の見た目の太字）。 */
.cw-app :is(h1, h2, h3, h4, h5, h6),
.cw-app.cw-form-wrap :is(h1, h2, h3, h4, h5, h6) {
    letter-spacing: normal;
    font-weight: 700;
}

.cw-app *,
.cw-app *::before,
.cw-app *::after,
.cw-app.cw-form-wrap *,
.cw-app.cw-form-wrap *::before,
.cw-app.cw-form-wrap *::after {
    box-sizing: border-box;
}

.cw-app [hidden],
.cw-app.cw-form-wrap [hidden] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   テーマから守る（サイトのページに置くフォームと、画面下部のボタン）
   サイトのテーマが、p・a・h2・input・button などに付けている指定を、ここで打ち消す。
   ・ここは「要素」への指定（.cw-app.cw-form-wrap p など）。クラスへの指定は、道具（tools/css-guard.php）が
     より強い書き方（.cw-app.cw-form-wrap .cw-xxx）を足すので、そちらが優先される。
   ・フォームに関わる CSS を足した・直したあとは、道具を実行する。
   -------------------------------------------------------------------------- */
.cw-app.cw-form-wrap {
    color: var(--cw-text);
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.cw-app.cw-form-wrap,
.cw-floating {
    text-align: start;
    text-transform: none;
    text-indent: 0;
    text-shadow: none;
    letter-spacing: normal;
    word-spacing: normal;
    word-break: normal;
    white-space: normal;
    font-style: normal;
    font-variant: normal;
    font-weight: 400;
    -webkit-text-size-adjust: 100%;
}

/* 文字まわり：テーマの指定ではなく、フォームの指定を引き継がせる */
.cw-app.cw-form-wrap :is(div, span, p, a, form, label, ol, ul, li, small, strong, details, summary, time, section, h1, h2, h3, h4, h5, h6, button, input, select, textarea),
.cw-floating :is(div, span, button) {
    font-family: inherit;
    font-style: inherit;
    letter-spacing: inherit;
    word-spacing: inherit;
    text-transform: inherit;
    text-indent: inherit;
    text-shadow: inherit;
    word-break: inherit;
    float: none;
}

.cw-app.cw-form-wrap :is(div, span, p, form, label, ol, ul, li, details, summary, time, section) {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    text-align: inherit;
}

.cw-app.cw-form-wrap :is(div, span, form, label, li, p) {
    font-weight: inherit;
}

/* 見出し：飾り（背景・線・記号）を付けるテーマが多い */
.cw-app.cw-form-wrap :is(h1, h2, h3, h4, h5, h6) {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: inherit;
    text-align: inherit;
}

.cw-app.cw-form-wrap :is(h1, h2, h3, h4, h5, h6, li)::before,
.cw-app.cw-form-wrap :is(h1, h2, h3, h4, h5, h6, li)::after {
    content: none;
}

.cw-app.cw-form-wrap :is(p, form, label, li) {
    padding: 0;
    border: 0;
    background: none;
}

.cw-app.cw-form-wrap :is(form, label) {
    margin: 0;
    width: auto;
}

.cw-app.cw-form-wrap p {
    margin: 0 0 1em;
}

.cw-app.cw-form-wrap a {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--cw-accent-text);
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-decoration: underline;
}

.cw-app.cw-form-wrap small {
    display: inline;
    color: inherit;
    font-size: smaller;
    line-height: inherit;
}

.cw-app.cw-form-wrap strong {
    background: none;
    color: inherit;
    font-size: inherit;
    font-weight: 700;
}

.cw-app.cw-form-wrap :is(ol, ul) {
    border: 0;
    background: none;
}

.cw-app.cw-form-wrap ol {
    list-style: decimal;
}

.cw-app.cw-form-wrap ul {
    list-style: disc;
}

.cw-app.cw-form-wrap code {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-family: monospace;
    font-size: inherit;
}

.cw-app.cw-form-wrap li {
    margin: 0;
}

.cw-app.cw-form-wrap :is(details, summary) {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

/* 入力欄・ボタン：影・高さ・幅・文字の変形を付けるテーマが多い */
.cw-app.cw-form-wrap :is(input, select, textarea, button),
.cw-floating button {
    max-width: 100%;
    height: auto;
    min-width: 0;
    box-shadow: none;
    opacity: 1;
    letter-spacing: normal;
    text-transform: none;
    text-shadow: none;
    text-indent: 0;
}

.cw-app.cw-form-wrap button,
.cw-floating button {
    margin: 0;
    width: auto;
}

.cw-app.cw-form-wrap :is(input[type="radio"], input[type="checkbox"]) {
    -webkit-appearance: auto;
    appearance: auto;
    position: static;
    top: auto;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 3px 3px 0 5px;
    padding: 0;
    border: 0;
    background: none;
}

.cw-app.cw-form-wrap img,
.cw-floating img {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    float: none;
    max-width: 100%;
}

/* 画面下部のボタンと、フォームを載せる枠（.cw-app の外にある） */
.cw-floating[data-cw-floating] {
    color: #1f1b16;
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.cw-floating *,
.cw-floating *::before,
.cw-floating *::after {
    box-sizing: border-box;
}

.cw-floating[data-cw-floating] :is(.cw-floating-modal, .cw-floating-backdrop, .cw-floating-panel) {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.cw-floating .cw-floating-btn {
    line-height: normal;
}

.cw-floating svg.cw-icon {
    width: 1.1em;
    height: 1.1em;
}

.cw-floating .cw-floating-btn :is(img, span) {
    line-height: inherit;
}

.cw-floating .cw-floating-close {
    padding: 0;
    color: #1f1b16;
    line-height: 1;
}

/* アイコンは線で描く（塗りを付けるテーマがある） */
.cw-app.cw-form-wrap svg,
.cw-floating svg {
    fill: none;
    stroke: currentColor;
}

.cw-icon,
.cw-app.cw-form-wrap .cw-icon {
    flex: 0 0 auto;
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.18em;
    pointer-events: none;
}

.cw-muted,
.cw-app.cw-form-wrap .cw-muted {
    color: var(--cw-muted);
    font-size: 0.88em;
}

/* --------------------------------------------------------------------------
   ボタン・入力
   -------------------------------------------------------------------------- */
.cw-app button,
.cw-app input,
.cw-app select,
.cw-app textarea,
.cw-app.cw-form-wrap button,
.cw-app.cw-form-wrap input,
.cw-app.cw-form-wrap select,
.cw-app.cw-form-wrap textarea {
    font: inherit;
    color: inherit;
}

.cw-app .cw-primary,
.cw-app .cw-secondary,
.cw-app.cw-form-wrap .cw-primary,
.cw-app.cw-form-wrap .cw-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 46px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid var(--cw-accent);
    background: var(--cw-accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.05s;
}

.cw-app .cw-primary:hover,
.cw-app.cw-form-wrap .cw-primary:hover {
    background: var(--cw-accent-strong);
}

.cw-app .cw-primary:active,
.cw-app.cw-form-wrap .cw-primary:active {
    transform: translateY(1px);
}

.cw-app .cw-primary:disabled,
.cw-app .cw-secondary:disabled,
.cw-app.cw-form-wrap .cw-primary:disabled,
.cw-app.cw-form-wrap .cw-secondary:disabled {
    opacity: 0.55;
    cursor: default;
}

.cw-app .cw-secondary,
.cw-app.cw-form-wrap .cw-secondary {
    background: var(--cw-panel);
    color: var(--cw-accent-text);
    border-color: var(--cw-accent-line);
}

.cw-app .cw-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--cw-muted);
    cursor: pointer;
    font-size: 22px;
}

.cw-app .cw-iconbtn:hover {
    background: var(--cw-subtle);
}

.cw-app .cw-text-link {
    border: 0;
    background: none;
    color: var(--cw-accent-text);
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cw-app input[type="text"],
.cw-app input[type="email"],
.cw-app input[type="search"],
.cw-app input[type="number"],
.cw-app input[type="tel"],
.cw-app input[type="url"],
.cw-app input[type="time"],
.cw-app input[type="date"],
.cw-app input[type="datetime-local"],
.cw-app select,
.cw-app textarea,
.cw-app.cw-form-wrap input[type="text"],
.cw-app.cw-form-wrap input[type="email"],
.cw-app.cw-form-wrap input[type="search"],
.cw-app.cw-form-wrap input[type="number"],
.cw-app.cw-form-wrap input[type="tel"],
.cw-app.cw-form-wrap input[type="url"],
.cw-app.cw-form-wrap input[type="time"],
.cw-app.cw-form-wrap input[type="date"],
.cw-app.cw-form-wrap input[type="datetime-local"],
.cw-app.cw-form-wrap select,
.cw-app.cw-form-wrap textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--cw-field-line);
    border-radius: 10px;
    background: #fff;
    margin: 0;
    font-size: 16px; /* iOS のズーム防止 */
}

.cw-app input:focus,
.cw-app select:focus,
.cw-app textarea:focus,
.cw-app.cw-form-wrap input:focus,
.cw-app.cw-form-wrap select:focus,
.cw-app.cw-form-wrap textarea:focus {
    outline: 2px solid var(--cw-accent-2);
    outline-offset: 1px;
    border-color: var(--cw-accent);
}

.cw-app .is-invalid,
.cw-app.cw-form-wrap .is-invalid {
    border-color: var(--cw-danger) !important;
    background: var(--cw-danger-soft) !important;
}

/* --------------------------------------------------------------------------
   お問い合わせフォーム
   -------------------------------------------------------------------------- */
.cw-form-wrap,
.cw-app.cw-form-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px;
    background: var(--cw-panel);
    border: 1px solid var(--cw-line);
    border-radius: 18px;
}

.cw-form-title,
.cw-app.cw-form-wrap .cw-form-title {
    margin: 0 0 8px;
    font-size: 1.35em;
    line-height: 1.4;
}

.cw-form-intro p,
.cw-app.cw-form-wrap .cw-form-intro p {
    margin: 0 0 6px;
    color: var(--cw-muted);
    font-size: 0.95em;
}

/* Turnstile（ロボット判定）は中央に置く */
.cw-turnstile,
.cw-app.cw-form-wrap .cw-turnstile {
    display: flex;
    justify-content: center;
    min-height: 65px;
}

.cw-steps,
.cw-app.cw-form-wrap .cw-steps {
    display: flex;
    align-items: stretch;
    gap: 4px;
    list-style: none;
    margin: 16px 0 20px !important;
    padding: 12px 8px;
    background: var(--cw-accent-soft-2);
    border: 1px solid var(--cw-accent-line);
    border-radius: var(--cw-radius);
}

.cw-step,
.cw-app.cw-form-wrap .cw-step {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
}

.cw-step-num,
.cw-app.cw-form-wrap .cw-step-num {
    position: absolute;
    top: -4px;
    left: calc(50% - 26px);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--cw-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cw-step-icon,
.cw-app.cw-form-wrap .cw-step-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--cw-accent-2);
    color: var(--cw-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.cw-step-text small,
.cw-app.cw-form-wrap .cw-step-text small {
    display: block;
    color: var(--cw-muted);
    font-size: 11px;
}

.cw-step-arrow,
.cw-app.cw-form-wrap .cw-step-arrow {
    display: flex;
    align-items: center;
    color: var(--cw-accent-line);
    font-size: 18px;
    padding-bottom: 18px;
}

/* 進んだステップを塗る（li は 1:ステップ1・2:矢印・3:ステップ2・4:矢印・5:ステップ3）。 */
.cw-steps .cw-step:nth-child(1) .cw-step-icon,
.cw-steps[data-step="2"] .cw-step:nth-child(3) .cw-step-icon,
.cw-steps[data-step="3"] .cw-step:nth-child(3) .cw-step-icon,
.cw-steps[data-step="3"] .cw-step:nth-child(5) .cw-step-icon,
.cw-app.cw-form-wrap .cw-steps .cw-step:nth-child(1) .cw-step-icon,
.cw-app.cw-form-wrap .cw-steps[data-step="2"] .cw-step:nth-child(3) .cw-step-icon,
.cw-app.cw-form-wrap .cw-steps[data-step="3"] .cw-step:nth-child(3) .cw-step-icon,
.cw-app.cw-form-wrap .cw-steps[data-step="3"] .cw-step:nth-child(5) .cw-step-icon {
    background: var(--cw-accent-2);
    color: #fff;
}

.cw-form,
.cw-app.cw-form-wrap .cw-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cw-field label,
.cw-field .cw-label,
.cw-app.cw-form-wrap .cw-field label,
.cw-app.cw-form-wrap .cw-field .cw-label {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 0.95em;
}

.cw-req,
.cw-opt,
.cw-app.cw-form-wrap .cw-req,
.cw-app.cw-form-wrap .cw-opt {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    vertical-align: 1px;
}

.cw-req,
.cw-app.cw-form-wrap .cw-req {
    background: var(--cw-accent);
    color: #fff;
}

.cw-opt,
.cw-app.cw-form-wrap .cw-opt {
    background: var(--cw-subtle);
    color: var(--cw-muted);
}

.cw-field-help,
.cw-app.cw-form-wrap .cw-field-help {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--cw-muted);
}

.cw-field-error,
.cw-form-message,
.cw-app.cw-form-wrap .cw-field-error,
.cw-app.cw-form-wrap .cw-form-message {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--cw-danger);
    font-weight: 700;
}

.cw-field-error:empty,
.cw-form-message:empty,
.cw-app.cw-form-wrap .cw-field-error:empty,
.cw-app.cw-form-wrap .cw-form-message:empty {
    display: none;
}

.cw-radios,
.cw-app.cw-form-wrap .cw-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cw-radio,
.cw-app.cw-form-wrap .cw-radio {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--cw-field-line);
    border-radius: 999px;
    font-weight: 400 !important;
    cursor: pointer;
}

.cw-radio:has(input:checked),
.cw-app.cw-form-wrap .cw-radio:has(input:checked) {
    border-color: var(--cw-accent);
    background: var(--cw-accent-soft);
}

.cw-hp,
.cw-app.cw-form-wrap .cw-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.cw-submit,
.cw-app.cw-form-wrap .cw-submit {
    width: 100%;
}

.cw-submit.is-loading,
.cw-app.cw-form-wrap .cw-submit.is-loading {
    opacity: 0.7;
}

.cw-form-note,
.cw-app.cw-form-wrap .cw-form-note {
    margin: 0;
    font-size: 12px;
    color: var(--cw-muted);
    text-align: center;
}

.cw-verify,
.cw-app.cw-form-wrap .cw-verify {
    text-align: center;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.cw-verify-icon,
.cw-app.cw-form-wrap .cw-verify-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.cw-verify-lead,
.cw-app.cw-form-wrap .cw-verify-lead {
    margin: 0;
    font-weight: 700;
}

.cw-code-form,
.cw-app.cw-form-wrap .cw-code-form {
    width: 100%;
    max-width: 380px;
}

.cw-code-form label,
.cw-app.cw-form-wrap .cw-code-form label {
    display: block;
    font-size: 13px;
    color: var(--cw-muted);
    margin-bottom: 6px;
}

.cw-code-row,
.cw-app.cw-form-wrap .cw-code-row {
    display: flex;
    gap: 8px;
}

.cw-code-row .cw-primary,
.cw-app.cw-form-wrap .cw-code-row .cw-primary {
    flex: 0 0 auto;
    white-space: nowrap;
}

.cw-app .cw-code-input,
.cw-app.cw-form-wrap .cw-code-input {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    font-size: 24px !important;
    letter-spacing: 0.3em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cw-verify-or,
.cw-app.cw-form-wrap .cw-verify-or {
    margin: 0;
    font-size: 13px;
    color: var(--cw-muted);
}

.cw-trouble,
.cw-app.cw-form-wrap .cw-trouble {
    margin-top: 18px;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    padding: 10px 14px;
    background: var(--cw-subtle);
    font-size: 14px;
}

.cw-trouble summary,
.cw-app.cw-form-wrap .cw-trouble summary {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 700;
    color: var(--cw-accent-text);
    list-style: none;
}

.cw-trouble summary::-webkit-details-marker,
.cw-app.cw-form-wrap .cw-trouble summary::-webkit-details-marker {
    display: none;
}

/* 開閉の三角（テーマによって、アイコンが別の行に落ちるのを防ぐため、自前で1行に並べる） */
.cw-trouble summary::before,
.cw-app.cw-form-wrap .cw-trouble summary::before {
    content: "";
    flex: 0 0 auto;
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent currentColor;
    transition: transform .15s;
}

.cw-trouble[open] summary::before,
.cw-app.cw-form-wrap .cw-trouble[open] summary::before {
    transform: rotate(90deg);
}

.cw-trouble summary svg,
.cw-app.cw-form-wrap .cw-trouble summary svg {
    flex: 0 0 auto;
    display: inline-block;
    margin: 0;
}

.cw-trouble ol,
.cw-app.cw-form-wrap .cw-trouble ol {
    margin: 10px 0 0;
    padding-left: 1.4em;
}

.cw-trouble li,
.cw-app.cw-form-wrap .cw-trouble li {
    margin-bottom: 8px;
}

.cw-domain,
.cw-app.cw-form-wrap .cw-domain {
    padding: 1px 6px;
    background: #fff;
    border: 1px solid var(--cw-line);
    border-radius: 4px;
    font-weight: 700;
    user-select: all;
}

.cw-carriers,
.cw-app.cw-form-wrap .cw-carriers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 6px;
}

.cw-carriers a,
.cw-form-enter a,
.cw-app.cw-form-wrap .cw-carriers a,
.cw-app.cw-form-wrap .cw-form-enter a {
    color: var(--cw-accent-text);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.cw-form-enter,
.cw-app.cw-form-wrap .cw-form-enter {
    text-align: center;
    margin: 16px 0 0;
    font-size: 14px;
}

.cw-powered,
.cw-app.cw-form-wrap .cw-powered {
    margin: 12px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--cw-muted);
    letter-spacing: 0.04em;
}

/* フローティングボタン */
.cw-floating {
    position: fixed;
    right: var(--cw-float-side, 16px);
    bottom: calc(var(--cw-float-bottom, 16px) + env(safe-area-inset-bottom));
    z-index: 99990;
}

/* スマホでは、設定の「スマホ」の高さを使う（空ならパソコンと同じ値が入っている） */
@media (max-width: 699px) {
    .cw-floating {
        bottom: calc(var(--cw-float-bottom-sp, var(--cw-float-bottom, 16px)) + env(safe-area-inset-bottom));
        right: 16px;
    }
    .cw-floating[data-cw-floating].is-left {
        right: auto;
        left: 16px;
    }
}

.cw-floating.is-left {
    right: auto;
    left: var(--cw-float-side, 16px);
}

/* お問い合わせフォームの上のロゴ・アイコン（設定でオンにしたときだけ） */
.cw-form-brand,
.cw-app.cw-form-wrap .cw-form-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    min-width: 0;
}

.cw-app .cw-form-brand img,
.cw-app.cw-form-wrap .cw-form-brand img {
    display: block;
    margin: 0;
    box-shadow: none;
}

.cw-app .cw-form-brand-icon,
.cw-app.cw-form-wrap .cw-form-brand-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 9px;
}

.cw-app .cw-form-brand-logo,
.cw-app.cw-form-wrap .cw-form-brand-logo {
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
    height: auto;
    max-height: 40px;
    max-width: min(240px, 70%);
    object-fit: contain;
}

.cw-form-brand-name,
.cw-app.cw-form-wrap .cw-form-brand-name {
    font-weight: 700;
    font-size: 16px;
}

.cw-app .cw-floating-btn,
.cw-floating-btn,
.cw-floating .cw-floating-btn {
    letter-spacing: normal;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px 8px 10px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #1f1b16;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
}

.cw-floating-modal,
.cw-floating .cw-floating-modal {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 99991;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.cw-floating-modal[hidden],
.cw-floating .cw-floating-modal[hidden] {
    display: none;
}

.cw-floating-backdrop,
.cw-floating .cw-floating-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.cw-floating-panel,
.cw-floating .cw-floating-panel {
    position: relative;
    width: min(640px, 100%);
    max-height: 92vh;
    /* スマホでは、アドレスバーなどを除いた「いま見えている高さ」に収める（vh だと、見えている高さより大きくなり、上がはみ出て見出しが隠れる）。上は、時計などの表示の分も空ける。 */
    max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top) - 12px));
    /* スマホでは、上の余白を 4px だけにする。iPhone の Safari は、時計などの表示の下からがページの領域なので、その分を足す必要はない（足すと、余白が二重になる）。全画面で出すページでは、env() の分が空く。 */
    max-height: calc(100dvh - env(safe-area-inset-top) - 4px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 18px 18px 0 0;
    background: #fff;
}

.cw-floating-panel .cw-form-wrap,
.cw-floating .cw-floating-panel .cw-form-wrap {
    border: 0;
    border-radius: 0;
}

.cw-floating-close,
.cw-floating .cw-floating-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

html.cw-modal-open {
    overflow: hidden;
}

@media (min-width: 700px) {
    .cw-floating-modal,
    .cw-floating .cw-floating-modal {
        align-items: center;
    }
    .cw-floating-panel,
    .cw-floating .cw-floating-panel {
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 18px;
    }
}

/* --------------------------------------------------------------------------
   専用画面の共通（お客様チャット・受信箱）
   -------------------------------------------------------------------------- */
body.cw-body {
    margin: 0;
    background: #f7f7f4;
    -webkit-text-size-adjust: 100%;
}

.cw-shell,
.cw-inbox {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--cw-bg);
    overflow: hidden;
}

.cw-shell {
    max-width: 720px;
    margin: 0 auto;
    border-left: 1px solid var(--cw-line);
    border-right: 1px solid var(--cw-line);
}

.cw-header,
.cw-appbar {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 56px;
    padding: 6px 8px 6px 14px;
    padding-top: calc(6px + env(safe-area-inset-top));
    background: var(--cw-panel);
    border-bottom: 1px solid var(--cw-line);
}

.cw-header-logo img {
    display: block;
    max-height: 36px;
    max-width: 220px;
    width: auto;
    height: auto;
}

.cw-dropdown {
    position: absolute;
    top: calc(100% - 4px);
    right: 8px;
    z-index: 50;
    min-width: 240px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.cw-dropdown a,
.cw-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--cw-text);
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.cw-dropdown a:hover,
.cw-dropdown button:hover {
    background: var(--cw-subtle);
}

.cw-dropdown-sep {
    margin: 4px 0;
    border: 0;
    border-top: 1px solid var(--cw-line);
}

.cw-dropdown .is-danger {
    color: var(--cw-danger);
}

.cw-dropdown-info {
    padding: 8px 12px 10px;
    border-bottom: 1px solid var(--cw-line);
    margin-bottom: 4px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cw-dropdown-info span {
    color: var(--cw-muted);
}

.cw-notice {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--cw-accent-soft-2);
    border-bottom: 1px solid var(--cw-line);
    font-size: 12px;
    color: var(--cw-muted);
}

.cw-status-badge {
    flex: 0 0 auto;
    padding: 1px 8px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 11px;
}

.cw-status-badge.is-open {
    background: var(--cw-ok-soft);
    color: var(--cw-ok);
}

.cw-status-badge.is-closed {
    background: var(--cw-subtle);
    color: var(--cw-muted);
}

/* --------------------------------------------------------------------------
   チャット（メッセージ一覧）
   -------------------------------------------------------------------------- */
.cw-chat {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fbf8f1;
}

.cw-chat-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px 16px;
    overscroll-behavior: contain;
}

.cw-chat-guide {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 4px auto 12px;
    max-width: 480px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--cw-muted);
    font-size: 12px;
    text-align: center;
}

.cw-message-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cw-date-sep {
    text-align: center;
    margin: 8px 0 2px;
}

.cw-date-sep span {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    color: #5c5549;
    font-size: 11px;
}

.cw-msg {
    display: flex;
    flex-direction: column;
    max-width: 82%;
}

.cw-msg.is-other {
    align-self: flex-start;
}

.cw-msg.is-mine {
    align-self: flex-end;
    align-items: flex-end;
    margin-right: 10px;
}

.cw-msg-name {
    font-size: 12px;
    color: var(--cw-muted);
    margin: 0 0 2px 12px;
}

.cw-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.cw-msg.is-mine .cw-msg-row {
    flex-direction: row-reverse;
}

.cw-bubble {
    position: relative;
    margin-left: 10px;
    padding: 7px 11px;
    border: 1px solid var(--cw-line);
    border-radius: 16px;
    background: var(--cw-panel);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    min-width: 0;
}

.cw-msg.is-mine .cw-bubble {
    margin-left: 0;
    background: var(--cw-accent-soft);
    border-color: var(--cw-accent-line);
}

/* 吹き出しのしっぽ（StaffWorks と同じ作り） */
.cw-bubble::before,
.cw-bubble::after {
    content: "";
    position: absolute;
    top: 10px;
    width: 0;
    height: 0;
    border-style: solid;
}

.cw-msg.is-other .cw-bubble::before {
    left: -9px;
    border-width: 7px 9px 7px 0;
    border-color: transparent var(--cw-line) transparent transparent;
}

.cw-msg.is-other .cw-bubble::after {
    left: -7px;
    border-width: 6px 8px 6px 0;
    border-color: transparent var(--cw-panel) transparent transparent;
}

.cw-msg.is-mine .cw-bubble::before {
    right: -9px;
    border-width: 7px 0 7px 9px;
    border-color: transparent transparent transparent var(--cw-accent-line);
}

.cw-msg.is-mine .cw-bubble::after {
    right: -7px;
    border-width: 6px 0 6px 8px;
    border-color: transparent transparent transparent var(--cw-accent-soft);
}

.cw-msg-body {
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.55;
}

.cw-msg-body a {
    color: var(--cw-accent-text);
}

.cw-msg-body.is-retracted {
    color: var(--cw-muted);
    font-style: italic;
    font-size: 0.9em;
}

.cw-msg-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 10px;
    color: var(--cw-muted);
    line-height: 1.3;
    flex: 0 0 auto;
}

.cw-msg.is-other .cw-msg-meta {
    align-items: flex-start;
}

.cw-read {
    color: var(--cw-accent-text);
    font-weight: 700;
}

.cw-quote {
    display: flex;
    flex-direction: column;
    margin: 2px 0 5px;
    padding: 3px 8px;
    border-left: 3px solid var(--cw-accent);
    background: rgba(0, 0, 0, 0.04);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.cw-quote-name {
    font-weight: 700;
    color: var(--cw-accent-text);
}

.cw-quote-text {
    color: var(--cw-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.cw-photo {
    display: block;
    margin: 2px 0 4px;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
}

.cw-photo img {
    display: block;
    max-width: min(240px, 62vw);
    max-height: 280px;
    width: auto;
    height: auto;
}

img.cw-emoji {
    width: 1.3em;
    height: 1.3em;
    margin: 0 0.05em;
    vertical-align: -0.25em;
    display: inline-block;
}

.cw-msg.is-flash .cw-bubble,
.cw-inquiry-card.is-flash {
    animation: cw-flash 1.6s ease;
}

@keyframes cw-flash {
    0%, 60% { box-shadow: 0 0 0 4px var(--cw-accent-line); }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* システムメッセージ・自動応答 */
.cw-sys {
    align-self: center;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    max-width: 92%;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    color: #4f493f;
    font-size: 12.5px;
    line-height: 1.5;
}

.cw-sys .cw-icon {
    margin-top: 2px;
}

.cw-sys time {
    flex: 0 0 auto;
    color: var(--cw-muted);
    font-size: 10px;
    margin-top: 2px;
}

.cw-sys em {
    flex: 0 0 auto;
    font-style: normal;
    font-size: 10px;
    padding: 0 6px;
    border-radius: 999px;
    background: #fff;
    color: var(--cw-muted);
    margin-top: 2px;
}

.cw-sys.is-auto {
    background: var(--cw-accent-soft-2);
    border: 1px dashed var(--cw-accent-line);
}

.cw-sys.is-staffonly {
    background: #eef1f5;
}

/* 区切りカード（新しいお問い合わせ） */
.cw-inquiry-card {
    align-self: stretch;
    margin: 6px 0;
    padding: 10px 14px 8px;
    background: #fff;
    border: 1px solid var(--cw-accent-line);
    border-left: 5px solid var(--cw-accent-2);
    border-radius: 12px;
    -webkit-touch-callout: none;
    user-select: none;
}

.cw-inquiry-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--cw-accent-text);
    font-size: 14px;
}

.cw-inquiry-card-name {
    font-size: 13px;
    font-weight: 700;
    margin-top: 2px;
}

/* 入力内容：押すと開く。文字は本文と同じ大きさ（小さい文字にしない）。 */
.cw-card-details {
    margin: 6px 0 2px;
    border-radius: 10px;
    background: var(--cw-accent-soft-2);
}

.cw-card-details > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    font-weight: 700;
    color: var(--cw-accent-text);
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}

.cw-card-details > summary::-webkit-details-marker {
    display: none;
}

.cw-card-details > summary svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    transition: transform 0.15s;
}

.cw-card-details[open] > summary svg {
    transform: rotate(90deg);
}

.cw-card-fields {
    margin: 0;
    padding: 0 12px 6px;
}

.cw-card-field {
    padding: 8px 0;
    border-top: 1px solid var(--cw-accent-line);
    line-height: 1.5;
}

.cw-card-field dt {
    font-size: 0.85em;
    font-weight: 700;
    color: var(--cw-muted);
}

.cw-card-field dd {
    margin: 0;
    word-break: break-word;
}

.cw-inquiry-card-body {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--cw-line);
    word-break: break-word;
    line-height: 1.6;
}

.cw-inquiry-card .cw-msg-meta {
    flex-direction: row;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}

.cw-more {
    text-align: center;
    padding: 4px 0 8px;
}

.cw-chat-jump {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--cw-line);
    background: #fff;
    color: var(--cw-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 5;
}

/* --------------------------------------------------------------------------
   入力欄（LINE 風。StaffWorks と同じ構成）
   -------------------------------------------------------------------------- */
.cw-composer-wrap {
    flex: 0 0 auto;
    background: var(--cw-panel);
    border-top: 1px solid var(--cw-line);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}

.cw-composer {
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.cw-app .cw-compose-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 46px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cw-muted);
    font-size: 25px;
    cursor: pointer;
    border-radius: 10px;
}

.cw-app .cw-compose-icon.is-active {
    color: var(--cw-accent);
    background: var(--cw-accent-soft);
}

.cw-composer.is-active .cw-compose-icon:not([data-cw-canned-btn]):not([data-cw-menu-btn]) {
    display: none;
}

.cw-compose-field {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    min-width: 0;
}

.cw-app .cw-compose-field textarea {
    min-height: 46px;
    max-height: 140px;
    resize: none;
    padding: 11px 40px 11px 14px;
    border-radius: 23px;
    line-height: 1.4;
    overflow-y: auto;
}

.cw-app .cw-compose-emoji {
    position: absolute;
    right: 6px;
    bottom: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cw-muted);
    font-size: 23px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cw-app .cw-send {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 0;
    background: var(--cw-accent);
    color: #fff;
    font-size: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cw-app .cw-send:disabled {
    opacity: 0.5;
}

.cw-compose-status {
    margin: 4px 6px 0;
    font-size: 12px;
    color: var(--cw-muted);
}

.cw-compose-status:empty {
    display: none;
}

.cw-compose-status.is-error {
    color: var(--cw-danger);
    font-weight: 700;
}

.cw-compose-attach {
    margin: 0 4px 8px;
}

.cw-attach-item {
    position: relative;
    display: inline-block;
}

.cw-attach-item img {
    display: block;
    max-width: 120px;
    max-height: 120px;
    border-radius: 10px;
    border: 1px solid var(--cw-line);
}

.cw-app .cw-attach-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 0;
    background: #333;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cw-reply-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 4px 8px;
    padding: 4px 4px 4px 10px;
    border-left: 3px solid var(--cw-accent);
    background: var(--cw-subtle);
    border-radius: 6px;
    font-size: 13px;
}

.cw-reply-bar span {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-reply-bar .cw-iconbtn {
    width: 30px;
    height: 30px;
    font-size: 16px;
}

.cw-blocked-note {
    margin: 4px;
    text-align: center;
    color: var(--cw-muted);
    font-size: 14px;
}

/* リッチメニュー（タイル形式） */
/* ボタンメニューを開く・閉じる帯（入力欄の上に、いつも出す） */
.cw-app .cw-menustrip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    /* ボタンの形にはしない（下のボタンと見分けが付くように）。入力欄のまわりの余白を打ち消して、画面の端から端までの帯にする。 */
    width: calc(100% + 16px);
    min-height: 30px;
    margin: -8px -8px 8px;
    padding: 4px 12px;
    border: 0;
    border-bottom: 1px solid var(--cw-line);
    border-radius: 0;
    background: var(--cw-accent-soft-2);
    color: var(--cw-accent-text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.cw-app .cw-menustrip svg {
    width: 14px;
    height: 14px;
    transition: transform .15s;
}

.cw-app .cw-menustrip.is-active svg {
    transform: rotate(180deg);
}

/* ボタンは、外の枠で囲まない（枠の分だけ、場所を取るため）。ボタンは小さめにして、アイコンと文字を横に並べる。 */
.cw-richmenu {
    --cw-menu-cols: 2;
    display: grid;
    grid-template-columns: repeat(var(--cw-menu-cols), 1fr);
    gap: 6px;
    margin: 0 0 8px;
}

.cw-app .cw-tile {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 44px;
    padding: 5px 8px;
    border: 1px solid var(--cw-line);
    border-radius: 10px;
    background: #fff;
    color: var(--cw-text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

/* 1行に3つ以上並ぶ、幅の狭いボタンは、アイコンの下に文字を置く（横に並べると、文字が入らないため）。 */
.cw-app .cw-tile.is-narrow {
    flex-direction: column;
    gap: 1px;
    min-height: 50px;
    padding: 4px 4px;
    font-size: 13px;
}

/* 横に並べると文字が折れるボタンは、アイコンの下に文字を置く（画面の幅に合わせて、JS の CW.tileFit が付ける）。 */
.cw-app .cw-tile.is-stack {
    flex-direction: column;
    gap: 1px;
    min-height: 50px;
    padding: 4px 4px;
}

/* 文字が長いボタンは、文字を少し小さくする（ボタンの中で、なるべく折れないように。12px より小さくはしない）。 */
.cw-app .cw-tile.is-len2 {
    font-size: 13px;
}

.cw-app .cw-tile.is-len3,
.cw-app .cw-tile.is-narrow.is-len2 {
    font-size: 12px;
}

.cw-app .cw-tile:active {
    background: var(--cw-accent-soft);
}

.cw-tile-icon {
    flex: 0 0 auto;
    color: var(--cw-accent);
    font-size: 20px;
    display: flex;
}

.cw-tile-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.cw-tile-label {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: center;
}

/* 絵文字ピッカー（StaffWorks と同じ構成） */
.cw-emoji-picker {
    position: fixed;
    left: 50%;
    bottom: calc(76px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(360px, calc(100vw - 16px));
    z-index: 120;
    background: #fff;
    border: 1px solid var(--cw-line);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.cw-emoji-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 4px 2px 12px;
    font-size: 13px;
    font-weight: 700;
    border-bottom: 1px solid var(--cw-line);
}

.cw-emoji-tabs {
    display: flex;
    gap: 2px;
    padding: 4px;
    border-bottom: 1px solid var(--cw-line);
    overflow-x: auto;
}

.cw-app .cw-emoji-tab,
.cw-app .cw-emoji-cell {
    border: 0;
    background: transparent;
    padding: 4px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1;
}

.cw-emoji-tab.is-active {
    background: var(--cw-accent-soft) !important;
}

.cw-emoji-grid {
    display: none;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.cw-emoji-grid.is-active {
    display: grid;
}

.cw-emoji-cell img,
.cw-emoji-tab img {
    width: 26px;
    height: 26px;
}

/* ライトボックス */
.cw-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cw-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.cw-lightbox-img {
    position: relative;
    max-width: 94vw;
    max-height: 84vh;
    border-radius: 8px;
}

.cw-lightbox-close,
.cw-lightbox-download {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #222;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.cw-lightbox-close {
    right: 12px;
    font-size: 20px;
    padding: 8px;
}

.cw-lightbox-download {
    right: 64px;
}

/* 長押しメニュー */
.cw-sheet {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* 担当と参加者を決める画面（下から開く） */
.cw-app .cw-staffsheet-box {
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}

.cw-staffsheet-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
}

.cw-staffsheet-help {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--cw-muted);
}

.cw-staffsheet-list {
    max-height: 50vh;
    overflow-y: auto;
    border-top: 1px solid var(--cw-line);
}

.cw-staffsheet-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    border-bottom: 1px solid var(--cw-line);
}

.cw-staffsheet-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 15px;
    cursor: pointer;
}

.cw-staffsheet-join {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
    font-size: 13px;
    color: var(--cw-muted);
    cursor: pointer;
}

.cw-staffsheet-acts {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.cw-staffsheet-acts > button {
    flex: 1 1 0;
}

.cw-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.cw-sheet-box {
    position: relative;
    width: min(420px, 100%);
    margin: 0 8px calc(8px + env(safe-area-inset-bottom));
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cw-app .cw-sheet-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    border: 0;
    border-bottom: 1px solid var(--cw-line);
    background: #fff;
    color: #1f1b16;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
}

.cw-app .cw-sheet-item.is-danger {
    color: var(--cw-danger);
}

.cw-app .cw-sheet-item.is-cancel {
    justify-content: center;
    font-weight: 700;
    border-bottom: 0;
}

/* --------------------------------------------------------------------------
   お客様：入口・期限切れ
   -------------------------------------------------------------------------- */
.cw-entry {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}

.cw-card {
    max-width: 520px;
    margin: 0 auto 16px;
    padding: 22px 20px;
    background: #fff;
    border: 1px solid var(--cw-line);
    border-radius: 18px;
    text-align: center;
}

.cw-card h1 {
    font-size: 1.2em;
    margin: 10px 0 8px;
    line-height: 1.4;
}

.cw-card p {
    color: var(--cw-muted);
    font-size: 14px;
    margin: 0 0 14px;
}

.cw-card .cw-form,
.cw-card .cw-trouble {
    text-align: left;
}

.cw-card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.cw-card-warn .cw-card-icon {
    background: var(--cw-subtle);
    color: var(--cw-muted);
}

/* --------------------------------------------------------------------------
   運営者：受信箱
   -------------------------------------------------------------------------- */
.cw-appbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cw-appbar-brand img {
    flex: 0 0 auto;
    border-radius: 8px;
}

/* 設定したロゴ（店名の文字の代わりに出す） */
.cw-appbar-brand img.cw-appbar-logo {
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
    height: auto;
    max-height: 32px;
    max-width: min(200px, 42vw);
    object-fit: contain;
    border-radius: 0;
}

.cw-appbar-brand [hidden] {
    display: none;
}

.cw-appbar-title {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cw-appbar-actions {
    display: flex;
    align-items: center;
}

.cw-app .cw-iconbtn.is-on {
    color: var(--cw-accent);
}

.cw-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.cw-inbox-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
}

.cw-roomlist-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--cw-panel);
    border-right: 1px solid var(--cw-line);
}

.cw-roomlist-tools {
    padding: 10px;
    border-bottom: 1px solid var(--cw-line);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cw-search {
    position: relative;
    display: flex;
    align-items: center;
}

.cw-search > .cw-icon {
    position: absolute;
    left: 12px;
    color: var(--cw-muted);
}

.cw-app .cw-search input {
    padding-left: 36px;
    min-height: 40px;
    border-radius: 999px;
    background: var(--cw-subtle);
    border-color: transparent;
}

.cw-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

.cw-app .cw-chip {
    flex: 0 0 auto;
    padding: 5px 14px;
    border: 1px solid var(--cw-line);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

.cw-app .cw-chip.is-active {
    background: var(--cw-accent);
    border-color: var(--cw-accent);
    color: #fff;
    font-weight: 700;
}

.cw-roomlist {
    flex: 1 1 auto;
    overflow-y: auto;
}

.cw-app .cw-roomitem {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--cw-line);
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.cw-app .cw-roomitem:hover {
    background: var(--cw-accent-soft-2);
}

.cw-app .cw-roomitem.is-active {
    background: var(--cw-accent-soft);
}

/* 未読の行は左端の細い線で示す（頭文字の丸いアイコンは廃止：意味を持たず、スマホで幅を取るため） */
.cw-app .cw-roomitem.is-unread {
    box-shadow: inset 4px 0 0 var(--cw-accent);
}

.cw-roomitem-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cw-roomitem-top,
.cw-roomitem-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cw-roomitem-top strong {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-roomitem-top time {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--cw-muted);
}

.cw-roomitem-preview {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: var(--cw-muted);
}

.cw-roomitem.is-unread .cw-roomitem-preview {
    color: var(--cw-text);
    font-weight: 700;
}

.cw-tag {
    flex: 0 0 auto;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.cw-tag.is-closed {
    background: var(--cw-ok-soft);
    color: var(--cw-ok);
}

.cw-tag.is-blocked {
    background: var(--cw-danger-soft);
    color: var(--cw-danger);
}

.cw-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--cw-muted);
    font-size: 14px;
}

.cw-empty .cw-icon {
    font-size: 40px;
    opacity: 0.5;
}

.cw-room-pane {
    position: relative;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.cw-room-empty {
    margin: auto;
    text-align: center;
    color: var(--cw-muted);
    padding: 20px;
}

.cw-room-empty-icon {
    font-size: 56px;
    color: var(--cw-accent-line);
}

.cw-room {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.cw-room-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #fff;
    border-bottom: 1px solid var(--cw-line);
}

.cw-room-back {
    display: none !important;
}

.cw-room-who {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    padding-left: 6px;
}

.cw-room-who strong,
.cw-room-who span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-app .cw-status-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--cw-accent-line);
    background: var(--cw-accent-soft);
    color: var(--cw-accent-text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.cw-app .cw-status-toggle.is-closed {
    border-color: #a8d8bf;
    background: var(--cw-ok-soft);
    color: var(--cw-ok);
}

.cw-room-blocked {
    padding: 6px 12px;
    background: var(--cw-danger-soft);
    color: var(--cw-danger);
    font-size: 13px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.cw-canned {
    max-height: 40vh;
    overflow-y: auto;
    margin: 0 0 8px;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    background: #fff;
}

.cw-canned-head {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--cw-muted);
    border-bottom: 1px solid var(--cw-line);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cw-app .cw-canned-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--cw-line);
    background: #fff;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
}

.cw-app .cw-canned-item:hover {
    background: var(--cw-accent-soft-2);
}

.cw-canned-item span {
    color: var(--cw-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* モーダル */
.cw-modal {
    position: fixed;
    inset: 0;
    z-index: 180; /* 設定画面（150）の上にも出せるように */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cw-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.cw-modal-box {
    position: relative;
    width: min(520px, 100%);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
}

.cw-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 6px 6px 16px;
    border-bottom: 1px solid var(--cw-line);
}

.cw-modal-head h2 {
    margin: 0;
    font-size: 16px;
}

.cw-modal-body {
    padding: 14px 16px 18px;
    overflow-y: auto;
    font-size: 14px;
}

.cw-modal-body p {
    margin: 0 0 12px;
}

.cw-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    margin: 0 0 12px;
}

.cw-info dt {
    color: var(--cw-muted);
}

.cw-info dd {
    margin: 0;
    word-break: break-all;
}

.cw-subhead {
    font-size: 14px;
    margin: 12px 0 6px;
}

.cw-history,
.cw-guide {
    margin: 0 0 12px;
    padding-left: 1.3em;
}

.cw-guide li {
    margin-bottom: 8px;
}

.cw-note {
    padding: 8px 12px;
    background: var(--cw-accent-soft);
    border-radius: 8px;
}

.cw-merge-list {
    margin-top: 10px;
    border: 1px solid var(--cw-line);
    border-radius: 10px;
    max-height: 40vh;
    overflow-y: auto;
}

.cw-loading {
    display: flex;
    justify-content: center;
    padding: 30px;
}

.cw-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--cw-line);
    border-top-color: var(--cw-accent);
    border-radius: 50%;
    animation: cw-spin 0.8s linear infinite;
}

@keyframes cw-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 860px) {
    .cw-inbox-body {
        grid-template-columns: minmax(0, 1fr);
    }
    .cw-room-pane {
        display: none;
    }
    .cw-inbox-body.is-room-open .cw-roomlist-pane {
        display: none;
    }
    .cw-inbox-body.is-room-open .cw-room-pane {
        display: flex;
    }
    .cw-room-back {
        display: inline-flex !important;
    }
}

@media (max-width: 480px) {
    .cw-form-wrap,
    .cw-app.cw-form-wrap {
        padding: 16px 14px;
        border-radius: 14px;
    }
    .cw-shell {
        border: 0;
    }
}

/* ご利用の流れ：狭い幅（スマホ・狭いカラム）では縦に並べる */
.cw-form-wrap,
.cw-app.cw-form-wrap {
    container-type: inline-size;
}

@container (max-width: 520px) {
    .cw-steps,
    .cw-app.cw-form-wrap .cw-steps {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 10px 14px;
    }
    .cw-step,
    .cw-app.cw-form-wrap .cw-step {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 12px;
        font-size: 14px;
    }
    .cw-step-num,
    .cw-app.cw-form-wrap .cw-step-num {
        top: -2px;
        left: -4px;
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
    .cw-step-icon,
    .cw-app.cw-form-wrap .cw-step-icon {
        flex: 0 0 auto;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .cw-step-text small,
    .cw-app.cw-form-wrap .cw-step-text small {
        display: inline;
        margin-left: 2px;
    }
    .cw-step-arrow,
    .cw-app.cw-form-wrap .cw-step-arrow {
        justify-content: flex-start;
        padding: 0 0 0 11px;
        height: 16px;
        font-size: 16px;
        transform: none;
    }
    .cw-step-arrow .cw-icon,
    .cw-app.cw-form-wrap .cw-step-arrow .cw-icon {
        transform: rotate(90deg);
    }
}

/* --------------------------------------------------------------------------
   受信箱：スマホ通知の案内バー・個人設定
   -------------------------------------------------------------------------- */
.cw-alert-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fdecea;
    border-bottom: 1px solid #f5b5ae;
    color: #8a1c13;
    font-size: 14px;
    line-height: 1.5;
}

.cw-alert-banner-icon {
    display: flex;
    font-size: 20px;
}

.cw-alert-banner-text {
    flex: 1 1 auto;
    min-width: 0;
}

.cw-app .cw-alert-banner-btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 14px;
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none;
}

@media (max-width: 699px) {
    .cw-alert-banner {
        flex-wrap: wrap;
    }
}

/* メールの送信記録（部屋ごと・確認待ちの1件ごと） */
.cw-maillog {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.cw-maillog li {
    padding: 8px 0 8px 12px;
    border-bottom: 1px solid var(--cw-line);
    border-left: 3px solid var(--cw-ok);
    margin-bottom: 4px;
}

.cw-maillog li.is-ng {
    border-left-color: var(--cw-danger);
}

.cw-maillog-main,
.cw-maillog-sub {
    display: block;
    overflow-wrap: anywhere;
}

.cw-maillog-sub {
    font-size: 12px;
    color: var(--cw-muted);
}

.cw-maillog .is-ng .cw-maillog-sub {
    color: var(--cw-danger);
}

.cw-pend-mailhead {
    margin: 12px 0 4px;
    font-size: 13px;
    font-weight: 700;
}

/* メンバー（同僚など）の一覧と、表示するチャットの切り替え */
.cw-member-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.cw-member-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--cw-line);
}

.cw-member-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-wrap: anywhere;
}

.cw-member-main .cw-muted {
    font-size: 12px;
}

.cw-member-title {
    margin: 4px 0 8px;
    font-weight: 700;
}

.cw-member-form .cw-form-message.is-ok {
    color: var(--cw-ok);
}

.cw-member-add > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    font-weight: 700;
    color: var(--cw-accent-text);
    cursor: pointer;
    list-style: none;
}

.cw-member-add > summary::-webkit-details-marker {
    display: none;
}

.cw-roombar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--cw-line);
    background: #fff;
    font-size: 13px;
}

.cw-roombar > span {
    flex: 0 0 auto;
    color: var(--cw-muted);
}

.cw-roombar select {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 36px;
    padding: 4px 8px;
    font-size: 14px;
}

.cw-set-daterow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.cw-set-daterow input[type="date"] {
    width: auto;
    flex: 0 1 170px;
}

.cw-set-daterow > span {
    font-size: 13px;
    color: var(--cw-muted);
}

.cw-set-doc {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.cw-set-doc-name {
    flex: 1 1 160px;
    min-width: 0;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.cw-sys-file {
    display: flex;
    justify-content: center;
    margin: 4px 0 10px;
}

.cw-sys-file .cw-filecard {
    max-width: min(420px, 100%);
}

.cw-filecard-warn {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.5;
    color: var(--cw-muted);
}

.cw-set-pre {
    margin: 0 0 10px;
    padding: 12px;
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--cw-line);
    border-radius: 10px;
    background: rgba(0, 0, 0, .03);
    font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre;
}

.cw-set-log-ref {
    display: inline-block;
    margin-left: 6px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .06);
    font-size: 11px;
    white-space: nowrap;
}

.cw-push-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 14px;
    background: var(--cw-accent-soft);
    border-bottom: 1px solid var(--cw-accent-line);
    font-size: 14px;
    line-height: 1.5;
}

.cw-push-banner-icon {
    color: var(--cw-accent);
    font-size: 20px;
    display: flex;
}

.cw-push-banner-text {
    flex: 1 1 auto;
    min-width: 0;
}

.cw-app .cw-push-banner-on {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 14px;
    font-size: 14px;
    white-space: nowrap;
}

.cw-prefs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cw-pref-card {
    padding: 12px 14px;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    background: var(--cw-panel);
}

.cw-pref-card h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    font-size: 15px;
}

.cw-pref-card h3 .cw-icon {
    color: var(--cw-accent);
}

.cw-pref-card .cw-muted {
    margin: 6px 0 0;
}

.cw-pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.cw-app .cw-pref-row select {
    width: auto;
    min-width: 140px;
}

.cw-app .cw-pref-row .cw-primary,
.cw-app .cw-pref-row .cw-secondary,
.cw-app.cw-form-wrap .cw-pref-row .cw-primary,
.cw-app.cw-form-wrap .cw-pref-row .cw-secondary {
    min-height: 38px;
    padding: 6px 16px;
}

.cw-pref-state {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: var(--cw-muted);
}

.cw-pref-state.is-on {
    color: var(--cw-ok);
}

.cw-pref-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.cw-pref-actions {
    display: flex;
    justify-content: flex-end;
}

.cw-pref-admin {
    margin: 0;
    text-align: center;
    font-size: 14px;
}

.cw-pref-admin a {
    color: var(--cw-accent-text);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cw-prefs .cw-form-message {
    color: var(--cw-ok);
    text-align: center;
    margin: 0;
}

.cw-prefs .cw-form-message.is-error {
    color: var(--cw-danger);
}

/* ==========================================================================
   設定画面（受信箱アプリ内・管理者のみ）
   スマホ：項目の一覧 → 各項目。PC：左に項目・右に内容の2ペイン。
   ========================================================================== */
.cw-settings {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cw-settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.cw-settings-box {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--cw-bg);
    overflow: hidden;
}

.cw-settings-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 6px calc(6px) 6px;
    padding-top: calc(6px + env(safe-area-inset-top));
    background: var(--cw-panel);
    border-bottom: 1px solid var(--cw-line);
}

.cw-settings-bar h2 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 17px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cw-settings-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}

.cw-settings-nav {
    flex: 1 1 auto;
    min-width: 0;
    overflow-y: auto;
    background: var(--cw-panel);
    padding-bottom: env(safe-area-inset-bottom);
}

.cw-settings-pane {
    flex: 1 1 auto;
    min-width: 0;
    display: none;
    container-type: inline-size;
}

.cw-settings.is-detail .cw-settings-nav {
    display: none;
}

.cw-settings.is-detail .cw-settings-pane {
    display: block;
}

.cw-app .cw-settings-navitem {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--cw-line);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.cw-app .cw-settings-navitem:hover,
.cw-app .cw-settings-navitem.is-active {
    background: var(--cw-accent-soft-2);
}

.cw-settings-navicon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.cw-settings-navtext {
    flex: 1 1 auto;
    min-width: 0;
}

.cw-settings-navtext strong {
    display: block;
    font-size: 15px;
    line-height: 1.4;
}

.cw-settings-navitem.is-dirty .cw-settings-navtext strong::after {
    content: "●";
    margin-left: 6px;
    color: var(--cw-accent);
    font-size: 10px;
    vertical-align: 2px;
}

.cw-settings-navtext small {
    display: block;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--cw-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cw-settings-navtext small.is-ok { color: var(--cw-ok); }
.cw-settings-navtext small.is-warn { color: #a86400; }
.cw-settings-navtext small.is-ng { color: var(--cw-danger); font-weight: 700; }

.cw-settings-navarrow {
    color: var(--cw-muted);
}

/* 各項目 */
.cw-set-section {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.cw-set-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
}

.cw-set-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: var(--cw-panel);
    border-top: 1px solid var(--cw-line);
}

.cw-set-footer .cw-set-message {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.cw-set-card {
    margin: 0 0 12px;
    padding: 14px 16px;
    background: var(--cw-panel);
    border: 1px solid var(--cw-line);
    border-radius: 14px;
}

.cw-set-card > :last-child {
    margin-bottom: 0;
}

.cw-set-card h3 {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.4;
}

.cw-set-field {
    display: block;
    margin: 0 0 12px;
    min-width: 0;
}

.cw-set-label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
}

.cw-set-help {
    display: block;
    margin: 4px 0 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--cw-muted);
}

p.cw-set-help {
    margin: 0 0 10px;
}

.cw-set-code,
.cw-set-help code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    background: var(--cw-subtle);
    padding: 1px 6px;
    border-radius: 6px;
    word-break: break-all;
}

.cw-settings input[type="tel"],
.cw-settings input[type="password"],
.cw-settings input[type="time"],
.cw-settings input[type="url"] {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--cw-field-line);
    border-radius: 10px;
    background: #fff;
    margin: 0;
    font-size: 16px;
}

.cw-settings input[type="color"] {
    width: 64px;
    height: 44px;
    padding: 3px;
    border: 1px solid var(--cw-field-line);
    border-radius: 10px;
    background: #fff;
}

.cw-settings input[type="checkbox"]:not(.cw-switch),
.cw-settings input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--cw-accent);
    flex: 0 0 auto;
}

.cw-set-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0 14px;
}

.cw-set-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

@container (min-width: 620px) {
    .cw-set-split {
        grid-template-columns: minmax(0, 1fr) 250px;
        align-items: start;
    }
    .cw-set-split > .cw-set-preview {
        position: sticky;
        top: 0;
    }
}

.cw-set-inline .cw-set-num {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.cw-app .cw-set-num input {
    width: 110px;
}

/* スイッチ */
.cw-set-toggle {
    margin: 0 0 12px;
}

.cw-set-toggle > label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

.cw-set-toggle-text {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.cw-app input.cw-switch {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    width: 48px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #c9c4ba;
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
}

.cw-app input.cw-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s;
}

.cw-app input.cw-switch:checked {
    background: var(--cw-accent);
}

.cw-app input.cw-switch:checked::after {
    transform: translateX(20px);
}

.cw-set-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 14px;
    cursor: pointer;
}

.cw-set-radios {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cw-set-radios label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.cw-set-radios.is-guided {
    gap: 12px;
}

.cw-set-radios.is-guided label {
    align-items: flex-start;
}

.cw-set-radios.is-guided small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--cw-muted);
}

.cw-set-reco {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--cw-accent);
    color: #fff;
    font-size: 11px;
    line-height: 1.6;
    white-space: nowrap;
}

.cw-set-reco[hidden] {
    display: none;
}

/* 選び方の案内（折りたたみ） */
.cw-set-choice {
    margin: 4px 0 12px;
}

.cw-set-choice > summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--cw-accent-text);
    cursor: pointer;
    list-style: none;
}

.cw-set-choice > summary::-webkit-details-marker {
    display: none;
}

.cw-set-choice[open] > summary .cw-icon {
    transform: rotate(90deg);
}

.cw-set-choice-body {
    padding: 10px 14px;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
}

.cw-set-choice-body p {
    margin: 10px 0 4px;
    font-size: 13px;
}

.cw-set-choice-body p:first-child {
    margin-top: 0;
}

.cw-set-choice .cw-set-events td:last-child {
    font-weight: 700;
}

.is-off {
    opacity: 0.45;
}

/* 配色の選択とプレビュー */
.cw-set-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 6px;
}

.cw-set-swatches label {
    width: 66px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    position: relative;
}

.cw-set-swatches label > input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cw-set-swatches label > span {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid var(--cw-panel);
    box-shadow: 0 0 0 1px var(--cw-line);
    overflow: hidden;
    display: block;
}

.cw-set-swatches label > input:checked + span {
    box-shadow: 0 0 0 2px var(--cw-text);
}

.cw-set-swatches label > input:focus-visible + span {
    box-shadow: 0 0 0 3px var(--cw-accent-2);
}

.cw-set-swatches em {
    font-style: normal;
    font-size: 11px;
    line-height: 1.3;
    text-align: center;
    color: var(--cw-muted);
}

.cw-settings .cw-set-swatches .is-custom input[type="color"] {
    width: 140%;
    height: 140%;
    margin: -20%;
    padding: 0;
    border: 0;
    border-radius: 0;
    cursor: pointer;
}

.cw-set-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--cw-bg);
    border: 1px solid var(--cw-line);
    border-radius: 14px;
    min-width: 0;
}

.cw-set-preview.is-light {
    background: #f5f5f7;
}

.cw-set-preview-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--cw-muted);
}

.cw-set-pv-bubble {
    max-width: 88%;
    padding: 8px 12px;
    border-radius: 16px 16px 16px 4px;
    background: #fff;
    border: 1px solid var(--cw-line);
    font-size: 13.5px;
    line-height: 1.5;
}

.cw-set-pv-bubble.is-mine {
    align-self: flex-end;
    border-radius: 16px 16px 4px 16px;
    background: var(--cw-accent-soft);
    border-color: var(--cw-accent-line);
}

.cw-set-pv-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.cw-set-preview .cw-tile {
    cursor: default;
}

.cw-app .cw-set-pv-btn {
    align-self: flex-end;
    min-height: 38px;
    padding: 6px 16px;
    font-size: 14px;
    cursor: default;
}

.cw-set-preview .cw-richmenu {
    margin: 0;
}

.cw-settings .cw-set-preview select {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 14px;
}

/* 状態の一覧（診断） */
.cw-set-events {
    width: 100%;
    margin: 8px 0 10px;
    border-collapse: collapse;
    font-size: 13px;
}
.cw-set-events th,
.cw-set-events td {
    padding: 8px 10px;
    border: 1px solid var(--cw-line);
    text-align: left;
    vertical-align: top;
}
.cw-set-events th { background: rgba(0, 0, 0, .03); font-weight: 700; }
@media (max-width: 699px) {
    .cw-set-events thead { display: none; }
    .cw-set-events,
    .cw-set-events tbody,
    .cw-set-events tr,
    .cw-set-events td { display: block; }
    .cw-set-events tr { padding: 8px 0; border-bottom: 1px solid var(--cw-line); }
    .cw-set-events td { padding: 1px 0; border: 0; }
}
.cw-set-status {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.cw-set-status li {
    position: relative;
    padding: 2px 0 2px 20px;
    font-size: 13.5px;
    line-height: 1.6;
}

.cw-set-status li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 9px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cw-muted);
}

.cw-set-status .is-ok::before { background: var(--cw-ok); }
.cw-set-status .is-warn::before { background: #f0b400; }
.cw-set-status .is-ng::before { background: var(--cw-danger); }
.cw-set-status .is-ng { color: var(--cw-danger); }

/* 道具・ボタン */
.cw-set-tool {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin: 0 0 12px;
}

.cw-set-tool .cw-set-field {
    flex: 1 1 200px;
    margin: 0;
}

.cw-app .cw-set-btn {
    min-height: 42px;
    padding: 6px 16px;
    font-size: 14px;
    cursor: pointer;
}

.cw-set-message {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--cw-ok);
}

.cw-set-message.is-error {
    color: var(--cw-danger);
}

.cw-set-message:empty {
    display: none;
}

.cw-set-footer .cw-set-message:empty {
    display: block;
}

/* 画像 */
.cw-set-media {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.cw-set-media img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    background: #fff;
}

.cw-set-role {
    margin-left: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--cw-subtle);
    color: var(--cw-muted);
    font-size: 11px;
}

.cw-set-media-now {
    flex: 1 0 100%;
    font-size: 12px;
    color: var(--cw-muted, #777);
}

.cw-set-media img.is-wide {
    object-fit: contain;
    width: auto;
    max-width: 200px;
    height: 48px;
    padding: 6px 10px;
}

/* 営業時間 */
.cw-set-hours-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
}

.cw-set-hours-row strong {
    flex: 0 0 1.6em;
}

.cw-settings .cw-set-hours-row input[type="time"] {
    flex: 1 1 96px;
    width: auto;
    min-width: 0;
    padding: 8px;
}

.cw-set-hours-row .cw-set-check {
    margin: 0;
    flex: 0 0 auto;
}

/* 繰り返し項目 */
.cw-set-rows {
    margin: 0 0 10px;
}

.cw-set-row {
    display: flex;
    gap: 6px;
    margin: 0 0 10px;
    padding: 12px 6px 12px 12px;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    background: var(--cw-accent-soft-2);
}

.cw-set-row-fields {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0 12px;
    align-items: start;
}

.cw-set-row-fields > .cw-set-wide {
    grid-column: 1 / -1;
}

.cw-set-row-fields > .cw-set-check {
    align-self: center;
}

.cw-set-row-fields > :last-child {
    margin-bottom: 0;
}

/* いまは使わないボタン（登録したまま、お客様には表示しない） */
.cw-app .cw-set-unused {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: 14px;
    cursor: pointer;
}

.cw-app .cw-set-unused input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
}

.cw-set-row.is-unused {
    background: transparent;
    border-style: dashed;
}

.cw-set-row.is-unused .cw-set-row-fields > :not(.cw-set-unused) {
    opacity: 0.45;
}

.cw-set-row-tools {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cw-app .cw-set-row-tools .cw-iconbtn {
    width: 36px;
    height: 36px;
    font-size: 18px;
}

.cw-set-down .cw-icon {
    transform: rotate(180deg);
}

.cw-app .cw-iconbtn.is-danger {
    color: var(--cw-danger);
}

.cw-set-iconpick {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.cw-set-iconnow {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--cw-accent-line);
    background: #fff;
    color: var(--cw-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.cw-set-iconnow img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.cw-app .cw-set-iconpick select {
    flex: 1 1 120px;
    width: auto;
    min-width: 0;
}

.cw-set-list {
    margin: 0;
    padding-left: 18px;
    font-size: 14px;
}

.cw-set-list li {
    margin-bottom: 8px;
}

/* 送信ログ */
.cw-set-logwrap {
    max-height: 380px;
    overflow-y: auto;
}

.cw-set-log {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cw-set-log li {
    padding: 8px 0;
    border-bottom: 1px solid var(--cw-line);
}

.cw-set-log-main {
    display: block;
    font-size: 13.5px;
    word-break: break-all;
}

.cw-set-log-sub {
    display: block;
    font-size: 12px;
    color: var(--cw-muted);
}

.cw-set-log .is-ng .cw-set-log-sub {
    color: var(--cw-danger);
}

/* PC：2ペインのパネル */
@media (min-width: 861px) {
    .cw-settings-box {
        width: min(1080px, calc(100% - 48px));
        height: min(860px, calc(100% - 48px));
        border-radius: 18px;
    }
    .cw-settings-bar {
        padding: 8px 8px 8px 20px;
    }
    .cw-app .cw-settings-back,
    .cw-settings-navarrow {
        display: none;
    }
    .cw-settings-nav,
    .cw-settings.is-detail .cw-settings-nav {
        display: block;
        flex: 0 0 280px;
        border-right: 1px solid var(--cw-line);
    }
    .cw-settings-pane,
    .cw-settings.is-detail .cw-settings-pane {
        display: block;
    }
    .cw-set-scroll {
        padding: 18px 20px;
    }
    .cw-set-footer {
        padding: 12px 20px;
    }
}

.cw-set-message.is-note {
    color: #a86400;
}

/* --------------------------------------------------------------------------
   お問い合わせの目的・フォームのセット（お問い合わせフォーム／チャットのシート）
   -------------------------------------------------------------------------- */
.cw-radios-stack,
.cw-app.cw-form-wrap .cw-radios-stack {
    flex-direction: column;
    align-items: stretch;
}

.cw-radios-stack .cw-radio,
.cw-app.cw-form-wrap .cw-radios-stack .cw-radio {
    border-radius: 12px;
}

.cw-purpose-group,
.cw-app.cw-form-wrap .cw-purpose-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cw-form-notice,
.cw-app.cw-form-wrap .cw-form-notice {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 10px 12px;
    background: var(--cw-accent-soft-2);
    border: 1px solid var(--cw-accent-line);
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--cw-accent-text);
}

.cw-form-notice .cw-icon,
.cw-app.cw-form-wrap .cw-form-notice .cw-icon {
    margin-top: 3px;
}

.cw-consent .cw-check,
.cw-app.cw-form-wrap .cw-consent .cw-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    margin: 0;
}

.cw-consent input[type="checkbox"],
.cw-app.cw-form-wrap .cw-consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    flex: 0 0 auto;
    accent-color: var(--cw-accent);
}

.cw-consent a,
.cw-app.cw-form-wrap .cw-consent a {
    color: var(--cw-accent-text);
}

.cw-formsheet {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.cw-formsheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.cw-app .cw-formsheet-box {
    position: relative;
    width: min(640px, 100%);
    max-height: 88vh;
    max-height: 88dvh;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--cw-panel);
    border-radius: 18px 18px 0 0;
    overflow: hidden;
}

.cw-formsheet-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 8px 8px 18px;
    border-bottom: 1px solid var(--cw-line);
}

.cw-formsheet-head h2 {
    margin: 0;
    font-size: 17px;
}

.cw-formsheet-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cw-formsheet-foot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--cw-line);
}

.cw-formsheet-foot .cw-form-message {
    flex: 1 1 auto;
    margin: 0;
}

.cw-card-field dd {
    white-space: pre-wrap;
}

@media (min-width: 700px) {
    .cw-formsheet {
        align-items: center;
    }
    .cw-app .cw-formsheet-box {
        border-radius: 18px;
    }
}

/* 受信箱：固定・営業の印 */
.cw-roomitem-pin {
    color: var(--cw-accent);
    font-size: 14px;
    margin-right: 4px;
    vertical-align: -2px;
}

.cw-roomitem-company {
    font-weight: 400;
    color: var(--cw-muted);
    margin-right: 6px;
}

.cw-tag.is-sales {
    background: var(--cw-subtle);
    color: var(--cw-muted);
}

/* 設定画面：フォームのセット（入れ子の行） */
.cw-set-formrow {
    background: var(--cw-panel);
    padding: 14px 8px 14px 14px;
}

.cw-set-subrow {
    background: var(--cw-accent-soft-2);
}

.cw-set-row-fields .cw-set-repeater {
    margin-top: 2px;
}

.cw-settings input[type="url"] {
    width: 100%;
}

/* --------------------------------------------------------------------------
   受信箱：返信したスタッフの名前・部屋の担当者
   -------------------------------------------------------------------------- */
.cw-msg-name.is-staff {
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 0 12px 2px 0;
    font-weight: 700;
    color: var(--cw-accent-text);
}

.cw-app .cw-assign-btn {
    flex: 0 0 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 9.5em;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px dashed var(--cw-field-line);
    border-radius: 999px;
    background: var(--cw-panel);
    color: var(--cw-muted);
    font-size: 12.5px;
    cursor: pointer;
}

.cw-app .cw-assign-btn.is-set {
    border-style: solid;
    border-color: var(--cw-accent-line);
    background: var(--cw-accent-soft-2);
    color: var(--cw-accent-text);
    font-weight: 700;
}

.cw-assign-btn > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-tag.is-assign {
    background: var(--cw-accent-soft);
    color: var(--cw-accent-text);
    max-width: 9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .cw-app .cw-assign-btn {
        max-width: 6.5em;
        padding: 4px 8px;
    }
}

/* --------------------------------------------------------------------------
   受信箱：社内メモ（スタッフだけに見える書き込み）
   返信（吹き出し）と見間違えないよう、黄色い付箋のような見た目にする。
   -------------------------------------------------------------------------- */
.cw-note {
    align-self: stretch;
    margin: 2px 0;
    padding: 8px 12px 10px;
    background: #fff8d6;
    border: 1px solid #ecd98a;
    border-left: 4px solid #d9b100;
    border-radius: 4px 10px 10px 4px;
    color: #4a3f10;
    font-size: 14px;
    line-height: 1.6;
}

.cw-note-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    font-size: 12px;
    color: #7a6714;
}

.cw-note-head time {
    margin-left: auto;
    font-size: 10px;
}

.cw-note-body {
    word-break: break-word;
}

.cw-note-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    padding: 6px 10px;
    background: #fff8d6;
    border: 1px solid #ecd98a;
    border-radius: 10px;
    color: #7a6714;
    font-size: 12.5px;
    line-height: 1.5;
}

.cw-note-bar > span {
    flex: 1 1 auto;
    min-width: 0;
}

.cw-composer.is-note .cw-compose-field {
    background: #fff8d6;
    border-color: #d9b100;
}

.cw-composer.is-note .cw-compose-field textarea {
    background: transparent;
}

.cw-composer.is-note .cw-send {
    background: #b38f00;
    border-color: #b38f00;
}

.cw-app .cw-compose-icon.is-active[data-cw-note-toggle] {
    background: #fff8d6;
    color: #7a6714;
}

.cw-app .cw-note-bar .cw-text-link {
    flex: 0 0 auto;
    white-space: nowrap;
    color: #7a6714;
    text-decoration: underline;
}

/* 設定画面：データの保存場所 */
.cw-set-facts {
    margin: 0 0 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 14px;
    font-size: 13.5px;
    line-height: 1.7;
}

.cw-set-facts dt {
    font-weight: 700;
    white-space: nowrap;
}

.cw-set-facts dd {
    margin: 0;
    min-width: 0;
}

/* ==========================================================================
   設定画面：分かりやすさのための部品
   （グループ見出し・はじめにやること・くわしい設定の畳み込み・「？」のヘルプ）
   ========================================================================== */
.cw-settings-group {
    margin: 0;
    padding: 14px 14px 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--cw-muted);
    background: var(--cw-bg);
    border-bottom: 1px solid var(--cw-line);
}

.cw-app .cw-settings-navitem.is-start .cw-settings-navicon {
    background: var(--cw-accent);
    color: #fff;
}

/* はじめにやること */
.cw-check-progress {
    height: 8px;
    margin: 2px 0 8px;
    border-radius: 999px;
    background: var(--cw-subtle);
    overflow: hidden;
}

.cw-check-progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--cw-accent);
}

.cw-checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cw-app .cw-checkitem {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 10px 12px 12px;
    border: 1px solid var(--cw-accent-line);
    border-radius: 12px;
    background: var(--cw-accent-soft-2);
    text-align: left;
    cursor: pointer;
    color: var(--cw-muted);
}

.cw-app .cw-checkitem:hover {
    background: var(--cw-accent-soft);
}

.cw-checkmark {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--cw-accent);
    background: #fff;
    color: var(--cw-accent-text);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cw-checktext {
    flex: 1 1 auto;
    min-width: 0;
}

.cw-checktext strong {
    display: block;
    font-size: 15px;
    line-height: 1.4;
    color: var(--cw-text);
}

.cw-checktext small {
    display: block;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--cw-muted);
}

.cw-app .cw-checkitem.is-done {
    border-color: var(--cw-line);
    background: var(--cw-panel);
}

.cw-checkitem.is-done .cw-checkmark {
    border-color: var(--cw-ok);
    background: var(--cw-ok);
    color: #fff;
}

.cw-checkitem.is-done .cw-checktext strong {
    color: var(--cw-muted);
    font-weight: 400;
}

.cw-checkitem.is-done .cw-checktext small {
    color: var(--cw-ok);
}

/* くわしい設定（畳んでおく） */
.cw-set-more {
    margin: 0 0 12px;
}

.cw-set-more > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    border: 1px dashed var(--cw-field-line);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--cw-muted);
    cursor: pointer;
    list-style: none;
}

.cw-set-more > summary::-webkit-details-marker {
    display: none;
}

.cw-set-more > summary .cw-icon {
    transition: transform 0.15s;
}

.cw-set-more[open] > summary .cw-icon {
    transform: rotate(90deg);
}

.cw-set-more[open] > summary {
    margin-bottom: 12px;
    border-style: solid;
    border-color: var(--cw-line);
    background: var(--cw-panel);
}

.cw-set-more-body > :last-child {
    margin-bottom: 0;
}

/* 「？」 */
.cw-set-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cw-app .cw-set-q {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--cw-accent-line);
    border-radius: 50%;
    background: var(--cw-accent-soft-2);
    color: var(--cw-accent-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.cw-helpsheet {
    position: fixed;
    inset: 0;
    z-index: 170;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.cw-helpsheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.cw-helpsheet-box {
    position: relative;
    width: min(560px, 100%);
    max-height: 86vh;
    max-height: 86dvh;
    display: flex;
    flex-direction: column;
    background: var(--cw-panel);
    border-radius: 18px 18px 0 0;
    overflow: hidden;
}

.cw-helpsheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 8px 8px 18px;
    border-bottom: 1px solid var(--cw-line);
}

.cw-helpsheet-head h3 {
    margin: 0;
    font-size: 16px;
}

.cw-helpsheet-body {
    padding: 16px 18px 6px;
    overflow-y: auto;
}

.cw-helpsheet-foot {
    padding: 10px 18px calc(14px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: center;
}

.cw-help-flow {
    display: flex;
    align-items: stretch;
    gap: 4px;
    margin: 0 0 14px;
    padding: 12px 8px;
    background: var(--cw-accent-soft-2);
    border: 1px solid var(--cw-accent-line);
    border-radius: 14px;
}

.cw-help-flow span {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.4;
}

.cw-help-flow b {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--cw-accent);
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cw-help-flow i {
    align-self: center;
    font-style: normal;
    font-size: 18px;
    font-weight: 700;
    color: var(--cw-accent);
}

.cw-help-lines {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cw-help-lines li {
    position: relative;
    padding: 0 0 10px 18px;
    font-size: 14.5px;
    line-height: 1.7;
}

.cw-help-lines li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cw-accent);
}

.cw-set-copy {
    margin: 0 0 8px;
}

.cw-set-copy .cw-set-code {
    display: inline-block;
    padding: 8px 14px;
    font-size: 15px;
    user-select: all;
}

@media (min-width: 700px) {
    .cw-helpsheet {
        align-items: center;
    }
    .cw-helpsheet-box {
        border-radius: 18px;
    }
}

/* 設定画面：業種のテンプレート・プレビュー・営業時間のいまの表示 */
.cw-tpl-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin: 0 0 10px;
}

.cw-app .cw-tpl {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px 12px;
    border: 1px solid var(--cw-line);
    border-radius: 14px;
    background: var(--cw-panel);
    cursor: pointer;
    text-align: center;
}

.cw-app .cw-tpl:hover,
.cw-app .cw-tpl.is-active {
    border-color: var(--cw-accent);
    background: var(--cw-accent-soft-2);
}

.cw-app .cw-tpl.is-active {
    box-shadow: 0 0 0 1px var(--cw-accent);
}

.cw-tpl-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cw-tpl strong {
    font-size: 14.5px;
    line-height: 1.4;
}

.cw-tpl small {
    font-size: 12px;
    color: var(--cw-muted);
    line-height: 1.4;
}

.cw-tpl-detail {
    margin: 0 0 10px;
    padding: 12px 14px;
    border: 1px solid var(--cw-accent-line);
    border-radius: 12px;
    background: var(--cw-accent-soft-2);
}

.cw-tpl-title {
    margin: 0 0 8px;
    font-size: 14.5px;
    font-weight: 700;
}

.cw-tpl-facts {
    margin: 0 0 8px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 14px;
    font-size: 13.5px;
    line-height: 1.6;
}

.cw-tpl-facts dt {
    font-weight: 700;
    white-space: nowrap;
}

.cw-tpl-facts dd {
    margin: 0;
}

.cw-tpl-facts ul {
    margin: 0;
    padding-left: 16px;
}

.cw-set-toptool {
    justify-content: flex-end;
}

.cw-set-now {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px;
    font-size: 13.5px;
}

.cw-set-card > .cw-help-flow {
    margin-bottom: 12px;
}

.cw-helpsheet .cw-pv {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 15px;
}

.cw-helpsheet .cw-pv .cw-form-title {
    margin: 0 0 6px;
    font-size: 1.2em;
}

.cw-app .cw-pv-send {
    align-self: stretch;
    cursor: default;
    opacity: 0.85;
}

/* 営業時間：スマホでも1行（曜日・開店・閉店・定休）に収める */
.cw-settings .cw-set-hours-row input[type="time"] {
    flex: 1 1 72px;
    padding: 8px 4px 8px 8px;
}

.cw-set-hours-row {
    flex-wrap: nowrap;
}

.cw-set-hours-row .cw-set-check {
    white-space: nowrap;
}

/* メディアライブラリ（設定の「メディアから選ぶ」）。管理画面の外で開くため、読み上げ専用の文字を隠す指定を補う。 */
.cw-body .media-modal .screen-reader-text,
.cw-body .media-frame .screen-reader-text,
.cw-body .uploader-window .screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.cw-body .media-modal,
.cw-body .media-modal input,
.cw-body .media-modal select,
.cw-body .media-modal button,
.cw-body .media-modal textarea {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    font-size: 13px;
}

/* 押すとコピーできる表示（URL・ショートコード） */
.cw-app .cw-set-copychip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 8px 10px 8px 12px;
    border: 1px solid var(--cw-line);
    border-radius: 10px;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cw-app .cw-set-copychip:hover {
    border-color: var(--cw-accent-line);
    background: var(--cw-accent-soft-2);
}

.cw-set-copychip .cw-set-code {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    background: transparent;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.cw-set-copychip-act {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--cw-accent-text);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.cw-set-copychip-act svg {
    width: 16px;
    height: 16px;
}

.cw-set-copychip.is-copied {
    border-color: var(--cw-accent);
}

/* 設定の中の案内（ホーム画面への追加など） */
.cw-set-note {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
    border-radius: 12px;
    background: var(--cw-accent-soft-2);
    font-size: 13px;
}

.cw-set-note > svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    color: var(--cw-accent);
}

.cw-set-note strong {
    display: block;
    font-size: 14px;
}

.cw-set-note p {
    margin: 4px 0 0;
    color: var(--cw-muted);
}

.cw-app .cw-set-note .cw-set-btn {
    margin-top: 10px;
}

/* 個人設定「文字の大きさ」（受信箱）。読む部分だけを拡大・縮小する。 */
.cw-inbox[data-cw-font="small"] { --cw-zoom: 0.9; }
.cw-inbox[data-cw-font="large"] { --cw-zoom: 1.15; }
.cw-inbox[data-cw-font="xlarge"] { --cw-zoom: 1.3; }

.cw-inbox[data-cw-font] .cw-roomlist,
.cw-inbox[data-cw-font] .cw-message-list,
.cw-inbox[data-cw-font] .cw-canned,
.cw-inbox[data-cw-font] .cw-compose-field,
.cw-inbox[data-cw-font] .cw-modal-body {
    zoom: var(--cw-zoom, 1);
}

.cw-pref-fontsample {
    margin: 8px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--cw-accent-soft-2);
    font-size: 16px;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   予約カレンダー（オプション機能）：お客様がフォームで日を選ぶ部分
   -------------------------------------------------------------------------- */
.cw-cal,
.cw-app.cw-form-wrap .cw-cal {
    max-width: 420px;
    padding: 10px;
    border: 1px solid var(--cw-field-line, #b3ab9d);
    border-radius: 12px;
    background: #fff;
}

.cw-cal.is-loading,
.cw-app.cw-form-wrap .cw-cal.is-loading {
    opacity: 0.6;
}

.cw-cal-loading,
.cw-app.cw-form-wrap .cw-cal-loading {
    margin: 0;
    padding: 12px 4px;
    font-size: 14px;
    color: var(--cw-muted, #6d665c);
}

.cw-cal-head,
.cw-app.cw-form-wrap .cw-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 16px;
}

.cw-app .cw-cal-nav,
.cw-cal-nav,
.cw-app.cw-form-wrap .cw-cal-nav {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.cw-cal-nav:disabled,
.cw-app.cw-form-wrap .cw-cal-nav:disabled {
    opacity: 0.25;
    cursor: default;
}

.cw-cal-grid,
.cw-app.cw-form-wrap .cw-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cw-cal-week,
.cw-app.cw-form-wrap .cw-cal-week {
    padding: 2px 0;
    text-align: center;
    font-size: 12px;
    color: var(--cw-muted, #6d665c);
}

.cw-cal-week.is-sun,
.cw-app.cw-form-wrap .cw-cal-week.is-sun { color: #c62828; }
.cw-cal-week.is-sat,
.cw-app.cw-form-wrap .cw-cal-week.is-sat { color: #1565c0; }

.cw-app .cw-cal-day,
.cw-cal-day,
.cw-app.cw-form-wrap .cw-cal-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    font: inherit;
    font-size: 16px;
    line-height: 1.1;
    color: inherit;
}

.cw-cal-day.is-off,
.cw-app.cw-form-wrap .cw-cal-day.is-off {
    color: #c3beb5;
}

.cw-app .cw-cal-day.is-open,
.cw-cal-day.is-open,
.cw-app.cw-form-wrap .cw-cal-day.is-open {
    border-color: var(--cw-accent-line, #ffcc80);
    background: var(--cw-accent-soft, #fff3e0);
    color: var(--cw-accent-text, #b54708);
    font-weight: 700;
    cursor: pointer;
}

.cw-app .cw-cal-day.is-picked,
.cw-cal-day.is-picked,
.cw-app.cw-form-wrap .cw-cal-day.is-picked {
    border-color: var(--cw-accent, #ef6c00);
    background: var(--cw-accent, #ef6c00);
    color: #fff;
}

.cw-cal-day.is-full,
.cw-app.cw-form-wrap .cw-cal-day.is-full {
    background: #f1eee8;
    color: #8a8378;
}

.cw-cal-day small,
.cw-app.cw-form-wrap .cw-cal-day small {
    font-size: 10px;
    font-weight: 400;
}

.cw-cal-legend,
.cw-app.cw-form-wrap .cw-cal-legend {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--cw-muted, #6d665c);
}

.cw-cal-dot,
.cw-app.cw-form-wrap .cw-cal-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 4px;
    border-radius: 3px;
    vertical-align: middle;
}

.cw-cal-dot.is-open,
.cw-app.cw-form-wrap .cw-cal-dot.is-open { background: var(--cw-accent-soft, #fff3e0); border: 1px solid var(--cw-accent-line, #ffcc80); }
.cw-cal-dot.is-full,
.cw-app.cw-form-wrap .cw-cal-dot.is-full { background: #f1eee8; border: 1px solid #d9d4ca; }

.cw-cal-slots,
.cw-app.cw-form-wrap .cw-cal-slots {
    display: grid;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--cw-line, #e4dfd5);
}

.cw-cal-slots-title,
.cw-app.cw-form-wrap .cw-cal-slots-title {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 700;
}

.cw-app .cw-cal-slot,
.cw-cal-slot,
.cw-app.cw-form-wrap .cw-cal-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 8px 14px;
    border: 1px solid var(--cw-accent-line, #ffcc80);
    border-radius: 10px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
}

.cw-app .cw-cal-slot.is-picked,
.cw-cal-slot.is-picked,
.cw-app.cw-form-wrap .cw-cal-slot.is-picked {
    border-color: var(--cw-accent, #ef6c00);
    background: var(--cw-accent, #ef6c00);
    color: #fff;
}

.cw-cal-slot.is-off,
.cw-app.cw-form-wrap .cw-cal-slot.is-off {
    border-color: #e4dfd5;
    background: #f7f5f1;
    color: #8a8378;
    cursor: default;
}

.cw-cal-slot small,
.cw-app.cw-form-wrap .cw-cal-slot small {
    font-size: 12px;
}

.cw-cal-picked,
.cw-app.cw-form-wrap .cw-cal-picked {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--cw-muted, #6d665c);
}

.cw-cal-picked.is-set,
.cw-app.cw-form-wrap .cw-cal-picked.is-set {
    color: inherit;
    font-weight: 700;
}

.cw-cal-retry,
.cw-app.cw-form-wrap .cw-cal-retry {
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--cw-accent-text, #b54708);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* 予約カレンダー：設定画面（スタッフが受け付ける日を決める） */
.cw-cala-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cw-app .cw-cala-tab {
    padding: 8px 14px;
    border: 1px solid var(--cw-line);
    border-radius: 999px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.cw-app .cw-cala-tab.is-active {
    border-color: var(--cw-accent);
    background: var(--cw-accent);
    color: #fff;
}

.cw-app .cw-cala-tab.is-add:not(.is-active) {
    border-style: dashed;
    color: var(--cw-accent-text);
}

.cw-set-unit {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.cw-app .cw-set-unit input {
    width: 110px;
}

.cw-app .cw-text-link.is-danger {
    color: #c62828;
}

.cw-cala-month.is-loading {
    opacity: 0.5;
}

.cw-cala-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 16px;
}

.cw-cala-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cw-cala-week {
    padding: 2px 0;
    text-align: center;
    font-size: 12px;
    color: var(--cw-muted);
}

.cw-cala-week.is-sun { color: #c62828; }
.cw-cala-week.is-sat { color: #1565c0; }

.cw-app .cw-cala-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: 52px;
    margin: 0;
    padding: 2px;
    border: 1px solid var(--cw-line);
    border-radius: 10px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-size: 15px;
    line-height: 1.1;
    cursor: pointer;
}

.cw-app .cw-cala-day.is-open {
    border-color: var(--cw-accent-line);
    background: var(--cw-accent-soft);
    color: var(--cw-accent-text);
    font-weight: 700;
}

.cw-app .cw-cala-day.is-full {
    border-color: #e0a8a8;
    background: #fdecec;
    color: #b3261e;
    font-weight: 700;
}

.cw-app .cw-cala-day.is-off {
    background: #f4f2ee;
    color: #9a9388;
}

.cw-app .cw-cala-day.is-past {
    opacity: 0.45;
}

.cw-app .cw-cala-day.is-editing {
    outline: 3px solid var(--cw-accent);
    outline-offset: 1px;
}

.cw-cala-day small {
    min-height: 11px;
    font-size: 10px;
    font-weight: 400;
}

.cw-cala-mark {
    margin-left: 2px;
    font-size: 7px;
    font-style: normal;
    vertical-align: top;
    color: var(--cw-accent);
}

.cw-cala-legend {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--cw-muted);
}

.cw-cala-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-right: 4px;
    border-radius: 3px;
    vertical-align: middle;
}

.cw-cala-dot.is-open { background: var(--cw-accent-soft); border: 1px solid var(--cw-accent-line); }
.cw-cala-dot.is-full { background: #fdecec; border: 1px solid #e0a8a8; }
.cw-cala-dot.is-off { background: #f4f2ee; border: 1px solid var(--cw-line); }

.cw-cala-editor {
    margin-top: 14px;
    padding: 14px;
    border: 2px solid var(--cw-accent-line);
    border-radius: 12px;
    background: var(--cw-accent-soft-2);
}

.cw-cala-editor h4 {
    margin: 0 0 10px;
    font-size: 17px;
}

.cw-cala-editor h4 small {
    margin-left: 6px;
    font-size: 12px;
    font-weight: 400;
    color: var(--cw-muted);
}

.cw-cala-slot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid var(--cw-line);
    border-radius: 10px;
    background: #fff;
}

.cw-app .cw-cala-slot input[type="text"] {
    flex: 1 1 150px;
    width: auto;
    min-width: 0;
}

.cw-cala-times {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cw-app .cw-cala-times input {
    width: 118px;
}

.cw-cala-stop {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 12px;
    padding: 12px;
    border: 1px solid var(--cw-line);
    border-radius: 10px;
    background: #fff;
}

.cw-cala-stop.is-on {
    border-color: #e0a8a8;
    background: #fdecec;
}

.cw-cala-stop p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--cw-muted);
}

/* 確認・お知らせの小窓（ブラウザ標準のダイアログの代わり）。設定・メディアライブラリより手前に出す。 */
.cw-dialog {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cw-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.cw-dialog-box {
    position: relative;
    width: min(420px, 100%);
    padding: 20px 18px 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cw-dialog-text {
    margin: 0 0 16px;
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.cw-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.cw-app .cw-dialog-actions button {
    min-height: 44px;
    padding: 8px 18px;
}

.cw-app .cw-dialog-actions .cw-primary.is-danger,
.cw-app.cw-form-wrap .cw-dialog-actions .cw-primary.is-danger {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
}

/* 小窓の中の、1行の入力欄（CW.prompt） */
.cw-app .cw-dialog-input {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 0 0 16px;
    padding: 8px 12px;
    border: 1px solid var(--cw-field-line, #b3ab9d);
    border-radius: 10px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-size: 16px;
}

/* 受信箱の上部：予約カレンダー設定への入口（スマホはアイコンだけ、PC は文字も出す） */
.cw-app .cw-appbar-cal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    color: var(--cw-muted);
    font-size: 22px;
    text-decoration: none;
}

.cw-appbar-cal span {
    display: none;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

@media (min-width: 861px) {
    .cw-app .cw-appbar-cal {
        margin-right: 4px;
        padding: 0 14px 0 12px;
        border: 1px solid var(--cw-accent-line);
        background: var(--cw-accent-soft-2);
        color: var(--cw-accent-text);
        font-size: 18px;
    }
    .cw-appbar-cal span {
        display: inline;
    }
}

/* 予約カレンダー設定：1日分の内容を、ほかの日へ写す */
.cw-app .cw-cala-day.is-source {
    outline: 3px dashed var(--cw-accent);
    outline-offset: 1px;
}

.cw-app .cw-cala-day.is-target {
    border-color: #2e7d32;
    background: #e8f5e9;
    color: #1b5e20;
    font-weight: 700;
    opacity: 1;
}

.cw-cala-copy-what {
    margin: 0 0 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
}

.cw-cala-copy-how,
.cw-cala-copy-count {
    margin: 0 0 8px;
    font-size: 14px;
}

.cw-cala-copy-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
}

.cw-app .cw-cala-editor button:disabled {
    opacity: 0.45;
    cursor: default;
}

/* 連携サイトに埋め込んだフォーム：確認後の「チャットを開く」 */
.cw-embed-go,
.cw-app.cw-form-wrap .cw-embed-go {
    padding: 24px 16px;
    text-align: center;
}

.cw-embed-go p,
.cw-app.cw-form-wrap .cw-embed-go p {
    margin: 0 0 14px;
    font-size: 16px;
}

.cw-embed-go .cw-primary,
.cw-app.cw-form-wrap .cw-embed-go .cw-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 26px;
    border-radius: 999px;
    background: var(--cw-accent, #ef6c00);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

/* 受信箱：お問い合わせ元（連携サイト）での絞り込みと、一覧の印 */
.cw-sitefilter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 8px;
    font-size: 13px;
    color: var(--cw-muted);
}

.cw-sitefilter span {
    flex: 0 0 auto;
}

.cw-app .cw-sitefilter select {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    min-height: 36px;
    padding: 4px 28px 4px 10px;
    font-size: 14px;
}

.cw-tag.is-site {
    background: #e3f2fd;
    color: #0d47a1;
}

/* サービスからの引き継ぎ：入力済み（変更できない）の欄と、案内 */
.cw-form input[readonly],
.cw-app.cw-form-wrap .cw-form input[readonly] {
    background: #f4f2ee;
    color: #5c564d;
}

.cw-handoff-note svg,
.cw-app.cw-form-wrap .cw-handoff-note svg {
    color: #2e7d32;
}

.cw-set-code.is-block {
    display: block;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}

/* 行の中の説明（欄の下に置く短い補足） */
.cw-set-row-fields > p.cw-set-help {
    margin: -2px 0 10px;
}

/* 行の中の小見出し */
.cw-set-subhead {
    margin: 8px 0 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--cw-line);
    font-size: 14px;
    font-weight: 700;
}

/* サービスからの引継用フォーム：必ず引き継ぐ項目（変更できない行）と、いまの登録内容の一覧 */
.cw-set-fixedrows {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.cw-set-fixedrow {
    padding: 8px 12px;
    border: 1px dashed var(--cw-line, #d9d2c7);
    border-radius: 10px;
    font-size: 14px;
}

.cw-set-fixedrow small {
    margin-left: 4px;
    opacity: .7;
    font-size: 12px;
}

.cw-set-summary {
    margin: 0;
    font-size: 14px;
}

.cw-set-summary dt {
    margin-top: 8px;
    font-size: 12px;
    opacity: .7;
}

.cw-set-summary dt:first-child {
    margin-top: 0;
}

.cw-set-summary dd {
    margin: 2px 0 0;
    font-weight: 700;
}

/* 高度な設定：進め方の案内（番号付きの手順）・状態の1行・依頼文・選び方の表 */
.cw-set-steps {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cw-set-step {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--cw-line);
}

.cw-set-step:first-child {
    padding-top: 0;
    border-top: 0;
}

.cw-set-step-mark {
    display: inline-flex;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid var(--cw-line);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
}

.cw-set-step-mark svg {
    display: none;
    width: 16px;
    height: 16px;
}

.cw-set-step.is-done .cw-set-step-mark svg {
    display: block;
}

.cw-set-step.is-done .cw-set-step-num {
    display: none;
}

.cw-set-step.is-done .cw-set-step-mark {
    border-color: #2e9e5b;
    background: #2e9e5b;
    color: #fff;
}

.cw-set-step-body {
    flex: 1 1 auto;
    min-width: 0;
}

.cw-set-step-body > strong {
    display: block;
    font-size: 15px;
}

.cw-set-step-body > strong small {
    display: none;
    margin-left: 8px;
    color: #2e9e5b;
    font-size: 12px;
}

.cw-set-step-body > p {
    margin: 2px 0 0;
    font-size: 14px;
    opacity: .8;
}

.cw-set-step-act {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.cw-set-step-act .cw-set-help,
.cw-set-step-act .cw-set-stateline,
.cw-set-step-act .cw-set-peek {
    flex: 1 1 100%;
    margin: 0;
}

.cw-app a.cw-set-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.cw-set-stateline {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0 0 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .04);
    font-size: 14px;
}

.cw-set-stateline svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.cw-set-stateline.is-ok {
    background: rgba(46, 158, 91, .12);
}

.cw-set-stateline.is-ok svg {
    color: #2e9e5b;
}

.cw-set-stateline.is-warn {
    background: rgba(214, 69, 65, .1);
}

.cw-set-stateline.is-warn svg {
    color: #d64541;
}

.cw-set-peek summary {
    cursor: pointer;
    font-size: 13px;
    opacity: .8;
}

.cw-set-peek pre {
    max-height: 260px;
    margin: 8px 0 0;
    padding: 10px;
    overflow: auto;
    border: 1px solid var(--cw-line);
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.cw-set-tablewrap {
    overflow-x: auto;
}

.cw-set-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cw-set-table th,
.cw-set-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--cw-line);
    text-align: center;
    vertical-align: middle;
}

.cw-set-table th {
    font-size: 12px;
    font-weight: 700;
}

.cw-set-table th:first-child,
.cw-set-table td:first-child {
    min-width: 180px;
    text-align: left;
}

/* 連携サイトの行の中の折りたたみ（相手のサイトに入れるもの） */
.cw-set-rowmore {
    margin: 10px 0 0;
}

.cw-set-rowmore > .cw-set-more-body {
    display: grid;
}

/* 「このサイトだけで試す」で開いたときの注意書き（お客様には出ない） */
.cw-form-notice.cw-handoff-trial,
.cw-app.cw-form-wrap .cw-form-notice.cw-handoff-trial {
    border: 2px dashed #d64541;
    background: rgba(214, 69, 65, .06);
}

/* フォームのセットの設定：「サービスからの引継用フォーム」を、ふつうのフォームのセットと区切って見せる */
.cw-set-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 32px 0 14px;
    color: var(--cw-accent-text);
    font-size: 14px;
    font-weight: 700;
}

.cw-set-divider::before,
.cw-set-divider::after {
    content: "";
    flex: 1 1 0;
    border-top: 2px solid var(--cw-accent);
}

.cw-set-divider > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cw-set-divider svg {
    width: 18px;
    height: 18px;
}

.cw-set-zone {
    padding: 12px 12px 0;
    border: 2px solid var(--cw-accent);
    border-radius: 16px;
    background: var(--cw-accent-soft, rgba(0, 0, 0, .03));
}

/* 欄のすぐ下に付ける、短い注意書きの箇条書き */
.cw-set-notes {
    margin-top: 8px;
    font-size: 13px;
}

.cw-set-notes li {
    margin-bottom: 4px;
}

/* 入力欄のあとに出す注意書き（目的ごとのフォームのセット・引継用フォーム）：次の要素との間をあける */
.cw-form > .cw-form-notice,
.cw-form > .cw-purpose-group > .cw-form-notice,
.cw-app.cw-form-wrap .cw-form > .cw-form-notice,
.cw-app.cw-form-wrap .cw-form > .cw-purpose-group > .cw-form-notice {
    margin-bottom: 16px;
}

/* 入力項目の「表示する条件」（条件分岐）の欄 */
.cw-set-cond {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--cw-line);
}

.cw-set-condopts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 8px;
}

.cw-set-condopts .cw-set-help {
    flex: 1 1 100%;
    margin: 0;
}

/* 条件に合わず隠している項目（hidden 属性が、テーマの指定で効かない場合に備える） */
.cw-app .cw-field[hidden],
.cw-app.cw-form-wrap .cw-field[hidden] {
    display: none !important;
}

/* 「表示する条件」は、条件分岐を使うときだけ開く */
.cw-set-condwrap {
    margin-top: 4px;
}

.cw-set-condwrap > summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    font-size: 13px;
    color: var(--cw-muted);
    cursor: pointer;
    list-style: none;
}

.cw-set-condwrap > summary::-webkit-details-marker {
    display: none;
}

.cw-set-condwrap > summary svg {
    width: 14px;
    height: 14px;
    transition: transform .15s;
}

.cw-set-condwrap[open] > summary svg {
    transform: rotate(90deg);
}

.cw-set-condwrap[open] > summary {
    color: var(--cw-accent-text);
    font-weight: 700;
}

.cw-set-condwrap .cw-set-cond {
    margin-top: 4px;
    padding-top: 0;
    border-top: 0;
}

/* --------------------------------------------------------------------------
   設定：開閉できる行（フォームのセットと、その入力項目）
   たたんだ状態では、1行の要約（名前と印）だけを見せる。
   -------------------------------------------------------------------------- */
.cw-set-fold {
    flex-wrap: wrap;
    align-items: center;
    padding: 6px 6px 6px 8px;
}

.cw-app .cw-set-foldhead {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 0;
    padding: 4px 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cw-app .cw-set-foldhead:hover {
    background: rgba(0, 0, 0, .04);
}

.cw-set-foldhead > svg,
.cw-set-zonefold > summary > svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    transition: transform .15s;
}

.cw-set-fold:not(.is-collapsed) > .cw-set-foldhead > svg,
.cw-set-zonefold[open] > summary > svg {
    transform: rotate(90deg);
}

.cw-set-foldname {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-set-foldchips {
    flex: 0 1 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
}

.cw-set-chip {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .06);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    white-space: nowrap;
}

.cw-set-chip.is-req {
    background: rgba(214, 69, 65, .12);
    color: #b3312d;
}

.cw-set-chip.is-cond {
    max-width: 100%;
    overflow: hidden;
    background: var(--cw-accent-soft);
    color: var(--cw-accent-text);
    text-overflow: ellipsis;
}

/* 行の道具（上へ・下へ・削除）は、見出しの右に横並びで置く */
.cw-set-fold > .cw-set-row-tools {
    flex-direction: row;
}

.cw-set-fold > .cw-set-row-fields {
    flex: 1 1 100%;
    order: 3;
    padding: 8px 6px 8px 4px;
}

.cw-set-fold.is-collapsed > .cw-set-row-fields {
    display: none;
}

/* 開いている行は、枠の色を変えて、どの設定がどの行のものか分かるようにする */
.cw-set-fold:not(.is-collapsed) {
    border-color: var(--cw-accent);
}

.cw-set-formrow.cw-set-fold:not(.is-collapsed) {
    border-width: 2px;
}

.cw-set-subrow.cw-set-fold:not(.is-collapsed) {
    background: var(--cw-accent-soft);
}

.cw-set-subrow.cw-set-fold.is-collapsed {
    background: var(--cw-panel, #fff);
}

/* 引継用フォーム：区切りの下に、1行で置く（押すと開く） */
.cw-set-zonefold {
    padding: 0 12px;
}

.cw-set-zonefold > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    cursor: pointer;
    list-style: none;
}

.cw-set-zonefold > summary::-webkit-details-marker {
    display: none;
}

.cw-set-zonefold[open] > summary {
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .cw-set-foldhead {
        flex-wrap: wrap;
    }

    .cw-set-foldchips {
        flex: 1 1 100%;
        justify-content: flex-start;
        padding-left: 24px;
    }
}

/* 行の見出し：名前を切らずに見せる（印は、入りきらなければ次の行へ回す） */
.cw-app .cw-set-foldhead,
.cw-set-zonefold > summary {
    flex-wrap: wrap;
}

.cw-set-foldname {
    flex: 1 1 auto;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
}

.cw-set-foldhead > .cw-set-foldname,
.cw-set-zonefold > summary > .cw-set-foldname {
    min-width: 8em;
}

.cw-set-foldchips {
    flex: 0 1 auto;
    margin-left: auto;
}

@media (max-width: 600px) {
    .cw-set-foldchips {
        flex: 1 1 100%;
        margin-left: 0;
    }
}

/* 入力項目「画像の添付」 */
.cw-app .cw-field input[type="file"],
.cw-app.cw-form-wrap .cw-field input[type="file"] {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 8px;
    border: 1px dashed var(--cw-field-line);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
}

/* チャットの添付：PDF（名前と大きさの行。押すとダウンロード） */
.cw-app a.cw-filecard {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 280px;
    padding: 10px 12px;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.cw-filecard > svg {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    color: var(--cw-accent);
}

.cw-filecard-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cw-filecard-name {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-filecard-meta {
    font-size: 12px;
    opacity: .7;
}

.cw-filecard-badge {
    display: inline-block;
    margin-right: 6px;
    padding: 0 6px;
    border: 1px solid currentColor;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}

.cw-filecard-badge.is-macro {
    border-color: var(--cw-danger);
    background: var(--cw-danger);
    color: #fff;
}

.cw-app a.cw-filecard.is-macro {
    border-color: var(--cw-danger);
}

.cw-filecard.is-macro .cw-filecard-meta {
    opacity: 1;
}

.cw-filecard + .cw-msg-body {
    margin-top: 6px;
}

/* 送信前の添付の表示（PDF） */
.cw-attach-item.is-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    height: auto;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--cw-line);
    border-radius: 10px;
    background: #fff;
}

.cw-attach-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 14px;
}

.cw-attach-file svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

.cw-attach-file > span {
    overflow: hidden;
    max-width: 200px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-attach-item.is-file .cw-attach-remove {
    position: static;
}

/* 申込内容：長い文章の項目は、折りたたまずに表に出す */
.cw-card-long {
    margin-top: 10px;
}

.cw-card-long-label {
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 700;
    opacity: .7;
}

.cw-card-long .cw-inquiry-card-body {
    margin-top: 0;
}

/* 設定：気を付けてほしいことの知らせ（お問い合わせフォームに、ご用件を書く欄がないとき など） */
.cw-set-warn {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid rgba(214, 69, 65, .45);
    border-radius: 12px;
    background: rgba(214, 69, 65, .07);
    font-size: 14px;
    line-height: 1.6;
}

.cw-set-warn[hidden] {
    display: none;
}

.cw-set-warn > svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    color: #d64541;
}

/* --------------------------------------------------------------------------
   設定：営業・宣伝の仕分けのキーワード（強い言葉・弱い言葉）
   -------------------------------------------------------------------------- */
.cw-set-guide {
    margin: 4px 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    background: var(--cw-subtle);
    font-size: 14px;
}

.cw-set-guide-lead {
    margin: 0 0 8px;
    font-weight: 700;
}

.cw-set-guide-cols,
.cw-set-kwcols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 12px;
}

.cw-set-guide-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    border-left: 4px solid #d64541;
}

.cw-set-guide-col.is-weak {
    border-left-color: #e0a100;
}

.cw-set-guide-col em {
    margin-top: 4px;
    font-size: 12.5px;
    font-style: normal;
    opacity: .75;
}

.cw-set-guide-ex {
    margin: 10px 0 6px;
    padding: 0;
    list-style: none;
}

.cw-set-guide-ex li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-bottom: 6px;
}

.cw-set-guide-q {
    font-weight: 700;
}

.cw-set-guide-a {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12.5px;
}

.cw-set-guide-a.is-pass {
    background: rgba(46, 158, 91, .14);
    color: #1f7a43;
}

.cw-set-guide-a.is-hit {
    background: rgba(214, 69, 65, .12);
    color: #b3312d;
}

.cw-set-kwtest {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--cw-line);
}

.cw-set-kwverdict {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin: 8px 0 6px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.cw-set-kwverdict svg {
    width: 20px;
    height: 20px;
}

.cw-set-kwverdict > span {
    font-size: 12.5px;
    opacity: .8;
}

.cw-set-kwverdict.is-hit {
    background: rgba(214, 69, 65, .1);
    color: #b3312d;
}

.cw-set-kwverdict.is-pass {
    background: rgba(46, 158, 91, .12);
    color: #1f7a43;
}

.cw-set-kwfound {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 4px 0;
    font-size: 12.5px;
}

.cw-set-kwfound > span:first-child {
    margin-right: 4px;
    opacity: .7;
}

.cw-set-chip.is-kwstrong {
    background: rgba(214, 69, 65, .12);
    color: #b3312d;
}

.cw-set-chip.is-kwweak {
    background: rgba(224, 161, 0, .18);
    color: #7a5800;
}

/* --------------------------------------------------------------------------
   受信箱：確認待ち（メールの確認が済んでいない送信）
   本物のお問い合わせと同じ顔をさせない。入口は目立たせず、内容は押すまで見せない。
   -------------------------------------------------------------------------- */
.cw-app .cw-chip.cw-chip-pending {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    border-style: dashed;
    background: transparent;
    color: var(--cw-muted);
    font-weight: 400;
}

.cw-chip-pending svg {
    width: 14px;
    height: 14px;
}

.cw-pend-warn {
    display: flex;
    gap: 8px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(224, 161, 0, .14);
    font-size: 13.5px;
    line-height: 1.6;
}

.cw-pend-warn svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.cw-pend-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    opacity: .75;
}

.cw-pend-row {
    margin: 0 0 8px;
    padding: 10px 12px;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    background: #fff;
}

.cw-pend-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
}

.cw-pend-mail {
    font-size: 13px;
    opacity: .75;
    overflow-wrap: anywhere;
}

.cw-pend-time {
    margin-left: auto;
    font-size: 12px;
    opacity: .6;
}

.cw-pend-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.cw-pend-chip {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .06);
    font-size: 12px;
}

.cw-pend-body {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--cw-subtle);
    font-size: 14px;
}

.cw-pend-chip.is-biz {
    background: var(--cw-accent-soft);
    color: var(--cw-accent-text);
    font-weight: 700;
}

.cw-pend-biz {
    margin-top: 2px;
}

.cw-pend-field {
    margin: 0 0 6px;
}

.cw-pend-field dt {
    font-size: 12px;
    font-weight: 700;
    opacity: .7;
}

.cw-pend-field dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.cw-pend-acts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin-top: 10px;
}

.cw-app .cw-pend-acts .cw-secondary,
.cw-app.cw-form-wrap .cw-pend-acts .cw-secondary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 36px;
    padding: 4px 12px;
    font-size: 13px;
}

.cw-pend-acts svg {
    width: 15px;
    height: 15px;
}

.cw-app .cw-text-link.is-danger {
    color: #b3312d;
}

.cw-pend-suspect {
    margin: 12px 0 0;
    padding: 0 12px;
    border: 1px dashed var(--cw-line);
    border-radius: 12px;
}

.cw-pend-suspect > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    cursor: pointer;
    list-style: none;
    color: var(--cw-muted);
}

.cw-pend-suspect > summary::-webkit-details-marker {
    display: none;
}

.cw-pend-suspect > summary > span {
    flex: 1 1 auto;
}

.cw-pend-suspect > summary > svg {
    width: 16px;
    height: 16px;
    transition: transform .15s;
}

.cw-pend-suspect[open] > summary > svg {
    transform: rotate(90deg);
}

.cw-pend-stats {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--cw-line);
    font-size: 13.5px;
}

.cw-pend-stats p {
    margin: 4px 0 0;
}

/* 確認待ちの入口：絞り込みの下に、右寄せの小さな1行で置く（横に流れる絞り込みの中に入れると、見えなくなるため） */
.cw-app .cw-pendline {
    display: flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    margin: 6px 0 0 auto;
    padding: 4px 10px;
    border: 1px dashed var(--cw-line);
    border-radius: 999px;
    background: transparent;
    color: var(--cw-muted);
    font-size: 12.5px;
    cursor: pointer;
}

.cw-app .cw-pendline[hidden] {
    display: none;
}

.cw-pendline svg {
    width: 13px;
    height: 13px;
}

/* 確認待ち：スマホの幅での整え（「まとめて消す」を折り返さない・ボタンを詰める） */
.cw-pend-suspect > summary > .cw-text-link {
    flex: 0 0 auto;
    white-space: nowrap;
}

.cw-pend-suspect > summary > svg {
    flex: 0 0 auto;
}

@media (max-width: 600px) {
    .cw-app .cw-pend-acts .cw-secondary,
    .cw-app.cw-form-wrap .cw-pend-acts .cw-secondary {
        padding: 4px 10px;
    }

    .cw-pend-time {
        flex: 1 1 100%;
        margin-left: 0;
    }
}

/* 設定：数字で決める項目（画面下部のボタンの高さ） */
.cw-set-numrow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.cw-set-numrow + .cw-set-numrow {
    margin-top: 8px;
}

.cw-set-numhead {
    flex: 0 0 4.5em;
    align-self: center;
    font-size: 14px;
    font-weight: 700;
}

.cw-set-numitem {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.cw-app .cw-set-numitem input.cw-set-num {
    width: 92px;
    min-width: 0;
    text-align: right;
}

/* 設定の進め方：自分でチェックを付ける手順 */
.cw-set-step.is-done .cw-set-step-body > strong small {
    display: inline;
}

.cw-set-stepcheck {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid var(--cw-line);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}

.cw-app .cw-set-stepcheck input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
}

.cw-set-step.is-done .cw-set-stepcheck {
    border-color: #2e9e5b;
}

/* --------------------------------------------------------------------------
   設定「フォーム」：タブ・お客様に見える順の並び・見え方・モーダル
   -------------------------------------------------------------------------- */
.cw-ftabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 0 0 14px;
    border-bottom: 1px solid var(--cw-line);
}

.cw-app .cw-ftab {
    margin: 0 0 -1px;
    padding: 9px 12px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--cw-muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.cw-app .cw-ftab.is-on {
    border-bottom-color: var(--cw-accent);
    color: var(--cw-accent-text);
}

.cw-ftab small {
    font-weight: 400;
    color: var(--cw-muted);
}

.cw-ftab-pane {
    display: none;
}

.cw-ftab-pane.is-on {
    display: block;
}

/* 別のタブにあるセットを、いまのタブから編集するとき：中身は隠したまま、モーダルだけを見せる */
.cw-ftab-pane.has-modal:not(.is-on) {
    display: block;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

/* 窓口を選ぶ欄（オプション機能「窓口」） */
.cw-deskbar {
    margin: 0 0 14px;
    padding: 10px 12px 2px;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    background: var(--cw-panel, #fff);
}

.cw-deskbar > .cw-set-label {
    margin: 0 0 6px;
}

.cw-desks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
}

.cw-app .cw-desk {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-height: 36px;
    margin: 0;
    padding: 5px 12px;
    border: 1px solid var(--cw-line);
    border-radius: 10px;
    background: var(--cw-panel, #fff);
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.cw-app .cw-desk.is-on {
    border-color: var(--cw-accent);
    box-shadow: 0 0 0 1px var(--cw-accent);
    background: var(--cw-accent-soft-2, var(--cw-accent-soft));
    color: var(--cw-accent-text);
    cursor: default;
}

.cw-desk small {
    font-weight: 400;
    font-size: 12px;
    color: var(--cw-muted);
}

.cw-deskbar-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 6px;
}

.cw-deskbar-sc {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--cw-muted);
}

.cw-deskbar-acts {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cw-app .cw-deskbar .cw-set-btn.is-danger {
    color: #c62828;
}

.cw-fpv-shared {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--cw-muted);
}

.cw-fstep-lead {
    margin: 0 0 12px;
}

.cw-fstep {
    position: relative;
    padding: 0 0 14px 36px;
}

.cw-fstep::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 28px;
    bottom: 0;
    width: 2px;
    background: var(--cw-line);
}

.cw-fstep-num {
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 2px solid var(--cw-accent-line);
    border-radius: 50%;
    background: var(--cw-panel);
    color: var(--cw-accent-text);
    font-size: 13px;
    font-weight: 700;
}

.cw-fstep > .cw-set-card {
    margin-bottom: 0;
}

/* 見え方（お客様のフォームに近い形で出す。入力はできない） */
.cw-fpv {
    position: relative;
    padding: 12px 14px;
    border: 1px solid var(--cw-line);
    border-radius: 14px;
    background: var(--cw-panel);
}

.cw-fpv-cap {
    margin: 0 0 8px;
    padding-right: 64px;
    color: var(--cw-muted);
    font-size: 12px;
}

.cw-fpv-cap select {
    width: auto;
    max-width: 60%;
    min-height: 0;
    padding: 2px 6px;
    font-size: 12px;
}

.cw-app .cw-fpv-edit {
    position: absolute;
    top: 8px;
    right: 10px;
}

.cw-app .cw-set-btn.cw-set-btn-s {
    min-height: 30px;
    padding: 2px 11px;
    border-radius: 8px;
    font-size: 13px;
}

.cw-fpv-title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
}

.cw-fpv-intro {
    margin: 0;
    color: var(--cw-muted);
    font-size: 14px;
    white-space: pre-line;
}

.cw-fpv-f {
    display: block;
    margin: 0 0 10px;
}

.cw-fpv > :last-child,
.cw-fpv [data-cw-fv] > :last-child {
    margin-bottom: 0;
}

.cw-fpv [data-cw-fv] {
    margin-bottom: 10px;
}

.cw-fpv > [data-cw-fv]:last-child {
    margin-bottom: 0;
}

.cw-fpv-l {
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
    font-weight: 700;
}

.cw-fpv-fixed {
    margin-left: 6px;
    color: var(--cw-muted);
    font-size: 11px;
    font-weight: 400;
}

.cw-fpv-box {
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--cw-line);
    border-radius: 8px;
    background: var(--cw-subtle);
    color: var(--cw-muted);
    font-size: 12px;
}

.cw-fpv-box.is-tall {
    align-items: flex-start;
    min-height: 60px;
    padding-top: 6px;
}

.cw-fpv-off {
    display: block;
    padding: 5px 10px;
    border: 1px dashed var(--cw-field-line);
    border-radius: 8px;
    color: var(--cw-muted);
    font-size: 13px;
}

.cw-fpv-off.is-plain {
    border-style: dotted;
}

.cw-fpv-check {
    display: block;
    padding: 4px 0;
    font-size: 14px;
}

.cw-fpv-check::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 1px solid var(--cw-field-line);
    border-radius: 3px;
    vertical-align: -2px;
    background: var(--cw-subtle);
}

.cw-fpv-send {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: 10px;
    background: var(--cw-accent);
    color: #fff;
    font-weight: 700;
    opacity: .8;
}

.cw-fpv-send svg {
    width: 16px;
    height: 16px;
}

.cw-fpv-from {
    margin: 8px 0 0;
    color: var(--cw-muted);
    font-size: 13px;
}

/* 押すと切り替えのモーダルが開く枠 */
.cw-app .cw-fpv-tap {
    position: relative;
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 0 26px 0 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cw-app .cw-fpv-tap:hover,
.cw-app .cw-fpv-tap:focus-visible {
    outline: 2px solid var(--cw-accent-line);
    outline-offset: 3px;
}

.cw-fpv-tap::after {
    content: "✎";
    position: absolute;
    right: 4px;
    top: 4px;
    color: var(--cw-accent-text);
    font-size: 14px;
}

/* 目的：タイトルの行と中身で、背景を分ける。開いている目的は、枠を濃くする */
.cw-set-row.cw-set-prow {
    padding: 0;
    overflow: hidden;
    background: var(--cw-subtle);
}

.cw-set-prow > .cw-set-foldhead {
    padding: 8px 6px 8px 10px;
    border-radius: 0;
}

.cw-set-prow > .cw-set-foldhead .cw-set-foldchips {
    justify-content: flex-start;
}

.cw-set-prow > .cw-set-row-tools {
    padding-right: 6px;
}

.cw-set-prow > .cw-set-row-fields {
    margin: 0;
    padding: 12px;
    border-top: 1px solid var(--cw-line);
    background: var(--cw-panel);
}

.cw-set-prow.cw-set-fold:not(.is-collapsed) {
    border-width: 2px;
    background: var(--cw-accent-soft);
}

.cw-set-prow:not(.is-collapsed) > .cw-set-row-fields {
    border-top-color: var(--cw-accent-line);
}

.cw-set-pick {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cw-set-pick > select {
    flex: 1 1 auto;
    min-width: 0;
}

.cw-set-nest {
    margin: 10px 0 0 4px;
    padding: 2px 0 2px 12px;
    border-left: 3px solid var(--cw-accent-line);
}

.cw-set-nest-ttl {
    margin: 0 0 4px;
    color: var(--cw-muted);
    font-size: 13px;
}

.cw-set-nest ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cw-set-nest li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px dotted var(--cw-line);
    font-size: 14px;
}

.cw-set-nest li:last-child {
    border-bottom: 0;
}

.cw-set-nest li small {
    margin-left: auto;
    color: var(--cw-muted);
    font-size: 12px;
    white-space: nowrap;
}

.cw-set-usenote {
    margin: 10px 0 0;
    padding: 6px 10px;
    border: 1px solid var(--cw-accent-line);
    border-radius: 9px;
    background: var(--cw-accent-soft);
    color: var(--cw-accent-text);
    font-size: 13px;
}

.cw-fmodal-body > .cw-set-usenote {
    margin: 0 0 12px;
}

.cw-set-prow-more {
    padding-top: 6px;
}

.cw-set-chip.is-none {
    border: 1px dashed var(--cw-field-line);
    background: transparent;
    color: var(--cw-muted);
}

/* フォームのセットの一覧 */
.cw-set-row.cw-set-setrow {
    align-items: center;
    background: var(--cw-panel);
}

.cw-set-sethead {
    flex: 1 1 0;
    min-width: 220px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

.cw-set-sethead > .cw-set-foldname {
    flex: 0 1 auto;
}

.cw-set-setuses {
    flex: 1 1 200px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.cw-set-setbtns {
    display: flex;
    gap: 6px;
}

/* 設定のモーダル */
.cw-fmodal {
    display: none;
}

.cw-fmodal.is-open {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(0, 0, 0, .45);
    visibility: visible;
}

.cw-fmodal-box {
    width: min(440px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: var(--cw-bg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
    overflow: hidden;
}

.cw-fmodal-box.is-wide {
    width: min(680px, 100%);
}

.cw-fmodal-head {
    flex: 0 0 auto;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cw-line);
    background: var(--cw-panel);
}

.cw-fmodal-head h3 {
    margin: 0;
    font-size: 16px;
}

.cw-fmodal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.cw-fmodal-foot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--cw-line);
    background: var(--cw-panel);
}

.cw-fmodal-foot .cw-set-message {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.cw-set-setrow > .cw-set-row-tools {
    flex-direction: row;
}

.cw-set-row.cw-set-setrow {
    flex-wrap: wrap;
    padding: 8px 6px 8px 12px;
}

/* 一覧を取り直している間（時間がかかるときだけ） */
.cw-roomlist {
    transition: opacity .15s;
}

.cw-roomlist.is-loading {
    opacity: .55;
}
