/* Kaname「お金の見張り番」専用スタイル（.kt-watch-* スコープ／Lever2）。
   - kaname.css / kaname_pop.css の --kt-* トークンを再利用（両ファイルは編集しない）。
   - 390px ポップ前提。横スクロール禁止（要素は親幅内に収める）。
   - 規約: 新規の全幅パーセント・リテラルは書かない（幅は flex / inset / clamp 等で表現）。
     ※ 棒グラフの height は テンプレ側で算出した比率を inline style で付与する。 */

.kt-watch { padding-bottom: 24px; }

/* ── ヒーロー ──────────────────────────────────────────── */
.kt-watch-hero { text-align: center; margin: 14px 0 18px; }
.kt-watch-crest {
  display: inline-block; margin: 0 0 8px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  color: var(--kt-accent-d, #1b52cc);
  background: var(--kt-accent-bg, #e7efff);
  border: 1px solid rgba(43, 108, 246, .22);
}
.kt-watch-title { margin: 4px 0 10px; line-height: 1.12; }
.kt-watch-lead {
  margin: 0 auto; max-width: 34em;
  color: var(--kt-ink-soft, #5b6478);
  font-size: 14.5px; line-height: 1.75;
}
.kt-watch-disclaimer {
  margin: 12px auto 0; max-width: 34em;
  padding: 10px 14px; border-radius: 14px;
  font-size: 11.5px; line-height: 1.7; text-align: left;
  color: #7a5a12;
  background: #fff7e8; border: 1px solid rgba(245, 166, 35, .32);
}
.kt-watch-disclaimer strong { color: #835a06; }

/* ── 共通アイブロウ ───────────────────────────────────── */
.kt-watch-eyebrow {
  margin: 0 0 8px;
  font-size: 13px; font-weight: 800; letter-spacing: .02em;
  color: var(--kt-kicker, #A64B35);
}
.kt-watch-eyebrow--center { text-align: center; }

/* ── 家計未入力 / 項目なし のカード（既存 .kt-card を踏襲） ── */
.kt-watch-empty,
.kt-watch-noitems,
.kt-watch-snap { margin: 16px 0 0; }

/* ── メインの数字：見つかるお金（目安） ──────────────────── */
.kt-watch-found {
  margin: 18px 0 0;
  padding: 18px 16px 16px;
  border-radius: 22px; text-align: center;
  background: linear-gradient(135deg, #ffffff, #f1f7ff);
  border: 1px solid rgba(43, 108, 246, .16);
  box-shadow: var(--kt-shadow, 0 6px 22px rgba(43, 108, 246, .10));
}
.kt-watch-found-amount {
  margin: 6px 0 4px; line-height: 1.02;
  color: var(--kt-ink, #1e2433); font-weight: 800;
}
.kt-watch-found-unit {
  font-size: 16px; font-weight: 800;
  color: var(--kt-ink-soft, #5b6478); margin-right: 4px;
}
.kt-watch-found-yen {
  font-size: 24px; font-weight: 800;
  color: var(--kt-accent, #2b6cf6); vertical-align: 0.06em;
}
.kt-watch-found-num {
  font-size: clamp(34px, 12vw, 52px);
  color: var(--kt-accent, #2b6cf6);
  letter-spacing: -.01em;
}
.kt-watch-found-tilde {
  font-size: .56em; font-weight: 700;
  color: var(--kt-ink-soft, #5b6478);
  margin: 0 .12em; vertical-align: .14em;
}
.kt-watch-found-period {
  margin: 2px 0 0;
  font-size: 12px; color: var(--kt-ink-soft, #5b6478); line-height: 1.6;
}
.kt-watch-found-multiple {
  margin: 12px auto 0; max-width: 30em;
  padding: 10px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.7; color: var(--kt-ink, #1e2433);
  background: #fff; border: 1px dashed rgba(43, 108, 246, .3);
}
.kt-watch-found-multiple b { color: var(--kt-accent-d, #1b52cc); font-weight: 800; }
.kt-watch-found-multiple-tag {
  display: inline-block; margin-right: 6px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 800;
  color: #fff; background: var(--kt-accent, #2b6cf6);
}

/* ── 取り戻したお金の累計（誇らしく・目安／保証しない） ──── */
.kt-watch-cum { margin: 18px 0 0; }
.kt-watch-cum-card {
  position: relative; overflow: hidden;
  padding: 18px 16px 16px; border-radius: 22px; text-align: center;
  background: linear-gradient(135deg, #fff8ec, #fffdf7);
  border: 1px solid rgba(213, 158, 58, .34);
  box-shadow: 0 8px 26px rgba(213, 158, 58, .14);
}
.kt-watch-cum-card::before {
  content: ""; position: absolute; inset: -40% -30% auto auto;
  width: 56vw; max-width: 220px; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(245, 196, 96, .22), transparent 70%);
  pointer-events: none;
}
.kt-watch-cum-eyebrow {
  position: relative; margin: 0 0 6px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .02em; color: #835a06;
}
.kt-watch-cum-amount {
  position: relative; margin: 4px 0 2px; line-height: 1.02; font-weight: 800;
}
.kt-watch-cum-yen {
  font-size: 22px; font-weight: 800; color: #b5790f; vertical-align: .08em; margin-right: 2px;
}
.kt-watch-cum-num {
  font-size: clamp(32px, 11.5vw, 50px); letter-spacing: -.01em; color: #b5790f;
}
.kt-watch-cum-sub {
  position: relative; margin: 4px auto 0; max-width: 30em;
  font-size: 12.5px; line-height: 1.65; color: #7a5a12;
}
.kt-watch-cum-mult {
  position: relative; margin: 12px auto 0; max-width: 30em;
  padding: 9px 13px; border-radius: 13px;
  font-size: 12.5px; line-height: 1.65; color: #6b4f12;
  background: rgba(255, 255, 255, .72); border: 1px dashed rgba(213, 158, 58, .42);
}
.kt-watch-cum-mult b { color: #9a6b10; font-weight: 800; }
.kt-watch-cum-mult-tag {
  display: inline-block; margin-right: 6px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 800; color: #fff; background: #9a6b10;
}
.kt-watch-cum-note { position: relative; margin: 10px 0 0; }

/* ── 項目別カード ─────────────────────────────────────── */
.kt-watch-items { margin: 16px 0 0; }
.kt-watch-items-lead {
  margin: 6px 0 0; font-size: 12.5px; line-height: 1.7;
  color: var(--kt-ink-soft, #5b6478);
}
.kt-watch-item-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.kt-watch-item {
  padding: 13px 15px; border-radius: 16px;
  background: var(--kt-card, #fff);
  border: 1px solid var(--kt-line, #e4e9f2);
  box-shadow: 0 2px 10px rgba(43, 108, 246, .05);
}
.kt-watch-item-head { display: flex; align-items: flex-start; gap: 10px; }
.kt-watch-item-rank {
  flex: 0 0 auto;
  width: 1.7em; height: 1.7em; line-height: 1.7em; text-align: center;
  border-radius: 50%; font-size: 13px; font-weight: 800;
  color: var(--kt-accent-d, #1b52cc);
  background: var(--kt-accent-bg, #e7efff);
  border: 1px solid rgba(43, 108, 246, .2);
}
.kt-watch-item-headtext { flex: 1 1 auto; min-width: 0; }
.kt-watch-item-conf {
  flex: 0 0 auto; align-self: flex-start;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 800; white-space: nowrap;
  color: #5b6478; background: #f0f3f8; border: 1px solid #e0e6f0;
}
.kt-watch-item-conf--high { color: #1f7a3d; background: #eafaf0; border-color: rgba(31, 122, 61, .26); }
.kt-watch-item-conf--mid { color: #1b52cc; background: #e7efff; border-color: rgba(43, 108, 246, .26); }
.kt-watch-item-conf--low { color: #7a5a12; background: #fff7e8; border-color: rgba(213, 158, 58, .3); }
.kt-watch-item-label {
  margin: 0 0 2px; font-size: 14.5px; font-weight: 800;
  color: var(--kt-ink, #1e2433);
}
.kt-watch-item-amt {
  margin: 0; font-size: 18px; font-weight: 800;
  color: var(--kt-accent, #2b6cf6);
}
.kt-watch-item-yen { font-size: .78em; vertical-align: .05em; }
.kt-watch-item-tilde {
  font-size: .62em; font-weight: 700; margin: 0 .1em;
  color: var(--kt-ink-soft, #5b6478);
}
.kt-watch-item-per {
  font-size: 11.5px; font-weight: 600;
  color: var(--kt-ink-soft, #5b6478); margin-left: 4px;
}
.kt-watch-item-note {
  margin: 6px 0 0; font-size: 12.5px; line-height: 1.65;
  color: var(--kt-ink-soft, #5b6478);
}

/* 実行手順／次の一手（折りたたみ） */
.kt-watch-item-steps {
  margin: 10px 0 0; border-radius: 12px;
  background: #f7faff; border: 1px solid rgba(43, 108, 246, .14);
}
.kt-watch-item-steps[open] { background: #fbfdff; }
.kt-watch-item-steps-sum {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px; cursor: pointer; list-style: none;
  font-size: 12.5px; font-weight: 800; color: var(--kt-accent-d, #1b52cc);
  border-radius: 12px;
}
.kt-watch-item-steps-sum::-webkit-details-marker { display: none; }
/* 独自の開閉印は廃止（2026-07-14 折りたたみ共通作法＝base.htmlの「ひらく/とじる」チップへ
   全ページ一本化・1機能=1名称）。content上書きはhead_extra後読みで後勝ちするためここに残さない。 */
.kt-watch-item-steps-ic { font-size: 14px; line-height: 1; }
.kt-watch-item-steps-lead {
  margin: 0; padding: 0 14px 2px;
  font-size: 11.5px; line-height: 1.6; color: var(--kt-ink-soft, #5b6478);
}
.kt-watch-item-steplist {
  margin: 6px 0 0; padding: 0 14px 0 0; list-style: none;
  counter-reset: kt-step; display: grid; gap: 7px;
}
.kt-watch-item-step {
  position: relative; padding: 0 0 0 30px;
  font-size: 12.5px; line-height: 1.6; color: var(--kt-ink, #1e2433);
  counter-increment: kt-step;
}
.kt-watch-item-step::before {
  content: counter(kt-step);
  position: absolute; left: 8px; top: 0;
  width: 1.5em; height: 1.5em; line-height: 1.5em; text-align: center;
  border-radius: 50%; font-size: 10.5px; font-weight: 800;
  color: #fff; background: var(--kt-accent, #2b6cf6);
}
.kt-watch-item-steps-note {
  margin: 9px 0 0; padding: 0 14px 11px;
  font-size: 11px; line-height: 1.55; color: var(--kt-ink-soft, #7a8295);
}

.kt-watch-items-note,
.kt-watch-trend-note { margin: 10px 0 0; }

/* ── 月次スナップショットの推移（素のCSS棒グラフ） ──────── */
.kt-watch-trend { margin: 16px 0 0; }
.kt-watch-bars {
  display: flex; align-items: flex-end; gap: 8px;
  margin: 10px 0 0; padding: 14px 12px 10px;
  min-height: 168px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f7faff, #ffffff);
  border: 1px solid var(--kt-line, #e4e9f2);
  overflow-x: hidden;   /* 横はみ出し防止（列が増えても親内で詰める） */
}
.kt-watch-bar-col {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; gap: 5px;
  height: 132px;
}
.kt-watch-bar-val {
  font-size: 9.5px; font-weight: 700; line-height: 1.1;
  color: var(--kt-ink-soft, #5b6478);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  align-self: stretch; text-align: center;
}
.kt-watch-bar {
  display: block; width: clamp(14px, 8vw, 34px);
  min-height: 6px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #4f8bff, #2b6cf6);
  box-shadow: 0 2px 8px rgba(43, 108, 246, .22);
  transition: height .5s cubic-bezier(.22, 1, .36, 1);
}
.kt-watch-bar-col:last-child .kt-watch-bar {
  background: linear-gradient(180deg, #ffa06b, #ff7a59);
  box-shadow: 0 2px 8px rgba(255, 122, 89, .28);
}
.kt-watch-bar-ym {
  font-size: 10px; font-weight: 600;
  color: var(--kt-ink-soft, #5b6478);
  white-space: nowrap;
}

/* ── 今月分を記録する ─────────────────────────────────── */
.kt-watch-snap-btn { margin-top: 4px; }
.kt-watch-snap-msg {
  margin: 10px 0 0; padding: 9px 13px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.6; font-weight: 700;
}
.kt-watch-snap-msg.is-ok {
  color: #1f7a3d; background: #eafaf0; border: 1px solid rgba(31, 122, 61, .26);
}
.kt-watch-snap-msg.is-err {
  color: #9a3b2e; background: #fdeeeb; border: 1px solid rgba(154, 59, 46, .26);
}

/* ── 明細CSV取り込み（ブラウザ内解析・合計だけ送信） ──────── */
.kt-watch-csv { margin: 16px 0 0; }
.kt-watch-csv-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: linear-gradient(135deg, #f4f9f6, #ffffff);
  border: 1px solid rgba(31, 122, 61, .18);
}
.kt-watch-csv-ic { font-size: 26px; line-height: 1; flex: 0 0 auto; }
.kt-watch-csv-body { flex: 1 1 auto; min-width: 0; }
.kt-watch-csv-title {
  margin: 0 0 4px; font-size: 15.5px; font-weight: 800;
  color: var(--kt-ink, #1e2433);
}
.kt-watch-csv-lead {
  margin: 0 0 8px; font-size: 12.5px; line-height: 1.7;
  color: var(--kt-ink-soft, #5b6478);
}
.kt-watch-csv-privacy {
  margin: 0 0 12px; padding: 9px 12px; border-radius: 12px;
  font-size: 11.5px; line-height: 1.65; font-weight: 700;
  color: #1f7a3d; background: #eafaf0;
  border: 1px solid rgba(31, 122, 61, .22);
}
.kt-watch-csv-pick { display: inline-block; cursor: pointer; }
.kt-watch-csv-pick-btn { display: inline-block; }
.kt-watch-csv-pickname {
  margin: 8px 0 0; font-size: 12px; font-weight: 700;
  color: var(--kt-ink, #1e2433); overflow-wrap: anywhere;
}

/* 編集サマリ */
.kt-watch-csv-summary {
  margin: 14px 0 0; padding: 12px;
  border-radius: 14px;
  background: #fff; border: 1px solid var(--kt-line, #e4e9f2);
}
.kt-watch-csv-ym-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 8px;
}
.kt-watch-csv-ym-label {
  font-size: 12.5px; font-weight: 800; color: var(--kt-ink, #1e2433);
}
.kt-watch-csv-ym-input {
  flex: 1 1 auto; min-width: 0;
  padding: 7px 10px; border-radius: 10px;
  font-size: 13px; color: var(--kt-ink, #1e2433);
  border: 1px solid var(--kt-line, #e4e9f2); background: #fff;
}
.kt-watch-csv-summary-hint {
  margin: 0 0 10px; font-size: 11.5px; line-height: 1.6;
  color: var(--kt-ink-soft, #5b6478);
}
.kt-watch-csv-table { display: grid; gap: 7px; }
.kt-watch-csv-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 10px;
  background: #f7faff; border: 1px solid var(--kt-line, #e4e9f2);
}
.kt-watch-csv-row.is-income {
  background: #f0fbf4; border-color: rgba(31, 122, 61, .2);
}
.kt-watch-csv-row-label {
  flex: 1 1 auto; min-width: 0;
  font-size: 13px; font-weight: 700; color: var(--kt-ink, #1e2433);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kt-watch-csv-row-yen {
  flex: 0 0 auto; font-size: 13px; font-weight: 800;
  color: var(--kt-accent, #2b6cf6);
}
.kt-watch-csv-row-input {
  flex: 0 1 7.5em; min-width: 0; width: 7.5em;
  padding: 6px 8px; border-radius: 8px; text-align: right;
  font-size: 13.5px; font-weight: 700; color: var(--kt-ink, #1e2433);
  border: 1px solid var(--kt-line, #e4e9f2); background: #fff;
}
.kt-watch-csv-row-per {
  flex: 0 0 auto; font-size: 11px; font-weight: 600;
  color: var(--kt-ink-soft, #5b6478);
}
.kt-watch-csv-send { margin: 12px 0 0; }

/* メッセージ（成功/失敗） */
.kt-watch-csv-msg {
  margin: 12px 0 0; padding: 9px 13px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.6; font-weight: 700;
}
.kt-watch-csv-msg.is-ok {
  color: #1f7a3d; background: #eafaf0; border: 1px solid rgba(31, 122, 61, .26);
}
.kt-watch-csv-msg.is-err {
  color: #9a3b2e; background: #fdeeeb; border: 1px solid rgba(154, 59, 46, .26);
}
.kt-watch-csv-fallback { margin: 10px 0 0; }

/* ── free：合計ぼかし＋teaser ─────────────────────────── */
.kt-watch-free { margin: 18px 0 0; }
.kt-watch-free-card { text-align: center; position: relative; }
.kt-watch-lock { display: block; font-size: 26px; margin: 0 0 4px; }
.kt-watch-free-blur {
  margin: 6px 0 10px; line-height: 1.05; font-weight: 800;
  color: var(--kt-accent, #2b6cf6);
  filter: blur(7px); opacity: .55; user-select: none;
}
.kt-watch-free-blur-num { font-size: clamp(34px, 12vw, 52px); }
.kt-watch-free-peek {
  list-style: none; margin: 12px auto; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  max-width: 30em;
}
.kt-watch-free-peek li {
  padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
  color: var(--kt-ink, #1e2433);
  background: var(--kt-accent-bg, #e7efff);
  border: 1px solid rgba(43, 108, 246, .18);
}
.kt-watch-free-note { margin: 12px 0 0; }

/* ── 会員レポート：先月比／費目別3ヶ月推移／達成の一言（目安・非断定） ── */
.kt-watch-report { margin: 18px 0 0; }
.kt-watch-report .kt-watch-eyebrow { margin: 0 0 10px; }

/* ① 先月比（＋/−を色で） */
.kt-watch-delta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
  padding: 12px 14px; border-radius: 16px;
  background: var(--kt-card, #fff);
  border: 1px solid var(--kt-line, #e4e9f2);
  box-shadow: var(--kt-shadow, 0 6px 22px rgba(43, 108, 246, .10));
}
.kt-watch-delta-tag {
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 800; color: #fff;
  background: var(--kt-ink-soft, #5b6478);
}
.kt-watch-delta-val { font-size: clamp(20px, 6.5vw, 26px); font-weight: 800; }
.kt-watch-delta-cap {
  font-size: 12px; line-height: 1.6; color: var(--kt-ink-soft, #5b6478); flex: 1 1 12em;
}
.kt-watch-delta--up .kt-watch-delta-val { color: #1b7a3d; }
.kt-watch-delta--up .kt-watch-delta-tag { background: #1b7a3d; }
.kt-watch-delta--down .kt-watch-delta-val { color: #b5451c; }
.kt-watch-delta--down .kt-watch-delta-tag { background: #b5451c; }
.kt-watch-delta--flat .kt-watch-delta-val { color: var(--kt-ink-soft, #5b6478); }

/* ② 費目別3ヶ月推移（CSSバー・費目ごと） */
.kt-watch-catlist { margin: 14px 0 0; display: grid; gap: 10px; }
.kt-watch-catlist-lead {
  margin: 0 0 2px; font-size: 12px; line-height: 1.6; color: var(--kt-ink-soft, #5b6478);
}
.kt-watch-cat {
  padding: 10px 12px; border-radius: 14px;
  background: var(--kt-card, #fff);
  border: 1px solid var(--kt-line, #e4e9f2);
}
.kt-watch-cat-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.kt-watch-cat-label { font-size: 13px; font-weight: 800; color: var(--kt-ink, #1e2433); }
.kt-watch-cat-latest { font-size: 13px; font-weight: 800; color: var(--kt-accent-d, #1b52cc); }
.kt-watch-cat-per { font-size: 10.5px; font-weight: 600; color: var(--kt-ink-soft, #5b6478); margin-left: 3px; }
.kt-watch-cat-bars {
  display: flex; align-items: flex-end; gap: 6px;
  height: 40px; margin: 8px 0 4px;
}
.kt-watch-cat-bar {
  flex: 1 1 0; min-width: 0; border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #a9c4ff, #cdddff);
  transition: height .3s ease;
}
.kt-watch-cat-bar--now {
  background: linear-gradient(180deg, var(--kt-accent, #2b6cf6), #6f9bff);
}
.kt-watch-cat-delta { margin: 2px 0 0; font-size: 11px; color: var(--kt-ink-soft, #5b6478); }
.kt-watch-cat-delta.is-up { color: #1b7a3d; }
.kt-watch-cat-delta.is-down { color: #b5451c; }

/* ③ 達成の一言 */
.kt-watch-achieve {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 16px;
  background: var(--kt-accent-bg, #e7efff);
  border: 1px solid rgba(43, 108, 246, .16);
}
.kt-watch-achieve-ic { font-size: 18px; }
.kt-watch-achieve-text { margin: 4px 0 0; font-size: 13px; line-height: 1.75; color: var(--kt-ink, #1e2433); }
.kt-watch-achieve-cat { color: var(--kt-accent-d, #1b52cc); font-weight: 800; }
.kt-watch-achieve-amt { font-weight: 700; }
.kt-watch-achieve-annual { margin: 6px 0 0; font-size: 12px; line-height: 1.7; color: var(--kt-ink-soft, #5b6478); }
.kt-watch-achieve-note { margin: 8px 0 0; }

/* ── 横スクロール根絶の保険（長文・数字の折返し） ─────────── */
.kt-watch :where(p, span, b, li) { overflow-wrap: anywhere; word-break: normal; }

/* ── 動きを減らす設定への配慮 ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .kt-watch-bar, .kt-watch-cat-bar { transition: none; }
}
