:root {
  --ink: #0d1728;
  --ink-soft: #1f2b3f;
  --muted: #6f7c8f;
  --muted-strong: #4d5c72;
  --canvas: #e9eef2;
  --surface: #f8fafb;
  --paper: #fffdf7;
  --line: #d8e0e7;
  --line-strong: #c4cfda;
  --cobalt: #2f5bff;
  --cobalt-dark: #2346c7;
  --coral: #e76f51;
  --mint: #b9e3d0;
  --amber: #f4c95d;
  --white: #ffffff;
  --shadow: 0 20px 50px rgba(13, 23, 40, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

body.app-loading {
  overflow: hidden;
}

body.app-loading .app-shell {
  visibility: hidden;
}

.boot-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted-strong);
  background: var(--canvas);
  font-size: 13px;
  font-weight: 750;
}

.boot-mark {
  width: 42px;
  height: 42px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 9px;
  background: var(--coral);
  border-radius: 8px;
  transform: rotate(-4deg);
  animation: boot-breathe 1.2s ease-in-out infinite alternate;
}

.boot-mark span {
  height: 3px;
  background: var(--ink);
  border-radius: 4px;
}

.boot-mark span:nth-child(2) { width: 75%; }
.boot-mark span:nth-child(3) { width: 50%; }

.boot-error {
  max-width: 340px;
  display: grid;
  gap: 8px;
  padding: 22px;
  text-align: center;
}

.boot-error strong,
.boot-error span {
  display: block;
}

.boot-error strong {
  color: var(--ink);
  font-size: 17px;
}

.boot-error button {
  min-height: 42px;
  margin-top: 8px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: var(--radius);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[contenteditable="true"]:focus-visible {
  outline: 3px solid rgba(47, 91, 255, 0.28);
  outline-offset: 2px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--canvas);
}

.sidebar {
  width: 250px;
  flex: 0 0 250px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: calc(27px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
  color: #dce6f2;
  background: var(--ink);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
}

.sidebar-close-button {
  display: none;
  width: 34px;
  height: 34px;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  color: #b7c5d7;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.sidebar-close-button svg {
  width: 17px;
  height: 17px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 7px;
  border-radius: 9px;
  background: var(--coral);
  transform: rotate(-4deg);
}

.brand-mark span {
  height: 2px;
  display: block;
  background: var(--ink);
  border-radius: 4px;
}

.brand-mark span:nth-child(2) {
  width: 75%;
}

.brand-mark span:nth-child(3) {
  width: 50%;
}

.brand-name {
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-caption {
  margin: 3px 0 0;
  color: #8ea0b8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.sidebar-rule {
  height: 1px;
  margin: 29px 10px 17px;
  background: rgba(255, 255, 255, 0.1);
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-item {
  min-height: 44px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 11px;
  color: #9eacc0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  text-align: left;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #ffffff;
  background: #1b2c48;
  border-color: rgba(124, 160, 210, 0.22);
  box-shadow: inset 3px 0 0 var(--coral);
}

.nav-key,
.nav-count {
  margin-left: auto;
  color: #7f90a8;
  font-size: 11px;
  font-weight: 700;
}

.nav-trailing-icon {
  margin-left: auto;
  opacity: 0.64;
}

.admin-nav-item {
  margin-top: 6px;
  border-top-color: rgba(255, 255, 255, 0.08);
}

.nav-key {
  padding: 1px 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-status {
  margin: 0 10px 17px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-status .status-dot {
  background: var(--mint);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c6d3e3;
  font-size: 12px;
  font-weight: 700;
}

.status-dot,
.mode-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--mint);
}

.sidebar-status p {
  margin: 8px 0 0;
  color: #71839a;
  font-size: 11px;
  line-height: 1.6;
}

.sidebar-footer-button {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  color: #b6c6d8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  font-size: 12px;
  transition: background 160ms ease, color 160ms ease;
}

.sidebar-footer-button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-footer-button svg {
  width: 15px;
  height: 15px;
}

.sidebar-backdrop {
  display: none;
}

.workspace {
  min-width: 0;
  flex: 1;
  background: var(--canvas);
}

.topbar {
  height: calc(68px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 13px;
  padding: env(safe-area-inset-top) calc(32px + env(safe-area-inset-right)) 0 calc(32px + env(safe-area-inset-left));
  background: rgba(248, 250, 251, 0.86);
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumb svg {
  width: 14px;
  height: 14px;
  color: #a0acbb;
}

.breadcrumb strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.topbar-spacer {
  flex: 1;
}

.topbar-new-button {
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  color: #ffffff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.topbar-new-button:hover {
  background: var(--cobalt);
  border-color: var(--cobalt);
}

.topbar-new-button svg {
  width: 15px;
  height: 15px;
}

.icon-button,
.avatar-button {
  width: 35px;
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-strong);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.icon-button:hover {
  color: var(--ink);
  background: #e7edf1;
  border-color: var(--line);
}

.menu-button {
  display: none;
}

.avatar-button {
  color: #ffffff;
  background: var(--cobalt);
  border-color: var(--cobalt);
  font-size: 12px;
  font-weight: 800;
}

.page-content {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 38px 38px 55px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}

.eyebrow,
.section-index {
  margin: 0 0 7px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 5px;
  color: var(--ink);
  font-family: "Avenir Next", "Noto Sans SC", "Segoe UI", sans-serif;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.15;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.heading-meta {
  display: flex;
  align-items: center;
  gap: 17px;
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mode-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  font-weight: 700;
}

.mode-dot {
  width: 6px;
  height: 6px;
  flex-basis: 6px;
  background: var(--amber);
}

.heading-time {
  padding-left: 16px;
  border-left: 1px solid var(--line-strong);
  font-variant-numeric: tabular-nums;
}

.context-strip {
  display: grid;
  grid-template-columns: minmax(180px, 1.45fr) minmax(120px, 0.9fr) minmax(150px, 0.95fr) minmax(220px, 1.2fr) auto;
  align-items: end;
  gap: 15px;
  padding: 16px 18px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 7px 18px rgba(13, 23, 40, 0.025);
}

.context-field {
  min-width: 0;
}

.subject-field {
  position: relative;
}

.context-field label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.required-mark,
.optional-mark {
  margin-left: 4px;
  font-size: 9px;
  font-weight: 800;
}

.required-mark {
  color: var(--coral);
}

.optional-mark {
  color: #9aa7b6;
}

.context-field input,
.context-field select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  color: var(--ink-soft);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.context-field input:hover,
.context-field select:hover {
  border-color: var(--line-strong);
}

.context-field input:focus,
.context-field select:focus {
  border-color: rgba(47, 91, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.1);
}

.subject-picker {
  position: relative;
}

.subject-picker-button {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 9px 0 10px;
  color: var(--ink-soft);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11px;
  text-align: left;
}

.subject-picker-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-picker-button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.subject-picker.open .subject-picker-button {
  border-color: rgba(47, 91, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.1);
}

.subject-picker.open .subject-picker-button svg {
  transform: rotate(180deg);
}

.subject-menu {
  position: absolute;
  z-index: 14;
  top: calc(100% + 7px);
  left: 0;
  width: min(330px, calc(100vw - 54px));
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(13, 23, 40, 0.17);
}

.subject-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
}

.subject-option-grid label {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
}

.subject-option-grid input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  padding: 0;
  accent-color: var(--cobalt);
}

.custom-subject-field {
  display: block;
  margin: 9px 0 0 !important;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.custom-subject-field span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.custom-subject-field input {
  height: 35px;
  font-size: 12px;
}

.subject-done-button {
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  color: #ffffff;
  background: var(--ink);
  border: 0;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.student-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.student-field-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.student-field-row .student-input-wrap {
  min-width: 0;
  flex: 1;
}

.student-input-wrap input {
  padding-left: 40px;
  padding-right: 10px;
}

.student-input-wrap > svg {
  position: absolute;
  right: 9px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.student-avatar {
  position: absolute;
  left: 9px;
  z-index: 1;
  width: 23px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--mint);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.manage-students-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-strong);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.manage-students-button:hover {
  color: var(--cobalt);
  border-color: #aebfe8;
}

.manage-students-button svg {
  width: 16px;
  height: 16px;
}

.time-inputs {
  display: flex;
  align-items: center;
  gap: 7px;
}

.time-inputs input {
  min-width: 0;
  flex: 1;
}

.time-inputs span {
  color: var(--muted);
}

.new-session-button {
  min-width: 122px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: #ffffff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.new-session-button svg {
  width: 15px;
  height: 15px;
}

.new-session-button:hover {
  color: #ffffff;
  border-color: var(--cobalt);
  background: var(--cobalt);
}

.memory-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 17px;
  margin: 1px -2px -1px;
  padding: 14px 2px 0;
  border-top: 1px solid var(--line);
}

.memory-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.memory-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.memory-toggle .switch {
  flex: 0 0 38px;
}

.memory-toggle input:checked + .switch {
  background: var(--cobalt);
}

.memory-toggle input:checked + .switch::after {
  transform: translateX(16px);
}

.memory-toggle-copy strong,
.memory-toggle-copy small {
  display: block;
}

.memory-toggle-copy strong {
  color: var(--ink-soft);
  font-size: 11px;
}

.memory-toggle-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.memory-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 10px;
  overflow: hidden;
}

.memory-summary span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-summary-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #aab6c2;
}

.memory-row.enabled .memory-summary-dot {
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(185, 227, 208, 0.35);
}

.template-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -2px -2px 0;
  padding: 11px 2px 0;
  border-top: 1px solid var(--line);
}

.template-row-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.template-row-label svg {
  width: 14px;
  height: 14px;
  color: var(--coral);
}

.template-quick-button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  color: var(--cobalt);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 800;
}

.template-quick-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-quick-button svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.template-row small {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
}

.text-command,
.danger-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 0;
  color: var(--cobalt);
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.text-command:hover {
  color: var(--cobalt-dark);
}

.text-command:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.92fr) minmax(470px, 1.08fr);
  align-items: start;
  gap: 26px;
  margin-top: 31px;
}

.input-column,
.output-column {
  min-width: 0;
}

.section-heading {
  min-height: 49px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.section-index {
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.15em;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.section-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 11px;
}

.capture-panel,
.notes-panel,
.evidence-panel {
  margin-bottom: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.capture-panel {
  padding: 18px 19px 15px;
}

.capture-panel-header,
.evidence-heading,
.notes-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

.panel-hint {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.capture-state,
.photo-count {
  padding: 3px 8px;
  color: var(--muted-strong);
  background: #e8eef2;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

.recording-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 17px;
}

.record-button {
  position: relative;
  width: 53px;
  height: 53px;
  flex: 0 0 53px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: var(--coral);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 17px rgba(231, 111, 81, 0.25);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.record-button:hover {
  background: #d85f42;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(231, 111, 81, 0.3);
}

.record-button.recording {
  background: var(--cobalt);
  box-shadow: 0 8px 17px rgba(47, 91, 255, 0.27);
}

.record-button.recording::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(47, 91, 255, 0.3);
  border-radius: 50%;
  animation: pulse 1.4s ease-out infinite;
}

.record-button svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}

.waveform {
  height: 47px;
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  padding: 0 2px;
  overflow: hidden;
}

.waveform span {
  width: 3px;
  height: 9px;
  flex: 0 0 3px;
  background: #cbd6de;
  border-radius: 4px;
  transition: height 160ms ease, background 160ms ease;
}

.waveform span:nth-child(2n) { height: 17px; }
.waveform span:nth-child(3n) { height: 27px; }
.waveform span:nth-child(4n) { height: 13px; }
.waveform span:nth-child(5n) { height: 35px; }

.waveform.active span {
  background: var(--cobalt);
  animation: wave 700ms ease-in-out infinite alternate;
}

.waveform.active span:nth-child(2n) { animation-delay: -300ms; }
.waveform.active span:nth-child(3n) { animation-delay: -520ms; }
.waveform.active span:nth-child(4n) { animation-delay: -180ms; }

.record-time {
  min-width: 38px;
  color: var(--ink-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.recording-footnote {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 10px;
}

.recording-footnote svg {
  width: 13px;
  height: 13px;
  color: var(--amber);
}

.notes-panel {
  overflow: hidden;
}

.notes-header {
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}

.input-mode-toggle {
  display: inline-flex;
  padding: 3px;
  background: #e9eef1;
  border-radius: 7px;
}

.mode-toggle {
  height: 27px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}

.mode-toggle.active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(13, 23, 40, 0.09);
}

.notes-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.text-button {
  padding: 4px 0;
  color: var(--muted-strong);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 700;
}

.text-button:hover {
  color: var(--cobalt);
}

#transcript {
  width: 100%;
  min-height: 242px;
  display: block;
  padding: 16px 16px 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  outline: 0;
  resize: vertical;
  font-size: 13px;
  line-height: 1.8;
}

#transcript::placeholder {
  color: #a2afbd;
}

.notes-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 15px 10px;
  color: var(--muted);
  background: #f0f4f6;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.evidence-panel {
  padding: 17px 18px 16px;
}

.evidence-heading {
  align-items: center;
}

.ai-status-strip {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: 13px;
  padding: 9px 10px;
  color: #5c6675;
  background: #eef2f4;
  border: 1px solid #d9e1e6;
  border-radius: 6px;
}

.ai-status-strip.connected {
  color: #315f50;
  background: #eaf5f1;
  border-color: #c5e2d5;
}

.ai-status-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-strong);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.ai-status-strip.connected .ai-status-icon {
  color: #2f7961;
  border-color: #bfddcf;
}

.ai-status-icon svg {
  width: 16px;
  height: 16px;
}

.ai-status-strip strong,
.ai-status-strip small {
  display: block;
}

.ai-status-strip strong {
  color: var(--ink-soft);
  font-size: 11px;
}

.ai-status-strip small {
  margin-top: 1px;
  font-size: 9px;
}

.dropzone {
  min-height: 102px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 14px;
  padding: 14px;
  color: var(--muted);
  background: #f2f6f7;
  border: 1px dashed #b8c6d0;
  border-radius: 8px;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease;
}

.dropzone:hover,
.dropzone.dragging {
  background: #edf2f5;
  border-color: var(--cobalt);
}

.dropzone input {
  display: none;
}

.dropzone-icon {
  width: 29px;
  height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 3px;
  color: var(--cobalt);
  background: #dce5ff;
  border-radius: 8px;
}

.dropzone-icon svg {
  width: 16px;
  height: 16px;
}

.dropzone-title {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.dropzone-subtitle {
  color: var(--muted);
  font-size: 10px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.photo-grid:empty {
  display: none;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  margin: 0;
  overflow: hidden;
  background: #dfe7ec;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  cursor: zoom-in;
}

.photo-number {
  position: absolute;
  left: 5px;
  bottom: 5px;
  min-width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: rgba(13, 23, 40, 0.73);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

.remove-photo {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: rgba(13, 23, 40, 0.72);
  border: 0;
  border-radius: 50%;
}

.remove-photo:hover {
  background: var(--coral);
}

.remove-photo svg {
  width: 13px;
  height: 13px;
}

.evidence-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.evidence-warning svg {
  width: 13px;
  height: 13px;
  color: var(--amber);
}

.output-heading {
  align-items: center;
}

.output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  color: #946f13;
  background: #fff5d9;
  border: 1px solid #f2e2ad;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

.review-status .status-dot {
  width: 6px;
  height: 6px;
  flex-basis: 6px;
  background: var(--amber);
}

.report-sheet {
  position: relative;
  min-height: 616px;
  padding: 30px 36px 24px;
  overflow: hidden;
  color: #1c2737;
  background: var(--paper);
  border: 1px solid #e3e0d6;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  outline: none;
}

.report-sheet.is-generating {
  opacity: 0.72;
  pointer-events: none;
}

.report-empty {
  min-height: 530px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.report-empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  color: var(--coral);
}

.report-empty h3 {
  margin-bottom: 5px;
  font-size: 18px;
}

.report-empty p {
  margin: 0;
  font-size: 12px;
}

.report-sheet::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 15px;
  width: 2px;
  background: rgba(231, 111, 81, 0.32);
}

.report-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.report-type {
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.report-id {
  color: #a3a59f;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
}

.report-sheet h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 850;
  line-height: 1.25;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  color: #7b817e;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.report-section {
  margin-top: 27px;
}

.report-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  color: var(--ink);
  border-bottom: 1px solid #e5e0d4;
  font-size: 13px;
  font-weight: 850;
}

.section-marker {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: var(--ink);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 850;
}

.task-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: task;
}

.task-list li {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 7px;
  align-items: start;
  padding: 12px 0 12px;
  border-bottom: 1px solid #eeeae1;
  font-size: 12px;
  line-height: 1.7;
}

.task-list li::before {
  counter-increment: task;
  content: counter(task) ".";
  color: #858982;
  font-size: 11px;
  font-weight: 800;
}

.task-text {
  min-width: 0;
}

.task-check {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #15745a;
  background: #d9f0e3;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
}

.task-check.deferred {
  color: #956f10;
  background: #fff0c9;
}

.feedback-section {
  margin-top: 25px;
}

.feedback-copy {
  padding-top: 11px;
  color: #3e4a59;
  font-size: 12px;
  line-height: 1.82;
}

.feedback-copy p {
  margin: 0 0 10px;
}

.feedback-copy p:last-child {
  margin-bottom: 0;
}

.report-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  padding-top: 13px;
  color: #8b8e86;
  border-top: 1px solid #e5e0d4;
  font-size: 10px;
}

.report-footer span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.report-footer svg {
  width: 13px;
  height: 13px;
  color: #6b9e7b;
}

.output-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 13px;
}

.output-footnote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.output-footnote svg {
  width: 14px;
  height: 14px;
  color: #679f7f;
}

.copy-button,
.generate-button {
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  color: #ffffff;
  background: var(--cobalt);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(47, 91, 255, 0.2);
  font-size: 12px;
  font-weight: 800;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.copy-button:hover,
.generate-button:hover {
  background: var(--cobalt-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 21px rgba(47, 91, 255, 0.25);
}

.copy-button:disabled {
  color: #8290a0;
  background: #dce3ea;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.report-sheet.is-stale .custom-report-text {
  opacity: 0.62;
}

.copy-button svg,
.generate-button svg {
  width: 16px;
  height: 16px;
}

.mobile-generate {
  display: none;
  width: 100%;
}

.header-generate {
  min-height: 34px;
  padding: 0 12px;
  box-shadow: none;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  max-width: min(90vw, 420px);
  padding: 10px 14px;
  color: #ffffff;
  background: var(--ink);
  border-radius: 7px;
  box-shadow: 0 12px 30px rgba(13, 23, 40, 0.2);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.info-dialog {
  width: min(450px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(13, 23, 40, 0.22);
}

.info-dialog::backdrop {
  background: rgba(13, 23, 40, 0.45);
}

.photo-dialog {
  width: min(900px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 12px;
  overflow: hidden;
  color: #ffffff;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(13, 23, 40, 0.32);
}

.photo-dialog::backdrop {
  background: rgba(13, 23, 40, 0.75);
}

.photo-dialog img {
  width: 100%;
  max-height: calc(100vh - 105px);
  display: block;
  object-fit: contain;
  border-radius: 5px;
}

.photo-dialog p {
  margin: 8px 38px 0 3px;
  color: #b7c3d2;
  font-size: 11px;
}

.photo-dialog-close {
  position: absolute;
  z-index: 1;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: rgba(13, 23, 40, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
}

.photo-dialog-close svg {
  width: 17px;
  height: 17px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 23px 0;
}

.dialog-header h2 {
  font-size: 20px;
}

.dialog-body {
  padding: 16px 23px 4px;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.75;
}

.dialog-body p {
  margin-bottom: 11px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 23px 21px;
}

.secondary-button {
  min-height: 35px;
  padding: 0 13px;
  color: var(--ink-soft);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.secondary-button:hover {
  border-color: var(--line-strong);
  background: #f3f6f8;
}

.primary-button {
  min-height: 35px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--cobalt);
  border: 1px solid var(--cobalt);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--cobalt-dark);
  border-color: var(--cobalt-dark);
}

.privacy-options {
  display: grid;
  gap: 8px;
  padding-top: 19px;
}

.account-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
  padding: 10px;
  background: #eef3f5;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.account-row-avatar {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 7px;
}

.account-row-avatar svg {
  width: 18px;
  height: 18px;
}

.account-row small,
.account-row strong {
  display: block;
}

.account-row small {
  color: var(--muted);
  font-size: 9px;
}

.account-row strong {
  margin-top: 1px;
  color: var(--ink);
  font-size: 13px;
}

.privacy-dialog-actions {
  justify-content: space-between;
}

.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.switch-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  background: #c5d0d9;
  border-radius: 20px;
  transition: background 160ms ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(13, 23, 40, 0.16);
  transition: transform 160ms ease;
}

.switch-row input:checked + .switch {
  background: var(--cobalt);
}

.switch-row input:checked + .switch::after {
  transform: translateX(16px);
}

.privacy-note {
  margin: 7px 0 0;
  padding: 10px 11px;
  color: var(--muted);
  background: #eef3f5;
  border-left: 3px solid var(--mint);
  border-radius: 5px;
  font-size: 10px;
  line-height: 1.65;
}

.student-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  overflow: auto;
}

.student-list {
  display: grid;
  gap: 7px;
}

.student-file-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.student-file-row.active {
  border-color: rgba(47, 91, 255, 0.45);
  box-shadow: inset 3px 0 0 var(--cobalt);
}

.student-file-avatar {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--mint);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 850;
}

.student-file-main {
  min-width: 0;
}

.student-file-main strong,
.student-file-main small {
  display: block;
}

.student-file-main strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.student-file-main small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.student-file-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.student-select-button,
.student-delete-button {
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
}

.student-select-button {
  color: var(--cobalt);
  background: #edf1ff;
  border: 1px solid #d8e0ff;
}

.student-delete-button {
  width: 30px;
  padding: 0;
  color: #9b5960;
  background: transparent;
  border: 1px solid transparent;
}

.student-delete-button:hover {
  color: #b54450;
  background: #fff0f1;
  border-color: #f3cdd1;
}

.student-delete-button svg,
.student-select-button svg {
  width: 14px;
  height: 14px;
}

.add-student-form {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.form-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 850;
}

.form-title svg {
  width: 15px;
  height: 15px;
  color: var(--coral);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.history-toolbar select {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  color: var(--ink-soft);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.add-student-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
}

.add-student-submit svg {
  width: 14px;
  height: 14px;
}

.history-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 15px 23px 0;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.history-toolbar select {
  width: 180px;
}

.danger-text-button {
  color: #b24d58;
}

.danger-text-button svg {
  width: 13px;
  height: 13px;
}

.history-list {
  max-height: min(580px, calc(100vh - 210px));
  display: grid;
  gap: 8px;
  padding: 14px 23px 22px;
  overflow: auto;
}

.history-item {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.history-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 13px;
  cursor: pointer;
  list-style: none;
}

.history-item summary::-webkit-details-marker {
  display: none;
}

.history-item-title strong,
.history-item-title small {
  display: block;
}

.history-item-title strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.history-item-title small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.history-item-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.history-item-actions > svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.history-delete-button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a6656b;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.history-delete-button:hover {
  background: #fff0f1;
}

.history-delete-button svg {
  width: 13px;
  height: 13px;
}

.history-report {
  margin: 0;
  padding: 13px;
  color: #465366;
  background: #f3f6f8;
  border-top: 1px solid var(--line);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.template-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  overflow: auto;
}

.template-dialog-body {
  display: grid;
  gap: 13px;
  padding-top: 18px;
}

.template-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.template-toolbar label > span,
.template-field > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.template-toolbar select,
.template-field input,
.template-field textarea {
  width: 100%;
  color: var(--ink-soft);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.template-toolbar select,
.template-field input {
  height: 38px;
  padding: 0 10px;
}

.template-field textarea {
  min-height: 248px;
  padding: 11px;
  resize: vertical;
  font-family: "Noto Sans Mono CJK SC", "Microsoft YaHei UI", monospace;
  font-size: 12px;
  line-height: 1.65;
}

.template-toolbar select:focus,
.template-field input:focus,
.template-field textarea:focus {
  border-color: rgba(47, 91, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.1);
}

.template-toolbar .secondary-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.template-toolbar .secondary-button svg {
  width: 14px;
  height: 14px;
}

.template-tokens {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.template-tokens > span {
  color: var(--muted);
  font-size: 10px;
}

.template-tokens button {
  min-height: 29px;
  padding: 0 8px;
  color: #42516a;
  background: #eef2f5;
  border: 1px solid #d7e0e7;
  border-radius: 6px;
  font-size: 10px;
}

.template-tokens button:hover {
  color: var(--cobalt);
  border-color: #bdc9ef;
}

.template-help {
  margin: -2px 0 0 !important;
  color: var(--muted);
  font-size: 10px;
}

.template-dialog-actions {
  align-items: center;
  justify-content: space-between;
}

.template-dialog-actions > div {
  display: flex;
  gap: 8px;
}

.formatted-report {
  margin-top: 22px;
}

.formatted-report-line {
  min-height: 1.5em;
  color: #3e4a59;
  font-size: 12px;
  line-height: 1.82;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.formatted-report-line.format-title {
  margin-bottom: 2px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 850;
}

.formatted-report-line.format-student {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 850;
  line-height: 1.3;
}

.formatted-report-line.format-meta {
  color: #7b817e;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.formatted-report-line.format-section {
  margin-top: 20px;
  padding: 0 0 7px;
  color: var(--ink);
  border-bottom: 1px solid #e5e0d4;
  font-size: 13px;
  font-weight: 850;
}

.formatted-report-line.format-task {
  padding: 9px 0;
  border-bottom: 1px solid #eeeae1;
}

.formatted-report-line.format-continuity {
  margin: 9px 0;
  padding: 8px 9px;
  color: #3b5860;
  background: #eaf5f1;
  border-left: 3px solid #72b795;
  border-radius: 4px;
}

.empty-state {
  padding: 36px 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 25px;
  height: 25px;
  margin-bottom: 8px;
  color: #9ba9b8;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.empty-state span {
  margin-top: 4px;
  font-size: 10px;
}

.continuity-lead {
  padding: 9px 10px;
  color: #3b5860;
  background: #eaf5f1;
  border-left: 3px solid #72b795;
  border-radius: 4px;
}

@keyframes pulse {
  0% { opacity: 0.72; transform: scale(0.97); }
  100% { opacity: 0; transform: scale(1.16); }
}

@keyframes wave {
  0% { transform: scaleY(0.65); }
  100% { transform: scaleY(1.12); }
}

@keyframes boot-breathe {
  0% { opacity: 0.72; transform: rotate(-4deg) scale(0.97); }
  100% { opacity: 1; transform: rotate(-4deg) scale(1.03); }
}

@media (max-width: 1120px) {
  .page-content {
    padding-right: 26px;
    padding-left: 26px;
  }

  .context-strip {
    grid-template-columns: minmax(170px, 1.3fr) minmax(110px, 0.9fr) minmax(135px, 0.9fr) minmax(195px, 1.15fr);
  }

  .new-session-button {
    grid-column: 4;
    justify-self: end;
  }

  .studio-grid {
    grid-template-columns: minmax(310px, 0.86fr) minmax(430px, 1.14fr);
    gap: 20px;
  }
}

@media (max-width: 1080px) {
  .sidebar {
    position: fixed;
    z-index: 20;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(290px, 86vw);
    flex-basis: min(290px, 86vw);
    transform: translateX(-100%);
    transition: transform 220ms ease;
    box-shadow: 15px 0 35px rgba(13, 23, 40, 0.18);
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close-button {
    display: inline-flex;
    width: 44px;
    height: 44px;
  }

  .sidebar.open .brand-lockup {
    padding-left: 54px;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 19;
    top: 0;
    right: 0;
    bottom: 0;
    left: min(290px, 86vw);
    display: block;
    padding: 0;
    background: rgba(13, 23, 40, 0.48);
    border: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  .sidebar.open + .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .menu-button {
    display: inline-flex;
    width: 44px;
    height: 44px;
  }

  body.sidebar-open .menu-button {
    position: fixed;
    z-index: 21;
    top: calc(22px + env(safe-area-inset-top));
    left: calc(18px + env(safe-area-inset-left));
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
  }

  .topbar {
    padding: env(safe-area-inset-top) calc(20px + env(safe-area-inset-right)) 0 calc(20px + env(safe-area-inset-left));
  }

  .studio-grid {
    grid-template-columns: 1fr;
  }

  .report-sheet {
    min-height: 0;
  }

  .mobile-generate {
    display: inline-flex;
    margin: 12px 0 0;
    min-height: 48px;
  }

  .header-generate {
    display: none;
  }

  .output-footer .copy-button {
    min-width: 122px;
  }
}

@media (max-width: 620px) {
  .topbar {
    height: calc(60px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) calc(13px + env(safe-area-inset-right)) 0 calc(13px + env(safe-area-inset-left));
  }

  .breadcrumb span {
    display: none;
  }

  .breadcrumb svg {
    display: none;
  }

  .page-content {
    padding: 25px calc(13px + env(safe-area-inset-right)) calc(34px + env(safe-area-inset-bottom)) calc(13px + env(safe-area-inset-left));
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 22px;
  }

  h1 {
    font-size: 28px;
  }

  .page-subtitle {
    font-size: 13px;
  }

  .heading-meta {
    width: 100%;
    justify-content: space-between;
    padding-bottom: 0;
  }

  .context-strip {
    grid-template-columns: 1fr 1fr;
    gap: 12px 10px;
    padding: 14px 13px 13px;
  }

  .student-field,
  .time-field {
    grid-column: span 2;
  }

  .new-session-button {
    grid-column: span 2;
    width: 100%;
    min-height: 46px;
  }

  .memory-row {
    grid-column: span 2;
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
  }

  .memory-toggle {
    grid-column: span 2;
  }

  .memory-summary {
    min-width: 0;
  }

  .memory-row .text-command {
    justify-self: end;
  }

  .template-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px 9px;
  }

  .template-row small {
    width: 100%;
    margin-left: 20px;
  }

  .topbar-new-button {
    min-width: 56px;
    height: 40px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid input,
  .form-grid select,
  .history-toolbar select {
    font-size: 16px;
  }

  .student-file-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .student-file-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .history-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .history-toolbar select {
    width: 100%;
  }

  .history-toolbar .danger-text-button {
    justify-content: flex-start;
  }

  .template-toolbar {
    grid-template-columns: 1fr;
  }

  .template-toolbar .secondary-button {
    justify-content: center;
  }

  .template-field textarea {
    min-height: 220px;
    font-size: 16px;
  }

  .template-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .template-dialog-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .template-dialog-actions .danger-text-button {
    align-self: flex-start;
  }

  .studio-grid {
    gap: 20px;
    margin-top: 24px;
  }

  .section-heading {
    min-height: 42px;
    margin-bottom: 10px;
  }

  .section-note {
    display: none;
  }

  .capture-panel,
  .evidence-panel {
    padding-right: 14px;
    padding-left: 14px;
  }

  .notes-header {
    padding-right: 12px;
    padding-left: 12px;
  }

  .notes-actions {
    gap: 7px;
  }

  #transcript {
    min-height: 255px;
    padding-right: 13px;
    padding-left: 13px;
    font-size: 16px;
  }

  .context-field input,
  .context-field select {
    font-size: 16px;
  }

  .notes-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-sheet {
    padding: 24px 21px 20px 28px;
  }

  .report-sheet::before {
    left: 11px;
  }

  .report-sheet h3 {
    font-size: 21px;
  }

  .formatted-report-line.format-student {
    font-size: 21px;
  }

  .task-list li {
    grid-template-columns: 21px 1fr auto;
    font-size: 12px;
  }

  .report-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .output-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 11px;
  }

  .copy-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
