/* Portal form panels, entry grid, lesson details and confirmation. */
#editor {
  --form-inset: 28px;
  width: min(560px, calc(100vw - 40px));
  max-height: 90dvh;
  border: 1px solid #d3e2dc;
  border-radius: 22px;
  box-shadow: 0 24px 90px #163c312b;
  background: white;
  color: #25352f;
}
#editor:not([data-editor-layout="compact"]) { width: min(1160px, calc(100vw - 48px)); }
#editor::backdrop { background: #17332955; backdrop-filter: blur(5px); }
#editor .modal-heading, #editor .dialog-body, #editor .dialog-actions { padding-inline: var(--form-inset); }
#editor .modal-heading {
  position: sticky; top: 0; z-index: 2;
  align-items: flex-start; background: white; border: 0; padding-block: 28px 16px; margin:0;
}
#editor .modal-heading > div { border-left: 6px solid #346b56; padding-left: 16px; }
#editor .modal-heading h2 { font-size: clamp(21px, 3vw, 27px); line-height: 1.3; color: #173d30; }
#editor #editor-description { margin-top: 7px; color: #526459; font-size: 12px; }
#editor .dialog-body { gap: 16px; padding-block: 18px 24px; }
#editor .form-section { border: 1px solid #d3e2dc; border-radius: 14px; min-width: 0; }
#editor .form-section h3 {
  display: flex; align-items: center; gap: 9px; margin: 0; padding: 12px 18px;
  border-radius: 13px 13px 0 0; font-size: 18px; color: #173d30;
  background: linear-gradient(110deg, #e7f3ec, #f2f8f4);
}
#editor .form-section-body { display: grid; gap: 16px; min-width: 0; padding: 16px 18px; }
#editor .form-section-body > p { margin: 0; }
#editor .field { gap: 7px; min-width: 0; }
#editor .field > span { color: #42584e; font-size: 12px; font-weight: 500; }
#editor .editor-required { color: #a34332; font-weight: 650; }
#editor input:not([type="checkbox"]), #editor select {
  min-width: 0; max-width: 100%; min-height: 40px; padding: 8px 10px;
  border: 1px solid #a2b7aa; border-radius: 7px; color: #25352f; background: white;
}
#editor .editor-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 22px; }
#editor .editor-fields.timed { grid-template-columns: repeat(3,minmax(0,1fr)); }
#editor .dialog-actions {
  padding-block: 14px 20px; background: white; border-top: 1px solid #d3e2dc; flex-wrap: wrap;
}
#editor .primary { background: #346b56; border-color: #346b56; color: white; }
#editor .btn { min-height: 40px; padding-inline: 14px; }
#editor .draft-note { margin-inline: var(--form-inset); border: 1px solid #c5d3d5; color: #164754; background: #eaf3f2; }
#editor .editor-entry-grid {
  display: grid; gap: 1px; background: #dbe4df; border: 1px solid #dbe4df;
  border-radius: 10px; overflow: clip; align-items: stretch;
}
#editor .editor-student-grid { grid-template-columns: 1.15fr 1fr 1.15fr 1.15fr; }
#editor .editor-class-grid { grid-template-columns: 1.15fr 1fr 1.45fr 1fr; }
#editor .editor-entry-grid > * { min-width: 0; background: #fff; }
#editor .editor-entry-grid .field { gap: 0; align-content: start; }
#editor .editor-entry-grid .field > span, #editor .editor-entry-grid legend {
  width: 100%; padding: 12px; background: #e7f3ec; color: #284b3d; font-size: 12px; font-weight: 650;
}
#editor .editor-entry-grid :is(input:not([type="checkbox"]),select) {
  width: calc(100% - 24px); margin: 12px; border-color: #c3d2c9;
}
#editor .editor-entry-grid fieldset { padding: 0; margin: 0; border: none; border-radius: 0; }
#editor .editor-entry-grid legend { float: left; }
#editor .editor-members { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 7px 12px; max-height: 9rem; overflow: auto; }
#editor .editor-members label { display: flex; align-items: center; gap: 7px; min-height: 32px; overflow-wrap: anywhere; }
#editor .editor-members input { width: 15px; height: 15px; flex: none; accent-color: #346b56; }
#editor .editor-details {
  display: grid; gap: 18px 24px; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; padding-bottom: 4px;
}
#editor .editor-details dt { font-size: 11px; color: #526459; margin-bottom: 6px; }
#editor .editor-details dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
#editor .editor-details .badge i { display: none; }
#editor .editor-status { display: inline-block; padding: 3px 6px; border-radius: 4px; background: #edf3e8; color: #546151; font-size: 11px; }
#editor .editor-detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
#editor .editor-attendance { border-top: 1px solid #e5e9e3; margin-top: 3px; padding-top: 16px; min-width: 0; }
#editor .editor-attendance h3 { margin-bottom: 7px; font-size: 16px; }
#editor .editor-table-wrap { overflow-x: auto; }
#editor .attendance-list { display: table; width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
#editor .attendance-list :is(th,td) { padding: 12px 14px; border-bottom: 1px solid #eff1ec; }
#editor .attendance-list thead th { font-size: 11px; font-weight: 550; background: #f7f8f5; color: #526459; white-space: nowrap; }
#editor .attendance-list tbody th { font-weight: 600; }
#editor .attendance-list tbody tr:last-child :is(th,td) { border-bottom: 0; }
#editor .attendance-list select { min-width: 6.5rem; }
#editor .confirmation-table { min-width: 460px; font-size: 13px; }
#editor .confirmation-table thead th { color: #346b56; background: #edf3ef; }
#editor .confirmation-table select { width: 100%; }
#editor .editor-confirmation-intro { color: #526459; font-size: 12px; }
#editor .editor-confirmation-grid {
  display: grid; grid-template-columns: 1fr 1.2fr 1.25fr 1fr;
  gap: 1px; background: #d3e2dc; border: 1px solid #d3e2dc; border-radius: 10px; overflow: clip;
}
#editor .editor-confirmation-grid > section { min-width: 0; background: white; }
#editor .editor-confirmation-grid h3 { padding: 11px 13px; background: #edf3ef; color: #346b56; font-size: 13px; }
#editor .editor-confirmation-grid section > div { display: grid; align-content: start; gap: 4px; padding: 12px 13px; }
#editor .editor-confirmation-grid small { color: #526459; font-size: 11px; overflow-wrap: anywhere; }
#editor .editor-roster { display: flex; flex-wrap: wrap; gap: 5px; }
#editor .editor-confirmation-attendance { border: 1px solid #d3e2dc; border-radius: 10px; }
#editor .editor-confirmation-attendance summary {
  cursor: pointer; padding: 10px 12px; border-radius: 9px; background: #edf3ef; font-size: 13px; font-weight: 650; color: #346b56;
}
#editor .editor-confirmation-attendance summary small { float: right; color: #526459; font-weight: 400; }
#editor .editor-confirmation-attendance > div { display: grid; gap: 12px; min-width: 0; padding: 12px; }
#editor .editor-confirmation-attendance .editor-table-wrap { border: 1px solid #d3e2dc; border-radius: 9px; }
#editor .charge-preview { justify-self: end; background: #e7f3ec; }

/* Match the product's teal, right-docked conversation panel. */
#assistant[open] {
  position: fixed; z-index: 48; inset: auto 18px 18px auto; margin: 0;
  width: clamp(300px, 30vw, 348px); height: min(72dvh, 690px);
  max-height: calc(100dvh - var(--synapse-header-height, 80px) - 24px);
  border: 1px solid #c5d3d5; border-radius: 14px;
  box-shadow: 0 8px 36px #172f3630; color: #172f36; background: white;
}
#assistant .chat-head { padding: 10px 14px; border: 0; background: #164754; color: white; }
#assistant .chat-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; color: inherit; }
#assistant .chat-head button { width: 30px; height: 30px; color: white; border: 0; background: transparent; }
#assistant .chat-meta { padding: 8px 14px; border-bottom: 1px solid #dce6e6; background: #f4f8f7; color: #4d6063; }
#assistant #chat-body { padding: 10px 14px; overscroll-behavior: contain; }
#assistant .chat-welcome { padding: 6px 0; }
#assistant .chat-welcome h3 { margin: 0 0 12px; font-size: 15px; }
#assistant .prompts button { min-height: 35px; padding: 6px 9px; border: 1px solid #c5d3d5; border-radius: 7px; background: white; }
#assistant .chat-entry { align-self: stretch; max-width: 100%; }
#assistant .chat-entry > strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#assistant .chat-entry > p { margin: 0; padding: 3px 0; border: 0; background: transparent; line-height: 1.55; }
#assistant .chat-entry.user > p { margin-left: 16px; padding: 8px 10px; border-radius: 8px; background: #eaf3f2; }
#assistant .chat-result { border-color: #dce6e6; }
#assistant #chat-form { padding: 10px 14px; border-top: 1px solid #dce6e6; }
#assistant .privacy-note { margin: 0 0 6px; font-size: 11px; line-height: 1.45; color: #4d6063; }
#assistant .composer { align-items: center; }
#assistant .composer textarea { flex: 1; min-width: 0; border: 1px solid #c5d3d5; border-radius: 7px; }
#assistant .send-btn { flex: none; width: auto; min-height: 36px; padding: 6px 12px; white-space: nowrap; color: white; background: #164754; border-radius: 7px; }
@media (min-width: 1100px) {
  body:has(#assistant[open]) #main-pane { margin-right: calc(clamp(300px, 30vw, 348px) + 22px); }
}
@media (max-width: 600px) {
  #editor, #editor:not([data-editor-layout="compact"]) { --form-inset: 14px; width: calc(100vw - 20px); border-radius: 14px; }
  #editor .modal-heading { gap: 8px; padding-block: 16px 10px; }
  #editor .modal-heading > div { padding-left: 10px; border-left-width: 4px; }
  #editor .modal-heading .icon-btn { flex: none; }
  #editor .form-section-body, #editor .form-section h3 { padding-inline: 12px; }
  #editor .form-section h3 { font-size: 16px; }
  #editor .editor-entry-grid { grid-template-columns: minmax(0,1fr); }
  #editor .editor-entry-grid .field > span, #editor .editor-entry-grid legend { padding: 8px 12px; }
  #editor .editor-entry-grid :is(input:not([type="checkbox"]),select) { margin-block: 7px; }
  #editor .editor-fields, #editor .editor-fields.timed { grid-template-columns: minmax(0,1fr); gap: 12px; }
  #editor .editor-details { gap: 12px; }
  #editor .editor-confirmation-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #editor .attendance-list :is(th,td) { padding: 8px; }
  #editor .attendance-list thead th { white-space: normal; }
  #assistant[open] { inset: auto 10px max(10px, env(safe-area-inset-bottom)) auto; width: calc(100vw - 20px); height: 72dvh; }
}
