@charset "UTF-8";
/* みちびき基幹システム v1.6 ── 画面のスタイル
   指示書のカラーパレット・余白・角丸・影の指定に従っています。
   数値を変えるときは UI再構築指示書_修正版.md の §3 §42 §43 §44 を確認してください。 */

:root{
  --green:#168A63;
  --green-hover:#117452;
  --green-bg:#EAF7F1;
  --green-bg2:#F3FAF7;
  --side:#0C2942;
  --bg:#F6F8FA;
  --card:#FFFFFF;
  --text:#17212B;
  --sub:#667085;
  --line:#E4E9EE;
  --warn:#F59E0B;
  --error:#DC4C4C;
  --ok:#16A36A;
  --shadow:0 1px 3px rgba(0,0,0,.04);
  --r:8px;
  --r-lg:10px;
  --side-w:220px;
  --head-h:64px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--text);
  font-family:"Noto Sans JP",system-ui,-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Meiryo",sans-serif;
  font-size:14px; line-height:1.65;
  -webkit-text-size-adjust:100%;
}
a{color:var(--green); text-decoration:none}
button{font-family:inherit}
img{max-width:100%}
.hide{display:none !important}

/* アイコンの既定サイズ。ここが無いとSVGが巨大化します */
svg{width:20px; height:20px; display:block; flex:0 0 auto}
.side-nav svg,.side-foot svg{width:18px; height:18px}
.head .av svg{width:18px; height:18px}
.head .usr>svg{width:16px; height:16px; color:var(--sub)}
.head .usr .nm,.head .usr .rl{white-space:nowrap}
.kpi .ic svg{width:19px; height:19px}
.qa .ic svg{width:24px; height:24px}
.drop .ic svg{width:34px; height:34px; margin:0 auto}
.m-head .ib svg{width:23px; height:23px}
.m-nav a svg{width:21px; height:21px}
.m-shot svg{width:38px; height:38px}
.login .brand .lg svg{width:26px; height:26px}
.btn svg{width:16px; height:16px}
.btn.sm svg{width:14px; height:14px}

/* ============================================ 部品 */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  height:38px; padding:0 16px; border-radius:var(--r);
  border:1px solid var(--line); background:#fff; color:var(--text);
  font-size:14px; cursor:pointer; white-space:nowrap;
}
.btn:hover{background:#F9FAFB}
.btn.primary{background:var(--green); border-color:var(--green); color:#fff}
.btn.primary:hover{background:var(--green-hover); border-color:var(--green-hover)}
.btn.ghost{background:#fff; border-color:var(--green); color:var(--green)}
.btn.ghost:hover{background:var(--green-bg2)}
.btn.danger{border-color:#F3C8C8; color:var(--error)}
.btn.danger:hover{background:#FDF3F3}
.btn.lg{height:48px; padding:0 22px; font-size:15px}
.btn.sm{height:30px; padding:0 10px; font-size:12.5px}
.btn.block{width:100%}
.btn:disabled{opacity:.5; cursor:not-allowed}

.card{background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow)}
.card>.card-h{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 18px; border-bottom:1px solid var(--line);
}
.card-h h2{margin:0; font-size:15px; font-weight:600}
.card-h .more{font-size:12.5px; color:var(--green)}
.card-b{padding:16px 18px}
.card-b.tight{padding:0}

.badge{
  display:inline-flex; align-items:center; height:22px; padding:0 8px;
  border-radius:4px; font-size:12px; font-weight:500; white-space:nowrap;
}
.b-mikakunin{background:#FEF3E2; color:#B4740A}
.b-kakunin  {background:var(--green-bg); color:#0F6E4E}
.b-ai-run   {background:#E8F1FD; color:#1F5FA8}
.b-ai-ng    {background:#FDECEC; color:#B03535}
.b-ai-ok    {background:#F1F3F5; color:#667085}
.b-gray     {background:#F1F3F5; color:#667085}
.b-scan     {background:#F1F3F5; color:#48566A}
.b-densi    {background:#EEF2FF; color:#4453A6}
.b-limit    {background:#FDECEC; color:#B03535}

label.f{display:block; margin-bottom:14px}
label.f>span{display:block; font-size:12.5px; color:var(--sub); margin-bottom:5px}
input[type=text],input[type=password],input[type=date],input[type=number],input[type=search],select,textarea{
  width:100%; height:40px; padding:0 11px; font-size:14px; font-family:inherit; color:var(--text);
  background:#fff; border:1px solid var(--line); border-radius:var(--r); outline:none;
}
textarea{height:auto; padding:9px 11px; line-height:1.6; resize:vertical}
input:focus,select:focus,textarea:focus{border-color:var(--green); box-shadow:0 0 0 3px rgba(22,138,99,.12)}
input.ng,select.ng{border-color:var(--warn); background:#FFFCF5}
input.ng:focus{box-shadow:0 0 0 3px rgba(245,158,11,.15)}
input:disabled,select:disabled{background:#F6F8FA; color:var(--sub)}
.hint{font-size:12px; color:var(--sub); margin-top:4px}

table.tbl{width:100%; border-collapse:collapse; font-size:13.5px}
table.tbl th{
  text-align:left; font-weight:500; font-size:12.5px; color:var(--sub);
  background:#FAFBFC; padding:9px 14px; border-bottom:1px solid var(--line); white-space:nowrap;
}
table.tbl td{padding:11px 14px; border-bottom:1px solid #EFF2F5; vertical-align:middle}
table.tbl tr:last-child td{border-bottom:none}
table.tbl tbody tr:hover{background:#FAFBFC}
table.tbl .num{text-align:right; font-variant-numeric:tabular-nums}
.tbl-wrap{overflow-x:auto}
.lnk{color:var(--green); cursor:pointer; font-weight:500}
.lnk:hover{text-decoration:underline}

.empty{padding:34px 16px; text-align:center; color:var(--sub); font-size:13.5px}
.sk{background:linear-gradient(90deg,#F1F3F5 25%,#E9ECEF 37%,#F1F3F5 63%);
    background-size:400% 100%; animation:sk 1.2s ease infinite; border-radius:6px; height:14px}
@keyframes sk{0%{background-position:100% 50%}100%{background-position:0 50%}}

.note{border-radius:var(--r); padding:12px 14px; font-size:13px; line-height:1.7}
.note.warn{background:#FFF9EC; border:1px solid #F7DFB0; color:#8A5D06}
.note.err {background:#FDF3F3; border:1px solid #F2C9C9; color:#9B3232}
.note.ok  {background:var(--green-bg2); border:1px solid #C6E6D9; color:#0F6E4E}
.note.info{background:#F7F9FB; border:1px solid var(--line); color:#48566A}
.note b{font-weight:600}
.note ul{margin:6px 0 0; padding-left:1.2em}

/* ============================================ 骨組み */
#app{display:flex; min-height:100vh}

.side{
  width:var(--side-w); flex:0 0 var(--side-w); background:var(--side); color:#fff;
  display:flex; flex-direction:column; position:fixed; inset:0 auto 0 0; z-index:60;
}
.side-brand{padding:18px 16px 12px}
.side-brand .nm{font-size:15px; font-weight:600; letter-spacing:.02em}
.side-brand .ver{font-size:11.5px; color:rgba(255,255,255,.55); margin-top:2px}
.side-nav{flex:1; overflow-y:auto; padding:4px 0 12px}
.side-nav .grp{
  padding:11px 18px 4px; font-size:11px; letter-spacing:.06em;
  color:rgba(255,255,255,.45);
}
.side-nav a{
  display:flex; align-items:center; gap:9px; margin:1px 10px; padding:6.5px 10px;
  border-radius:7px; color:rgba(255,255,255,.82); font-size:13.5px; cursor:pointer;
}
.side-nav a:hover{background:rgba(255,255,255,.08)}
.side-nav a.on{background:var(--green); color:#fff; font-weight:500}
.side-nav a.on svg{opacity:1}
.side-nav svg{width:18px; height:18px; flex:0 0 18px; opacity:.85}
.side-foot{border-top:1px solid rgba(255,255,255,.1); padding:10px}
.side-foot a{
  display:flex; align-items:center; gap:9px; padding:8px 10px; border-radius:7px;
  color:rgba(255,255,255,.75); font-size:13.5px; cursor:pointer;
}
.side-foot a:hover{background:rgba(255,255,255,.08)}

.main{flex:1; min-width:0; margin-left:var(--side-w); display:flex; flex-direction:column}
.head{
  height:var(--head-h); flex:0 0 var(--head-h); background:#fff; border-bottom:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between; padding:0 28px;
  position:sticky; top:0; z-index:40;
}
.head .ttl{font-size:16px; font-weight:600}
.head .usr{display:flex; align-items:center; gap:9px; cursor:pointer; padding:6px 8px; border-radius:var(--r)}
.head .usr:hover{background:#F6F8FA}
.head .av{
  width:30px; height:30px; border-radius:50%; background:var(--green-bg); color:var(--green);
  display:flex; align-items:center; justify-content:center;
}
.head .usr .nm{font-size:13.5px; font-weight:500}
.head .usr .rl{font-size:11.5px; color:var(--sub)}
.menu{
  position:absolute; top:56px; right:24px; background:#fff; border:1px solid var(--line);
  border-radius:var(--r); box-shadow:0 6px 22px rgba(0,0,0,.09); min-width:180px; padding:5px; z-index:50;
}
.menu a{display:block; padding:9px 12px; border-radius:6px; color:var(--text); font-size:13.5px; cursor:pointer}
.menu a:hover{background:#F6F8FA}

.page{flex:1; padding:24px 28px 40px; max-width:1400px; width:100%}
.page-h{display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:16px; flex-wrap:wrap}
.page-h h1{margin:0; font-size:22px; font-weight:600}
.page-h .sub{font-size:13px; color:var(--sub); margin-top:2px}

.grid{display:grid; gap:16px}
.g-kpi{grid-template-columns:repeat(5,1fr)}
.g-65-35{grid-template-columns:1.85fr 1fr}
.g-2{grid-template-columns:1fr 1fr}

/* KPI */
.kpi{
  background:#fff; border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow);
  padding:16px 18px; min-height:116px; display:flex; flex-direction:column; gap:6px;
}
.kpi .ic{
  width:34px; height:34px; border-radius:8px; background:var(--green-bg); color:var(--green);
  display:flex; align-items:center; justify-content:center; margin-bottom:2px;
}
.kpi .ic.amber{background:#FEF3E2; color:#B4740A}
.kpi .ic.red{background:#FDECEC; color:#B03535}
.kpi .t{font-size:12.5px; color:var(--sub)}
.kpi .v{font-size:28px; font-weight:600; line-height:1.15; font-variant-numeric:tabular-nums}
.kpi .v small{font-size:14px; font-weight:500; margin-left:3px}
.kpi .v .over{font-size:13px; color:var(--sub); margin-left:4px}
.kpi .f{font-size:12px; color:var(--sub)}
.kpi.alert .v{color:#B4740A}
.kpi.calm .v{color:var(--ok)}

/* いま気をつけること */
.attn{display:flex; gap:11px; padding:13px 18px; border-bottom:1px solid #EFF2F5; cursor:pointer}
.attn:last-child{border-bottom:none}
.attn:hover{background:#FAFBFC}
.attn .dot{width:8px; height:8px; border-radius:50%; margin-top:7px; flex:0 0 8px}
.attn .d1{background:var(--error)} .attn .d2{background:var(--warn)} .attn .d3{background:#5B8DEF}
.attn .tx{flex:1; min-width:0}
.attn .tx b{display:block; font-size:13.5px; font-weight:600; margin-bottom:2px}
.attn .tx span{font-size:12.5px; color:var(--sub); display:block}

/* クイックアクション */
.qa{display:grid; grid-template-columns:repeat(4,1fr); gap:14px}
.qa a{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px;
  padding:22px 10px; border:1px solid var(--line); border-radius:var(--r); background:#fff;
  color:var(--text); font-size:13.5px; font-weight:500; cursor:pointer; text-align:center;
}
.qa a:hover{border-color:var(--green); background:var(--green-bg2)}
.qa .ic{
  width:44px; height:44px; border-radius:10px; background:var(--green-bg); color:var(--green);
  display:flex; align-items:center; justify-content:center;
}

/* ============================================ 要確認 3ペイン */
.kk{display:grid; grid-template-columns:288px minmax(0,1fr) 400px; gap:16px; align-items:start}
.kk-list{
  background:#fff; border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow);
  overflow:hidden; max-height:calc(100vh - var(--head-h) - 110px); display:flex; flex-direction:column;
}
.kk-list .card-h{flex:0 0 auto}
.kk-list .body{overflow-y:auto}
.kk-item{display:flex; gap:11px; padding:11px 13px; border-bottom:1px solid #EFF2F5; cursor:pointer}
.kk-item:hover{background:#FAFBFC}
.kk-item.on{background:var(--green-bg2); box-shadow:inset 3px 0 0 var(--green)}
.kk-item .th{
  width:46px; height:58px; flex:0 0 46px; border-radius:5px; border:1px solid var(--line);
  object-fit:cover; background:#F1F3F5;
}
.kk-item .info{flex:1; min-width:0}
.kk-item .no{font-size:12px; color:var(--sub); font-variant-numeric:tabular-nums}
.kk-item .nm{font-size:13.5px; font-weight:500; margin:1px 0 2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.kk-item .mt{display:flex; align-items:center; gap:6px; flex-wrap:wrap}
.kk-item .am{font-size:13px; font-weight:600; font-variant-numeric:tabular-nums}
.kk-view{
  background:#F1F3F5; border:1px solid var(--line); border-radius:var(--r-lg);
  min-height:520px; display:flex; align-items:center; justify-content:center; padding:14px; position:relative;
}
.kk-view img{max-height:calc(100vh - var(--head-h) - 190px); border-radius:6px; box-shadow:0 2px 10px rgba(0,0,0,.08); cursor:zoom-in}
.kk-view iframe{width:100%; height:calc(100vh - var(--head-h) - 190px); border:0; border-radius:6px; background:#fff}
.kk-view .zoomhint{position:absolute; left:14px; bottom:12px; font-size:11.5px; color:var(--sub)}
.kk-form{display:flex; flex-direction:column; gap:14px}

.ai-box{background:var(--green-bg2); border:1px solid #CFE8DD; border-radius:var(--r); padding:13px 15px}
.ai-box .hd{display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:9px}
.ai-box .hd b{font-size:13px; font-weight:600}
.ai-box .draft{background:#fff; border:1px solid var(--green); color:var(--green);
  border-radius:4px; font-size:11px; padding:1px 7px; font-weight:600}
.ai-box .mdl{font-size:11.5px; color:var(--sub); margin-left:auto}
.ai-box table{width:100%; border-collapse:collapse; font-size:12.5px}
.ai-box table td{padding:3px 0; border:0}
.ai-box table td:last-child{text-align:right; font-variant-numeric:tabular-nums}
.conf{font-size:11px; padding:0 5px; border-radius:3px; background:#fff; color:var(--sub); border:1px solid var(--line)}
.conf.low{background:#FFF9EC; color:#8A5D06; border-color:#F7DFB0}

.limit-ok{font-size:12px; color:var(--sub)}
.limit-ng{font-size:12px; color:var(--error); font-weight:600}

/* 撮る */
.steps{display:flex; align-items:center; gap:10px; margin-bottom:18px; flex-wrap:wrap}
.step{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--sub)}
.step .n{
  width:24px; height:24px; border-radius:50%; background:#E9EDF1; color:var(--sub);
  display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600;
}
.step.on{color:var(--text); font-weight:500}
.step.on .n{background:var(--green); color:#fff}
.step-line{flex:1; min-width:20px; height:1px; background:var(--line)}

.pick{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:16px}
.pick .op{
  border:1.5px solid var(--line); border-radius:var(--r); background:#fff; padding:14px 16px; cursor:pointer;
}
.pick .op:hover{border-color:#BFD8CD}
.pick .op.on{border-color:var(--green); background:var(--green-bg2)}
.pick .op b{display:block; font-size:14px; font-weight:600; margin-bottom:3px}
.pick .op span{font-size:12.5px; color:var(--sub)}

.drop{
  border:2px dashed #C9D4DE; border-radius:var(--r-lg); background:#FAFCFD;
  padding:38px 20px; text-align:center; cursor:pointer;
}
.drop:hover{border-color:var(--green); background:var(--green-bg2)}
.drop .ic{color:var(--green); margin-bottom:10px}
.drop .t1{font-size:15px; font-weight:600; color:var(--green)}
.drop .t2{font-size:13px; color:var(--sub); margin-top:4px}
.drop .t3{font-size:12px; color:var(--sub); margin-top:8px}
.drop.busy{opacity:.6; pointer-events:none}

.uplist{display:flex; flex-direction:column}
.uprow{display:flex; align-items:center; gap:12px; padding:11px 18px; border-bottom:1px solid #EFF2F5}
.uprow:last-child{border-bottom:none}
.uprow .th{width:38px; height:48px; border-radius:5px; border:1px solid var(--line); object-fit:cover; background:#F1F3F5}
.uprow .g{flex:1; min-width:0}
.uprow .g b{display:block; font-size:13px; font-weight:500}
.uprow .g span{font-size:12px; color:var(--sub)}

/* 検索 */
.search{display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end}
.search .fld{display:flex; flex-direction:column; gap:5px}
.search .fld>span{font-size:12px; color:var(--sub)}
.search .rng{display:flex; align-items:center; gap:6px}
.search .rng span{color:var(--sub); font-size:12px}
.search input[type=date]{width:148px}
.search input.amt{width:110px}
.search input.kw{width:190px}
.search select{width:130px}

/* 電帳法 */
.dc-total{display:flex; align-items:center; gap:18px; padding:20px 22px; border-radius:var(--r-lg); border:1px solid; flex-wrap:wrap}
.dc-total .big{font-size:32px; font-weight:700; line-height:1}
.dc-total.ok  {background:var(--green-bg2); border-color:#C6E6D9; color:#0F6E4E}
.dc-total.mid {background:#FFF9EC; border-color:#F7DFB0; color:#8A5D06}
.dc-total.ng  {background:#FDF3F3; border-color:#F2C9C9; color:#9B3232}
.dc-total .msg{font-size:14px; font-weight:600}
.dcitem{display:flex; gap:13px; padding:14px 18px; border-bottom:1px solid #EFF2F5}
.dcitem:last-child{border-bottom:none}
.dcitem .j{
  width:26px; height:26px; flex:0 0 26px; border-radius:50%; display:flex; align-items:center;
  justify-content:center; font-size:14px; font-weight:700;
}
.dcitem .j.o{background:var(--green-bg); color:var(--ok)}
.dcitem .j.x{background:#FDECEC; color:var(--error)}
.dcitem .j.h{background:#FFF6E5; color:var(--warn)}
.dcitem .c{flex:1; min-width:0}
.dcitem .c b{display:block; font-size:13.5px; font-weight:600}
.dcitem .c .st{font-size:12.5px; color:var(--sub); margin-top:2px}
.dcitem .c .to{font-size:12.5px; color:#8A5D06; margin-top:4px}

/* 名刺 */
.mcards{display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:14px}
.mcard{background:#fff; border:1px solid var(--line); border-radius:var(--r); overflow:hidden; cursor:pointer}
.mcard:hover{border-color:var(--green)}
.mcard img{width:100%; height:132px; object-fit:cover; background:#F1F3F5; display:block}
.mcard .b{padding:11px 13px}
.mcard .b b{display:block; font-size:14px; font-weight:600}
.mcard .b span{display:block; font-size:12.5px; color:var(--sub)}
.cmp{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.cmp .col{border:1px solid var(--line); border-radius:var(--r); padding:12px 14px}
.cmp .col.a{border-color:var(--green); background:var(--green-bg2)}
.cmp .col h4{margin:0 0 8px; font-size:12.5px; color:var(--sub); font-weight:600}
.cmp dl{margin:0; font-size:13px}
.cmp dt{color:var(--sub); font-size:11.5px; margin-top:6px}
.cmp dd{margin:0}
.keep{font-size:11px; color:#8A5D06; background:#FFF9EC; border:1px solid #F7DFB0; border-radius:3px; padding:0 5px}

/* 履歴 */
.tabs{display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:16px; overflow-x:auto}
.tabs a{
  padding:9px 14px; font-size:13.5px; color:var(--sub); cursor:pointer; white-space:nowrap;
  border-bottom:2px solid transparent; margin-bottom:-1px;
}
.tabs a:hover{color:var(--text)}
.tabs a.on{color:var(--green); font-weight:600; border-bottom-color:var(--green); background:var(--green-bg2)}
.hist{display:flex; gap:12px; padding:12px 0; border-bottom:1px solid #EFF2F5}
.hist:last-child{border-bottom:none}
.hist .v{
  flex:0 0 42px; height:24px; border-radius:4px; background:var(--green-bg); color:#0F6E4E;
  display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600;
}
.hist .m{flex:1; min-width:0; font-size:12.5px}
.hist .m b{font-size:13px}
.kv{width:100%; border-collapse:collapse; font-size:12.5px}
.kv td{padding:3px 8px 3px 0; vertical-align:top}
.kv td:first-child{color:var(--sub); white-space:nowrap; width:34%}

/* ダイアログ */
.mask{position:fixed; inset:0; background:rgba(15,25,35,.45); z-index:100; display:flex;
      align-items:center; justify-content:center; padding:20px}
.dlg{background:#fff; border-radius:var(--r-lg); width:100%; max-width:460px; max-height:88vh; overflow:auto;
     box-shadow:0 12px 40px rgba(0,0,0,.2)}
.dlg .h{padding:16px 20px; border-bottom:1px solid var(--line); font-size:15px; font-weight:600}
.dlg .b{padding:18px 20px}
.dlg .f{padding:14px 20px; border-top:1px solid var(--line); display:flex; gap:9px; justify-content:flex-end}
.mask.viewer{background:rgba(10,15,20,.9)}
.mask.viewer img{max-width:96vw; max-height:92vh; border-radius:6px}

.toast{
  position:fixed; left:50%; transform:translateX(-50%); bottom:26px; z-index:200;
  background:#17212B; color:#fff; padding:11px 18px; border-radius:var(--r); font-size:13.5px;
  box-shadow:0 6px 22px rgba(0,0,0,.25); max-width:90vw;
}
.toast.err{background:#8E2F2F}

/* ログイン */
.login{min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; background:var(--bg)}
.login .box{width:100%; max-width:380px}
.login .brand{text-align:center; margin-bottom:20px}
.login .brand .lg{
  width:52px; height:52px; border-radius:12px; background:var(--side); color:#fff; margin:0 auto 12px;
  display:flex; align-items:center; justify-content:center;
}
.login .brand b{font-size:18px; font-weight:600; display:block}
.login .brand span{font-size:12.5px; color:var(--sub)}

/* ============================================ スマホ */
.m-head,.m-nav,.m-drawer,.m-mask{display:none}

@media(max-width:1023px){
  .g-kpi{grid-template-columns:repeat(2,1fr)}
  .g-65-35,.g-2{grid-template-columns:1fr}
  .kk{grid-template-columns:1fr}
  .kk-list{max-height:none}
  .qa{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:767px){
  body{font-size:14px}
  .side{display:none}
  .head{display:none}
  .main{margin-left:0}

  .m-head{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    height:56px; padding:0 6px 0 4px; background:#fff; border-bottom:1px solid var(--line);
    position:sticky; top:0; z-index:40; padding-top:env(safe-area-inset-top);
    height:calc(56px + env(safe-area-inset-top));
  }
  .m-head .ib{
    width:44px; height:44px; display:flex; align-items:center; justify-content:center;
    background:none; border:0; color:var(--text); cursor:pointer;
  }
  .m-head .tt{font-size:15px; font-weight:600}

  .m-nav{
    display:grid; grid-template-columns:repeat(5,1fr); position:fixed; left:0; right:0; bottom:0; z-index:50;
    background:#fff; border-top:1px solid var(--line);
    padding-bottom:env(safe-area-inset-bottom);
  }
  .m-nav a{
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
    height:56px; font-size:10.5px; color:var(--sub); cursor:pointer;
  }
  .m-nav a.on{color:var(--green); font-weight:600}
  .m-nav .bdg{
    position:absolute; transform:translate(14px,-12px); min-width:16px; height:16px; padding:0 4px;
    border-radius:8px; background:var(--warn); color:#fff; font-size:10px; font-weight:700;
    display:flex; align-items:center; justify-content:center;
  }

  .m-mask{display:block; position:fixed; inset:0; background:rgba(15,25,35,.45); z-index:70}
  .m-drawer{
    display:flex; flex-direction:column; position:fixed; left:0; top:0; bottom:0; width:262px; z-index:80;
    background:var(--side); color:#fff; overflow-y:auto; padding-top:env(safe-area-inset-top);
  }
  .m-drawer .side-nav a{font-size:14.5px; padding:10px 12px}

  .page{padding:14px 15px 84px}
  .page-h h1{font-size:19px}
  /* スマホでは「いま気をつけること」をKPIの直後に出す（下にスクロールされず埋もれるため） */
  .g-65-35{display:flex; flex-direction:column}
  .g-65-35 .d-attn{order:-1}
  .grid{gap:12px}
  .g-kpi{grid-template-columns:1fr 1fr; gap:12px}
  .kpi{min-height:92px; padding:13px 14px}
  .kpi .v{font-size:24px}
  .kpi .ic{width:30px; height:30px}
  .kpi.wide{grid-column:1 / -1}
  .qa{grid-template-columns:repeat(2,1fr); gap:12px}
  .card-b{padding:14px}
  .card>.card-h{padding:12px 14px}
  .pick{grid-template-columns:1fr 1fr; gap:10px}
  .cmp{grid-template-columns:1fr}
  .mcards{grid-template-columns:1fr 1fr; gap:12px}
  /* スマホでは検索条件を縦に積む。横スクロールを絶対に出さないため flex をやめる */
  .search{display:block}
  .search .fld{display:block; width:auto; margin-bottom:12px}
  .search .fld>span{display:block; margin-bottom:5px}
  .search input[type=date],.search input.amt,.search input.kw,.search select{width:100%}
  .search .rng{display:flex; width:auto; gap:6px; align-items:center}
  .search .rng input{flex:1 1 0; width:auto; min-width:0}
  .search .btn{width:100%; margin-bottom:8px}

  /* iPhone で入力時に勝手に拡大されないよう 16px 以上 */
  input[type=text],input[type=password],input[type=date],input[type=number],input[type=search],select,textarea{
    font-size:16px; height:48px;
  }
  textarea{height:auto}
  .btn{height:44px; padding:0 16px}
  .btn.sm{height:36px}
  .btn.lg{height:52px}
  .lnk,.tabs a{min-height:44px; display:inline-flex; align-items:center}

  .m-shot{
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
    min-height:140px; border-radius:var(--r-lg); background:var(--green); color:#fff;
    border:0; width:100%; cursor:pointer; font-size:16px; font-weight:600;
  }
  .m-shot:active{background:var(--green-hover)}
  .m-shot .sub{font-size:12.5px; font-weight:400; opacity:.9}

  .kk-view{min-height:auto; padding:10px}
  .kk-view img{max-height:56vh}
  .kk-view iframe{height:56vh}

  .srow{display:flex; gap:11px; padding:12px 14px; border-bottom:1px solid #EFF2F5; cursor:pointer}
  .srow:last-child{border-bottom:none}
  .srow .th{width:42px; height:52px; flex:0 0 42px; border-radius:5px; border:1px solid var(--line); object-fit:cover; background:#F1F3F5}
  .srow .g{flex:1; min-width:0}
  .srow .r1{display:flex; justify-content:space-between; gap:8px; align-items:baseline}
  .srow .r1 .no{font-size:12.5px; color:var(--green); font-weight:600; font-variant-numeric:tabular-nums}
  .srow .r1 .am{font-size:14px; font-weight:600; font-variant-numeric:tabular-nums}
  .srow .r2{font-size:11.5px; color:var(--sub)}
  .srow .r3{display:flex; gap:6px; align-items:center; margin-top:3px; flex-wrap:wrap}
  .srow .r3 .nm{font-size:13px; margin-right:auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
}

@media(min-width:768px){
  .only-sp{display:none !important}
}
@media(max-width:767px){
  .only-pc{display:none !important}
}

/* 医療費（医療費控除）。事業の経費と見分けがつくよう別色にしています */
.b-iryo{background:#F3EEFB; color:#6B4CA8}

/* ============================================ 集計 */
.period{display:flex; gap:8px; flex-wrap:wrap; align-items:center}
.period .pbtn{
  height:34px; padding:0 14px; border-radius:var(--r); border:1px solid var(--line);
  background:#fff; color:var(--text); font-size:13.5px; cursor:pointer; white-space:nowrap;
}
.period .pbtn:hover{background:#F9FAFB}
.period .pbtn.on{background:var(--green); border-color:var(--green); color:#fff; font-weight:500}

.chips{display:flex; gap:7px; flex-wrap:wrap; align-items:center}
.chip{
  display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 6px 0 11px;
  border-radius:15px; border:1px solid var(--green); background:var(--green-bg);
  color:#0F6E4E; font-size:12.5px; white-space:nowrap;
}
.chip button{
  width:20px; height:20px; border:0; border-radius:50%; background:rgba(15,110,78,.12);
  color:#0F6E4E; cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0;
}
.chip button svg{width:12px; height:12px}
.chip-add{
  height:30px; padding:0 12px; border-radius:15px; border:1px dashed #BFD8CD;
  background:#fff; color:var(--green); font-size:12.5px; cursor:pointer;
}

/* 月ごとの棒（外部ライブラリを使わず、divの高さで描いています） */
.mbars{display:flex; align-items:flex-end; gap:6px; height:200px; padding:0 2px}
.mbar{flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; gap:5px;
      cursor:pointer; height:100%}
.mbar .amt{font-size:10.5px; color:var(--sub); font-variant-numeric:tabular-nums; white-space:nowrap}
.mbar .tr{flex:1; width:100%; min-height:0; display:flex; align-items:flex-end; justify-content:center}
.mbar .bar{width:100%; max-width:44px; height:var(--v); min-height:2px;
           background:var(--green); border-radius:4px 4px 0 0}
.mbar .lb{font-size:11px; color:var(--sub); white-space:nowrap}
.mbar:hover .bar{background:var(--green-hover)}
.mbar.zero .bar{background:#E4E9EE; height:2px}
.mbar.on .bar{background:#0F6E4E}
.mbar.on .lb{color:var(--green); font-weight:600}

/* 科目ごとの横棒 */
.kbar{display:flex; align-items:center; gap:11px; padding:9px 18px; cursor:pointer}
.kbar:hover{background:#FAFBFC}
.kbar .nm{width:104px; flex:0 0 104px; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.kbar .tr{flex:1; min-width:0; height:16px; background:#F1F3F5; border-radius:3px; overflow:hidden}
.kbar .fl{height:100%; background:var(--green); border-radius:3px}
.kbar .vl{width:112px; flex:0 0 112px; text-align:right; font-size:13px;
          font-variant-numeric:tabular-nums; white-space:nowrap}
.kbar .vl small{color:var(--sub); font-size:11.5px; margin-left:5px}
.kbar.on{background:var(--green-bg2)}
.kbar.on .nm{font-weight:600; color:var(--green)}

@media(max-width:767px){
  /* スマホでは横向きの棒。長さ（幅）が金額に比例します */
  .mbars{height:auto; display:block; padding:0}
  .mbar{flex-direction:row; align-items:center; gap:10px; height:auto; padding:8px 0;
        border-bottom:1px solid #EFF2F5}
  .mbar:last-child{border-bottom:none}
  .mbar .lb{width:54px; flex:0 0 54px; text-align:left; font-size:12px; order:1}
  .mbar .tr{order:2; flex:1; width:auto; height:16px; background:#F1F3F5;
            border-radius:3px; align-items:stretch; justify-content:flex-start; overflow:hidden}
  .mbar .bar{width:var(--v); max-width:none; height:100%; min-height:0; min-width:0;
             border-radius:3px}
  .mbar.zero .bar{width:0; height:100%}
  .mbar .amt{width:86px; flex:0 0 86px; text-align:right; font-size:12px; order:3}
  .kbar{padding:9px 14px; gap:9px}
  .kbar .nm{width:84px; flex:0 0 84px; font-size:12.5px}
  .kbar .vl{width:92px; flex:0 0 92px; font-size:12.5px}
  .kbar .vl small{display:none}
}
