/* ===== ブロック1（旧 yosan.html 行 11） ===== */

/* ============================================================
   UNIFIED DESIGN SYSTEM — 全シート統一
   ベース：基本設定シートのKPIカードデザインを全体に適用
   ============================================================ */
:root {
  --navy:        #1a2035;
  --navy-deep:   #10152a;
  --navy-mid:    #252d45;
  --gold:        #e3b04a;
  --gold-light:  #FBF3DA;
  --gold-dark:   #b8880f;
  --blue:        #475569;
  --blue-light:  #f1f5f9;
  --beige:       #f0f2f8;       /* ページ全体の背景 */
  --beige-card:  #f8fafc;       /* サブ背景 */
  --white:       #FFFFFF;
  --border:      #e4e6ef;
  --text:        #1e293b;
  --muted:       #64748b;
  --green:       #10b981;
  --red:         #ef4444;
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.03);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.12);
  --gold-rgb:    227,176,74;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-y: scroll; }
body {
  font-family: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
  background: var(--beige);
  color: var(--text);
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  letter-spacing: 0.02em;
}

.container { width: 100%; }

/* ── ヘッダー ── */
.header {
  background: var(--white);
  padding: 16px 32px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.header h1 { color: var(--navy); font-size: 19px; font-weight: 700; letter-spacing: 0.04em; }
#customer-name { background: transparent; border: none; outline: none; color: var(--navy); font-size: 13px; font-weight: 500; width: 120px; }
#customer-name::placeholder { color: var(--muted); }

/* ── グループタブ ── */
.tabs { background: var(--white); display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 24px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 9px 20px; font-size: 13px; font-weight: 500; border-radius: 6px;
  color: var(--muted); cursor: pointer; border: none; background: transparent; transition: all .2s;
}
.tab.active { color: var(--navy); background: transparent; font-weight: 700; box-shadow: inset 0 -3px 0 var(--gold); }
.tab:hover:not(.active) { color: var(--navy); background: rgba(0,0,0,.04); }

/* ── サブタブ ── */
.subtabs { display: flex; flex-wrap: wrap; background: #f1f5f9; border-bottom: 1px solid var(--border); padding: 0 8px; }
.subtab {
  padding: 8px 18px; font-size: 12px; font-weight: 500; color: var(--muted);
  cursor: pointer; border: 1px solid transparent; border-radius: 6px; background: transparent; transition: all .15s;
}
.subtab.active { color: var(--navy); font-weight: 700; background: transparent; border-color: transparent; box-shadow: inset 0 -2px 0 var(--gold); }
.subtab:hover:not(.active) { color: var(--navy); background: rgba(12,29,54,0.03); }

/* ── パネル共通 ── */
.panel { display: none; background: #f1f5f9; border-radius: 0; overflow: hidden; }
#tab-ie, #tab-tochi { padding: 28px 48px; }
#tab-shohi { padding: 28px 88px; }
@media (min-width: 1700px){ #tab-shohi { padding: 28px 140px; } }
@media (max-width: 1200px){ #tab-shohi { padding: 24px 40px; } }
@media (max-width: 900px){ #tab-shohi, #tab-ie, #tab-tochi { padding: 12px 16px; } }
@media print { #tab-ie, #tab-shohi, #tab-tochi { padding: 0; } }
.panel.active { display: block; }

/* ── 共通カード ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-beige { background: var(--beige-card); }

/* ── セクション見出し ── */
.col-title, .sec-title {
  font-size: 13px; font-weight: 700; color: var(--navy);
  border-left: 4px solid var(--gold); padding-left: 12px;
  margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center;
}
.sec {
  font-size: 11px; font-weight: 700; color: var(--navy);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin: 22px 0 12px; padding-bottom: 6px;
  border-bottom: 2px solid var(--gold);
}
.sec:first-child { margin-top: 0; }

/* ── フォーム共通 ── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 6px; }
.iw {
  display: flex; align-items: center; gap: 8px;
  background: #f8fafc; border: 1px solid #cbd5e1;
  border-radius: 8px; padding: 6px 14px; transition: all .2s;
}
.iw:focus-within { border-color: var(--gold); background: var(--white); box-shadow: 0 0 0 3px rgba(var(--gold-rgb),0.12); }
.iw input {
  flex: 1; min-width: 0; border: none; background: transparent;
  font-family: 'Roboto', sans-serif; font-size: 18px; font-weight: 700;
  color: var(--navy); text-align: right; outline: none;
}
.iw .u { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; font-weight: 500; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── サマリーボックス ── */
.total-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--gold-light); border: 1px solid rgba(var(--gold-rgb),0.3);
  border-radius: 8px; padding: 12px 16px; margin: 8px 0 16px;
}
.tl { font-size: 12px; font-weight: 700; color: var(--gold-dark); }
.tv { font-family: 'Roboto', sans-serif; font-size: 16px; font-weight: 700; color: var(--gold); }

.hb-gold {
  background: #f1f5f9; border: 1px solid #e4e6ef;
  border-radius: 8px; padding: 14px 16px; margin: 8px 0;
}
.hb-gold .hl { font-size: 11px; color: #475569; margin-bottom: 4px; font-weight: 700; }
.hb-gold .hv { font-family: 'Roboto', sans-serif; font-size: 22px; font-weight: 700; color: #1a2035; }
.hb-gold .hs { font-size: 12px; color: #64748b; font-weight: 500; }

.hb-blue {
  background: var(--blue-light); border: 1px solid #e4e6ef;
  border-radius: 8px; padding: 14px 16px; margin: 8px 0;
}
.hb-blue .hl { font-size: 11px; color: #475569; margin-bottom: 4px; font-weight: 700; }
.hb-blue .hv { font-family: 'Roboto', sans-serif; font-size: 24px; font-weight: 700; color: var(--navy); }
.hb-blue .hs { font-size: 12px; color: #475569; font-weight: 500; }

/* ── 返済負担率ボックス ── */
.big-result {
  background: var(--navy); border-radius: 12px; padding: 24px;
  text-align: center; margin: 12px 0; box-shadow: var(--shadow-md);
}
.br-l { font-size: 11px; color: rgba(255,255,255,.5); margin-bottom: 6px; font-weight: 500; }
.br-v { font-family: 'Roboto', sans-serif; font-size: 48px; font-weight: 700; color: var(--gold); line-height: 1; }
.br-u { font-size: 18px; color: var(--gold); font-weight: 700; }
.br-s { margin-top: 12px; font-size: 12px; font-weight: 700; padding: 5px 18px; border-radius: 20px; display: inline-block; }
.s-safe   { background: #10b981; color: #fff; }
.s-normal { background: #10b981; color: #fff; }
.s-hard   { background: var(--gold); color: #fff; }
.s-danger { background: #ef4444; color: #fff; }
.s-empty  { background: rgba(255,255,255,.1); color: rgba(255,255,255,.4); }
.note { font-size: 11px; color: var(--muted); line-height: 1.7; margin-top: 12px; }

/* ── ゲージバー ── */
.gauge-bar { display: flex; border-radius: 7px; overflow: hidden; height: 16px; }
.gauge-seg { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }
.g1 { background: #10b981; flex: 25; }
.g2 { background: var(--gold); flex: 3; }
.g3 { background: var(--gold); flex: 2; }
.g4 { background: #ef4444; flex: 5; }
.pointer-wrap { position: relative; height: 12px; }
.pointer { position: absolute; top: 0; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid var(--navy); transform: translateX(-50%); transition: left .4s cubic-bezier(.4,0,.2,1); }
.gauge-scale { display: flex; justify-content: space-between; font-size: 12px; color: #475569; font-weight: 600; margin-top: 3px; }
.gauge-title { font-size: 12px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }

/* ============================================================
   TAB1: シミュレーション
   ============================================================ */
.sim-grid { display: flex; flex-direction: column; gap: 0; max-width: 960px; margin: 0 auto; width: 100%; }

/* 上部KPIゾーン */
.sim-bar-zone {
  background: var(--beige);
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #475569; font-weight: 500; }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }

/* ステータスバナー（上部中央） */
.sim-status-banner {
  text-align: center;
  margin-bottom: 16px;
}
.verdict-pill { display: inline-flex; align-items: center; gap: 10px; padding: 10px 28px; border-radius: 40px; font-size: 15px; font-weight: 700; letter-spacing: 0.03em; border: 2px solid; transition: all .3s; }
.verdict-empty { background: #f1f5f9; border-color: #cbd5e1; color: #64748b; }
.verdict-ok { background: rgba(16,185,129,0.1); border-color: #10b981; color: #065f46; }
.verdict-ng { background: rgba(239,68,68,0.08); border-color: #ef4444; color: #991b1b; }
.verdict-icon { font-size: 20px; }

/* KPIカード（白カード） - 2列レイアウト */
.sim-bar-zone-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.sim-bar-zone-header > div {
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 22px 26px;
}

.bar-zone-total-label {
  font-size: 13px; color: var(--navy); font-weight: 700;
  margin-bottom: 10px; display: flex; align-items: center; gap: 5px;
  border-left: 3px solid var(--gold); padding-left: 10px;
}
.bar-zone-total-val {
  font-family: 'Roboto', sans-serif; font-size: 40px; font-weight: 700;
  color: var(--navy); line-height: 1;
}
.bar-zone-total-val span { font-family: 'Noto Sans JP', sans-serif; font-size: 16px; font-weight: 700; margin-left: 6px; }
.bar-zone-total-val-right {
  font-family: 'Roboto', sans-serif; font-size: 40px; font-weight: 700;
  color: var(--navy); line-height: 1; text-align: left;
}
.bar-zone-total-val-right span { font-family: 'Noto Sans JP', sans-serif; font-size: 16px; font-weight: 700; margin-left: 6px; }
.bar-zone-total-val-right.empty { color: #cbd5e1; font-size: 24px; }
.bar-zone-total-val.empty { color: #cbd5e1; font-size: 24px; }

/* 内訳行 */
.kpi-breakdown {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kpi-breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #475569;
}
.kpi-breakdown-row .kpi-val { font-weight: 700; color: var(--navy); }

/* 内訳ラベル */
.kpi-breakdown-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; color: var(--muted);
  margin-top: 12px; margin-bottom: 6px;
  letter-spacing: 0.06em;
}
.kpi-breakdown-label .kbi-icon { display: none; }

/* KPIバー（カード内） */
.kpi-bar-wrap { margin-top: 14px; border-radius: 8px; overflow: hidden; height: 14px; display: flex; }

.bar-zone-cond { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.cond-circle { display: none; }
.cond-ok-text { font-size: 11px; font-weight: 700; color: var(--muted); }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: #fff;
  padding: 5px 14px; border-radius: 6px; margin-top: 8px;
}

/* 詳細分析セクション */
.sim-detail-section {
  margin-top: 4px;
}
.sim-detail-section-title {
  font-size: 18px; font-weight: 700; color: var(--navy);
  margin-bottom: 14px;
}
.sim-detail-grid {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.sim-repayment-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.sim-repayment-card .repay-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.sim-repayment-card .repay-title {
  font-size: 13px; font-weight: 700; color: var(--navy);
}
.sim-repayment-card .repay-land-label {
  font-size: 11px; color: var(--muted); font-weight: 700; text-align: right;
}
.sim-repayment-card .repay-land-val {
  font-family: 'Roboto', sans-serif; font-size: 26px; font-weight: 700;
  color: var(--navy); text-align: right; line-height: 1;
}
.sim-repayment-card .repay-land-val span { font-size: 13px; margin-left: 3px; font-family: 'Noto Sans JP', sans-serif; }
.repay-gauge-label { font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 6px; } 
#kigen-list-wrap { display: none; }
#kigen-list-wrap.open { display: block; }
.sim-tochi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  min-width: 220px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}
.sim-tochi-card .tc-label { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.sim-tochi-card .tc-price-box {
  background: var(--gold-light);
  border: 1px solid rgba(var(--gold-rgb),0.3);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.sim-tochi-card .tc-price-box .tc-price-val {
  font-family: 'Roboto', sans-serif;
  font-size: 22px; font-weight: 700; color: #1e293b;
}
.sim-tochi-card .tc-price-box .tc-price-unit { font-size: 12px; font-weight: 700; color: #64748b; }
.sim-tochi-card .tc-price-sub { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.sim-tochi-card .tc-price-note { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* プログレスバー */
.bar-row { margin-bottom: 10px; }
.bar-row-label-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.bar-row-label { font-size: 11px; color: #64748b; font-weight: 700; }
.bar-row-amount { font-size: 12px; font-weight: 700; color: var(--navy); }
.bar-row-amount.gold { color: var(--gold); }
.bar-double, .bar-triple {
  display: flex; border-radius: 99px; overflow: hidden;
  background: #cbd5e1; height: 12px; transition: all .3s; margin: 4px 0 12px;
}
.bar-seg { height: 100%; transition: width .5s cubic-bezier(.4,0,.2,1); }
.bar-seg-label, .bar-seg-label2 { display: none; }

/* チップ */
.bar-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.bar-chip {
  font-size: 12px; font-weight: 700; padding: 6px 16px;
  border-radius: 20px; color: #fff; display: inline-flex; align-items: center; gap: 5px;
}

/* 3列レイアウト */
.sim-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px; background: var(--beige); }
.col { background: var(--white); border-radius: 12px; padding: 24px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.col + .col { border-left: none; }

/* ============================================================
   TAB2: 諸費用
   ============================================================ */
.preset-bar {
  background: linear-gradient(135deg, #f1f5f9 0%, #e4e6ef 100%);
  padding: 18px 28px; border-bottom: 2px solid var(--gold);
}
.preset-bar-label { font-size: 11px; font-weight: 700; color: #64748b; letter-spacing: 0.08em; margin-bottom: 12px; }
.preset-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 11px 14px;
  width: 268px; box-sizing: border-box; text-align: center;
  border-radius: 6px; border: 1px solid #cbd5e1;
  background: rgba(255,255,255,0.7); color: #1e293b;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all .2s;
}
.preset-btn:hover { background: rgba(255,255,255,0.95); border-color: var(--gold); color: var(--navy); }
.preset-btn.active { background: #fdf4e3; border-color: var(--gold); color: var(--navy); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--gold), 0 2px 10px rgba(var(--gold-rgb),0.15); }
.preset-icon { font-size: 16px; line-height: 1.2; flex-shrink: 0; }
.preset-btn .preset-name { font-weight: 700; font-size: 13px; line-height: 1.3; display: block; }
.preset-btn .preset-sub { font-size: 11px; font-weight: 400; color: #64748b; opacity: 1; display: block; margin-top: 3px; line-height: 1.45; }
.preset-btn:hover .preset-sub { color: #475569; }
.preset-btn.active .preset-sub { color: #475569; }
.preset-add-btn { width: auto !important; flex-direction: row !important; align-items: center !important; align-self: center; justify-content: flex-start !important; gap: 5px !important; padding: 6px 8px !important; border: none !important; background: transparent !important; box-shadow: none !important; color: #64748b !important; }
.preset-add-btn .preset-icon { font-size: 13px !important; }
.preset-add-btn .preset-name { font-size: 12px !important; font-weight: 600 !important; text-decoration: underline; text-underline-offset: 3px; }
.preset-add-btn .preset-sub { display: none !important; }
.preset-add-btn:hover { color: var(--navy) !important; }
.preset-add-btn:hover .preset-name { color: var(--gold) !important; }
.preset-btns { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; justify-content: flex-start; }
.preset-changed-note { font-size: 11px; color: #64748b; margin-top: 10px; display: none; }
.preset-changed-note.show { display: block; }
.preset-custom-wrap { position: relative; display: inline-flex; }
.preset-custom-actions { position: absolute; top: -6px; right: -6px; display: none; gap: 4px; z-index: 10; }
.preset-custom-wrap:hover .preset-custom-actions { display: flex; }
.preset-custom-action { width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.preset-edit-btn { background: #fff; color: var(--navy); }
.preset-del-btn { background: var(--red); color: #fff; }

.shohi-layout { display: grid; grid-template-columns: 320px 1fr; background: var(--beige); min-height: 600px; }
/* 新レイアウト：カテゴリを横2列グリッドで表示 */
.shohi-left { padding: 22px 20px; border-right: 1px solid var(--border); background: var(--beige-card); overflow-y: auto; max-height: 760px; }
.shohi-left h3 { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--gold); }
.shohi-right { padding: 28px; }
.shohi-right h3 { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 16px; border-left: 4px solid var(--gold); padding-left: 12px; }

.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; }
.filter-btn { padding: 5px 14px; border-radius: 6px; border: 1px solid var(--border); font-size: 12px; font-weight: 500; cursor: pointer; background: var(--white); color: #475569; transition: all .15s; }
.filter-btn.active { background: #fdf4e3; color: var(--navy); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.filter-btn.gold.active { background: #fdf4e3; border-color: var(--gold); color: var(--navy); box-shadow: inset 0 0 0 1px var(--gold); }

/* カード1枚に最低430pxを保証し、列数は幅に応じて自動で3→2→1列に落とす（2026-08-31修正）。
   固定ブレークポイント（旧: 1000pxまで3列）では、ノートPC＋拡大表示の「有効幅1000〜1200px帯」で
   カードが行の必要幅（↑↓・税込表示込みで約410px）を下回り、overflow:hiddenのため
   スクロールも出せずに項目名・ボタンが見切れていた */
#shohi-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 16px; align-items: start; max-width: 1600px; }
@media (max-width: 600px){ #shohi-cats { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.cat-block { margin-bottom: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--white); box-shadow: var(--shadow-sm); }
.cat-header { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; cursor: pointer; user-select: none; background: #f8fafc; transition: background .15s; }
.cat-header:hover { background: #f1f5f9; }
.cat-header .cat-name { font-size: 13px; font-weight: 700; color: var(--navy); }
.cat-header .cat-total { font-family: 'Roboto', sans-serif; font-size: 13px; font-weight: 700; color: var(--navy); }
.cat-header .cat-arrow { font-size: 11px; color: var(--muted); transition: transform .2s; }
.cat-header.open .cat-arrow { transform: rotate(180deg); }
.cat-items { display: none; background: var(--white); }
.cat-items.open { display: block; }
.cat-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-top: 1px solid #f1f5f9; gap: 8px; }
/* 幅が足りないときは項目名だけが縮んで「…」になる（金額・ボタン類は縮めない・2026-08-31） */
.cat-item .item-input, .cat-item .row-move-cell, .cat-item .del-row-btn, .cat-item .info-btn { flex-shrink: 0; }
.cat-item.is-req { background: #f8fafc; }
.item-name { font-size: 12px; color: #1e293b; flex: 1; white-space: nowrap; min-width: 3em; overflow: hidden; text-overflow: ellipsis; }
.item-req { font-size: 12px; color: var(--navy); margin-right: 4px; flex-shrink: 0; }
.item-unit { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.item-input { width: 92px; text-align: right; border: 1px solid #cbd5e1; border-radius: 6px; padding: 5px 8px; font-family: 'Roboto', sans-serif; font-size: 13px; font-weight: 700; color: var(--navy); outline: none; background: var(--white); }
.item-input.req-input { border-color: var(--navy); background: #f1f5f9; }
.item-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(var(--gold-rgb),0.15); }
.add-row-btn { display: block; width: 100%; padding: 9px; background: transparent; border: 1.5px dashed #cbd5e1; border-top: none; border-radius: 0 0 10px 10px; color: var(--navy); font-size: 12px; font-weight: 700; cursor: pointer; transition: background .15s; }
.add-row-btn:hover { background: rgba(12,29,54,0.03); }
.del-row-btn { background: transparent; border: none; color: #cbd5e1; font-size: 13px; cursor: pointer; padding: 0 3px; transition: color .15s; }
.del-row-btn:hover { color: var(--red); }
.reset-btn { background: transparent; border: 1px solid var(--border); border-radius: 6px; padding: 4px 12px; font-size: 11px; color: var(--muted); cursor: pointer; }
.reset-btn:hover { background: #e4e6ef; }
.info-btn { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #cbd5e1; color: #94a3b8; font-size: 11px; font-weight: 700; cursor: pointer; border: none; margin-left: 6px; }
.chukai-auto-btn { display: inline-flex; align-items: center; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 6px; border: 1px solid #cbd5e1; background: #f1f5f9; color: #94a3b8; cursor: pointer; margin-left: 8px; vertical-align: middle; transition: background .15s, color .15s; }
.chukai-auto-btn.on { background: #1a2035; color: #fff; border-color: #1a2035; }

.shohi-total-box { background: var(--navy); border-radius: 12px; padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow-md); }
.shohi-total-label { font-size: 12px; color: rgba(255,255,255,.5); margin-bottom: 6px; font-weight: 500; }
.shohi-total-val { font-family: 'Roboto', sans-serif; font-size: 40px; font-weight: 700; color: var(--gold); }
.shohi-total-unit { font-size: 18px; color: var(--gold); font-weight: 700; }
.shohi-total-sub { font-size: 12px; color: rgba(255,255,255,.4); margin-top: 6px; }

.shohi-summary { background: var(--gold-light); border-radius: 10px; padding: 18px; margin-bottom: 18px; border: 1px solid rgba(var(--gold-rgb),0.2); }
.shohi-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(var(--gold-rgb),0.15); font-size: 13px; }
.shohi-summary-row:last-child { border-bottom: none; }
.sr-label { color: var(--gold-dark); font-weight: 700; font-size: 12px; }
.sr-val { font-family: 'Roboto', sans-serif; font-weight: 700; color: var(--navy); }

.shohi-bar-wrap { margin-top: 18px; }
.shohi-bar { display: flex; height: 32px; border-radius: 6px; overflow: hidden; background: #e4e6ef; margin-bottom: 8px; }
.shohi-bar-seg { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; font-weight: 700; overflow: hidden; white-space: nowrap; padding: 0 6px; }

.honsha-block { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.honsha-block label { font-size: 12px; font-weight: 700; color: #475569; display: block; margin-bottom: 8px; }
.honsha-iw { display: flex; align-items: center; gap: 8px; }
.honsha-iw input { flex: 1; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 14px; font-family: 'Roboto', sans-serif; font-size: 18px; font-weight: 700; color: var(--navy); text-align: right; outline: none; }
.honsha-iw input:focus { border-color: var(--gold); }

.grand-box { background: var(--navy-deep); border-radius: 12px; padding: 20px; text-align: center; box-shadow: var(--shadow-md); }
.grand-label { font-size: 12px; color: rgba(255,255,255,.5); margin-bottom: 6px; }
.grand-val { font-family: 'Roboto', sans-serif; font-size: 36px; font-weight: 700; color: var(--gold); }
.grand-unit { font-size: 16px; color: var(--gold); font-weight: 700; }

/* ============================================================
   TAB3: 家の坪数
   ============================================================ */
.other-floor-btn { padding: 7px 18px; border-radius: 8px; border: 1px solid #cbd5e1; font-size: 13px; font-weight: 500; cursor: pointer; background: var(--white); color: #475569; transition: all .15s; }
.other-floor-btn:hover { border-color: var(--gold); color: var(--gold); }
.other-floor-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }

.ie-layout { display: grid; grid-template-columns: 1fr minmax(360px, 420px); background: var(--beige); min-height: 600px; max-width: 1080px; margin: 0 auto; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.ie-left { padding: 24px 28px; background: var(--white); border-right: 1px solid var(--border); overflow-x: auto; }
.ie-right { padding: 28px; background: var(--beige-card); }

/* ── 初期バナー：LDK別グリッド ── */
.banner-plan-grid { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; max-width: 680px; margin: 0 auto; box-shadow: var(--shadow-sm); }
.banner-ldk-col { flex: 1; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.banner-ldk-col:last-child { border-right: none; }
.banner-ldk-label { font-size: 12px; font-weight: 700; color: var(--navy); background: linear-gradient(180deg,#f1f5f9,#e4e6ef); padding: 9px 8px 8px; text-align: center; border-bottom: 1px solid var(--border); letter-spacing: 0.04em; }
.banner-plan-btn { display: block; width: 100%; padding: 10px 6px; background: #fff; border: none; border-top: 1px solid #f1f5f9; font-size: 12px; font-weight: 500; color: #475569; cursor: pointer; transition: all .15s; text-align: center; }
.banner-plan-btn:first-of-type { border-top: none; }
.banner-plan-btn:hover { background: var(--gold-light); color: var(--navy); font-weight: 700; }
/* バナーの「＋ 追加」：プラン選択パネルの plan-add-btn と同じ見た目に揃える */
.banner-plan-btn.banner-plan-add { color: #94a3b8; background: #f8fafc; border-top: 1px dashed #cbd5e1; font-size: 11px; font-weight: 700; }
.banner-plan-btn.banner-plan-add:hover { background: var(--gold-light); color: var(--gold-dark); }

/* ── 選択済みバー ── */
.plan-selected-bar { display: flex; align-items: center; justify-content: space-between; background: #f1f5f9; border: 1px solid #e4e6ef; border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; gap: 12px; }
.plan-selected-left { display: flex; align-items: center; gap: 12px; }
.plan-selected-icon { font-size: 22px; line-height: 1; }
.plan-selected-sub { font-size: 12px; color: #64748b; font-weight: 700; margin-bottom: 2px; }
.plan-selected-name { font-size: 15px; font-weight: 700; color: #1a2035; letter-spacing: 0.02em; }
.plan-change-btn { background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; padding: 7px 14px; font-size: 12px; font-weight: 700; color: #1a2035; cursor: pointer; white-space: nowrap; transition: all .15s; }
.plan-change-btn:hover { background: #f1f5f9; color: #1a2035; border-color: var(--gold); }
.plan-change-btn.open { background: #1a2035; border-color: #1a2035; color: #fff; }

/* ── プラン選択パネル（変更時展開） ── */
.plan-select-panel { background: var(--beige-card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; }

/* ── カテゴリグリッド（サイドバー内） ── */
.plan-category-grid { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 0; }
.plan-category { flex: 1; border-right: 1px solid var(--border); }
.plan-category:last-child { border-right: none; }
.plan-cat-label { font-size: 11px; font-weight: 700; color: var(--navy); background: #f1f5f9; padding: 7px 8px 6px; border-bottom: 1px solid var(--border); letter-spacing: 0.04em; text-align: center; }
.plan-category .plan-btns { display: flex; flex-direction: column; gap: 0; padding: 0; }
.plan-category .plan-btn { display: block; width: 100%; padding: 8px 6px; border-radius: 0; border: none; border-top: 1px solid #f1f5f9; font-size: 12px; font-weight: 500; cursor: pointer; background: var(--white); color: #475569; transition: all .15s; text-align: center; white-space: nowrap; }
.plan-category .plan-btn:first-child { border-top: none; }
.plan-category .plan-btn:hover { background: var(--gold-light); color: var(--navy); }
.plan-category .plan-btn.active { background: var(--navy); color: #fff; font-weight: 700; }

.plan-group-label { font-size: 11px; font-weight: 700; color: var(--gold); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.plan-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 0; }
.plan-btn { padding: 7px 16px; border-radius: 6px; border: 1px solid #cbd5e1; font-size: 13px; font-weight: 500; cursor: pointer; background: var(--white); color: #475569; transition: all .15s; }
.plan-btn:hover { border-color: var(--gold); color: var(--gold); }
.plan-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; }

/* プランボタンの✎編集アイコン（プリセットの✎編集と同じ操作方法：ホバーで右上に表示） */
.plan-btn-wrap { position: relative; display: inline-block; }
.plan-category .plan-btn-wrap { display: block; }
.plan-btn-edit { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: none;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); color: var(--navy); font-size: 10px; font-weight: 700;
  display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 5; }
.plan-btn-wrap:hover .plan-btn-edit { display: flex; }
/* カスタム追加プランの削除✕（✎の左隣にホバー表示） */
.plan-btn-del { position: absolute; top: -6px; right: 16px; width: 20px; height: 20px; border-radius: 50%; border: none;
  background: var(--red, #ef4444); box-shadow: 0 1px 4px rgba(0,0,0,.25); color: #fff; font-size: 10px; font-weight: 700;
  display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 5; }
.plan-btn-wrap:hover .plan-btn-del { display: flex; }
/* カテゴリへの間取りタイプ「＋ 追加」ボタンとメニュー */
.plan-category .plan-add-btn { display: block; width: 100%; padding: 7px 6px; border: none; border-top: 1px dashed #cbd5e1;
  background: #f8fafc; color: #94a3b8; font-size: 11px; font-weight: 700; cursor: pointer; text-align: center; transition: all .15s; }
.plan-category .plan-add-btn:hover { background: var(--gold-light); color: var(--gold-dark); }
.plan-add-menu { border-top: 1px solid #e4e6ef; background: #fffdf5; }
.plan-add-option { display: block; width: 100%; padding: 7px 6px; border: none; border-top: 1px solid #f1f5f9;
  background: transparent; color: #475569; font-size: 12px; cursor: pointer; text-align: center; }
.plan-add-option:hover { background: var(--gold-light); color: var(--navy); font-weight: 700; }
.plan-add-form { display: flex; flex-direction: column; gap: 5px; padding: 8px; }
.plan-add-form .plan-add-type,
.plan-add-form .plan-add-title { width: 100%; border: 1.5px solid #e4e6ef; border-radius: 5px; padding: 6px 7px; font-size: 12px; outline: none; box-sizing: border-box; background: #fff; }
.plan-add-form .plan-add-type:focus,
.plan-add-form .plan-add-title:focus { border-color: var(--gold); }
.plan-add-form .plan-add-submit { width: 100%; padding: 6px; border: none; border-radius: 5px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.plan-add-form .plan-add-submit:hover { background: var(--gold-dark); }

/* ③ 総予算/総額のスリム常時表示バー（買うものの総額グループ）
   下のコンテンツ（家・土地タブの max-width:1080px 中央寄せ）と同じ幅に揃え、
   お財布（総予算）を上・総額を下に縦積みして、同一スケールのバー長で見比べられるようにする */
#cost-summary-bar { display: flex; flex-direction: column; gap: 12px; background: #f8fafc; border: 1px solid #e4e6ef; border-radius: 10px; padding: 12px 18px; margin: 4px auto 14px; max-width: 1080px; width: calc(100% - 96px); box-sizing: border-box; }
@media (max-width: 900px) { #cost-summary-bar { width: calc(100% - 32px); } }
#cost-summary-bar .cs-col { width: 100%; }
#cost-summary-bar .cs-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#cost-summary-bar .cs-lbl { font-size: 11px; font-weight: 600; color: #64748b; }
#cost-summary-bar .cs-val { font-size: 18px; font-weight: 700; color: #1a2035; font-family: 'Roboto', sans-serif; white-space: nowrap; }
#cost-summary-bar .cs-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #e2e8f0; margin: 6px 0 5px; }
#cost-summary-bar .cs-seg { height: 100%; transition: width .3s; }
#cost-summary-bar .cs-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 10.5px; color: #64748b; }
#cost-summary-bar .cs-legend .cs-key { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
#cost-summary-bar .cs-legend .cs-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

.madori-table { width: 100%; border-collapse: collapse; min-width: 0; }
.madori-table th { font-size: 11px; font-weight: 700; color: var(--muted); padding: 8px 10px; text-align: left; border-bottom: 2px solid var(--border); }
.madori-table th:nth-child(2) { text-align: right; white-space: nowrap; }
.madori-table td { padding: 7px 10px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
.madori-table .room-name { font-weight: 700; color: var(--navy); white-space: nowrap; width: 100%; }
.madori-table td:nth-child(2) { width: 1px; white-space: nowrap; text-align: right; padding: 0 10px; vertical-align: middle; }
.madori-table td.unit { white-space: nowrap; padding: 0 10px 0 4px; width: 1px; vertical-align: middle; }
.madori-table input.tsubo-input { width: 72px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 7px 8px; font-family: 'Roboto', sans-serif; font-size: 14px; font-weight: 700; color: var(--navy); text-align: right; outline: none; }
.madori-table input.tsubo-input:focus { border-color: var(--gold); }
.madori-table input.tsubo-input[readonly] { background: #e4e6ef; border-color: #cbd5e1; color: #94a3b8; }
/* 3階建て（3列表示）時のコンパクトモード：各列を縮小して重なり・はみ出しを防ぐ */
.madori-cols-wrap.compact3 .madori-col { padding: 0 8px 0 0; }
.madori-cols-wrap.compact3 .madori-col + .madori-col { padding: 0 8px; }
.madori-cols-wrap.compact3 .madori-table th { padding: 8px 4px; font-size: 10px; }
.madori-cols-wrap.compact3 .madori-table td { padding: 6px 4px; font-size: 12px; }
.madori-cols-wrap.compact3 .madori-table td:nth-child(2) { padding: 0 2px; }
.madori-cols-wrap.compact3 .madori-table td.unit { padding: 0 4px 0 2px; }
.madori-cols-wrap.compact3 .madori-table .room-name { white-space: normal; font-size: 11px; line-height: 1.3; word-break: break-all; }
.madori-cols-wrap.compact3 .madori-table input.tsubo-input { width: 46px; padding: 5px 4px; font-size: 12px; }
.madori-cols-wrap { display: grid; grid-template-columns: 1fr; gap: 0; align-items: flex-start; }
/* グリッド列がコンテンツ幅（min-width:auto）で膨らんで隣列と重ならないよう縮小を許可 */
.madori-cols-wrap .madori-col { min-width: 0; }
.madori-cols-wrap .madori-col .madori-table { width: 100%; }
/* 追加行（カスタム部屋）の部屋名入力：固定行のラベルと同じ見た目（透明枠・太字ネイビー）。
   フォーカス時だけ枠を出して編集可能であることを示す */
.madori-table input.custom-room-name-input { flex: 1 1 auto; min-width: 0; width: 100%; border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 2px 4px; margin-left: -4px; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--navy); outline: none; }
.madori-table input.custom-room-name-input:hover { border-color: #e4e6ef; }
.madori-table input.custom-room-name-input:focus { border-color: var(--gold); background: #fff; }
.madori-table input.custom-room-name-input::placeholder { color: #cbd5e1; font-weight: 400; }
.madori-cols-wrap.compact3 .madori-table input.custom-room-name-input { font-size: 11px; padding: 2px 2px; margin-left: -2px; }
/* 追加行の削除ボタン：控えめに表示・ホバーで赤 */
.custom-room-del { background: transparent; border: none; color: #cbd5e1; cursor: pointer; font-size: 13px; padding: 2px 3px; margin-left: 2px; vertical-align: middle; }
.custom-room-del:hover { color: #ef4444; }
.madori-cols-wrap.compact3 .custom-room-del { font-size: 11px; padding: 1px 2px; margin-left: 0; }
.madori-col { width: 100%; min-width: 0; padding: 0 24px 0 0; }
.madori-col + .madori-col { padding: 0 24px 0 24px; border-left: 1px solid var(--border); }
.madori-subtotal { display: flex; justify-content: space-between; align-items: center; background: var(--blue-light); border: 1px solid #e4e6ef; border-radius: 8px; padding: 11px 14px; margin: 12px 0; width: fit-content; min-width: 280px; gap: 24px; }
.madori-subtotal .stl { font-size: 12px; font-weight: 700; color: #475569; }
.madori-subtotal .stv { font-family: 'Roboto', sans-serif; font-size: 18px; font-weight: 700; color: var(--navy); }

.ie-result-box { background: #f1f5f9; border: 1px solid #e4e6ef; border-left: 4px solid var(--gold); border-radius: 12px; padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.ie-result-label { font-size: 11px; color: #64748b; font-weight: 700; margin-bottom: 4px; }
.ie-result-val { font-family: 'Roboto', sans-serif; font-size: 40px; font-weight: 700; color: #1a2035; line-height: 1; }
.ie-result-unit { font-size: 18px; color: #1a2035; font-weight: 700; }
.ie-result-sub { font-size: 12px; color: #94a3b8; margin-top: 6px; }
.ie-breakdown { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; margin-bottom: 14px; }
.ie-breakdown-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.ie-breakdown-row:last-child { border-bottom: none; }
.ie-sync-btn { width: 100%; padding: 13px; background: #334155; border: none; border-radius: 8px; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 8px; transition: all .2s; }
.ie-sync-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }

.tanka-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tanka-row label { font-size: 13px; font-weight: 700; color: #475569; min-width: 130px; }
.tanka-row input { width: 100px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 12px; font-family: 'Roboto', sans-serif; font-size: 15px; font-weight: 700; color: var(--navy); text-align: right; outline: none; }
.tanka-row input:focus { border-color: var(--gold); }

/* ============================================================
   軽減策カード (kigen)
   ============================================================ */
.kigen-card {
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 12px; transition: all .2s;
}
.kigen-card.checked { border-color: var(--gold); background: var(--gold-light); }
.kigen-card-left { display: flex; align-items: center; gap: 14px; flex: 1; }
.kigen-card-icon { width: 42px; height: 42px; background: #f1f5f9; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.kigen-card.checked .kigen-card-icon { background: var(--navy); }
.kigen-card-text h4 { font-size: 14px; font-weight: 700; color: var(--navy); }
.kigen-card-text p { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.kigen-card-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.kigen-card-effect { text-align: right; }
.kigen-card-effect .eff-label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 2px; }
.kigen-card-effect .eff-val { font-family: 'Roboto', sans-serif; font-size: 18px; font-weight: 700; color: var(--red); }

/* iOS風トグル */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #CBD5E1; transition: .2s; border-radius: 26px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #fff; transition: .2s; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
input:checked + .slider { background: var(--navy); }
input:checked + .slider:before { transform: translateX(20px); }

/* ============================================================
   共通ボタン・モーダル
   ============================================================ */
.sv-btn { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 12px; font-weight: 700; transition: all .15s; white-space: nowrap; }
.sv-btn-save { background: #334155; color: #fff; }
.sv-btn-save:hover { filter: brightness(1.08); }
.sv-btn-load { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.sv-btn-load:hover { background: rgba(255,255,255,.18); }
.sv-btn-print { background: rgba(255,255,255,.06); color: #fff; border: 1px solid rgba(255,255,255,.15); }
.sv-btn-print:hover { background: rgba(255,255,255,.13); }

.modal-overlay, .sv-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(12,29,54,.55); z-index: 2000; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.open, .sv-modal-overlay.open { display: flex; }
.modal-box { background: var(--white); border-radius: 16px; max-width: 680px; width: 92%; box-shadow: 0 20px 50px rgba(12,29,54,.2); overflow: hidden; animation: modalIn .2s ease; border: 1px solid var(--gold); }
.sv-modal { background: var(--white); border-radius: 16px; max-width: 520px; width: 90%; box-shadow: 0 20px 50px rgba(12,29,54,.2); overflow: hidden; animation: modalIn .2s ease; border: 1px solid var(--gold); }
@keyframes modalIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header, .sv-modal-hdr { background: var(--navy); padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--gold); }
.modal-title { color: #fff; font-size: 18px; font-weight: 700; }
.sv-modal-title { color: #fff; font-size: 15px; font-weight: 700; }
.modal-cat { font-size: 11px; color: var(--gold); font-weight: 700; margin-top: 2px; }
.modal-close, .sv-modal-close { background: transparent; border: none; color: rgba(255,255,255,.5); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover, .sv-modal-close:hover { color: #fff; }
.modal-body { padding: 28px 32px; }
.sv-modal-body { padding: 24px; }
.modal-tagline { font-size: 15px; font-weight: 700; color: var(--navy); background: var(--blue-light); border-left: 4px solid var(--gold); padding: 14px 18px; border-radius: 0 8px 8px 0; margin-bottom: 18px; line-height: 1.7; }
.modal-desc { font-size: 14px; color: #475569; line-height: 1.9; }

.sv-input-row { display: flex; gap: 10px; margin-bottom: 18px; }
.sv-input-row input { flex: 1; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 14px; font-size: 14px; color: var(--navy); outline: none; font-weight: 500; }
.sv-input-row input:focus { border-color: var(--gold); }
.sv-do-btn { padding: 10px 22px; background: var(--gold); color: var(--navy); border: none; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.sv-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.sv-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.sv-item-info { flex: 1; min-width: 0; }
.sv-item-name { font-size: 13px; font-weight: 700; color: var(--navy); }
.sv-item-date { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.sv-item-load { padding: 6px 14px; background: var(--navy); color: #fff; border: none; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; }
.sv-item-del { padding: 6px 10px; background: transparent; color: #cbd5e1; border: 1px solid #e4e6ef; border-radius: 6px; font-size: 12px; cursor: pointer; }
.sv-item-del:hover { color: var(--red); border-color: var(--red); }
.sv-empty { text-align: center; padding: 28px; color: #cbd5e1; font-size: 13px; }
.sv-list-title { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.sv-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 28px; border-radius: 30px; font-size: 13px; font-weight: 700; z-index: 3000; opacity: 0; transition: opacity .25s; box-shadow: 0 8px 24px rgba(0,0,0,.2); pointer-events: none; }
.sv-toast.show { opacity: 1; }

/* ── 情報ポップオーバー（旧モーダルを置き換え） ── */
#info-popover {
  display: none;
  position: fixed;
  z-index: 2500;
  width: 480px;
  max-width: calc(100vw - 24px);
  max-height: 78vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(12,29,54,.22), 0 2px 8px rgba(12,29,54,.12);
  border: 1px solid var(--gold);
  overflow: hidden;
  animation: popIn .18s cubic-bezier(.22,1,.36,1);
  flex-direction: column;
}
#info-popover.open { display: flex; }
@keyframes popIn { from { transform: scale(.94) translateY(-6px); opacity:0; } to { transform: scale(1) translateY(0); opacity:1; } }
/* 矢印（上から出る場合） */
#info-popover::before {
  content: '';
  position: absolute;
  top: -8px;
  left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  width: 16px; height: 8px;
  background: var(--navy);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
/* 矢印（下から出る場合） */
#info-popover.pop-up::before {
  top: auto;
  bottom: -8px;
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  background: var(--gold);
}
.pop-header {
  background: var(--navy);
  padding: 16px 20px 14px;
  display: flex; align-items: flex-start; justify-content: space-between;
  border-bottom: 2px solid var(--gold);
  flex-shrink: 0;
}
.pop-title { color: #fff; font-size: 18px; font-weight: 700; line-height: 1.3; }
.pop-cat   { font-size: 12px; color: var(--gold); font-weight: 700; margin-top: 3px; letter-spacing: .05em; }
.pop-close {
  background: transparent; border: none; color: rgba(255,255,255,.45);
  font-size: 22px; cursor: pointer; line-height: 1; flex-shrink: 0;
  padding: 0 0 0 12px; margin-top: 1px;
}
.pop-close:hover { color: #fff; }
.pop-body {
  overflow-y: auto; padding: 20px 22px 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.pop-tagline {
  font-size: 15px; font-weight: 700; color: var(--navy);
  background: var(--blue-light); border-left: 4px solid var(--gold);
  padding: 13px 16px; border-radius: 0 8px 8px 0; line-height: 1.7;
}
.pop-desc { font-size: 14px; color: #475569; line-height: 1.9; }
.pop-note { font-size: 13px; color: #64748b; background: #f8fafc; padding: 12px 15px; border-radius: 6px; line-height: 1.85; }
.pop-points-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.pop-point-row { padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.pop-point-row:last-child { border-bottom: none; }
.pop-point-q { display: block; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.pop-point-a { display: block; color: #475569; line-height: 1.75; }
/* 背景クリック用の透明レイヤー */
#info-popover-backdrop {
  display: none; position: fixed; inset: 0; z-index: 2499;
}
#info-popover-backdrop.open { display: block; }


.rate-zone { background: #f1f5f9; border: 1px solid #e4e6ef; border-radius: 12px; padding: 16px; margin-top: 14px; }
.rate-zone-title { font-size: 11px; font-weight: 700; color: #64748b; letter-spacing: .05em; margin-bottom: 10px; }
.rate-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rate-btn { padding: 6px 14px; border-radius: 6px; border: 1px solid #cbd5e1; background: rgba(255,255,255,0.7); color: #475569; font-size: 12px; font-weight: 500; cursor: pointer; transition: all .15s; }
.rate-btn:hover { background: #fdf4e3; border-color: var(--gold); color: var(--navy); }
.rate-btn.active { background: #fdf4e3; border-color: var(--gold); color: var(--navy); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--gold), 0 2px 10px rgba(var(--gold-rgb),0.15); }
.risk-talk { background: #fff; border: 1px solid #e4e6ef; border-radius: 8px; padding: 12px 14px; font-size: 12px; color: #1e293b; line-height: 1.8; display: none; }
.risk-talk.show { display: block; }
.risk-talk strong { color: var(--gold); font-weight: 700; }
.risk-ok { color: #10b981; font-weight: 700; }
.risk-warn { color: var(--gold); font-weight: 700; }
.risk-ng { color: #ef4444; font-weight: 700; }
.rate-default-link { font-size: 11px; color: #64748b; cursor: pointer; text-decoration: underline; margin-left: 8px; }
.rate-default-link:hover { color: var(--gold); }
#safe-rate-slider { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--gold) 0%, var(--gold) 44.4%, #e4e6ef 44.4%, #e4e6ef 100%); outline: none; cursor: pointer; }
#safe-rate-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(12,29,54,.25); cursor: pointer; }
#safe-rate-slider::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(12,29,54,.25); cursor: pointer; }
#safe-rate-slider::-moz-range-track { height: 6px; border-radius: 3px; background: transparent; }
.def-quick-btn { padding: 5px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: var(--white); font-size: 12px; font-weight: 500; cursor: pointer; color: #475569; }
.def-quick-btn:hover { border-color: var(--gold); color: var(--gold); }

/* カスタムプリセット */
.cp-cat-label { font-size: 11px; font-weight: 700; color: var(--gold); letter-spacing: .05em; padding: 8px 4px 4px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.cp-item-row { display: grid; grid-template-columns: 1fr 105px 128px 46px 40px 26px; align-items: center; gap: 4px; padding: 5px 4px; border-radius: 5px; }
.tax-flag-btn { font-size: 10px; border: 1px solid #e4e6ef; background: #fff; color: #64748b; border-radius: 4px; padding: 3px 0; cursor: pointer; white-space: nowrap; }
.tax-flag-btn.notax { background: #fdf6e3; border-color: #e6d9a8; color: #8a6d1a; font-weight: 600; }
.cp-item-row:hover { background: #f8fafc; }
/* 諸費用の中項目見出し（第2弾・メインタブ＆印刷） */
.shohi-grp-row { display: flex; justify-content: space-between; align-items: center; background: #eef2f7; padding: 4px 12px; margin: 7px 0 2px; border-radius: 4px; border-left: 3px solid #94a3b8; }
.shohi-grp-row .grp-name { font-size: 11px; font-weight: 600; color: #475569; letter-spacing: .04em; }
.shohi-grp-row .grp-total { font-size: 10.5px; color: #64748b; font-family: 'Roboto', sans-serif; white-space: nowrap; }
/* 項目の並び替え（↑↓）ボタン（2026-08-25 ④・cp/fp両モーダル共通） */
.row-move-cell { display: flex; gap: 2px; justify-content: center; }
.row-move-btn { width: 18px; height: 22px; border: 1px solid #e4e6ef; background: #fff; border-radius: 4px; color: #64748b; font-size: 11px; cursor: pointer; padding: 0; line-height: 1; }
.row-move-btn:hover { background: #eef2ff; color: #1a2035; border-color: #c7d2fe; }
.cp-name-input { border: 1px solid transparent; border-radius: 4px; padding: 4px 7px; font-size: 12px; color: var(--text); background: transparent; width: 100%; outline: none; }
.cp-name-input:focus { border-color: var(--gold); background: var(--white); }
.cp-extra-del { width: 22px; height: 22px; border-radius: 50%; border: none; background: transparent; color: #cbd5e1; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cp-extra-del:hover { color: var(--red); background: #fef2f2; }
.cp-cat-add-btn { display: block; width: 100%; padding: 5px 0; margin-bottom: 8px; background: transparent; border: 1.5px dashed #cbd5e1; border-radius: 5px; color: #94a3b8; font-size: 11px; font-weight: 700; cursor: pointer; }
.cp-cat-add-btn:hover { border-color: var(--navy); color: var(--navy); }
.cp-toggle { display: flex; border: 1px solid #cbd5e1; border-radius: 6px; overflow: hidden; }
.cp-toggle-opt { padding: 4px 10px; font-size: 11px; font-weight: 700; cursor: pointer; background: var(--white); color: #94a3b8; border: none; }
.cp-toggle-opt.req-on { background: var(--navy); color: #fff; }
.cp-toggle-opt.opt-on { background: #f1f5f9; color: #475569; }

/* 固定プリセット行 */
.fp-master-row, .fp-extra-row { display: grid; grid-template-columns: 1fr 130px 26px; gap: 6px; align-items: center; padding: 5px 4px; }

/* フォーミュラボックス */
.formula-mini { background: #f1f5f9; border-radius: 8px; padding: 10px 14px; font-size: 11px; color: #475569; text-align: center; line-height: 1.7; margin: 10px 0; }
.formula-mini strong { color: var(--navy); }

/* 印刷シート選択モーダル */
.psm-overlay { position:fixed;inset:0;background:rgba(0,0,0,.65);z-index:9999;display:flex;align-items:center;justify-content:center; }
.psm-dialog { background:#fff;border-radius:16px;width:min(94vw,880px);max-height:90vh;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 24px 64px rgba(0,0,0,.45); }
.psm-header { padding:18px 24px 14px;border-bottom:1px solid #e4e6ef;display:flex;align-items:flex-start;justify-content:space-between;flex-shrink:0; }
.psm-grid { flex:1;overflow-y:auto;padding:16px 20px;display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px; }
.psm-card { border:2px solid #e4e6ef;border-radius:12px;overflow:hidden;cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .1s;user-select:none;background:#fff;position:relative; }
.psm-card:hover { border-color:var(--gold);box-shadow:0 4px 16px rgba(0,0,0,.1);transform:translateY(-1px); }
.psm-card.selected { border-color:#1a2035;box-shadow:0 2px 12px rgba(12,29,54,.18); }
.psm-card-thumb { height:130px;overflow:hidden;position:relative; }
.psm-card-thumb-inner { position:absolute;top:0;left:0;width:1100px;transform-origin:top left;pointer-events:none; }
.psm-card-info { padding:10px 12px 12px; }
.psm-card-title { font-size:13px;font-weight:700;color:#1a2035;margin-bottom:4px; }
.psm-card-desc { font-size:11px;color:#94a3b8;line-height:1.5; }
.psm-check { position:absolute;top:8px;right:8px;width:22px;height:22px;border-radius:50%;background:#1a2035;display:flex;align-items:center;justify-content:center;color:#fff;font-size:13px;font-weight:700;opacity:0;transition:opacity .15s; }
.psm-card.selected .psm-check { opacity:1; }
.psm-footer { padding:14px 24px;border-top:1px solid #e4e6ef;display:flex;align-items:center;gap:10px;flex-shrink:0;background:#f8fafc; }
.psm-btn-sm { font-size:12px;padding:6px 12px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;color:#475569;cursor:pointer; }
.psm-btn-sm:hover { background:#f1f5f9; }
.psm-btn-exec { font-size:13px;font-weight:700;padding:9px 22px;border:none;border-radius:8px;background:#334155;color:#fff;cursor:pointer;display:flex;align-items:center;gap:7px; }
.psm-btn-exec:hover { background:#1a2035; }
.psm-btn-exec:disabled { background:#94a3b8;cursor:not-allowed; }

/* 印刷 */
.cond-row, .cond-badge-old, .cond-text-old, .bar-section { display: none; }
.save-btn-wrap { display: flex; gap: 6px; }

@media print {
  @page { size: A3 landscape; margin: 4mm; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body { padding: 0 !important; background: var(--beige) !important; }
  .header { border-radius: 0 !important; }
  .panel { display: none !important; }
  .panel.active { display: block !important; border-radius: 0 !important; }
  .tabs, .subtabs, .save-btn-wrap, .sv-btn, .reset-btn, .filter-bar, .add-row-btn, .del-row-btn, .ie-sync-btn, .rate-zone, .preset-bar, .modal-overlay, .sv-modal-overlay, .sv-toast, .print-hide { display: none !important; }
  .cat-items { display: block !important; }
}

/* ── 予算が合わない場合のショートカット（2026-09-29）──
   .sc-link: 確認手順の各行の右端に置く小さな移動ボタン（既存の next-step-trigger と同じ配色）
   #tochi-shortcut-btn: 全ページ共通の「確認手順へ戻る」固定ボタン（土地タブでは非表示・印刷には出さない）
   .sc-highlight: 飛び先の欄を数秒だけ金色で光らせる */
.sc-link {
  margin-left: auto;
  flex-shrink: 0;
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s;
}
.sc-link:hover { background: rgba(var(--gold-rgb),0.08); border-color: var(--gold); transform: translateX(2px); }
#tochi-shortcut-btn {
  position: fixed;
  right: 16px;                   /* 右下の「ログイン中」バー（bottom16px・高さ約40px）の真上に揃える */
  bottom: 64px;
  z-index: 1500;                 /* モーダル（2000〜）より下・本文より上 */
  display: none;
  align-items: center;
  gap: 7px;
  background: #1a2035;           /* 真下の「ログイン中」バーと同じ濃紺（並べて違和感が出ないように） */
  color: #fff;
  border: none;                  /* 丸いボタンに左の金帯を付けると三日月状に欠けて見えるため外し、アイコンを金にする */
  border-radius: 999px;
  padding: 11px 18px 11px 15px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
  transition: transform .15s, box-shadow .15s, background .15s;
}
#tochi-shortcut-btn svg { color: var(--gold); }
#tochi-shortcut-btn:hover { background: #334155; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.28); }
#tochi-shortcut-btn.on { display: inline-flex; }
@keyframes scHighlight {
  0%   { box-shadow: 0 0 0 0 rgba(var(--gold-rgb),0.0); background-color: rgba(var(--gold-rgb),0.30); }
  30%  { box-shadow: 0 0 0 6px rgba(var(--gold-rgb),0.35); background-color: rgba(var(--gold-rgb),0.25); }
  100% { box-shadow: 0 0 0 0 rgba(var(--gold-rgb),0.0); background-color: transparent; }
}
.sc-highlight { animation: scHighlight 2.6s ease-out 1; border-radius: 8px; }
@media print { .sc-link, #tochi-shortcut-btn { display: none !important; } }

/* kigen-card2: 2列グリッド用コンパクトカード */
.kigen-card2 { background:#fff; border:1px solid #e4e6ef; }
.kigen-card2.checked { background:#f8fafc; border-color:var(--gold); }
.kigen-card2-icon { background:#f1f5f9; }
.kigen-card2.checked .kigen-card2-icon { background:#f1f5f9; }
.kigen-track2 { background:#CBD5E1; }
.kigen-card2.checked .kigen-track2 { background:#1a2035; }
.kigen-knob2 { left:2px; }
.kigen-card2.checked .kigen-knob2 { left:18px !important; }

/* ── サブタブの視認性とアニメーションの強化 ── */
.subtab {
  color: #475569;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.subtab:hover:not(.active) {
  color: var(--navy);
  background: rgba(12, 29, 54, 0.05);
}

/* ── ヘッダーボタンの階層化 ── */
.header button {
  transition: all 0.2s ease;
}
.header button[onclick*="Load"],
.header button[onclick*="openPrintSelectModal"] {
  background: #f8fafc !important;
  border: 1px solid #e4e6ef !important;
  color: #1a2035 !important;
}
.header button[onclick*="Load"]:hover,
.header button[onclick*="openPrintSelectModal"]:hover {
  background: #f1f5f9 !important;
  color: #1a2035 !important;
}

/* ── カードの立体感と柔らかさの調整 ── */
.card, .sim-bar-zone-header > div, .sim-repayment-card, .sim-tochi-card {
  border: 1px solid rgba(12, 29, 54, 0.08) !important;
  box-shadow: 0 4px 12px rgba(12, 29, 54, 0.03) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover, .sim-repayment-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(12, 29, 54, 0.06) !important;
}

/* ── 下部3列のセクション余白の最適化 ── */
.sim-bottom .sec {
  margin: 28px 0 16px;
  letter-spacing: 0.1em;
}
.sim-bottom .sec:first-child {
  margin-top: 0;
}

/* ── 対面プレゼン特化：文字サイズの底上げ ── */
.field label, .u, .tl, .note {
  font-size: 13px !important;
}
.cat-header .cat-name, .madori-table td {
  font-size: 13px !important;
}
.item-name {
  font-size: 11px !important;
}
.gauge-scale, .tc-price-note {
  font-size: 11px !important;
}

/* ── 入力中の項目を強調（迷子防止） ── */
.iw {
  border: 1.5px solid #cbd5e1 !important;
  transition: all 0.2s ease;
}
.iw:focus-within {
  border-color: var(--gold) !important;
  background: #f8fafc !important;
  box-shadow: 0 0 0 4px rgba(227, 176, 74, 0.2) !important;
}

/* ── テーブル行ホバー（営業担当者のポインター代わり） ── */
.cat-item, .madori-table tr {
  transition: background-color 0.15s ease;
}
.cat-item:hover, .madori-table tr:hover:not([id*="btn"]) {
  background-color: rgba(227, 176, 74, 0.06) !important;
}

/* ── 返済負担率メーターの強化 ── */
#mini-pointer {
  width: 5px !important;
  height: 14px !important;
  box-shadow: 0 0 6px rgba(0,0,0,0.4) !important;
}
#mini-status {
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 6px 18px !important;
}

/* ── ストーリー進行特化：STEPバッジ ── */
.col {
  counter-reset: step-counter 2;   /* 中列以降: STEP 3, 4 */
}
.col:first-child {
  counter-reset: step-counter 0;   /* 左列: STEP 1, 2 */
}
.sim-bottom .sec {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 0;
  margin-top: 32px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--navy);
}
.sim-bottom .sec::before {
  counter-increment: step-counter;
  content: "STEP " counter(step-counter);
  position: static;
  flex-shrink: 0;
  background: transparent;
  color: #475569;
  border: 1.5px solid #94a3b8;
  font-family: 'Roboto', sans-serif;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.sim-bottom .sec:first-child {
  margin-top: 0;
}

/* ── 未入力プレースホルダーのトーン ── */
.iw input::placeholder {
  color: #cbd5e1 !important;
  font-weight: 400;
}

/* ── タブに矢印でステップ感を演出 ── */
#group-tabs {
  padding-left: 8px;
}
#group-tabs .tab {
  position: relative;
  margin-right: 18px;
}
#group-tabs .tab:not(:last-child)::after {
  content: "➔";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.25);
  font-size: 11px;
  pointer-events: none;
}

/* ── ロードマップ：大タブの現在地を強調 ── */
.tab {
  position: relative;
  opacity: 0.85;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab.active {
  opacity: 1;
  color: var(--navy) !important;
  background: transparent !important;
  box-shadow: inset 0 -3px 0 var(--gold);
}
/* サブタブのアクティブ強調 */
.subtab.active {
  color: var(--navy) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: inset 0 -2px 0 var(--gold);
}

/* ── 次ステップ誘導ボタン ── */
.next-step-trigger {
  display: flex;
  width: fit-content;
  min-width: 300px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 24px auto 8px;
  padding: 14px 20px 14px 18px;
  background: #fff;
  color: var(--navy);
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  letter-spacing: 0.03em;
  text-align: left;
}
.next-step-trigger:hover {
  background: rgba(var(--gold-rgb),0.07);
  border-color: var(--gold);
  border-left-color: var(--gold);
  box-shadow: 0 4px 16px rgba(var(--gold-rgb),0.18);
  transform: translateX(4px);
  color: var(--navy);
}
.next-step-trigger::after {
  content: "→";
  font-size: 16px;
  color: var(--gold);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.next-step-trigger:hover::after {
  transform: translateX(4px);
}

/* ═══════════════════════════════════════════════
   レスポンシブ対応（タブレット・小画面）
═══════════════════════════════════════════════ */

/* タブレット縦持ち・小型ノートPC（〜1100px） */
@media (max-width: 1100px) {
  /* 上部カード：2列→1列 */
  .sim-bar-zone-header {
    grid-template-columns: 1fr !important;
  }

  /* 下部3列→2列 */
  .sim-bottom {
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
  }

  /* ヘッダーボタン縮小 */
  .header button {
    font-size: 11px !important;
    padding: 6px 10px !important;
  }
  #customer-name, #company-name {
    width: 90px !important;
  }
}

/* タブレット・iPad縦持ち（〜860px） */
@media (max-width: 860px) {
  /* 下部3列→1列 */
  .sim-bottom {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 14px !important;
  }

  /* 上部入力欄 2列→1列 */
  .two {
    grid-template-columns: 1fr !important;
  }

  /* 家タブ・左右レイアウトを縦積みに */
  .ie-layout {
    grid-template-columns: 1fr !important;
  }
  .ie-right {
    border-left: none !important;
    border-top: 1px solid var(--border);
  }

  /* 土地タブ縦積みに */
  #tab-tochi > div > div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* 間取りテーブル横並びを縦積みに */
  .madori-cols-wrap {
    grid-template-columns: 1fr !important;
  }

  /* サブタブ折り返し */
  .subtabs {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  .subtab {
    font-size: 11px !important;
    padding: 5px 8px !important;
  }

  /* タブ文字縮小 */
  .tab {
    font-size: 12px !important;
    padding: 10px 12px !important;
  }

  /* ヘッダー高さ調整 */
  .header {
    padding: 10px 14px !important;
  }
  h1#header-title {
    font-size: 13px !important;
    white-space: nowrap !important;
  }
}

/* スマートフォン（〜600px） */
@media (max-width: 600px) {
  .sim-bottom { padding: 10px !important; }

  /* 借入シミュレーション下段を縦に */
  .sim-bottom > .col:last-child {
    grid-column: 1 / -1;
  }

  /* 金利シナリオボタン折り返し */
  .rate-btns { flex-wrap: wrap !important; }
  .rate-btn { font-size: 12px !important; padding: 4px 8px !important; }

  /* 補助金テーブル横スクロール */
  #tab-hojyokin table { min-width: 480px; }
  #tab-kojyo table    { min-width: 600px; }

  /* 次ステップボタンをフル幅に */
  .next-step-trigger {
    float: none !important;
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ── 諸費用 cat-item レスポンシブ ── */
.item-tax-disp {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 1200px) {
  .item-tax-disp { font-size: 10px !important; width: 88px !important; }
  .item-input     { width: 80px !important; }
}
@media (max-width: 940px) {
  .item-tax-disp { display: none !important; }
  .item-input     { width: 88px !important; }
}

/* ── ヘッダー右側 ── */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}
@media (max-width: 900px) {
  .header-right {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ── ヘッダー全体 wrap対応 ── */
@media (max-width: 900px) {
  .header {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 10px 16px !important;
  }
}

/* ── アカウント権限（Phase 1）──────────────────────────
   一般アカウント（body.role-member）: 会社マスターを変更するUIを隠す。
   案件内の調整（畳数入力・部屋追加・プリセット適用等）は全員可のまま */
body.role-member .plan-add-btn,
body.role-member .banner-plan-add,
body.role-member .plan-add-menu,
body.role-member .plan-btn-edit,
body.role-member .plan-btn-del,
body.role-member .rate-default-link,
body.role-member .preset-add-btn,
body.role-member .preset-custom-actions,
body.role-member button[onclick*="saveAreaRatio"],
body.role-member .cat-rename-btn { display: none !important; }
/* 太陽光・高性能住宅の会社初期値バー（管理者のみ・閲覧のみ契約は非表示・印刷は print-hide で除外・2026-10-06） */
.company-defaults-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed #cbd5e1; }
.company-defaults-note { flex-basis: 100%; font-size: 11px; color: #64748b; line-height: 1.5; }
body.role-member .company-defaults-bar,
body.lic-readonly .company-defaults-bar { display: none !important; }
/* 諸費用カテゴリの表示名変更ボタン（管理者のみ・印刷除外はprint-hideで） */
.cat-rename-btn { border:none; background:none; color:#94a3b8; font-size:11px; cursor:pointer; margin-left:6px; padding:0 2px; }
.cat-rename-btn:hover { color: var(--gold); }
/* ※ STEP4の「自分の初期値に保存」（saveRateYearsDefault）は個人設定のため全員に表示（2026-08-05 A案） */
/* 担当欄が固定の席（displayName設定済み・役割問わず）: プルダウンの矢印を消して
   ラベルとして見せる（disabled時のブラウザ標準のグレーアウトも打ち消して読みやすく） */
body.rep-fixed #rep-name {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: default !important;
  opacity: 1;
  color: #1a2035;
}

/* 閲覧のみ契約（body.lic-readonly）: 保存系の入口を隠す（関数側でも二重ガード） */
body.lic-readonly button[onclick*="openSaveModal"],
body.lic-readonly button[onclick*="triggerImport"] { display: none !important; }

/* ===== ブロック2（旧 yosan.html 行 10687） ===== */

  #terms-modal { display:none; position:fixed; inset:0; background:rgba(16,21,42,.92); z-index:99998; align-items:center; justify-content:center; }
  #terms-modal .tm-card { background:#fff; border-radius:16px; width:760px; max-width:94vw; max-height:92vh; display:flex; flex-direction:column; box-shadow:0 16px 48px rgba(10,15,30,.45); }
  #terms-body { flex:1; overflow:auto; padding:16px 24px; font-size:12px; line-height:1.7; color:#1a2035; border-top:1px solid #e4e6ef; border-bottom:1px solid #e4e6ef; }
  #terms-body h2 { font-size:13px; margin:16px 0 6px; color:#22314f; }
  #terms-body ol { padding-left:1.7em; margin:4px 0; }
  #terms-body li { margin:3px 0; }
  #terms-body ol.alpha { list-style-type:katakana; }
  #terms-body .todo { background:#fff3a0; padding:0 3px; }
  #terms-accept-btn { background:#1a2035; color:#fff; border:none; border-radius:8px; padding:10px 20px; font-size:13px; font-weight:700; cursor:pointer; }
  #terms-accept-btn:disabled { background:#cbd5e1; cursor:not-allowed; }
  #terms-decline-btn, #terms-logout-btn { background:transparent; border:1px solid #cbd5e1; border-radius:8px; padding:10px 14px; font-size:12px; color:#475569; cursor:pointer; }

/* ===== ブロック3（旧 yosan.html 行 11330） ===== */

@media screen {
/* ① 値が更新された瞬間のポップ強調 */
@keyframes v0-pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.07); }
  100% { transform: scale(1); }
}
.v0-pop { animation: v0-pop .45s cubic-bezier(.34,1.56,.64,1); }

/* ② 返済負担率ポインターを大きく・見やすく */
#mini-pointer {
  width: 6px !important;
  height: 20px !important;
  border-radius: 3px !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 2px 6px rgba(26,32,53,.45) !important;
  transition: left .5s cubic-bezier(.34,1.2,.64,1) !important;
}
/* ポインター先に付く数値バブル */
.v0-ptr-bubble {
  position: absolute;
  top: -30px;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(26,32,53,.28);
  transition: left .5s cubic-bezier(.34,1.2,.64,1), opacity .3s;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}
.v0-ptr-bubble::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -4px;
  transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px;
  background: var(--navy);
}
.v0-ptr-bubble.show { opacity: 1; }

/* ④ 入力中セルを一段持ち上げて「今ここ」を明確化 */
.iw:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb),0.18), 0 6px 16px rgba(var(--gold-rgb),0.16) !important;
  transition: transform .15s ease, box-shadow .15s ease;
}

@media (prefers-reduced-motion: reduce) {
  .v0-pop { animation: none; }
  .pointer, #pointer, .v0-ptr-bubble { transition: none !important; }
}
} /* /@media screen（印刷には演出スタイルを適用しない） */
