/* ==========================================================================
   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;
}

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

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

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

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

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

.cw-app .cw-primary,
.cw-app .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 {
    background: var(--cw-accent-strong);
}

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

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

.cw-app .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="date"],
.cw-app input[type="datetime-local"],
.cw-app select,
.cw-app 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 {
    outline: 2px solid var(--cw-accent-2);
    outline-offset: 1px;
    border-color: var(--cw-accent);
}

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

/* --------------------------------------------------------------------------
   開始フォーム
   -------------------------------------------------------------------------- */
.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 {
    margin: 0 0 8px;
    font-size: 1.35em;
    line-height: 1.4;
}

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

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

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

.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 {
    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 {
    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 {
    display: block;
    color: var(--cw-muted);
    font-size: 11px;
}

.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 {
    background: var(--cw-accent-2);
    color: #fff;
}

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

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

.cw-req,
.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 {
    background: var(--cw-accent);
    color: #fff;
}

.cw-opt {
    background: var(--cw-subtle);
    color: var(--cw-muted);
}

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

.cw-field-error,
.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 {
    display: none;
}

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

.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) {
    border-color: var(--cw-accent);
    background: var(--cw-accent-soft);
}

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

.cw-submit {
    width: 100%;
    font-size: 17px;
}

.cw-submit.is-loading {
    opacity: 0.7;
}

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

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

.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 {
    margin: 0;
    font-weight: 700;
}

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

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

.cw-code-row {
    display: flex;
    gap: 8px;
}

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

.cw-app .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 {
    margin: 0;
    font-size: 13px;
    color: var(--cw-muted);
}

.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 {
    cursor: pointer;
    font-weight: 700;
    color: var(--cw-accent-text);
}

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

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

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

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

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

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

.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: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 99990;
}

.cw-floating.is-left {
    right: auto;
    left: 16px;
}

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

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

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

.cw-app .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 {
    font-weight: 700;
    font-size: 16px;
}

.cw-app .cw-floating-btn,
.cw-floating-btn {
    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 {
    position: fixed;
    inset: 0;
    z-index: 99991;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

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

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

.cw-floating-panel {
    position: relative;
    width: min(640px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
    background: #fff;
}

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

.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 {
        align-items: center;
    }
    .cw-floating-panel {
        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 .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-richmenu {
    --cw-menu-cols: 2;
    display: grid;
    grid-template-columns: repeat(var(--cw-menu-cols), 1fr);
    gap: 8px;
    margin: 0 0 8px;
    padding: 8px;
    background: var(--cw-accent-soft-2);
    border: 1px solid var(--cw-accent-line);
    border-radius: 14px;
}

.cw-app .cw-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 78px;
    padding: 10px 6px;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    background: #fff;
    color: var(--cw-text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.cw-app .cw-tile.is-wide {
    flex-direction: row;
    min-height: 56px;
    gap: 8px;
}

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

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

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

/* 絵文字ピッカー（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-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 {
        padding: 16px 14px;
        border-radius: 14px;
    }
    .cw-shell {
        border: 0;
    }
}

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

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

/* --------------------------------------------------------------------------
   受信箱：スマホ通知の案内バー・個人設定
   -------------------------------------------------------------------------- */
.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 {
    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;
}

.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;
    min-height: 64px;
}

.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-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 {
    flex-direction: column;
    align-items: stretch;
}

.cw-radios-stack .cw-radio {
    border-radius: 12px;
}

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

.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 {
    margin-top: 3px;
}

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

.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 {
    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 {
    max-width: 420px;
    padding: 10px;
    border: 1px solid var(--cw-field-line, #b3ab9d);
    border-radius: 12px;
    background: #fff;
}

.cw-cal.is-loading {
    opacity: 0.6;
}

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

.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 {
    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 {
    opacity: 0.25;
    cursor: default;
}

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

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

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

.cw-app .cw-cal-day,
.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 {
    color: #c3beb5;
}

.cw-app .cw-cal-day.is-open,
.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 {
    border-color: var(--cw-accent, #ef6c00);
    background: var(--cw-accent, #ef6c00);
    color: #fff;
}

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

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

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

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

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

.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 {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 700;
}

.cw-app .cw-cal-slot,
.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 {
    border-color: var(--cw-accent, #ef6c00);
    background: var(--cw-accent, #ef6c00);
    color: #fff;
}

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

.cw-cal-slot small {
    font-size: 12px;
}

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

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

.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 {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
}

/* 受信箱の上部：予約カレンダー設定への入口（スマホはアイコンだけ、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;
}
