/* MaStock 授業動画 */
:root {
  --navy: #16213a;
  --navy-2: #22304f;
  --orange: #c2461a;
  --orange-2: #e2602c;
  --slate: #7f8db0;
  --slate-soft: #e8ebf3;
  --ink: #16213a;
  --muted: #646c7e;
  --line: #e2e5ec;
  --bg: #f4f5f8;
  --card: #ffffff;
  --ok: #2f7d5b;
  --danger: #b3261e;
  --r-lg: 22px;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(22, 33, 58, .06), 0 6px 18px rgba(22, 33, 58, .06);
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-latin: "Outfit", "Zen Kaku Gothic New", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.num, .latin { font-family: var(--font-latin); }
[hidden] { display: none !important; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: pulse 1.2s ease-in-out infinite; border-radius: 14px; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.96); } }

/* ---------- ロゴ ---------- */
.wordmark { font-family: var(--font-latin); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.wordmark .ma { color: var(--orange); }
.wordmark .st { color: var(--navy); }

/* ---------- ログイン ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(1200px 500px at 50% -10%, #fff 0%, rgba(255,255,255,0) 70%),
    var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 2px solid var(--navy);
  border-radius: 28px;
  padding: 40px 36px 32px;
  box-shadow: var(--shadow);
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand img { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 20px; }
.auth-brand .wordmark { font-size: 44px; }
.auth-brand .sub {
  margin-top: 10px;
  color: var(--muted);
  letter-spacing: .32em;
  font-size: 15px;
  padding-left: .32em;
}
.auth-note { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }
.auth h2 { font-size: 17px; margin: 0 0 4px; text-align: center; }
.auth p.lead { color: var(--muted); font-size: 13.5px; text-align: center; margin: 0 0 18px; }

/* ---------- フォーム ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--navy-2); }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: var(--r-sm);
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 84px; }
.input:focus { border-color: var(--slate); box-shadow: 0 0 0 3px var(--slate-soft); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 140px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--orange); }
.error-msg { color: var(--danger); font-size: 13.5px; min-height: 1.4em; margin: 2px 0 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--slate); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-2); }
.btn.accent { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn.accent:hover { background: #ab3d16; }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--slate-soft); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.block { width: 100%; padding: 12px; font-size: 15px; }

/* ---------- ヘッダー ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand .wordmark { font-size: 24px; }
.brand .tag {
  font-size: 12px; font-weight: 700; color: #fff; background: var(--navy);
  padding: 3px 10px; border-radius: 999px; letter-spacing: .08em;
}
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a {
  text-decoration: none; font-weight: 700; font-size: 14px; color: var(--muted);
  padding: 7px 14px; border-radius: 999px;
}
.nav a:hover { background: var(--slate-soft); color: var(--navy); }
.nav a.on { background: var(--navy); color: #fff; }
.spacer { flex: 1; }
.usermenu { position: relative; }
.userbtn {
  display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: #fff;
  border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font-weight: 700; font-size: 14px;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--slate-soft); color: var(--navy);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 6px; display: none;
}
.usermenu.open .dropdown { display: block; }
.dropdown .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.dropdown .who b { display: block; color: var(--ink); font-size: 14px; }
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px;
  border-radius: 8px; text-decoration: none; cursor: pointer; font-size: 14px;
}
.dropdown a:hover, .dropdown button:hover { background: var(--slate-soft); }

.page { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head .desc { color: var(--muted); font-size: 13.5px; margin: 2px 0 0; }

/* ---------- 一覧 ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px;
  font-weight: 700; font-size: 13.5px; cursor: pointer; text-decoration: none; color: var(--navy-2);
}
.chip:hover { border-color: var(--slate); }
.chip.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.search { position: relative; width: min(280px, 100%); }
.search input { padding-left: 36px; border-radius: 999px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--slate); }

.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 700; margin: 30px 0 4px;
}
.section-title::before {
  content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--orange);
}
.chapter-title {
  font-size: 14.5px; font-weight: 700; color: var(--navy-2); margin: 18px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.chapter-title .count { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.chapter-title .bar { flex: 1; height: 1px; background: var(--line); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; }
.card {
  display: block; text-decoration: none; background: var(--card); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(22,33,58,.08), 0 12px 28px rgba(22,33,58,.1); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--navy); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center;
  color: #fff; gap: 2px;
  background:
    linear-gradient(transparent 0 0),
    radial-gradient(260px 120px at 85% 0%, rgba(226,96,44,.35), transparent 70%),
    var(--navy);
}
.thumb .ph .ph-sub { font-size: 12px; color: var(--slate); letter-spacing: .1em; }
.thumb .ph .ph-no { font-family: var(--font-latin); font-weight: 800; font-size: 30px; line-height: 1.1; }
.thumb .ph .ph-no small { font-size: 14px; font-weight: 700; margin: 0 2px; }
.thumb .ph::after {
  content: ""; position: absolute; right: 14px; top: 12px; width: 26px; height: 5px; border-radius: 3px; background: var(--orange-2);
  box-shadow: -4px 9px 0 0 var(--slate);
}
.badge {
  position: absolute; font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 7px;
}
.badge.dur { right: 8px; bottom: 10px; background: rgba(22,33,58,.86); color: #fff; font-family: var(--font-latin); }
.badge.done { left: 8px; top: 8px; background: var(--ok); color: #fff; }
.badge.draft { right: 8px; top: 8px; background: #fff; color: var(--orange); border: 1.5px solid var(--orange); }
.pbar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.35); }
.pbar i { display: block; height: 100%; background: var(--orange-2); }
.card-body { padding: 10px 14px 13px; }
.card-meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.card-meta .no { color: var(--orange); font-weight: 700; }
.card-title { font-weight: 700; font-size: 14.5px; line-height: 1.45; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.continue { background: var(--navy); border-radius: var(--r-lg); padding: 18px 20px 20px; margin-bottom: 6px; color: #fff; }
.continue h2 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.continue h2::before { content: ""; width: 22px; height: 5px; border-radius: 3px; background: var(--orange-2); }
.continue .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.continue .card { border-color: transparent; color: var(--ink); }

.empty {
  text-align: center; padding: 56px 20px; color: var(--muted); background: #fff; border-radius: var(--r-lg);
  border: 1.5px dashed var(--line);
}
.empty img { width: 56px; margin: 0 auto 14px; opacity: .9; border-radius: 13px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- 再生 ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.player-wrap { background: #000; border-radius: var(--r); overflow: hidden; aspect-ratio: 16 / 9; position: relative; }
.player-wrap video { width: 100%; height: 100%; display: block; background: #000; }
.player-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 4px; }
.seg { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 2px; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 999px; font-family: var(--font-latin); font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--navy); color: #fff; }
.seg-label { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.resume-note {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--slate-soft); border-radius: var(--r-sm);
  padding: 8px 12px; font-size: 13.5px; margin-top: 10px;
}
.crumb { font-size: 13px; color: var(--muted); margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crumb .sep { color: var(--slate); }
.watch h1 { font-size: 22px; margin: 4px 0 8px; line-height: 1.4; }
.watch h1 .no { color: var(--orange); font-family: var(--font-latin); margin-right: 8px; }
.watch .desc { white-space: pre-wrap; background: #fff; border-radius: var(--r); padding: 14px 16px; border: 1px solid var(--line); font-size: 14px; }
.staff-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; padding: 10px 12px; border-radius: var(--r-sm); background: #fff; border: 1px dashed var(--slate); }
.staff-tools .pill { align-self: center; }

/* 授業プリント */
.files { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 12px 0; transition: border-color .15s, background .15s; }
.files.over { border-color: var(--orange); background: #fff7f3; }
.files-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.files-head h2 { font-size: 15px; margin: 0; flex: 1; display: flex; align-items: center; gap: 6px; }
.files-head h2 svg { color: var(--orange); width: 16px; height: 16px; }
.file { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-top: 1px solid var(--line); }
.files-head + .file { border-top: 0; }
.ficon { flex: 0 0 auto; width: 40px; height: 48px; border-radius: 6px; display: grid; place-items: center; font-family: var(--font-latin); font-weight: 800; font-size: 12px; color: #fff; background: var(--orange); position: relative; }
.ficon.img { background: var(--slate); font-family: var(--font); font-size: 11px; }
.ficon::after { content: ""; position: absolute; right: 0; top: 0; border-width: 0 10px 10px 0; border-style: solid; border-color: #fff #fff rgba(0,0,0,.18) rgba(0,0,0,.18); }
.fmeta { flex: 1; min-width: 0; }
.fmeta b { display: block; font-size: 14.5px; }
.fmeta small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fops { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.files-empty { color: var(--muted); font-size: 13px; margin: 4px 0 2px; }
.badge.print { left: 8px; bottom: 10px; background: #fff; color: var(--orange); display: inline-flex; align-items: center; gap: 3px; }
.pdfchip { display: inline-flex; align-items: center; gap: 5px; background: #fff7f3; border: 1px solid #f4cdbd; color: #7a2e12; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; margin: 8px 6px 0 0; }
.pdfchip small { font-weight: 400; color: var(--muted); }
.dropzone.small { padding: 18px 16px; margin-bottom: 10px; }
.staff-tools .lbl { font-size: 12px; font-weight: 700; color: var(--slate); align-self: center; margin-right: 4px; }
.prevnext { display: flex; gap: 10px; margin-top: 16px; }
.prevnext a { flex: 1; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; font-size: 13.5px; }
.prevnext a:hover { border-color: var(--slate); }
.prevnext a small { display: block; color: var(--muted); font-size: 12px; }
.prevnext a.next { text-align: right; }
.prevnext a.hl { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(194,70,26,.12); }

.side { background: #fff; border-radius: var(--r-lg); border: 1px solid var(--line); padding: 14px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.side h3 { font-size: 13px; margin: 2px 4px 10px; color: var(--muted); }
.side-item { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 6px; border-radius: var(--r-sm); text-decoration: none; align-items: center; }
.side-item:hover { background: var(--bg); }
.side-item.on { background: var(--slate-soft); }
.side-item .thumb { border-radius: 8px; }
.side-item .thumb .ph .ph-no { font-size: 18px; }
.side-item .thumb .ph::after, .side-item .thumb .ph .ph-sub { display: none; }
.side-item .t { font-size: 13px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-item .m { font-size: 11.5px; color: var(--muted); }

/* ---------- 管理 ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .mini-thumb { width: 96px; border-radius: 6px; overflow: hidden; }
.tbl .ops { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.tbl .sub { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.pub { background: #e3f2ea; color: var(--ok); }
.pill.draft { background: #fdece5; color: var(--orange); }
.pill.role-admin { background: var(--navy); color: #fff; }
.pill.role-teacher { background: var(--slate-soft); color: var(--navy); }
.pill.role-student { background: #f1f2f5; color: var(--muted); }
.pill.off { background: #f1f2f5; color: #999; }
.pill.lock { background: #fde8e7; color: var(--danger); }
button.pill { border: 0; cursor: pointer; }
.meter { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.meter .track { flex: 1; height: 6px; background: var(--slate-soft); border-radius: 3px; overflow: hidden; }
.meter .track i { display: block; height: 100%; background: var(--orange-2); }
.meter.done .track i { background: var(--ok); }
.meter span { font-family: var(--font-latin); font-size: 12.5px; width: 38px; text-align: right; }
.stat { display: inline-flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--muted); }
.stat b { font-family: var(--font-latin); font-size: 18px; color: var(--ink); }

.dropzone {
  display: block;
  border: 2px dashed var(--slate); border-radius: var(--r-lg); background: #fff; padding: 34px 20px; text-align: center;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.dropzone.over { background: var(--slate-soft); border-color: var(--navy); }
.dropzone b { display: block; font-size: 16px; margin-bottom: 4px; }
.dropzone span { color: var(--muted); font-size: 13px; }
.upitem { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; margin-top: 14px; display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.upitem .thumb { border-radius: 10px; }
.upitem .fname { font-size: 12.5px; color: var(--muted); word-break: break-all; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.upitem .fields { display: grid; grid-template-columns: 1.1fr 1fr 1fr 90px; gap: 10px; }
.upitem .fields .wide { grid-column: 1 / -1; }
.upitem .field { margin-bottom: 0; }
.upbar { height: 8px; background: var(--slate-soft); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.upbar i { display: block; height: 100%; width: 0; background: var(--orange-2); transition: width .2s; }
.upstate { font-size: 12.5px; margin-top: 4px; color: var(--muted); }
.upstate.ok { color: var(--ok); font-weight: 700; }
.upstate.ng { color: var(--danger); font-weight: 700; }
.upactions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; }

.subj-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm); }
.subj-checks .all { width: 100%; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }

.subj-list { list-style: none; padding: 0; margin: 0; }
.subj-list li { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.subj-list li .name { flex: 1; font-weight: 700; }
.subj-list li .cnt { color: var(--muted); font-size: 12.5px; }

/* ---------- モーダル ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(22,33,58,.45); z-index: 50; display: grid; place-items: center; padding: 16px;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: var(--r-lg); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  box-shadow: 0 20px 60px rgba(22,33,58,.3); animation: rise .18s ease-out;
}
.modal.wide { width: min(820px, 100%); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.modal-head { display: flex; align-items: center; padding: 16px 20px 6px; }
.modal-head h2 { font-size: 17px; margin: 0; flex: 1; }
.modal-body { padding: 8px 20px 4px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 18px; flex-wrap: wrap; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.x:hover { background: var(--bg); }
.pw { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 15px; background: var(--slate-soft); padding: 2px 8px; border-radius: 6px; letter-spacing: .04em; }
.callout { background: #fff7f3; border: 1px solid #f4cdbd; color: #7a2e12; border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); z-index: 80;
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; width: max-content; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ng { background: var(--danger); }

#print-area { display: none; }

@media (max-width: 960px) {
  .watch { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .topbar-in { gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
  .brand .wordmark { font-size: 20px; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .userbtn .uname { display: none; }
  .page { padding: 16px 12px 48px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .auth-card { padding: 32px 22px 26px; }
  .upitem { grid-template-columns: 1fr; }
  .upitem .fields { grid-template-columns: 1fr 1fr; }
  .watch h1 { font-size: 18px; }
  .toolbar .search { width: 100%; order: -1; }
  .toolbar .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .chip { flex: 0 0 auto; }
  .player-bar [data-skip] { display: none; }
  .file { flex-wrap: wrap; }
  .fops { width: 100%; justify-content: flex-start; padding-left: 52px; }
  .pdfchip small { display: none; }
}

/* ---------- 印刷（ログインカード） ---------- */
@media print {
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
  .lcards { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
  .lcard { border: 1px dashed #999; padding: 14px 16px; break-inside: avoid; font-size: 12px; }
  .lcard .lc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  .lcard .lc-head img { width: 26px; height: 26px; border-radius: 6px; }
  .lcard .lc-head .wordmark { font-size: 16px; }
  .lcard .lc-head small { font-size: 11px; }
  .lcard dl { margin: 0; display: grid; grid-template-columns: 7em 1fr; gap: 3px 6px; }
  .lcard dt { color: #555; }
  .lcard dd { margin: 0; font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
  .lcard dd.nm { font-family: var(--font); }
  .lcard p { margin: 8px 0 0; color: #555; font-size: 10.5px; }
}
