/* 家計簿 v0.5 ダッシュボード。見た目の正はモック v5-1（深い松葉 #24523a・生成りの地）。
   ほかの画面（明細・ふり返り・設定）は style.css のまま。ここは #dash の中だけに効く。 */

html:has(body.dash-on) { background: #d3d0c8; }
body.dash-on { background: #d3d0c8; padding-bottom: 0; }
body.dash-on .wrap, body.dash-on .tabbar, body.dash-on .actionbar { display: none !important; }
body:not(.dash-on) #dash { display: none; }

#dash {
  --pine: #24523a; --ink: #1d211c; --sub: #5e5a4f; --paper: #f3eee2; --card: #fffdf8; --line: #e2dccd;
  max-width: 430px; min-height: 100vh; margin: 0 auto; background: var(--paper); color: var(--ink);
  font: 500 15px/1.45 "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif; padding-bottom: calc(62px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
#dash *, #dash *::before, #dash *::after { box-sizing: border-box; margin: 0; }
#dash button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
#dash b, #dash .big, #dash .ct, #dash .ttl, #dash .vbig, #dash .vn { font-family: "Noto Serif JP", "Yu Mincho", serif; font-weight: 800; white-space: nowrap; }
#dash .num { font-variant-numeric: tabular-nums; }

/* 見出しの帯（緑） */
#dash .h { padding: 20px 22px 18px; background: var(--pine); color: #fffaf0; }
#dash .h .s { color: #d3e0d6; }
#dash .ttl { font-size: 17px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
#dash .corner { font: 500 13px "Noto Sans JP", sans-serif; color: #d3e0d6; padding: 6px 0 6px 12px; min-height: 36px; }
#dash .s { color: var(--sub); font-size: 13.5px; }
#dash .big { font-size: 68px; line-height: 1.12; }
#dash .big small { font-size: 21px; margin-left: 3px; }
#dash .big.word { font-size: 50px; }
#dash .after { margin-top: 10px; }
#dash .m { padding: 0 18px 18px; }
#dash .sub, #dash .t { display: flex; justify-content: space-between; align-items: baseline; white-space: nowrap; margin-top: 8px; gap: 8px; }
#dash .t > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#dash .sub b { font-size: 23px; }
#dash .t b { font-size: 21px; }

/* カード */
#dash .c { background: var(--card); border-radius: 8px; padding: 13px 16px; margin-top: 13px; }
#dash .ct { font-size: 17px; margin-bottom: 6px; }
#dash .bar { height: 11px; border-radius: 5px; background: #ddd5c3; margin-top: 6px; position: relative; }
#dash .bar i { display: block; height: 100%; border-radius: 5px; background: var(--pine); }
#dash .bar u { position: absolute; top: -4px; width: 2px; height: 19px; background: var(--ink); }
#dash .h .bar { background: #4b7260; margin-top: 14px; }
#dash .h .bar i { background: #fffaf0; }

/* 押すと開く行 */
#dash .w { display: block; width: 100%; padding-bottom: 10px; }
#dash .more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .18s ease-out; }
#dash .more > div { overflow: hidden; }
#dash .open + .more { grid-template-rows: 1fr; }
#dash .more table { margin: 2px 0 12px; }
#dash table { width: 100%; border-collapse: collapse; }
#dash td, #dash th { padding: 5px 0; text-align: right; border-top: 1px solid var(--line); font-weight: 500; }
#dash th { font-size: 12.5px; color: var(--sub); border: 0; text-align: left; }
#dash td:first-child { text-align: left; }
#dash em { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; font-style: normal; flex: none; }
#dash td b { font-size: 16.5px; }
#dash .lg { display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: 12.5px; color: var(--sub); }
#dash .lg em { margin-right: 5px; }

/* 棒グラフ */
#dash .g { display: flex; gap: 9px; align-items: flex-end; justify-content: center; position: relative; height: 150px; margin-top: 26px; }
#dash .g > button { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; text-align: center; font-size: 12.5px; min-width: 0; }
#dash .k { display: flex; flex-direction: column-reverse; gap: 1px; border-radius: 4px 4px 0 0; overflow: hidden; }
#dash .k i { min-height: 3px; }
#dash .k.n { background: #e6dfcf; }
#dash .g hr { position: absolute; left: 0; right: 0; border: 0; border-top: 2px dashed var(--ink); pointer-events: none; }
#dash .g span { background: var(--card); position: relative; z-index: 1; align-self: center; padding: 0 2px; line-height: 17px; white-space: nowrap; }
#dash .d { display: flex; gap: 9px; justify-content: center; }
#dash .d span { flex: 1; text-align: center; font-size: 13px; color: var(--sub); min-width: 0; }
#dash .d .on { color: var(--ink); font-family: "Noto Serif JP", serif; font-weight: 800; }
#dash .off .g, #dash .off .d { gap: 34px; }
#dash .off .g > button, #dash .off .d span { flex: 0 0 74px; }
#dash .yr .g, #dash .yr .d { gap: 4px; }
#dash .yr .g > button { font-size: 11px; }
#dash .yr .g span { padding: 0; }
#dash .yr .d .on { box-shadow: inset 0 -3px var(--ink); padding-bottom: 3px; }
#dash .un { position: absolute; left: 0; bottom: 6px; text-align: center; font-size: 12.5px; color: var(--sub); }

/* 押すと出る小窓 */
#dash .pop { position: relative; margin-top: 12px; background: var(--paper); border-radius: 8px; padding: 12px 16px 14px; animation: dpop .14s ease-out; }
@keyframes dpop { from { transform: scale(.94); opacity: 0; } }
#dash .pop .t b { font-size: 18px; }
#dash .pop .ct { margin: 0; padding-right: 40px; }
#dash .x { position: absolute; right: 2px; top: 0; width: 46px; height: 46px; font-size: 24px; text-align: center; }

/* 前へ・次へ */
#dash .nav { display: flex; align-items: center; margin: 0 -8px 4px; }
#dash .nav > button { width: 46px; height: 44px; font: 800 26px/1 "Noto Serif JP", serif; text-align: center; }
#dash .nav > button:disabled { opacity: .25; cursor: default; }
#dash .nav > .mid { flex: 1; font-size: 19px; text-align: center; white-space: nowrap; }
#dash .nav > .mid b { font-size: 19px; }

/* カレンダー */
#dash .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
#dash .cal small { font-size: 12px; color: var(--sub); }
#dash .cal button { height: 44px; border-radius: 6px; text-align: center; background: var(--paper); }
#dash .cal button:disabled { opacity: .35; cursor: default; }
#dash .cal .u { color: #fff; font-family: "Noto Serif JP", serif; font-weight: 800; font-size: 17px; }
#dash .cal .sel, #dash .cal .td { box-shadow: inset 0 0 0 2px var(--ink); }
#dash .cal .in { background: #cfdccb; }

/* 下のタブ */
#dash .tab { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; height: calc(62px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--card); border-top: 1px solid var(--line); z-index: 9; }
#dash .tab button { flex: 1; text-align: center; color: var(--sub); font-size: 15.5px; }
#dash .tab .on { color: #fff; background: var(--pine); font-family: "Noto Serif JP", serif; font-weight: 800; }

/* 期間の切り替え */
#dash .seg { display: flex; background: #eeeae0; border-radius: 6px; padding: 2px; flex: none; }
#dash .seg button { padding: 5px 10px; border-radius: 5px; font-size: 13px; color: var(--sub); min-height: 32px; }
#dash .seg .on { background: var(--pine); color: #fff; }

/* 目標の見出し（案 B） */
#dash .gl + .gl { border-top: 1px solid #3f6a54; margin-top: 12px; padding-top: 10px; }
#dash .vn { font-size: 17px; }
#dash .vs { font-size: 12px; color: #b9cdbf; }
#dash .vn .vs { font-family: "Noto Sans JP", sans-serif; font-weight: 500; }
#dash .vbig { font-size: 40px; line-height: 1.15; color: #fffaf0; }
#dash .vbig small { font-size: 18px; margin-left: 2px; }
#dash .vbig small.pre { margin: 0 6px 0 0; }
#dash .vline { display: flex; align-items: center; gap: 6px; font-size: 13.5px; margin-top: 4px; white-space: nowrap; flex-wrap: wrap; }
#dash .vline i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
#dash .vline b { font-family: "Noto Sans JP", sans-serif; font-weight: 500; }
#dash .kr { display: inline-block; font-size: 10.5px; line-height: 1; padding: 2px 4px; margin-left: 5px; border-radius: 3px; background: #e9d9a8; color: #5a4712; vertical-align: 2px; font-family: "Noto Sans JP", sans-serif; font-weight: 500; }

/* お金の流れ */
#dash svg .sx { font-size: 11px; fill: var(--sub); text-anchor: middle; }
#dash svg .sn { font-size: 11px; text-anchor: middle; font-weight: 500; }
#dash svg .sv { font: 800 14px "Noto Serif JP", serif; text-anchor: middle; }
#dash .ag { margin-top: 6px; }
#dash .ag .t { margin-top: 5px; }
#dash .ar { font-size: 13.5px; color: var(--sub); padding-left: 20px; margin-top: 2px !important; }
#dash .empty { color: var(--sub); font-size: 13.5px; padding: 8px 0 4px; }

/* 隅の入口 */
#dash .menu { position: fixed; inset: 0; z-index: 20; background: rgba(20, 24, 20, .35); display: flex; align-items: flex-start; justify-content: center; }
#dash .menu > div { margin-top: 56px; width: min(400px, calc(100% - 24px)); background: var(--card); border-radius: 8px; padding: 6px 0; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
#dash .menu button { display: block; width: 100%; padding: 12px 18px; font-size: 15.5px; min-height: 46px; }
#dash .menu button + button { border-top: 1px solid var(--line); }
#dash .loading { padding: 40px 22px; color: var(--sub); }
#dash .menu .imp { padding: 10px 18px 8px; border-top: 1px solid var(--line); font-size: 12.5px; }
#dash .menu .imp.warn { color: #a8533f; }
