:root {
  --ink: #3b3b40;
  --sub: #85858f;
  --line: #e6e6ec;
  --card: #fff;
  --tile: #f3f4f7;
  --blue: #2f7be0;
  --green: #2fa36b;
  --amber: #d98a1c;
  --shadow: 0 2px 14px rgba(70, 70, 110, .09);
  --r: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { display: flow-root; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #ccd4e3 0%, #d9d9e5 42%, #ead9d4 78%, #f0d6c8 100%) fixed;
  min-height: 100vh;
  -webkit-user-select: none; user-select: none;
  letter-spacing: .02em;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, select { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }

/* ---------- ホーム ---------- */
.home { max-width: 1180px; margin: 0 auto; padding: 6vh 32px 24px; }
a.tile { color: inherit; text-decoration: none; }
.lead { text-align: center; font-weight: 500; font-size: clamp(20px, 2.4vw, 30px); line-height: 1.75; margin: 0 0 4vh; }
.tile {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 12px;
  transition: transform .12s, box-shadow .12s;
}
.tile:active { transform: scale(.98); box-shadow: 0 1px 6px rgba(70, 70, 110, .12); }
.tile svg { width: 46px; height: 46px; stroke: #4a4a52; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.tile b { font-size: 19px; font-weight: 600; letter-spacing: .08em; text-align: center; }
.tile small { color: var(--sub); font-size: 13px; letter-spacing: .1em; }

/* 見出し（教職員／ご用件） */
.sec { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 4px 12px; }
.sec b { font-size: 19px; font-weight: 600; letter-spacing: .08em; }
.sec i { font-style: normal; font-size: 11px; letter-spacing: .32em; color: rgba(40, 40, 50, .6); }
.sec small { color: var(--green); font-size: 13px; font-weight: 600; }
.sec span { margin-left: auto; color: rgba(40, 40, 50, .8); font-size: 12px; }

/* 使い方の切り替え：.k＝iPad だけ、.v＝閲覧（学生のスマホ・PC）だけ */
body.view .k, body:not(.view) .v { display: none !important; }

/* 顔写真（なければ頭文字の丸） */
.av { flex: none; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; font-weight: 600; font-size: 22px; -webkit-touch-callout: none; pointer-events: none; }

/* 教職員：上に一列。右へスライド＝在室・左へ＝不在、タップ＝コメント。不在は半透明、在室は白＋緑 */
.st-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 3vh; }
/* どのカードも写真と名前は上端にそろえる（コメントの有無で位置がずれないように） */
.st {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 12px; padding: 16px;
  background: rgba(255, 255, 255, .5); border-radius: var(--r); box-shadow: var(--shadow); border: 1.5px solid transparent;
  touch-action: pan-y; -webkit-touch-callout: none; cursor: pointer; transition: transform .2s, background .2s;
}
.st[style*="translate"] { transition: background .2s; }
.st.on { background: #ddf3e6; border-color: rgba(47, 163, 107, .6); } /* 在室は緑のカード */
.st > .nm { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.st b { font-size: 19px; font-weight: 600; }
.st em { font-style: normal; font-size: 12px; font-weight: 600; letter-spacing: .1em; padding: 2px 10px; border-radius: 10px; align-self: flex-start; background: rgba(0, 0, 0, .06); color: var(--sub); }
.st.on em { background: var(--green); color: #fff; }
.st:not(.on) .av { filter: grayscale(.6); opacity: .8; }
.st[data-hint=in] { background: #e6f5ec; }
.st[data-hint=out] { background: #ececf0; }
.st[data-hint]::after { position: absolute; top: 10px; right: 14px; font-size: 12px; font-weight: 600; letter-spacing: .1em; }
.st[data-hint=in]::after { content: "在室にする"; color: var(--green); }
.st[data-hint=out]::after { content: "不在にする"; color: var(--sub); }
.st-row .empty, .sd-row .empty { padding: 10px 4px; color: rgba(40, 40, 50, .7); }

/* 在室中の学生：小さく並べる */
.sd-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 3vh; }
.sd { cursor: pointer; display: inline-flex; align-items: center; gap: 9px; padding: 5px 18px 5px 5px; background: #fff; border-radius: 30px; box-shadow: var(--shadow); }
.sd:active { transform: scale(.97); }
body.view .sd { cursor: default; transform: none; }
.sd .av { width: 34px; height: 34px; font-size: 14px; }
.sd b { font-size: 14px; font-weight: 600; }
.sd small { font-size: 11px; color: var(--sub); }

/* 機材の貸し出し状況（閲覧用） */
.eq-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.eq { background: rgba(255, 255, 255, .7); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.eq b { font-size: 15px; font-weight: 600; }
.eq small { font-size: 12px; color: var(--green); }
.eq.out { background: #fbf4ea; }
.eq.out small { color: var(--amber); }

/* 小さいボタン（スマホの機材編集・コメント欄） */
.sbtn { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 18px; font-size: 14px; border: 1px solid var(--line); background: #fff; white-space: nowrap; cursor: pointer; }
.sbtn.pri { background: var(--blue); border-color: var(--blue); color: #fff; }
.sec .sbtn { margin-left: auto; height: 32px; font-size: 13px; }
.msg { color: var(--sub); font-size: 13px; }
.foot-link { text-align: center; margin: 2vh 0 0; }
.foot-link a { color: rgba(40, 40, 50, .75); font-size: 13px; }

/* 教職員の共有画像：カード内の小さな見本と、大きく表示する画面 */
.sh { flex: none; width: 64px; height: 46px; border-radius: 6px; overflow: hidden; background: #e4e5ea; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.sh img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.done > .viewer { width: min(900px, 94vw); padding: 20px 20px 18px; }
.viewer img { display: block; max-width: 100%; max-height: 68vh; margin: 0 auto 12px; border-radius: 10px; }
.viewer h2 { font-size: 18px; margin: 0; }

/* 教職員のスマホ：自分のコメント欄 */
.mine { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 3vh; }
.mine-h { display: flex; align-items: center; gap: 12px; }
.mine-h .av { width: 48px; height: 48px; font-size: 18px; }
.mine-h > div { display: flex; flex-direction: column; gap: 2px; }
.mine-h b { font-size: 17px; }
.mine-h small { font-size: 12px; color: var(--sub); }
.mine .chips { justify-content: flex-start; margin: 14px 0 10px; }
.mine textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; resize: vertical; -webkit-user-select: text; user-select: text; }
.mine-img img { display: block; max-width: 100%; max-height: 240px; border-radius: 10px; margin-top: 10px; }
.mine-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mine-row .btn { flex: 0 0 120px; margin-left: auto; }

/* 機材の登録・編集（スマホ・PC） */
.eqe { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--tile); border-radius: 10px; padding: 10px; }
.eqe input:not([type=checkbox]) { flex: 1 1 160px; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 15px; background: #fff; }
.eqe label { font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }

/* スマホ：借りる／返す（QR 読み取り）と、出勤時のお知らせ */
.borrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 3vh; }
.borrow .tile { height: 110px; }
.borrow .tile svg { width: 38px; height: 38px; }
.borrow .msg { grid-column: 1 / -1; margin: 0; color: rgba(40, 40, 50, .8); }
.eq { flex-direction: row !important; align-items: center; justify-content: space-between; }
.eq > div { display: flex; flex-direction: column; gap: 4px; }
.scan { position: fixed; inset: 0; z-index: 30; background: #111; color: #fff; display: flex; flex-direction: column; transition: box-shadow .2s; }
.scan.hit { box-shadow: inset 0 0 0 8px var(--green); }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-top { position: relative; padding: 16px; text-align: center; background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
.scan-top p { margin: 10px 0 0; font-size: 14px; }
.seg { display: inline-flex; background: rgba(255, 255, 255, .2); border-radius: 22px; padding: 3px; }
.seg button { color: #fff; padding: 8px 26px; border-radius: 19px; font-size: 15px; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; }
.shot { position: relative; margin: auto 16px 0; background: #fff; color: var(--ink); border-radius: 14px; padding: 16px; text-align: center; }
.shot p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.shot .row { display: flex; gap: 10px; }
.shot .btn { height: 48px; }
.scan-log { position: relative; list-style: none; margin: auto 0 0; padding: 0 16px; max-height: 32vh; overflow: auto; }
.shot:not([hidden]) + .scan-log { margin-top: 10px; }
.scan-log li { background: rgba(255, 255, 255, .9); color: var(--ink); border-radius: 10px; padding: 9px 12px; margin-top: 6px; font-size: 14px; border-left: 5px solid var(--green); }
.scan-log li.ng { border-left-color: #d0563b; }
.scan .scan-end { flex: 1; height: 50px; }
.done > .wide { width: min(560px, 92vw); }
.notice { text-align: left; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; max-height: 40vh; overflow: auto; }
.notice h3 { font-size: 13px; color: var(--sub); font-weight: 500; letter-spacing: .1em; margin: 0 0 8px; }
.nt { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.nt .av { width: 40px; height: 40px; font-size: 15px; }
.nt > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nt b { font-size: 14px; } .nt span { font-size: 14px; line-height: 1.5; }

/* iPad（アプリ）：ホーム画面は画面ぴったり。ページはスクロール・引っぱりで動かさず、学生の一覧と操作パネルの中だけ動く */
html.kiosk, html.kiosk body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.kiosk .home { height: 100dvh; display: flex; flex-direction: column; padding-top: max(4vh, env(safe-area-inset-top)); padding-bottom: max(2vh, env(safe-area-inset-bottom)); }
html.kiosk .top { flex: none; margin-bottom: 3vh; }
html.kiosk .home > .sec, html.kiosk .st-row, html.kiosk .clock { flex: none; }
html.kiosk .home > .sec { margin-bottom: 1.2vh; }
html.kiosk .st-row { margin-bottom: 2.2vh; }
html.kiosk .sd-row { flex: 1 1 0; min-height: 46px; overflow-y: auto; align-content: flex-start; margin-bottom: 1.6vh; }
/* 下のカード（チェックイン・機材）は画面が低いほど縦を小さくして、上の表示を優先する。低い画面では中身を横並びにする */
html.kiosk .cards { flex: none; height: clamp(68px, 15vh, 200px); }
@media (max-height: 900px) {
  html.kiosk .cards .tile { flex-direction: row; gap: 14px; }
  html.kiosk .cards .tile svg { width: 34px; height: 34px; }
  html.kiosk .cards .tile i { margin: 0; }
}
html.kiosk .clock { margin-top: 1.4vh; }
html.kiosk .panel { height: calc(100dvh - 8vh); overflow-y: auto; overscroll-behavior: contain; }

/* iPad：持ち出し中の機材（ホーム）、機材の画面の「返す」と予備の一覧、カメラの切り替え */
.eo-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2.5vh; }
.eo { cursor: pointer; display: inline-flex; align-items: baseline; gap: 8px; padding: 7px 14px; background: #fbf4ea; border-radius: 20px; box-shadow: var(--shadow); border: 1px solid rgba(217, 138, 28, .25); }
.eo b { font-size: 14px; font-weight: 600; } .eo small { font-size: 12px; color: var(--amber); }
.eo:active, .eq[data-out]:active { transform: scale(.97); }
.eq[data-out] { cursor: pointer; }
.eo-row .empty { padding: 4px; color: rgba(40, 40, 50, .7); }
html.kiosk .eo-row { flex: none; max-height: 12vh; overflow: hidden; margin-bottom: 2vh; }
.opt.ret { grid-column: 1 / -1; min-height: 80px; background: #eaf2fd; border-color: rgba(47, 123, 224, .35); }
.opt.ret::before { display: none; }
.opt.ret b { font-size: 20px; color: var(--blue); }
.scan-bar { position: relative; flex: none; display: flex; gap: 10px; margin: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.flip { flex: none; height: 50px; padding: 0 18px; border-radius: 25px; color: #fff; background: rgba(255, 255, 255, .22); font-size: 14px; }
.scan video.mirror { transform: scaleX(-1); }

/* iPad のコメント画面の画像欄 */
.cm-img { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cm-img #cimg { flex: 1 1 100%; }
.cm-img #cimg img { display: block; max-width: 100%; max-height: 140px; border-radius: 8px; margin: 0 auto; }

/* 教職員カード内のコメント欄（画像の有無で高さが変わらないよう、見本 46px が入る高さにそろえる） */
.st .cm { flex-basis: 100%; display: flex; align-items: center; gap: 10px; min-height: 58px; margin: 0; font-size: 13px; line-height: 1.5;
  background: rgba(255, 255, 255, .75); border-radius: 8px; padding: 6px 10px; overflow-wrap: anywhere; }
.st.on .cm { background: var(--tile); }
.st .cm span { flex: 1; text-align: left; }

/* Teams ボタンとメンバー一覧（スマホ・PC） */
.teams { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 6px 12px; border-radius: 16px; background: #5b5fc7; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; flex: none; }
.teams svg { width: 15px; height: 15px; fill: #fff; }
.members { display: grid; gap: 8px; margin-bottom: 3vh; }
.members h3 { margin: 10px 0 0; font-size: 12px; color: rgba(40, 40, 50, .7); font-weight: 500; letter-spacing: .12em; }
.mb { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .75); border-radius: 12px; padding: 8px 10px; }
.mb .av { width: 36px; height: 36px; font-size: 14px; }
.mb b { font-size: 15px; font-weight: 600; }
.mb em { font-style: normal; font-size: 11px; color: var(--green); background: rgba(47, 163, 107, .12); padding: 1px 8px; border-radius: 9px; }
.mb small { margin-left: auto; font-size: 12px; color: var(--sub); }

/* 研究室のロゴ（ホームの左上。元の画像の大きさ＝高さ 36px、スマホは少し小さく） */
/* あいさつ文と同じ段に、左にロゴ・中央に文。両側の列を同じ幅にして文を画面の真ん中に保つ。ロゴは文の上下中央にそろえる */
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 16px; margin-bottom: 4vh; }
.top .brand { grid-column: 1; justify-self: start; }
.top .lead { grid-column: 2; margin: 0; }
.logo { display: block; height: 36px; width: auto; }
@media (max-width: 700px) { .logo { height: 28px; } .top { margin-bottom: 24px; } }

/* ご用件：カードを横に並べる */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; height: clamp(150px, 24vh, 240px); }
.clock { text-align: center; color: rgba(60, 60, 70, .65); margin-top: 3vh; font-size: 14px; letter-spacing: .14em; }

/* コメント入力 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 12px; }
.chip { padding: 9px 14px; border-radius: 18px; background: var(--tile); font-size: 14px; }
.chip:active { background: #e3e5ea; }
.done input { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; font-size: 16px; }

/* 教職員カード：授業中（在室していない間）は黄色 */
.st.cls { background: #fffbea; border-color: rgba(222, 170, 20, .45); }
.st.cls em { background: #fff0bf; color: #8a6200; }
.st.cls .av { filter: none; opacity: 1; }

/* iPad：中段を2列に。左＝在室中の学生・授業中、右＝今日の予定（中だけスクロール） */
.mid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.mid .col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
html.kiosk .mid { flex: 1 1 0; min-height: 0; margin-bottom: 1.6vh; }
html.kiosk .mid .sec { flex: none; margin-bottom: 1.2vh; }
html.kiosk .cl-row { flex: 0 1 auto; max-height: 40%; min-height: 40px; overflow-y: auto; align-content: flex-start; margin-bottom: 0; }
html.kiosk .sc-list { flex: 1 1 0; min-height: 0; overflow-y: auto; align-content: start; margin-bottom: 0; }

/* 授業中：黄色のカード（教職員・学生） */
.cl-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 3vh; }
.cl { display: inline-flex; align-items: center; gap: 9px; padding: 5px 16px 5px 5px; background: #fff4c7; border: 1px solid rgba(222, 170, 20, .45); border-radius: 30px; box-shadow: var(--shadow); }
.cl .av { width: 34px; height: 34px; font-size: 14px; }
.cl b { font-size: 14px; font-weight: 600; }
.cl small { font-size: 11px; color: #8a6200; }
.cl-row .empty, .sc-list .empty { padding: 6px 4px; color: rgba(40, 40, 50, .7); }

/* 今日の予定：教員の予定のある時間（件名は出さない）と、教職員のメモ・画像 */
.sc-list { display: grid; gap: 8px; margin-bottom: 3vh; }
.sc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(255, 255, 255, .78); border-radius: 12px; box-shadow: var(--shadow); border-left: 4px solid transparent; cursor: pointer; }
.sc.now { border-left-color: var(--amber); background: #fff8ee; }
.sc .av { width: 38px; height: 38px; font-size: 15px; }
.sc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sc-t b { font-size: 14px; font-weight: 600; }
.sc-t .when { font-size: 13px; }
.sc.now .when { color: #b4691a; font-weight: 600; }
.sc-t .memo { font-size: 13px; color: var(--sub); overflow-wrap: anywhere; }
.sc-t .memo::before { content: "メモ"; font-size: 10px; color: #fff; background: #9a9aa6; border-radius: 4px; padding: 0 5px; margin-right: 6px; vertical-align: 1px; }
.sc .sh { width: 56px; height: 40px; }
body.view .sc { cursor: default; }

/* ---------- 本人の端末（スマホ・PC）：ホーム／機材一覧／メンバー／私 ---------- */
.app { max-width: 760px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 18px 40px; }
.me-top { margin: 4px 4px 18px; }
.me-top .logo { height: 28px; }
.me-top h1 { margin: 16px 0 0; font-size: 22px; font-weight: 600; line-height: 1.5; letter-spacing: .04em; }
.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); z-index: 5; }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; font-size: 11px; color: #6b6b75; }
.tabbar svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.on { color: var(--blue); font-weight: 600; }
.me-av { display: grid; width: 26px; height: 26px; border-radius: 50%; }
.me-av .av { width: 100%; height: 100%; font-size: 11px; }
.tabbar button.on .me-av { box-shadow: 0 0 0 2px var(--blue); }
@media (max-width: 699px) {
  .app { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
}
@media (min-width: 700px) {
  .tabbar { position: sticky; top: 12px; width: fit-content; margin: 0 auto 22px; gap: 4px; padding: 5px; border-radius: 28px; background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); }
  .tabbar button { flex-direction: row; gap: 7px; padding: 8px 18px; border-radius: 22px; font-size: 14px; }
  .tabbar button.on { background: #eaf2fd; }
  .tabbar svg { width: 20px; height: 20px; }
  .me-av { width: 22px; height: 22px; }
}

/* 未登録のお知らせ（赤い小さなポップアップ。押すと「私」のその項目へ） */
.todos { display: grid; gap: 8px; margin-bottom: 16px; }
.todos:empty { display: none; }
.todo { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 10px 14px; border-radius: 12px; font-size: 13px;
  background: #fdecec; color: #b42318; border: 1px solid rgba(208, 56, 40, .25); box-shadow: 0 2px 8px rgba(180, 35, 24, .08); }
.todo::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; }
.todo b { margin-left: auto; white-space: nowrap; font-weight: 600; }
.todo:active { transform: scale(.99); }

/* 機材一覧（ペン＝編集、ゴミ箱＝一覧から外す、＋＝追加） */
.tools { display: flex; align-items: center; gap: 10px; margin: 0 4px 12px; }
.tools .sp { flex: 1; }
.add { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); box-shadow: 0 4px 14px rgba(47, 123, 224, .35); }
.add svg { width: 24px; height: 24px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.eq-list { display: grid; gap: 8px; }
.eq-list .eq { gap: 8px; }
.eq-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.eq-t .note { font-size: 12px; color: var(--sub); }
.ic { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.ic:active { background: var(--tile); }
.ic svg { width: 20px; height: 20px; stroke: #5a5a64; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic.del svg { stroke: #c0392b; }

/* メンバー */
.mb-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.mb em.cls { color: #8a6200; background: #fff0bf; }

/* 私：プロフィール・時間割・予定表・メモ */
.box { position: relative; display: block; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; scroll-margin-top: 80px; }
.box h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; letter-spacing: .06em; }
.box .msg { margin: 0 0 10px; line-height: 1.7; }
.box .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.box .row .msg { flex: 1 1 180px; margin: 0; }
.box .row .btn { flex: 0 0 120px; }
.box input:not([type=file]):not([type=checkbox]) { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 16px; background: #fff; }
.box label { display: block; font-size: 12px; color: var(--sub); }
.box label input { margin-top: 4px; color: var(--ink); }
.box.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px #e5484d; } 100% { box-shadow: var(--shadow); } }
.prof { display: flex; gap: 16px; align-items: flex-start; }
.prof .pick { position: relative; flex: none; cursor: pointer; }
.prof .pick .av { width: 84px; height: 84px; font-size: 30px; }
.prof .badge { position: absolute; right: -4px; bottom: 0; background: var(--blue); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 10px; }
.pf-in { flex: 1; display: grid; gap: 10px; min-width: 0; }
.box .grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.box .grades button { height: 40px; border-radius: 10px; background: var(--tile); border: 1.5px solid transparent; font-size: 14px; }
.box .grades button.on { background: #eaf2fd; border-color: var(--blue); color: var(--blue); font-weight: 600; }
.tt { display: grid; grid-template-columns: 52px repeat(6, 1fr); gap: 4px; margin-top: 6px; }
.tt > b { text-align: center; font-size: 13px; font-weight: 600; padding: 4px 0; }
.tt > i { font-style: normal; font-size: 13px; font-weight: 600; display: flex; flex-direction: column; justify-content: center; }
.tt > i small { font-size: 9.5px; font-weight: 400; color: var(--sub); line-height: 1.3; }
.tt .c { height: 46px; border-radius: 8px; background: var(--tile); border: 1.5px solid transparent; }
.tt .c.on { background: #fff0bf; border-color: rgba(222, 170, 20, .6); }
.tt .c.on::after { content: "授業"; font-size: 12px; font-weight: 600; color: #8a6200; }
.tt .c.uni { display: grid; place-items: center; background: #fff7d6; border: 1.5px dashed rgba(222, 170, 20, .6); font-size: 11px; color: #8a6200; }
.tt > em { grid-column: 1 / -1; font-style: normal; text-align: center; font-size: 11px; color: var(--sub); background: rgba(0, 0, 0, .03); border-radius: 6px; padding: 3px 0; }
.ok-line { color: var(--green); font-weight: 600; margin: 0 0 6px; }
.box details { margin-top: 14px; font-size: 13px; line-height: 1.7; }
.box summary { cursor: pointer; color: var(--blue); }
.box ol { margin: 4px 0 10px; padding-left: 20px; }
.sbtn.del { color: #c0392b; }
.box.link { color: var(--ink); text-decoration: none; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.box.link::after { content: "›"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--sub); }
.box.link span { font-size: 12px; font-weight: 400; color: var(--sub); }
.box.mine .chips { margin-top: 4px; }

/* Google でログイン・連携 */
.or { display: flex; align-items: center; gap: 10px; color: var(--sub); font-size: 12px; margin: 10px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gbtn { width: 100%; height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #dadce0; border-radius: 23px; background: #fff; font-size: 15px; font-weight: 600; color: #3c4043; }
.gbtn svg, .grow svg { width: 20px; height: 20px; flex: none; }
.gerr { color: #b42318; background: #fdecec; border-radius: 10px; padding: 8px 12px; font-size: 13px; text-align: left; }
.grow { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.grow .msg { flex: 1; margin: 0; }

.btn.setup { display: grid; place-items: center; text-decoration: none; margin-top: 14px; background: linear-gradient(90deg, #2fa36b, #5cc28f); }
#setup .msg { font-size: 12px; margin: 6px 0 0; }

/* ログイン（登録されていない端末）：ログイン用 QR と、初めての人・受付 iPad の案内 */
.gate.login .logo { height: 28px; margin: 0 auto 14px; }
.lqr { width: 220px; height: 220px; margin: 6px auto 4px; background: #f4f5f8; border-radius: 12px; }
.lqr svg { display: block; width: 100%; height: 100%; }
.gate details { text-align: left; margin-top: 12px; font-size: 14px; color: var(--sub); }
.gate summary { cursor: pointer; color: var(--blue); }
.gate details p { margin: 8px 0 0; }
.gate .pw input { margin: 10px 0; }
.gate .pw .btn { width: 100%; }

/* 新しい端末の承認（管理者）：受付 iPad として登録／自分の端末として追加／やめる */
.done .choice { display: grid; gap: 10px; margin-top: 22px; }

/* 機材の追加・編集の小さな画面 */
.done .form { text-align: left; }
.done .form h2 { margin: 0 0 14px; font-size: 20px; }
.done .form label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 12px; }
.done .form input { margin-top: 4px; color: var(--ink); }
.done .form .err { color: #c0392b; min-height: 1.2em; margin: 0; font-size: 13px; }
.done .form .row { margin-top: 10px; }

/* ---------- 操作パネル（スクショの「白いカード」） ---------- */
.panel {
  max-width: 1080px; margin: 4vh auto; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 26px 34px 36px; display: grid; grid-template-columns: 260px 1fr; gap: 10px 40px; min-height: 70vh; align-content: start;
}
.back {
  grid-column: 1 / -1; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}
.back svg { width: 20px; height: 20px; stroke: #666; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side h2 { font-size: 22px; font-weight: 600; margin: 22px 0 12px; line-height: 1.5; }
.side p { color: var(--sub); font-size: 14px; line-height: 1.8; margin: 0; white-space: pre-line; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; align-content: start; margin-top: 22px; }
.grid h3 { grid-column: 1 / -1; margin: 10px 0 0; font-size: 12px; color: var(--sub); font-weight: 500; letter-spacing: .12em; }
.opt {
  position: relative; background: var(--tile); border-radius: 10px; min-height: 96px; padding: 18px 10px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border: 1.5px solid transparent; transition: transform .1s, background .1s;
}
.opt:active { transform: scale(.97); background: #e9ebf0; }
.opt .av { width: 44px; height: 44px; font-size: 17px; }
.opt b { font-size: 16px; font-weight: 600; word-break: keep-all; overflow-wrap: anywhere; }
.opt small { font-size: 12px; color: var(--sub); line-height: 1.4; }
.opt::before {
  content: ""; position: absolute; top: 10px; left: 10px; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid #c9cad2; background: #fff;
}
.opt.on { border-color: rgba(47, 163, 107, .35); background: #eef7f1; }
.opt.on::before { background: var(--green); border-color: var(--green); }
.opt.out { border-color: rgba(217, 138, 28, .3); background: #fbf4ea; }
.opt.out::before { background: var(--amber); border-color: var(--amber); }
.opt.plain::before { display: none; }
.empty { grid-column: 1 / -1; color: var(--sub); font-size: 14px; padding: 20px 0; }

/* ---------- 完了表示 ---------- */
.done { position: fixed; inset: 0; background: rgba(60, 60, 80, .18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 10; }
.done > div { background: #fff; border-radius: 18px; box-shadow: 0 10px 40px rgba(60, 60, 90, .18); width: min(440px, 90vw); padding: 36px 32px 26px; text-align: center; position: relative; overflow: hidden; }
.done svg { width: 64px; height: 64px; stroke: var(--green); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.done h2 { margin: 12px 0 4px; font-size: 24px; font-weight: 600; letter-spacing: .08em; }
.done p { margin: 0; color: var(--sub); font-size: 15px; line-height: 1.7; }
.done .row { display: flex; gap: 12px; margin-top: 26px; }
.done .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--blue); width: 100%; transform-origin: left; }
.btn {
  flex: 1; height: 48px; border-radius: 24px; color: #fff; font-weight: 600; letter-spacing: .1em;
  background: linear-gradient(90deg, #2f7be0, #6ea8e6);
}
.btn.ghost { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.btn:disabled { opacity: .5; }

/* ---------- 合言葉入力 ---------- */
.gate { max-width: 420px; margin: 18vh auto; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 32px; text-align: center; }
.gate h2 { font-weight: 600; font-size: 20px; margin: 0 0 10px; }
.gate p { color: var(--sub); font-size: 14px; line-height: 1.7; }
.gate input { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; margin: 14px 0; font-size: 16px; }

/* ---------- スマホ ---------- */
@media (max-width: 700px) {
  .home { padding: 28px 16px; }
  .lead { font-size: 17px; margin-bottom: 24px; }
  .st-row { grid-template-columns: 1fr; gap: 10px; }
  .st { padding: 12px; } .st .av { width: 46px; height: 46px; font-size: 18px; }
  .sec span { margin-left: 0; width: 100%; }
  .cards { height: auto; grid-auto-rows: 140px; gap: 14px; }
  .tile svg { width: 36px; height: 36px; } .tile b { font-size: 16px; }
  .panel { grid-template-columns: 1fr; margin: 0; border-radius: 0; min-height: 100vh; padding: 18px 16px 28px; }
  .side h2 { margin-top: 12px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
#me-memo .mine-img img { max-height: 140px; }
#me-dev .row.dev .btn { flex: 1 1 auto; }
#me-dev #dev-msg:empty { display: none; }

/* ステータスの絵文字（在室中だけ）：カードの右上 */
.emo { position: absolute; top: -9px; right: -7px; font-size: 26px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .18)); pointer-events: none; }
.sd { position: relative; }
.sd .emo { font-size: 19px; top: -8px; right: -6px; }
.mb-t .emo { position: static; font-size: 18px; filter: none; }
.emo-bar { display: flex; gap: 8px; margin: -6px 0 18px; }
.emo-bar button { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .8); font-size: 24px; box-shadow: var(--shadow); border: 2px solid transparent; }
.emo-bar button.on { border-color: var(--blue); background: #fff; }

/* 私：自分のカードとボタン（各機能は別ページ） */
.me-card { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; position: relative; }
.me-card .av { width: 64px; height: 64px; font-size: 24px; }
.me-card > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.me-card b { font-size: 18px; }
.me-card small { color: var(--sub); font-size: 13px; }
.me-card .emo { position: static; font-size: 30px; filter: none; }
.chev { width: 18px; height: 18px; flex: none; stroke: #9a9aa6; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu { padding: 4px 0; }
.menu > button, .menu > a { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; font-size: 16px; color: var(--ink); text-decoration: none; text-align: left; }
.menu > * + * { border-top: 1px solid var(--line); }
.back-link { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 12px; font-size: 15px; color: var(--blue); }
.back-link svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* プロフィール：ステータスの絵文字（お気に入り5つ・候補） */
.emo-fav { display: flex; gap: 10px; margin-bottom: 14px; }
.ef { position: relative; width: 52px; height: 52px; border-radius: 50%; background: var(--tile); display: grid; place-items: center; border: 2px solid transparent; }
.ef.on { border-color: var(--blue); background: #eaf2fd; }
.ef.empty { border: 2px dashed var(--line); background: none; }
.ef > button:first-child { font-size: 26px; width: 100%; height: 100%; }
.ef .x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); font-size: 13px; line-height: 20px; color: var(--sub); }
.emo-pal { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; }
.emo-pal button { height: 42px; font-size: 24px; border-radius: 10px; }
.emo-pal button:active { background: var(--tile); }
.emo-pal button:disabled { opacity: .3; }
#me-emo .row input { flex: 1; }
.ef.more { font-size: 22px; color: var(--sub); background: none; border: 2px dashed var(--line); }
.ef.more.on { border-style: solid; border-color: var(--blue); color: var(--blue); }
#me-emo .emo-fav { margin-bottom: 0; flex-wrap: wrap; }
#me-emo .emo-pal { margin-top: 14px; }
#me-emo .emo-fav { gap: 8px; flex-wrap: nowrap; }
#me-emo .ef { width: 46px; height: 46px; }
#me-emo .ef > button:first-child { font-size: 23px; }
