@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  --bg: #08090a;
  --bg-2: #0d0f0e;
  --surface: #111412;
  --surface-2: #171b19;
  --surface-3: #1e2320;
  --line: rgba(255, 255, 255, .065);
  --line-2: rgba(255, 255, 255, .11);
  --text: #f4f6f5;
  --muted: #9aa39e;
  --faint: #626b66;
  --accent: #10b981;
  --accent-hi: #34d399;
  --accent-soft: rgba(16, 185, 129, .12);
  --accent-line: rgba(52, 211, 153, .28);
  --on-accent: #03140d;
  --holiday: #fb7185;
  --event: #60a5fa;
  --exam: #fbbf24;
  --note: #a1a1aa;
  --danger: #f87171;
  --r: 14px;
  --r-sm: 9px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Inter', 'Noto Sans JP', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01';
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 500px at 12% -8%, rgba(16, 185, 129, .10), transparent 60%),
              radial-gradient(700px 400px at 100% 0%, rgba(96, 165, 250, .05), transparent 60%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(16, 185, 129, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232825; border-radius: 10px; border: 3px solid var(--bg); }
.i { flex: none; display: block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
[hidden] { display: none !important; }

/* ===== ボタン・入力 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2);
  font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, .16); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hi); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-block { width: 100%; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--bg-2); outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 84px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.seg button { height: 28px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 1px 2px rgba(0, 0, 0, .4); }
.seg a { height: 28px; padding: 0 14px; border-radius: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; }
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 1px 2px rgba(0, 0, 0, .4); }

.tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.tag.green { background: var(--accent-soft); color: var(--accent-hi); }
.tag.red { background: rgba(251, 113, 133, .12); color: var(--holiday); }
.tag.amber { background: rgba(251, 191, 36, .12); color: var(--exam); }
.tag.blue { background: rgba(96, 165, 250, .12); color: var(--event); }

.av {
  --c: var(--accent); width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent);
}
.av.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11.5px; }
.av.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.av.group { color: var(--muted); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ===== 認証 ===== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; position: relative; z-index: 1; }
.auth-hero { padding: 56px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); position: relative; overflow: hidden; }
.auth-hero::after {
  content: ''; position: absolute; width: 620px; height: 620px; right: -220px; bottom: -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, .22), transparent 65%); filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(145deg, #34d399, #059669); display: grid; place-items: center; color: var(--on-accent); box-shadow: 0 6px 20px -6px rgba(16, 185, 129, .7); }
.brand-mark svg { width: 17px; height: 17px; }
.brand small { color: var(--faint); font-weight: 500; margin-left: 2px; }
.auth-copy h1 { font-size: 46px; line-height: 1.12; letter-spacing: -.035em; margin: 0 0 18px; font-weight: 700; }
.auth-copy h1 em { font-style: normal; background: linear-gradient(90deg, #6ee7b7, #10b981 60%, #60a5fa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-copy p { color: var(--muted); font-size: 15px; max-width: 420px; margin: 0; }
.auth-points { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 12.5px; position: relative; z-index: 1; }
.auth-points span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.auth-points svg { color: var(--accent-hi); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-box { width: 100%; max-width: 360px; }
.auth-box h2 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-box > p { color: var(--muted); margin: 0 0 26px; }
.auth-alt { margin-top: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.auth-alt a { color: var(--accent-hi); font-weight: 600; }
.alert { display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 16px; border: 1px solid; }
.alert.err { color: #fecaca; background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .25); }
.alert.ok { color: #a7f3d0; background: var(--accent-soft); border-color: var(--accent-line); }

/* ===== 骨組み ===== */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: 100vh; position: relative; z-index: 1; }
.side { display: flex; flex-direction: column; padding: 18px 12px; border-right: 1px solid var(--line); background: rgba(8, 9, 10, .6); backdrop-filter: blur(12px); }
.side .brand { padding: 4px 8px 22px; }
.class-chip { margin: 0 6px 18px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); }
.class-chip small { display: block; font-size: 11px; color: var(--faint); font-weight: 600; letter-spacing: .04em; }
.class-chip b { font-size: 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-sec { font-size: 11px; font-weight: 600; color: var(--faint); padding: 14px 10px 6px; letter-spacing: .03em; }
.nav a {
  display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 9px;
  color: var(--muted); font-weight: 500; font-size: 13.5px; position: relative; transition: background .12s, color .12s;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.on { background: var(--surface-2); color: var(--text); }
.nav a.on::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a.on .i { color: var(--accent-hi); }
.nav .badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; border-top: 1px solid var(--line); }
.side-foot .who { min-width: 0; flex: 1; line-height: 1.3; }
.side-foot .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { color: var(--faint); font-size: 11.5px; }

.main { min-width: 0; overflow-y: auto; }
.page { max-width: 1180px; margin: 0 auto; padding: 34px 36px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-head .eyebrow { font-size: 12px; font-weight: 600; color: var(--accent-hi); margin-bottom: 6px; letter-spacing: .02em; }
.page-head h1 { font-size: 30px; letter-spacing: -.03em; margin: 0; line-height: 1.15; font-weight: 700; }
.page-head .actions { display: flex; gap: 8px; }

.card { background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 40%), var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-head h2 { font-size: 14.5px; margin: 0; font-weight: 700; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.card-head h2 .i { color: var(--muted); }
.card-body { padding: 14px 18px 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ===== 課題 ===== */
.celebrate {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, .16), rgba(16, 185, 129, .05)); border: 1px solid var(--accent-line);
}
.celebrate .ico { width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.celebrate b { display: block; font-size: 15px; color: #d1fae5; }
.celebrate span { font-size: 12.5px; color: #86c9ad; }
.task { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg-2); transition: border-color .15s; }
.task + .task { margin-top: 8px; }
.task:hover { border-color: var(--line-2); }
.task .chk {
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: transparent; flex: none;
  display: grid; place-items: center; color: transparent; transition: all .15s var(--ease); padding: 0;
}
.task .chk:hover { border-color: var(--accent); }
.task.done .chk { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.task.done .t-title { color: var(--faint); text-decoration: line-through; }
.task .t-main { min-width: 0; flex: 1; }
.task .t-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task .t-sub { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.due.soon { color: var(--exam); }
.due.over { color: var(--danger); }
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; width: 90px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }

/* ===== 宿題掲示板 ===== */
.av.xs { width: 18px; height: 18px; border-radius: 6px; font-size: 9.5px; margin-right: 5px; vertical-align: -4px; }
.hw { display: flex; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); transition: border-color .15s; }
.hw + .hw { margin-top: 10px; }
.hw:hover { border-color: var(--line-2); }
.hw .chk { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: transparent; flex: none; display: grid; place-items: center; color: transparent; transition: all .15s var(--ease); padding: 0; margin-top: 1px; }
.hw .chk:hover { border-color: var(--accent); }
.hw.done .chk { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.hw.done .hw-title { color: var(--faint); text-decoration: line-through; }
.hw-main { flex: 1; min-width: 0; }
.hw-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hw-title { font-size: 14px; }
.hw-detail { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.hw-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--faint); }
.hw-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.hw-meta .due { color: var(--muted); }
.hw-meta .due.soon { color: var(--exam); } .hw-meta .due.over { color: var(--danger); }
.hw-side { display: flex; align-items: flex-start; gap: 4px; flex: none; }
.trust { display: flex; gap: 6px; }
.vote { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; transition: all .15s; }
.vote b { font-weight: 700; color: var(--text); }
.vote:hover:not(:disabled) { border-color: rgba(255, 255, 255, .2); color: var(--text); }
.vote:disabled { opacity: .45; cursor: default; }
.vote.up.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hi); }
.vote.up.on b { color: var(--accent-hi); }
.vote.down.on { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .35); color: var(--exam); }
.vote.down.on b { color: var(--exam); }
.tag .i { margin-right: -1px; }
.imp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.imp-table th { text-align: left; color: var(--faint); font-weight: 600; padding: 6px; border-bottom: 1px solid var(--line); }
.imp-table td { padding: 4px; border-bottom: 1px solid var(--line); }
.imp-table input { width: 100%; height: 30px; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 0 6px; outline: none; }
.imp-table input:focus { border-color: var(--accent); background: var(--bg-2); }
.imp-table input.bad { border-color: rgba(248, 113, 113, .5); }
.imp-table .ck { width: 28px; text-align: center; }
.imp-table .ck input { width: 15px; height: 15px; accent-color: var(--accent); }

/* スクショ読み取り */
.scan-drop { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border: 1.5px dashed var(--line-2); border-radius: 14px; cursor: pointer; transition: all .15s; outline: none;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%); }
.scan-drop:hover, .scan-drop:focus-visible, .scan-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.scan-drop.off { cursor: default; opacity: .7; background: none; }
.scan-drop.off:hover { border-color: var(--line-2); background: none; }
.scan-ico { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 6px 20px -6px var(--accent); }
.scan-drop.off .scan-ico { background: var(--bg-3, var(--bg-2)); color: var(--faint); box-shadow: none; }
.scan-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.scan-txt b { font-size: 15px; }
.scan-txt span { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.scan-wait { display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.scan-wait b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.scan-wait span:not(.spin) { font-size: 12.5px; color: var(--muted); }
.spin { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.imp-alt { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.imp-alt summary { cursor: pointer; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; list-style: none; }
.imp-alt summary::-webkit-details-marker { display: none; }
.imp-alt[open] summary { color: var(--text); }
@media (max-width: 560px) { .scan-drop { padding: 16px; gap: 12px; } .scan-ico { width: 44px; height: 44px; } }
.modal.wide { max-width: 760px; }

/* ===== プリント市場 ===== */
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; transition: all .12s; }
.fchip:hover { color: var(--text); border-color: rgba(255, 255, 255, .2); }
.fchip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hi); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pcard { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform .18s var(--ease), border-color .15s, box-shadow .18s; }
.pcard:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .8); }
.pcard.want { border-color: rgba(251, 191, 36, .28); }
.pthumb { position: relative; aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
.pcard:hover .pthumb img { transform: scale(1.03); }
.pthumb-empty { height: 100%; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; color: var(--faint); font-size: 12px;
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255, 255, 255, .018) 10px 20px); }
.pcard.want .pthumb-empty { color: var(--exam); }
.pbadge { position: absolute; left: 10px; top: 10px; height: 22px; padding: 0 9px; border-radius: 7px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; backdrop-filter: blur(8px); }
.pbadge.want { background: rgba(251, 191, 36, .9); color: #2a1d02; }
.pbadge.ok { background: rgba(16, 185, 129, .9); color: var(--on-accent); }
.pbadge.share { background: rgba(8, 9, 10, .7); color: #cfe0ff; border: 1px solid rgba(255, 255, 255, .12); }
.pcount { position: absolute; right: 10px; bottom: 10px; height: 22px; padding: 0 8px; border-radius: 7px; background: rgba(8, 9, 10, .72); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.pinfo { padding: 12px 14px 14px; display: flex; flex-direction: column; align-items: flex-start; }
.pinfo b { font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pmeta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 11.5px; color: var(--faint); }
.pmeta span { display: inline-flex; align-items: center; gap: 3px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery.sm { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.gallery a { display: block; border-radius: 11px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 3 / 4; background: var(--bg-2); cursor: zoom-in; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.gallery a:hover img { transform: scale(1.04); }
.photo-previews { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-previews:not(:empty) { margin-top: 10px; }
.photo-previews .pv { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); }
.photo-previews .pv img { width: 100%; height: 100%; object-fit: cover; }
.photo-previews .pv button { position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border-radius: 6px; border: 0; background: rgba(0, 0, 0, .7); color: #fff; display: grid; place-items: center; padding: 0; }
.photo-previews .pv.busy::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.drop { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; transition: all .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hi); }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .92); display: grid; place-items: center; animation: fadeIn .15s; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, .8); }
.lightbox .lb-tools { position: fixed; top: 16px; right: 16px; display: flex; gap: 8px; }
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.kind-pick label { cursor: pointer; }
.kind-pick input { display: none; }
.kind-pick span { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2); font-size: 13px; font-weight: 700; transition: all .15s; }
.kind-pick small { font-weight: 500; color: var(--faint); font-size: 11.5px; }
.kind-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); }

/* ===== 今日の時間割 ===== */
.today-tt { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.pd { padding: 10px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); position: relative; overflow: hidden; min-height: 70px; }
.pd::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--line-2)); }
.pd small { font-size: 11px; color: var(--faint); font-weight: 600; }
.pd b { display: block; font-size: 13.5px; margin: 2px 0 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd span { font-size: 11.5px; color: var(--muted); }
.pd.now { border-color: var(--accent-line); background: var(--accent-soft); }
.pd.empty b { color: var(--faint); font-weight: 500; }
.off-day { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line-2); color: var(--muted); }

/* ===== カレンダー ===== */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; }
.cal-title { display: flex; align-items: center; gap: 10px; }
.cal-title h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; min-width: 130px; }
.cal-tools { display: flex; align-items: center; gap: 8px; }
.cal-range { font-size: 12px; color: var(--faint); padding: 0 18px 12px; margin-top: -6px; }
.month { border-top: 1px solid var(--line); }
.month-dow, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-dow div { padding: 9px 10px; font-size: 11.5px; font-weight: 600; color: var(--faint); text-align: center; border-bottom: 1px solid var(--line); }
.month-dow div.sat { color: #7aa8e8; } .month-dow div.sun { color: #e07f90; }
.day { min-height: 104px; padding: 7px 7px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.day:nth-child(7n) { border-right: 0; }
.day:hover { background: rgba(255, 255, 255, .018); }
.day.out { background: rgba(0, 0, 0, .25); }
.day.out .dn { color: var(--faint); opacity: .55; }
.day .dn { font-size: 12.5px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; margin-bottom: 1px; }
.day.sat .dn { color: #7aa8e8; } .day.sun .dn, .day.hol .dn { color: #f08a9b; }
.day.today .dn { background: var(--accent); color: var(--on-accent); }
.day.sel { background: rgba(16, 185, 129, .05); box-shadow: inset 0 0 0 1px var(--accent-line); }
.chip {
  display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; line-height: 1.5;
  background: color-mix(in srgb, var(--k) 14%, transparent); color: color-mix(in srgb, var(--k) 88%, white);
}
.chip::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--k); flex: none; }
.chip.done { opacity: .45; text-decoration: line-through; }
.more { font-size: 11px; color: var(--muted); padding-left: 6px; }
.k-holiday { --k: var(--holiday); } .k-event { --k: var(--event); } .k-exam { --k: var(--exam); } .k-note { --k: var(--note); } .k-assignment { --k: var(--accent); }

.week { border-top: 1px solid var(--line); overflow-x: auto; }
.week-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(110px, 1fr)); min-width: 820px; }
.week-grid > div { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 7px; min-width: 0; }
.week-grid > div:nth-child(8n) { border-right: 0; }
.wk-h { text-align: center; padding: 10px 6px !important; }
.wk-h small { display: block; font-size: 11px; color: var(--faint); font-weight: 600; }
.wk-h b { font-size: 18px; letter-spacing: -.02em; }
.wk-h.today b { color: var(--accent-hi); }
.wk-h.hol b, .wk-h.sun b { color: #f08a9b; } .wk-h.sat b { color: #7aa8e8; }
.wk-lbl { font-size: 11px; color: var(--faint); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.wk-all { min-height: 44px; display: flex; flex-direction: column; gap: 3px; }
.wk-cell { min-height: 58px; }
.wk-cell .pd { min-height: 0; padding: 7px 8px 7px 10px; }
.wk-cell .pd b { font-size: 12.5px; }
.wk-off { height: 100%; display: grid; place-items: center; font-size: 11px; color: var(--faint); background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .02) 6px 12px); border-radius: 8px; min-height: 44px; }

.day-panel { border-top: 1px solid var(--line); padding: 16px 18px 18px; }
.day-panel h4 { margin: 0 0 10px; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
.di { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.di + .di { margin-top: 6px; }
.di .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--k); flex: none; }
.di .grow { flex: 1; min-width: 0; }
.di .grow b { font-size: 13px; display: block; }
.di .grow small { color: var(--muted); font-size: 11.5px; }

/* ===== ポップオーバー ===== */
.pop-wrap { position: relative; }
.pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 250px; padding: 8px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .8);
  animation: popIn .16s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.pop label { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.pop label:hover { background: var(--surface-3); }
.pop input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.pop .sw { width: 8px; height: 8px; border-radius: 50%; background: var(--k); }
.search-box { position: relative; }
.search-box .i { position: absolute; left: 11px; top: 11px; color: var(--faint); }
.search-box .input { padding-left: 34px; height: 36px; }
.results { max-height: 300px; overflow-y: auto; margin-top: 6px; }
.res { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.res:hover { background: var(--surface-3); }
.res small { margin-left: auto; color: var(--faint); font-size: 11.5px; }

/* ===== チャット ===== */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 100vh; }
.chat.info-open { grid-template-columns: 300px minmax(0, 1fr) 280px; }
.c-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: rgba(13, 15, 14, .55); }
.c-list-head { padding: 22px 16px 12px; display: flex; align-items: center; justify-content: space-between; }
.c-list-head h1 { font-size: 20px; margin: 0; letter-spacing: -.02em; }
.c-filter { padding: 0 12px 10px; }
.c-rows { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.c-row { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 11px; cursor: pointer; transition: background .12s; }
.c-row:hover { background: var(--surface); }
.c-row.on { background: var(--surface-2); }
.c-row .meta { min-width: 0; flex: 1; }
.c-row .top { display: flex; align-items: baseline; gap: 8px; }
.c-row .nm { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.c-row .tm { font-size: 11px; color: var(--faint); flex: none; }
.c-row .pv { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-row.unread .nm, .c-row.unread .pv { color: var(--text); }
.c-row .cnt { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; flex: none; }
.av-wrap { position: relative; flex: none; }
.av-wrap .online { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2.5px solid var(--bg); }

.c-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.c-head { height: 64px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(8, 9, 10, .7); backdrop-filter: blur(10px); }
.c-head .ttl { min-width: 0; flex: 1; line-height: 1.3; }
.c-head .ttl b { font-size: 14.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-head .ttl small { font-size: 12px; color: var(--muted); }
.msgs { flex: 1; overflow-y: auto; padding: 22px 24px 10px; }
.sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--faint); font-size: 11.5px; font-weight: 600; }
.sep::before, .sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.m { display: flex; gap: 11px; padding: 2px 0; }
.m .av { margin-top: 2px; }
.m.cont { padding-left: 43px; }
.m.cont .av, .m.cont .m-who { display: none; }
.m-body { min-width: 0; max-width: min(620px, 80%); }
.m-who { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.m-who b { font-size: 13px; }
.m-who time { font-size: 11px; color: var(--faint); }
.bubble { display: inline-block; padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.m.cont .bubble { border-radius: 14px; }
.m.me { flex-direction: row-reverse; }
.m.me.cont { padding-left: 0; padding-right: 0; }
.m.me .av, .m.me .m-who b { display: none; }
.m.me .m-body { text-align: right; }
.m.me .m-who { justify-content: flex-end; }
.m.me .bubble { background: var(--accent); color: var(--on-accent); border-color: transparent; border-radius: 14px 4px 14px 14px; text-align: left; font-weight: 500; }
.m.me.cont .bubble { border-radius: 14px; }
.m + .m:not(.cont) { margin-top: 12px; }
.sys { text-align: center; margin: 12px 0; }
.sys span { display: inline-block; font-size: 11.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 4px 11px; border-radius: 20px; }
.composer { flex: none; padding: 12px 20px 18px; }
.composer-box { display: flex; align-items: flex-end; gap: 8px; padding: 7px 7px 7px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea { flex: 1; border: 0; background: transparent; outline: none; resize: none; font-size: 14px; line-height: 1.55; padding: 6px 0; max-height: 160px; }
.composer .hint { font-size: 11px; color: var(--faint); margin: 6px 4px 0; }
.send { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; transition: opacity .15s; }
.send:disabled { opacity: .35; cursor: default; }
.c-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.c-empty .big { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent-hi); }
.c-empty h3 { color: var(--text); margin: 0 0 6px; font-size: 17px; }
.c-info { border-left: 1px solid var(--line); overflow-y: auto; padding: 20px 16px; background: rgba(13, 15, 14, .55); }
.c-info h3 { font-size: 13px; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }
.mem { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 9px; }
.mem:hover { background: var(--surface); }
.mem .grow { flex: 1; min-width: 0; font-size: 13px; }
.mem .grow small { display: block; color: var(--faint); font-size: 11px; }

/* ===== モーダル・トースト ===== */
.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .62); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9); animation: modalIn .2s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 4px; }
.modal-head h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.modal-body { padding: 14px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 6px 20px 20px; }
.picker { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 11px; padding: 4px; background: var(--bg-2); }
.pick { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick .grow { flex: 1; min-width: 0; font-size: 13px; }
.pick .grow small { color: var(--faint); font-size: 11.5px; margin-left: 6px; }
.pick input { accent-color: var(--accent); width: 16px; height: 16px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8); font-size: 13px; animation: modalIn .2s var(--ease); }
.toast .i { color: var(--accent-hi); }
.toast.err .i { color: var(--danger); }

/* ===== 表 ===== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--faint); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.who-cell { display: flex; align-items: center; gap: 11px; }
.who-cell b { display: block; font-size: 13.5px; }
.who-cell small { color: var(--faint); font-size: 12px; }

.tt-edit { width: 100%; border-collapse: separate; border-spacing: 6px; }
.tt-edit th { font-size: 12px; color: var(--faint); font-weight: 600; padding: 4px; }
.tt-edit td { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; vertical-align: top; }
.tt-edit input[type=text] { width: 100%; border: 0; background: transparent; outline: none; font-size: 12px; padding: 3px 0; color: var(--muted); }
.tt-edit input.s { font-size: 13px; font-weight: 700; color: var(--text); }
.tt-edit input[type=color] { width: 100%; height: 6px; border: 0; padding: 0; background: none; cursor: pointer; margin-top: 4px; }
.tt-edit input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.tt-edit input[type=color]::-webkit-color-swatch { border: 0; border-radius: 3px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { cursor: pointer; }
.swatches input { display: none; }
.swatches span { display: block; width: 28px; height: 28px; border-radius: 9px; background: var(--c); box-shadow: inset 0 0 0 2px transparent; transition: transform .12s; }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }

.mobile-bar { display: none; }
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
  .chat.info-open { grid-template-columns: 300px minmax(0, 1fr); }
  .c-info { position: fixed; right: 0; top: 0; bottom: 0; width: 290px; z-index: 40; background: var(--bg-2); }
}
@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding-bottom: 64px; }
  .page { padding: 22px 16px 40px; }
  .page-head h1 { font-size: 24px; }
  .today-tt { grid-template-columns: repeat(3, 1fr); }
  .day { min-height: 70px; padding: 4px; }
  .chip { font-size: 10px; padding: 1px 4px; }
  .chip::before { display: none; }
  .chat, .chat.info-open { grid-template-columns: 1fr; height: calc(100vh - 64px); }
  .chat.open .c-list { display: none; }
  .chat:not(.open) .c-main { display: none; }
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 50; background: rgba(8, 9, 10, .92); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .mobile-bar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; color: var(--faint); font-weight: 600; position: relative; }
  .mobile-bar a.on { color: var(--accent-hi); }
  .mobile-bar .badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
}

/* =====================================================================
   iPad 前提の調整
   ===================================================================== */
.shell { height: 100vh; height: 100dvh; padding-top: env(safe-area-inset-top); }
.chat { height: calc(100vh - env(safe-area-inset-top)); height: calc(100dvh - env(safe-area-inset-top)); }
.side { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.c-back { display: none; }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* 指で操作する端末（iPad）: 押しやすい大きさ・ズームしない文字サイズ */
@media (pointer: coarse) {
  body { font-size: 15px; -webkit-tap-highlight-color: transparent; }
  .btn { height: 44px; padding: 0 16px; font-size: 14px; border-radius: 11px; }
  .btn-sm { height: 38px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
  .btn-icon { width: 44px; } .btn-sm.btn-icon { width: 38px; }
  .input, .select { height: 46px; font-size: 16px; }
  .textarea, .composer textarea { font-size: 16px; }
  .nav a { height: 46px; font-size: 14.5px; }
  .seg button, .seg a { height: 36px; padding: 0 16px; font-size: 13.5px; }
  .c-row { padding: 12px 10px; }
  .pick { padding: 11px 10px; }
  .pick input { width: 20px; height: 20px; }
  .pop label { min-height: 44px; }
  .send { width: 44px; height: 44px; border-radius: 12px; }
  .task .chk, .hw .chk { width: 30px; height: 30px; }
  .day { min-height: 104px; }
  .bubble { font-size: 15.5px; }
  .toasts { bottom: max(20px, env(safe-area-inset-bottom)); }
}
/* タッチ端末ではホバーの見た目が押したあと残るので出さない */
@media (hover: none) {
  .btn:hover { background: var(--surface-2); border-color: var(--line-2); }
  .btn-primary:hover { background: var(--accent); border-color: transparent; }
  .btn-ghost:hover { background: transparent; color: var(--muted); border-color: transparent; }
  .pcard:hover { transform: none; box-shadow: none; }
  .pcard:hover .pthumb img, .gallery a:hover img { transform: none; }
  .c-row:hover, .mem:hover, .pick:hover, .day:hover { background: transparent; }
  .c-row.on:hover { background: var(--surface-2); }
  .btn:active, .c-row:active, .pick:active, .menu-grid a:active { opacity: .7; }
}

/* iPad の縦向き・分割表示（761〜1180px）: 左はアイコンのレールにして画面を広く使う */
@media (min-width: 761px) and (max-width: 1180px) {
  .shell { grid-template-columns: 84px minmax(0, 1fr); }
  .side { padding: 14px 8px; align-items: center; }
  .side .brand { padding: 4px 0 16px; justify-content: center; }
  .brand-txt, .class-chip, .nav-sec, .side-foot .who, .side-foot form { display: none; }
  .nav { width: 100%; gap: 4px; }
  .nav a { flex-direction: column; justify-content: center; gap: 3px; height: 58px; padding: 0 2px; font-size: 10.5px; text-align: center; line-height: 1.2; }
  .nav a .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav a.on::before { left: -8px; top: 14px; bottom: 14px; }
  .nav .badge { position: absolute; top: 4px; right: 12px; margin: 0; }
  .nav .pts { position: absolute; top: 4px; right: 4px; margin: 0; }
  .side-foot { justify-content: center; border-top: 0; padding: 10px 0 0; }
  .page { padding: 26px 24px 50px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .chat, .chat.info-open { grid-template-columns: 290px minmax(0, 1fr); }
  .c-info { position: fixed; right: 0; top: 0; bottom: 0; width: 320px; z-index: 40; background: var(--bg-2); box-shadow: -20px 0 50px -20px rgba(0, 0, 0, .8); padding-top: max(20px, env(safe-area-inset-top)); }
}
@media (min-width: 1000px) and (max-width: 1180px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr) 320px; }
}
/* スマホ・iPad の狭い分割表示 */
@media (max-width: 760px) {
  .main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .mobile-bar { height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  .chat, .chat.info-open { height: calc(100vh - 64px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); height: calc(100dvh - 64px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); }
  .c-back { display: inline-flex; }
  .hide-sm { display: none; }
  .grid-auto { grid-template-columns: 1fr; }
  .modal-bg { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); max-height: 92vh; overflow-y: auto; }
  .modal.wide { max-width: none; }
  .c-info { width: 100%; }
  .fr-act .btn span { display: none; }
}
.nav .pts { margin-left: auto; font-size: 11px; font-weight: 700; color: #fcd34d; background: rgba(251, 191, 36, .1); padding: 1px 7px; border-radius: 9px; }
.nav .badge.warn { background: var(--exam); }

/* ボトムシート（通知・メニュー） */
.modal.sheet .modal-body { padding-top: 6px; }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-grid a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 84px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.menu-grid a.on { color: var(--accent-hi); border-color: var(--accent-line); }
.menu-grid .badge { position: absolute; top: 8px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; display: grid; place-items: center; }
.notif-list { max-height: 60vh; overflow-y: auto; margin: 0 -8px; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 10px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.notif + .notif { border-top: 1px solid var(--line); border-radius: 0; }
.notif.new { background: var(--accent-soft); border-radius: 12px; }
.notif .grow { flex: 1; min-width: 0; }
.notif small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.notif-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--accent-hi); }
.notif-ic .av { width: 30px; height: 30px; }
.sheet-list { display: flex; flex-direction: column; gap: 6px; }
.sheet-list button { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); text-align: left; font-weight: 600; }
.sheet-list button small { flex-basis: 100%; padding-left: 30px; color: var(--faint); font-weight: 400; font-size: 12px; }
.sheet-list .danger { color: var(--danger); }

/* 称号・アイコンの枠 */
.ttl-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; vertical-align: 1px;
  color: #fde68a; background: linear-gradient(135deg, rgba(251, 191, 36, .18), rgba(245, 158, 11, .08)); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .3); white-space: nowrap; }
.av.fr-mint { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #34d399; }
.av.fr-gold { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fbbf24, 0 0 14px -2px rgba(251, 191, 36, .7); }
.av.fr-sakura { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #f9a8d4, 0 0 14px -2px rgba(244, 114, 182, .6); }
.av.fr-neon { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #22d3ee, 0 0 18px 0 rgba(34, 211, 238, .8); animation: neon 2.4s ease-in-out infinite; }
@keyframes neon { 50% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #a78bfa, 0 0 22px 2px rgba(167, 139, 250, .8); } }
.av.fr-rainbow { position: relative; isolation: isolate; box-shadow: 0 0 0 2px var(--bg); }
.av.fr-rainbow::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; padding: 2px; z-index: -1;
  background: conic-gradient(#f87171, #fbbf24, #34d399, #60a5fa, #a78bfa, #f472b6, #f87171); animation: spin 4s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.m .av[class*="fr-"] { margin: 4px; }

/* チャット: 送信取り消し・ブロック中・メッセージの操作 */
.gone { text-align: center; margin: 10px 0; }
.gone span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); padding: 5px 12px; border-radius: 20px; border: 1px dashed var(--line-2); }
.bubble { cursor: pointer; }
.m.acting .bubble { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.m-actions { display: flex; gap: 6px; margin-top: 6px; animation: popIn .15s var(--ease); }
.m.me .m-actions { justify-content: flex-end; }
.m-actions button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13px; font-weight: 600; }
.m-actions .danger { color: var(--danger); }
.cant-send { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 14px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 13px; }
.composer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
@media (max-width: 760px) { .composer { padding-bottom: 12px; } }
.c-info .mem .btn-sm { flex: none; }

/* カレンダー: 自分だけの予定 */
.chip.priv { border-style: dashed; }
.chip.priv .i { display: inline-block; vertical-align: -1px; margin-right: 3px; }
.seg-lg button { height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* フレンド */
.fr-search { margin-bottom: 18px; max-width: 420px; }
.fr-sec { margin-bottom: 18px; }
.fr-list { padding-top: 8px; }
.fr-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.fr-row + .fr-row { border-top: 1px solid var(--line); }
.fr-row .grow { flex: 1; min-width: 0; }
.fr-row .grow b { font-size: 14.5px; }
.fr-row .grow small { display: block; color: var(--faint); font-size: 12px; }
.fr-act { display: flex; gap: 6px; flex: none; }
.fr-empty { margin: 4px 0; font-size: 13px; }

/* ポイント */
.pts-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 18px;
  background: radial-gradient(500px 200px at 0% 0%, rgba(251, 191, 36, .14), transparent 70%), var(--surface); }
.pts-big { display: flex; align-items: baseline; gap: 8px; }
.pts-big b { font-size: 46px; letter-spacing: -.03em; line-height: 1; }
.pts-big small { color: var(--muted); font-size: 15px; font-weight: 700; }
.pts-star { color: #fbbf24; align-self: center; }
.pts-me { display: flex; align-items: center; gap: 14px; }
.pts-me small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.shop-h { font-size: 12px; color: var(--faint); font-weight: 700; margin: 4px 0 10px; letter-spacing: .03em; }
.shop-h + .shop { margin-bottom: 18px; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); text-align: center; }
.shop-item.on { border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .05); }
.shop-item .av { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; margin: 4px; }
.shop-name { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: -4px; }
.shop-item .btn { width: 100%; }
.shop-item .btn .i { color: #fbbf24; }
.shop-item .btn-primary .i { color: var(--on-accent); }
.rule { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 13.5px; }
.rule + .rule { border-top: 1px solid var(--line); }
.rule b { color: #fcd34d; }
.rule b.neg { color: var(--muted); }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; font-size: 13.5px; }
.rank-row.me { background: var(--accent-soft); }
.rank-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row b small { color: var(--faint); font-size: 11px; margin-left: 2px; }
.rank-n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface-3); color: var(--muted); flex: none; }
.rank-1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2500; }
.rank-2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.rank-3 { background: linear-gradient(135deg, #fdba74, #c2410c); color: #2a1206; }

/* 招待・承認 */
.invite { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.invite .grow { flex: 1; min-width: 180px; }
.qr { padding: 10px; background: #fff; border-radius: 14px; flex: none; }
.qr img, .qr canvas { display: block; }
.invite-code { font-size: 26px; font-weight: 800; letter-spacing: .08em; word-break: break-all; }
.invite-set { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.code-input { font-size: 18px; letter-spacing: .06em; font-weight: 700; }
.waiting-card { border-color: rgba(251, 191, 36, .35); }
.wait-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.wait-row + .wait-row { border-top: 1px solid var(--line); }
.wait-row .grow { flex: 1; min-width: 160px; }
.wait-row .grow small { display: block; color: var(--faint); font-size: 12px; }
.pending-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.pending-card { max-width: 480px; padding: 36px 30px; text-align: center; }
.pending-card h1 { font-size: 22px; margin: 18px 0 12px; letter-spacing: -.02em; }
.pending-card p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.pending-ico { width: 68px; height: 68px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; background: rgba(251, 191, 36, .12); color: #fbbf24; }
.steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.steps div { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.steps span { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hi); font-weight: 800; font-size: 12px; }

/* 時間割: 時刻・7限以上・スクショ読み取りの確認表 */
.today-tt { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.wk-lbl .pt-time { display: block; font-size: 10.5px; color: var(--faint); font-weight: 500; line-height: 1.35; margin-top: 3px; }
.tt-edit th .tt-time { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-2); font-size: 11.5px; padding: 3px 4px; color: var(--muted); }
.tt-prev-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; max-height: 56vh; }
.tt-prev { border-collapse: separate; border-spacing: 4px; min-width: 640px; width: 100%; }
.tt-prev th { font-size: 12px; color: var(--faint); font-weight: 700; padding: 4px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.tt-prev tr th:first-child { width: 86px; text-align: left; }
.tt-prev th input[type=time] { display: block; width: 100%; margin-top: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); font-size: 11px; padding: 2px 3px; color: var(--muted); }
.tt-prev td { background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 9px; padding: 5px 7px; vertical-align: top; }
.tt-prev td input { width: 100%; border: 0; background: transparent; outline: none; font-size: 12px; color: var(--muted); padding: 2px 0; }
.tt-prev td input.s { font-size: 14px; font-weight: 700; color: var(--text); }
@media (pointer: coarse) { .tt-prev td input { font-size: 16px; } .tt-prev td input.s { font-size: 16px; } }

/* クラス（1組・2組・3組…） */
.cls-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.cls-pick label { cursor: pointer; }
.cls-pick label input { position: absolute; opacity: 0; pointer-events: none; }
.cls-pick label span { display: inline-flex; align-items: center; justify-content: center; min-width: 76px; height: 44px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2); font-weight: 700; font-size: 15px; transition: all .12s; }
.cls-pick label input:checked + span { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 6px 18px -8px var(--accent); }
.cls-pick label input:focus-visible + span { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.cls-pick .btn { min-width: 76px; font-size: 15px; }
.cls-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 18px; border-color: rgba(251, 191, 36, .4); background: linear-gradient(135deg, rgba(251, 191, 36, .08), transparent 60%), var(--surface); }
.cls-banner-txt { display: flex; align-items: center; gap: 12px; color: #fbbf24; }
.cls-banner-txt b { display: block; color: var(--text); font-size: 14.5px; }
.cls-banner-txt span { display: block; color: var(--muted); font-size: 12.5px; }
.cls-tabs { display: inline-flex; flex-wrap: wrap; }
.cls-inline .select { height: 32px; font-size: 13px; padding: 0 8px; min-width: 88px; width: auto; }
@media (pointer: coarse) { .cls-inline .select { height: 40px; font-size: 16px; } }
.cls-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cls-row .input { flex: 1; }
.cls-row .faint { font-size: 12px; min-width: 34px; text-align: right; }
.tgt-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.tgt-seg label { flex: 1; min-width: 120px; cursor: pointer; }
.tgt-seg input { position: absolute; opacity: 0; pointer-events: none; }
.tgt-seg span { display: flex; align-items: center; justify-content: center; gap: 7px; height: 42px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2); font-weight: 600; font-size: 13.5px; color: var(--muted); }
.tgt-seg input:checked + span { color: var(--text); border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

/* 時間割の読み取り: 選んだ画像の小さな見本 */
.shot-thumb { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); font-size: 12px; color: var(--muted); }
.shot-thumb:empty { display: none; }
.shot-thumb img { width: 84px; height: 84px; object-fit: cover; object-position: top; border-radius: 8px; background: #fff; flex: none; }
