/* 経営ダッシュボード（試作）
   配色の方針: 白ベース・濃紺・鮮やかな色はグラフの細い線や小さな印だけ */
:root {
  color-scheme: light;
  --page: #e9eef5;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --ink: #0f1522;
  --ink-2: #3a4353;
  --muted: #687182;
  --grid: #e6e9ef;
  --axis: #c2c9d4;
  --border: rgba(15, 21, 34, 0.09);
  --slab: #172a52;
  --slab-2: #22407a;

  /* グラフの色（役割で固定） */
  --c-in: #2a78d6;      /* 現金・入ったお金 */
  --c-out: #eb6834;     /* 出たお金・経費 */
  --c-equity: #1f3f8a;  /* 自己資金（濃い紺。現金の青と同じ仲間） */
  --c-down: #e34948;    /* 減った月 */
  --bgline: 23,42,82;   /* 背景の線（R,G,B） */

  /* 良い／悪いの文字色 */
  --good: #006300;
  --bad: #b42323;
  --good-bg: #e3f3e3;
  --bad-bg: #fbe6e6;
  --warn-bg: #fdf1d3;
  --warn: #7a5200;

  --radius: 14px;
  --font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Segoe UI", "Yu Gothic UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.app { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 22px 24px 40px; }

/* ---------- 上の帯 ---------- */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { display: block; font-size: 11px; letter-spacing: 0.18em; color: var(--muted); font-weight: 600; }
.brand-logo { display: block; height: 46px; width: auto; margin: 0 0 6px -2px; }
h1 { margin: 2px 0 0; font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: 0.01em; line-height: 1.2; }
.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dummy-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--warn-bg); color: var(--warn);
  border-radius: 999px; padding: 5px 12px 5px 6px; font-size: 12.5px; font-weight: 700;
}
.dummy-chip i {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--warn); color: #fff; font-style: normal; font-size: 12px; font-weight: 800;
}
.stepper {
  display: flex; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px;
}
.stepper button {
  width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  font-size: 22px; line-height: 1; cursor: pointer; font-family: inherit;
}
.stepper button:hover:not(:disabled) { background: var(--surface-2); }
.stepper button:disabled { color: var(--axis); cursor: default; }
.stepper .month { min-width: 124px; text-align: center; line-height: 1.15; padding: 0 4px; }
.stepper .month span { display: block; font-size: 11px; color: var(--muted); }
.stepper .month strong { font-size: 19px; font-weight: 800; }
:focus-visible { outline: 2px solid var(--c-in); outline-offset: 2px; }

/* ---------- タブ ---------- */
.tabs { display: flex; gap: 6px; margin: 18px 0 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; border: 1px solid transparent; background: transparent; color: var(--ink-2);
  font: inherit; font-weight: 700; font-size: 14.5px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: background 0.2s, color 0.2s;
}
.tab:hover { background: rgba(255, 255, 255, 0.7); }
.tab[aria-selected="true"] { background: linear-gradient(100deg, var(--slab), var(--slab-2)); color: #fff; }
.tab small { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(15, 21, 34, 0.08); color: var(--muted); }
.tab[aria-selected="true"] small { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ---------- 並べ方 ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; }
.c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px 16px; min-width: 0;
}
.card h2 { margin: 0; font-size: 16px; font-weight: 800; }

/* ---------- 拡大ボタンと拡大表示（会議で映すとき用） ---------- */
.card { position: relative; }
.card:not(.tile):not(.soon):not(.hero) > h2 { padding-right: 40px; }
.zoom-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}
.zoom-btn:hover { background: var(--slab); color: #fff; border-color: transparent; }
details.table-view { padding-right: 40px; }
.zoom-fit details.table-view { padding-right: 0; }
.zoom-fit .zoom-btn { display: none; }

html.zooming, html.zooming body { overflow: hidden; }
.zoom-layer { position: fixed; inset: 0; z-index: 40; background: var(--page); display: flex; flex-direction: column; }
.zoom-layer[hidden] { display: none; }
.zoom-bar {
  flex: none; display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.zoom-nav { display: flex; align-items: center; gap: 2px; }
.zoom-nav button {
  width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  font: inherit; font-size: 24px; line-height: 1; cursor: pointer;
}
.zoom-nav button:hover:not(:disabled) { background: var(--surface-2); }
.zoom-nav button:disabled { color: var(--axis); cursor: default; }
.z-month { min-width: 130px; text-align: center; font-size: 20px; font-weight: 800; }
.zoom-hint { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.z-pdf, .z-full, .z-close {
  font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; border-radius: 999px; padding: 8px 16px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
}
.z-close { background: var(--slab); color: #fff; border-color: transparent; }
.z-full[hidden] { display: none; }
.zoom-print-head, .print-only { display: none; }

/* PDF・印刷ボタン（画面の右上） */
.pdf-btn {
  font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; border-radius: 999px; padding: 9px 18px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); white-space: nowrap;
}
.pdf-btn:hover, .z-pdf:hover, .z-full:hover { background: var(--surface-2); color: var(--ink); }
.pdf-btn:disabled { opacity: 0.45; cursor: default; }
.pdf-btn + .pdf-btn { margin-left: -4px; } /* PDF と CSV は少し寄せて、ひと組に見せる */
.zoom-stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 16px; }
.zoom-fit { transform: scale(var(--k, 1)); transform-origin: 50% 50%; }
.zoom-fit.pop { animation: zoom-pop 0.18s ease-out; }
@keyframes zoom-pop { from { opacity: 0; transform: scale(calc(var(--k, 1) * 0.97)); } to { opacity: 1; transform: scale(var(--k, 1)); } }
.zoom-fit > .card { min-height: 0; width: 100%; }
/* スマホ: 大きくはせず、幅いっぱいで縦に流す */
.zoom-stage.narrow { display: block; overflow: auto; -webkit-overflow-scrolling: touch; }
.zoom-stage.narrow .zoom-fit { width: 100%; }
@media screen and (max-width: 760px) {
  .zoom-hint { display: none; }
  .zoom-bar { gap: 8px; padding: 8px 10px; }
  .z-month { min-width: 104px; font-size: 17px; }
  .z-close { margin-left: auto; }
  .z-pdf, .z-full, .z-close { padding: 7px 12px; }
}
.card .sub { margin: 2px 0 10px; font-size: 12.5px; color: var(--muted); }
.card .caption { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-2); }
.card .caption strong { color: var(--ink); }

/* 入場の動き */
.enter > .grid > * { animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.enter > .grid > *:nth-child(2) { animation-delay: 0.05s; }
.enter > .grid > *:nth-child(3) { animation-delay: 0.1s; }
.enter > .grid > *:nth-child(4) { animation-delay: 0.14s; }
.enter > .grid > *:nth-child(5) { animation-delay: 0.18s; }
.enter > .grid > *:nth-child(6) { animation-delay: 0.22s; }
.enter > .grid > *:nth-child(n+7) { animation-delay: 0.26s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 主役の数字 ---------- */
.hero {
  background: linear-gradient(115deg, var(--slab) 0%, var(--slab-2) 100%); color: #fff; border: 0;
  padding: 22px 24px 20px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; min-height: 300px;
}
.hero::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 0 0 46px rgba(255, 255, 255, 0.035), 0 0 0 92px rgba(255, 255, 255, 0.025);
  pointer-events: none;
}
.hero .eyebrow { color: rgba(255, 255, 255, 0.62); }
.hero .eyebrow.asof { letter-spacing: 0.06em; font-size: 12px; } /* いつ時点の数字か（英語の飾り文字はやめた） */
.hero h2 { font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, 0.92); margin-top: 2px; }
.hero-num { font-size: clamp(54px, 7.2vw, 92px); font-weight: 800; line-height: 1.02; letter-spacing: -0.02em; margin: 14px 0 8px; white-space: nowrap; }
.hero-num .unit { font-size: 0.3em; font-weight: 700; letter-spacing: 0; margin-left: 6px; color: rgba(255, 255, 255, 0.8); }
.hero-say { font-size: 14px; color: rgba(255, 255, 255, 0.88); margin: 10px 0 0; max-width: 34em; }
.hero-facts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.hero-facts div { font-size: 12px; color: rgba(255, 255, 255, 0.66); }
.hero-facts b { display: block; font-size: 19px; font-weight: 800; color: #fff; line-height: 1.3; }
.hero-facts b small { font-size: 12px; font-weight: 700; margin-left: 2px; color: rgba(255, 255, 255, 0.8); }

/* ---------- 増減の印 ---------- */
.delta { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 2px 10px 2px 8px; white-space: nowrap; }
.delta i { font-style: normal; font-size: 10px; }
.delta.good { background: var(--good-bg); color: var(--good); }
.delta.bad { background: var(--bad-bg); color: var(--bad); }
.delta.flat { background: var(--surface-2); color: var(--muted); }
.vs { font-size: 12px; color: var(--muted); margin-left: 6px; }
.hero .vs { color: rgba(255, 255, 255, 0.7); }

/* ---------- 数字のタイル ---------- */
.tile { display: flex; flex-direction: column; gap: 4px; }
.tile .label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.tile .value { font-size: 30px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; white-space: nowrap; }
.tile .value .unit { font-size: 13px; font-weight: 700; margin-left: 3px; color: var(--ink-2); letter-spacing: 0; }
.tile .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tile .note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.spark { flex: none; }

/* ---------- グラフ ---------- */
.chart { width: 100%; position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .grid-l { stroke: var(--grid); stroke-width: 1; }
.chart .axis-l { stroke: var(--axis); stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .tick.sel { fill: var(--ink); font-weight: 800; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ring { stroke: var(--surface); stroke-width: 2; }
.chart .selline { stroke: var(--axis); stroke-width: 1; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; pointer-events: none; }
.chart .hover-dot { pointer-events: none; }
.chart .endlabel { font-size: 11.5px; fill: var(--ink-2); font-weight: 700; }
.chart .endvalue { font-size: 12px; fill: var(--ink); font-weight: 800; }
.chart .vlabel { font-size: 12px; fill: var(--ink); font-weight: 800; }
.chart .ref { stroke: var(--axis); stroke-width: 1; }
.chart .reflabel { font-size: 11px; fill: var(--muted); }
.chart .fit { stroke: #9aa3b2; stroke-width: 1.5; fill: none; }
.chart .axis-title { font-size: 11px; fill: var(--muted); }
.chart .bar { transition: opacity 0.25s; }
.chart .hit { fill: transparent; cursor: pointer; }
.grow .bar { animation: growy 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; transform-box: fill-box; }
.grow .bar.pos { transform-origin: 50% 100%; }
.grow .bar.neg { transform-origin: 50% 0%; }
@keyframes growy { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin: 0 0 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.legend i.box { width: 10px; height: 10px; border-radius: 3px; }

/* 吹き出し */
.tip {
  position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: #fff;
  border-radius: 10px; padding: 9px 12px; font-size: 12.5px; line-height: 1.5; min-width: 150px;
  box-shadow: 0 8px 24px rgba(15, 21, 34, 0.22);
}
.tip-t { font-size: 11.5px; color: rgba(255, 255, 255, 0.7); margin-bottom: 3px; }
.tip-r { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tip-k { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.tip-r strong { font-weight: 800; font-size: 13.5px; }
.tip-n { color: rgba(255, 255, 255, 0.72); }

/* ---------- 横棒の一覧 ---------- */
.rows { display: grid; gap: 7px; margin-top: 4px; }
.r {
  display: grid; grid-template-columns: minmax(96px, 190px) minmax(40px, 1fr) 84px; align-items: center; gap: 12px;
  font-size: 13.5px;
}
.r.wide { grid-template-columns: minmax(96px, 190px) minmax(40px, 1fr) 84px 62px 92px; }
.r .name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r .track { height: 10px; }
.r .hbar { display: block; height: 10px; border-radius: 0 4px 4px 0; min-width: 2px; transform-origin: 0 50%; }
.grow .hbar { animation: growx 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* カードが画面に入るまでは、棒が伸びる動きを止めておく（入ったときに .inview が付いて動き出す。app.js の「画面に入ったときに動き出す」） */
.card:not(.inview) .bar, .card:not(.inview) .hbar { animation-play-state: paused !important; }
.hbar.in { background: var(--c-in); } .hbar.out { background: var(--c-out); }
.r .val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r .val small, .r .pct small { font-weight: 600; font-size: 11px; color: var(--muted); margin-left: 1px; }
.r .pct { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.r .chg { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r .chg.good { color: var(--good); } .r .chg.bad { color: var(--bad); } .r .chg.flat { color: var(--muted); }
.r.head { font-size: 11.5px; color: var(--muted); }
.r.head .val, .r.head .pct, .r.head .chg { font-weight: 600; color: var(--muted); }
.r.total { border-top: 1px solid var(--grid); padding-top: 9px; margin-top: 3px; font-weight: 800; }
.r.total .name { color: var(--ink); }
.r.sep { border-top: 1px solid var(--grid); padding-top: 9px; margin-top: 3px; }

/* ---------- 表 ---------- */
details.table-view { margin-top: 16px; }
details.table-view summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--ink-2); padding: 6px 2px; }
.scroll-x { overflow-x: auto; }
table.nums { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 640px; }
table.nums th, table.nums td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.nums th { font-size: 11.5px; color: var(--muted); font-weight: 600; }
table.nums th:first-child, table.nums td:first-child { text-align: left; }
table.nums tr.sel td { background: var(--surface-2); font-weight: 800; }
table.nums td.neg { color: var(--bad); }

/* ---------- FJのサイト（リンクの一覧） ---------- */
.sec-h { margin: 10px 0 -4px; font-size: 14px; font-weight: 800; color: var(--ink-2); letter-spacing: 0.02em; }
.site-lead .sub { margin-bottom: 0; }
.site { display: flex; flex-direction: column; }
.site-kind {
  align-self: flex-start; font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: var(--surface-2);
  border-radius: 999px; padding: 2px 10px; margin-bottom: 8px;
}
.site h2 { font-size: 17px; }
.site-note { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); }
.site-url { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); word-break: break-all; }
.site-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: auto; padding-top: 16px; }
.site-open {
  display: inline-block; text-decoration: none; font-size: 13.5px; font-weight: 700; color: #fff;
  background: var(--slab); border-radius: 999px; padding: 8px 18px;
}
.site-open:hover { background: var(--slab-2); }
.site-num { font-size: 12px; color: var(--muted); }
.site-num small { margin-left: 6px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 1px 8px; }
html.printing .site-open { display: none; } /* 紙にはボタンを出さない（URLの文字は出る） */

/* ---------- 準備中・データの状況 ---------- */
.soon h2 { font-size: 18px; }
.soon ul { margin: 8px 0 0; padding-left: 1.2em; }
.soon li { margin: 3px 0; }
.soon .need { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--grid); }
.soon .tag { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 10px; margin-bottom: 6px; }

.src { display: grid; gap: 0; }
.src-row { display: grid; grid-template-columns: 170px minmax(0, 1.2fr) 130px minmax(0, 1.6fr); gap: 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--grid); font-size: 13.5px; }
.src-row.head { font-size: 11.5px; color: var(--muted); padding: 4px 0 8px; }
.src-row b { font-weight: 800; }
.src-row .from, .src-row .memo { color: var(--ink-2); }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px 2px 5px; white-space: nowrap; }
.st i { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: #fff; font-style: normal; font-size: 10px; font-weight: 800; }
.st.ok { background: var(--good-bg); color: var(--good); } .st.ok i { background: var(--good); }
.st.wait { background: var(--warn-bg); color: var(--warn); } .st.wait i { background: var(--warn); }
.st.todo { background: var(--bad-bg); color: var(--bad); } .st.todo i { background: var(--bad); }

.foot { margin-top: 22px; font-size: 12.5px; color: var(--muted); }
.foot p { margin: 2px 0; }
.foot strong { color: var(--ink-2); }

/* ---------- 画面が狭いとき（印刷のときは使わない。ブラウザが紙の幅を狭い画面として扱うため「screen and」を付けている） ---------- */
@media screen and (max-width: 1020px) {
  .c5, .c7, .c8, .c4 { grid-column: span 12; }
  .c3, .c6 { grid-column: span 6; }
  .hero { min-height: 0; }
}
@media screen and (max-width: 640px) {
  .app { padding: 16px 16px 32px; }
  .brand-logo { height: 40px; }
  .grid { gap: 12px; }
  .card { padding: 16px 16px 14px; }
  .c6 { grid-column: span 12; }
  .tile .value { font-size: 25px; }
  .controls { width: 100%; justify-content: space-between; }
  /* スマホでは項目名を上の段に出して、途切れないようにする */
  .r { grid-template-columns: minmax(24px, 1fr) 84px; column-gap: 10px; row-gap: 1px; font-size: 13px; }
  .r.wide { grid-template-columns: minmax(24px, 1fr) 84px 44px; }
  .r .name { grid-column: 1 / -1; white-space: normal; }
  .r.wide .chg { display: none; }
  .r.head .name { display: none; }
  .rows { gap: 10px; }
  .src-row { grid-template-columns: 1fr; gap: 4px; }
  .src-row.head { display: none; }
  .foot .hint { display: none; }
}
@media screen and (max-width: 420px) {
  .c3 { grid-column: span 12; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 保存の前に確かめる小さな窓（CSV） ---------- */
.ask-layer {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(15, 21, 34, 0.45);
}
.ask-layer[hidden] { display: none; }
.ask-box {
  width: min(500px, 100%); background: var(--surface); border-radius: var(--radius); padding: 24px 24px 20px;
  box-shadow: 0 18px 50px rgba(15, 21, 34, 0.28); animation: ask-in 0.16s ease-out;
}
@keyframes ask-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ask-box h3 { margin: 0 0 10px; font-size: 18px; font-weight: 800; }
.ask-text { margin: 0; font-size: 14px; color: var(--ink-2); }
.ask-kinds { display: grid; gap: 8px; margin: 14px 0 4px; }
.ask-kinds[hidden] { display: none; }
.ask-kinds label {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.ask-kinds label:has(input:checked) { border-color: var(--c-in); background: #f1f6fd; }
.ask-kinds input { margin: 3px 0 0; accent-color: var(--c-in); flex: none; }
.ask-kinds b { display: block; font-size: 14px; font-weight: 800; }
.ask-kinds small { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.ask-file { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); word-break: break-all; }
.ask-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.ask-btns button {
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; border-radius: 999px; padding: 10px 20px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
}
.ask-btns .ask-no:hover { background: var(--surface-2); }
.ask-btns .ask-yes { background: var(--slab); color: #fff; border-color: transparent; }
html.printing .ask-layer { display: none !important; }
@media (prefers-reduced-motion: reduce) { .ask-box { animation: none; } }

/* ==========================================================
   PDF・印刷
   ・画面全体 ＝ A4の縦に1枚で全部入れる
   ・拡大したカード ＝ A4の横に1枚
   紙の向きと縮め方は app.js が印刷の直前に決める（html.printing はそのときだけ付く目印）。
   並びに関わる決まりは html.printing に書く（印刷の直前に高さを測って、1枚に収まる縮め方を決めるため）。
   ========================================================== */
html.printing .app { max-width: none; margin: 0 auto; padding: 0; } /* 幅は app.js が決める */
html.printing #bg, html.printing .tip, html.printing .zoom-btn, html.printing .pdf-btn, html.printing .foot,
html.printing .stepper button, html.printing .tab:not([aria-selected="true"]) { display: none !important; }
html.printing .print-only { display: inline; font-size: 12px; color: var(--ink-2); }
/* 上の帯は1行にまとめる（「仮の数字」の札と出力日はここに出る） */
html.printing .top { align-items: center; }
html.printing .brand { display: flex; align-items: center; gap: 16px; }
html.printing .brand-logo { height: 40px !important; margin: 0 !important; }
html.printing h1 { font-size: 24px !important; margin: 0 !important; }
html.printing .tabs { margin: 8px 0 10px; overflow: visible; }
html.printing .grid { gap: 12px; }
html.printing .card { border: 1px solid #c9d1dd !important; }
html.printing .hero { border: 0 !important; }
html.printing .hero-num { font-size: 84px; } /* 画面の幅で大きさが変わらないように固定 */
html.printing .card:has(> details.table-view:not([open])) { display: none; } /* 閉じている表は紙に出さない */
html.printing details.table-view { padding-right: 0; margin-top: 0; }
html.printing .enter > .grid > *, html.printing .grow .bar, html.printing .grow .hbar, html.printing .zoom-fit.pop { animation: none !important; }
/* 拡大したカードを出すとき */
html.printing .zoom-layer { inset: 0 auto auto 0; width: 1040px; height: 700px; }
html.printing .zoom-bar { display: none; }
html.printing .zoom-print-head {
  flex: none; display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 4px;
  border-bottom: 1px solid var(--axis); font-size: 13px; color: var(--ink-2);
}
html.printing .zoom-print-head img { height: 36px; width: auto; }
html.printing .zoom-print-head b { font-size: 17px; color: var(--ink); }
html.printing .zoom-print-head .zp-month { font-size: 17px; font-weight: 700; color: var(--ink); }
html.printing .zoom-print-head .zp-note { margin-left: auto; background: var(--warn-bg); color: var(--warn); font-weight: 700; padding: 3px 12px; border-radius: 999px; }
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body, html.zooming, html.zooming body { overflow: visible !important; background: #fff !important; }
  body { min-height: 0; }
  .app { zoom: var(--pz, 0.58); } /* 1枚に収まる縮め方（app.js が計算する） */
  .card { break-inside: avoid; }
  .chart svg { max-width: 100%; height: auto; }
  html.zooming .app { display: none !important; }
  .zoom-layer { position: absolute !important; background: #fff !important; }
}
