:root {
  color-scheme: light;
  --ink: #09213a;
  --muted: #65778d;
  --navy: #05294f;
  --cyan: #0b8fa1;
  --blue: #1677e8;
  --yellow: #d7a62a;
  --line: #d4e3eb;
  --paper: #f1f8fc;
  --white: #ffffff;
  --danger: #b33b3b;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 320px; min-height: 100vh; min-height: 100dvh; margin: 0; background: var(--paper); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.teacher-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: max(12px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 12px max(22px, env(safe-area-inset-left));
  background: var(--navy);
  color: #fff;
}

.teacher-brand, .teacher-topbar nav { display: flex; align-items: center; }
.teacher-brand { gap: 10px; }
.teacher-brand > span { width: 38px; height: 38px; border: 1px solid rgba(77, 231, 255, .35); border-radius: 7px; background: #061a3b url("../assets/pwa/icon-96.png?v=20260910-owner-reviewed-data-export-v359") center / cover no-repeat; }
.teacher-brand strong { display: grid; line-height: 1.05; }
.teacher-brand small { margin-top: 4px; color: #bcecf2; font-size: 10px; }
.teacher-topbar nav { gap: 18px; color: #d8edf7; font-size: 14px; font-weight: 800; }

.teacher-shell { width: min(1320px, 100%); margin: 0 auto; padding: clamp(18px, 4vw, 44px); }
.teacher-login { width: min(430px, 100%); margin: 8vh auto 0; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(8, 42, 71, .11); }
.teacher-login > p, .observation-heading p { margin: 0 0 7px; color: var(--cyan); font-size: 12px; font-weight: 900; letter-spacing: 0; }
.teacher-login h1 { margin: 0 0 24px; font-size: 38px; }
form { display: grid; gap: 14px; }
.login-options { display: flex; flex-wrap: wrap; gap: 18px; }
.login-options label { display: flex; align-items: center; gap: 7px; color: var(--ink); }
.login-options input { width: 18px; min-height: 18px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 800; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); padding: 11px 12px; outline: none; }
input { min-height: 50px; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22, 119, 232, .1); }
button { min-height: 44px; border: 1px solid transparent; border-radius: 6px; padding: 9px 15px; background: var(--blue); color: #fff; font-weight: 850; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
.notice { min-height: 24px; margin-top: 13px; color: var(--danger); font-size: 13px; font-weight: 750; }

.observation-view { display: grid; gap: 18px; }
.observation-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.observation-heading h1 { margin: 0; font-size: clamp(34px, 5vw, 50px); letter-spacing: 0; }
.observation-heading span { display: block; margin-top: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.quiet-button, .text-button { border-color: var(--line); background: #fff; color: var(--cyan); box-shadow: none; }
.quiet-button { min-height: 40px; }
.quiet-link { display: inline-flex; align-items: center; min-height: 40px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 8px 13px; color: var(--cyan); font-size: 13px; font-weight: 850; }
.heading-actions { display: flex; align-items: center; gap: 8px; }
.text-button { min-height: 34px; padding: 5px 9px; font-size: 12px; }

.binding-panel { display: grid; gap: 14px; border: 1px solid #b9dbe6; background: #fff; padding: 18px; }
.binding-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.binding-panel > header div { display: grid; gap: 5px; }
.binding-panel > header span { color: var(--cyan); font-size: 11px; font-weight: 900; }
.binding-panel > header h2 { margin: 0; font-size: 22px; letter-spacing: 0; }
.binding-panel > header p { max-width: 760px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.binding-panel > header > strong { flex: 0 0 auto; border: 1px solid #9bd6dc; background: #eefafa; padding: 6px 9px; color: #087987; font-size: 11px; }
.binding-form { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) auto; align-items: end; gap: 10px; }
.binding-form button { min-width: 126px; min-height: 50px; }
.binding-note,.binding-message { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.binding-message { min-height: 18px; color: var(--cyan); font-weight: 800; }
.binding-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.binding-list:empty { display: none; }
.binding-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid var(--line); background: #f7fbfd; padding: 10px 11px; }
.binding-item div { display: grid; gap: 3px; min-width: 0; }
.binding-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.binding-item span { color: var(--muted); font-size: 11px; }
.binding-item button { min-height: 32px; border-color: var(--line); background: #fff; color: var(--muted); padding: 4px 8px; font-size: 11px; }

.learner-picker { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px) minmax(160px, 220px); align-items: end; gap: 14px; border: 1px solid var(--line); background: #fff; padding: 18px; }
.learner-picker > div > span { color: var(--cyan); font-size: 11px; font-weight: 900; }
.learner-picker h2 { margin: 5px 0 0; font-size: 22px; }

.observation-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.observation-summary > div { display: grid; gap: 5px; padding: 18px; border-right: 1px solid var(--line); }
.observation-summary > div:last-child { border-right: 0; }
.observation-summary span { color: var(--muted); font-size: 13px; font-weight: 800; }
.observation-summary strong { color: var(--cyan); font-size: 30px; }

.distribution-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.distribution-grid article { display: grid; gap: 12px; border: 1px solid var(--line); background: #fff; padding: 17px; }
.distribution-grid article > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.distribution-grid article > header span { font-weight: 900; }
.distribution-grid article > header strong { color: var(--cyan); font-size: 13px; }
.distribution-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.distribution-list > div { display: grid; gap: 4px; min-height: 66px; border: 1px solid var(--line); background: #f7fbfd; color: var(--ink); padding: 9px; text-align: left; }
.distribution-list > div strong { color: var(--blue); font-size: 20px; }
.distribution-list > div small { color: var(--muted); }
.distribution-list p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }

.observation-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.status-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.status-tabs button { min-height: 42px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--muted); box-shadow: none; }
.status-tabs button.is-active { border-bottom-color: var(--blue); color: var(--ink); }
.observation-toolbar label { min-width: 160px; }
.observation-toolbar select { min-height: 42px; padding: 7px 10px; }

.observation-workspace { display: grid; grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); min-height: 520px; border: 1px solid var(--line); background: #fff; }
.student-records { border-right: 1px solid var(--line); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.section-title h2 { margin: 0; font-size: 17px; }
.record-list { display: grid; align-content: start; max-height: calc(100vh - 310px); overflow-y: auto; }
.record-card { display: grid; gap: 6px; min-height: 104px; padding: 15px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink); text-align: left; box-shadow: none; }
.record-card:hover, .record-card:focus-visible, .record-card.is-active { background: #edf7ff; }
.record-card.is-active { box-shadow: inset 4px 0 var(--blue); }
.record-card > span { color: var(--cyan); font-size: 11px; font-weight: 900; }
.record-card strong { font-size: 16px; }
.record-card small { color: var(--muted); font-size: 12px; }
.record-card p { margin: 0; color: #334b62; font-size: 13px; line-height: 1.4; }

.record-detail { min-width: 0; padding: clamp(18px, 3vw, 30px); }
.empty-state { margin: 0; color: var(--muted); line-height: 1.55; }
.error-text { color: var(--danger); }
.detail-content { display: grid; gap: 20px; }
.detail-content > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.detail-content h2 { margin: 5px 0 0; font-size: clamp(24px, 3vw, 32px); }
.detail-content header > span { color: var(--muted); font-size: 13px; font-weight: 800; }
.kind-label { color: var(--cyan); font-size: 11px; font-weight: 900; }
.system-finding { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 15px; border-left: 4px solid var(--blue); background: #eef7ff; }
.system-finding h3, .system-finding p { margin: 0; }
.system-finding p { line-height: 1.5; }
.system-finding span { color: var(--muted); font-size: 12px; }

.issue-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.issue-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); }
.issue-list li > div { display: grid; gap: 4px; }
.issue-list strong { font-size: 14px; }
.issue-list span { color: var(--muted); font-size: 13px; }
.seek-button { min-height: 34px; flex: 0 0 auto; padding: 5px 10px; border-color: #9ad5dc; background: #e9f8fa; color: #087887; font-size: 12px; }

.evidence { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.evidence h3, .review-form h3 { margin: 0; font-size: 17px; }
.score-viewer { min-height: 180px; overflow: auto; border: 1px solid var(--line); background: #fffefa; padding: 10px; }
.score-viewer img { display: block; max-width: 100%; height: auto; margin: auto; }
.score-viewer svg { max-width: none; }
.score-pdf { width: 100%; min-height: 480px; border: 0; }
.performance-viewer video { width: 100%; max-height: 430px; background: #061d33; }
.performance-viewer audio { width: 100%; }
.download-link { display: inline-flex; align-items: center; width: max-content; min-height: 42px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 6px; color: var(--cyan); font-weight: 850; }

.review-form { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.verdict-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.verdict-grid button { border-color: var(--line); background: #fff; color: var(--ink); }
.verdict-grid button.is-selected { border-color: var(--blue); background: #eaf4ff; color: #075fb7; }
fieldset { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 0; border: 1px solid var(--line); padding: 12px; }
fieldset legend { color: var(--muted); font-size: 13px; font-weight: 800; }
fieldset label { display: flex; align-items: center; gap: 8px; color: var(--ink); }
fieldset input { width: 18px; min-height: 18px; }
.review-status { margin: 0; color: var(--cyan); font-size: 13px; font-weight: 800; }
.saved-review { display: flex; justify-content: space-between; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.saved-review span { color: var(--muted); font-size: 12px; }

.teacher-bottom-nav { display: none; }

@media (max-width: 820px) {
  .binding-form { grid-template-columns: 1fr 1fr; }
  .binding-form button { grid-column: 1 / -1; }
  .binding-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learner-picker { grid-template-columns: 1fr 1fr; }
  .learner-picker > div { grid-column: 1 / -1; }
  .observation-summary { grid-template-columns: repeat(3, 1fr); }
  .distribution-list { grid-template-columns: repeat(2, 1fr); }
  .observation-workspace { grid-template-columns: 1fr; }
  .student-records { border-right: 0; border-bottom: 1px solid var(--line); }
  .record-list { max-height: 310px; }
}

@media (max-width: 640px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .teacher-topbar { min-height: 64px; padding-inline: 14px; }
  .teacher-topbar nav a:first-child { display: none; }
  .teacher-brand strong { font-size: 14px; }
  .teacher-shell { padding: 14px; }
  .teacher-login { margin-top: 4vh; padding: 22px; }
  .observation-heading { align-items: flex-start; }
  .heading-actions { align-items: stretch; flex-direction: column; }
  .binding-panel > header { flex-direction: column; }
  .binding-form,.binding-list { grid-template-columns: 1fr; }
  .binding-form button { grid-column: auto; }
  .observation-summary { grid-template-columns: repeat(3, 1fr); }
  .observation-summary > div { padding: 13px 10px; }
  .observation-summary strong { font-size: 25px; }
  .observation-toolbar { align-items: stretch; flex-direction: column; }
  .learner-picker, .distribution-grid { grid-template-columns: 1fr; }
  .learner-picker > div { grid-column: auto; }
  .observation-toolbar label { min-width: 0; }
  .record-detail { padding: 16px; }
  .detail-content > header, .system-finding, .issue-list li { align-items: flex-start; flex-direction: column; }
  .system-finding { display: grid; grid-template-columns: 1fr; }
  .verdict-grid, fieldset { grid-template-columns: 1fr; }
  .teacher-bottom-nav {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .97);
  }
  .teacher-bottom-nav a { display: grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 850; }
  .teacher-bottom-nav a.is-active { color: var(--blue); }
}
