:root {
  --bg: #f5f6f8;
  --panel: #fff;
  --line: #e2e5ea;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #f5a623;
  --accent-dark: #d98c0c;
  --open: #2f7d4f;
  --closed: #b04a3f;
  --danger: #c0392b;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

h1 { font-size: 20px; margin: 20px 0 12px; }
h2 { font-size: 16px; }
h4 { font-size: 13px; margin: 14px 0 4px; }
small { color: var(--muted); }

/* --- 全体の骨組み（左サイドバー） ------------------------------------ */

body.shell {
  display: grid;
  grid-template-columns: 210px 1fr;
  grid-template-rows: 52px 1fr;
  grid-template-areas:
    "brand top"
    "side  main";
  min-height: 100vh;
}

.brandbar {
  grid-area: brand;
  display: flex; align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0 18px;
}
.brandbar a {
  font-weight: 700; font-size: 18px; letter-spacing: .02em;
  color: var(--text); text-decoration: none;
}

.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
}
.topbar .spacer { flex: 1; }
.topbar .me { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.topbar .me form { margin: 0; }

.sidebar {
  grid-area: side;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 12px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.side-item, .side-sub {
  display: block; text-decoration: none; color: var(--text);
  padding: 8px 12px; border-radius: var(--radius); font-size: 14px;
}
.side-item:hover, .side-sub:hover, .side-group > summary:hover { background: var(--bg); }
.side-item.on, .side-sub.on { background: var(--accent); font-weight: 600; }

.side-group > summary {
  list-style: none; cursor: pointer;
  padding: 8px 12px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
}
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary::before { content: "▸ "; color: var(--muted); }
.side-group[open] > summary::before { content: "▾ "; }
.side-sub { padding-left: 26px; font-size: 13px; }

body.shell > main { grid-area: main; min-width: 0; }

/* 窓が狭いときはサイドバーを畳んで上に置く */
@media (max-width: 820px) {
  body.shell {
    grid-template-columns: 1fr;
    grid-template-rows: 52px auto 1fr;
    grid-template-areas: "brand" "top" "side" ;
  }
  body.shell > main { grid-area: auto; }
  .sidebar { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); }
  .brandbar { border-right: none; }
}

/* --- レイアウト ----------------------------------------------------- */

main { padding: 0 20px 40px; }
main.centered { display: grid; place-items: center; min-height: 100vh; padding: 0; }

/* 左に一覧・右にフォームの2ペイン（5.3） */
main.split {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  padding: 16px 20px 40px;
  align-items: start;
}
@media (max-width: 900px) {
  main.split { grid-template-columns: 1fr; }
}

.pane-left, .pane-right {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.pane-left { position: sticky; top: 16px; max-height: calc(100vh - 90px); overflow: auto; }
.pane-right.placeholder { color: var(--muted); display: grid; place-items: center; min-height: 240px; }

/* --- コマ一覧 ------------------------------------------------------- */

.lesson-list { list-style: none; margin: 8px 0 0; padding: 0; }
.lesson-list li { margin-bottom: 4px; }
.lesson-list .empty { color: var(--muted); padding: 8px; }

.lesson {
  width: 100%; text-align: left; cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: var(--radius);
  padding: 8px 10px; font: inherit; color: inherit;
  display: grid; gap: 2px;
}
.lesson:hover { background: var(--bg); }
.lesson.on { background: #fff7e6; border-color: var(--accent); }
.lesson .slot { font-size: 12px; color: var(--muted); }
.lesson .student { font-weight: 600; }
.lesson .student small { font-weight: 400; margin-left: 6px; }
.lesson-status { font-size: 12px; color: var(--danger); }
.lesson .other-teacher { display: block; font-size: 11px; color: var(--muted); }

/* 担当コマ / すべて の切替と、左ペインの絞り込み */
.scope-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.scope-tabs .tab { flex: 1; text-align: center; padding: 6px 8px; font-size: 13px; }
.pane-filters {
  display: grid; gap: 8px; margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.pane-filters label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.pane-filters select {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 5px 8px; font: inherit; font-size: 13px; color: var(--text);
  background: var(--panel); width: 100%;
}
.pane-filters .linkish { justify-self: start; font-size: 12px; padding: 0; }

a.new-report {
  display: block; text-align: center; text-decoration: none;
  margin-bottom: 12px; padding: 8px 12px; font-size: 13px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--text);
}
a.new-report:hover { background: var(--accent-dark); }

.req {
  font-size: 11px; font-weight: 400; color: var(--danger);
  border: 1px solid #eab0a8; background: #fdeeec;
  border-radius: 3px; padding: 0 5px; margin-left: 6px;
}
.search-form textarea {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px; font: inherit; width: 100%; resize: vertical;
}
.search-form textarea:focus, .search-form select:focus, .search-form input:focus {
  outline: 2px solid var(--accent); border-color: transparent;
}
.search-form input[type="time"] { min-width: 0; }

/* --- バッジ --------------------------------------------------------- */

.badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 1px 8px; border-radius: 999px; border: 1px solid;
  white-space: nowrap;
}
.b-NONE      { color: var(--muted); border-color: var(--line); background: #fafafa; }
.b-DRAFT     { color: #8a6d1f; border-color: #e8d08a; background: #fdf6e3; }
.b-SUBMITTED { color: #1f5c8a; border-color: #a8cbe8; background: #eaf4fb; }
.b-PUBLISHED { color: var(--open); border-color: #a8d8bb; background: #eefaf2; }
.b-RETURNED  { color: var(--danger); border-color: #eab0a8; background: #fdeeec; }
.b-NO_SHOW   { color: #7a4b00; border-color: #e8c98a; background: #fdf3e0; }

/* --- 公開 / 非公開の明示（取り違え防止） ---------------------------- */

.visibility {
  font-size: 11px; padding: 1px 8px; border-radius: 999px; font-weight: 600;
}
.visibility.open   { color: var(--open); background: #eefaf2; border: 1px solid #a8d8bb; }
.visibility.closed { color: var(--closed); background: #fdeeec; border: 1px solid #eab0a8; }

/* --- 報告書フォーム ------------------------------------------------- */

.report-head h2 { margin: 0 0 4px; }
.report-head .meta { margin: 2px 0; color: var(--muted); }
.report-head .meta.small { font-size: 12px; }
.report-head .subject { margin-left: 10px; color: var(--text); }
.save-state { margin-left: 10px; font-size: 12px; }
.save-state.ok  { color: var(--open); }
.save-state.err { color: var(--danger); }

.notice {
  border: 1px solid var(--line); background: #fafafa;
  border-radius: var(--radius); padding: 10px 12px; margin: 12px 0;
}
.notice.warn { border-color: #eab0a8; background: #fdeeec; }
.notice p { margin: 4px 0 0; white-space: pre-wrap; }

/* 前回の注記。次回の開始地点なので常時見える位置に置く（1.3） */
.prev-note {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fbfcfd; padding: 10px 12px; margin: 14px 0;
}
.prev-note summary { cursor: pointer; font-weight: 600; }
.prev-note-body {
  white-space: pre-wrap; margin: 8px 0; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  max-height: 200px; overflow: auto; font-size: 13px;
}
.prev-actions { display: flex; align-items: center; gap: 10px; }

.field { display: block; margin: 18px 0; }
.field .label { font-weight: 600; margin-right: 8px; }
.field textarea {
  display: block; width: 100%; margin-top: 6px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; font: inherit; line-height: 1.7; resize: vertical;
  background: var(--panel);
}
.field textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.field textarea:disabled { background: #f3f4f6; color: var(--muted); }

.attachments { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 12px; }
.attachments li {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px; background: var(--panel); width: 180px;
}
.attachments img { width: 100%; height: 110px; object-fit: cover; border-radius: 4px; display: block; }
.attachments .fname { font-size: 11px; color: var(--muted); word-break: break-all; display: block; margin: 4px 0; }
.attach-actions { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; }

/* スクショの範囲選択。Snipping Tool と同じ操作感にする */
.shot-overlay {
  position: fixed; inset: 0; z-index: 50; background: #111;
  display: flex; flex-direction: column;
}
.shot-overlay[hidden] { display: none; }  /* display:flex が [hidden] を打ち消すため */
.shot-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: #1b1b1b; color: #f4f4f4; font-size: 13px;
}
.shot-bar .shot-msg { flex: 1; }
.shot-bar button { background: #2c2c2c; border-color: #3f3f3f; color: #f4f4f4; }
.shot-bar button:hover:not(:disabled) { background: #3a3a3a; }
/* padding は置かない。JS が clientWidth/Height をそのまま収まる大きさとして使うため */
.shot-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
#shotCanvas { cursor: crosshair; display: block; touch-action: none; }

.actions {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--line); padding-top: 14px; margin-top: 20px;
}
.actions .hint { flex: 1; }
.hint { color: var(--muted); font-size: 12px; }

/* --- ボタン --------------------------------------------------------- */

button, .ghost {
  font: inherit; cursor: pointer; border-radius: var(--radius);
  padding: 7px 16px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text);
}
button:hover:not(:disabled), .ghost:hover { background: var(--bg); }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }
.primary:hover:not(:disabled) { background: var(--accent-dark); }
.danger { color: var(--danger); border-color: #eab0a8; }
.linkish {
  border: none; background: none; padding: 0; color: var(--muted);
  text-decoration: underline; font-size: 12px;
}
.file-btn { display: inline-block; }
a.ghost { text-decoration: none; display: inline-block; }

/* --- ログイン ------------------------------------------------------- */

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 32px;
}
.login { width: 340px; display: grid; gap: 14px; }
.login h1 { margin: 0; text-align: center; }
.login .sub { margin: -10px 0 6px; text-align: center; color: var(--muted); }
.login label { display: grid; gap: 4px; font-size: 13px; }
.login input {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px; font: inherit;
}
.login input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.error {
  color: var(--danger); background: #fdeeec; border: 1px solid #eab0a8;
  border-radius: var(--radius); padding: 8px 12px; margin: 0; font-size: 13px;
}

/* --- 塾長: 一覧 ----------------------------------------------------- */

.filters {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap;
}
.filters label { display: grid; gap: 4px; font-size: 13px; }
.filters select, .filters input {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 7px 10px; font: inherit; min-width: 180px;
}

.tabs { display: flex; gap: 4px; width: 100%; }
.tab {
  text-decoration: none; color: var(--text);
  padding: 6px 14px; border-radius: var(--radius); border: 1px solid transparent;
}
.tab:hover { background: var(--bg); }
.tab.on { background: var(--accent); font-weight: 600; }
.tab .count {
  display: inline-block; margin-left: 6px; font-size: 11px;
  background: rgba(0,0,0,.12); border-radius: 999px; padding: 0 7px;
}

.bulk-bar {
  display: flex; align-items: center; gap: 16px;
  background: #fff7e6; border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 10px 16px; margin-bottom: 12px;
}

.report-table {
  width: 100%; border-collapse: collapse;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.report-table th, .report-table td {
  padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.report-table th { background: #fafbfc; font-size: 12px; color: var(--muted); font-weight: 600; }
.report-table tr:last-child td { border-bottom: none; }
.report-table .nowrap { white-space: nowrap; }
.report-table .small { font-size: 12px; color: var(--muted); }
.report-table .pick { width: 36px; }
.report-table .grade { display: block; }
.report-table .subject-cell { max-width: 280px; font-size: 12px; color: var(--muted); }
.report-table .row-actions { white-space: nowrap; text-align: right; }
.report-table .row-actions button { padding: 4px 10px; font-size: 12px; margin-left: 4px; }
.report-table .empty { color: var(--muted); text-align: center; padding: 30px; }

.detail-body { background: #fafbfc; border-radius: var(--radius); padding: 12px 16px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-body pre {
  white-space: pre-wrap; word-break: break-word; font: inherit;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; margin: 0;
}
.detail-body pre.note { background: #fdf9f8; border-color: #eab0a8; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 140px; height: 90px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }

.total { color: var(--muted); font-size: 12px; margin-top: 10px; }

/* --- 登録・アカウント管理 ------------------------------------------- */

.ok-msg {
  color: var(--open); background: #eefaf2; border: 1px solid #a8d8bb;
  border-radius: var(--radius); padding: 8px 12px; margin: 0; font-size: 13px;
}

.register { width: 400px; }
.invite-summary {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.invite-summary p { margin: 4px 0; }
.invite-summary .for-student { font-size: 13px; }
.role-chip {
  display: inline-block; background: var(--accent); font-weight: 600;
  border-radius: 999px; padding: 1px 12px; margin-right: 4px;
}

.invite-card { margin-bottom: 24px; padding: 20px 24px; }
.invite-card h2 { margin-top: 0; }
.invite-form {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  margin-top: 12px;
}
.invite-form label { display: grid; gap: 4px; font-size: 13px; }
.invite-form label[hidden] { display: none; }
.invite-form select, .invite-form input {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 7px 10px; font: inherit; min-width: 190px;
}

.invite-result { margin-top: 16px; display: grid; gap: 8px; }
.invite-url { display: flex; gap: 8px; }
.invite-url input {
  flex: 1; font: inherit; font-size: 13px;
  border: 1px solid var(--accent); border-radius: var(--radius); padding: 8px 10px;
  background: #fff7e6;
}

.badge.inv-OPEN     { color: #1f5c8a; border-color: #a8cbe8; background: #eaf4fb; }
.badge.inv-USED     { color: var(--open); border-color: #a8d8bb; background: #eefaf2; }
.badge.inv-EXPIRED  { color: var(--muted); border-color: var(--line); background: #fafafa; }
.badge.inv-REVOKED  { color: var(--danger); border-color: #eab0a8; background: #fdeeec; }

.chip {
  display: inline-block; background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 6px 1px 10px; margin: 0 4px 4px 0;
  font-size: 12px;
}
.chip .linkish { padding: 0 4px; font-size: 13px; color: var(--danger); }

/* 止めたアカウント。消さずに残すので、生きている行と見分けられるようにする */
.report-table tr.inactive { color: var(--muted); background: #fafafa; }
.report-table tr.inactive td:not(.row-actions) { opacity: .7; }
.muted { color: var(--muted); }
.report-table .add-student {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 8px; font: inherit; font-size: 12px;
}
code {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; font-size: 12px;
}

/* --- ホーム ---------------------------------------------------------- */

.tiles { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0 28px; }
.tile {
  display: grid; gap: 2px; min-width: 150px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px;
  text-decoration: none; color: var(--text);
}
.tile:hover { border-color: var(--accent); }
.tile.attn { border-color: var(--accent); background: #fff7e6; }
.tile-num { font-size: 26px; font-weight: 700; line-height: 1.2; }
.tile-label { font-size: 12px; color: var(--muted); }

.list-card { padding: 0; overflow: hidden; }
.list-card .report-table { border: none; border-radius: 0; }
.report-table a { color: #1f5c8a; }
.more { text-align: right; margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); }
.more a { color: #1f5c8a; font-size: 13px; }

/* --- 報告書検索 ------------------------------------------------------ */

.search-form { max-width: 640px; display: grid; gap: 20px; }
.search-field { display: grid; gap: 6px; border: none; padding: 0; margin: 0; }
.search-label { font-weight: 600; font-size: 13px; }
.search-label small { font-weight: 400; }
.search-form select, .search-form input[type="date"] {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px; font: inherit; background: var(--panel); color: var(--text);
}
.search-form select { width: 100%; }
.date-range { display: flex; align-items: center; gap: 8px; }
.date-range input { flex: 1; min-width: 0; }
.radio { display: inline-flex; align-items: center; gap: 5px; margin-right: 16px; font-size: 13px; }
.search-actions { display: flex; align-items: center; gap: 12px; }
.filters .date-range input {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 7px 10px; font: inherit; min-width: 0;
}
.filters .date-range { min-width: 260px; }

.not-yet { max-width: 640px; margin-top: 24px; }
.not-yet summary { cursor: pointer; font-weight: 600; }
.not-yet ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.not-yet li { margin: 4px 0; }

/* --- 保護者画面 ------------------------------------------------------ */

.report-card { max-width: 780px; margin: 14px 0; padding: 20px 24px; }

/* 保護者の一覧。1件はヘッダーだけ出して、押すと本文の画面へ移る */
a.report-link {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
}
a.report-link:hover { border-color: var(--accent-dark); background: var(--bg); }
a.report-link .report-head { flex: 1; min-width: 0; }
a.report-link .chevron { color: var(--muted); font-size: 24px; line-height: 1; }
a.back { display: inline-block; text-decoration: none; margin: 4px 0; }
a.back:hover { text-decoration: underline; }
.report-card h4 { color: var(--muted); }
.report-card pre {
  white-space: pre-wrap; word-break: break-word; font: inherit;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; margin: 0;
}
.report-card .grade { margin-left: 10px; font-weight: 400; }
.empty-block {
  color: var(--muted); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px; text-align: center;
}

/* --- 前日リマインド ------------------------------------------------- */

/* 通知の本文は改行をそのまま見せる。1行に潰すと、兄弟や複数コマが
   1通にまとまっているかを画面で確かめられなくなる。 */
.notif-body {
  white-space: pre-wrap; word-break: break-word;
  font: inherit; font-size: 12px; line-height: 1.6;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; margin: 0;
  max-width: 34em;
}

.badge.rem-SENT      { color: var(--open); border-color: #a8d8bb; background: #eefaf2; }
.badge.rem-READY     { color: #1f5c8a; border-color: #a8cbe8; background: #eaf4fb; }
.badge.rem-DRY_RUN   { color: #8a6d1f; border-color: #e8d08a; background: #fdf6e3; }
.badge.rem-NO_DEVICE { color: var(--muted); border-color: var(--line); background: #fafafa; }
.badge.rem-FAILED    { color: var(--danger); border-color: #eab0a8; background: #fdeeec; }

/* 「実際には送られない」ことを目立たせる。見落とすと、送ったつもりになる */
.hint.warn {
  color: #8a6d1f; background: #fdf6e3; border: 1px solid #e8d08a;
  border-radius: var(--radius); padding: 8px 12px;
}

.inline-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.inline-check input { width: auto; }

/* --- 授業予定（コマ管理） -------------------------------------------- */

.weekday-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 10px 0;
}
.wd-label { font-size: 12px; color: var(--muted); }
.wd-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; background: var(--panel); cursor: pointer;
  font-size: 13px;
}
.wd-chip:has(input:checked) {
  background: var(--accent); border-color: var(--accent-dark); color: #fff;
}
.wd-chip input { margin: 0; }

/* 作る前に日付を全部見せる。曜日と期間からだと何件できるか読み取れない */
.preview-dates {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 10px 0; max-height: 240px; overflow-y: auto;
}
.date-chip {
  font-size: 12px; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); white-space: nowrap;
}
.date-chip.dup {
  color: var(--muted); background: #fafafa; text-decoration: line-through;
}
/* 予定が重なる日。作らない（すでに予定のある時間帯には入れない） */
.date-chip.clash {
  color: var(--danger); border-color: #eab0a8; background: #fdeeec; text-decoration: line-through;
}
.tp { display: inline-flex; align-items: center; gap: 2px; }
.tp select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--panel); }

.editor-row > td { background: var(--bg); }

/* --- 欠席・遅刻の連絡 ------------------------------------------------ */

.lesson-card { margin-bottom: 10px; }
.lesson-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.lesson-head .slot { font-size: 16px; }
.lesson-meta { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }

.absence-form {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
}
.absence-form label { display: block; font-size: 12px; color: var(--muted); }
.absence-form input, .absence-form select {
  display: block; font: inherit; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
}
.absence-form .reason input { min-width: 220px; }

/* すでに連絡が入っている回。出席に戻す導線だけ残す */
.notice-box {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px;
}
.notice-box p { margin: 0 0 6px; }

.code-block {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px;
  font-size: 13px; overflow-x: auto; margin: 6px 0;
}

/* --- 予約: 色のルール（momotech予約アプリ.md） --------------------------
   緑 = 確定 / 黄 = 調整中（教室が作業中） / オレンジ = 保護者の返事待ち
   黄とオレンジを分けるのは「次に動くのは誰か」を取り違えないため */

:root {
  --bk-green: #2f9e5b;   --bk-green-bg: #e6f6ec;
  --bk-yellow: #b08900;  --bk-yellow-bg: #fff6cc;
  --bk-orange: #d9661c;  --bk-orange-bg: #fdeadb;
}

.badge.bk-confirmed { color: var(--bk-green); border-color: #a8d8bb; background: var(--bk-green-bg); }
.badge.bk-pending   { color: var(--bk-yellow); border-color: #ecd77a; background: var(--bk-yellow-bg); }
.badge.bk-proposed  { color: var(--bk-orange); border-color: #f0b58a; background: var(--bk-orange-bg); }
.badge.bk-muted,
.badge.bk-DECLINED,
.badge.bk-CANCELED  { color: var(--muted); border-color: var(--line); background: #fafafa; }
.badge.bk-CONFIRMED,
.badge.bk-ACCEPTED  { color: var(--bk-green); border-color: #a8d8bb; background: var(--bk-green-bg); }
.badge.bk-PENDING   { color: var(--bk-yellow); border-color: #ecd77a; background: var(--bk-yellow-bg); }
.badge.bk-PROPOSED  { color: var(--bk-orange); border-color: #f0b58a; background: var(--bk-orange-bg); }

/* --- 保護者: 授業カレンダー ------------------------------------------- */

.cal-head {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 8px 0 6px;
}
.cal-head strong { font-size: 18px; min-width: 8em; text-align: center; }
.cal-head .ghost { padding: 4px 14px; font-size: 18px; }

.cal-legend {
  list-style: none; display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: center; padding: 0; margin: 0 0 10px; font-size: 12px; color: var(--muted);
}
.cal-legend li { display: flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.t-confirmed { background: var(--bk-green); }
.dot.t-pending   { background: #f2c200; }
.dot.t-proposed  { background: var(--bk-orange); }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px;
  max-width: 760px; margin: 0 auto;
}
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }
.cal-wd.sun, .cal-day.sun { color: #c0392b; }
.cal-wd.sat, .cal-day.sat { color: #1f5c8a; }
.cal-cell {
  min-height: 72px; padding: 4px; border-radius: 6px; text-align: left;
  display: flex; flex-direction: column; gap: 3px; align-items: stretch;
  background: var(--panel); border: 1px solid var(--line);
}
.cal-cell.blank { background: transparent; border-color: transparent; }
.cal-cell.past { opacity: .55; }
.cal-cell.bookable { background: #fffdf7; }
.cal-cell.today .cal-day {
  background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px;
}
.cal-cell.selected { outline: 2px solid var(--accent); border-color: transparent; }
.cal-day { font-size: 12px; font-weight: 600; align-self: flex-start; }
.cal-chips { display: flex; flex-direction: column; gap: 2px; }
.chip {
  font-size: 11px; line-height: 1.5; border-radius: 4px; padding: 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip.t-confirmed { background: var(--bk-green); color: #fff; }
.chip.t-pending   { background: var(--bk-yellow-bg); color: var(--bk-yellow); border: 1px solid #ecd77a; }
.chip.t-proposed  { background: var(--bk-orange); color: #fff; }
.chip.t-muted     { background: #eceef1; color: var(--muted); text-decoration: line-through; }
.chip.t-declined-original {
  background: transparent; color: var(--muted); border: 1px dashed #c9ccd2;
  text-decoration: line-through;
}

.day-panel {
  max-width: 760px; margin: 16px auto 0; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 16px;
}
.day-panel h2 { margin: 0 0 10px; font-size: 16px; }
.day-panel h3 { margin: 0 0 8px; font-size: 14px; }

.ev {
  border: 1px solid var(--line); border-left-width: 5px;
  border-radius: var(--radius); padding: 10px 12px; margin: 0 0 10px;
}
.ev.t-confirmed { border-left-color: var(--bk-green); }
.ev.t-pending   { border-left-color: #f2c200; background: #fffdf2; }
.ev.t-proposed  { border-left-color: var(--bk-orange); background: #fffaf6; }
.ev.t-muted     { border-left-color: #c9ccd2; color: var(--muted); }
.ev-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.ev-meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.ev-original { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.small-btn { margin-top: 8px; padding: 4px 12px; font-size: 13px; }

.proposal { margin: 10px 0 4px; }
.pr-row { display: flex; align-items: baseline; gap: 10px; }
.pr-label { font-size: 12px; color: var(--muted); min-width: 4.5em; }
.pr-old { color: var(--muted); }
.pr-new { font-size: 16px; }
.pr-arrow { color: var(--bk-orange); margin: 2px 0 2px 1.5em; }
.pr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.decline-form, .book-form {
  display: grid; gap: 8px; margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.decline-form[hidden], .book-form[hidden] { display: none; }
.decline-form label, .book-form label { display: grid; gap: 4px; font-size: 13px; }
.decline-form input, .decline-form select,
.book-form input, .book-form select {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; font: inherit; background: var(--panel);
}
.book-form .primary, .decline-form .primary { justify-self: start; }

/* その月のご希望が回数より少ないとき（承認してもらう） */
.count-box {
  max-width: 760px; margin: 0 auto 16px; background: var(--bk-yellow-bg);
  border: 1px solid #ecd77a; border-radius: 12px; padding: 12px 16px;
}
.count-alert + .count-alert { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #ecd77a; }
.count-alert p { margin: 0; }
.count-alert .hint { margin-top: 6px; }

/* まとめて希望を出す（曜日・複数の日） */
.bulk-bar { max-width: 760px; margin: 0 auto 10px; text-align: center; }
.bulk-bar .hint { margin: 0; }
.bulk-bar .ok-msg { text-align: left; white-space: pre-line; }
.cal-cell.picked { background: var(--bk-yellow-bg); outline: 2px solid var(--accent); border-color: transparent; }
.cal-cell.picked .cal-day::after { content: " ✓"; color: var(--accent-dark); }
.wd-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.wd-pick { min-width: 44px; padding: 6px 0; border-radius: 999px; font-weight: 600; }
.wd-pick.sun { color: #c0392b; }
.wd-pick.sat { color: #1f5c8a; }
.wd-pick.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.wd-pick.on:hover:not(:disabled) { background: var(--accent-dark); }
.wd-pick:disabled { opacity: .35; }
.bulk-days { margin: 0; font-size: 13px; }
.period-field { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.period-field legend { font-size: 13px; padding: 0; margin-bottom: 4px; }
.period-field legend small { margin-left: 8px; }
.period-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.book-form label.period-pick {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--panel);
}
.book-form label.period-pick:has(input:checked) {
  background: var(--accent); border-color: var(--accent-dark); color: #fff; font-weight: 600;
}
.period-pick input { margin: 0; accent-color: var(--accent-dark); }

.reply-box {
  max-width: 760px; margin: 0 auto 16px; background: var(--bk-orange-bg);
  border: 1px solid #f0b58a; border-radius: 12px; padding: 14px 16px;
}
.reply-box h2 { margin: 0 0 4px; font-size: 16px; color: var(--bk-orange); }
.reply-box .ev { background: var(--panel); }

@media (max-width: 600px) {
  .cal-grid { gap: 2px; }
  .cal-cell { min-height: 56px; padding: 3px 2px; }
  .chip { font-size: 10px; padding: 0 2px; }
}

/* --- 予定表（塾長・講師） ------------------------------------------- */

.swatch {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  vertical-align: -1px; margin-right: 4px; border: 1px solid transparent;
}
.sw-confirmed { background: #92d050; }
.sw-pending   { background: #ffff00; border-color: #e0d000; }
.sw-proposed  { background: var(--bk-orange); }
.sw-original  { background: transparent; border: 1px dashed #9aa0a8; }
.sw-trial     { background: #ffccff; }

.sched-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 8px 0; }
.sched-bar .cal-head { margin: 0; }
.sched-bar .cal-legend { margin: 0; justify-content: flex-start; }

.pending-box {
  background: #fffbe0; border: 1px solid #ecd77a; border-radius: 12px;
  padding: 10px 14px; margin: 0 0 12px;
}
.pending-box h2 { margin: 0 0 6px; font-size: 15px; }
.pending-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pending-item { padding: 4px 10px; font-size: 13px; background: #fff; }

.sched-wrap {
  overflow: auto; max-height: calc(100vh - 200px);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
table.sched { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.sched th, .sched td {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 2px 3px; vertical-align: top; min-width: 62px; background: var(--panel);
}
.sched thead th {
  position: sticky; top: 0; z-index: 2; background: #f3f4f6;
  text-align: center; line-height: 1.2; padding: 4px 2px;
}
.sched thead th.sat { color: #1f5c8a; }
.sched thead th.sun { color: #c0392b; }
.sched thead th.today { background: var(--accent); color: #fff; }
.sched .sticky-col {
  position: sticky; left: 0; z-index: 1; min-width: 120px; max-width: 150px;
  text-align: left; background: #fafafa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sched thead .sticky-col { z-index: 3; }
.sched tr.sec th, .sched tr.sec td { background: #ffe699; font-weight: 700; }
.sched tr.sec td a { font-weight: 400; font-size: 12px; }
.sched td.today { background: #fffdf2; }
.sched td.clickable { cursor: pointer; }
.sched td.clickable:hover { background: #f5f8ff; }
.sched td.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.sched .note-col { min-width: 120px; max-width: 200px; white-space: pre-wrap; font-size: 11px; }
.sched .s-name small { color: var(--muted); }
.sched .unsub {
  margin-left: 4px; font-size: 10px; color: var(--danger);
  border: 1px solid #eab0a8; border-radius: 999px; padding: 0 5px;
}

.sched td.sh { text-align: center; font-size: 11px; white-space: nowrap; }
.sh-OK      { color: var(--open); }
.sh-PARTIAL { background: #ddebf7 !important; color: #1f5c8a; }
.sh-NG      { background: #f1f2f4 !important; color: #9aa0a8; }

.sched .chip { display: block; margin: 1px 0; font-size: 11px; }
.chip.c-confirmed { background: #92d050; color: #1f3b0f; }
.chip.c-pending   { background: #ffff00; color: #5c5200; border: 1px solid #e0d000; }
.chip.c-proposed  { background: var(--bk-orange); color: #fff; }
.chip.c-original  { background: transparent; color: var(--muted); border: 1px dashed #9aa0a8; }
.chip.c-muted     { background: #eceef1; color: var(--muted); text-decoration: line-through; }

/* 教室の予定（保護者には見えない）。予定表のピンク・青 */
.ev-TRIAL { background: #ffccff !important; }
.ev-CHORE { background: #bdd7ee !important; }
.ev-ADULT { background: #e2efda !important; }
.ev-INTERVIEW { background: #fff2cc !important; }
.chip.ev-TRIAL, .chip.ev-CHORE, .chip.ev-ADULT, .chip.ev-INTERVIEW { color: var(--text); }

.sched-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100%;
  background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -6px 0 18px rgba(0, 0, 0, .08); padding: 14px 16px; overflow-y: auto; z-index: 20;
}
.sched-panel[hidden] { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.panel-head strong { font-size: 15px; }
.pbox {
  border: 1px solid var(--line); border-left-width: 5px; border-radius: var(--radius);
  padding: 8px 10px; margin: 0 0 10px;
}
.pbox.t-confirmed { border-left-color: #92d050; }
.pbox.t-pending   { border-left-color: #f2c200; background: #fffdf2; }
.pbox.t-proposed  { border-left-color: var(--bk-orange); background: #fffaf6; }
.pbox.t-original  { border-left-style: dashed; color: var(--muted); }
.pbox.t-muted     { border-left-color: #c9ccd2; }
.pbox p { margin: 4px 0 0; }
.pbox details { margin-top: 6px; }
.pbox summary, .add-lesson summary { cursor: pointer; font-size: 13px; color: var(--accent-dark); }
.pform { display: grid; gap: 6px; margin-top: 8px; }
.pform h4 { margin: 4px 0 0; }
.pform .prow { display: flex; gap: 8px; }
.pform .pf { display: grid; gap: 2px; font-size: 12px; flex: 1; }
.pform input, .pform select, .pform textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font: inherit; width: 100%;
  background: var(--panel);
}
.pform .primary, .pform .ghost { justify-self: start; }
.pactions { display: flex; gap: 8px; flex-wrap: wrap; }
.propose { margin-top: 8px; }
.danger-link { color: var(--danger); margin-top: 8px; display: inline-block; }
.add-lesson { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }

.migrate-box { margin-top: 24px; }
.migrate-box summary { cursor: pointer; font-weight: 600; }
.mig-opts { display: grid; gap: 8px; margin: 10px 0; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.mig-opts .inline-check { margin-right: 12px; font-size: 13px; }

/* 講師の行：その講師が入る授業。マスの色がシフト */
.sched td.tcell { min-width: 74px; }
.sched td.tcell.av-OK      { background: #ffffff; }
.sched td.tcell.av-PARTIAL { background: #e6f1fb; }
.sched td.tcell.av-NG      { background: repeating-linear-gradient(135deg, #eceef1 0 4px, #f6f7f9 4px 8px); }
.sched td.tcell.av-none    { background: #f6f7f9; }
.sched td.tcell .sh-text { display: block; font-size: 9px; color: var(--muted); line-height: 1.3; white-space: nowrap; }
.sched .t-row th.t-name { vertical-align: middle; }
.sched .t-load {
  display: inline-block; margin-left: 4px; font-size: 10px; padding: 0 5px; border-radius: 999px;
  background: #eef1f5; color: var(--muted);
}
.chip.tchip { cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 124px; }
.chip.tchip[draggable="true"] { cursor: grab; }
.chip.dragging { opacity: .4; }
.sched td.drop-hover { outline: 2px dashed #2f6fbf; outline-offset: -2px; background: #eaf2fd !important; }
.chip.c-trial { background: #ffccff; color: #6b1f5c; }
.sched tr.sec-trial th, .sched tr.sec-trial td { background: #ffd9f7; }
.sched tr.trial-row th.s-name { background: #fff0fc; }
.sched .sec-toggle { margin-left: 12px; font-weight: 400; cursor: pointer; }
.item-btn { display: block; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.item-btn:hover:not(:disabled) { outline: 2px solid var(--accent); }
.item-btn:disabled { cursor: default; opacity: 1; }
.pbox.shift-box { border-left-width: 1px; }
.pbox.shift-box.av-PARTIAL { background: #e6f1fb; }
.pbox.shift-box.av-NG, .pbox.shift-box.av-none { background: #f1f2f4; }
.maybe-tag.edited { color: #1f4f8a; border-color: #a8c6ea; background: #eaf2fd; }
.trial-result { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }

/* 教室の印 [百][今][オ] */
.room-tag {
  display: inline-block; min-width: 1.4em; margin-right: 3px; padding: 0 3px; border-radius: 3px;
  font-size: 10px; font-weight: 700; line-height: 1.5; text-align: center; color: #fff; vertical-align: 1px;
}
.room-tag.rm-a { background: #1f5c8a; }     /* 百道教室 */
.room-tag.rm-b { background: #0f766e; }     /* 今宿教室 */
.room-tag.rm-o { background: #7c3aed; }     /* オンライン */
.room-tag.rm-h { background: #b45309; }     /* 在宅（雑務） */
.room-tag.rm-x { background: #6b7280; }
.room-tag.rm-none { background: #d1d5db; color: #374151; }
.room-filter { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-right: 12px; font-weight: 400; }
.rf-btn { padding: 1px 8px; font-size: 11px; border-radius: 999px; background: #fff; }
.rf-btn.on { background: var(--accent); border-color: var(--accent-dark); font-weight: 700; }
.sched td.tcell.two-rooms { box-shadow: inset 0 0 0 2px #e0a3a3; }
.two-rooms-tag {
  display: inline-block; margin: 0 0 2px; padding: 0 5px; border-radius: 999px; font-size: 9px; font-weight: 700;
  color: var(--danger); background: #fdeeec; border: 1px solid #eab0a8;
}
.me-room { margin-top: 6px; padding-left: 8px; border-left: 3px solid var(--line); }
.me-room-name { font-size: 12px; font-weight: 700; }

/* 時刻（時と 00・15・30・45 分） */
.tp { display: inline-flex; align-items: center; gap: 2px; }
.tp select, .pform .tp select, .invite-form .tp select { width: auto; min-width: 64px; flex: none; }
.invite-form label > .tp { display: flex; }
/* 時間（長さ）→ 終了は自動 */
.tp-endpick { flex-wrap: wrap; gap: 4px 8px; }
.tp-end { font-size: 13px; font-weight: 700; white-space: nowrap; }
.tp-end.bad { color: var(--danger); font-weight: 400; white-space: normal; }

/* 講師のアカウント：自分のシフトと授業 */
.sched-me td.tcell { min-width: 86px; height: 64px; }
.me-list { display: grid; gap: 6px; max-width: 760px; }
.me-day { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; background: var(--panel); }
.me-day.av-PARTIAL { background: #f2f8fd; }
.me-date { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.me-date .two-rooms-tag { font-size: 11px; margin: 0; }
.warn-text { color: var(--danger); margin-top: 2px; }
#meList { margin-top: 16px; }
.me-item { margin-top: 4px; font-size: 13px; }

/* 講師の欄：○△× と入室時間 */
.sched td.sh small { display: block; font-size: 9px; color: var(--muted); line-height: 1.2; }
.sched tr.sec td .sec-link { margin-left: 12px; }
.sched tr.sec td { font-weight: 400; font-size: 11px; color: #5c4a00; }

/* 生徒の回数（入っている数／回数） */
.sched .cnt {
  display: inline-block; margin-left: 4px; font-size: 10px; padding: 0 5px; border-radius: 999px;
  border: 1px solid #a8d8bb; color: var(--open); background: #eefaf2;
}
.sched .cnt.short { border-color: #eab0a8; color: var(--danger); background: #fdeeec; }
.sched .note-col small { display: block; }
.sched .nc-lesson_count { min-width: 44px; text-align: center; }
.sched .nc-regular, .sched .nc-courses { min-width: 150px; }

/* 割り振り案 */
.sw-plan { background: #eaf2fd; border: 1px dashed #2f6fbf; }
.chip.c-plan { background: #eaf2fd; color: #1f4f8a; border: 1px dashed #2f6fbf; }
.chip.c-plan.maybe { background: #fff6cc; }
.plan-box {
  background: #f3f8ff; border: 1px solid #a8c6ea; border-radius: 12px;
  padding: 12px 16px; margin: 0 0 12px;
}
.plan-box[hidden] { display: none; }
.plan-head { display: flex; align-items: center; gap: 10px; }
.plan-head h2 { margin: 0; font-size: 16px; }
.plan-box .actions { border-top-color: #cfe0f5; }
.badge.plan-badge { color: #1f4f8a; border-color: #a8c6ea; background: #eaf2fd; }
.badge.xl-short { color: var(--danger); border-color: #eab0a8; background: #fdeeec; }
.plan-table td { vertical-align: top; }
.plan-line { font-size: 12px; padding: 1px 0; }
.plan-kind { display: inline-block; min-width: 7.5em; color: var(--muted); }
.plan-line.k-confirm .plan-kind { color: var(--bk-green); }
.plan-line.k-propose .plan-kind { color: var(--bk-orange); }
.maybe-tag {
  margin-left: 6px; font-size: 10px; padding: 0 5px; border-radius: 999px;
  border: 1px solid #ecd77a; color: var(--bk-yellow); background: var(--bk-yellow-bg);
}
.pbox.t-plan { border-left-color: #2f6fbf; border-left-style: dashed; background: #f3f8ff; }

/* 生徒の設定（回数・コース・いつもの枠） */
.note-form h4 { margin: 10px 0 0; border-top: 1px dashed var(--line); padding-top: 8px; }
.c-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.c-row select, .c-row input { width: auto; flex: 1 1 auto; min-width: 0; }
.c-row .c-min { flex: 0 0 72px; }
/* いつもの枠：曜日・開始・教室を1段目、講師と「外す」を2段目に */
.r-row {
  display: grid; grid-template-columns: 56px 1fr 1fr; gap: 4px; align-items: center;
  padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfc;
}
.r-row .r-teacher { grid-column: 1 / 3; }
.r-row [data-remove-row] { justify-self: end; }
.c-box, .r-box { display: grid; gap: 4px; }

/* 保護者のカレンダー：次月の予約方法 */
.book-guide {
  max-width: 760px; margin: 0 auto 12px; padding: 10px 12px; font-size: 13px;
  background: #fff7e6; border: 1px solid #f5d9a8; border-radius: var(--radius);
}
.book-guide[hidden] { display: none; }

/* シフト：まとめて時間を入れる */
.shift-tools { flex-direction: column; align-items: center; }
.shift-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: center; }
.shift-bulk select { padding: 2px 4px; border: 1px solid var(--line); border-radius: 4px; }
.sg-times select { width: 100%; min-width: 0; font-size: 11px; padding: 1px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }

/* 時間割・コース */
.tt-box { padding: 16px 20px; margin-bottom: 14px; }
.tt-box h2 { margin-top: 0; }
.tt-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.course-table input[type="text"], .course-table input:not([type]) {
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font: inherit; width: 100%;
}
.course-table td.center { text-align: center; }
.course-table tr.inactive td { opacity: .55; }
.row-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

@media (max-width: 600px) {
  .sched-wrap { max-height: none; }
}

/* --- シフト提出 ----------------------------------------------------- */

.shift-overview { padding: 16px; margin-bottom: 12px; }
.shift-overview h2 { margin-top: 0; }
.ov-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ov-item { padding: 3px 10px; font-size: 13px; }
.ov-item.done { border-color: #a8d8bb; background: #f4fbf6; }
.ov-item.yet  { border-color: #ecd77a; background: #fffbe8; }
.ov-item.yet span { color: var(--bk-yellow); }
.ov-item.on   { outline: 2px solid var(--accent); }
.shift-status { text-align: center; margin: 4px 0 10px; }
.room-pref-row { display: flex; flex-wrap: wrap; gap: 8px; }
.room-pref-row select { max-width: 100%; }
.shift-status .locked { color: var(--danger); }
.shift-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 8px; }
.shift-tools[hidden], .shift-bulk[hidden], .actions[hidden] { display: none; }
.shift-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px;
  max-width: 900px; margin: 0 auto;
}
.sg-wd { text-align: center; font-size: 12px; color: var(--muted); }
.sg-wd.sun, .sg-num.sun { color: #c0392b; }
.sg-wd.sat, .sg-num.sat { color: #1f5c8a; }
.sg-day {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px; min-height: 70px; display: flex; flex-direction: column; gap: 4px;
}
.sg-day.blank { background: transparent; border-color: transparent; }
.sg-day.m-OK      { border-color: #a8d8bb; background: #f4fbf6; }
.sg-day.m-PARTIAL { border-color: #a8cbe8; background: #f2f8fd; }
.sg-day.m-NG      { background: #f3f4f6; }
.sg-num { font-size: 12px; font-weight: 700; }
.sg-num small { font-weight: 400; color: var(--muted); }
.sg-marks { display: flex; gap: 3px; }
.sg-mark { flex: 1; padding: 2px 0; font-size: 14px; min-width: 0; }
.sg-mark.on { background: var(--accent); border-color: var(--accent-dark); color: #fff; font-weight: 700; }
/* △ の時間。横に並べると狭くて読めないので縦に積む */
.sg-times { display: flex; flex-direction: column; align-items: stretch; gap: 1px; font-size: 10px; text-align: center; }
.sg-times input { width: 100%; min-width: 0; font-size: 12px; padding: 1px 2px; border: 1px solid var(--line); border-radius: 4px; }

/* 締切後のシフト変更依頼。注意度：高＝その日にレッスンあり（赤）／低＝レッスンなし（黄） */
.sg-req { font-size: 10px; color: #8a6d1f; background: #fdf6e3; border-radius: 4px; text-align: center; }
.sg-req-btn { font-size: 11px; padding: 1px 2px; }
.shift-changes { padding: 16px; margin: 12px auto; max-width: 900px; }
.shift-changes h2 { margin-top: 0; }
.chg-item { border: 1px solid var(--line); border-left-width: 6px; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; background: var(--panel); }
.chg-item.alert-HIGH { border-left-color: var(--danger); background: #fdeeec; }
.chg-item.alert-LOW  { border-left-color: #e8d08a; background: #fffbe8; }
.chg-item.st-REJECTED, .chg-item.st-CANCELED { opacity: .65; }
.chg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.chg-lessons { color: var(--danger); font-size: 13px; }
.chg-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.alert-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; }
.alert-chip.alert-HIGH { color: #fff; background: var(--danger); }
.alert-chip.alert-LOW  { color: #8a6d1f; background: #f6e7b0; }
.shift-req-dialog { border: 1px solid var(--line); border-radius: var(--radius); max-width: min(420px, calc(100vw - 32px)); width: 100%; }
.shift-req-dialog h2 { margin-top: 0; font-size: 18px; }
.shift-req-dialog .sg-marks { margin: 8px 0; }
.shift-req-dialog .sg-mark { font-size: 18px; padding: 6px 0; }
.shift-req-dialog .sg-times { flex-direction: row; gap: 6px; font-size: 14px; margin-bottom: 8px; }
.shift-req-dialog .sg-times[hidden] { display: none; }
.shift-req-dialog textarea { width: 100%; box-sizing: border-box; }

@media (max-width: 600px) {
  .shift-grid { gap: 2px; }
  .sg-day { padding: 2px; }
  .sg-mark { font-size: 12px; }
}

/* 講師への連絡文（欠席・遅刻の連絡） */
.msg-lessons { margin-top: 14px; }
.msg-lessons input[type="checkbox"] { width: 18px; height: 18px; }
.msg-out { display: grid; gap: 16px; margin-top: 8px; }
.msg-item { display: grid; gap: 8px; }
.msg-item h3 { margin: 0; font-size: 15px; }
.msg-item textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; line-height: 1.6;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
}
.msg-actions { display: flex; gap: 8px; }

/* メッセージ（塾長 ⇔ 保護者・報告書のチャット欄） */
.badge-count {
  display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  text-align: center; line-height: 18px;
}
.badge-count[hidden] { display: none; }
.chat-card { margin-top: 20px; padding: 16px 20px; }
.chat-card h3 { margin: 0 0 4px; }
.chat { display: grid; gap: 10px; }
.chat-list {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 60vh; min-height: 160px; overflow-y: auto;
  padding: 12px; background: var(--bg); border-radius: var(--radius);
}
.chat-empty { color: var(--muted); font-size: 13px; text-align: center; margin: auto; }
.chat-row { display: flex; flex-direction: column; max-width: 78%; }
.chat-row.mine { align-self: flex-end; align-items: flex-end; }
.chat-row.theirs { align-self: flex-start; align-items: flex-start; }
.chat-bubble {
  white-space: pre-wrap; word-break: break-word; line-height: 1.6; font-size: 14px;
  padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
}
.chat-row.mine .chat-bubble { background: #fff3dc; border-color: #f3d39b; }
.chat-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea {
  flex: 1; font: inherit; font-size: 14px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px;
}
.msg-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .msg-layout { grid-template-columns: 1fr; } }
.msg-threads, .msg-pane {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.msg-new select { width: 100%; padding: 6px 8px; font: inherit; border: 1px solid var(--line); border-radius: var(--radius); }
.thread-list { display: grid; gap: 4px; margin-top: 10px; max-height: 70vh; overflow-y: auto; }
.thread-item {
  display: grid; gap: 2px; text-align: left; width: 100%;
  border: 1px solid transparent; padding: 8px 10px;
}
.thread-item.on { background: #fff7e6; border-color: var(--accent); }
.thread-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.thread-sub, .thread-time { font-size: 11px; color: var(--muted); }
.thread-last { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-head h2 { margin: 0; }
.thread-head { margin-bottom: 10px; }

/* 雑務の自動調整（シフトの画面・塾長） */
.chore-card { margin-top: 20px; padding: 16px 20px; }
.chore-card h2 { margin-top: 0; }
.chore-warn { margin: 10px 0 0; padding: 0 0 0 18px; color: var(--closed); font-size: 13px; }
.chore-table { margin-top: 12px; }
.chore-table input[type="checkbox"] { width: 18px; height: 18px; }
.chore-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }

/* 教室からのお知らせ（塾長が送る・保護者が読む） */
.ann-title { width: 100%; padding: 8px 10px; font: inherit; }
.ann-card h2 { margin: 4px 0 8px; }
.ann-body { margin: 0; white-space: pre-wrap; word-break: break-word; }
.ann-new { color: var(--danger); border-color: #eab0a8; background: #fdeeec; }
.ann-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ann-actions { display: flex; gap: 8px; margin-top: 10px; }

/* 面接日の調整（予定表の画面・塾長）。雑務の自動調整と同じ形 */
.interview-pick { display: flex; align-items: center; gap: 8px; }
.interview-text { width: 100%; min-height: 9em; margin-top: 10px; padding: 8px 10px; font: inherit; font-size: 14px; }

/* 来月の希望日の締切（保護者のカレンダー） */
.next-month {
  margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  background: #fdeeec; border: 1px solid #eab0a8; color: var(--danger);
}
.next-month.done { background: #eefaf2; border-color: #a8d8bb; color: var(--open); font-weight: 400; }

/* 連絡文の「確認しました」（塾長⇔講師のチャット） */
.chat-ack { font-size: 12px; margin-top: 4px; font-weight: 700; }
.chat-ack.done { color: var(--open); }
.chat-ack.wait { color: var(--muted); font-weight: 400; }
.chat-ack-btn {
  margin-top: 6px; padding: 6px 14px; font-weight: 700;
  background: var(--open); border-color: var(--open); color: #fff;
}
.chat-ack-btn:hover:not(:disabled) { background: #256641; }
.thread-wait { font-size: 11px; color: var(--closed); }

/* --- 振替の希望（保護者・塾長） --- */
.wish-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.wish-row select { padding: 6px 8px; }
.wish-rank { font-size: 12px; color: var(--muted); min-width: 4.5em; }
.wish-row .small-btn { margin-top: 0; }
.wish-list { margin: 6px 0; padding-left: 1.2em; font-size: 13px; }
.makeup-form label.small { display: grid; gap: 4px; max-width: 420px; }
.makeup-form input { padding: 6px 8px; }
.makeup-detail h3 { margin: 18px 0 6px; font-size: 15px; }
.report-table tr.makeup-best td { background: #eefaf2; }
.chip.c-makeup-wait { background: #fff; color: var(--danger); border: 1px dashed var(--danger); }
.pbox.t-makeup-wait { border-left-color: var(--danger); background: #fdf5f4; }
.makeup-wait-tag { color: var(--danger); border-color: #eab0a8; }
.makeup-wait-notice a { margin: 0 2px; }
.chat-ack-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chat-ack-btns .chat-ack-btn { margin-top: 0; }
.chat-decline-btn { padding: 6px 14px; font-weight: 700; background: #fff; color: var(--danger); border-color: var(--danger); }
.chat-ack.declined { color: var(--danger); }
.declined-note { color: var(--danger); }

/* --- 報酬・業務委託の書類（pay_*.html） ------------------------------- */

.pay-bulk { margin: 8px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report-table td.num, .report-table tfoot td.num { text-align: right; white-space: nowrap; }
.report-table tfoot td { font-weight: bold; border-top: 2px solid var(--line); }
.pay-warn { color: var(--closed); }
.pay-teacher { border-top: 1px solid var(--line); padding: 8px 0 16px; }
.pay-teacher h3 { font-size: 15px; margin: 8px 0; }
.pay-contract { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; }
.pay-contract label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.pay-contract label.inline-check { flex-direction: row; align-items: center; gap: 4px; color: var(--text); }
.pay-contract label.wide { flex: 1 1 320px; }
.pay-contract input { padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; }
.commute-table tr.changed td { background: #fff8e8; }
.pay-doc-links a { font-weight: bold; }

/* 指導報告書の「無断欠席」ボタン（押すと本文を書かなくても提出できる） */
.no-show-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.no-show-btn[aria-pressed="true"] { background: #fdf3e0; border-color: #e8a53c; color: #7a4b00; font-weight: bold; }
.no-show-on .field textarea { background: #f7f7f7; }

/* 授業内容の「教科書の目次から入れる」。どこからどこまでを選ぶと間の行がまとめて入る */
.toc-pick {
  display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap;
  margin-top: 6px; padding: 8px 10px;
  border: 1px dashed var(--line); border-radius: var(--radius); background: #fbfcfd;
}
.toc-pick-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.toc-pick select {
  padding: 4px 6px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel);
}
.toc-pick #tocCourse { max-width: 180px; }
.toc-pick-range { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; min-width: 0; }
/* width: 0 は、長い項目名に引っ張られて右ペインごと横に広がるのを防ぐため */
.toc-pick-range select { flex: 1 1 0; width: 0; min-width: 0; }
.toc-pick button { padding: 4px 12px; font-size: 13px; white-space: nowrap; }

/* 時間割・コースの「教科書の目次」を直す欄 */
.course-table button { white-space: nowrap; }
.course-table tr.toc-row td { background: #fbfcfd; }
.course-table .toc-text {
  display: block; width: 100%; padding: 8px 10px; font: inherit; line-height: 1.6;
  border: 1px solid var(--line); border-radius: 6px; resize: vertical;
}

/* --- 保護者への請求・引落（billing_*.html） ---------------------------- */

a.button {
  display: inline-block; text-decoration: none; color: var(--text);
  border-radius: var(--radius); padding: 7px 16px; border: 1px solid var(--line);
}
a.button.disabled { opacity: .5; cursor: not-allowed; }
.debit-box h2 { font-size: 15px; margin: 0 0 6px; }
.bill-guardian { border-top: 1px solid var(--line); padding: 8px 0 16px; scroll-margin-top: 16px; }
.bill-guardian:target { background: #fff8e8; }
.bill-guardian h3 { font-size: 15px; margin: 8px 0; }
.bill-guardian h4 { font-size: 13px; margin: 12px 0 4px; }
.bill-guardian .pay-contract select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; }
.invoice-list .amount { font-size: 18px; font-weight: bold; }

/* 確定した授業なのに担当の講師のシフトが ×（schedule.js / shifts.lesson_conflicts）。見落とさないよう強く */
.conflict-box {
  border: 2px solid var(--danger); background: #fdeeec; border-radius: var(--radius);
  padding: 12px 16px; margin: 0 0 12px;
}
.conflict-box h2 { margin: 0 0 4px; color: var(--danger); font-size: 18px; }
.conflict-list { display: flex; flex-direction: column; gap: 4px; }
.conflict-item { text-align: left; border: 1px solid #eab0a8; background: #fff; }
.conflict-reason { color: var(--danger); font-weight: 700; }
.conflict-note { color: var(--danger); font-weight: 700; background: #fdeeec; border-radius: 6px; padding: 6px 8px; margin: 4px 0; }
.chip.shift-ng {
  background: var(--danger) !important; color: #fff !important; border-color: #8e2a20 !important;
  font-weight: 700; animation: shift-ng-blink 1.2s ease-in-out infinite alternate;
}
@keyframes shift-ng-blink { from { box-shadow: 0 0 0 0 rgba(192, 57, 43, .0); } to { box-shadow: 0 0 0 3px rgba(192, 57, 43, .45); } }
@media (prefers-reduced-motion: reduce) { .chip.shift-ng { animation: none; } }
.tile.danger { border-color: var(--danger); background: #fdeeec; }
.tile.danger .tile-num, .tile.danger .tile-label { color: var(--danger); font-weight: 700; }

/* 給与・交通費の決まり（業務委託の設定） */
.pay-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; margin: 8px 0 12px; }
.pay-rules label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.pay-rules label.changed { color: var(--accent-dark); font-weight: bold; }
.pay-rules .rule-input { display: flex; align-items: center; gap: 6px; }
.pay-rules input { width: 120px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; }
.pay-options input:disabled { background: #f3f4f6; }
/* 交通手段の入力の行。種類で出す欄を切り替える（pay_settings.js の optionForm） */
.pay-options tr.editing td { background: #fffaf0; }
.opt-form { gap: 8px 12px; }
.opt-form .opt-group { display: contents; }
.opt-form .opt-group[hidden] { display: none; }
.opt-form .opt-note { display: inline; align-self: center; }
.opt-form select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; }
.opt-form .small-btn, .pay-options .opt-actions .small-btn { margin-top: 0; }
.pay-options td.center { text-align: center; }
.pay-options td.opt-actions { text-align: right; }

/* --- シフトを教室ごとに分ける講師（shifts.js） ------------------------------- */
.sg-day.by-room .sg-room { font-size: 10px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.sg-day.by-room .sg-marks { margin-bottom: 1px; }
.room-split-tag {
  display: inline-block; margin-left: 4px; padding: 0 6px; font-size: 10px;
  border-radius: 999px; border: 1px solid #a8c6ea; color: #1f4f8a; background: #eaf2fd;
}
.by-room-box { margin: 4px 0; }
.room-basis { margin: 4px 0 10px; }
.shift-req-dialog #reqRoomBox { display: block; margin: 6px 0; }
.shift-req-dialog #reqRoomBox[hidden] { display: none; }
.sh-text.sh-room { color: #1f6b3a; }

/* --- 退出チェック（exit_checks.js） ----------------------------------------- */
.exit-card { padding: 18px 22px; margin-bottom: 16px; }
.exit-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.exit-head select, .exit-head input { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.exit-items { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.exit-item label {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--panel);
}
.exit-item input { width: 20px; height: 20px; }
.exit-item label:has(input:checked) { background: #eefaf2; border-color: #a8d8bb; }
.exit-item.important label { border-color: #f0c36d; background: #fff8e1; }
.exit-item.important label:has(input:checked) { background: #eefaf2; border-color: #a8d8bb; }
.exit-item.important .exit-label { font-weight: 700; }
.exit-label { font-size: 15px; }
.exit-hint { flex-basis: 100%; font-size: 12px; color: var(--muted); padding-left: 28px; }
.exit-log { list-style: none; padding: 0; margin: 0; }
.exit-log li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.exit-table td { min-width: 200px; }
.exit-table td.exit-missing { background: #fdeeec; }
.exit-miss { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--danger); border-radius: 999px; padding: 0 8px; }
.exit-entry { margin-bottom: 4px; }
.exit-table td.exit-acked { background: #f6f7f9; }
.exit-ack { display: inline-block; font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 8px; }
.exit-ack-btn { margin: 0 0 0 6px; padding: 1px 10px; font-size: 12px; }
.exit-acked .linkish { margin-left: 6px; }
.exit-bulk { margin: 4px 0 8px; }
.exit-bulk .small-btn { margin-top: 0; }
.exit-entry .linkish { margin-left: 6px; }
.exit-editors { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.exit-editor textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); }

/* --- 教科書の貸出（textbooks.js） --------------------------------------------- */
.tb-card { padding: 18px 22px; margin-bottom: 16px; }
.tb-card > summary { cursor: pointer; }
.tb-form { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.tb-form select, .tb-form input, .tb-add input, .tb-add select, .tb-table input, .tb-table select, .tb-note {
  font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.tb-books { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.tb-book label { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; }
.tb-book label:has(input:checked) { background: #eefaf2; border-color: #a8d8bb; }
.tb-book.full label { opacity: .55; cursor: not-allowed; }
.tb-loan { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0; background: var(--panel); }
.tb-loan.overdue { border-color: #eab0a8; background: #fdeeec; }
.tb-loan.st-REJECTED, .tb-loan.st-CANCELED, .tb-loan.st-RETURNED { color: var(--muted); }
.tb-loan-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.tb-loan-actions .small-btn { margin-top: 0; }
.tb-note { min-width: 240px; flex: 1; }
.tb-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.tb-add #tbNewTitle { min-width: 220px; flex: 1; }
.tb-add #tbNewCopies, .tb-copies { width: 70px; }
.tb-table tr.inactive td { opacity: .55; }
.tb-remind { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0; }
