/* =========================================================================
   emotion.css — 情緒の層（方向C「やわらかい手触り」・発注者の決定 2026-10-08）
   ------------------------------------------------------------------------
   タブレット（08_ の器の写し）と作ったアプリ（shell_hub の器の写し）の両方が、この1本を読む。
   ★10/8 決定（発注者）: カンプ C_*.png の見た目を忠実に（寸法はカンプ 1180×820／820×1180 の上で測った値）。
     色はどの会社も共通（C のパステルの配色1つ・motif.json の palette）。イラストは画像生成（assets/illust/<業種>.png）
   ・data-emo="C" が付いた所だけに効く。data-emo-brand は作ったアプリだけ（器の主色も C の色にする）
   ・トーン: warm＝人に向く業種（丸み・弾み・浮く点）／calm＝既定／firm＝硬い業種（丸みと弾みを控えめに）
   ・動きは transform と opacity だけ（blur を使わない・iPad で重くしない）。reduce-motion では全部 0
   ========================================================================= */

[data-emo="C"] {
  --emo-r: 16px;
  --emo-shadow: 0 1px 2px rgba(31, 41, 60, .04), 0 6px 18px rgba(31, 41, 60, .06);
  --emo-shadow-deep: 0 2px 6px rgba(46, 92, 138, .08), 0 14px 30px rgba(31, 41, 60, .10);
  --emo-spring: cubic-bezier(.34, 1.56, .64, 1);
}
[data-emo="C"][data-emo-tone="warm"] { --emo-r: 18px; }
[data-emo="C"][data-emo-tone="firm"] { --emo-r: 12px; }

/* 作ったアプリ: 器の主色・地を C の共通の配色に（器の :root:root より強く） */
:root:root[data-emo-brand] {
  --brand: var(--emo-brand); --brand-band: var(--emo-accent); --brand-strong: var(--emo-ink);
  --brand-soft: var(--emo-bar); --brand-tint: var(--emo-tint); --brand-fg: var(--emo-ink);
  --grad-pill: linear-gradient(135deg, var(--emo-accent), var(--emo-brand));
  --shadow-pill: 0 1px 4px rgba(46, 92, 138, .28); --shadow-dot: 0 2px 8px rgba(46, 92, 138, .32);
  --bg: var(--emo-bg);
}
[data-emo-brand] body { background: linear-gradient(180deg, #F4F7FA 0%, var(--emo-bg) 100%) fixed; }

/* ---------------- 作ったアプリ: 上の段（社名の頭文字の丸・区切り） ---------------- */
[data-emo-brand] .emo-co-mark {
  flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 12px; border-radius: 50%;
  background: var(--grad-pill); color: #fff; font-size: 15px; font-weight: 700;
}
[data-emo-brand] .top-brand { display: flex; align-items: center; }
[data-emo-brand] .top-brand__co { font-size: 18px; font-weight: 700; }
[data-emo-brand] .shell-crumb .here { padding-left: 16px; margin-left: 4px; border-left: 1px solid var(--border-strong); font-size: 17px; font-weight: 700; color: var(--ink); }

/* ---------------- 作ったアプリ: あいさつの帯（本文の最初の子・見出しの上） ---------------- */
[data-emo="C"] .emo-band {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 114px;
  margin-bottom: 18px; padding: 18px 0 18px 28px; border-radius: var(--emo-r);
  background: linear-gradient(100deg, var(--emo-pastel) 0%, var(--emo-tint) 72%, var(--emo-pastel) 100%);
  border: 1px solid var(--emo-line); box-shadow: 0 1px 2px rgba(46, 92, 138, .05); overflow: hidden;
}
[data-emo="C"] .emo-band__text { flex: 1 1 auto; min-width: 0; padding-right: 8px; }
[data-emo="C"] .emo-band__hello { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.45; color: #1F2633; letter-spacing: .01em; }
[data-emo="C"] .emo-band__line { margin: 8px 0 0; font-size: 14px; font-weight: 500; line-height: 1.6; color: #2F3747; }
[data-emo="C"] .emo-band__line b { color: var(--emo-ink); font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; }
[data-emo="C"] .emo-band__line.is-swap { animation: emo-fade 240ms ease-out both; }
[data-emo="C"] { --emo-ill: 72px; }
[data-emo="C"][data-emo-tone="warm"] { --emo-ill: 110px; }
[data-emo="C"][data-emo-tone="firm"] { --emo-ill: 64px; }
[data-emo="C"] .emo-band__art { flex: none; display: flex; align-items: center; justify-content: center; margin-right: 28px; }
[data-emo="C"] .emo-band__art:empty { display: none; }
[data-emo="C"] .emo-band__illust { display: block; width: var(--emo-ill); height: var(--emo-ill); object-fit: contain; }

/* ---------------- 作ったアプリ: カード・数字・グラフ ---------------- */
[data-emo="C"] #content .card, [data-emo="C"] #content .table-wrap { border-radius: var(--emo-r); }
[data-emo="C"] #content .card, [data-emo="C"] #content .table-wrap { border-color: transparent; box-shadow: var(--emo-shadow); background: var(--surface); }
[data-emo="C"] #content .card-title { font-size: 16px; font-weight: 700; color: #1F2633; }
[data-emo="C"] .kpi-row { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
[data-emo="C"] .kpi-row > .kpi {
  display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 16px; row-gap: 2px; align-items: center; justify-items: start;
  min-height: 88px; padding: 16px 18px; border: 0; border-radius: var(--emo-r); background: var(--surface);
  box-shadow: var(--emo-shadow); transition: transform .16s ease, box-shadow .2s ease; overflow: visible;
}
[data-emo="C"] .kpi-row > .kpi .emo-ic { grid-row: 1 / span 2; align-self: center; }
[data-emo="C"] .kpi-row > .kpi .k-label { align-self: end; font-size: 13px; font-weight: 500; line-height: 1.4; color: #2F3747; }
[data-emo="C"] .kpi-row > .kpi .k-val { align-self: start; font-size: min(34px, 15cqi); font-weight: 700; line-height: 1.15; color: #121722; white-space: nowrap; }
[data-emo="C"] .kpi-row > .kpi .k-val.is-money { font-size: min(26px, 10.5cqi); }
[data-emo="C"] .kpi-row > .kpi .k-val .unit { margin-left: 6px; font-size: 16px; font-weight: 700; color: #2F3747; }
[data-emo="C"] .kpi-row > .kpi.is-hero { background: linear-gradient(135deg, var(--emo-tint), var(--emo-pastel)); box-shadow: var(--emo-shadow-deep); }
[data-emo="C"] .kpi-row > .kpi.is-hero .emo-ic { background: var(--surface); }
[data-emo="C"] .kpi-row > .kpi:active { transform: scale(.98); }
[data-emo="C"] .kpi-row.emo-enter > .kpi { animation: emo-rise 220ms ease-out both; animation-delay: calc(var(--i, 0) * 50ms); }
[data-emo="C"] .kpi.is-bump { animation: emo-bump 260ms var(--emo-spring); box-shadow: var(--emo-shadow-deep); }
[data-emo="C"][data-emo-tone="warm"] .kpi.is-bump { animation-name: emo-bump-warm; }
[data-emo="C"][data-emo-tone="firm"] .kpi.is-bump { animation-name: emo-bump-firm; }
[data-emo="C"] .emo-ic {
  flex: none; display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--emo-icbg); color: var(--emo-accent);
}
[data-emo="C"] .emo-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* 片付けた: ピル「済」がぽん・点が3つ浮く（warm だけ） */
[data-emo="C"] .emo-done {
  position: absolute; top: -10px; right: 14px; padding: 2px 12px; border-radius: var(--r-pill);
  background: var(--emo-brand); color: #fff; font-size: 12px; font-weight: 700; pointer-events: none;
  transform: rotate(-8deg); animation: emo-pop-rot 320ms var(--emo-spring) both;
}
[data-emo="C"][data-emo-tone="firm"] .emo-done { transform: none; animation-name: emo-pop; }
.emo-dot { position: absolute; bottom: 30%; width: 9px; height: 9px; border-radius: 50%; background: var(--emo-bar, var(--brand-soft)); pointer-events: none; animation: emo-float 700ms ease-out both; }

[data-emo="C"] .chart--emo { display: block; width: 100%; height: auto; }
[data-emo="C"] .chart--emo .bar-r { fill: var(--emo-bar); }
[data-emo="C"] .chart--emo .bar-r.is-main { fill: var(--emo-accent); }
[data-emo="C"] .chart--emo .bar-zero { fill: var(--emo-bar); }
[data-emo="C"] .chart--emo .ax--grid { stroke: #D9E1EA; stroke-width: 1; stroke-dasharray: 3 5; }
[data-emo="C"] .chart--emo .ax--base { stroke: #B9C4D2; stroke-width: 1.5; }
[data-emo="C"] .chart--emo .lb { fill: #3A4252; font-size: 14px; }
[data-emo="C"] .chart--emo .lb--y { font-size: 15px; }
[data-emo="C"] .chart--emo .lb.is-main { fill: #1F2633; font-weight: 700; }
[data-emo="C"] .chart--emo .ln { fill: none; stroke: var(--emo-accent); stroke-width: 3; }
[data-emo="C"] .chart--emo .dot { fill: var(--emo-accent); }
[data-emo="C"] .chart--emo.emo-enter .bar-r { transform-box: fill-box; transform-origin: 50% 100%; animation: emo-grow 420ms var(--emo-spring) both; }

[data-emo="C"] #content .panel--brand {
  display: grid; grid-template-columns: 52px 1fr; column-gap: 18px; row-gap: 4px; align-items: start;
  padding: 20px 24px; border-radius: var(--emo-r); background: linear-gradient(100deg, var(--emo-pastel), var(--emo-tint)); border: 1px solid var(--emo-line);
}
[data-emo="C"] #content .panel--brand > .emo-ic { grid-row: 1 / span 2; align-self: center; background: var(--surface); }
[data-emo="C"] #content .panel--brand .label { margin: 0; color: #1F2633; font-size: 16px; font-weight: 700; }
[data-emo="C"] #content .panel--brand p:last-child { margin: 0; font-size: 14px; line-height: 1.75; color: #2F3747; }

/* ピル（作ったアプリの画面型の中だけ・硬い業種のボタンは器の角丸のまま） */
[data-emo-brand] #content .badge, [data-emo-brand] #content .btn { border-radius: var(--r-pill); }
[data-emo-brand][data-emo-tone="firm"] #content .btn { border-radius: var(--r-md); }
[data-emo-brand] #content .btn:active { transform: scale(.98); }

/* トースト（作ったアプリ）: ピル・パステル・下の中央（カンプ C_shidashi_moment） */
[data-emo-brand] .toast-wrap { right: auto; left: 50%; transform: translateX(-50%); align-items: center; }
[data-emo-brand] .toast {
  position: relative; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 13px 26px 13px 52px; border: 0; border-radius: var(--r-pill);
  background: var(--emo-tint); color: #1F2633; font-weight: 700; box-shadow: var(--emo-shadow-deep);
  animation: emo-toast-in 220ms ease-out both;
}
[data-emo-brand] .toast::before { content: ""; position: absolute; left: 16px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; background: var(--emo-brand); }
[data-emo-brand] .toast::after { content: ""; position: absolute; left: 26px; top: 50%; width: 6px; height: 11px; margin-top: -8px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
[data-emo-brand] .toast.warn::before { background: var(--warn); }
[data-emo-brand] .toast.warn::after { border: 0; width: 2.5px; height: 11px; margin-top: -8px; left: 28px; background: #fff; transform: none; }
/* タブレットのトースト: 器の白いカードのまま、左の線だけ C の色（カンプ C_tablet_tsukuru） */
[data-emo="C"]:not([data-emo-brand]) .toast.success, [data-emo="C"]:not([data-emo-brand]) .toast:not(.warn) { border-left-color: var(--emo-accent); }
[data-emo] body:has(.casebar) .toast-wrap { bottom: 112px; }

/* ---------------- タブレット: 見出し行の帯（C の共通のパステル・右にイラスト・「取り下げる」は帯の外） ---------------- */
[data-emo="C"] .case-head { align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: nowrap; }
[data-emo="C"] .case-head > div:first-child {
  position: relative; flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  min-height: 104px; padding: 16px 20px 16px 24px; border-radius: 18px; overflow: hidden;
  background: linear-gradient(100deg, var(--emo-pastel) 0%, var(--emo-tint) 75%, var(--emo-pastel) 100%); box-shadow: 0 2px 6px rgba(46, 92, 138, .07);
}
[data-emo="C"] .case-head h1 { grid-column: 1; margin: 0; font-size: 24px; font-weight: 700; color: #1F2633; }
[data-emo="C"] .case-head .meta { grid-column: 1; gap: 8px; margin-top: 10px; }
[data-emo="C"] .case-head .meta > * {
  display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 2px 11px; border-radius: var(--r-pill);
  background: var(--surface); color: #2F3747; font-size: 12px; font-weight: 500; box-shadow: 0 1px 2px rgba(31, 41, 60, .05);
}
[data-emo="C"] .case-head .meta > .badge { background: var(--surface); }
[data-emo="C"] .case-head .case-illust { grid-column: 2; grid-row: 1 / span 2; width: var(--emo-ill); height: var(--emo-ill); object-fit: contain; }
[data-emo="C"] .case-head #headActions { flex: none; }

/* ---------------- タブレット: 録音中（白いカードに C の色のピル・波紋・声で動く点） ---------------- */
[data-emo="C"] .recbar.is-rec {
  flex-wrap: nowrap; align-items: center; gap: 18px; min-height: 108px; padding: 22px 24px 22px 30px; border: 0; border-radius: 18px;
  background: var(--surface); box-shadow: var(--emo-shadow);
}
.rec-pill { position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 30px 0 26px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-weight: 700; }
[data-emo="C"] .rec-pill { background: linear-gradient(180deg, var(--emo-accent), var(--emo-brand)); box-shadow: 0 0 0 8px var(--emo-icbg), 0 0 0 16px var(--emo-tint), 0 6px 16px rgba(46, 92, 138, .25); }
.rec-pill .recdot { width: 16px; height: 16px; background: #fff; }
.rec-pill b { font-size: 21px; letter-spacing: .02em; }
.rec-pill .rec-time { color: #fff; font-size: 21px; font-weight: 700; }
[data-emo="C"] .rec-pill::before, [data-emo="C"] .rec-pill::after {
  content: ""; position: absolute; inset: -8px; border-radius: inherit; border: 2px solid var(--emo-bar);
  opacity: 0; animation: emo-ripple 1.6s ease-out infinite; pointer-events: none;
}
[data-emo="C"] .rec-pill::after { animation-delay: .8s; }
.rec-wave { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: space-between; height: 50px; margin-left: 14px; }
.rec-wave i { display: block; width: 5px; height: 5px; border-radius: 3px; background: var(--emo-accent, var(--danger)); opacity: .85; transform-origin: 50% 50%; transition: transform 90ms linear; }
.rec-wave i:nth-child(3n+2) { opacity: .6; }
.rec-wave i:last-child { width: 16px; height: 16px; border-radius: 50%; opacity: 1; box-shadow: 0 0 0 4px var(--emo-icbg); }
[data-emo="C"] .recbar #recStop {
  margin-left: auto; min-width: 96px; height: 48px; padding: 0 20px; border-radius: 12px;
  background: var(--surface); color: #1F2633; border: 1px solid #D5DCE6; box-shadow: 0 1px 3px rgba(31, 41, 60, .08); font-weight: 700;
}
[data-emo="C"] .recbar #recStop svg { display: none; }

/* ---------------- タブレット: 問いのチップ（白・枠・選んだらパステル。印は出さない） ---------------- */
[data-emo="C"] .choice { min-height: 48px; padding: 0 20px; border: 1px solid #CDD6E2; border-radius: 9px; background: var(--surface); color: #1F2633; font-size: 15px; font-weight: 700; }
[data-emo="C"] .choice svg { display: none; }
[data-emo="C"] .choice[aria-pressed="true"] { border-color: var(--emo-line); background: var(--emo-icbg); color: var(--emo-ink); }
[data-emo="C"] .choice.is-bump { animation: emo-chip 220ms var(--emo-spring); }
[data-emo="C"] .from-rec { border-radius: var(--r-pill); background: var(--emo-icbg); color: var(--emo-ink); }
[data-emo="C"] .qcard, [data-emo="C"] .make-card { border: 0; border-radius: 18px; box-shadow: var(--emo-shadow); }

/* ---------------- タブレット: 下の段（いまの手順は C のパステル） ---------------- */
[data-emo="C"] .casebar__tabs button.is-current { background: var(--emo-tint); border-color: var(--emo-line); }
[data-emo="C"] .casebar__tabs button.is-current .sn { color: var(--emo-brand); }

/* ---------------- タブレット: ③ 作る の待ち時間（進む段・イラスト・画面の影・一緒に決める1つ。スピナーは使わない） ---------------- */
.emo-making {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 18px 20px; align-items: center;
  margin-top: 16px; padding: 26px 26px 24px; border-radius: 18px;
  background: linear-gradient(160deg, var(--emo-tint) 0%, var(--emo-pastel) 100%); box-shadow: 0 2px 8px rgba(46, 92, 138, .08);
}
.emo-making__head { grid-column: 1 / -1; margin: 0 0 2px; font-size: 24px; font-weight: 700; color: var(--emo-ink); }
.emo-steps { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.emo-steps li {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 20px; border-radius: var(--r-pill);
  border: 1px solid #E3E8EF; background: var(--surface); color: #1F2633; font-weight: 700; font-size: 15px;
  transition: background-color .26s, color .26s, border-color .26s;
}
.emo-steps li .emo-mk { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid #2E3E55; display: grid; place-items: center; }
.emo-steps li.is-done { background: var(--emo-icbg); border-color: transparent; color: var(--emo-ink); }
.emo-steps li.is-done .emo-mk { background: var(--emo-ink); border-color: var(--emo-ink); }
.emo-steps li.is-done .emo-mk::after { content: ""; width: 5px; height: 9px; margin-top: -2px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.emo-steps li.is-now { background: linear-gradient(180deg, var(--emo-accent), var(--emo-brand)); border-color: transparent; color: #fff; box-shadow: 0 6px 14px rgba(46, 92, 138, .25); animation: emo-pop 260ms var(--emo-spring); }
.emo-steps li.is-now .emo-mk { background: #fff; border-color: #fff; }
.emo-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 200px; }
.emo-stage .making-illust { width: 160px; height: 160px; object-fit: contain; animation: emo-stack 520ms var(--emo-spring, ease-out) both; }
.rec-illust { flex: none; width: 80px; height: 80px; object-fit: contain; }
[data-emo="C"] .rec-pill { flex: none; }
[data-emo="C"] .emo-done-illust { position: absolute; top: -26px; right: 58px; width: 48px; height: 48px; pointer-events: none; animation: emo-pop-rot 320ms var(--emo-spring) both; }
.emo-empty { display: flex; justify-content: center; margin-bottom: 8px; }
.emo-empty-illust { width: 120px; height: 120px; object-fit: contain; }
.emo-talk { grid-column: 1 / -1; margin: 6px 0 0; font-size: 15px; font-weight: 500; color: #1F2633; }
@media (max-width: 900px) { .emo-making { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); } }

/* ---------------- 動き ---------------- */
@keyframes emo-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes emo-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes emo-band-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes emo-pop { 0% { transform: scale(.96); } 60% { transform: scale(1.015); } 100% { transform: scale(1); } }
@keyframes emo-pop-rot { 0% { opacity: 0; transform: scale(.6) rotate(-8deg); } 60% { opacity: 1; transform: scale(1.08) rotate(-2deg); } 100% { transform: scale(1) rotate(-8deg); } }
@keyframes emo-bump { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.02); } }
@keyframes emo-bump-warm { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.03); } }
@keyframes emo-bump-firm { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.01); } }
@keyframes emo-chip { 0% { transform: scale(.98); } 55% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes emo-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes emo-float { from { opacity: .9; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-34px) scale(.6); } }
@keyframes emo-ripple { 0% { opacity: .6; transform: scale(1); } 100% { opacity: 0; transform: scale(1.12, 1.4); } }
@keyframes emo-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes emo-stack { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: none; } }
[data-emo="C"] .emo-band.emo-enter { animation: emo-band-in 240ms ease-out both; }
[data-emo="C"] .emo-band.emo-hang { animation: emo-pop 320ms var(--emo-spring) both; }

@media (prefers-reduced-motion: reduce) {
  [data-emo] *, [data-emo] *::before, [data-emo] *::after, .emo-making * {
    animation-duration: 0ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0ms !important;
  }
  [data-emo="C"] .rec-pill::before, [data-emo="C"] .rec-pill::after { display: none; }
  .rec-wave i { transition: none; }
}
