/* ===== 基本色：サイト全体の配色を変える場合は、主にここを編集します ===== */
:root {
  color-scheme: light;
  --ink: #173633;
  --muted: #647b77;
  --teal: #0f5b55;
  --teal-2: #167b71;
  --mint: #dff4ed;
  --mint-soft: #f1faf7;
  --yellow: #f4bd4f;
  --paper: #ffffff;
  --line: #d8e5e1;
  --bg: #f4f8f7;
  --shadow: 0 18px 45px rgba(30, 67, 62, .11);
}

/* ===== 全体共通の表示設定 ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif; font-size: 16px; line-height: 1.65; }
button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }

/* ===== ページ上部のヘッダー ===== */
.site-header { background: var(--teal); color: white; }
.header-inner { max-width: 1180px; margin: auto; min-height: 68px; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: .03em; }
.back-link { color: white; text-decoration: none; font-size: .86rem; font-weight: 700; padding: 7px 11px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; }
.back-link:hover { background: rgba(255,255,255,.12); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--yellow); color: #3c310f; border-radius: 9px 9px 9px 3px; font-size: 19px; }

/* ===== 導入文と注意書き ===== */
.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 80px; }
.intro { display: grid; grid-template-columns: 1.1fr .9fr; gap: 70px; align-items: end; margin-bottom: 30px; }
.eyebrow { display: inline-flex; margin: 0 0 8px; color: var(--teal-2); font-size: .85rem; font-weight: 800; letter-spacing: .15em; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.25; letter-spacing: -.045em; }
h1 span { color: var(--teal-2); }
.intro-copy { color: #516c68; font-size: 1.04rem; margin: 0 0 8px; max-width: 42rem; }

.notice { display: flex; align-items: flex-start; gap: 13px; background: #fff9e9; border: 1px solid #eadcae; border-radius: 14px; padding: 14px 17px; margin-bottom: 22px; color: #5f552f; font-size: .91rem; }
.notice p { margin: 0; }
.notice-icon { flex: 0 0 23px; height: 23px; display: grid; place-items: center; background: var(--yellow); color: #44360d; border-radius: 50%; font-weight: 900; font-family: Georgia, serif; }

/* ===== 入力カード共通（住まい・要介護度・負担割合・サービス） ===== */
.mode-panel, .control-card, .services-section { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 7px 24px rgba(28, 70, 63, .055); }
.mode-panel { padding: 25px; margin-bottom: 20px; }
.section-heading { display: flex; align-items: flex-start; gap: 13px; }
.section-heading h2 { margin: 0; font-size: 1.17rem; line-height: 1.35; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: .88rem; }
.step { flex: 0 0 29px; height: 29px; display: grid; place-items: center; background: var(--teal); color: white; border-radius: 9px; font-weight: 800; font-size: .9rem; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 19px; }
.mode-button { border: 1px solid var(--line); background: #fbfdfc; border-radius: 15px; color: var(--ink); min-height: 82px; padding: 13px 18px; display: flex; align-items: center; gap: 15px; text-align: left; cursor: pointer; transition: .18s ease; }
.mode-button:hover { border-color: #91bdb5; transform: translateY(-1px); }
.mode-button.active { background: var(--mint); border: 2px solid var(--teal-2); padding: 12px 17px; box-shadow: inset 0 0 0 2px white; }
.mode-button strong, .mode-button small { display: block; }
.mode-button strong { font-size: 1.02rem; }
.mode-button small { color: var(--muted); margin-top: 2px; }
.mode-icon { width: 43px; height: 43px; border-radius: 12px; display: grid; place-items: center; background: white; color: var(--teal); font-size: 1.6rem; font-weight: 900; box-shadow: 0 4px 13px rgba(15,91,85,.11); }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.controls-column { display: grid; gap: 20px; }
.control-card { padding: 24px 25px; }
.compact { align-items: center; }
.level-options { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-top: 18px; }
.level-options button { min-height: 56px; border: 1px solid var(--line); background: white; color: #425e59; border-radius: 11px; padding: 7px 4px; cursor: pointer; font-weight: 700; line-height: 1.25; font-size: .9rem; }
.level-options button:hover { border-color: #75aaa1; }
.level-options button.active { border-color: var(--teal); color: white; background: var(--teal); box-shadow: 0 7px 15px rgba(15,91,85,.2); }
.burden-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 18px; }
.burden-options label { position: relative; cursor: pointer; }
.burden-options input { position: absolute; opacity: 0; }
.burden-options span { min-height: 62px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 7px; background: white; }
.burden-options strong { font-size: 1.17rem; }
.burden-options small { color: var(--muted); font-size: .74rem; }
.burden-options input:checked + span { border: 2px solid var(--teal); background: var(--mint); color: var(--teal); }
.burden-options input:focus-visible + span { outline: 3px solid #f3c559; outline-offset: 2px; }

/* ===== サービス一覧と利用回数入力 ===== */
.services-section { padding: 25px; }
.services-title { margin-bottom: 20px; }
.service-group { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.service-group:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.group-title { margin: 0 0 10px; color: var(--teal); font-size: .84rem; font-weight: 800; letter-spacing: .06em; }
.service-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; border: 1px solid #e0ebe8; border-radius: 14px; padding: 14px 15px; margin-top: 9px; background: white; transition: .15s ease; }
.service-item.selected { border-color: #71aca2; background: var(--mint-soft); }
.service-item.daycare-service { grid-template-columns: 1fr; }
.service-main-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.service-check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; min-width: 0; }
.service-check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--teal); flex: 0 0 auto; }
.service-name { display: block; font-weight: 750; line-height: 1.45; }
.service-price { display: block; margin-top: 3px; color: var(--muted); font-size: .84rem; }
.count-input { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.count-input input { width: 68px; padding: 8px 7px; border: 1px solid #acc7c2; border-radius: 9px; text-align: right; background: white; }
.count-input input:disabled { opacity: .42; background: #edf2f1; }
.count-input span { color: var(--muted); font-size: .86rem; }
/* ===== 通所介護・短期入所の詳細入力と加算欄 ===== */
.daycare-options { margin-top: 2px; padding: 14px; border-top: 1px solid #cee2dd; display: grid; gap: 14px; }
.daycare-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-label { display: grid; gap: 5px; color: #45625d; font-size: .8rem; font-weight: 700; }
.field-control { display: flex; align-items: center; gap: 7px; }
.field-control input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #9fbfba; border-radius: 9px; text-align: right; background: white; }
.field-control select { width: 100%; min-width: 0; padding: 9px 30px 9px 10px; border: 1px solid #9fbfba; border-radius: 9px; background: white; color: var(--ink); }
.field-control span { flex: 0 0 auto; color: var(--muted); font-size: .82rem; }
.shortstay-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.addon-heading { margin: 0 0 6px; color: var(--teal); font-size: .78rem; font-weight: 800; }
.addon-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.addon-option { display: flex; align-items: flex-start; gap: 8px; color: #36534e; font-size: .78rem; line-height: 1.45; cursor: pointer; }
.addon-option input { flex: 0 0 auto; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--teal); }
.addon-option small { display: block; color: var(--muted); }
.addon-note { margin: 2px 0 0; color: var(--muted); font-size: .74rem; }
.optional-addons { border-top: 1px dashed #bfd6d1; padding-top: 10px; }
.optional-addons summary { cursor: pointer; color: var(--teal); font-size: .8rem; font-weight: 800; }
.optional-addons[open] summary { margin-bottom: 9px; }
.optional-addons p { margin: 8px 0 0; color: var(--muted); font-size: .74rem; }
.facility-item { grid-template-columns: 1fr; }
.empty-message { padding: 30px; text-align: center; color: var(--muted); background: #f8fbfa; border: 1px dashed #b9ceca; border-radius: 14px; }

/* ===== 右側の試算結果カード ===== */
.result-card { position: sticky; top: 20px; color: white; background: var(--teal); border-radius: 22px; box-shadow: var(--shadow); padding: 24px; overflow: hidden; }
.result-card::after { content: ""; position: absolute; width: 170px; height: 170px; border-radius: 50%; background: rgba(255,255,255,.055); right: -65px; top: 42px; pointer-events: none; }
.result-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #bde5de; font-size: .78rem; font-weight: 800; letter-spacing: .07em; }
.result-topline button { border: 0; color: white; background: rgba(255,255,255,.12); border-radius: 8px; padding: 5px 9px; cursor: pointer; font-size: .75rem; }
.result-card h2 { font-size: .96rem; margin: 24px 0 1px; font-weight: 600; color: #e8f7f4; }
.total { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 7px; padding: 3px 0 15px; border-bottom: 1px solid rgba(255,255,255,.2); }
.total strong { font-size: 3.2rem; line-height: 1.15; letter-spacing: -.045em; }
.total span { font-size: 1.05rem; }
.total-details { display: grid; gap: 7px; margin: 13px 0 21px; color: #c8e7e2; font-size: .8rem; }
.total-details div { display: flex; justify-content: space-between; gap: 12px; }
.total-details strong { color: white; }
.summary-lines { display: grid; gap: 1px; overflow: hidden; border-radius: 11px; background: rgba(255,255,255,.09); }
.summary-lines div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 12px; background: rgba(0,0,0,.075); font-size: .84rem; }
.summary-lines span { color: #bde0db; }
.result-note { margin: 17px 0 0; color: #c5dfdb; font-size: .76rem; line-height: 1.65; }

/* ===== 試算方法の説明とフッター ===== */
.method-note { margin-top: 21px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.method-note summary { padding: 15px 18px; cursor: pointer; font-weight: 700; }
.method-note div { padding: 0 18px 15px; color: var(--muted); font-size: .86rem; }
.method-note p { margin: 0; }
footer { text-align: center; color: #758783; border-top: 1px solid var(--line); padding: 23px; font-size: .8rem; }
footer p { margin: 0; }

/* ===== キーボード操作時の選択表示 ===== */
:focus-visible { outline: 3px solid #efbb43; outline-offset: 3px; }

/* ===== 画面幅920px以下：タブレット向け調整 ===== */
@media (max-width: 920px) {
  .intro { grid-template-columns: 1fr; gap: 18px; }
  .workspace { grid-template-columns: 1fr; }
  .result-card { position: relative; top: 0; grid-row: 1; }
  .level-options { grid-template-columns: repeat(4, 1fr); }
}
/* ===== 画面幅620px以下：スマートフォン向け調整 ===== */
@media (max-width: 620px) {
  .header-inner { min-height: 60px; padding: 10px 16px; flex-wrap: wrap; }
  .back-link { font-size: .76rem; }
  .page-shell { width: min(100% - 24px, 1180px); padding: 34px 0 56px; }
  .intro { margin-bottom: 23px; }
  h1 { font-size: 2.25rem; }
  .mode-panel, .control-card, .services-section { padding: 19px 16px; border-radius: 17px; }
  .mode-switch { grid-template-columns: 1fr; }
  .level-options { grid-template-columns: repeat(3, 1fr); }
  .burden-options { grid-template-columns: repeat(3, 1fr); }
  .burden-options small { display: none; }
  .service-item { grid-template-columns: 1fr; gap: 10px; }
  .service-main-row, .daycare-inputs, .shortstay-inputs, .addon-list { grid-template-columns: 1fr; }
  .daycare-options { padding: 13px 8px 4px 32px; }
  .count-input { padding-left: 32px; }
  .count-input input { width: 82px; }
  .result-card { padding: 21px 19px; border-radius: 18px; }
  .total strong { font-size: 2.75rem; }
}

