:root{ --brand:#EF9F27; --brand-d:#d98a1f; --bg:#f2f3f5; --line:#e4e4e4; --ink:#222; --muted:#777; --navw:220px; --navh:56px; }
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:system-ui,"Noto Sans CJK JP",sans-serif;background:var(--bg);color:var(--ink)}
a{color:inherit}

/* ===== ログイン ===== */
.center-page{display:flex;min-height:100vh;align-items:center;justify-content:center}
.card{background:#fff;padding:28px 24px;border-radius:12px;width:min(360px,90vw);box-shadow:0 2px 12px rgba(0,0,0,.08)}
.card h1{font-size:18px;margin:0 0 20px}
.card label{display:block;font-size:13px;margin:14px 0 6px;color:#333}
.card input{width:100%;padding:11px;border:1px solid #ccc;border-radius:8px;font-size:16px}
.card button{width:100%;margin-top:22px;padding:12px;border:0;border-radius:8px;background:var(--brand);color:#fff;font-size:16px;font-weight:bold;cursor:pointer}
.err{background:#fdecea;color:#b3261e;padding:10px;border-radius:8px;font-size:13px;margin-bottom:8px}

/* ===== アプリの枠（スマホ=下タブ / PC=左サイド） ===== */
.app{}
.nav{position:fixed;left:0;right:0;bottom:0;height:var(--navh);display:flex;background:#fff;border-top:1px solid var(--line);z-index:30}
.nav .brand{display:none}
.navlink{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;color:var(--muted);text-decoration:none}
.navlink i{font-size:21px}
.navlink .ext{font-size:12px}
.navlink.active{color:var(--brand)}

.main{min-height:100vh;min-height:100dvh;padding-bottom:var(--navh)}
.appbar{background:var(--brand);color:#fff;padding:12px 16px;display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;z-index:20}
.appbar .ttl{font-weight:bold}
.appbar .lg{color:#fff;font-size:13px;text-decoration:none}
.content{padding:14px}

@media (min-width:768px){
  .nav{top:0;bottom:0;right:auto;width:var(--navw);height:100vh;height:100dvh;flex-direction:column;border-top:0;border-right:1px solid var(--line);padding-top:8px}
  .nav .brand{display:block;font-weight:bold;color:var(--brand);padding:14px 18px;font-size:16px}
  .navlink{flex:0 0 auto;flex-direction:row;justify-content:flex-start;gap:12px;padding:13px 18px;font-size:15px;width:100%}
  .navlink.active{background:#fff7ec}
  .main{margin-left:var(--navw);padding-bottom:0}
  .content{padding:22px;max-width:920px}
}

/* ===== ダッシュボード ===== */
.section-label{font-size:12px;color:var(--muted);margin:6px 2px 8px}
.cards{display:grid;grid-template-columns:1fr;gap:12px;margin-bottom:22px}
.card-box{background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px}
.card-box h3{margin:0 0 8px;font-size:15px}
.card-box .muted{color:var(--muted);font-size:14px}
.stat{display:flex;gap:18px;margin-top:4px}
.stat .n{font-size:26px;font-weight:bold;color:var(--brand)}
.stat .l{font-size:12px;color:var(--muted)}
.tiles{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.tile{display:flex;flex-direction:column;align-items:flex-start;gap:8px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px;text-decoration:none;color:var(--ink)}
.tile i{font-size:26px;color:var(--brand)}
.tile .t{font-weight:bold}
.tile .s{font-size:12px;color:var(--muted)}
.tile.primary{background:var(--brand);color:#fff;border-color:var(--brand)}
.tile.primary i,.tile.primary .s{color:#fff}
@media (min-width:768px){ .cards{grid-template-columns:1fr 1fr} .tiles{grid-template-columns:repeat(4,1fr)} }

/* ===== チャット ===== */
.main.is-chat{padding-bottom:0;min-height:0;height:100vh;height:100dvh}
.chatwrap{display:flex;flex-direction:column;height:calc(100vh - var(--navh));height:calc(100dvh - var(--navh))}
@media (min-width:768px){ .chatwrap{height:100vh;height:100dvh} }
.bar{background:var(--brand);color:#fff;padding:12px 16px;display:flex;justify-content:space-between;align-items:center;flex:0 0 auto}
.bar.teacher{background:var(--brand-d)}
.bar a{color:#fff;font-size:13px;text-decoration:none}
.bar .back{margin-right:auto}
.messages{flex:1 1 auto;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:8px;background:var(--bg)}
.msg{display:flex}
.msg.mine{justify-content:flex-end}
.msg.other{justify-content:flex-start}
.bubble{max-width:76%;padding:9px 12px;border-radius:14px;font-size:15px;line-height:1.5;word-break:break-word;box-shadow:0 1px 1px rgba(0,0,0,.06)}
.msg.mine .bubble{background:var(--brand);color:#fff;border-bottom-right-radius:4px}
.msg.other .bubble{background:#fff;border:1px solid var(--line);border-bottom-left-radius:4px}
.bubble .text{white-space:pre-wrap}
.bubble .photo{display:block;max-width:230px;width:100%;border-radius:10px;margin-top:2px}
.bubble .time{font-size:11px;opacity:.7;margin-top:4px;text-align:right}
.composer{flex:0 0 auto;display:flex;align-items:flex-end;gap:8px;padding:8px;background:#fff;border-top:1px solid var(--line)}
.composer textarea{flex:1 1 auto;resize:none;max-height:120px;padding:10px;border:1px solid #ccc;border-radius:18px;font-size:16px;font-family:inherit}
.composer button{flex:0 0 auto;padding:10px 16px;border:0;border-radius:18px;background:var(--brand);color:#fff;font-weight:bold;cursor:pointer}
.composer .clip{flex:0 0 auto;width:40px;height:40px;border-radius:50%;background:#f0f0f0;display:flex;align-items:center;justify-content:center;font-size:22px;color:#666;cursor:pointer}
.composer .clip.has-file{background:var(--brand);color:#fff}
.composer-err{margin:0 8px}

/* ===== 講師：受講生一覧 ===== */
.list{padding:8px}
.list a{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:14px;background:#fff;border:1px solid var(--line);border-radius:10px;margin-bottom:8px;text-decoration:none;color:var(--ink)}
.list .name{font-weight:bold}
.list .sub{font-size:12px;color:var(--muted)}
.empty{padding:24px;color:var(--muted);text-align:center}
