/* 週案メーカー */
.sa-demo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.sa-tb { gap: 8px; }
.sa-date { width: auto; flex: 0 1 170px; min-width: 140px; }
.sa-h { font-size: 19px; margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.sa-h small { font-size: 13px; font-weight: 600; color: var(--ink2); }
.sa-h3 { font-size: 15.5px; margin: 20px 0 8px; }
.sa-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* 1週間の表（PC は曜日が横、スマホは1日ずつ縦に並ぶ） */
.sa-week { display: grid; gap: 5px; align-items: stretch; }
.sa-pl { display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--ink2); background: var(--bg2); border-radius: 8px; }
.sa-day { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--bg2); padding: 6px 9px; font: inherit; color: var(--ink); cursor: pointer; min-width: 0; min-height: 58px; }
.sa-day:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line-soft)); }
.sa-day .dt { font-size: 13px; color: var(--ink2); display: flex; align-items: baseline; gap: 6px; }
.sa-day .dt b { font-size: 16px; color: var(--ink); }
.sa-day .ev { font-size: 12px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.sa-day .ev.none { color: var(--ink3); font-weight: 500; opacity: .7; }
.sa-day .af { font-size: 11.5px; color: var(--ink2); line-height: 1.35; overflow-wrap: anywhere; }
.sa-day .pt { font-size: 11px; font-weight: 800; color: var(--coral); }
.sa-day.today { box-shadow: inset 0 3px 0 var(--coral); }
.sa-day.off { background: color-mix(in srgb, var(--ink) 9%, var(--card)); }
.sa-offday { border: 1px dashed var(--line-soft); border-radius: 10px; background: color-mix(in srgb, var(--ink) 5%, var(--card)); color: var(--ink2); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; display: grid; place-items: center; padding: 10px; min-height: 60px; writing-mode: vertical-rl; letter-spacing: .2em; }
.sa-cell { position: relative; display: flex; flex-direction: column; gap: 2px; align-items: stretch; text-align: left; border: 1px solid var(--line-soft); border-left: 5px solid var(--c); border-radius: 10px; background: var(--card); padding: 6px 8px; font: inherit; color: var(--ink); cursor: pointer; min-width: 0; min-height: 92px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.sa-cell:hover { box-shadow: 0 2px 10px -4px rgba(17, 22, 34, .3); }
.sa-cell .pn { display: none; }
.sa-cell .sj { font-weight: 800; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; line-height: 1.3; }
.sa-cell .sj em { font-style: normal; font-size: 11.5px; font-weight: 800; border: 1px solid var(--line-soft); border-radius: 6px; padding: 0 5px; background: var(--bg2); }
.sa-cell .sj i { font-style: normal; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--coral); border-radius: 99px; padding: 0 6px; }
.sa-cell .un { font-size: 12px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.sa-cell .un.auto { color: var(--ink2); }
.sa-cell .un.none { color: var(--ink3); font-weight: 500; opacity: .6; }
.sa-cell .un b { margin-left: 5px; font-size: 11.5px; padding: 0 5px; border-radius: 6px; background: color-mix(in srgb, var(--c) 16%, var(--card)); white-space: nowrap; }
.sa-cell .am { font-size: 11.5px; line-height: 1.4; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sa-cell .pr { font-size: 11px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-cell.empty { border-left-width: 1px; border-style: dashed; background: transparent; align-items: center; justify-content: center; color: var(--ink3); }
.sa-cell.empty .plus { font-size: 13px; opacity: .6; }
.sa-cell.chg { background: color-mix(in srgb, var(--coral) 5%, var(--card)); }
@media (max-width: 760px) {
  .sa-week { display: block; }
  .sa-pl { display: none; }
  .sa-day { width: 100%; margin: 14px 0 6px; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-height: 0; position: sticky; top: calc(var(--header-h, 60px) + 2px); z-index: 3; }
  .sa-day:first-of-type { margin-top: 0; }
  .sa-cell { width: 100%; margin-bottom: 5px; min-height: 0; padding-left: 40px; }
  .sa-cell .pn { display: grid; place-items: center; position: absolute; left: 6px; top: 7px; width: 26px; height: 26px; border-radius: 50%; background: var(--bg2); font-size: 12px; font-weight: 800; color: var(--ink2); }
  .sa-cell.empty { min-height: 40px; align-items: flex-start; }
  .sa-offday { width: 100%; writing-mode: horizontal-tb; min-height: 48px; }
}
.sa-notes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
@media (max-width: 980px) { .sa-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .sa-notes { grid-template-columns: minmax(0, 1fr); } }
.sa-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.sa-mini-i { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--card); padding: 7px 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; }
.sa-mini-i .nm { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-mini-i .nm i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.sa-mini-i b { font-size: 19px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sa-mini-i .cm { grid-column: 1 / -1; font-size: 11.5px; color: var(--ink2); }
.sa-mini-i .bar, .sa-prog .bar { grid-column: 1 / -1; display: block; height: 5px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin-top: 3px; }
.sa-mini-i .bar span, .sa-prog .bar span { display: block; height: 100%; border-radius: 99px; }

/* 時間割 */
.sa-pal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--bg2); margin-bottom: 10px; }
.sa-pallb { font-size: 12px; font-weight: 800; color: var(--ink2); margin-right: 2px; }
.sa-clsin { width: 110px; min-height: 34px; }
.sa-base { table-layout: fixed; min-width: 560px; }
.sa-base th { text-align: center; }
.sa-base th[scope="row"] { width: 38px; top: auto; }
.sa-base thead th:first-child { width: 38px; }
.sa-base td { padding: 3px; }
.sa-bcell { width: 100%; min-height: 50px; border: 1px solid var(--line-soft); border-left: 5px solid var(--c); border-radius: 9px; background: var(--card); font: inherit; color: var(--ink); cursor: pointer; display: grid; place-items: center; padding: 3px 4px; line-height: 1.25; touch-action: manipulation; }
.sa-bcell b { font-size: 13.5px; } .sa-bcell small { font-size: 11.5px; color: var(--ink2); font-weight: 700; }
.sa-bcell.empty { border-style: dashed; border-left-width: 1px; background: transparent; }

/* 単元・時数・設定 */
.sa-units, .sa-set { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 860px) { .sa-units, .sa-set { grid-template-columns: minmax(0, 1fr); } }
.sa-box { border: 1px solid var(--line-soft); border-radius: 14px; background: var(--card); padding: 12px 14px; display: grid; gap: 10px; min-width: 0; align-content: start; }
.sa-box h3 { margin: 0; font-size: 15.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.sa-box h3 small { font-size: 12px; font-weight: 600; color: var(--ink2); }
.sa-uta { font-size: 13.5px; line-height: 1.6; tab-size: 4; }
.sa-hours { font-size: 13.5px; width: max-content; min-width: 100%; }
.sa-hours th, .sa-hours td { white-space: nowrap; padding: 6px 9px; }
.sa-hours tbody th { top: auto; }
.sa-hours .nm { text-align: left; background: var(--card); position: sticky; left: 0; z-index: 1; }
.sa-hours .nm .sa-dot { margin-right: 6px; }
.sa-hours .num { text-align: right; font-variant-numeric: tabular-nums; }
.sa-hours .bad { color: var(--bad); font-weight: 800; }
.sa-hours tfoot td, .sa-hours tfoot th { background: var(--bg2); font-weight: 800; top: auto; }
.sa-prog { min-width: 110px; font-size: 12px; text-align: right; }
.sa-auto { width: auto; }
.sa-subj input[type="color"] { width: 38px; height: 32px; padding: 0; border: 1px solid var(--line-soft); border-radius: 8px; background: none; }
.sa-vac { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) auto minmax(0, 1.2fr) auto; gap: 6px; align-items: center; }
@media (max-width: 520px) { .sa-vac { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; } .sa-vac > :first-child { grid-column: 1 / -1; } }
.sa-unitrow { display: grid; grid-template-columns: minmax(0, 1fr) 84px 84px; gap: 8px; align-items: start; }
.sa-box .stepper input { width: 78px; }
