
/* v71: photo surfaces follow light theme; handle focus stays inside the grip. */
body.light-theme :is(.photo-gallery-nav,.photo-viewer-tools){background:#e6eef9f2!important;color:#243e60!important;border:1px solid #c5d4e8!important;box-shadow:0 4px 20px #11294420!important}
body.light-theme .photo-viewer :is(.icon-button,.photo-zoom-reset){background:#d4e2f5!important;color:#244b7b!important;border-color:#b9cce6!important;box-shadow:none!important}
body.light-theme .photo-viewer .photo-tool-divider{background:#bacbe0!important}
body.light-theme .photo-zoom-range{accent-color:#315f9f}
body.light-theme .photo-zoom-range::-webkit-slider-thumb{background:#315f9f!important;border-color:#fff!important}
body.light-theme .material-modal :is(.photo-attach,.photo-count){background:#dfebfa!important;color:#244b7b!important;border-color:#c2d3eb!important}
body.light-theme .material-modal .attachment-thumb{background:#e4ecf6!important;border-color:#c7d6e8!important}
body .sheet-handle{outline:none!important;box-shadow:none!important;border-radius:28px 28px 0 0!important}
body .sheet-handle:focus-visible>span{outline:2px solid #779bd0;outline-offset:3px}
html.modal-returning dialog.modal,html.modal-returning dialog.modal::backdrop{animation:none!important;transition:none!important}

/* Match each preview to its surrounding homework surface. */
body .homework-unit .homework-unit-content,
body .homework-unit .homework-card:not(.is-completed),
body :is(.homework-card,.task-card) .attachments,
body :is(.homework-card,.task-card) .attachment-thumb {border-radius:inherit}
body .homework-unit .divided-content .homework-card {border-radius:14px}
body :is(.homework-card,.task-card) .attachment-thumb img {border-radius:inherit}
body .homework-unit:not(.divided-unit) .homework-card .attachment-thumb,body .homework-unit .divided-content .homework-card .attachment-thumb{border-radius:inherit}

/* The summary thumbnail sits inside an intermediate content wrapper. */
body .task-card > div:has(> .attachment-thumb) {
  border-radius: inherit;
}

body dialog.modal .task-card:has(.attachment-thumb) {
  --summary-photo-width: clamp(59px, 18vw, 132px);
  padding-right: calc(var(--summary-photo-width) + 12px);
}

body dialog.modal .task-card > div:has(> .attachment-thumb) {
  min-width: 0;
  overflow-wrap: anywhere;
}

body dialog.modal .task-card .attachment-thumb {
  right: 0;
  width: var(--summary-photo-width) !important;
}

body dialog.modal .task-list > .task-card .attachment-thumb {
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}

body.cosmic-theme dialog.modal .task-list > .task-card .attachment-thumb {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
