/* 経費精算アプリ（スマートフォン） */
:root{
  --ink:#1b2430; --sub:#5b6673; --line:#dfe4ea; --bg:#eef1f5;
  --accent:#1b6fb8; --accent-d:#15568e; --ok:#1f8a4c; --warn:#b8541b; --bad:#c0392b;
  --chip:#eaf2fa;
}
*{box-sizing:border-box}
/* class で display を指定した要素（.btn・.thumbs など）は、これが無いと hidden が効かない */
[hidden]{display:none !important}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink);
  font-family:"BIZ UDPゴシック","Yu Gothic UI","Hiragino Sans","Noto Sans JP",sans-serif;
  font-size:16px; line-height:1.6; -webkit-text-size-adjust:100%;
}
.app{max-width:480px; margin:0 auto; background:#fff; min-height:100vh;
     display:flex; flex-direction:column; box-shadow:0 0 24px rgba(20,35,55,.08)}
header{background:var(--accent); color:#fff; padding:12px 16px; display:flex;
       align-items:center; gap:10px; position:sticky; top:0; z-index:5}
header h1{font-size:16px; margin:0; font-weight:700}
header .who{margin-left:auto; font-size:12px; opacity:.92}
header .hdr-btn{background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.45); color:#fff;
                font-size:11.5px; padding:5px 10px; border-radius:14px; cursor:pointer; margin-left:8px}
header a.hdr-btn{text-decoration:none; white-space:nowrap}
header button.back{background:none; border:0; color:#fff; font-size:20px; padding:0 4px;
                   cursor:pointer; font-family:inherit; line-height:1}
main{flex:1; padding:14px 16px 32px}
.view[hidden]{display:none}

h2{font-size:15px; margin:18px 0 8px}
p{margin:0 0 10px}
.muted{color:var(--sub); font-size:13px; line-height:1.8}
.center{text-align:center}
/* 置き換え用の小さな指定（CSP で style 属性が使えないため、すべてここに置く） */
.mt-lg{margin-top:19px}
.m0{margin:0}
.m-sm{margin:6px 0}
.lead-b{font-weight:700; margin-bottom:10px}
.narrow{max-width:240px; margin:0}
hr.sep{border:0; border-top:1px solid var(--line); margin:18px 0 12px}
.invite-code{font-size:34px; font-weight:700; letter-spacing:4px; text-align:center; margin:18px 0}

.card{border:1px solid var(--line); border-radius:12px; padding:14px; margin-bottom:12px; background:#fff}
.card.flat{background:#f7f9fb}
.month{font-size:13px; color:var(--sub)}
.month b{display:block; font-size:19px; color:var(--ink); margin-top:3px}
.deadline{margin-top:8px; font-size:13px; color:var(--warn); font-weight:700}
.kpi{display:flex; gap:10px; margin-top:12px}
.kpi div{flex:1; background:var(--chip); border-radius:10px; padding:10px 4px; text-align:center}
.kpi span{display:block; font-size:11px; color:var(--sub)}
.kpi strong{font-size:18px}

button{font-family:inherit}
.btn{display:block; width:100%; border:0; border-radius:12px; padding:15px 10px; font-size:16px;
     font-weight:700; margin-bottom:10px; cursor:pointer}
.btn:disabled{opacity:.5; cursor:default}
.btn.main{background:var(--accent); color:#fff}
.btn.sub{background:#fff; color:var(--accent-d); border:1.5px solid var(--accent)}
.btn.ok{background:var(--ok); color:#fff}
.btn.ghost{background:#f2f4f7; color:var(--sub); font-weight:400; font-size:14px; padding:12px}
.btn.danger{background:#fff; color:var(--bad); border:1.5px solid var(--bad); font-size:14px; padding:12px}
.btn.small{width:auto; display:inline-block; padding:8px 14px; font-size:13px; margin:0 6px 0 0}

label.f{display:block; font-size:12px; color:var(--sub); margin:0 0 4px; font-weight:700}
input[type=text],input[type=date],input[type=number],input[type=password],textarea,select{
  width:100%; border:1px solid var(--line); border-radius:10px; padding:12px;
  font-size:16px; font-family:inherit; background:#fff; color:var(--ink); margin-bottom:12px}
input:focus,textarea:focus,select:focus{outline:2px solid var(--accent); outline-offset:-1px}
input.amount{font-size:22px; text-align:right; font-weight:700}
.seg{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px}
.seg button{font-size:13px; padding:9px 13px; border-radius:18px; border:1px solid var(--line);
            color:var(--sub); background:#fff; cursor:pointer}
.seg button.on{background:var(--accent); color:#fff; border-color:var(--accent); font-weight:700}

.pin{display:flex; gap:10px; justify-content:center; margin:22px 0 14px}
.pin i{width:16px; height:16px; border-radius:50%; background:#d6dde5; transition:background .1s}
.pin i.on{background:var(--accent)}
.pad{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; max-width:300px; margin:0 auto}
.pad button{background:#f2f4f7; border:0; border-radius:12px; padding:16px 0; font-size:20px; cursor:pointer}
.pad button.blank{background:none; cursor:default}

.shot{border:1.5px dashed #b6c2cf; border-radius:12px; padding:18px 10px; text-align:center;
      color:var(--accent-d); background:#f7fbff; margin-bottom:12px; cursor:pointer; font-weight:700}
.shot .ic{font-size:26px; display:block; margin-bottom:4px}
.shot small{display:block; color:var(--sub); font-size:11px; font-weight:400; margin-top:4px}
.thumbs{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px}
.thumbs figure{margin:0; position:relative}
.thumbs img{width:64px; height:80px; object-fit:cover; border-radius:8px; border:1px solid var(--line)}
.thumbs button{position:absolute; top:-6px; right:-6px; width:22px; height:22px; border-radius:50%;
               border:0; background:var(--bad); color:#fff; font-size:13px; line-height:1; cursor:pointer}

.rows{border:1px solid var(--line); border-radius:12px; overflow:hidden; margin-bottom:12px}
.row{display:flex; justify-content:space-between; align-items:flex-start; padding:12px 14px;
     border-bottom:1px solid var(--line); cursor:pointer; background:#fff}
.row:last-child{border-bottom:0}
.row .l{font-size:14px; min-width:0}
.row .l small{display:block; color:var(--sub); font-size:11.5px; margin-top:3px}
.row .r{font-size:15px; font-weight:700; white-space:nowrap; padding-left:10px}
.tag{display:inline-block; font-size:10.5px; padding:2px 8px; border-radius:10px;
     background:var(--chip); color:var(--accent-d); margin-right:5px}
.tag.no{background:#fdeeea; color:var(--warn)}
.total{display:flex; justify-content:space-between; align-items:center; background:var(--chip);
       border-radius:11px; padding:13px 14px; margin-bottom:12px}
.total span{font-size:13px; color:var(--accent-d); font-weight:700}
.total b{font-size:21px}

.warnbox{background:#fff7ed; border:1px solid #f0d6b8; border-radius:10px; padding:11px 12px;
         font-size:12.5px; color:#8a4b14; line-height:1.8; margin-bottom:12px}
.errbox{background:#fdeeea; border:1px solid #f0c0b8; border-radius:10px; padding:11px 12px;
        font-size:13px; color:#8c2d1c; line-height:1.7; margin-bottom:12px}
.okbox{background:#eaf6ee; border:1px solid #bfe0cb; border-radius:10px; padding:11px 12px;
       font-size:13px; color:#1b6b3c; line-height:1.7; margin-bottom:12px}
.hero{font-size:46px; text-align:center; margin:18px 0 6px}
.msg{text-align:center; font-size:16px; font-weight:700; margin-bottom:4px}

.toast{position:fixed; left:50%; bottom:22px; transform:translateX(-50%);
       background:#1b2430; color:#fff; padding:11px 18px; border-radius:22px; font-size:13.5px;
       max-width:88%; z-index:20; box-shadow:0 6px 18px rgba(0,0,0,.25)}
.toast[hidden]{display:none}
.spinner{display:inline-block; width:15px; height:15px; border:2px solid rgba(255,255,255,.4);
         border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite;
         vertical-align:-2px; margin-right:6px}
@keyframes spin{to{transform:rotate(360deg)}}
footer{padding:16px; font-size:11px; color:var(--sub); text-align:center; line-height:1.8}
