:root {
  --bg: #f6f3ef;
  --surface: #ffffff;
  --surface-2: #f0ebe5;
  --text: #2a2220;
  --muted: #6b5f59;
  --line: #e2d9d0;
  --accent: #8a1538;       /* 鹿大のえんじ */
  --accent-ink: #ffffff;
  --today: #fff4e6;
  --live: #e8590c;
  --warn: #a85f00;
  --warn-ink: #ffffff;
  --danger-ink: #ffffff;
  --danger: #c92a2a;
  --c0: #f9d8de; --c0i: #7d1730;
  --c1: #ffe3c2; --c1i: #8a4a00;
  --c2: #fff1a8; --c2i: #6b5800;
  --c3: #d3f0cf; --c3i: #22632a;
  --c4: #cdeef0; --c4i: #0d5f66;
  --c5: #d6e4ff; --c5i: #1d4592;
  --c6: #e6dcff; --c6i: #4d2c99;
  --c7: #e9e3dc; --c7i: #4a403a;
  --radius: 12px;
  --grid-bg: #ece5dd;      /* 時間割の下地（空きコマは白） */
  --muted-strong: #5d514b;
  --pill: rgb(255 255 255 / .72);
  --gutter: 10px; /* 画面の左右の余白（狭い画面ほど小さく） */
  color-scheme: light;
}
@media (min-width: 48em) { :root { --gutter: 16px; } }
@media (max-width: 26.25em) { :root { --gutter: 6px; } }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171312;
    --surface: #221c1b;
    --surface-2: #2c2524;
    --text: #f1e9e5;
    --muted: #a99c96;
    --line: #3a3130;
    --accent: #e0708f;
    --accent-ink: #1a0b10;
    --today: #2c2118;
    --live: #ff8a4c;
    --warn: #f0b23a;
    --warn-ink: #1a1200;
    --danger-ink: #2a0505;
    --danger: #ff7b7b;
    --c0: #4a2430; --c0i: #ffc2d0;
    --c1: #4a3220; --c1i: #ffd3a3;
    --c2: #45401f; --c2i: #f5e48a;
    --c3: #23402a; --c3i: #b7e8b0;
    --c4: #1e3f42; --c4i: #a8e6ea;
    --c5: #233452; --c5i: #b9d0ff;
    --c6: #352a52; --c6i: #d5c6ff;
    --c7: #36302c; --c7i: #ddd3ca;
    --grid-bg: #120e0d;
    --muted-strong: #cdbfb8;
    --pill: rgb(0 0 0 / .28);
    color-scheme: dark;
  }
}

/*
  文字の大きさは rem で書く（ブラウザや端末の「文字サイズ」の設定に合わせて大きくなるように）。
  箱の高さは決め打ちせず、文字が大きくなったら箱も伸びるようにする。
  画面幅の切り替えも em で書くので、文字を大きくすると狭い画面向けの並びになる。
*/
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: .9375rem;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-wrap: anywhere;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

.c0 { --cb: var(--c0); --ci: var(--c0i); } .c1 { --cb: var(--c1); --ci: var(--c1i); }
.c2 { --cb: var(--c2); --ci: var(--c2i); } .c3 { --cb: var(--c3); --ci: var(--c3i); }
.c4 { --cb: var(--c4); --ci: var(--c4i); } .c5 { --cb: var(--c5); --ci: var(--c5i); }
.c6 { --cb: var(--c6); --ci: var(--c6i); } .c7 { --cb: var(--c7); --ci: var(--c7i); }

/* ---- 上の帯（1行：年度の矢印・前期/後期/集中・リンク・設定） ---- */
.top {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; font-size: min(1rem, 16px);
  padding: calc(4px + env(safe-area-inset-top)) var(--gutter) 6px;
  max-width: 90rem; margin: 0 auto;
  container-type: inline-size;
}
.yearnav { display: flex; align-items: center; flex: none; }
.year { font-weight: 800; font-size: .9375em; white-space: nowrap; }
.tools { display: flex; flex: none; margin-left: auto; }
.icon-btn {
  flex: none; border: 0; background: transparent; min-width: 2em; min-height: 2.5em; border-radius: 50%;
  font-size: 1.25em; color: var(--muted); line-height: 1; display: inline-grid; place-items: center; padding: 0;
}
.icon-btn svg { display: block; }
/* 画面の「×」は正方形（丸い枠・押したときの背景が縦長にならないように） */
.icon-btn[data-close] { width: 2.5em; height: 2.5em; min-width: 0; min-height: 0; }
.top .icon-btn { border-radius: 12px; }
#prevYear, #nextYear { color: var(--text); min-width: 2em; }
.icon-btn:hover { background: var(--surface-2); }

/* 前期→後期→集中と順に切り替えるボタン（押すたびに矢印が回る） */
.term-btn {
  flex: none; display: inline-flex; align-items: center; gap: .3em; border: 0; border-radius: 12px; background: var(--surface-2);
  color: var(--accent); font-weight: 800; font-size: 1em; padding: 0 .55em; min-height: 2.25em; white-space: nowrap; margin: 0 auto 0 2px;
}
.term-btn svg { flex: none; transition: transform .3s; }
.term-main { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.1; }
.term-dots { display: flex; gap: 3px; }
.term-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .25; }
.term-dots i.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .term-btn svg { transition: none; } }
.year small { font-size: inherit; }
@container (max-width: 20rem) { .year small { display: none; } }

main { max-width: 90rem; margin: 0 auto; padding: 0 var(--gutter) 40px; }
/* 広い画面では、時間割を左に広くとり、課題・集計を右に並べる */
@media (min-width: 60em) {
  main { display: grid; grid-template-columns: minmax(0, 1fr) clamp(15rem, 28vw, 22rem); column-gap: 16px; align-items: start; }
  main > * { grid-column: 1; }
  main > .side { grid-column: 2; grid-row: 1 / span 6; }
  .side > .panel:first-child { margin-top: 0; }
}

/* ---- 時間割 ----
   スマホでは枠を画面の左右いっぱいに広げ、表は常に画面に収める（横スクロールなし）。
   左は時限（大きな数字と、その下に開始・終了の時刻）、各コマは縦に長く、科目名を真ん中に、教室は下の丸いラベルに。 */
.grid-wrap {
  background: var(--grid-bg); border-radius: var(--radius); padding: 6px 4px 8px;
  overflow-x: auto; overscroll-behavior-x: contain;
}
.grid {
  /* コマの高さ：画面の高さ（バーが出ているときの高さ）から、上の部分を引いて、行の数で割る。入りきらないときは下限で止め、ページを下にスクロールする */
  --cell-h: clamp(4.75rem, calc((100svh - 8rem) / var(--rows, 5)), 7rem);
  --ph: 1.3rem; /* 時限の列：数字と、縦に並べた開始時刻（時／分）が入る幅。文字を大きくすると、一緒に広がる */
  width: 100%;
  border-collapse: separate; border-spacing: 4px; table-layout: fixed;
}
.grid thead th { font-size: .875rem; color: var(--muted); padding: 2px 0 4px; font-weight: 700; }
/* 今日の曜日は色のついた丸 */
.grid thead th > span { display: inline-grid; place-items: center; min-width: 2em; height: 2em; padding: 0 .2em; border-radius: 999px; line-height: 1; }
.grid thead th.today > span { background: var(--accent); color: var(--accent-ink); }
.grid th.corner, .ph { width: var(--ph); }
.ph { text-align: center; vertical-align: middle; color: var(--muted); padding: 0; }
.ph b { display: block; font-size: 1.125rem; font-weight: 800; color: var(--muted-strong); line-height: 1.2; }
.ph small { display: flex; flex-direction: column; align-items: center; margin-top: 2px; font-size: .625rem; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell { height: var(--cell-h); padding: 0; vertical-align: top; border-radius: 12px; background: var(--surface); }
.cell.today { background: var(--today); }
.cell.live, .cell.live .course { box-shadow: inset 0 0 0 2px var(--live); }
.cell > button { width: 100%; height: 100%; min-height: var(--cell-h); }
.empty { border: 0; background: transparent; color: transparent; font-size: 1.125rem; border-radius: 12px; }
.empty:hover, .empty:focus-visible { color: var(--muted); background: rgb(127 127 127 / .08); }
.stack { display: flex; flex-direction: column; gap: 3px; height: 100%; min-height: var(--cell-h); }
.course {
  border: 0; border-radius: 12px; padding: 6px 4px 5px; text-align: center;
  background: var(--cb); color: var(--ci); display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1 0 auto; min-width: 0; width: 100%; overflow: hidden;
}
.course.clash { outline: 2px dashed var(--danger); outline-offset: -2px; }
/* 科目名は空いたところの真ん中に */
.cname {
  margin-block: auto; font-size: .8125rem; font-weight: 700; line-height: 1.3; word-break: break-all; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}
/* 教室は下の丸いラベル（長いときは … で省略） */
.croom {
  display: block; max-width: 100%; box-sizing: border-box; padding: 0 .55em; border-radius: 999px;
  background: var(--pill); color: var(--ci); font-size: .625rem; font-weight: 700; line-height: 1.6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 欠席・課題のしるしは、文字に重ならないよう一番下の行に並べる */
.meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.abs, .dot {
  font-size: .625rem; font-weight: 800; line-height: 1.4; padding: 0 .35em; border-radius: 6px; white-space: nowrap;
}
.abs { background: var(--pill); color: var(--ci); }
.abs.warn { background: var(--warn); color: var(--warn-ink); }
.abs.edge, .abs.over { background: var(--danger); color: var(--danger-ink); }
.dot { background: var(--accent); color: var(--accent-ink); }

/* 候補 */
.cand-chip {
  flex: none; min-height: 1.5rem; border: 1px dashed var(--muted); background: var(--surface); color: var(--muted);
  border-radius: 6px; font-size: .625rem; font-weight: 700; padding: 1px 2px; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cand-cell {
  border: 1.5px dashed var(--muted); background: transparent; border-radius: 8px; padding: 4px;
  display: flex; flex-direction: column; gap: 2px; text-align: left; overflow: hidden; min-width: 0;
}
.cand-count { font-size: .625rem; font-weight: 800; color: var(--accent); white-space: nowrap; }
.cand-name {
  font-size: .625rem; line-height: 1.3; color: var(--ci); background: var(--cb); opacity: .8; border-radius: 4px; padding: 0 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.badge {
  display: inline-block; font-size: .6875rem; font-weight: 800; line-height: 1.5; padding: 0 .5em; margin-right: .4em; border-radius: 6px;
  border: 1px dashed currentColor; vertical-align: .15em; white-space: nowrap;
}
.badge.take { border-style: solid; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.course-line.cand { opacity: .75; border-left-style: dashed; }
.cand-box { display: grid; gap: 6px; }
.slot-links { margin: 0; font-size: .8125rem; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--accent); border-radius: 999px; padding: .55em 1em; min-height: 2.5rem; font-size: inherit; font-weight: 600; text-align: left; }
.muted { color: var(--muted); font-weight: 400; font-size: .8125rem; }
.slot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.slot-item {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  border-left: 5px solid var(--ci); background: var(--cb); border-radius: 10px; padding: 8px 10px;
}
.slot-item.cand { background: var(--surface-2); border-left-style: dashed; }
.slot-main {
  flex: 1 1 12rem; min-width: 0; border: 0; background: transparent; text-align: left; padding: 0;
  display: grid; gap: 2px; color: var(--text);
}
.slot-main b { font-size: .9375rem; }
.slot-main small { color: var(--muted); font-size: .75rem; }
.slot-main .badge { justify-self: start; }
.slot-acts { flex: 1 1 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.slot-acts .btn { padding: .55em .85em; min-height: 2.5rem; font-size: .8125rem; white-space: nowrap; display: inline-flex; align-items: center; }
.notice.decided p { margin: 0 0 6px; }
.status-pick { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.status-pick legend { font-size: .8125rem; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 4px; }
.status-pick label {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: .4em .8em;
  color: var(--text); font-weight: 600; font-size: .875rem; cursor: pointer; white-space: nowrap;
}
.status-pick label:has(input:checked) { border-color: var(--accent); background: var(--today); color: var(--accent); }

/* ---- パネル ---- */
.panel { background: var(--surface); border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; box-shadow: 0 1px 2px rgb(0 0 0 / .06); }
.panel h2 { font-size: .875rem; margin: 0 0 8px; color: var(--muted); }
.extra-list, .task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.course-line { width: 100%; border: 0; border-left: 5px solid var(--ci); background: var(--cb); color: var(--ci); border-radius: 8px; text-align: left; padding: 8px 10px; display: grid; }
.course-line small { opacity: .85; }
.empty-note { color: var(--muted); font-size: .8125rem; }
.task-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: 0; }
.task-list label { display: flex; gap: 8px; align-items: baseline; min-width: 0; padding-block: .3rem; }
.task-list input[type="checkbox"] { width: 1.3rem; height: 1.3rem; align-self: center; }
.task-list small { color: var(--muted); font-size: .75rem; }
.task-list li.soon small { color: var(--warn); font-weight: 700; }
.task-list li.late small { color: var(--danger); font-weight: 700; }
.task-list li.done span { text-decoration: line-through; color: var(--muted); }
.text-btn { border: 0; background: transparent; color: var(--accent); font-weight: 600; padding: .7em 0 .5em; min-height: 2.5rem; text-align: left; }
.text-btn.danger { color: var(--danger); margin-top: 12px; }
.link-like { border: 0; background: transparent; color: var(--accent); padding: .5em .3em; min-height: 2.25rem; text-decoration: underline; font-size: inherit; text-align: left; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); text-align: center; gap: 8px 4px; }
/* 4つ横に並ぶ幅があるときだけ横一列（3つと1つに分かれないように） */
main { container-type: inline-size; }
@container (min-width: 22rem) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats b { display: block; font-size: 1.375rem; color: var(--accent); line-height: 1.3; }
.stats small { color: var(--muted); font-size: .6875rem; display: block; line-height: 1.3; }
.stats .cats { grid-column: 1 / -1; margin: 6px 0 0; font-size: .75rem; color: var(--muted); }

/* ---- ダイアログ ---- */
dialog.sheet {
  border: 0; padding: 0; background: var(--surface); color: var(--text);
  width: min(35rem, 100vw); max-width: 100vw; max-height: min(92dvh, 900px); border-radius: 16px;
  box-shadow: 0 20px 60px rgb(0 0 0 / .3); overflow-x: hidden;
}
dialog.sheet::backdrop { background: rgb(20 10 10 / .45); }
@media (max-width: 37.5em) {
  dialog.sheet { margin: auto 0 0; width: 100vw; border-radius: 16px 16px 0 0; max-height: 92dvh; }
}
.sheet-body { padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 10px; min-width: 0; }
.sheet-body > * { min-width: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: -14px; background: var(--surface); margin: -14px -16px 0; padding: 14px 16px 6px; z-index: 1; }
.sheet-head h2 { margin: 0; font-size: 1.125rem; min-width: 0; }
.detail-title { border-left: 6px solid var(--ci); padding-left: 10px; line-height: 1.3; }
.sheet-body h3 { font-size: .8125rem; color: var(--muted); margin: 10px 0 4px; }
.facts { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: .875rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
/* 教室のボタンは背が高いので、「教室」の文字をボタンの高さの真ん中にそろえる */
.facts dt.mid { align-self: center; }
.facts dd.room-list { align-items: center; }
.big-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); gap: 8px; }
.btn {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: .5em .9em;
  font-weight: 600; text-decoration: none; color: var(--text); text-align: center; display: inline-block;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.big { padding: .8em .9em; font-size: 1rem; }
.file-btn { cursor: pointer; }
.bookmarklet { cursor: grab; border-style: dashed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.spacer { flex: 1; }

.absence .counter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.absence .counter b { font-size: 1.75rem; min-width: 1.5em; text-align: center; }
.absence .counter b.edge, .absence .counter b.over { color: var(--danger); }
.round {
  min-width: 2.5rem; min-height: 2.5rem; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 1.25rem; line-height: 1;
}
.hint { font-size: .75rem; color: var(--muted); margin: 0; font-weight: 400; }
.notice { background: var(--today); border-left: 4px solid var(--accent); padding: 8px 10px; border-radius: 6px; margin: 0; font-size: .875rem; }
.memo { white-space: pre-wrap; margin: 0; }
.task-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.task-add input[name="title"] { flex: 1 1 100%; }
.task-add input[name="due"] { flex: 1 1 12rem; width: auto; min-width: 0; }
.task-add .btn { flex: none; white-space: nowrap; }
@media (min-width: 30em) { .task-add input[name="title"] { flex-basis: 12rem; } }

form label, .sheet-body > label { display: grid; gap: 3px; font-size: .8125rem; font-weight: 600; color: var(--muted); min-width: 0; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: .5em .6em; color: var(--text); font-weight: 400;
  font-size: max(16px, 1rem); /* iPhone で入力欄を押したときに拡大されないように */
}
input[type="checkbox"], input[type="radio"] { flex: none; width: 1.1em; height: 1.1em; margin: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
/* 2つ並べる欄は、入りきらなければ縦に並べる */
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr)); gap: 8px; }
label.check { display: flex; align-items: center; gap: 10px; padding-block: .55rem; font-weight: 400; color: var(--text); font-size: .9375rem; }
label.check input { width: 1.3rem; height: 1.3rem; }
.import { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.import summary { font-weight: 700; cursor: pointer; padding-block: .55em; }
.import[open] { display: grid; gap: 8px; }
.import textarea { margin-top: 6px; }

.slots { border: 0; padding: 0; margin: 0; min-width: 0; }
.slots legend { font-size: .8125rem; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 4px; }
.sp { display: grid; grid-template-columns: 1.4rem repeat(var(--cols), minmax(0, 1fr)); gap: 3px; }
.sp-h { font-size: .75rem; color: var(--muted); text-align: center; align-self: center; }
.sp-b { min-height: 2.1rem; min-width: 0; padding: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 6px; color: var(--muted); }
.sp-b.taken { background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 4px, var(--surface-2) 4px, var(--surface-2) 8px); }
.sp-b.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.period-editor { display: grid; gap: 6px; }
/* 1限＝1段：「1限」｜始まり 〜 終わり（文字が大きくても折り返さない） */
.period-row { display: grid; grid-template-columns: 2.6em minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; padding: 4px 8px; background: var(--surface-2); border-radius: 12px; }
.period-row b { font-size: .9375em; }
.period-row .pair { display: contents; color: var(--muted); }
.period-row .pair input { min-width: 0; width: 100%; text-align: center; font-variant-numeric: tabular-nums; padding: .45em .1em; background: var(--surface); }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .875rem;
  opacity: 0; pointer-events: none; transition: .2s; width: max-content; max-width: calc(100vw - 32px); z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.has-action.show { pointer-events: auto; display: flex; align-items: center; gap: 12px; }
.toast button { border: 0; background: transparent; color: inherit; font-weight: 800; text-decoration: underline; padding: .4em .2em; min-height: 2.25rem; }

/* 狭い画面（文字を大きくしたときも、ここに入る） */
/* スマホ：時間割の枠を画面の左右いっぱいに広げる */
@media (max-width: 40em) {
  .grid-wrap { margin-inline: calc(var(--gutter) * -1); border-radius: 0; padding: 6px 2px 8px 0; }
  .grid { border-spacing: 3px; }
}
@media (max-width: 26.25em) {
  .cname { font-size: .75rem; }
  .croom { font-size: .5625rem; }
}

/* ---- このコマに開講されている授業 ---- */
.offers { display: grid; gap: 8px; }
.offers.ruled { border-top: 1px solid var(--line); padding-top: 4px; }
.offers h3 { margin-bottom: 0; }
.offer-filters { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.offer-filters label { display: grid; gap: 2px; font-size: .75rem; font-weight: 600; color: var(--muted); flex: 1 1 6rem; min-width: 0; }
.offer-filters label.grow { flex: 2 1 10rem; order: 1; }
/* 学科・プログラム：名前が長いので、「さがす」と同じ行に広めにとる */
.offer-filters label.prog { flex: 2 1 12rem; order: 1; }
label.prog[hidden] { display: none; }
.row > label.prog { grid-column: 1 / -1; }
.prog-tag { display: inline-block; justify-self: start; width: fit-content; margin-left: 6px; padding: 1px 6px; border-radius: 6px; font-size: .6875rem; font-weight: 700; vertical-align: 2px; background: var(--accent); color: var(--accent-ink); }
.offer-filters[hidden] { display: none; }
.offer-list { display: grid; gap: 6px; }
.offer-item {
  display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center;
  border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 10px;
}
.offer-main { flex: 1 1 12rem; min-width: 0; display: grid; gap: 1px; }
.offer-main b { font-size: .9375rem; line-height: 1.35; }
.offer-main small { color: var(--muted); font-size: .75rem; }
.added { font-size: .8125rem; font-weight: 700; color: var(--muted); padding: .4em .5em; white-space: nowrap; }
.btn.more { justify-self: center; margin-top: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }

.task-list .due { white-space: nowrap; }
.task-list small .link-like { min-height: 0; padding: .3em .1em; }

/* ---- スマホ：上の列のリンクは「🔗」にまとめて、時間割を上に寄せる ---- */

/* ---- バックアップのお知らせ・設定の書き出し ---- */
.backup-info { margin: 0; font-size: .875rem; font-weight: 600; }

/* ---- 授業時間（24時間の文字で入れる） ---- */
.time-in { text-align: center; font-variant-numeric: tabular-nums; }

/* ---- すでに入れた授業を、このコマにも入れる ---- */
.addslot { background: var(--surface-2); border-radius: 10px; padding: 4px 12px; }
.addslot summary { font-weight: 700; cursor: pointer; padding-block: .6em; font-size: .875rem; }
.addslot[open] { display: grid; gap: 6px; padding-bottom: 10px; }

/* ---- コマの教室 ---- */
.croom.empty { background: transparent; border: 1px dashed currentColor; font-weight: 600; }
.room-list { display: flex; flex-wrap: wrap; gap: 6px; }
.room-btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: .45em .9em; min-height: 2.5rem; font-size: inherit; text-align: left; }
.room-btn small { color: var(--muted); font-weight: 700; }
.room-btn.empty { color: var(--accent); border-style: dashed; font-weight: 600; }
.slot-rooms { display: grid; gap: 8px; margin-top: 8px; }
