.auth-pending body { visibility: hidden; }

.course-roadmap { margin: 0 0 28px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 8%, var(--surface)), var(--surface)); }
.course-roadmap header span { color: var(--blue); font: 700 9px "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .12em; }
.course-roadmap header h3 { margin: 5px 0 18px; color: var(--text); font-size: 22px; }
.course-roadmap ol { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; counter-reset: roadmap; }
.course-roadmap li { position: relative; min-height: 94px; padding: 15px 16px 14px 48px; border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--surface) 88%, transparent); counter-increment: roadmap; }
.course-roadmap li::before { content: counter(roadmap); position: absolute; top: 14px; left: 15px; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: #07120a; background: var(--lime); font: 800 10px "JetBrains Mono", monospace; }
.course-roadmap li b { color: var(--text); font-size: 13px; }
.course-roadmap li p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.lesson-bottom-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding-top: 18px; padding-bottom: 28px; }
.lesson-bottom-navigation > a, .lesson-bottom-navigation > span:not(:empty) { min-height: 68px; display: flex; flex-direction: column; justify-content: center; padding: 13px 16px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface); text-decoration: none; }
.lesson-bottom-navigation .next { text-align: right; align-items: flex-end; }
.lesson-bottom-navigation small { margin-bottom: 5px; color: var(--muted); font: 700 9px "JetBrains Mono", monospace; text-transform: uppercase; }
.lesson-bottom-navigation strong { font-size: 13px; }
.lesson-bottom-navigation a:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }
.lesson-bottom-navigation .is-locked { opacity: .55; cursor: not-allowed; }
@media (max-width: 650px) { .lesson-bottom-navigation { grid-template-columns: 1fr; } .lesson-bottom-navigation .next { text-align: left; align-items: flex-start; } }
@media (max-width: 760px) { .course-roadmap { padding: 18px; } .course-roadmap ol { grid-template-columns: 1fr; } }

.admin-thread:not(.is-empty) {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  min-height: 0;
}
.admin-thread.is-global { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.admin-thread-messages { min-height: 0; }
.admin-reply-form textarea { min-height: 180px; }
.admin-thread-head-actions { display: flex; align-items: center; gap: 10px; }
.admin-thread-head-actions > button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--surface); cursor: pointer; }
.admin-thread-head-actions > button:hover { border-color: var(--lime); }
.admin-user-detail:has(> .admin-empty) { display: grid; place-items: center; }
.admin-user-detail > .admin-empty { margin-top: 0; }
.admin-user-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 4px; }
.admin-user-summary > div { padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.admin-user-summary strong, .admin-user-summary small { display: block; }
.admin-user-summary strong { color: var(--lime); font: 800 17px "JetBrains Mono", monospace; }
.admin-user-summary small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.admin-user-summary p { grid-column: 1 / -1; margin: 0; color: var(--muted); font: 500 8px "JetBrains Mono", monospace; }
.admin-profile-form > div { display: grid; grid-template-columns: 1fr 1fr 180px; gap: 12px; margin: 16px 0; }
.admin-profile-form label span { display: block; margin-bottom: 6px; color: var(--muted); font: 700 9px "JetBrains Mono", monospace; text-transform: uppercase; }
.admin-profile-form input { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--line); border-radius: 3px; color: var(--text); background: #07101c; font: 12px "JetBrains Mono", monospace; }
html[data-course-theme=light] .admin-profile-form input { background: #fff; }
.admin-profile-form > button { padding: 10px 14px; border: 1px solid var(--lime); border-radius: 3px; color: #11180d; background: var(--lime); font-weight: 800; cursor: pointer; }
.admin-profile-form > button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 900px) { .admin-profile-form > div { grid-template-columns: 1fr; } }
.admin-lesson-context-modal { position: fixed; inset: 0; z-index: 70; padding: 28px; background: rgba(3, 7, 15, .78); backdrop-filter: blur(8px); }
.admin-lesson-context-modal > section { width: min(980px, 100%); height: calc(100vh - 56px); margin: 0 auto; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.admin-lesson-context-modal header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.admin-lesson-context-modal header span { color: var(--blue); font: 700 10px "JetBrains Mono", monospace; text-transform: uppercase; }
.admin-lesson-context-modal header h2 { margin: 4px 0 0; }
.admin-lesson-context-modal header button { border: 0; color: var(--muted); background: transparent; font-size: 30px; cursor: pointer; }
.admin-lesson-context-modal article { overflow: auto; padding: 26px 34px; }
.admin-progress-main { height: calc(100vh - 72px); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; background: var(--bg); }
.admin-progress-main > header { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 22px 28px; border-bottom: 1px solid var(--line); }
.admin-progress-main > header span { color: var(--blue); font: 700 10px "JetBrains Mono", monospace; text-transform: uppercase; }
.admin-progress-main > header h1 { margin: 4px 0; font-size: 28px; }
.admin-progress-main > header p { margin: 0; color: var(--muted); }
.admin-progress-main > header input { width: min(320px, 35vw); padding: 11px 13px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--surface); }
.admin-progress-table { min-height: 0; overflow: auto; padding: 0 0 24px; }
.admin-progress-seasons { position: sticky; top: 0; left: 0; z-index: 7; width: max-content; min-width: 100%; display: flex; gap: 8px; box-sizing: border-box; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--bg); }
.admin-progress-seasons button { min-width: 118px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface); cursor: pointer; }
.admin-progress-seasons button span { color: inherit; font: 700 11px "JetBrains Mono", monospace; text-transform: uppercase; }
.admin-progress-seasons button small { font: 500 9px "JetBrains Mono", monospace; white-space: nowrap; }
.admin-progress-seasons button:hover { border-color: var(--blue); color: var(--text); }
.admin-progress-seasons button.active { border-color: var(--blue); color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.admin-progress-table table { border-collapse: separate; border-spacing: 0; min-width: 100%; background: var(--surface); }
.admin-progress-table th, .admin-progress-table td { height: 48px; padding: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.admin-progress-table thead th { position: sticky; top: 59px; z-index: 3; min-width: 52px; color: var(--muted); background: var(--surface); font: 700 9px "JetBrains Mono", monospace; }
.admin-progress-table thead th:first-child { left: 0; z-index: 5; min-width: 250px; text-align: left; padding-left: 20px; }
.admin-progress-table thead th span, .admin-progress-table thead th strong { display: block; }
.admin-progress-table tbody > tr > th { position: sticky; left: 0; z-index: 2; min-width: 250px; padding: 0 20px; text-align: left; background: var(--surface); }
.admin-progress-table tbody > tr > th strong, .admin-progress-table tbody > tr > th small { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-progress-table tbody > tr > th small { margin-top: 3px; color: var(--muted); font: 500 9px "JetBrains Mono", monospace; }
.admin-progress-table td button { width: 34px; height: 34px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.admin-progress-table td button:hover { border-color: var(--blue); transform: scale(1.06); }
.admin-progress-table td button.approved { color: #07140d; background: var(--lime); font-weight: 900; }
.admin-progress-table td button.pending { color: #101018; background: #f4c95d; }
.admin-progress-table td button.granted { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 45%, transparent); }
.admin-progress-table td button.locked { opacity: .48; filter: grayscale(1); }
.admin-progress-table td button:disabled { opacity: .4; cursor: wait; }
@media (max-width: 760px) { .admin-progress-main > header { align-items: stretch; flex-direction: column; } .admin-progress-main > header input { width: 100%; } }

.admin-chat-avatar img,
.admin-user-item > span img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

#admin-chat-search {
  width: 100%;
  margin: 12px 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
}

.global-chat-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  border: 1px solid rgba(86, 169, 255, .55);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #1769aa, #2149bb);
  box-shadow: 0 16px 48px rgba(7, 31, 72, .48);
  font-weight: 800;
  cursor: pointer;
}
.global-chat-button span { color: #9ed7ff; }
.global-chat-button b { min-width: 21px; height: 21px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: 999px; color: #fff; background: #d84056; font-size: 11px; }
.global-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 24px;
  background: rgba(3, 7, 15, .76);
  backdrop-filter: blur(9px);
}
.global-chat-dialog {
  width: min(760px, 100%);
  height: min(760px, calc(100vh - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}
.global-chat-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.global-chat-dialog > header span { color: var(--blue); font: 700 11px "JetBrains Mono", monospace; text-transform: uppercase; }
.global-chat-dialog > header h2 { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 18px; }
.global-chat-dialog > header img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.global-chat-dialog > header button { border: 0; color: #9fb0c8; background: transparent; font-size: 30px; cursor: pointer; }
.global-chat-messages { overflow-y: auto; display: flex; flex-direction: column; gap: 13px; padding: 22px; }
.global-chat-form { padding: 16px 20px 20px; border-top: 1px solid var(--line); }
.global-chat-form textarea { width: 100%; resize: vertical; min-height: 90px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); }
.global-chat-form > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.global-chat-form small { color: var(--muted); }
.global-chat-form button { padding: 10px 15px; border: 0; border-radius: 8px; color: #fff; background: var(--blue); font-weight: 800; cursor: pointer; }
.chat-lesson-label { display: inline-block; margin: 7px 0 1px; color: #7fbef2; font: 700 10px "JetBrains Mono", monospace; }
.chat-lesson-label.direct { color: #8ed9ac; }
.chat-message blockquote { margin: 10px 0 2px; padding: 10px 14px; border-left: 3px solid var(--blue); border-radius: 0 8px 8px 0; color: #c5d4e8; background: rgba(73, 145, 212, .12); }
html[data-course-theme=light] #admin-chat-search,
html[data-course-theme=light] .global-chat-form textarea { background: #fff; color: var(--text); }
html[data-course-theme=light] .global-chat-button {
  border-color: #b8cee5;
  color: #315271;
  background: #e8f1fa;
  box-shadow: 0 10px 28px rgba(40, 76, 112, .16);
}
html[data-course-theme=light] .global-chat-button span { color: #547da3; }
html[data-course-theme=light] .global-chat-form button,
html[data-course-theme=light] .admin-reply-form button {
  color: #fff;
  background: #52779b;
}
html[data-course-theme=light] .chat-message blockquote { color: #354a60; background: #edf4fb; }
@media (max-width: 700px) {
  .global-chat-button { right: 14px; bottom: 14px; }
  .global-chat-modal { padding: 0; }
  .global-chat-dialog { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .global-chat-form > div { align-items: flex-end; }
  .global-chat-form small { max-width: 62%; }
}

.classic-emoji { width: 23px; height: 23px; display: inline-block; vertical-align: -6px; object-fit: contain; }
.chat-emoji-picker,
.admin-reply-form > .chat-emoji-picker,
.global-chat-form > .chat-emoji-picker { position: relative; display: inline-block; margin: 8px 0 0; }
.chat-emoji-toggle,
.global-chat-form .chat-emoji-toggle,
.admin-reply-form .chat-emoji-toggle,
.homework-form .chat-emoji-toggle { width: 36px; height: 32px; display: grid; place-items: center; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; }
.chat-emoji-toggle img { width: 24px; height: 24px; }
.chat-emoji-panel { position: absolute; left: 0; bottom: 40px; z-index: 30; width: 366px; max-width: calc(100vw - 24px); max-height: 360px; box-sizing: border-box; overflow-x: hidden; overflow-y: auto; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #101a29; box-shadow: 0 18px 50px rgba(0, 0, 0, .42); }
.chat-emoji-panel[hidden] { display: none; }
.chat-emoji-panel button,
.global-chat-form .chat-emoji-panel button,
.admin-reply-form .chat-emoji-panel button,
.homework-form .chat-emoji-panel button { width: 100%; min-width: 0; height: 38px; display: grid; place-items: center; padding: 3px; border: 1px solid transparent; border-radius: 7px; background: transparent; cursor: pointer; }
.chat-emoji-panel button:hover { border-color: var(--blue); background: rgba(120, 176, 229, .12); transform: translateY(-1px); }
.chat-emoji-panel .classic-emoji { width: 29px; height: 29px; vertical-align: initial; }
.chat-emoji-panel small { grid-column: 1 / -1; max-width: none; padding: 5px 2px 0; color: var(--muted); font: 500 7px "JetBrains Mono", monospace; text-align: center; }
html[data-course-theme=light] .chat-emoji-panel { background: #f7fbff; }

.chat-sound-toggle { width: 38px; height: 38px; flex: 0 0 38px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.chat-sound-toggle span { color: var(--blue); font: 900 18px "JetBrains Mono", monospace; }
.chat-sound-toggle:hover { border-color: var(--blue); color: var(--text); }
.chat-sound-toggle.is-active { border-color: rgba(198, 255, 92, .6); color: var(--lime); }
html[data-course-theme=light] .chat-sound-toggle { background: transparent; }
.chat-message-markdown { margin-top: 8px; color: #d7e2ef; font-size: 13px; line-height: 1.55; }
.chat-message-markdown > :first-child { margin-top: 0; }
.chat-message-markdown > :last-child { margin-bottom: 0; }
.chat-message-markdown p { margin: 7px 0; }
.chat-message-markdown h2, .chat-message-markdown h3, .chat-message-markdown h4 { margin: 12px 0 6px; color: var(--text); line-height: 1.25; letter-spacing: -.02em; }
.chat-message-markdown h2 { font-size: 18px; }
.chat-message-markdown h3 { font-size: 16px; }
.chat-message-markdown h4 { font-size: 14px; }
.chat-message-markdown ul, .chat-message-markdown ol { margin: 7px 0; padding-left: 22px; }
.chat-message-markdown li { margin: 3px 0; }
.chat-message-markdown a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.chat-message-markdown code:not(pre code) { padding: 2px 5px; border-radius: 4px; color: #b7e2ff; background: rgba(89, 153, 207, .14); font-family: "JetBrains Mono", monospace; }
.chat-message-markdown pre { max-width: 100%; overflow-x: auto; margin: 9px 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; background: #07101c; }
.chat-message-markdown pre code { font: 11px/1.55 "JetBrains Mono", monospace; white-space: pre; }
.chat-message-markdown blockquote { margin: 8px 0; padding: 8px 11px; border-left: 3px solid var(--blue); color: #b9cadb; background: rgba(89, 153, 207, .08); }
.chat-message-markdown hr { margin: 12px 0; border: 0; border-top: 1px solid var(--line); }
.chat-message-markdown img:not(.classic-emoji) { max-width: min(100%, 440px); height: auto; border-radius: 7px; }
.chat-message-markdown .lesson-homework { margin: 0; padding: 0; border: 0; background: transparent; }
html[data-course-theme=light] .chat-message-markdown { color: #354a60; }
html[data-course-theme=light] .chat-message-markdown pre { background: #edf4fb; }
html[data-course-theme=light] .chat-message-markdown code:not(pre code) { color: #24557f; }

.chat-quote-selection { position: fixed; z-index: 140; transform: translateX(-50%); padding: 8px 11px; border: 1px solid var(--blue); border-radius: 7px; color: #fff; background: #315f8b; box-shadow: 0 10px 28px rgba(0, 0, 0, .34); font: 700 10px "JetBrains Mono", monospace; cursor: pointer; }
.chat-quote-selection[hidden] { display: none; }
.chat-quote-selection:hover { background: #4479a9; }

.chat-format-help,
.global-chat-form > .chat-format-help,
.admin-reply-form > .chat-format-help { position: relative; z-index: 18; display: inline-block; margin: 8px 0 0 7px; vertical-align: top; }
.chat-format-toggle,
.global-chat-form .chat-format-toggle,
.admin-reply-form .chat-format-toggle,
.homework-form .chat-format-toggle { min-height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface); font: 700 9px "JetBrains Mono", monospace; cursor: pointer; }
.chat-format-toggle > span { width: 18px; height: 18px; display: inline-grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; color: var(--blue); font-size: 11px; }
.chat-format-toggle:hover, .chat-format-toggle[aria-expanded=true] { border-color: var(--blue); color: var(--text); }
.chat-format-popover { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 46; width: min(410px, calc(100vw - 32px)); max-height: min(520px, calc(100dvh - 110px)); box-sizing: border-box; overflow-y: auto; padding: 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #101a29; box-shadow: 0 20px 60px rgba(0, 0, 0, .52); }
.chat-format-popover[hidden] { display: none; }
.chat-format-popover header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.chat-format-popover header strong { font-size: 13px; }
.chat-format-popover header button { width: 28px; height: 28px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 23px; cursor: pointer; }
.chat-format-popover ul { display: grid; gap: 0; margin: 9px 0; padding: 0; list-style: none; }
.chat-format-popover li { display: grid; grid-template-columns: minmax(145px, 1.1fr) 1fr; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }
.chat-format-popover li:last-child { border-bottom: 0; }
.chat-format-popover code { overflow-wrap: anywhere; color: var(--blue); font: 700 10px/1.5 "JetBrains Mono", monospace; }
.chat-format-popover li span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.chat-format-popover > small { display: block; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.45; }
html[data-course-theme=light] .chat-format-toggle { border-color: #aebfd0; color: #405a73; background: #fff; }
html[data-course-theme=light] .chat-format-toggle > span { border-color: #52779b; color: #fff; background: #52779b; }
html[data-course-theme=light] .chat-format-toggle:hover,
html[data-course-theme=light] .chat-format-toggle[aria-expanded=true] { border-color: #52779b; color: #274760; background: #edf4fb; }
html[data-course-theme=light] .chat-format-popover { background: #fff; box-shadow: 0 18px 50px rgba(42, 67, 92, .22); }
.chat-message-actions { display: inline-flex; gap: 5px; margin-left: auto; }
.chat-message-edit, .chat-message-delete, .chat-message-copy { padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: transparent; font: 600 9px "JetBrains Mono", monospace; cursor: pointer; }
.chat-message-copy { min-width: 25px; font-size: 14px; line-height: 1; }
.chat-message-edit:hover, .chat-message-copy:hover { border-color: var(--blue); color: var(--blue); }
.chat-message-delete:hover { border-color: #c7475b; color: #e77888; }
.chat-message-edit:disabled, .chat-message-delete:disabled, .chat-message-copy:disabled { opacity: .45; cursor: wait; }
.chat-read-receipt { margin-left: 5px; color: var(--muted); font: 800 10px "JetBrains Mono", monospace; letter-spacing: -3px; }
.chat-read-receipt.is-read { color: var(--blue); }
.chat-message-edit-input { width: 100%; min-height: 120px; box-sizing: border-box; padding: 10px; border: 1px solid var(--blue); border-radius: 6px; color: var(--text); background: var(--surface); font: 13px/1.5 Inter, sans-serif; resize: vertical; }
.chat-message-edit-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 7px; }
.chat-message-edit-actions button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--surface); cursor: pointer; }
.chat-message-edit-actions button:last-child { border-color: var(--blue); background: var(--blue); color: #fff; }

.admin-reply-tools { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.admin-reply-tools label { cursor: pointer; }
.admin-reply-tools label > span { display: inline-flex; align-items: center; min-height: 32px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: var(--surface); font: 700 10px "JetBrains Mono", monospace; }
.admin-reply-tools label:hover > span { border-color: var(--blue); }
.admin-reply-tools small { color: var(--muted); font: 500 9px "JetBrains Mono", monospace; }
.admin-reply-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.admin-reply-files:empty { display: none; }
.admin-reply-files > span { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: color-mix(in srgb, var(--blue) 7%, var(--surface)); font: 600 10px "JetBrains Mono", monospace; }
.admin-reply-files > span small { color: var(--muted); white-space: nowrap; }
.admin-reply-files > span button,
html[data-course-theme=light] .admin-reply-files > span button { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.admin-reply-files > span button:hover { color: #fff; background: #c7475b; }

@media (max-width: 700px) {
  .chat-sound-toggle { width: 36px; height: 36px; flex-basis: 36px; }
  .chat-emoji-panel { position: fixed; left: 50%; bottom: 78px; width: 286px; max-height: min(55vh, 360px); grid-template-columns: repeat(6, 1fr); transform: translateX(-50%); }
}

/* Both student chats can switch between a comfortable window and the full viewport. */
.chat-dialog-actions { display: flex; align-items: center; gap: 9px; }
.homework-chat-dialog > header .chat-dialog-actions,
.global-chat-dialog > header .chat-dialog-actions { display: flex; }
.homework-chat-dialog > header .chat-size-toggle,
.global-chat-dialog > header .chat-size-toggle {
  width: auto;
  min-width: 42px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: transparent;
  font: 700 10px "JetBrains Mono", monospace;
}
.chat-size-toggle span { font-size: 18px; line-height: 1; }
.chat-size-toggle em { font-style: normal; white-space: nowrap; }
.chat-size-toggle:hover { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 9%, transparent); }
.homework-chat-modal.is-expanded,
.global-chat-modal.is-expanded { padding: 0; }
.homework-chat-modal.is-expanded .homework-chat-dialog,
.global-chat-modal.is-expanded .global-chat-dialog {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
}
@media (max-width: 700px) {
  .global-chat-modal:not(.is-expanded) { padding: 8px; }
  .global-chat-modal:not(.is-expanded) .global-chat-dialog {
    height: calc(100dvh - 16px);
    border: 1px solid var(--line);
    border-radius: 7px;
  }
}
@media (max-width: 700px) {
  .chat-format-popover { position: fixed; left: 50%; top: 50%; bottom: auto; width: calc(100vw - 24px); max-height: calc(100dvh - 48px); transform: translate(-50%, -50%); }
  .chat-format-popover li { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 520px) {
  .chat-size-toggle em { display: none; }
  .homework-chat-dialog > header .chat-size-toggle,
  .global-chat-dialog > header .chat-size-toggle { width: 38px; min-width: 38px; padding: 0; }
}
