/**
 * カルテ共通スタイル — PC / 大画面向け（viewport の max-width 条件は含まない）
 *
 * - 既定レイアウト・タイポ・色・コンポーネントのベースはすべて本ファイル。
 * - 幅 640px 以上・720px 以上で効かせる拡張は @media (min-width: …) のみ本ファイルに記述。
 * - 狭い画面（max-width）の上書き: common-form.mobile.css（〜720px / 520px 等）
 * - 768px 以下のテーブル縦積み等: common-form.tablet.css
 * - セクション見出し・sticky: common-form.section.css
 *
 * PC 表示の見た目を変えないため、本ファイル内の既存ルールの内容は変更しない方針（移動のみ mobile 側へ）。
 */
:root {
    /* Base theme (blue) */
    --karte-main: #1e3a8a;
    --karte-main-dark: #142b66;
    --karte-accent: #2563eb;
    --karte-bg: #f5f7fb;
    --karte-card: #ffffff;
    --karte-border: #d7deea;
    --karte-text: #1f2937;
    --karte-subtext: #6b7280;
    /* プレースホルダ（本文より薄いグレー。WebKit の -webkit-text-fill 対策あり） */
    --karte-placeholder: #94a3b8;
    /* OK 時・入力欄右端（〇＋チェック、青系・アクセント色） */
    --karte-field-ok-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='12' r='9.5' stroke='%232563eb' stroke-width='1.85'/%3E%3Cpath d='M8.25 12.05L10.95 14.75L16.2 9.4' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --karte-danger: #dc2626;
    --karte-warning: #b45309;
    --karte-success: #059669;
    --karte-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --karte-radius: 16px;
    /* 事業目的サイドバー・メインずらし（max-width と揃える） */
    --karte-content-max-width: 1080px;
    --karte-purpose-search-panel-width: 420px;
    --karte-purpose-search-main-gap: 16px;
    /* HTML5 検証でフォーカスされた欄がテーマの固定ヘッダーに隠れないよう（kk/gk 共通） */
    --karte-scroll-top-inset: min(28vh, 170px);
}

/* scrollIntoView / ネイティブ検証フォーカス時のスクロール位置調整（:has 非対応ブラウザは JS が補完） */
html:has(#kh-karte-form),
html:has(form[data-kh-live-validation]) {
    scroll-padding-top: var(--karte-scroll-top-inset);
    scroll-padding-left: env(safe-area-inset-left, 0);
    scroll-padding-right: env(safe-area-inset-right, 0);
}

#kh-karte {
    max-width: var(--karte-content-max-width);
    margin: 0 auto;
    padding: 32px 16px 72px;
    color: var(--karte-text);
    line-height: 1.75;
    position: relative;
    left: 0;
    transition: left 0.28s ease;
}

#kh-karte * {
    box-sizing: border-box;
}

#kh-karte a {
    color: var(--karte-accent);
    text-decoration: none;
}

#kh-karte a:hover {
    text-decoration: underline;
}

#kh-karte .kh-karte__general {
    display: none;
}

#kh-karte .kh-karte__sent {
    display: none;
    margin-bottom: 24px;
    padding: 16px 20px;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-weight: 700;
}

#kh-karte.kh-karte--sent .kh-karte__sent {
    display: block !important;
}

#kh-karte.kh-karte--sent .kh-karte__general {
    display: none !important;
}

#kh-karte .kh-karte__hero {
    margin-bottom: 32px;
}

#kh-karte .kh-karte__heroCard {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--karte-border);
    border-radius: 24px;
    box-shadow: var(--karte-shadow);
    overflow: hidden;
}

#kh-karte .kh-karte__heroTitle {
    margin: 0;
    padding: 24px 28px;
    /* この見出しだけはオレンジ背景を固定 */
    background: linear-gradient(135deg, #c2410c 0%, #f97316 100%);
    color: #fff;
    font-size: 28px;
    line-height: 1.4;
    font-weight: 800;
    letter-spacing: 0.02em;
}

#kh-karte .kh-karte__inner {
    padding: 28px;
}

#kh-karte .kh-karte__text p,
#kh-karte .kh-karte__text li {
    font-size: 15px;
}

#kh-karte .kh-karte__steps {
    margin: 20px 0 0;
    padding: 0;
    counter-reset: karte-step;
    list-style: none;
}

#kh-karte .kh-karte__steps li {
    position: relative;
    margin: 0 0 14px;
    padding: 16px 16px 16px 56px;
    background: #fff;
    border: 1px solid var(--karte-border);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

#kh-karte .kh-karte__steps li::before {
    counter-increment: karte-step;
    content: counter(karte-step);
    position: absolute;
    top: 14px;
    left: 14px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--karte-main);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

#kh-karte .kh-karte__linkBtn {
    margin: 14px 0 18px;
}

#kh-karte .kh-karte__linkBtn a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-weight: 700;
}

#kh-karte .kh-karte__linkBtn a::after {
    content: "→";
    font-weight: 700;
}

/* NOTE: section/sticky/purpose rules were split into `common-form.section.css`. */

#kh-karte .kh-karte__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 0 22px;
    background: var(--karte-card);
    border: 1px solid var(--karte-border);
    border-radius: var(--karte-radius);
    overflow: hidden;
    box-shadow: var(--karte-shadow);
}

/* 「設立メンバーに未成年等の存在」テーブル（kk / gk 共通）。
   直前がメンバー追加スロット（破線カード）なので、くっついて見えないよう上に余白を足す。
   マークアップ: karte/index.php・g-karte/index.php */
#kh-karte .kh-karte__table--minorExistence {
    margin-top: 32px;
}

#kh-karte .kh-karte__table tr:not(:last-child) th,
#kh-karte .kh-karte__table tr:not(:last-child) td {
    border-bottom: 1px solid #e8edf5;
}

#kh-karte .kh-karte__table th {
    width: 36%;
    padding: 18px 20px;
    vertical-align: top;
    background: #f8fafc;
    color: #111827;
    font-size: 15px;
    font-weight: 800;
    text-align: left;
}

#kh-karte .kh-karte__table td {
    padding: 18px 20px;
    vertical-align: top;
    background: #fff;
    font-size: 15px;
}

/* 入力欄直下の補足（メール本人など） */
#kh-karte .kh-karte__fieldHelp {
    margin: 0;
    padding: 0;
}

#kh-karte .kh-karte__fieldHelp--emailSelf {
    margin-top: 0;
    margin-bottom: 12px;
    padding: 10px 12px;
    font-size: 13.5px;
    line-height: 1.6;
    font-weight: 600;
    color: var(--karte-text);
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

/* 注意・警告テキスト（セクション見出し・メール補足など） */
#kh-karte .kh-karte__textDanger {
    color: var(--karte-danger);
}

#kh-karte .kh-karte__fieldHelp--emailSelf .kh-karte__textDanger,
#kh-karte .kh-karte__fieldHelp--emailSelf .kh-karte__textDanger strong {
    font-weight: 800;
}

#kh-karte .kh-karte__inputFull {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#kh-karte .kh-karte__radioLabel {
    display: inline-block;
    margin-right: 1.2em;
}

/* --------------------------------------------------------------------------
   申込プラン（ラジオをカード風に装飾 / common-form-plan.php）
   -------------------------------------------------------------------------- */
#kh-karte .kh-karte__planRadiogroup {
    margin-top: 4px;
}

/* ブロック間は下のグリッドの gap と揃える（カードが縦一列に等間隔で並ぶ） */
#kh-karte .kh-karte__planBlock {
    margin-bottom: 10px;
}

#kh-karte .kh-karte__planBlock:last-child {
    margin-bottom: 0;
}

#kh-karte .kh-karte__planSubhead {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--karte-text);
}

#kh-karte .kh-karte__planLead {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--karte-subtext);
    font-weight: 600;
}

/* 2026-07-31: PC でも 2 列にせず、**全カードを横長のまま縦一列**に並べる
   （旧: min-width 640px で 1fr 1fr の 2 列 → A・B が横並び、C だけ次の行だった）。 */
#kh-karte .kh-karte__planGrid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    /* 高さを揃える */
    align-items: stretch;
    /* 一番人気ステッカーがカード外にハミ出る分の余白 */
    padding-top: 16px;
}

#kh-karte .kh-karte__planCard {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    /* カード自体も高さ 100% にしてグリッド行の高さに追従 */
    height: 100%;
}

/* 「一番人気のプラン」ステッカー：疑似要素でカード上辺に少し乗せる */
#kh-karte .kh-karte__planCard--featured::before {
    content: "一番人気のプラン";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    padding: 5px 16px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.3;
    color: #ffffff;
    background: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35);
    white-space: nowrap;
    pointer-events: none;
}

/* 書類のみは1列ブロック内で全幅 */
#kh-karte .kh-karte__planBlock--docs .kh-karte__planCard--docs {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* 2026-08-04: 透明ラジオを「カード全面に敷く」のをやめた。
   旧実装は position:absolute + inset:0 + width/height:100% でカード全面を覆い、
   可視部 (.kh-karte__planCardSurface) を pointer-events:none にしてクリックを透過させていた。
   この作りは「ラジオの包含ブロックが必ず .kh-karte__planCard である」ことに依存しており、
   .kh-karte__planCard の position: relative が効かない状況（テーマ側 CSS の上書き等）では
   3 枚のラジオがそろってプラン領域全体まで広がる。z-index が同値のため DOM 最後の
   C（書類のみ）が常に最前面になり、どのカードを押しても C が選ばれていた
   ＝「黒水牛を選んだのに確認画面も送信値も書類のみ」。
   ラジオは 1px に縮めてクリック判定から外し、クリックは <label>（=カード）に受けさせる。
   label は自分の中の input を活性化するので、座標や重なりに一切依存しない。 */
#kh-karte .kh-karte__planCardInput {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

#kh-karte .kh-karte__planCardSurface {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px 12px;
    flex-wrap: wrap;
    padding: 14px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
    /* 旧: pointer-events: none（透明ラジオへクリックを透過させるため）。
       ラジオを 1px 化してクリックは label が受ける方式に変えたので、
       ここで透過させると label にイベントが届かなくなる。必ず既定のまま。 */
    /* 2 カード並びで高さを揃えるため、カード内で surface を 100% に */
    height: 100%;
    box-sizing: border-box;
}

/* 2026-07-31: featured（黒水牛＝B セット）の枠色強調は廃止。
   「一番人気のプラン」バッジ（::before）だけ残し、枠線は他カードと同じ既定色にする。 */

#kh-karte .kh-karte__planCard:hover .kh-karte__planCardSurface {
    border-color: #bfdbfe;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

#kh-karte .kh-karte__planCard:has(.kh-karte__planCardInput:checked) .kh-karte__planCardSurface {
    border-color: var(--karte-accent);
    border-width: 2px;
    background: linear-gradient(165deg, #dbeafe 0%, #eff6ff 100%);
    box-shadow:
        0 0 0 2px rgba(37, 99, 235, 0.35),
        0 8px 22px rgba(37, 99, 235, 0.18);
}
#kh-karte .kh-karte__planCard:has(.kh-karte__planCardInput:checked) .kh-karte__planCardTitle {
    color: #1d4ed8;
}
#kh-karte .kh-karte__planCard:has(.kh-karte__planCardInput:checked)::after {
    content: "選択中";
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 3;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1.3;
    color: #ffffff;
    background: var(--karte-accent);
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    pointer-events: none;
}

#kh-karte .kh-karte__planCard:has(.kh-karte__planCardInput:focus-visible) .kh-karte__planCardSurface {
    outline: 2px solid var(--karte-accent);
    outline-offset: 2px;
}

#kh-karte .kh-karte__planCardFigure {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
}

#kh-karte .kh-karte__planCardFigure svg {
    display: block;
}

/* 実写画像（webp）: ボックス内にきれいに収める */
#kh-karte .kh-karte__planCardImg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 書類のみ（SVG）はこれまで通り小さめで中央寄せ */
#kh-karte .kh-karte__planCardFigure--docs {
    width: 60px;
    height: 60px;
    background: #ffffff;
}

/* ラジオボタンの表示は廃止。選択状態はカードの背景色・ボーダー・「選択中」バッジで示す */
#kh-karte .kh-karte__planCardRadioUi {
    display: none;
}

#kh-karte .kh-karte__planCardBody {
    flex: 1 1 120px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* 旧「おすすめ」バッジは廃止。一番人気のプラン は .kh-karte__planCard--featured::before で表示 */
#kh-karte .kh-karte__planCardBadge {
    display: none;
}

#kh-karte .kh-karte__planCardTitle {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--karte-text);
}

#kh-karte .kh-karte__planCardMeta {
    font-size: 12px;
    line-height: 1.5;
    color: var(--karte-subtext);
    font-weight: 600;
}

#kh-karte .kh-karte__planCardPrice {
    flex-shrink: 0;
    margin-left: auto;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    padding-top: 0;
    line-height: 1.2;
}

#kh-karte .kh-karte__planCardPriceTax {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.04em;
    margin-right: 2px;
}

#kh-karte .kh-karte__planCardPriceBreakdown {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

#kh-karte .kh-karte__planCardPriceMain {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

#kh-karte .kh-karte__planCardPriceNum {
    font-size: 1.55rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: var(--karte-main);
    line-height: 1.1;
}

#kh-karte .kh-karte__planCardPriceUnit {
    font-size: 15px;
    font-weight: 700;
    color: #475569;
}

#kh-karte .kh-karte__planCard--docs .kh-karte__planCardPriceNum {
    color: #334155;
}

#kh-karte .kh-karte__relaOtherWrap {
    margin-top: 12px;
}
#kh-karte .kh-karte__relaOtherLabel {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}
#kh-karte .kh-karte__memberJobOtherWrap {
    margin-top: 10px;
}
#kh-karte .kh-karte__memberJobOtherLabel {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

#kh-karte .kh-karte__memberSameAsYaritori {
    color: var(--karte-text);
    font-size: 15px;
    line-height: 1.55;
}

/* 表示ミラーは入力欄と同じ本文色（職業行などで親の色に負けないよう明示） */
#kh-karte .kh-karte__memberSameAsYaritori > .kh-karte__member1LiveValue {
    color: var(--karte-text);
}

#kh-karte .kh-karte__member1LiveValue {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--karte-text);
    word-break: break-all;
}

#kh-karte .kh-karte__member1LiveValue.kh-karte__member1LiveValue--empty {
    font-weight: 600;
    color: #9ca3af;
}

#kh-karte tr.kh-karte__member1MirrorRow {
    display: none !important;
}

/* 資本金総額（出資の自動合計・入力欄に見えないブロック表示） */
#kh-karte .kh-karte__capitalAutoBlock {
    max-width: 100%;
}

#kh-karte .kh-karte__capitalAutoSurface {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    box-sizing: border-box;
}

#kh-karte .kh-karte__capitalAutoHint {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 600;
    color: #64748b;
}

#kh-karte .kh-karte__capitalAutoFigureRow {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
}

#kh-karte .kh-karte__capitalAutoFigure {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--karte-text);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

#kh-karte .kh-karte__capitalAutoUnitSuffix {
    font-size: 15px;
    font-weight: 700;
    color: #475569;
}

/* 出資合計 0 円時：一株額面は選べない旨（アラートではなく本文下の説明） */
#kh-karte .kh-karte__shareFaceZeroHint {
    margin: 10px 0 0;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.7;
    background: #fef2f2;
    border: 1px solid rgba(185, 28, 28, 0.4);
    border-radius: 10px;
    box-sizing: border-box;
}

/* 前半の警告文は黒に近い色でコントラストを確保 */
#kh-karte .kh-karte__shareFaceZeroHintLead {
    display: inline;
    color: #111827;
    font-weight: 600;
}

/* 「戻ってメンバーを追加してください」は赤文字で強調 */
#kh-karte .kh-karte__shareFaceZeroHintLink {
    display: inline-block;
    margin-top: 6px;
    color: #b91c1c;
    font-size: 15px;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    cursor: pointer;
}

#kh-karte .kh-karte__shareFaceZeroHintLink:hover,
#kh-karte .kh-karte__shareFaceZeroHintLink:focus {
    color: #7f1d1d;
    text-decoration: underline;
}

#kh-karte #kh-karte-share-face-row.kh-karte__shareFaceRow--zeroCapital #kh-karte-share-face-badge {
    display: none;
}

#kh-karte .kh-karte__capitalConfirmBox {
    padding: 14px 16px;
    border: 2px solid var(--karte-accent, #2563eb);
    border-radius: 12px;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12);
    box-sizing: border-box;
}

#kh-karte .kh-karte__capitalConfirmLead {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 800;
    color: #1e40af;
    line-height: 1.45;
}

#kh-karte .kh-karte__capitalConfirmBadge {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #fff;
    background: var(--karte-accent, #2563eb);
    border-radius: 6px;
    vertical-align: middle;
}

#kh-karte .kh-karte__capitalConfirmLabel {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.55;
    font-weight: 700;
    color: var(--karte-text);
}

#kh-karte .kh-karte__capitalConfirmLabel input[type="checkbox"] {
    flex-shrink: 0;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.2em;
    accent-color: var(--karte-accent, #2563eb);
}

#kh-karte .kh-karte__capitalConfirmText strong {
    font-weight: 800;
    color: #1e3a8a;
}

/* メンバー枠（1人分のグループ） */
#kh-karte .kh-karte__members {
    margin-top: 8px;
}

#kh-karte .kh-karte__memberGroup {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    margin-bottom: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

/* 左縦書きラベル（メンバー番号①〜⑥でトーン切替、⑦は①と同じ） */
#kh-karte .kh-karte__memberGroupRibbon {
    flex: 0 0 auto;
    width: 3rem;
    min-width: 2.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 8px 16px;
    color: #fff;
    border-right: 3px solid rgba(255, 255, 255, 0.35);
}

/* 追加メンバー: メンバー表の下に配置する「メンバー②を削除」など文言ボタン */
#kh-karte .kh-karte__memberDeleteBar {
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    justify-content: flex-end;
}
#kh-karte .kh-karte__memberDeleteBar--bottom {
    margin: 10px 0 24px;
}

#kh-karte .kh-karte__memberRemoveBtn.kh-karte__memberRemoveBtn--labeled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0;
    padding: 10px 20px;
    border: 2px solid #dc2626;
    border-radius: 10px;
    background: #dc2626;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#kh-karte .kh-karte__memberRemoveBtn.kh-karte__memberRemoveBtn--labeled:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #991b1b;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(185, 28, 28, 0.35);
}

#kh-karte .kh-karte__memberRemoveBtn.kh-karte__memberRemoveBtn--labeled:active:not(:disabled) {
    transform: translateY(1px);
}

#kh-karte .kh-karte__memberRemoveBtn.kh-karte__memberRemoveBtn--labeled:disabled {
    cursor: not-allowed;
    background: #fca5a5;
    border-color: #fca5a5;
    color: #ffffff;
    opacity: 0.7;
    box-shadow: none;
}

#kh-karte .kh-karte__memberRemoveBtnLabel {
    pointer-events: none;
}

/* メンバー①：削除ボタン無しの帯（縦ラベルを帯内で中央寄せ） */
#kh-karte .kh-karte__memberGroupRibbon--noRemove {
    justify-content: center;
    padding-top: 14px;
    padding-bottom: 14px;
}

#kh-karte .kh-karte__memberGroupRibbon--tone1 {
    background: linear-gradient(165deg, #312e81 0%, #4338ca 48%, #6366f1 100%);
    border-right-color: #a5b4fc;
}

#kh-karte .kh-karte__memberGroupRibbon--tone2 {
    background: linear-gradient(165deg, #134e4a 0%, #0d9488 48%, #2dd4bf 100%);
    border-right-color: #5eead4;
}

#kh-karte .kh-karte__memberGroupRibbon--tone3 {
    background: linear-gradient(165deg, #9a3412 0%, #ea580c 48%, #fb923c 100%);
    border-right-color: #fed7aa;
}

#kh-karte .kh-karte__memberGroupRibbon--tone4 {
    background: linear-gradient(165deg, #9f1239 0%, #e11d48 48%, #fb7185 100%);
    border-right-color: #fecdd3;
}

#kh-karte .kh-karte__memberGroupRibbon--tone5 {
    background: linear-gradient(165deg, #164e63 0%, #0891b2 48%, #22d3ee 100%);
    border-right-color: #a5f3fc;
}

#kh-karte .kh-karte__memberGroupRibbon--tone6 {
    background: linear-gradient(165deg, #581c87 0%, #9333ea 48%, #c084fc 100%);
    border-right-color: #e9d5ff;
}

#kh-karte .kh-karte__memberGroupRibbonText {
    flex: 1 1 auto;
    min-height: 0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.35;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

#kh-karte .kh-karte__memberGroupBody {
    flex: 1 1 auto;
    min-width: 0;
    padding: 16px 18px;
    background: #fafafa;
}

#kh-karte .kh-karte__memberGroupLead {
    margin: 0 0 14px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.65;
    color: #4b5563;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

#kh-karte .kh-karte__memberGroupLead--member1 {
    text-align: center;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 700;
    color: #334155;
}

#kh-karte .kh-karte__memberGroupLeadEm {
    font-weight: 800;
    color: #1e40af;
}

#kh-karte .kh-karte__memberGroupBody .kh-karte__table {
    margin-bottom: 0;
}

#kh-karte #kh-karte-members + .kh-karte__btnRow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 20px;
}

#kh-karte .kh-karte__memberAddHint {
    display: block;
    width: 100%;
    flex-basis: 100%;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.55;
    text-align: center;
}

/* 「次のメンバーが折りたたまれている」スロット（2026-07-31）。
   メンバーカードと同じ枠組み（帯 + 本体）を破線・グレーで出し、押すと実体のカードに変わる。
   マークアップ: common-form-members.php / ラベル同期: common-form-add-member.js */
#kh-karte .kh-karte__memberAddSlot {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    margin-bottom: 28px;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    overflow: hidden;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

/* [hidden] は display:flex に負けるので明示で打ち消す（最大人数到達時） */
#kh-karte .kh-karte__memberAddSlot[hidden] {
    display: none;
}

#kh-karte .kh-karte__memberAddSlot:hover {
    border-color: #f97316;
    background: #fff7ed;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.14);
}

/* 帯は未確定を表すグレー（確定済みメンバーの tone1〜6 とは別扱い） */
#kh-karte .kh-karte__memberAddSlotRibbon {
    background: linear-gradient(165deg, #94a3b8 0%, #b6c2d1 48%, #cbd5e1 100%);
    border-right-color: #e2e8f0;
}

#kh-karte .kh-karte__memberAddSlot:hover .kh-karte__memberAddSlotRibbon {
    background: linear-gradient(165deg, #ea580c 0%, #f97316 48%, #fb923c 100%);
    border-right-color: #fed7aa;
}

#kh-karte .kh-karte__memberAddSlotBody {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 22px 18px;
}

#kh-karte .kh-karte__memberAddSlotHint {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #6b7280;
    text-align: center;
}

#kh-karte .kh-karte__btnRow--addMember {
    display: flex;
    justify-content: center;
    margin: 0 0 6px;
}

#kh-karte .kh-karte__addMemberBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 28px 12px 22px;
    border: 2px solid #f97316;
    border-radius: 999px;
    background: #f97316;
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(249, 115, 22, 0.28);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#kh-karte .kh-karte__addMemberBtn:hover:not(:disabled) {
    background: #ea580c;
    color: #ffffff;
    border-color: #c2410c;
    box-shadow: 0 10px 18px rgba(234, 88, 12, 0.35);
    transform: translateY(-1px);
}

#kh-karte .kh-karte__addMemberBtn:active:not(:disabled) {
    transform: translateY(0);
}

#kh-karte .kh-karte__addMemberBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#kh-karte .kh-karte__addMemberBtnIcon {
    flex: 0 0 auto;
    pointer-events: none;
}

#kh-karte .kh-karte__addMemberBtnLabel {
    pointer-events: none;
}

#kh-karte .kh-karte__submitBtn:disabled,
#kh-karte .kh-karte__submitBtn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#kh-karte .kh-karte__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-right: 8px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

#kh-karte .kh-karte__badge--required {
    background: #fee2e2;
    color: var(--karte-danger);
}

#kh-karte .kh-karte__badge--optional {
    background: #e0f2fe;
    color: #075985;
}

/* PC表示: ラベル左の補足（テキスト/画像）用スロット */
#kh-karte .kh-karte__thInner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* 2026-07-31: ？ヒントは見出しの左ではなく右端に置く（order + margin-left:auto で
   マークアップ順は変えずに右揃え配置にする）。tablet 以下では labelSide ごと非表示。 */
#kh-karte .kh-karte__labelSide {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    order: 2;
    margin-left: auto;
    width: 52px;
    min-height: 20px;
    color: var(--karte-subtext);
    font-size: 12px;
    line-height: 1.2;
    flex: 0 0 auto;
}

#kh-karte .kh-karte__labelMain {
    min-width: 0;
}

/* ラベル左の注釈ボタン */
#kh-karte .kh-karte__noteBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #111827;
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

#kh-karte .kh-karte__noteBtn:hover {
    border-color: #93c5fd;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.14);
}

/* 注釈モーダル内ヘッダー */
#kh-karte .kh-karte__noteModalHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

#kh-karte .kh-karte__noteModalTitle {
    font-size: 18px;
    font-weight: 900;
    color: #111827;
}

#kh-karte .kh-karte__noteModalBody {
    text-align: left;
    color: #111827;
    line-height: 1.8;
    white-space: pre-line;
}

#kh-karte .kh-karte__noteModalClose {
    width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   Tips（？）: ヒントを見ながらフォーム入力できるよう、全画面オーバーレイをやめて
   デスクトップは右の固定パネル、狭い画面は下からのシート。背面はクリックスルー。
   -------------------------------------------------------------------------- */
div#kh-karte-note-modal.kh-karte__modal--tipsSide {
    align-items: center;
    justify-content: flex-end;
    padding: 12px 0 12px 20px;
    z-index: 10080;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none;
    overflow: visible;
}

div#kh-karte-note-modal.kh-karte__modal--tipsSide[aria-hidden="false"] {
    display: flex;
}

div#kh-karte-note-modal.kh-karte__modal--tipsSide .kh-karte__modalContent.kh-karte__tipsPanel {
    pointer-events: auto;
    position: relative;
    z-index: 1001;
    width: min(100%, 420px);
    max-width: 420px;
    /* パネル全体の上限（本文は下記でさらに max-height し、長文は本文のみスクロール） */
    --kh-karte-tips-panel-max: min(88vh, 820px);
    max-height: var(--kh-karte-tips-panel-max);
    margin: 0;
    padding: 20px 22px 22px;
    text-align: left;
    border-radius: 18px 0 0 18px;
    box-shadow: -16px 0 48px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.06);
    align-self: center;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    animation: kh-karte-tipsSlideIn 0.26s ease-out;
}

div#kh-karte-note-modal.kh-karte__modal--tipsSide .kh-karte__noteModalHeader {
    flex-shrink: 0;
}

@keyframes kh-karte-tipsSlideIn {
    from {
        transform: translateX(20px);
        opacity: 0.82;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

div#kh-karte-note-modal.kh-karte__modal--tipsSide .kh-karte__noteModalBody {
    flex: 1 1 auto;
    min-height: 0;
    white-space: pre-line;
    /* タイトル・余白を除いた本文の最大高さ（超過分は縦スクロール） */
    max-height: min(
        58vh,
        480px,
        max(7.5rem, calc(var(--kh-karte-tips-panel-max, min(88vh, 820px)) - 110px))
    );
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
    margin-top: 10px;
    scrollbar-gutter: stable;
}

/* --------------------------------------------------------------------------
   事業目的：検索（テーブル内トグル + 右オーバーレイ）
   ・メイン幅は変更しない / チャット widget は展開中のみ非表示
   -------------------------------------------------------------------------- */
.kh-karte__shell {
    width: 100%;
    box-sizing: border-box;
}

#kh-karte .kh-karte__purposeSearchToggleRow > .kh-karte__purposeSearchToggleCell {
    padding: 16px 0 18px;
    vertical-align: top;
    /* Inner のグラデとつながるよう、わずかに青みのベース */
    background: #eef4fc;
    border-top: 1px solid var(--karte-border);
    border-bottom: 1px solid #e2e8f0;
}

#kh-karte .kh-karte__purposeSearchToggleInner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 親セル（#f8fafc）よりわずかに青みのあるトーン */
    background: linear-gradient(180deg, #e8f1fc 0%, #eff6ff 55%, #f4f8fc 100%);
    border-radius: 10px;
}

#kh-karte .kh-karte__purposeSearchToggleLead {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.65;
    color: var(--karte-text);
}

/* ボタン下配置用: やや小さめ・控えめにして、ボタンを主役に */
#kh-karte .kh-karte__purposeSearchToggleLead--below {
    font-size: 13.5px;
    font-weight: 500;
    color: #475569;
}

#kh-karte .kh-karte__purposeSearchToggleBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 20px 12px 22px;
    border-radius: 12px;
    border: 2px solid #1d4ed8;
    background: var(--karte-accent);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

#kh-karte .kh-karte__purposeSearchToggleBtnLabel {
    flex: 0 1 auto;
}

#kh-karte .kh-karte__purposeSearchToggleBtnIcon {
    display: inline-flex;
    flex-shrink: 0;
    line-height: 0;
    opacity: 0.95;
}

#kh-karte .kh-karte__purposeSearchToggleBtnSvg {
    display: block;
}

#kh-karte .kh-karte__purposeSearchToggleBtn:hover {
    background: #1d4ed8;
    border-color: #1e40af;
    box-shadow: 0 6px 18px rgba(29, 78, 216, 0.5);
}

#kh-karte .kh-karte__purposeSearchToggleBtn:focus {
    outline: none;
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(37, 99, 235, 0.45);
}

/* 右上固定の「しおり」トグル（テーブル外から開閉）— PC は縦を主に大きく、横は控えめ */
#kh-karte-purpose-search-tab.kh-karte__purposeSearchBookmark {
    position: fixed;
    top: calc(88px + 14px);
    right: 0;
    z-index: 10060;
    width: 40px;
    min-height: 172px;
    border: 1px solid #1d4ed8;
    border-right: 0;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    cursor: pointer;
    box-shadow: -4px 8px 20px rgba(37, 99, 235, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 2px;
    transition: right 0.28s ease, background-color 0.2s ease, color 0.2s ease;
}

#kh-karte-purpose-search-tab.kh-karte__purposeSearchBookmark:hover {
    background: var(--karte-accent);
    color: #fff;
}

#kh-karte-purpose-search-tab.kh-karte__purposeSearchBookmark:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25), -4px 8px 20px rgba(37, 99, 235, 0.18);
}

#kh-karte-purpose-search-tab .kh-karte__purposeSearchBookmarkText {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.1em;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

body.kh-karte-purpose-search-open #kh-karte-purpose-search-tab.kh-karte__purposeSearchBookmark {
    right: min(var(--karte-purpose-search-panel-width), 100vw);
}

/* オーバーレイ（#kh-karte 内だが fixed でビューポート基準） */
#kh-karte-purpose-search-overlay.kh-karte__purposeSearchOverlay {
    position: fixed;
    --kh-karte-purpose-search-top: 88px;
    top: var(--kh-karte-purpose-search-top);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10050;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

#kh-karte-purpose-search-overlay.kh-karte__purposeSearchOverlay.is-open {
    visibility: visible;
    pointer-events: none;
    opacity: 1;
}

#kh-karte-purpose-search-overlay .kh-karte__purposeSearchOverlayBackdrop {
    display: none;
}

#kh-karte-purpose-search-overlay .kh-karte__purposeSearchSheet {
    position: relative;
    z-index: 1;
    width: min(var(--karte-purpose-search-panel-width), 100vw);
    max-width: 100%;
    height: 100%;
    min-height: 0;
    background: #fff;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
    transform: translateX(100%);
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    pointer-events: auto;
}

#kh-karte-purpose-search-overlay.kh-karte__purposeSearchOverlay.is-open .kh-karte__purposeSearchSheet {
    transform: translateX(0);
}

#kh-karte-purpose-search-overlay .kh-karte__purposeSearchPanel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

#kh-karte-purpose-search-overlay .kh-karte__purposeSearchPanelHeader {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

#kh-karte-purpose-search-overlay .kh-karte__purposeSearchPanelTitle {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.35;
}

#kh-karte-purpose-search-overlay .kh-karte__purposeSearchPanelClose {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#kh-karte-purpose-search-overlay .kh-karte__purposeSearchPanelClose:hover {
    background: #f1f5f9;
    color: #0f172a;
}

#kh-karte-purpose-search-overlay .kh-karte__purposeSearchPanelBody {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0 16px;
    overscroll-behavior: contain;
}

/* カテゴリ .dropdown-menu が親の overflow で切れないようにする（対応ブラウザのみ） */
#kh-karte-purpose-search-overlay .kh-karte__purposeSearchPanelBody:has(.kh-karte__purposeSearchCatWrap.is-open) {
    overflow: visible;
}

/* カテゴリ・キーワード・検索：結果スクロール時も見えるよう先頭に sticky */
#kh-karte-purpose-search .kh-karte__purposeSearchSticky {
    position: sticky;
    top: 0;
    z-index: 6;
    margin: 0 0 12px;
    padding: 0 0 10px;
    background: #fff;
    border-bottom: 1px solid #e8edf5;
    box-shadow: 0 8px 16px -8px rgba(15, 23, 42, 0.08);
}

#kh-karte-purpose-search .kh-karte__purposeSearchForm {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#kh-karte-purpose-search .kh-karte__purposeSearchLabel {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
}

/*
 * カテゴリ：ネイティブ <select> の「開いた一覧」は CSS で max-height できない。
 * div.dropdown-menu で疑似プルダウンし、高さ制限はここで効く。
 */
#kh-karte-purpose-search .kh-karte__purposeSearchCatWrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    z-index: 2;
}

#kh-karte-purpose-search .kh-karte__purposeSearchKeywordRow {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

#kh-karte-purpose-search .kh-karte__purposeSearchKeywordRow .kh-karte__purposeSearchInput {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
}

#kh-karte-purpose-search .kh-karte__purposeSearchCatTrigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 8px 10px;
    font-size: 15px;
    line-height: 1.4;
    font-family: inherit;
    text-align: left;
    border: 1px solid var(--karte-border);
    border-radius: 10px;
    background: #fff;
    color: var(--karte-text);
    cursor: pointer;
}

#kh-karte-purpose-search .kh-karte__purposeSearchCatTriggerText {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#kh-karte-purpose-search .kh-karte__purposeSearchCatChevron {
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--karte-subtext, #6b7280);
    transition: transform 0.2s ease;
}

#kh-karte-purpose-search .kh-karte__purposeSearchCatWrap.is-open .kh-karte__purposeSearchCatChevron {
    transform: rotate(180deg);
}

#kh-karte-purpose-search .kh-karte__purposeSearchCatTrigger:hover {
    border-color: #c5d0e0;
}

#kh-karte-purpose-search .kh-karte__purposeSearchCatTrigger:focus {
    outline: none;
    border-color: var(--karte-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

#kh-karte-purpose-search .kh-karte__purposeSearchCatPanel.dropdown-menu,
#kh-karte-purpose-search .dropdown-menu.kh-karte__purposeSearchCatPanel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 50;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    border: 1px solid var(--karte-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    /* PC でも十分長く、かつウィンドウ高に追従（大画面は上限で抑える） */
    max-height: min(52vh, 440px);
    max-height: min(52dvh, 440px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Bootstrap 等の .dropdown-menu { display:none } より優先して開いたとき表示する */
#kh-karte-purpose-search .kh-karte__purposeSearchCatPanel.dropdown-menu:not([hidden]) {
    display: block;
}

#kh-karte-purpose-search .kh-karte__purposeSearchCatOption {
    display: block;
    width: 100%;
    margin: 0;
    padding: 10px 14px;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 15px;
    line-height: 1.45;
    text-align: left;
    color: var(--karte-text);
    cursor: pointer;
}

#kh-karte-purpose-search .kh-karte__purposeSearchCatOption:hover,
#kh-karte-purpose-search .kh-karte__purposeSearchCatOption:focus {
    outline: none;
    background: #f1f5f9;
}

#kh-karte-purpose-search .kh-karte__purposeSearchCatOption:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.35);
}

#kh-karte-purpose-search .kh-karte__purposeSearchLabelText {
    font-size: 13px;
    font-weight: 800;
    color: #334155;
}

#kh-karte-purpose-search .kh-karte__purposeSearchSubmit {
    flex: 0 0 auto;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: auto;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--karte-accent, #2563eb);
    background: var(--karte-accent, #2563eb);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}

#kh-karte-purpose-search .kh-karte__purposeSearchSubmit:hover {
    filter: brightness(1.05);
}

/* キーワード行の「閉じる」：スマホのボトムシート専用（PC はヘッダーの × で閉じる） */
#kh-karte-purpose-search .kh-karte__purposeSearchKeywordRow .kh-karte__purposeSearchInlineClose {
    display: none;
}

/* キーワード見出しのスマホ用差し替え（PC は「キーワード」だけ出す） */
#kh-karte-purpose-search .kh-karte__purposeSearchLabelText.kh-karte__purposeSearchLabelText--mobile {
    display: none;
}

#kh-karte-purpose-search .kh-karte__purposeSearchSubmit:disabled {
    opacity: 0.55;
    cursor: wait;
}

#kh-karte-purpose-search .kh-karte__purposeSearchHint {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 500;
    color: var(--karte-text, #1f2937);
}

#kh-karte-purpose-search .kh-karte__purposeSearchNote {
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.65;
    color: #64748b;
}

#kh-karte-purpose-search .kh-karte__purposeSearchError {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 13px;
    line-height: 1.5;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultsWrap {
    margin-top: 0;
    min-height: 0;
    position: relative;
}

/* 検索中スピナー */
#kh-karte-purpose-search .kh-karte__purposeSearchBusy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 16px;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
}

/* 属性 hidden より詳細度の高いセレクタで display を上書きしているため、
   明示的に hidden のときは非表示にする（id + class への指定を打ち消す） */
#kh-karte-purpose-search .kh-karte__purposeSearchBusy[hidden],
#kh-karte-purpose-search .kh-karte__purposeSearchEmpty[hidden],
#kh-karte-purpose-search .kh-karte__purposeSearchEmptyReset[hidden] {
    display: none !important;
}

#kh-karte-purpose-search .kh-karte__purposeSearchBusySpinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid #dbeafe;
    border-top-color: #1d4ed8;
    animation: khPurposeBusySpin 0.85s linear infinite;
}

@keyframes khPurposeBusySpin {
    to { transform: rotate(360deg); }
}

/* 検索結果ゼロのとき中央に大きく表示 */
#kh-karte-purpose-search .kh-karte__purposeSearchEmpty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 56px 20px;
    text-align: center;
    min-height: 200px;
}

#kh-karte-purpose-search .kh-karte__purposeSearchEmptyMsg {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

#kh-karte-purpose-search .kh-karte__purposeSearchEmptyReset {
    appearance: none;
    border: 2px solid #1d4ed8;
    background: #ffffff;
    color: #1d4ed8;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#kh-karte-purpose-search .kh-karte__purposeSearchEmptyReset:hover,
#kh-karte-purpose-search .kh-karte__purposeSearchEmptyReset:focus {
    background: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultsMeta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResults {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultItem {
    margin: 0;
    padding: 0;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultBtn {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--karte-border, #e2e8f0);
    background: #fff;
    cursor: pointer;
    font: inherit;
    color: var(--karte-text, #0f172a);
    transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultBtn:hover {
    border-color: var(--karte-accent, #2563eb);
    background: #f8fafc;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultBtn--added {
    background: #dbeafe;
    border-color: #3b82f6;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultBtn--added:hover {
    background: #bfdbfe;
    border-color: #2563eb;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultBtn:focus-visible {
    outline: 2px solid var(--karte-accent, #2563eb);
    outline-offset: 2px;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultText {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    word-break: break-word;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultMark {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin-top: 1px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-sizing: border-box;
    pointer-events: none;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultMark svg {
    display: block;
    opacity: 0;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultBtn--added .kh-karte__purposeSearchResultMark {
    border-color: #2563eb;
    background: #2563eb;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultBtn--added .kh-karte__purposeSearchResultMark svg {
    opacity: 1;
}

#kh-karte-purpose-search .kh-karte__purposeSearchResultMeta {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #64748b;
}

/* 事業目的入力欄：DB サジェスト（fixed、オーバーレイより前面） */
#kh-karte-purpose-suggest-popover.kh-karte__purposeSuggestPopover {
    position: fixed;
    z-index: 10080;
    margin: 0;
    max-height: min(240px, 42vh);
    overflow-y: auto;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
}

#kh-karte-purpose-suggest-popover.kh-karte__purposeSuggestPopover > li {
    margin: 0;
    border-bottom: 1px solid #e2e8f0;
}

#kh-karte-purpose-suggest-popover.kh-karte__purposeSuggestPopover > li:last-child {
    border-bottom: none;
}

.kh-karte__purposeSuggestOption {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: none;
    background: #fff;
    font-size: 14px;
    line-height: 1.45;
    color: var(--karte-text, #0f172a);
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

.kh-karte__purposeSuggestOption:hover,
.kh-karte__purposeSuggestOption:focus-visible {
    background: #eff6ff;
    outline: none;
}

#kh-karte-purpose-search .kh-karte__purposeSearchPager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

#kh-karte-purpose-search .kh-karte__purposeSearchPagerBtn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

#kh-karte-purpose-search .kh-karte__purposeSearchPagerBtn:hover:not(:disabled) {
    background: #e2e8f0;
}

#kh-karte-purpose-search .kh-karte__purposeSearchPagerBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#kh-karte-purpose-search .kh-karte__purposeSearchPagerInfo {
    font-size: 13px;
    color: #475569;
}

#kh-karte-purpose-search .kh-karte__inputFull,
#kh-karte-purpose-search .kh-karte__purposeSearchInput {
    width: 100%;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--karte-border);
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.45;
    color: var(--karte-text);
    background: #fff;
    box-sizing: border-box;
}

#kh-karte-purpose-search .kh-karte__purposeSearchKeywordRow .kh-karte__purposeSearchSubmit {
    padding: 6px 10px;
}

#kh-karte-purpose-search .kh-karte__purposeSearchInput:focus {
    outline: none;
    border-color: var(--karte-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/*
 * 展開中：必要なときだけメインを左へずらす。
 * サイドバー左端との間隔を --karte-purpose-search-main-gap に保つための最小限だけ移動する。
 * 画面が十分広く、初期配置のままで間隔を満たせる場合は移動しない。
 * transform は使わない（#kh-karte 内の position:fixed 追従バーの基準が壊れるため）。
 */
body.kh-karte-purpose-search-open #kh-karte {
    left: calc(
        -1 * min(
            max(0px, calc((100vw - var(--karte-content-max-width)) / 2)),
            max(
                0px,
                calc(
                    min(var(--karte-purpose-search-panel-width), 100vw)
                    + var(--karte-purpose-search-main-gap)
                    - max(0px, calc((100vw - var(--karte-content-max-width)) / 2))
                )
            )
        )
    );
}

/* 展開中：UserLocal 等の AI チャット iframe（極端に高い z-index でも隠す） */
body.kh-karte-purpose-search-open iframe[title="AI Chat Support"],
body.kh-karte-purpose-search-open iframe.ul-widget-main-window {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

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

    #kh-karte-purpose-search-overlay.kh-karte__purposeSearchOverlay,
    #kh-karte-purpose-search-overlay .kh-karte__purposeSearchSheet {
        transition: none;
    }
}

/* 申込み制限モーダル */
#kh-karte .kh-karte__restrictionBody {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    padding: 14px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    overscroll-behavior: contain;
}

#kh-karte .kh-karte__restrictionBody strong {
    color: #0f172a;
}

#kh-karte .kh-karte__restrictionBody p:first-child {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-weight: 900;
}

#kh-karte .kh-karte__restrictionBody p.kh-karte__restrictionKeyRule {
    font-size: 16px;
    line-height: 1.55;
    font-weight: 900;
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fef2f2;
    border: 2px solid #f87171;
    border-left-width: 5px;
    border-left-color: #dc2626;
    color: #7f1d1d;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.12);
}

/* なりすまし疑い時のお断り（キールールより一段軽く、末尾の送付先注意よりコンパクト） */
#kh-karte .kh-karte__restrictionBody p.kh-karte__restrictionCallout {
    margin: 0 0 14px;
    padding: 12px 14px 12px 16px;
    border-radius: 12px;
    background: linear-gradient(145deg, #fffbeb 0%, #fef9c3 55%, #fef08a 100%);
    border: 1px solid #fbbf24;
    border-left-width: 5px;
    border-left-color: #ca8a04;
    color: #713f12;
    font-size: 14px;
    line-height: 1.65;
    font-weight: 800;
    box-shadow: 0 3px 14px rgba(202, 138, 4, 0.14);
}

/* 黄色背景のコールアウト内で「なりすまし」を赤チップで強調 */
#kh-karte .kh-karte__restrictionBody p.kh-karte__restrictionCallout .kh-karte__restrictionCalloutMark {
    display: inline-block;
    margin: 0 3px;
    padding: 1px 8px 2px;
    border-radius: 4px;
    background: #b91c1c;
    color: #fff;
    font-size: 1.05em;
    font-weight: 900;
    letter-spacing: 0.04em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* 「転送不可」は黄色背景 + 赤太字で強調（注意事項の <li> と 書類の送付先ノートの両方で使う）。
   2026-07-31: 旧「転送不要」表記から差し替え。
   送付先ノート側の地色（琥珀のグラデーション）に沈まないよう、縁取りを 1px 入れる。 */
#kh-karte .kh-karte__restrictionBody .kh-karte__restrictionTensou {
    display: inline-block;
    padding: 0 5px 1px;
    border-radius: 3px;
    background: #ffee58;
    box-shadow: 0 0 0 1px rgba(120, 53, 15, 0.28);
    color: #b91c1c;
    font-weight: 900;
}

#kh-karte .kh-karte__restrictionBody p,
#kh-karte .kh-karte__restrictionBody li {
    font-size: 14px;
}

#kh-karte .kh-karte__restrictionBody p {
    margin: 0 0 14px;
}

#kh-karte .kh-karte__restrictionBody ul,
#kh-karte .kh-karte__restrictionBody ol {
    margin: 8px 0 14px 1.2em;
}

#kh-karte .kh-karte__restrictionBody ul li,
#kh-karte .kh-karte__restrictionBody ol li {
    margin: 0 0 6px;
}

#kh-karte .kh-karte__restrictionNote {
    margin-top: 20px;
    margin-bottom: 0;
    padding: 16px 18px 18px;
    border-radius: 14px;
    background: linear-gradient(165deg, #fffbeb 0%, #fde68a 45%, #fcd34d 100%);
    border: 2px solid #d97706;
    border-left-width: 6px;
    border-left-color: #b45309;
    color: #451a03;
    font-size: 15px;
    line-height: 1.65;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(180, 83, 9, 0.22);
}

#kh-karte .kh-karte__restrictionNote__lead {
    display: block;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(180, 83, 9, 0.35);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #92400e;
}

#kh-karte .kh-karte__restrictionFooter {
    margin-top: 14px;
    display: flex;
    justify-content: center;
}

#kh-karte .kh-karte__restrictionAccept {
    min-width: 240px;
    min-height: 48px;
    padding: 12px 20px;
    border: none;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

#kh-karte .kh-karte__restrictionAccept[disabled] {
    opacity: 0.22;
    filter: grayscale(0.6);
    cursor: not-allowed;
    box-shadow: none;
}

/* 事業目的 7〜25（段階表示・初期 hidden） */
#kh-karte tr.kh-karte__purposeRevealRow[hidden] {
    display: none !important;
}

/* 事業目的: 入力＋右側 縦書き削除ボタン */
#kh-karte .kh-karte__purposeFieldRow {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

#kh-karte .kh-karte__purposeFieldRow .kh-karte__purposeInput {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    max-width: none;
}

#kh-karte .kh-karte__purposeDeleteBtn {
    flex: 0 0 auto;
    align-self: stretch;
    min-height: 48px;
    padding: 10px 7px;
    margin: 0;
    border: none;
    border-radius: 10px;
    background: #dc2626;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.1em;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

#kh-karte .kh-karte__purposeDeleteBtn:hover {
    background: #b91c1c;
}

#kh-karte .kh-karte__purposeDeleteBtn:focus-visible {
    outline: 2px solid #fca5a5;
    outline-offset: 2px;
}

#kh-karte .kh-karte__purposeDeleteBtn.kh-karte__purposeDeleteBtn--inactive {
    display: none !important;
}

/* 下書き自動復元中モーダル（#kh-karte 内 / body 直下のどちらでも） */
#kh-karte .kh-karte__draftRestoreSpinnerWrap,
#kh-karte-draft-modal .kh-karte__draftRestoreSpinnerWrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 8px 28px;
}

#kh-karte .kh-karte__draftSpinner,
#kh-karte-draft-modal .kh-karte__draftSpinner {
    width: 44px;
    height: 44px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    box-sizing: border-box;
    animation: kh-karte-draft-spin 0.65s linear infinite;
}

@keyframes kh-karte-draft-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    #kh-karte .kh-karte__draftSpinner,
    #kh-karte-draft-modal .kh-karte__draftSpinner {
        animation: none;
        border-top-color: #e2e8f0;
        border-right-color: #2563eb;
    }
}

#kh-karte .kh-karte__draftModalMessage,
#kh-karte-draft-modal .kh-karte__draftModalMessage {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 700;
    text-align: center;
    color: #0f172a;
}

/* モーダル表示中は背景スクロールを止める */
html.kh-karte--modalOpen,
body.kh-karte--modalOpen {
    overflow: hidden;
}

#kh-karte input[type="text"],
#kh-karte input[type="email"],
#kh-karte input[type="number"],
#kh-karte input[type="tel"],
#kh-karte select,
#kh-karte textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: var(--karte-text);
    -webkit-text-fill-color: var(--karte-text);
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* 未選択の必須 select（プレースホルダ相当）は本文より薄く */
#kh-karte select:required:invalid,
form[data-kh-live-validation] select:required:invalid {
    color: var(--karte-placeholder);
    -webkit-text-fill-color: var(--karte-placeholder);
}

#kh-karte select option {
    color: var(--karte-text);
}

/* テーマ側の select 色上書き対策（職業は選択後のみ本文色を強制） */
#kh-karte select.kh-karte__memberJob:valid,
#kh-karte #kh-yaritori-member-job:valid {
    color: var(--karte-text);
    -webkit-text-fill-color: var(--karte-text);
}

#kh-karte input::placeholder,
#kh-karte textarea::placeholder,
form[data-kh-live-validation] input::placeholder,
form[data-kh-live-validation] textarea::placeholder {
    color: var(--karte-placeholder);
    -webkit-text-fill-color: var(--karte-placeholder);
    opacity: 1;
}

#kh-karte input::-webkit-input-placeholder,
#kh-karte textarea::-webkit-input-placeholder,
form[data-kh-live-validation] input::-webkit-input-placeholder,
form[data-kh-live-validation] textarea::-webkit-input-placeholder {
    color: var(--karte-placeholder);
    -webkit-text-fill-color: var(--karte-placeholder);
}

#kh-karte input::-moz-placeholder,
#kh-karte textarea::-moz-placeholder,
form[data-kh-live-validation] input::-moz-placeholder,
form[data-kh-live-validation] textarea::-moz-placeholder {
    color: var(--karte-placeholder);
    opacity: 1;
}

#kh-karte input:-ms-input-placeholder,
#kh-karte textarea:-ms-input-placeholder,
form[data-kh-live-validation] input:-ms-input-placeholder,
form[data-kh-live-validation] textarea:-ms-input-placeholder {
    color: var(--karte-placeholder);
}

/* フォーカス中はプレースホルダ（入力例）を表示しない */
#kh-karte input:focus::placeholder,
#kh-karte textarea:focus::placeholder,
form[data-kh-live-validation] input:focus::placeholder,
form[data-kh-live-validation] textarea:focus::placeholder {
    color: transparent;
    -webkit-text-fill-color: transparent;
    opacity: 0;
}

#kh-karte input:focus::-webkit-input-placeholder,
#kh-karte textarea:focus::-webkit-input-placeholder,
form[data-kh-live-validation] input:focus::-webkit-input-placeholder,
form[data-kh-live-validation] textarea:focus::-webkit-input-placeholder {
    color: transparent;
    -webkit-text-fill-color: transparent;
    opacity: 0;
}

#kh-karte input:focus::-moz-placeholder,
#kh-karte textarea:focus::-moz-placeholder,
form[data-kh-live-validation] input:focus::-moz-placeholder,
form[data-kh-live-validation] textarea:focus::-moz-placeholder {
    color: transparent;
    opacity: 0;
}

#kh-karte input:focus:-ms-input-placeholder,
#kh-karte textarea:focus:-ms-input-placeholder,
form[data-kh-live-validation] input:focus:-ms-input-placeholder,
form[data-kh-live-validation] textarea:focus:-ms-input-placeholder {
    color: transparent;
    opacity: 0;
}

#kh-karte input:focus,
#kh-karte select:focus,
#kh-karte textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
    background: #fff;
}

#kh-karte .kh-karte__splitCol {
    width: calc(50% - 8px);
    float: left;
}

#kh-karte .kh-karte__splitCol--left {
    margin-right: 16px;
}

#kh-karte .kh-karte__tel,
#kh-karte .kh-karte__birthday {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

#kh-karte .kh-karte__tel input {
    width: auto;
    min-width: 80px;
    text-align: center;
}

#kh-karte .kh-karte__birthday select {
    width: auto;
    min-width: 110px;
}

.kh-karte-establish-scope.kh-karte__establishWish {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.kh-karte-establish-scope .kh-karte__establishCal {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.kh-karte-establish-scope .kh-karte__establishCalToggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid var(--karte-border);
    border-radius: 8px;
    background: var(--karte-card);
    font-size: 15px;
    color: var(--karte-text);
    cursor: pointer;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kh-karte-establish-scope .kh-karte__establishCalToggle:hover {
    border-color: var(--karte-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kh-karte-establish-scope .kh-karte__establishCalToggle:focus {
    outline: 2px solid var(--karte-accent);
    outline-offset: 2px;
}

.kh-karte-establish-scope .kh-karte__establishCalToggleLabel {
    font-weight: 600;
    flex-shrink: 0;
}

.kh-karte-establish-scope .kh-karte__establishCalToggleValue {
    color: var(--karte-subtext);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kh-karte-establish-scope .kh-karte__establishCalPopover {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    z-index: 40;
    width: min(100vw - 24px, 400px);
    padding: 8px 10px;
    border: 1px solid var(--karte-border);
    border-radius: 10px;
    background: var(--karte-card);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
}

.kh-karte-establish-scope .kh-karte__establishCalPopover[hidden] {
    display: none !important;
}

.kh-karte-establish-scope .kh-karte__establishCalNotice {
    margin: 0 0 6px;
    padding: 6px 8px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid var(--karte-border);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
    color: var(--karte-text);
    text-align: center;
}

.kh-karte-establish-scope .kh-karte__establishCalNoticeLine {
    margin: 0;
}

.kh-karte-establish-scope .kh-karte__establishCalNoticeLine + .kh-karte__establishCalNoticeLine {
    margin-top: 4px;
}

.kh-karte-establish-scope .kh-karte__establishCalHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}

.kh-karte-establish-scope .kh-karte__establishCalMonth {
    font-weight: 700;
    font-size: 15px;
    flex: 1;
    text-align: center;
}

.kh-karte-establish-scope .kh-karte__establishCalNav {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--karte-border);
    border-radius: 8px;
    background: var(--karte-card);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--karte-text);
}

.kh-karte-establish-scope .kh-karte__establishCalNav:hover:not(:disabled) {
    background: #f5f5f5;
}

.kh-karte-establish-scope .kh-karte__establishCalNav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.kh-karte-establish-scope .kh-karte__establishCalWeekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: var(--karte-subtext);
}

.kh-karte-establish-scope .kh-karte__establishCalWd--sun,
.kh-karte-establish-scope .kh-karte__establishCalWd--sat {
    color: #ea580c;
}

.kh-karte-establish-scope .kh-karte__establishCalGrid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.kh-karte-establish-scope .kh-karte__establishCalPad {
    min-height: 32px;
}

.kh-karte-establish-scope .kh-karte__establishCalDay {
    min-height: 32px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--karte-text);
}

.kh-karte-establish-scope .kh-karte__establishCalDay:hover:not(:disabled) {
    background: #e3f2fd;
    border-color: var(--karte-accent);
}

/* 土日・祝日・年末年始：背景は通常日と同じ、文字のみ赤オレンジ */
.kh-karte-establish-scope .kh-karte__establishCalDay--red {
    background: #f8fafc;
    border-color: #e5e7eb;
    box-shadow: none;
    color: #ea580c;
    font-weight: 700;
}

.kh-karte-establish-scope .kh-karte__establishCalDay--red:hover:not(:disabled) {
    background: #e3f2fd;
    border-color: var(--karte-accent);
    color: #ea580c;
}

/* 選択日は塗りつぶさずアクセントの枠（リング）で示す */
.kh-karte-establish-scope .kh-karte__establishCalDay--selected {
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 3px var(--karte-accent);
}

.kh-karte-establish-scope .kh-karte__establishCalDay--selected:not(.kh-karte__establishCalDay--red) {
    background: #f8fafc;
    color: var(--karte-text);
    border-color: #e5e7eb;
    font-weight: 700;
}

.kh-karte-establish-scope .kh-karte__establishCalDay--selected:not(.kh-karte__establishCalDay--red):hover:not(:disabled) {
    background: #e3f2fd;
    border-color: var(--karte-accent);
    box-shadow: 0 0 0 3px var(--karte-accent);
}

.kh-karte-establish-scope .kh-karte__establishCalDay--selected.kh-karte__establishCalDay--red {
    background: #f8fafc;
    color: #ea580c;
    border-color: #e5e7eb;
    box-shadow: 0 0 0 3px var(--karte-accent);
    font-weight: 700;
}

.kh-karte-establish-scope .kh-karte__establishCalDay--selected.kh-karte__establishCalDay--red:hover:not(:disabled) {
    background: #e3f2fd;
    border-color: var(--karte-accent);
    color: #ea580c;
    box-shadow: 0 0 0 3px var(--karte-accent);
}

.kh-karte-establish-scope .kh-karte__establishCalDay--out {
    opacity: 0.28;
    cursor: not-allowed;
    background: #f0f0f0;
}

#kh-establish-red-confirm-modal.kh-karte__modal--establishRedConfirm {
    display: none;
    position: fixed;
    z-index: 2147483600;
    inset: 0;
    padding: 24px;
    margin: 0;
    box-sizing: border-box;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    overflow: auto;
    align-items: center;
    justify-content: center;
}

#kh-establish-red-confirm-modal.kh-karte__modal--establishRedConfirm[aria-hidden="false"] {
    display: flex !important;
}

#kh-establish-red-confirm-modal .kh-karte__establishRedModalContent {
    background: var(--karte-card);
    margin: auto;
    padding: 28px 24px 24px;
    border: 1px solid var(--karte-border);
    width: 100%;
    max-width: 420px;
    text-align: center;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
    box-sizing: border-box;
}

#kh-establish-red-confirm-modal .kh-karte__noteModalHeader {
    margin-bottom: 0;
}

#kh-establish-red-confirm-modal .kh-karte__noteModalTitle {
    font-size: 18px;
    font-weight: 900;
    color: var(--karte-text);
}

#kh-establish-red-confirm-modal .kh-karte__establishRedModalBodyWrap {
    margin: 12px 0 20px;
    text-align: left;
}

#kh-establish-red-confirm-modal .kh-karte__establishRedModalBodyLine {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--karte-text);
}

#kh-establish-red-confirm-modal .kh-karte__establishRedModalBodyLine:last-child {
    margin-bottom: 0;
}

#kh-establish-red-confirm-modal .kh-karte__modalButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

#kh-establish-red-confirm-modal .kh-karte__modalBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    min-height: 48px;
    margin: 0;
    padding: 10px 18px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 999px;
    font-weight: 700;
    font-size: 15px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#kh-establish-red-confirm-modal .kh-karte__modalBtn--yes {
    background-color: #f59e0b;
    color: #fff;
}

#kh-establish-red-confirm-modal .kh-karte__modalBtn--no {
    background-color: #64748b;
    color: #fff;
}

#kh-establish-red-confirm-modal .kh-karte__modalBtn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

#kh-karte .kh-karte__birthday--member select.kh-karte__memberBirthY {
    min-width: 118px;
    vertical-align: top;
}

#kh-karte .kh-karte__birthdayUnit {
    margin-right: 4px;
    font-size: 15px;
    color: var(--karte-text);
}

#kh-karte .kh-karte__memberBirthError {
    margin: 8px 0 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
    color: var(--karte-danger);
    clear: both;
}

#kh-karte .kh-karte__memberBirthError[hidden] {
    display: none !important;
}

/* メンバー②以降・代表取締役の電話（birth-by-rep.js の行内エラー。ライブ検証の .kh-karte__liveValidation-feedback と同系の強調） */
#kh-karte .kh-karte__memberRepPhoneError {
    margin: 8px 0 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--karte-danger);
    clear: both;
}

#kh-karte .kh-karte__memberRepPhoneError[hidden] {
    display: none !important;
}

#kh-karte .kh-karte__number {
    display: inline-block;
    width: 200px;
    max-width: 100%;
    margin-right: 8px;
}

#kh-karte .kh-karte__address100 input {
    width: 100%;
}

#kh-karte .kh-karte__policy {
    margin: 18px 0 0;
    text-align: center;
}

#kh-karte .kh-karte__policy label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
}

#kh-karte .kh-karte__policy input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* 同意チェックのライブ検証: チェック右ではなく行の下に表示 */
#kh-karte .kh-karte__policy .kh-karte__liveValidation-feedback {
    display: none;
    width: 100%;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

#kh-karte .kh-karte__btnRow {
    margin: 28px 0 0;
    text-align: center;
}

#kh-karte .kh-karte__preTransferConsult {
    margin: 28px auto 0;
    max-width: 640px;
    padding: 20px 22px 22px;
    text-align: left;
    font-size: 14px;
    line-height: 1.75;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-sizing: border-box;
}

#kh-karte .kh-karte__preTransferConsultTitle {
    margin: 0 0 0;
    padding: 0 0 14px 14px;
    border-left: 4px solid var(--karte-main);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.55;
    letter-spacing: 0.02em;
    color: #0f172a;
}

#kh-karte .kh-karte__preTransferConsultList {
    margin: 0;
    padding: 16px 0 2px 0;
    list-style: none;
    border-top: 1px solid #e2e8f0;
}

#kh-karte .kh-karte__preTransferConsultList li {
    position: relative;
    margin: 0.5em 0;
    padding: 8px 10px 8px 1.15em;
    border-radius: 8px;
}

#kh-karte .kh-karte__preTransferConsultList li::before {
    content: "・";
    position: absolute;
    left: 0;
    top: 8px;
    color: var(--karte-main);
    font-weight: 900;
    line-height: 1.75;
}

#kh-karte .kh-karte__preTransferConsultList li:nth-child(odd) {
    background: rgba(255, 255, 255, 0.72);
}

#kh-karte .kh-karte__preTransferConsultEm {
    font-weight: 900;
    color: #0f172a;
}

#kh-karte .kh-karte__submitBtn,
#kh-karte input[type="submit"].kh-karte__submitBtn,
#kh-karte-draft-modal .kh-karte__submitBtn,
#kh-karte-draft-modal input[type="submit"].kh-karte__submitBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 320px;
    max-width: 100%;
    min-height: 58px;
    padding: 14px 28px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--karte-main) 0%, var(--karte-accent) 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

#kh-karte .kh-karte__submitBtn:hover,
#kh-karte input[type="submit"].kh-karte__submitBtn:hover,
#kh-karte-draft-modal .kh-karte__submitBtn:hover,
#kh-karte-draft-modal input[type="submit"].kh-karte__submitBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.26);
}

/* 送信ボタン直下のエラー表示
   - サーバー側検証／例外の結果（PHP 出力）と、クライアント側ライブ検証の停止理由（JS 出力）の
     両方をここに集約する。 */
#kh-karte .kh-karte__submitError {
    margin: 12px 0 24px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--karte-danger);
    font-weight: 700;
    line-height: 1.6;
}

#kh-karte .kh-karte__submitError[hidden] {
    display: none !important;
}

#kh-karte .kh-karte__submitErrorTitle {
    font-size: 15px;
    font-weight: 800;
    margin: 0 0 6px;
    text-align: center;
}

#kh-karte .kh-karte__submitErrorList {
    margin: 0;
    padding: 0 0 0 1.25em;
    font-weight: 600;
}

#kh-karte .kh-karte__submitErrorList li {
    margin: 4px 0;
}

#kh-karte .kh-karte__submitErrorText {
    margin: 0;
    text-align: center;
    font-weight: 700;
}

#kh-karte .kh-karte__error {
    display: block !important;
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    text-align: center;
    color: var(--karte-danger);
    font-weight: 700;
}

#kh-karte #kh-karte-error-txt,
#kh-karte #kh-karte-position-error,
#kh-karte #kh-karte-hassoutext,
#kh-karte .kh-karte__proxyApply,
#kh-karte #kh-karte-teltext {
    display: none;
}

#kh-karte .kh-karte__alertText {
    display: inline-block !important;
}

#kh-karte .kh-karte__spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 9999;
    width: 52px;
    height: 52px;
    margin: -26px 0 0 -26px;
    border: 6px solid rgba(30, 58, 138, 0.15);
    border-radius: 50%;
    border-top-color: var(--karte-accent);
    animation: spin 0.8s linear infinite;
}

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

/* 復元モーダルは JS で body 直下に移す。#kh-karte 外でも最前面・整形されるよう別定義 */
#kh-karte-draft-modal.kh-karte__modal {
    display: none;
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    padding: 24px;
    margin: 0;
    box-sizing: border-box;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    overflow: auto;
    align-items: center;
    justify-content: center;
}

#kh-karte-draft-modal.kh-karte__modal[aria-hidden="false"] {
    display: flex !important;
}

#kh-karte-draft-modal .kh-karte__modalContent {
    background: #fff;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid var(--karte-border);
    width: 100%;
    max-width: 820px;
    text-align: center;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    max-height: min(78vh, 620px);
    overflow: hidden;
    box-sizing: border-box;
}

#kh-karte-draft-modal .kh-karte__noteModalHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

#kh-karte-draft-modal .kh-karte__noteModalTitle {
    font-size: 18px;
    font-weight: 900;
    color: #111827;
}

#kh-karte .kh-karte__modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    padding: 24px;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

/* aria-hidden で開閉を統一 */
#kh-karte .kh-karte__modal[aria-hidden="false"] {
    display: flex;
}

#kh-karte .kh-karte__modalContent {
    background: #fff;
    margin: 0;
    padding: 28px;
    border: 1px solid var(--karte-border);
    width: 100%;
    max-width: 820px;
    text-align: center;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    /* モーダル縦幅を少し短めに */
    max-height: min(78vh, 620px);
    overflow: hidden;
}

#kh-karte .kh-karte__modalDemerit {
    display: inline-block;
    margin-top: 16px;
    padding: 16px 18px;
    text-align: left;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 14px;
}

#kh-karte .kh-karte__modalBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    min-height: 48px;
    margin: 8px;
    padding: 10px 18px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 999px;
    font-weight: 700;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#kh-karte .kh-karte__modalBtn--yes2 {
    background-color: #16a34a;
    color: #fff;
}

#kh-karte .kh-karte__modalBtn--yes {
    background-color: #f59e0b;
    color: #fff;
}

#kh-karte .kh-karte__modalBtn--no {
    background-color: #ef4444;
    color: #fff;
}

#kh-karte .kh-karte__modalBtn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#kh-karte .kh-karte__modalButtons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-top: 14px;
}

#kh-karte-member-additional-inv-modal .kh-karte__memberAdditionalInvModalBody {
    text-align: left;
    line-height: 1.65;
    margin: 0;
    overflow: auto;
    max-height: min(50vh, 320px);
}

#kh-karte-member-additional-inv-modal .kh-karte__memberAdditionalInvModalBody p {
    margin: 0 0 12px;
}

#kh-karte-member-additional-inv-modal .kh-karte__memberAdditionalInvModalBody p:last-child {
    margin-bottom: 0;
}

#kh-karte-member-remove-modal.kh-karte__modal--memberRemoveConfirm .kh-karte__memberRemoveModalContent {
    max-width: 420px;
    max-height: none;
    text-align: center;
}

#kh-karte-member-remove-modal .kh-karte__memberRemoveModalBody {
    margin: 8px 0 4px;
    padding: 0 8px;
}

#kh-karte-member-remove-modal .kh-karte__memberRemoveModalMessage {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.65;
    color: #334155;
    text-align: center;
}

#kh-karte-member-remove-modal .kh-karte__memberRemoveModalButtons {
    margin-top: 20px;
    gap: 8px;
}

#kh-karte-member-remove-modal .kh-karte__memberRemoveModalBtnCancel {
    min-width: 140px;
    background-color: #e5e7eb;
    color: #374151;
}

#kh-karte-member-remove-modal .kh-karte__memberRemoveModalBtnCancel:hover {
    opacity: 0.92;
}

#kh-karte-member-remove-modal .kh-karte__memberRemoveModalBtnConfirm {
    min-width: 140px;
    background-color: #dc2626;
    color: #fff;
}

#kh-karte-member-remove-modal .kh-karte__memberRemoveModalBtnConfirm:hover {
    opacity: 0.92;
}

#kh-karte-capital-low-modal.kh-karte__modal--capitalLowConfirm .kh-karte__capitalLowModalContent {
    max-width: 540px;
    max-height: min(85vh, 640px);
    text-align: left;
}

#kh-karte-capital-low-modal .kh-karte__noteModalHeader {
    text-align: center;
}

#kh-karte-capital-low-modal .kh-karte__noteModalTitle {
    font-size: 17px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.35;
}

#kh-karte-capital-low-modal .kh-karte__capitalLowModalBody {
    margin: 12px 0 0;
    padding: 0 4px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

#kh-karte-capital-low-modal .kh-karte__capitalLowModalLead {
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 1.65;
    font-weight: 700;
    color: #334155;
}

#kh-karte-capital-low-modal .kh-karte__capitalLowModalLead strong {
    color: #b45309;
    font-weight: 900;
}

#kh-karte-capital-low-modal .kh-karte__capitalLowModalList {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14.5px;
    line-height: 1.7;
    font-weight: 600;
    color: #1e293b;
}

#kh-karte-capital-low-modal .kh-karte__capitalLowModalList li {
    position: relative;
    padding-left: 1.25em;
    margin-bottom: 10px;
}

#kh-karte-capital-low-modal .kh-karte__capitalLowModalList li::before {
    content: "・";
    position: absolute;
    left: 0;
    top: 0;
    color: #1e293b;
}

#kh-karte-capital-low-modal .kh-karte__capitalLowModalList li:last-child {
    margin-bottom: 0;
}

#kh-karte-capital-low-modal .kh-karte__capitalLowModalButtons {
    margin-top: 22px;
    justify-content: center;
}

/* 事業目的7 到達時の警告モーダル（OK のみ） */
#kh-karte-purpose-warn-modal.kh-karte__modal--purposeWarn .kh-karte__purposeWarnModalContent {
    max-width: 600px;
    max-height: min(85vh, 680px);
    text-align: left;
}

#kh-karte-purpose-warn-modal .kh-karte__noteModalHeader {
    text-align: center;
}

#kh-karte-purpose-warn-modal .kh-karte__noteModalTitle {
    font-size: 17px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.35;
}

#kh-karte-purpose-warn-modal .kh-karte__purposeWarnModalBody {
    margin: 12px 0 0;
    padding: 0 4px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

#kh-karte-purpose-warn-modal .kh-karte__purposeWarnModalLead,
#kh-karte-purpose-warn-modal .kh-karte__purposeWarnModalMid,
#kh-karte-purpose-warn-modal .kh-karte__purposeWarnModalFoot {
    margin: 0 0 14px;
    font-size: 14.5px;
    line-height: 1.7;
    color: #1e293b;
}

#kh-karte-purpose-warn-modal .kh-karte__purposeWarnModalFoot {
    margin-bottom: 0;
    color: #334155;
}

#kh-karte-purpose-warn-modal .kh-karte__purposeWarnModalList {
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    font-size: 14.5px;
    line-height: 1.7;
    font-weight: 700;
    color: #0f172a;
}

#kh-karte-purpose-warn-modal .kh-karte__purposeWarnModalList li {
    position: relative;
    padding-left: 1.25em;
    margin-bottom: 6px;
}

#kh-karte-purpose-warn-modal .kh-karte__purposeWarnModalList li::before {
    content: "・";
    position: absolute;
    left: 0;
    top: 0;
    color: #0f172a;
}

#kh-karte-purpose-warn-modal .kh-karte__purposeWarnModalList li:last-child {
    margin-bottom: 0;
}

#kh-karte-purpose-warn-modal .kh-karte__purposeWarnModalButtons {
    margin-top: 22px;
    justify-content: center;
}

/* 決算月が設立（希望）月に近すぎる警告モーダル（OK のみ）。
   デザインは上の事業目的7 警告モーダルの使い回し。
   取締役の任期が 10 年以外のときの警告モーダル（#kh-karte-director-term-warn-modal）も
   同じ見た目なので、同じ規則に相乗りさせている（class 名は closingMonthWarn 系のまま）。 */
#kh-karte-closing-month-warn-modal.kh-karte__modal--closingMonthWarn .kh-karte__closingMonthWarnModalContent,
#kh-karte-director-term-warn-modal.kh-karte__modal--closingMonthWarn .kh-karte__closingMonthWarnModalContent {
    max-width: 600px;
    max-height: min(85vh, 680px);
    text-align: left;
}

#kh-karte-closing-month-warn-modal .kh-karte__noteModalHeader,
#kh-karte-director-term-warn-modal .kh-karte__noteModalHeader {
    text-align: center;
}

#kh-karte-closing-month-warn-modal .kh-karte__noteModalTitle,
#kh-karte-director-term-warn-modal .kh-karte__noteModalTitle {
    font-size: 17px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.35;
}

#kh-karte-closing-month-warn-modal .kh-karte__closingMonthWarnModalBody,
#kh-karte-director-term-warn-modal .kh-karte__closingMonthWarnModalBody {
    margin: 12px 0 0;
    padding: 0 4px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

#kh-karte-closing-month-warn-modal .kh-karte__closingMonthWarnModalLead,
#kh-karte-director-term-warn-modal .kh-karte__closingMonthWarnModalLead {
    margin: 0 0 14px;
    font-size: 14.5px;
    line-height: 1.7;
    color: #1e293b;
}

/* 月・年数が入る文（JS が本文を入れる）。空のときは余白ごと消す。 */
#kh-karte-closing-month-warn-modal .kh-karte__closingMonthWarnModalExample,
#kh-karte-director-term-warn-modal .kh-karte__closingMonthWarnModalExample {
    margin-bottom: 0;
    color: #334155;
}

#kh-karte-closing-month-warn-modal .kh-karte__closingMonthWarnModalExample:empty,
#kh-karte-director-term-warn-modal .kh-karte__closingMonthWarnModalExample:empty {
    display: none;
}

#kh-karte-closing-month-warn-modal .kh-karte__closingMonthWarnModalButtons,
#kh-karte-director-term-warn-modal .kh-karte__closingMonthWarnModalButtons {
    margin-top: 22px;
    justify-content: center;
}

/* 個人情報保護指針 iframe モーダル */
#kh-karte-privacy-modal.kh-karte__modal--privacy {
    align-items: center;
    justify-content: center;
}

#kh-karte-privacy-modal .kh-karte__privacyModalContent {
    display: flex;
    flex-direction: column;
    width: min(860px, 94vw);
    height: min(86vh, 840px);
    max-width: 94vw;
    max-height: 92vh;
    padding: 0;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
}

#kh-karte-privacy-modal .kh-karte__privacyModalHeader {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

#kh-karte-privacy-modal .kh-karte__privacyModalTitle {
    font-size: 16px;
    font-weight: 900;
    color: #0f172a;
}

#kh-karte-privacy-modal .kh-karte__privacyModalClose {
    appearance: none;
    border: none;
    background: transparent;
    width: 32px;
    height: 32px;
    font-size: 22px;
    line-height: 1;
    color: #475569;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#kh-karte-privacy-modal .kh-karte__privacyModalClose:hover,
#kh-karte-privacy-modal .kh-karte__privacyModalClose:focus {
    background: #e2e8f0;
    color: #0f172a;
}

#kh-karte-privacy-modal .kh-karte__privacyModalBody {
    flex: 1 1 auto;
    min-height: 0;
    background: #ffffff;
    overflow: auto;
}

/* iframe 表示モード：本体は iframe を 100% 高さで埋め込む。スクロールは iframe 内に任せる */
#kh-karte-privacy-modal .kh-karte__privacyModalBody--iframe {
    position: relative;
    overflow: hidden;
    padding: 0;
}

#kh-karte-privacy-modal .kh-karte__privacyModalIframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

#kh-karte-privacy-modal .kh-karte__privacyModalBody--iframe .kh-karte__privacyModalLoading {
    position: absolute;
    inset: 0;
    background: #ffffff;
    z-index: 1;
}

#kh-karte-privacy-modal .kh-karte__privacyModalContentArea {
    padding: 20px 24px;
    box-sizing: border-box;
}

#kh-karte-privacy-modal .kh-karte__privacyModalContentInner {
    font-size: 14px;
    line-height: 1.75;
    color: #1f2937;
}

/* リモートページの card_content1 を埋め込んだときの基本整形 */
#kh-karte-privacy-modal .kh-karte__privacyModalContentInner h1,
#kh-karte-privacy-modal .kh-karte__privacyModalContentInner h2,
#kh-karte-privacy-modal .kh-karte__privacyModalContentInner h3,
#kh-karte-privacy-modal .kh-karte__privacyModalContentInner h4 {
    margin: 1.25em 0 0.5em;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.4;
}

#kh-karte-privacy-modal .kh-karte__privacyModalContentInner p {
    margin: 0 0 0.9em;
}

#kh-karte-privacy-modal .kh-karte__privacyModalContentInner ul,
#kh-karte-privacy-modal .kh-karte__privacyModalContentInner ol {
    margin: 0 0 1em;
    padding-left: 1.6em;
}

#kh-karte-privacy-modal .kh-karte__privacyModalContentInner li {
    margin-bottom: 0.35em;
}

#kh-karte-privacy-modal .kh-karte__privacyModalContentInner a {
    color: #1d4ed8;
    text-decoration: underline;
}

#kh-karte-privacy-modal .kh-karte__privacyModalContentInner img {
    max-width: 100%;
    height: auto;
}

/* ローディング */
#kh-karte-privacy-modal .kh-karte__privacyModalLoading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 80px 20px;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
}

#kh-karte-privacy-modal .kh-karte__privacyModalSpinner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #dbeafe;
    border-top-color: #1d4ed8;
    animation: khPurposeBusySpin 0.85s linear infinite;
}

/* エラー */
#kh-karte-privacy-modal .kh-karte__privacyModalError {
    padding: 60px 20px;
    text-align: center;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.7;
}

#kh-karte-privacy-modal .kh-karte__privacyModalError a {
    color: #1d4ed8;
    text-decoration: underline;
    font-weight: 700;
}

#kh-karte-privacy-modal .kh-karte__privacyModalFooter {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

#kh-karte-privacy-modal .kh-karte__privacyModalExternal {
    font-size: 13px;
    color: #1d4ed8;
    text-decoration: underline;
}

#kh-karte-privacy-modal .kh-karte__privacyModalExternal:hover {
    color: #1e40af;
}

#kh-karte-board-meeting-modal.kh-karte__modal--boardMeetingWarn .kh-karte__boardMeetingModalContent,
#kh-karte-rep-director-required-modal.kh-karte__modal--repDirectorRequired .kh-karte__repDirectorRequiredModalContent {
    max-width: 560px;
    max-height: min(85vh, 520px);
    text-align: left;
}

#kh-karte-board-meeting-modal .kh-karte__noteModalHeader,
#kh-karte-rep-director-required-modal .kh-karte__noteModalHeader {
    text-align: center;
}

#kh-karte-board-meeting-modal .kh-karte__noteModalTitle,
#kh-karte-rep-director-required-modal .kh-karte__noteModalTitle {
    font-size: 17px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.35;
}

#kh-karte-board-meeting-modal .kh-karte__boardMeetingModalBody,
#kh-karte-rep-director-required-modal .kh-karte__repDirectorRequiredModalBody {
    margin: 12px 0 0;
    padding: 0 4px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

#kh-karte-board-meeting-modal .kh-karte__boardMeetingModalLead,
#kh-karte-rep-director-required-modal .kh-karte__repDirectorRequiredModalLead {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.65;
    font-weight: 700;
    color: #334155;
}

#kh-karte-board-meeting-modal .kh-karte__boardMeetingModalLead strong,
#kh-karte-rep-director-required-modal .kh-karte__repDirectorRequiredModalLead strong {
    color: #b45309;
    font-weight: 900;
}

#kh-karte-board-meeting-modal .kh-karte__boardMeetingModalNote,
#kh-karte-rep-director-required-modal .kh-karte__repDirectorRequiredModalNote {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    color: #475569;
}

/* 登記簿謄本・代表住所（代表取締役を初めて選んだときの案内モーダル） */
#kh-karte-rep-registry-modal-step1.kh-karte__modal--repRegistryBook .kh-karte__repRegistryModalContent,
#kh-karte-rep-registry-modal-step2.kh-karte__modal--repRegistryBook .kh-karte__repRegistryModalContent,
#kh-karte-rep-registry-modal-step3.kh-karte__modal--repRegistryBook .kh-karte__repRegistryModalContent,
#kh-karte-rep-registry-modal-step4.kh-karte__modal--repRegistryBook .kh-karte__repRegistryModalContent {
    max-width: min(560px, 100%);
    max-height: min(88vh, 640px);
    text-align: left;
}

#kh-karte-rep-registry-modal-step4.kh-karte__modal--repRegistryBook .kh-karte__repRegistryModalContent--declineInfo {
    max-height: min(92vh, 720px);
    display: flex;
    flex-direction: column;
}

#kh-karte .kh-karte__repRegistryModalBody--declineInfo,
#kh-karte-rep-registry-modal-step4 .kh-karte__repRegistryModalBody--declineInfo {
    max-height: min(78vh, 560px);
}

#kh-karte-rep-registry-modal-step1 .kh-karte__noteModalHeader,
#kh-karte-rep-registry-modal-step2 .kh-karte__noteModalHeader,
#kh-karte-rep-registry-modal-step3 .kh-karte__noteModalHeader,
#kh-karte-rep-registry-modal-step4 .kh-karte__noteModalHeader {
    text-align: center;
}

#kh-karte .kh-karte__repRegistryModalBody {
    margin: 10px 0 0;
    padding: 0 4px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

#kh-karte .kh-karte__repRegistryModalLead {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.65;
    font-weight: 700;
    color: #334155;
}

#kh-karte .kh-karte__repRegistryModalLead--strong {
    font-weight: 900;
    color: #0f172a;
}

#kh-karte .kh-karte__repRegistryModalNote {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

#kh-karte .kh-karte__repRegistryModalNote--emph {
    font-weight: 800;
    color: #1e293b;
    margin-top: 4px;
}

#kh-karte .kh-karte__repRegistryModalList {
    margin: 6px 0 12px;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
}

#kh-karte .kh-karte__repRegistryModalList li {
    position: relative;
    padding-left: 1.25em;
    margin-bottom: 6px;
}

#kh-karte .kh-karte__repRegistryModalList li::before {
    content: "・";
    position: absolute;
    left: 0;
    top: 0;
    color: #334155;
}

#kh-karte .kh-karte__repRegistryModalFoot {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.55;
    color: #64748b;
}

#kh-karte .kh-karte__repRegistryModalText,
#kh-karte-rep-registry-modal-step4 .kh-karte__repRegistryModalText {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.65;
    color: #334155;
    font-weight: 500;
}

#kh-karte .kh-karte__repRegistryModalButtons--stack {
    flex-direction: column;
    align-items: stretch;
}

#kh-karte .kh-karte__repRegistryModalButtons--stack .kh-karte__modalBtn {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    white-space: normal;
}

#kh-karte-rep-director-required-modal .kh-karte__repDirectorRequiredModalNote strong {
    color: #b45309;
    font-weight: 900;
}

#kh-karte-board-meeting-modal .kh-karte__boardMeetingModalButtons,
#kh-karte-rep-director-required-modal .kh-karte__repDirectorRequiredModalButtons {
    margin-top: 22px;
    justify-content: center;
}

/* 都道府県: カスタムプルダウン（事業目的カテゴリと同様に一覧の高さ上限・地域見出し） */
#kh-karte .kh-karte__prefSelectWrap,
form[data-kh-live-validation] .kh-karte__prefSelectWrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    z-index: 4;
}

#kh-karte .kh-karte__prefSelectNative,
form[data-kh-live-validation] .kh-karte__prefSelectNative {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    overflow: hidden;
    pointer-events: none;
    top: 0;
    left: 0;
}

/* 見た目は #kh-karte select と同系（min-height / padding / 角丸 / 枠） */
#kh-karte .kh-karte__prefSelectTrigger,
form[data-kh-live-validation] .kh-karte__prefSelectTrigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.45;
    font-family: inherit;
    text-align: left;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: var(--karte-text);
    -webkit-text-fill-color: var(--karte-text);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease,
        background-image 0.2s ease;
}

#kh-karte .kh-karte__prefSelectTrigger:hover,
form[data-kh-live-validation] .kh-karte__prefSelectTrigger:hover {
    border-color: #c5d0e0;
}

#kh-karte .kh-karte__prefSelectTrigger:focus,
form[data-kh-live-validation] .kh-karte__prefSelectTrigger:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
    background: #fff;
}

#kh-karte .kh-karte__prefSelectTriggerText,
form[data-kh-live-validation] .kh-karte__prefSelectTriggerText {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 未選択の必須 select と同じ薄いラベル色（#kh-karte select:required:invalid） */
#kh-karte .kh-karte__prefSelectWrap:has(.kh-karte__prefSelectNative:required:invalid) .kh-karte__prefSelectTriggerText,
form[data-kh-live-validation]
    .kh-karte__prefSelectWrap:has(.kh-karte__prefSelectNative:required:invalid)
    .kh-karte__prefSelectTriggerText {
    color: var(--karte-placeholder);
    -webkit-text-fill-color: var(--karte-placeholder);
}

#kh-karte .kh-karte__prefSelectChevron,
form[data-kh-live-validation] .kh-karte__prefSelectChevron {
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--karte-subtext, #6b7280);
    transition: transform 0.2s ease;
}

#kh-karte .kh-karte__prefSelectWrap.is-open .kh-karte__prefSelectChevron,
form[data-kh-live-validation] .kh-karte__prefSelectWrap.is-open .kh-karte__prefSelectChevron {
    transform: rotate(180deg);
}

/* エラー: #kh-karte-form select.kh-karte__fieldState--error と同じトーン */
#kh-karte .kh-karte__prefSelectTrigger--invalid,
#kh-karte .kh-karte__prefSelectWrap:has(.kh-karte__prefSelectNative.kh-karte__fieldState--error) .kh-karte__prefSelectTrigger,
#kh-karte-form .kh-karte__prefSelectWrap:has(.kh-karte__prefSelectNative.kh-karte__fieldState--error) .kh-karte__prefSelectTrigger,
form[data-kh-live-validation] .kh-karte__prefSelectTrigger--invalid,
form[data-kh-live-validation] .kh-karte__prefSelectWrap:has(.kh-karte__prefSelectNative.kh-karte__fieldState--error) .kh-karte__prefSelectTrigger {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.45);
}

#kh-karte .kh-karte__prefSelectWrap:has(.kh-karte__prefSelectNative.kh-karte__fieldState--error) .kh-karte__prefSelectTrigger:focus,
#kh-karte-form .kh-karte__prefSelectWrap:has(.kh-karte__prefSelectNative.kh-karte__fieldState--error) .kh-karte__prefSelectTrigger:focus,
form[data-kh-live-validation] .kh-karte__prefSelectWrap:has(.kh-karte__prefSelectNative.kh-karte__fieldState--error) .kh-karte__prefSelectTrigger:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
}

/* OK: 他の広い入力欄と同様、右端に --karte-field-ok-icon（▼用スペースを確保） */
#kh-karte-form .kh-karte__prefSelectWrap:has(.kh-karte__prefSelectNative.kh-karte__fieldState--ok) .kh-karte__prefSelectTrigger,
form[data-kh-live-validation] .kh-karte__prefSelectWrap:has(.kh-karte__prefSelectNative.kh-karte__fieldState--ok) .kh-karte__prefSelectTrigger {
    border-color: var(--karte-accent) !important;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.38);
    background-color: #fff !important;
    background-image: var(--karte-field-ok-icon) !important;
    background-repeat: no-repeat !important;
    background-position: right 2.35rem center !important;
    background-size: 22px 22px !important;
    padding-right: 3.5rem !important;
}

#kh-karte-form .kh-karte__prefSelectWrap:has(.kh-karte__prefSelectNative.kh-karte__fieldState--ok) .kh-karte__prefSelectTrigger:focus,
form[data-kh-live-validation] .kh-karte__prefSelectWrap:has(.kh-karte__prefSelectNative.kh-karte__fieldState--ok) .kh-karte__prefSelectTrigger:focus {
    border-color: var(--karte-accent) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
    background-color: #fff !important;
    background-image: var(--karte-field-ok-icon) !important;
    background-repeat: no-repeat !important;
    background-position: right 2.35rem center !important;
    background-size: 22px 22px !important;
    padding-right: 3.5rem !important;
}

#kh-karte .kh-karte__prefSelectPanel,
form[data-kh-live-validation] .kh-karte__prefSelectPanel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 60;
    margin: 0;
    padding: 0;
    border: 1px solid var(--karte-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    overscroll-behavior: contain;
}

#kh-karte .kh-karte__prefSelectPanelInner,
form[data-kh-live-validation] .kh-karte__prefSelectPanelInner {
    max-height: min(52vh, 440px);
    max-height: min(52dvh, 440px);
    overflow-x: hidden;
    overflow-y: auto;
}

/* 地方ブロック見出し（関東・近畿など）：通常の県行と色を分け、見出しだと一目で分かるようにする */
#kh-karte .kh-karte__prefSelectGroupLabel,
form[data-kh-live-validation] .kh-karte__prefSelectGroupLabel {
    padding: 9px 14px 6px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: none;
    color: #1e3a8a;
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 55%, #93c5fd 100%);
    border-bottom: 2px solid #3b82f6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    user-select: none;
    pointer-events: none;
}

#kh-karte .kh-karte__prefSelectOption,
form[data-kh-live-validation] .kh-karte__prefSelectOption {
    display: block;
    width: 100%;
    margin: 0;
    padding: 10px 14px;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 15px;
    line-height: 1.45;
    text-align: left;
    color: var(--karte-text);
    cursor: pointer;
}

#kh-karte .kh-karte__prefSelectOption--placeholder,
form[data-kh-live-validation] .kh-karte__prefSelectOption--placeholder {
    color: #64748b;
    font-size: 14px;
}

/* 一覧行: 事業目的カテゴリ（.kh-karte__purposeSearchCatOption）と同じホバー */
#kh-karte .kh-karte__prefSelectOption:hover,
#kh-karte .kh-karte__prefSelectOption:focus,
form[data-kh-live-validation] .kh-karte__prefSelectOption:hover,
form[data-kh-live-validation] .kh-karte__prefSelectOption:focus {
    outline: none;
    background: #f1f5f9;
}

#kh-karte .kh-karte__prefSelectOption:focus-visible,
form[data-kh-live-validation] .kh-karte__prefSelectOption:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.35);
}

/* 選択中の県（プルダウン内チェック ≒ ネイティブの選択表示） */
#kh-karte .kh-karte__prefSelectOption--selected,
form[data-kh-live-validation] .kh-karte__prefSelectOption--selected {
    position: relative;
    padding-left: 42px;
    font-weight: 700;
    background: #f8fafc;
}

#kh-karte .kh-karte__prefSelectOption--selected::before,
form[data-kh-live-validation] .kh-karte__prefSelectOption--selected::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    background: var(--karte-field-ok-icon) center / contain no-repeat;
    pointer-events: none;
}

#kh-karte .kh-karte__prefSelectOption--placeholder.kh-karte__prefSelectOption--selected::before,
form[data-kh-live-validation] .kh-karte__prefSelectOption--placeholder.kh-karte__prefSelectOption--selected::before {
    display: none;
}

#kh-karte .kh-karte__prefSelectOption--placeholder.kh-karte__prefSelectOption--selected,
form[data-kh-live-validation] .kh-karte__prefSelectOption--placeholder.kh-karte__prefSelectOption--selected {
    padding-left: 14px;
    font-weight: inherit;
    background: transparent;
}

#kh-karte .kh-karte__prefSelectOption--selected:hover,
#kh-karte .kh-karte__prefSelectOption--selected:focus,
form[data-kh-live-validation] .kh-karte__prefSelectOption--selected:hover,
form[data-kh-live-validation] .kh-karte__prefSelectOption--selected:focus {
    background: #f1f5f9;
}

#kh-karte .kh-karte__alignRight { text-align: right; }
#kh-karte .kh-karte__mb10 { margin-bottom: 10px; }
#kh-karte .kh-karte__mb20 { margin-bottom: 20px; }
#kh-karte .kh-karte__mb30 { margin-bottom: 30px; }

#kh-karte .kh-karte__linkFont { text-decoration: underline; text-underline-offset: 0.15em; }

#kh-karte .kh-karte__onlyPc { display: inline; }
#kh-karte .kh-karte__onlySp { display: none; }
#kh-karte .kh-karte__cb { clear: both; }

/* スクリーンリーダー専用（視覚的 OK は入力欄右のチェックアイコンで表現） */
#kh-karte .kh-karte__sr-only,
form[data-kh-live-validation] .kh-karte__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#kh-karte .kh-karte__table td,
form[data-kh-live-validation] table td {
    position: relative;
}

/* --------------------------------------------------------------------------
   リアルタイムバリデーション（common-form-live-validation.js）
   karte（株式会社カルテ）: #kh-karte-form / gk: form[data-kh-live-validation]
   -------------------------------------------------------------------------- */
#kh-karte-form input.kh-karte__fieldState--error,
#kh-karte-form select.kh-karte__fieldState--error,
#kh-karte-form textarea.kh-karte__fieldState--error,
form[data-kh-live-validation] input.kh-karte__fieldState--error,
form[data-kh-live-validation] select.kh-karte__fieldState--error,
form[data-kh-live-validation] textarea.kh-karte__fieldState--error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.45);
}

/* OK: 枠は text / select / textarea / checkbox 共通（radio は除外） */
#kh-karte-form input.kh-karte__fieldState--ok:not([type="radio"]),
#kh-karte-form select.kh-karte__fieldState--ok,
#kh-karte-form textarea.kh-karte__fieldState--ok,
form[data-kh-live-validation] input.kh-karte__fieldState--ok:not([type="radio"]),
form[data-kh-live-validation] select.kh-karte__fieldState--ok,
form[data-kh-live-validation] textarea.kh-karte__fieldState--ok {
    border-color: var(--karte-accent) !important;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.38);
}

/* OK: 右端チェックは広い入力欄のみ（checkbox はレイアウト崩れ防止で除外） */
#kh-karte-form input.kh-karte__fieldState--ok:not([type="radio"]):not([type="checkbox"]),
#kh-karte-form select.kh-karte__fieldState--ok,
#kh-karte-form textarea.kh-karte__fieldState--ok,
form[data-kh-live-validation] input.kh-karte__fieldState--ok:not([type="radio"]):not([type="checkbox"]),
form[data-kh-live-validation] select.kh-karte__fieldState--ok,
form[data-kh-live-validation] textarea.kh-karte__fieldState--ok {
    background-color: #fff !important;
    background-image: var(--karte-field-ok-icon) !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 22px 22px !important;
    padding-right: 46px !important;
}

#kh-karte-form input.kh-karte__fieldState--error:focus,
#kh-karte-form select.kh-karte__fieldState--error:focus,
#kh-karte-form textarea.kh-karte__fieldState--error:focus,
form[data-kh-live-validation] input.kh-karte__fieldState--error:focus,
form[data-kh-live-validation] select.kh-karte__fieldState--error:focus,
form[data-kh-live-validation] textarea.kh-karte__fieldState--error:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
}

#kh-karte-form input.kh-karte__fieldState--ok:not([type="radio"]):focus,
#kh-karte-form select.kh-karte__fieldState--ok:focus,
#kh-karte-form textarea.kh-karte__fieldState--ok:focus,
form[data-kh-live-validation] input.kh-karte__fieldState--ok:not([type="radio"]):focus,
form[data-kh-live-validation] select.kh-karte__fieldState--ok:focus,
form[data-kh-live-validation] textarea.kh-karte__fieldState--ok:focus {
    border-color: var(--karte-accent) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

#kh-karte-form input.kh-karte__fieldState--ok:not([type="radio"]):not([type="checkbox"]):focus,
#kh-karte-form select.kh-karte__fieldState--ok:focus,
#kh-karte-form textarea.kh-karte__fieldState--ok:focus,
form[data-kh-live-validation] input.kh-karte__fieldState--ok:not([type="radio"]):not([type="checkbox"]):focus,
form[data-kh-live-validation] select.kh-karte__fieldState--ok:focus,
form[data-kh-live-validation] textarea.kh-karte__fieldState--ok:focus {
    background-color: #fff !important;
    background-image: var(--karte-field-ok-icon) !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 22px 22px !important;
    padding-right: 46px !important;
}

/* 公証役場（プルダウン風）：▼ と OK チェックを両方
   旧 <input> 時代の selector に加え、現行の <button> 版にも適用する */
#kh-karte-form input.kh-karte__notaryPickDisplay.kh-karte__fieldState--ok:not([type="checkbox"]),
form[data-kh-live-validation] input.kh-karte__notaryPickDisplay.kh-karte__fieldState--ok:not([type="checkbox"]),
#kh-karte-form button.kh-karte__notaryPickDisplay.kh-karte__fieldState--ok,
form[data-kh-live-validation] button.kh-karte__notaryPickDisplay.kh-karte__fieldState--ok {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M3.5 5.25L7 8.75l3.5-3.5'/%3E%3C/svg%3E"),
        var(--karte-field-ok-icon) !important;
    background-position: right 12px center, right 2.35rem center !important;
    background-size: 14px 14px, 22px 22px !important;
    background-repeat: no-repeat, no-repeat !important;
    padding-right: 3.5rem !important;
}

#kh-karte-form input.kh-karte__notaryPickDisplay.kh-karte__fieldState--ok:not([type="checkbox"]):focus,
form[data-kh-live-validation] input.kh-karte__notaryPickDisplay.kh-karte__fieldState--ok:not([type="checkbox"]):focus,
#kh-karte-form button.kh-karte__notaryPickDisplay.kh-karte__fieldState--ok:focus,
form[data-kh-live-validation] button.kh-karte__notaryPickDisplay.kh-karte__fieldState--ok:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 14 14'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M3.5 5.25L7 8.75l3.5-3.5'/%3E%3C/svg%3E"),
        var(--karte-field-ok-icon) !important;
    background-position: right 12px center, right 2.35rem center !important;
    background-size: 14px 14px, 22px 22px !important;
    background-repeat: no-repeat, no-repeat !important;
    padding-right: 3.5rem !important;
}

#kh-karte-form .kh-karte__liveValidation-feedback,
form[data-kh-live-validation] .kh-karte__liveValidation-feedback {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 700;
    letter-spacing: 0.02em;
}

#kh-karte-form .kh-karte__liveValidation-feedback--error,
form[data-kh-live-validation] .kh-karte__liveValidation-feedback--error {
    color: var(--karte-danger);
}

/* 会社設立メンバーについて（見出し〜メンバー一覧のみ）：代表取締役未設定時に赤枠 */
#kh-karte #kh-karte-members-section.kh-karte__membersSection.kh-karte__membersSection--repDirectorError,
#kh-karte-form #kh-karte-members-section.kh-karte__membersSection.kh-karte__membersSection--repDirectorError {
    margin: 0 0 20px;
    padding: 16px 14px 18px;
    border: 2px solid #dc2626;
    border-radius: 12px;
    background: rgba(254, 242, 242, 0.45);
    box-sizing: border-box;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15);
}

/* 「会社設立メンバーについて」見出し直後（代表取締役エラー文言：中央・やや大きめ） */
#kh-karte-form #kh-karte-rep-director-error.kh-karte__repDirectorError:not([hidden]) {
    display: block;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(220, 38, 38, 0.35);
    background: rgba(254, 242, 242, 0.95);
    text-align: center;
    font-size: 17px;
    line-height: 1.6;
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* セクション赤枠表示中は内側のエラー帯の枠を弱めて二重枠を避ける */
#kh-karte #kh-karte-members-section.kh-karte__membersSection--repDirectorError #kh-karte-rep-director-error.kh-karte__repDirectorError:not([hidden]),
#kh-karte-form .kh-karte__membersSection--repDirectorError #kh-karte-rep-director-error.kh-karte__repDirectorError:not([hidden]) {
    /* エラー文言そのものも「バリデーション枠＋黄色背景」で強調（ぱっと見で分かるように） */
    border: 2px solid #dc2626;
    background: #fffbeb;
    color: #7f1d1d;
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.10);
    padding: 12px 12px 12px;
    margin: 0 0 14px;
}

#kh-karte-form .kh-karte__liveValidation-feedback--ok,
form[data-kh-live-validation] .kh-karte__liveValidation-feedback--ok {
    color: var(--karte-accent);
}

/* OK 文言は視覚では隠し、チェックは入力欄右の背景で表示（音声は .kh-karte__sr-only） */
#kh-karte-form .kh-karte__liveValidation-feedback--visualHide,
form[data-kh-live-validation] .kh-karte__liveValidation-feedback--visualHide {
    position: absolute;
    left: 0;
    top: 100%;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ラジオグループ: 行内に疑似要素チェック＋短いラベル */
#kh-karte-form .kh-karte__liveValidation-feedback--ok[data-kh-lv-group],
form[data-kh-live-validation] .kh-karte__liveValidation-feedback--ok[data-kh-lv-group] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--karte-accent);
}

#kh-karte-form .kh-karte__liveValidation-feedback--ok[data-kh-lv-group]::before,
form[data-kh-live-validation] .kh-karte__liveValidation-feedback--ok[data-kh-lv-group]::before {
    content: "";
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: var(--karte-field-ok-icon) center / contain no-repeat;
}

#kh-karte-form .kh-karte__liveValidation-feedback__label,
form[data-kh-live-validation] .kh-karte__liveValidation-feedback__label {
    font-weight: 700;
    color: var(--karte-accent);
}

/* メールドメインの打ち間違い候補（クリックで自動修正・黄色系） */
#kh-karte-form .kh-karte__liveValidation-emailHint,
form[data-kh-live-validation] .kh-karte__liveValidation-emailHint {
    display: none;
    box-sizing: border-box;
    width: 100%;
    margin-top: 8px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.55;
    font-weight: 600;
    font-family: inherit;
    color: #5c4d00;
    letter-spacing: 0.02em;
    text-align: left;
    background-color: #fff8dc;
    border: 1px solid #f0d060;
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

#kh-karte-form .kh-karte__liveValidation-emailHint:hover,
form[data-kh-live-validation] .kh-karte__liveValidation-emailHint:hover {
    background-color: #fff3bf;
    border-color: #e6c34a;
}

#kh-karte-form .kh-karte__liveValidation-emailHint:focus-visible,
form[data-kh-live-validation] .kh-karte__liveValidation-emailHint:focus-visible {
    outline: 2px solid var(--karte-accent, #2563eb);
    outline-offset: 2px;
}

/* select はブラウザ標準の▼と重ならないようチェック位置を左寄せ */
#kh-karte-form select.kh-karte__fieldState--ok,
form[data-kh-live-validation] select.kh-karte__fieldState--ok {
    background-position: right 2.35rem center !important;
    padding-right: 3.5rem !important;
}

#kh-karte-form select.kh-karte__fieldState--ok:focus,
form[data-kh-live-validation] select.kh-karte__fieldState--ok:focus {
    background-position: right 2.35rem center !important;
    padding-right: 3.5rem !important;
}

/* --------------------------------------------------------------------------
   送信前確認モーダル（項目名・入力値の対比、PC は広めパネル）
   -------------------------------------------------------------------------- */
#kh-karte-submit-confirm-modal.kh-karte__submitConfirmModal {
    position: fixed;
    inset: 0;
    z-index: 100900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.5);
    box-sizing: border-box;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmPanel {
    width: min(100%, 520px);
    max-height: min(88vh, 640px);
    display: flex;
    flex-direction: column;
    padding: 20px 18px 18px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    box-sizing: border-box;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmTitle {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: 0.02em;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmLead {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.65;
    color: #475569;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmLeadNote {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.6;
    color: #64748b;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmBody {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f1f5f9;
    -webkit-overflow-scrolling: touch;
}

/* カルテの .kh-karte__sectionTitle に相当するグループ見出し */
#kh-karte-submit-confirm-modal .kh-karte__submitConfirmGroups {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmGroup {
    margin: 0;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmGroupTitle {
    margin: 0 0 8px;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.45;
    letter-spacing: 0.02em;
    color: var(--karte-main-dark, #142b66);
    background: linear-gradient(180deg, #eff6ff 0%, #e8eef7 100%);
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    border-left: 4px solid var(--karte-main, #1e3a8a);
    box-sizing: border-box;
}

/* 大見出し直下：メンバー別ブロック＋その他 dl を縦に並べる */
#kh-karte-submit-confirm-modal .kh-karte__submitConfirmGroupBody {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 設立メンバー：メンバー１（あなた）／メンバー２… の小見出し */
#kh-karte-submit-confirm-modal .kh-karte__submitConfirmMemberBlock {
    margin: 0;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmMemberTitle {
    margin: 0 0 6px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.45;
    letter-spacing: 0.03em;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    border-left: 3px solid #64748b;
    box-sizing: border-box;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmDl {
    margin: 0;
    display: block;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmDt {
    margin: 14px 0 6px;
    font-size: 12px;
    font-weight: 800;
    color: #475569;
    letter-spacing: 0.04em;
    line-height: 1.45;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmDt:first-child {
    margin-top: 0;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmDd {
    margin: 0;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.65;
    color: #0f172a;
    word-break: break-word;
    white-space: pre-wrap;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmBtns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmBtn {
    width: 100%;
    max-width: 320px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    box-sizing: border-box;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmBtn--ok {
    border-color: var(--karte-main, #1e3a8a);
    background: var(--karte-main, #1e3a8a);
    color: #fff;
}

#kh-karte-submit-confirm-modal .kh-karte__submitConfirmBtn:focus-visible {
    outline: 2px solid var(--karte-accent, #2563eb);
    outline-offset: 2px;
}

@media (min-width: 720px) {
    #kh-karte-submit-confirm-modal.kh-karte__submitConfirmModal {
        padding: 24px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmPanel {
        width: min(94vw, 920px);
        max-height: min(92vh, 880px);
        padding: 26px 32px 24px;
        border-radius: 18px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmTitle {
        font-size: 22px;
        margin-bottom: 12px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmLead {
        font-size: 15px;
        margin-bottom: 10px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmLeadNote {
        font-size: 14px;
        margin-bottom: 18px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmBody {
        padding: 16px 20px;
        margin-bottom: 20px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmGroups {
        gap: 22px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmGroupTitle {
        margin-bottom: 10px;
        padding: 10px 14px;
        font-size: 15px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmGroupBody {
        gap: 16px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmMemberTitle {
        margin-bottom: 8px;
        padding: 7px 12px;
        font-size: 14px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmDl {
        display: grid;
        grid-template-columns: minmax(200px, 32%) 1fr;
        column-gap: 20px;
        row-gap: 0;
        /* dt / dd の行見出しと値の上端を揃える（パディングを統一） */
        align-items: start;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmDt {
        margin: 0;
        padding: 12px 10px 12px 4px;
        font-size: 14px;
        font-weight: 800;
        line-height: 1.5;
        color: #334155;
        border-bottom: 1px solid #cbd5e1;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmDd {
        margin: 0;
        padding: 12px 16px;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.5;
        border-bottom: 1px solid #cbd5e1;
        border-radius: 10px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmDl > dt:nth-last-child(2),
    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmDl > dd:last-child {
        border-bottom: none;
        padding-bottom: 6px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmBtns {
        /* ボタンは PC でも縦並び＋中央揃えに統一（要望どおり） */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 12px;
    }

    #kh-karte-submit-confirm-modal .kh-karte__submitConfirmBtn {
        width: 100%;
        max-width: 320px;
        min-width: 168px;
    }
}

/* -------------------------------------------------------------------------
 * カルテ送信 XHR 中: オーバーレイ・スピナー・進捗バー（#kh-karte 外でも body 直下に出す）
 * ------------------------------------------------------------------------- */
html.kh-karte--submitBusy,
body.kh-karte--submitBusy {
    overflow: hidden;
}

.kh-karte__submitBusyOverlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
}

.kh-karte__submitBusyPanel {
    max-width: 320px;
    width: 100%;
    padding: 28px 24px 24px;
    border-radius: var(--karte-radius, 16px);
    background: var(--karte-card, #fff);
    box-shadow: var(--karte-shadow, 0 10px 30px rgba(15, 23, 42, 0.12));
    border: 1px solid var(--karte-border, #d7deea);
    text-align: center;
}

.kh-karte__submitBusySpinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 14px;
    border: 3px solid rgba(37, 99, 235, 0.2);
    border-top-color: var(--karte-accent, #2563eb);
    border-radius: 50%;
    animation: khKarteSubmitBusySpin 0.75s linear infinite;
}

@keyframes khKarteSubmitBusySpin {
    to {
        transform: rotate(360deg);
    }
}

.kh-karte__submitBusyTitle {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--karte-text, #1f2937);
    letter-spacing: 0.02em;
}

.kh-karte__submitBusyBar {
    position: relative;
    height: 8px;
    margin-top: 18px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
}

.kh-karte__submitBusyBarFill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--karte-accent, #2563eb), #1d4ed8);
    transition: width 0.15s ease-out;
}

.kh-karte__submitBusyBar--indeterminate .kh-karte__submitBusyBarFill {
    width: 38% !important;
    transition: none;
    animation: khKarteSubmitBusyIndet 1.1s ease-in-out infinite;
}

@keyframes khKarteSubmitBusyIndet {
    0% {
        transform: translateX(-120%);
    }
    100% {
        transform: translateX(320%);
    }
}

.kh-karte__submitBusyPct {
    display: block;
    margin-top: 10px;
    min-height: 1.25em;
    font-size: 14px;
    font-weight: 600;
    color: var(--karte-subtext, #6b7280);
}

/* ブラウザのオートフィルが実入力欄に入らないよう補助する非表示トラップ。
   旧 inline style="position:absolute;left:-9999px;..." をクラスに移行。 */
.kh-karte__autocompleteTrap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* JavaScript 無効時の警告ボックス（noscript 配下）。旧 inline style から移行。 */
.kh-karte__noscriptBox {
    position: relative;
    text-align: center;
    font-size: 20px;
    color: #b71c1c;
    border: 4px solid #b71c1c;
    padding: 15px;
    margin: 20px auto;
    max-width: 90%;
    background-color: #ffecb3;
    line-height: 1.6;
    font-family: Arial, sans-serif;
    border-radius: 6px;
}

.kh-karte__noscriptBoxIcon {
    position: absolute;
    top: -25px;
    left: -25px;
}

.kh-karte__noscriptBoxTitle {
    font-size: 24px;
}

/* 監査役の任期 row（KK 専用）。初期は hidden 属性で非表示。
   旧 inline style="display:none;" を削除した分、UA 既定の [hidden] 挙動を明示しておく。 */
#kh-karte tr.kh-karte__auditorTermRow[hidden] {
    display: none !important;
}

/* NOTE: tablet rules were split into `common-form.tablet.css`. */