/* 新しいデザイン「リキッド」(2026-10-17 ユーザー: リキッド(すりガラス)感がありつつ見やすく)。
   個人設定の「画面のデザイン」で「新しいデザイン」を選んだ端末だけ(Cookie design=liquid → <html class="theme-liquid">)。
   見本は docs/samples/liquid_design.html。決まったこと:
   - 背景: 斜めのグラデーション 青→空色→ミント(ミントは右下だけ)。動かさない
   - 窓(カード・左のメニュー): 白いすりガラス。透け20%(2026-10-18 に35%から下げ、背景も薄くした)・ぼかし軽め・ふちの線なし(影だけ)・角を大きく丸く
   - 左のメニュー: 明るいガラス。今いる画面(とそのまとまり)だけ紺。アイコンは色の線の枠(塗らない)
   - まとまりの窓(パソコン): 白いガラスで透け65%
   - 表の明細行: 1行ずつ白い板・すき間3px(字の下は透かさない)。入力欄も白
   - 印刷には効かない(@media screen の中だけ)。見やすさの決まり(本文の色・線の濃さ・入力欄の枠)はそのまま
   2026-10-21 ユーザー(Codex の見本 v10「質感でましたね」): 後ろは落ち着いたグレージュ、手前の窓に厚み(下の影)と見出しの左上の短い反射。
   表・入力欄は白いまま。ここより下の「グレージュ」の所 */
@media screen {
  .theme-liquid {
    --liq-glass: rgba(255, 253, 248, 0.66);   /* グレージュの上で少し透ける白(2026-10-21。前は 0.8 の白) */
    --liq-glass-side: rgba(247, 244, 237, 0.88); /* 左のメニューは字が多いので白め */
    --liq-blur: 10px;
    --liq-radius: 8px; /* 2026-10-24 Codex v82: 角丸を抑える(18→8) */
    --liq-shadow: 0 22px 34px -19px rgba(56, 54, 48, 0.5), 0 5px 10px -5px rgba(58, 56, 50, 0.28), inset 0 -2px 3px rgba(94, 92, 84, 0.12);
    --liq-outline: #a5a29a;
    --band: rgba(255, 255, 255, 0.55);
  }
  .theme-liquid body {
    /* 2026-10-18 ユーザー: 背景を強調すると見づらい → 同じ色の流れのまま薄く(前は #b8d2f6 → #c1e0f4 → #c3e6f3 → #c4eadc) */
    /* 2026-10-21 ユーザー: グレージュ(Codex v10。少し明るめ)。前は 青→空色→ミント */
    background: #cdc8c0 linear-gradient(135deg, #c9c4bc 0%, #dad6cf 58%, #c8c4be 100%) fixed;
  }
  /* 2026-10-23 ユーザー: スマホ(iPhone の Safari)でホームの上が白く霞む。Safari は画面の上のふち(時計の所)を、ページの背景の
     「色」でぼかして重ねる。グラデーションだけで色が無いと白になるので、同じグレージュの色を下地に置く */
  html.theme-liquid { background-color: #cdc8c0; }

  /* ---- 窓(カード) ---- */
  .theme-liquid .card {
    background: var(--liq-glass);
    -webkit-backdrop-filter: blur(var(--liq-blur)) saturate(150%);
    backdrop-filter: blur(var(--liq-blur)) saturate(150%);
    border: 1px solid var(--liq-outline);
    border-radius: var(--liq-radius);
    box-shadow: var(--liq-shadow);
  }
  .theme-liquid .home-card__title { margin-top: 0; border-radius: 0; position: relative; isolation: isolate;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 253, 248, 0.45) 30%, rgba(229, 224, 214, 0.35) 72%, rgba(255, 255, 254, 0.6) 100%);
    box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.7), inset 0 -6px 9px -7px rgba(93, 90, 75, 0.45); }
  /* 見出しの左上の短い白い反射(全体を光らせない) */
  .theme-liquid .card > .home-card__title:first-child::before {
    content: ""; position: absolute; top: 3px; left: 3px; width: 105px; height: 30px; border-radius: 7px 0 0 0; z-index: -1; pointer-events: none;
    border-top: 2px solid rgba(255, 255, 255, 0.94); border-left: 2px solid rgba(255, 255, 255, 0.88);
    -webkit-mask: linear-gradient(130deg, #000 12%, transparent 78%); mask: linear-gradient(130deg, #000 12%, transparent 78%);
  }
  .theme-liquid .search-form { border-radius: 8px; }

  /* ---- ボタン(丸い形) ---- */
  .theme-liquid .btn { border-radius: var(--radius-control); } /* 2026-10-24 v82: 丸いボタンをやめる */
  /* 赤い枠のボタン(ログアウト・対象外にする・削除)は紺で塗らない(2026-10-18 ユーザー: スマホの個人設定のログアウトが紺の塗りになっていた) */
  .theme-liquid .btn:not(.btn--secondary):not(.btn--danger):not(.btn--danger-outline) {
    background: linear-gradient(180deg, #1d4d80, #113961);
    box-shadow: 0 4px 12px rgba(17, 57, 97, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }
  .theme-liquid .btn--secondary { background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 236, 228, 0.9)); box-shadow: 0 6px 10px -6px rgba(53, 53, 46, 0.45), inset 0 -2px 3px rgba(124, 120, 99, 0.1); }
  .theme-liquid .btn--danger-outline { background: transparent; } /* 赤い枠のボタンは背景なし(ノーマルと同じ。パソコンもスマホも) */
  .theme-liquid .btn--danger-outline:hover { background: #fbeceb; }

  /* ---- 入力欄は白(透かさない) ---- */
  .theme-liquid input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]),
  .theme-liquid select, .theme-liquid textarea { background-color: #fff; }

  /* ---- 表: 明細行を1行ずつの白い板に(すき間3px) ---- */
  .theme-liquid .table { background: transparent; border-collapse: separate; border-spacing: 0 3px; }
  .theme-liquid .table th { background: transparent; border-bottom: 0; padding-top: 6px; padding-bottom: 4px; }
  .theme-liquid .table td { background: #fff; border-bottom: 1px solid #dfe5ee; border-top: 1px solid #dfe5ee; }
  .theme-liquid .table td:first-child { border-left: 1px solid #dfe5ee; border-radius: 6px 0 0 6px; }
  .theme-liquid .table td:last-child { border-right: 1px solid #dfe5ee; border-radius: 0 6px 6px 0; }
  .theme-liquid .table td:only-child { border-radius: 6px; }
  /* 対象者(施行)の枠の中は、白い値の枠が白い地に溶けて見づらかった(2026-10-27 ユーザー) → 地を外の枠と同じ生成り色にして白い枠を浮かせる */
  .theme-liquid .funeral-case-panel { background: rgba(240, 236, 228, 0.7); }
  .theme-liquid .funeral-case-panel__summary { background: rgba(255, 255, 255, 0.55); border-radius: var(--radius) var(--radius) 0 0; }
  .theme-liquid .funeral-case-panel:not([open]) > .funeral-case-panel__summary { border-radius: var(--radius); }
  /* 項目名(th)の隣の値(td)は、左にも線と角丸(2026-10-27 ユーザー: 顧客・施行の詳細で白い枠の左に線が無く、背景にまぎれて見づらい) */
  .theme-liquid .table th + td { border-left: 1px solid #dfe5ee; border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
  .theme-liquid .table tr:hover td { background: #f6f9fd; }
  .theme-liquid .table tr[data-href]:hover td { background: #eaf2fc; }
  /* 下へ進めたときに上に残る見出し(sticky_thead_controller.js)は字が読めるように白っぽく */
  /* 2026-11-20 ユーザー(iPhone・請求書一覧): 少しでも透けると後ろの行の字が見えた → 透かさない */
  .theme-liquid .table-wrap.sticky-thead { background: #f4f1eb; border-radius: 0 0 8px 8px; }

  /* ---- 左のメニュー: 明るいガラス ---- */
  .theme-liquid .app-shell {
    --side-bg: rgba(247, 244, 237, 0.97); /* 上に止めたホームの行の下地(下の行が透けて重ならないように) */
    --side-ink: #222020;
    --side-line: transparent;
    --side-hover: rgba(255, 255, 255, 0.75);
  }
  /* ガラスは ::before に描く(.sidebar 自体に backdrop-filter を付けると、右に出すまとまりの窓(position: fixed)の位置がずれるため) */
  /* position は付けない(パソコンは sticky・スマホは横から出る fixed のまま。relative にするとスマホのメニューが切れた。2026-10-18) */
  .theme-liquid .app-shell .sidebar { background: transparent; color: var(--side-ink); isolation: isolate; }
  .theme-liquid .app-shell .sidebar::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 8px;
    background: var(--liq-glass-side);
    -webkit-backdrop-filter: blur(var(--liq-blur)) saturate(150%);
    backdrop-filter: blur(var(--liq-blur)) saturate(150%);
    box-shadow: var(--liq-shadow);
  }
  .theme-liquid .app-shell .sidebar__nav > .sidebar__top-link--home { background: transparent; }
  .theme-liquid .app-shell .sidebar__nav > .sidebar__top-link--home:hover { background: var(--side-hover); }
  .theme-liquid .app-shell .sidebar__nav a,
  .theme-liquid .app-shell .sidebar__top-link,
  .theme-liquid .app-shell .sidebar__group > summary { border-radius: 6px; font-weight: 600; }
  .theme-liquid .app-shell .sidebar__action { color: #113961; border-color: rgba(17, 57, 97, 0.25); background: rgba(255, 255, 255, 0.7); }
  .theme-liquid .app-shell .sidebar .font-scale__option { color: #113961; border-color: rgba(17, 57, 97, 0.25); background: rgba(255, 255, 255, 0.7); }
  .theme-liquid .app-shell .sidebar .font-scale__option.is-active { background: #113961; color: #fff; border-color: #113961; }
  .theme-liquid .app-shell .sidebar__close { background: rgba(255, 255, 255, 0.8); color: #113961; }

  /* 今いる画面(Home)と、今いる画面が入っているまとまり: スマホの下の帯と同じ「白に銀の縁」・アイコンを浮かせて下に影
     (2026-10-29 ユーザー: 下の帯とそろえる。前は紺) */
  .theme-liquid .app-shell .sidebar__top-link--current,
  .theme-liquid .app-shell .sidebar__group--current > summary {
    color: #113961 !important; font-weight: 750; border: 1.5px solid transparent !important;
    background: linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.86)) padding-box,
                linear-gradient(135deg, #fbfcfd 0%, #a4adb8 28%, #f2f4f7 50%, #8e98a4 74%, #e9edf1 100%) border-box !important;
    box-shadow: 0 2px 8px rgba(17, 27, 37, 0.16) !important;
  }
  .theme-liquid .app-shell .sidebar__top-link--current > .sidebar__icon,
  .theme-liquid .app-shell .sidebar__group--current > summary > .sidebar__icon { position: relative; transform: translateY(-2px); }
  .theme-liquid .app-shell .sidebar__top-link--current > .sidebar__icon::after,
  .theme-liquid .app-shell .sidebar__group--current > summary > .sidebar__icon::after {
    content: ""; position: absolute; left: 50%; bottom: -6px; width: 24px; height: 6px; transform: translateX(-50%); pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 70%);
  }

  /* アイコン: 色の四角に白い線 → 色の線の枠(中は塗らない)。黄色など明るい色は白の上で見えるよう濃く */
  .theme-liquid .icon-tile--dashboard { --tile: #2a8fc9; }
  .theme-liquid .icon-tile--customers { --tile: #3e9a59; }
  .theme-liquid .icon-tile--billing { --tile: #c99a0e; }
  .theme-liquid .icon-tile--consultation { --tile: #9a4fc0; }
  .theme-liquid .icon-tile--chart { --tile: #d04545; }
  .theme-liquid .icon-tile--admin_docs { --tile: #5530a3; }
  .theme-liquid .icon-tile--admin { --tile: #6a7686; }
  .theme-liquid .icon-tile--home { --tile: #e07a2e; }
  .theme-liquid .sidebar__top-link > .icon-tile,
  .theme-liquid .sidebar__group > summary > .icon-tile {
    background: rgba(255, 255, 255, 0.55); border: 1.8px solid var(--tile); color: var(--tile); stroke: var(--tile); border-radius: 9px;
  }
  .theme-liquid .sidebar__top-link > .icon-tile [stroke="#fff"],
  .theme-liquid .sidebar__group > summary > .icon-tile [stroke="#fff"] { stroke: var(--tile); }
}

/* パソコン: メニューを浮かせる・まとまりの窓は白いガラス(透け65%) */
@media screen and (min-width: 861px) {
  .theme-liquid .sidebar { top: 14px; height: calc(100vh - 28px); margin: 14px 0 14px 14px; }
  .theme-liquid .sidebar__toggle { left: 220px; }
  .theme-liquid .app-shell .sidebar__group[open] > summary { background: rgba(255, 255, 255, 0.9); box-shadow: 0 2px 8px rgba(17, 57, 97, 0.12); }
  .theme-liquid .app-shell .sidebar__group-body {
    background: rgba(255, 255, 255, 0.35);
    -webkit-backdrop-filter: blur(16px) saturate(170%);
    backdrop-filter: blur(16px) saturate(170%);
    border: 0; border-radius: 8px; padding: 10px;
    box-shadow: 0 18px 40px rgba(17, 40, 80, 0.22), 0 3px 8px rgba(17, 40, 80, 0.10);
  }
  .theme-liquid .app-shell .sidebar__group-body a { color: #222020; border-radius: 6px; font-weight: 600; }
  .theme-liquid .app-shell .sidebar__group-body a:hover { background: rgba(17, 57, 97, 0.08); }
  .theme-liquid .app-shell .sidebar__group-body a[aria-current="page"] { background: rgba(17, 57, 97, 0.12); }
  .theme-liquid .app-shell .sidebar__group-body .sidebar__sub > summary { color: #222020; opacity: 0.75; }
  .theme-liquid .app-shell .sidebar__group-body .sidebar__sub > summary:hover { background: rgba(17, 57, 97, 0.08); opacity: 1; }
  .theme-liquid .app-shell .sidebar__group-body .sidebar__sub-body { border-left-color: rgba(17, 57, 97, 0.18); }
}

/* スマホの下の帯(2026-10-18 ユーザー: ガラスのデザインに合わせる)。左のメニューと同じく色の線の枠(中は塗らない)。
   開いている画面も線のアイコンで、その色の枠を太く・中をうすくその色に */
@media screen and (max-width: 860px) {
  .theme-liquid .tab-bar { border-top-color: var(--liq-outline); }
  .theme-liquid .tab-bar__item { color: #3a3f44; }
  .theme-liquid .tab-bar__item > .icon-tile {
    background: rgba(255, 255, 255, 0.6); border: 1.8px solid var(--tile); color: var(--tile); stroke: var(--tile); border-radius: 10px;
  }
  .theme-liquid .tab-bar__item > .icon-tile [stroke="#fff"] { stroke: var(--tile); }
  /* 開いている画面: ほかと同じ線の枠のまま、その色(スケジュールは紫)で枠を太く・中をうすくその色に・名前もその色(2026-10-18 ユーザー) */
  .theme-liquid .tab-bar__item.is-active > .icon-tile {
    border-width: 2.4px; background: color-mix(in srgb, var(--tile) 16%, #fff); box-shadow: 0 4px 12px color-mix(in srgb, var(--tile) 35%, transparent);
  }
  .theme-liquid .tab-bar__item.is-active[class*="icon-tile--"] { color: #1f4962; font-weight: 750; } /* 2026-10-24 Codex v80: 文字は濃い青(前はアイコンの色) */
}

/* スマホ: メニューは引き出しなので白っぽく(後ろの画面が透けて読みにくくならないように)。
   ガラスは ::before でなくメニューそのものに塗る(引き出しは中でたてに動くので、::before だと下へ進めたところで切れていた。2026-10-18 ユーザーの写真) */
@media screen and (max-width: 860px) {
  .theme-liquid { --liq-glass-side: rgba(247, 244, 237, 0.98); }
  /* スマホのメールの箱はガラスにしない(backdrop-filter があると、中の固定の上の帯(.m-head)が箱を基準に置かれて両脇が11pxずれ、右が切れた。2026-10-25)。
     背景・枠・影も無し(application.css の html .app-shell .card.mail-page) */
  .theme-liquid .card.mail-page { background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .theme-liquid .mail-body { background: #fff; } /* 本文は白い紙に(2026-11-11 ユーザー) */
  .theme-liquid .app-shell .sidebar { background: var(--liq-glass-side); border-radius: 0 8px 8px 0; }
  .theme-liquid .app-shell .sidebar::before { content: none; }
  /* 顧客の画面の請求書で選ぶと下に浮く段(2026-10-29): ほかの窓と同じすりガラス */
  .theme-liquid .invoice-actions.is-floating { background: var(--liq-glass); -webkit-backdrop-filter: blur(var(--liq-blur)) saturate(160%); backdrop-filter: blur(var(--liq-blur)) saturate(160%);
    border-color: transparent; box-shadow: var(--liq-shadow); }
}
