.journal-student:has(.lesson-student-note[open]) .journal-student-tools { grid-column:1 / -1; }
.lesson-student-note { margin-top:0; }
.lesson-student-note > summary { display:flex; align-items:center; gap:8px; margin-top:4px; }
.lesson-student-note > summary::before { content:'＋'; }
.lesson-student-note[open] > summary { margin-left:0; background:#f0f4f1; }
.lesson-student-note[open] > summary::before { content:'−'; }
.lesson-entry-editor { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; align-items:start; }
.lesson-student-note .lesson-entry-editor { border-top:1px solid var(--line); margin-top:14px; padding-top:16px; }
.lesson-entry-text, .photo-picker { min-width:0; }
.lesson-entry-text > label, .photo-picker-heading { display:flex; justify-content:space-between; align-items:center; font-size:13px; font-weight:600; color:var(--text); margin:0 0 8px; min-height:20px; }
.lesson-entry-text textarea { width:100%; min-height:112px; resize:vertical; font-size:14px; line-height:1.5; }
.photo-picker-heading .muted { font-weight:400; font-variant-numeric:tabular-nums; }
.photo-dropzone { position:relative; display:flex; align-items:center; justify-content:center; gap:12px; min-height:112px; padding:16px; border:1px dashed #a8b8ae; border-radius:12px; background:#f7faf8; cursor:pointer; color:#344f40; text-align:left; }
.photo-dropzone:hover, .photo-dropzone.is-dragging { border-color:#397652; background:#eaf4ed; }
.photo-dropzone:focus-within { outline:3px solid #88b79a; outline-offset:3px; }
.photo-dropzone input { position:absolute; inset:0; opacity:0; width:100%; height:100%; cursor:pointer; }
.photo-dropzone strong { display:block; font-weight:600; font-size:14px; }
.photo-drop-icon { font-size:24px; line-height:1; }
.photo-drop-hint { display:block; font-size:12px; color:var(--muted); margin-top:4px; }
.photo-help, .lesson-note-panel .photo-help { margin:7px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.photo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:10px; margin-top:12px; }
.photo-grid:empty { display:none; }
.photo-tile { min-width:0; padding:5px; border:1px solid var(--line); border-radius:10px; background:white; }
.photo-tile > a { display:block; }
.photo-tile img { width:100%; height:104px; object-fit:cover; display:block; border-radius:6px; background:#f0f2ef; }
.photo-filename { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:var(--muted); margin:6px 3px; }
.photo-remove { display:flex; gap:5px; align-items:center; font-size:12px; cursor:pointer; padding:5px 3px; }
.photo-remove input { margin:0; }
.photo-tile > button { width:100%; font-size:12px; padding:6px; }
.photo-tile.is-removed { border-style:dashed; background:#f7f2ed; }
.photo-tile.is-removed img { opacity:.3; }
.photo-pending { font-size:10px; color:#537660; padding:0 3px; }
.photo-error, .journal-save-error { color:#a32d24; background:#fff2ef; border-radius:8px; padding:10px 12px; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.journal-save-error { margin-top:16px; }
[data-photo-error][hidden], [data-journal-error][hidden] { display:none; }
details.lesson-note-panel { display:block; }
.lesson-note-panel > summary { color:var(--text); font-size:16px; font-weight:600; cursor:pointer; }
.lesson-note-panel > summary::marker { color:var(--muted); }
.lesson-note-panel[open] > .lesson-entry-editor { margin-top:18px; }
.photo-viewer { position:fixed; inset:0; margin:auto; max-width:94vw; max-height:94vh; width:fit-content; padding:16px; border:0; border-radius:14px; background:#fff; }
.photo-viewer::backdrop { background:#17211dd9; }
.photo-viewer[open] { display:flex; flex-direction:column; gap:12px; align-items:center; }
.photo-viewer > button { align-self:flex-end; }
.photo-viewer img { display:block; max-width:86vw; max-height:72vh; object-fit:contain; }
.photo-viewer p { font-size:13px; overflow-wrap:anywhere; max-width:80vw; }
#attendance-form[aria-busy=true] .attendance-list, #attendance-form[aria-busy=true] .lesson-note-panel { opacity:.7; }
@media(max-width:700px) {
  .lesson-entry-editor { grid-template-columns:minmax(0,1fr); gap:18px; }
  .photo-dropzone { min-height:92px; }
  .photo-drop-hint { display:none; }
  .photo-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
  .photo-tile img { height:82px; }
  .photo-remove, .photo-tile > button { min-height:36px; }
  .lesson-student-note > summary { min-height:40px; }
}
