:root{
  --green:#1f3a68; --red:#a8261c; --amber:#8a5200;
  --ink:#111; --sub:#888; --btn:#efefef; --line:#e4e4e4;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:#fff;color:var(--ink);
  font-family:"Noto Sans JP","Noto Sans CJK JP","Hiragino Sans","IPAPGothic",sans-serif}
button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:pointer}
#app{position:fixed;inset:0;display:flex;flex-direction:column;max-width:480px;margin:0 auto;overflow:hidden}

/* 上の行 */
.head{display:flex;align-items:center;justify-content:space-between;padding:8px 10px 6px 14px;height:48px}
.head .d{font-size:16px;font-weight:700;line-height:1.2}
.head .r{display:flex;align-items:center;gap:10px}
.cnt{font-size:18px;font-weight:700;white-space:nowrap}
.head .t{font-size:13px;color:#666;margin-top:1px}
.copy{background:#111;color:#fff;border-radius:6px;width:72px;height:40px;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.15}
.copy b{font-size:14px}
.copy span{font-size:11px;color:#ddd}

/* 班のタブ */
.tabs{display:flex;gap:4px;margin:2px 10px 6px;padding:2px;background:#f0f0f0;border-radius:9px;overflow-x:auto;scrollbar-width:none;flex:none}
.tabs::-webkit-scrollbar{display:none}
.tab{flex:1 0 110px;height:32px;border-radius:7px;font-size:15px;font-weight:700;color:#333;white-space:nowrap}
.tab.on{background:#111;color:#fff}
.tab .n{font-size:20px;vertical-align:-2px;margin-right:4px}

/* 一覧 */
.list{flex:1;overflow-y:auto;touch-action:pan-y;padding:0 10px}
.list.pad{padding-bottom:70px}
.row{display:flex;align-items:center;height:37px}
.hit{flex:1;display:flex;align-items:center;height:37px;min-width:0;cursor:pointer}
.chk{width:24px;height:24px;border-radius:50%;border:2px solid #9b9b9b;margin:0 10px 0 2px;flex:none;display:flex;align-items:center;justify-content:center}
.row.p .chk{background:var(--green);border-color:var(--green)}
.row.p .chk::after{content:"";width:6px;height:11px;border:solid #fff;border-width:0 2.5px 2.5px 0;transform:rotate(45deg) translate(-1px,-1px)}
.nm{font-size:17px;white-space:nowrap}
.row.p .nm{color:#8a8a8a}
.why{font-size:14px;margin-left:auto;padding:0 4px 0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;text-align:right}
.why.a{color:#c01f14;font-weight:700} .why.l{color:#a85d00;font-weight:700}
.tag{font-size:13px;color:#555;margin-left:8px;white-space:nowrap}
.tag i{font-style:normal;font-size:16px;color:#222}
.btns{display:flex;gap:6px;margin-left:6px;flex:none}
.b{width:54px;height:32px;border-radius:6px;background:var(--btn);font-size:14px;font-weight:700;color:#555}
.b.a.on{background:#d92d20;color:#fff}
.b.l.on{background:#f5a000;color:#111}
.row.p .b:not(.on),.row.ab .b:not(.on){background:#f7f7f7;color:#b5b5b5}
.row.pa{background:#e9e9e9;margin:0 -10px;padding:0 10px}
.row.pa .nm{color:#777}
.row.out .nm{color:#aaa}
.row.out .hit{cursor:default}


/* 下のメニュー */
.nav{flex:none;display:flex;height:45px;border-top:1px solid var(--line);background:#fff}
.nav button{flex:1;font-size:14px;color:#777}
.nav button.on{color:#111;font-weight:700}

/* 下から出る欄 */
.sheet{position:fixed;left:0;right:0;bottom:var(--kb,0px);max-width:480px;margin:0 auto;background:#fff;border-top:1px solid #d6d6d6;box-shadow:0 -3px 12px rgba(0,0,0,.12);padding:10px 12px 12px;z-index:10;display:none}
.sheet.show{display:block}
.sheet h3{margin:0 0 8px;font-size:16px;font-weight:700;display:flex;justify-content:space-between;align-items:center}
.sheet h3 button{font-size:14px;color:#555;padding:4px 6px}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.chip{height:36px;padding:0 14px;border-radius:6px;background:var(--btn);font-size:15px}
.free button{width:64px;height:40px;border-radius:6px;background:#111;color:#fff;font-size:14px}

/* コピーした文章 */
.copied pre{margin:0 0 8px;white-space:pre-wrap;word-break:break-all;font:inherit;font-size:15px;line-height:1.6;user-select:text;-webkit-user-select:text;background:#f6f6f6;border-radius:6px;padding:8px 10px}
.copied .m{font-size:14px;color:#555;margin-bottom:6px}


.free{display:flex;gap:6px}
.free input{flex:1;height:40px;border:1px solid #bbb;border-radius:6px;padding:0 10px;font-size:16px;min-width:0}
/* 記録がないとき */
.msg{padding:28px 14px;text-align:center}
.msg p{margin:0 0 16px;font-size:16px;line-height:1.7;color:#333}
.msg button{display:block;width:100%;max-width:300px;height:48px;margin:0 auto 10px;border-radius:8px;background:#111;color:#fff;font-size:16px;font-weight:700}
.msg button.sub{background:var(--btn);color:#333;font-weight:400}
/* 保存できないとき */
.warn{display:none;background:#d92d20;color:#fff;font-size:14px;padding:8px 14px;text-align:center}
.warn.show{display:block}
.nav button.off{color:#bbb}

/* 追加ボタン（メニューの上の右下。メニューの中には入れない） */
.fab{position:fixed;right:14px;bottom:57px;width:46px;height:46px;border-radius:50%;background:#111;color:#fff;font-size:30px;line-height:44px;text-align:center;box-shadow:0 2px 6px rgba(0,0,0,.3);z-index:5}
.fab.hide{display:none}
.srch{display:flex;gap:6px}
.srch input{flex:1;height:40px;border:1px solid #bbb;border-radius:6px;padding:0 10px;font-size:16px;min-width:0}
.cands{max-height:var(--cm,210px);overflow-y:auto;margin-top:6px}
.cand{display:flex;justify-content:space-between;align-items:center;width:100%;height:42px;padding:0 4px;border-bottom:1px solid #eee;font-size:17px;text-align:left}
.cand small{font-size:14px;color:#666}
.cand.new{color:var(--green);font-weight:700}

/* 画面 */
.scr{flex:1;display:flex;flex-direction:column;min-height:0}
.scr.hide{display:none}
.mhead{display:flex;align-items:center;gap:12px;height:48px;padding:0 14px;font-size:16px;flex:none}
.mhead b{font-size:17px}
.mhead span{font-size:14px;color:#555}
.mhead .back{font-size:15px;color:#333;padding:6px 8px 6px 0}
.mbody{flex:1;overflow-y:auto;padding:0 14px 20px}
.madd{display:flex;gap:6px;margin-bottom:8px}
.madd input{flex:1;min-width:0;height:42px;border:1px solid #bbb;border-radius:6px;padding:0 10px;font-size:16px}
.madd select{height:42px;border:1px solid #bbb;border-radius:6px;background:#fff;font-size:16px;padding:0 4px}
.madd button{width:60px;height:42px;border-radius:6px;background:#111;color:#fff;font-size:15px;font-weight:700}
.mimp{width:100%;height:44px;border-radius:6px;border:1px solid #bbb;background:#fff;font-size:15px;margin-bottom:6px}
.msec{margin-top:12px;font-size:15px;font-weight:700;color:#333;padding:4px 0;border-bottom:1px solid var(--line)}
.msec small{font-size:13px;font-weight:400;color:#666;margin-left:6px}
.mrow{display:flex;align-items:center;height:46px;border-bottom:1px solid #f0f0f0}
.mrow .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.mb{min-width:54px;height:34px;padding:0 8px;border-radius:6px;background:var(--btn);font-size:14px;font-weight:700;color:#444;margin-left:6px}
.mb.rm{color:#a8261c;font-weight:400}
.empty{padding:20px 0;color:#555;font-size:15px;line-height:1.7}
.note{margin:0 0 12px;font-size:14px;color:#444;line-height:1.6}
.two{display:flex;gap:8px;justify-content:flex-end}
.two button{height:42px;padding:0 20px;border-radius:6px;background:var(--btn);font-size:15px}
.two button.ok{background:#a8261c;color:#fff;font-weight:700}
.gchip{height:40px;min-width:54px;padding:0 12px;border-radius:6px;background:var(--btn);font-size:16px}
.gchip.on{background:#111;color:#fff}

/* 取り込み */
.mbody textarea{width:100%;height:260px;border:1px solid #bbb;border-radius:6px;padding:10px;font-size:16px;font-family:inherit;line-height:1.6;resize:none}
.big{display:block;width:100%;height:48px;border-radius:8px;background:#111;color:#fff;font-size:16px;font-weight:700;margin-top:10px}
.big:disabled{background:#bbb}
.big.sub{background:var(--btn);color:#333;font-weight:400}
.hint{font-size:13px;color:#666;line-height:1.6;margin:0 0 8px;white-space:pre-line}
.card{border:1px solid var(--line);border-radius:8px;padding:10px;margin-bottom:10px}
.card .top{display:flex;align-items:center;gap:8px;margin-bottom:8px;font-size:15px}
.card .top input{height:38px;border:1px solid #bbb;border-radius:6px;padding:0 8px;font-size:16px;min-width:0}
.card .top input.no{width:56px}
.card .top input.tm{flex:1}
.card .top em{font-style:normal;font-size:13px;color:#555;white-space:nowrap}
.names{display:flex;flex-wrap:wrap;gap:6px}
.nmc{font-size:15px;padding:4px 8px;border-radius:6px;background:#f2f2f2}
.nmc i{font-style:normal;font-size:12px;margin-left:4px;color:#1f3a68;font-weight:700}
.nmc i.mv{color:#a85d00}
.warn2{background:#fff3dc;border-radius:8px;padding:10px 12px;margin-bottom:10px;font-size:14px;line-height:1.7}
.warn2.err{background:#fdeceb;color:#a8261c}
.sum{font-size:15px;line-height:1.8;margin-bottom:10px}

/* 日付一覧 */
.dnew{display:flex;gap:6px;margin-bottom:6px}
.dnew input{flex:1;min-width:0;height:42px;border:1px solid #bbb;border-radius:6px;padding:0 8px;font-size:16px}
.dnew button{height:42px;padding:0 12px;border-radius:6px;background:#111;color:#fff;font-size:14px;font-weight:700}
.drow{display:block;width:100%;text-align:left;padding:10px 0;border-bottom:1px solid var(--line)}
.drow .dt{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:4px}
.drow .dt b{font-size:17px}
.drow .dt span{font-size:14px;color:#555}
.drow .dl{font-size:14px;line-height:1.6;color:#333;word-break:break-all}
.drow .dl.a b{color:#c01f14}
.drow .dl.l b{color:#a85d00}
.drow .dl.m{color:#555}
/* 欠席・遅刻 */
.mbody .tabs{margin:2px 0 10px}
.tab.sm{flex:1 0 80px;font-size:14px}
.prow{display:block;width:100%;text-align:left;padding:10px 0;border-bottom:1px solid var(--line)}
.prow .pt{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:3px}
.prow .pt b{font-size:17px}
.prow .pt span{font-size:14px;color:#444}
.prow .pt .a{color:#c01f14;font-weight:700}
.prow .pt .l{color:#a85d00;font-weight:700;margin-left:10px}
.prow .pd{font-size:14px;line-height:1.6;color:#444;word-break:break-all}
/* 履歴 */
.hrow{display:flex;align-items:center;gap:10px;height:44px;border-bottom:1px solid #f0f0f0;font-size:16px}
.hrow .hd{width:92px;flex:none}
.hrow .hs{font-weight:700}
.hrow .hs.p{color:#1f3a68}
.hrow .hs.a{color:#c01f14}
.hrow .hs.l{color:#a85d00}
.hrow .hs.n{color:#888;font-weight:400}
.hrow .hw{font-size:14px;color:#555}

.two2{display:flex;gap:8px}
.two2 .mimp{flex:1;margin-bottom:6px}
