:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  color: #222;
  background: #fff;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; border: 1px solid #ccc; border-radius: 4px; background: #fff; padding: 8px 13px; min-height: 38px; }
button:hover { background: #f5f5f5; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: #222; border-color: #222; color: #fff; }
button.primary:hover { background: #444; }
a { color: #222; text-underline-offset: 3px; }
button:focus-visible, a:focus-visible { outline: 2px solid #666; outline-offset: 3px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #666; outline-offset: 1px; }
input, select, textarea { display: block; width: 100%; min-height: 40px; padding: 9px 10px; border: 1px solid #bbb; border-radius: 4px; background: #fff; }
input::placeholder, textarea::placeholder { color: #777; }
textarea { resize: vertical; line-height: 1.5; }
label { display: block; margin: 20px 0 7px; font-weight: 500; }
small { display: block; color: #666; font-size: 12px; line-height: 1.5; margin-top: 6px; }
h1 { font-size: 23px; font-weight: 600; margin: 0; line-height: 1.4; }
h2 { font-size: 17px; font-weight: 600; line-height: 1.5; margin: 0; }
h3 { font-size: 15px; font-weight: 500; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
.boot { padding: 40px; color: #666; }
.login { max-width: 360px; margin: 100px auto; padding: 0 20px; }
.login-tabs { display: flex; gap: 22px; margin: 24px 0 28px; border-bottom: 1px solid #ddd; }
.login-tabs button { border: 0; border-radius: 0; min-height: 0; padding: 0 0 10px; color: #777; background: none; }
.login-tabs button[aria-pressed="true"] { color: #222; border-bottom: 2px solid #222; margin-bottom: -1px; }
.login-submit { width: 100%; margin-top: 24px; }
.workspace { max-width: 940px; margin: 0 auto; padding: 0 24px 60px; }
.toolbar { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; padding: 22px 0; border-bottom: 1px solid #ddd; margin-bottom: 34px; }
.toolbar nav, .account { display: flex; align-items: center; gap: 20px; min-width: 0; }
.account { font-size: 13px; gap: 14px; flex-wrap: wrap; }
.account span { overflow-wrap: anywhere; }
.link-button { padding: 0; border: 0; border-radius: 0; background: none; color: #666; min-height: 30px; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: #111; background: none; }
.toolbar nav .link-button { text-decoration: none; }
.toolbar nav .active { color: #222; font-weight: 600; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.score-help { color: #666; font-size: 12px; line-height: 1.5; margin: -10px 0 20px; }
#scores-table { overflow-x: auto; }
.score-table { width: 100%; min-width: 850px; border-collapse: separate; border-spacing: 0; }
.score-table th, .score-table td { padding: 12px 8px; border-bottom: 1px solid #ddd; text-align: center; font-variant-numeric: tabular-nums; }
.score-table th { font-size: 13px; font-weight: 500; color: #666; }
.score-table th.started { color: #222; font-weight: 600; }
.score-table th:first-child, .score-table td:first-child { position: sticky; left: 0; z-index: 1; min-width: 200px; width: 210px; padding-left: 0; text-align: left; background: #fff; border-right: 1px solid #ddd; overflow-wrap: anywhere; }
.score-table th:last-child, .score-table td:last-child { position: sticky; right: 0; z-index: 1; width: 65px; min-width: 65px; padding-right: 0; text-align: right; background: #fff; border-left: 1px solid #ddd; font-weight: 600; }
.lecture-toggle { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; font: inherit; cursor: pointer; }
.lecture-toggle input { width: 16px; height: 16px; min-height: 16px; padding: 0; accent-color: #222; }
.filters { display: flex; gap: 12px; margin: 0 0 28px; }
.filters select { flex: 1; min-width: 0; }
.filters input { width: 260px; flex-shrink: 0; }
.empty { color: #666; padding: 15px 0; }
.question-record { padding: 20px 0; border-bottom: 1px solid #ddd; min-width: 0; }
.question-meta { display: flex; align-items: baseline; gap: 16px; justify-content: space-between; font-size: 13px; margin-bottom: 12px; }
.question-meta>a:first-child { color: #666; overflow-wrap: anywhere; }
.timestamp { font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.question-text, .answer p { line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.answer { margin-top: 18px; }
.answer>span { font-size: 12px; color: #666; display: block; margin-bottom: 5px; }
.review-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.score-options { display: flex; align-items: center; gap: 10px; }
.score-toggle { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 3px 0; min-height: 28px; font-size: 12px; font-weight: 400; color: #666; white-space: nowrap; cursor: pointer; }
.score-toggle input { display: inline-block; width: 16px; height: 16px; min-height: 16px; padding: 0; accent-color: #222; flex: none; }
.record-actions { display: flex; gap: 20px; margin-top: 14px; font-size: 13px; }
.video-group { margin-top: 30px; }
.video-group>h2 { margin-bottom: 22px; overflow-wrap: anywhere; }
.video-group>h2 a { text-decoration: none; }
.time-group { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 20px; margin-bottom: 24px; }
.time-group h3 { padding-top: 4px; }
.time-group .question-record { padding-top: 0; padding-bottom: 18px; margin-bottom: 18px; }
.time-group .question-record:last-child { margin-bottom: 0; }
.author { display: block; font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.video-list { padding-left: 22px; margin: 0; }
.video-list>li { padding: 16px 0; border-bottom: 1px solid #ddd; color: #666; }
.video-row { display: flex; align-items: baseline; gap: 25px; justify-content: space-between; padding-left: 5px; }
.video-row>a { line-height: 1.6; overflow-wrap: anywhere; }
.video-controls { display: flex; align-items: center; gap: 16px; flex: none; }
.lecture-select { width: 145px; font-size: 13px; }
.video-lecture { color: #666; font-size: 13px; white-space: nowrap; }
.video-row button { flex-shrink: 0; font-size: 13px; }
.modal { width: min(540px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 26px; border: 1px solid #bbb; border-radius: 5px; color: #222; background: #fff; overflow: auto; }
.modal::backdrop { background: #0005; }
.modal>h2 { margin-bottom: 24px; font-size: 20px; }
.modal form>label:first-child { margin-top: 0; }
.modal .time-input { width: 130px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.optional { color: #666; font-weight: 400; }
.preview-link { display: block; font-size: 12px; margin-top: 15px; width: max-content; max-width: 100%; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 25px; }
.form-error { font-size: 13px; color: #b12222; line-height: 1.6; margin-top: 12px; }
.form-error:empty { display: none; }
.confirm-text { line-height: 1.6; overflow-wrap: anywhere; margin-top: 18px; }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 10; max-width: calc(100% - 32px); pointer-events: none; }
.toast { border: 1px solid #ccc; background: #fff; border-radius: 4px; padding: 10px 16px; font-size: 13px; line-height: 1.6; }
.view-tabs { display: flex; gap: 22px; margin-bottom: 24px; border-bottom: 1px solid #ddd; }
.view-tabs button { border: 0; border-radius: 0; padding: 0 0 10px; background: none; color: #777; }
.view-tabs button[aria-pressed="true"] { color: #222; border-bottom: 2px solid #222; margin-bottom: -1px; }
#student-video-context { font-size: 13px; margin-bottom: 12px; }
.video-group>h2 button { font: inherit; color: #222; text-align: left; line-height: 1.5; overflow-wrap: anywhere; }
.player-dock { position: sticky; top: 0; z-index: 2; padding: 8px 0 12px; background: #fff; border-bottom: 1px solid #ddd; }
.media-mount { aspect-ratio: 16 / 9; width: min(100%, calc(44dvh * 16 / 9)); margin: 0 auto; background: #111; }
.media-mount iframe, #youtube-player { width: 100%; height: 100%; border: 0; display: block; }
.player-status { font-size: 13px; line-height: 1.6; color: #666; margin: 12px 0; }
.question-timeline { margin-top: 12px; }
.timeline-labels { display: flex; justify-content: space-between; font: 12px ui-monospace, monospace; }
#player-seek { padding: 0; border: 0; min-height: 32px; accent-color: #222; }
.timeline-marks { position: relative; margin: -24px 8px 24px; height: 0; }
.timeline-marker { position: absolute; transform: translateX(-50%); min-height: 16px; width: 16px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: #777; }
.timeline-marker:hover, .timeline-marker.current { background: #111; }
#player-questions { padding-top: 24px; }
#player-questions .time-group { scroll-margin-top: calc(var(--player-dock-height, 0px) + 16px); }
#player-questions .time-group.current { border-left: 2px solid #222; padding-left: 10px; margin-left: -12px; }
#player-questions .timestamp.current { font-weight: 700; color: #111; }
@media (max-width: 640px) {
  .login { margin-top: 64px; }
  .workspace { padding: 0 18px 40px; }
  .toolbar { gap: 8px; padding: 16px 0; margin-bottom: 28px; }
  .toolbar nav { width: 100%; }
  .account { gap: 14px; width: 100%; }
  .account span { margin-right: auto; }
  h1 { font-size: 21px; }
  .score-table th:first-child, .score-table td:first-child { min-width: 150px; width: 160px; }
  .filters { flex-direction: column; }
  .filters input { width: 100%; }
  input, select, textarea { font-size: 16px; }
  .question-meta { gap: 12px; font-size: 12px; }
  .video-row { align-items: flex-start; flex-direction: column; gap: 6px; }
  .video-row button { min-height: 32px; }
  .modal { width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 22px 20px; }
  .time-group { grid-template-columns: 58px minmax(0, 1fr); gap: 12px; }
  .review-item { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .timestamp { font-size: 12px; }
}
