/* Mathside styles extracted from mathside.html. Original order preserved. */

:root {
      color-scheme: light dark;
      background: light-dark(#fff, #181818);
    }

    body {
      margin: 0;
    }

    #mt-studio svg.lucide {
      display: block;
      flex: none;
      stroke-width: 1.6;
    }

#mt-studio {
      --paper: light-dark(#fbfaf7, #171d1c);
      --panel: light-dark(#ffffff, #202826);
      --ink: light-dark(#233b35, #e0ebe6);
      --quiet: light-dark(#65766e, #a6b7af);
      --line: light-dark(#dfe5df, #3a4842);
      --wash: light-dark(#edf2eb, #283830);
      --accent: light-dark(#28624b, #a3d3b6);
      --on-accent: light-dark(#fff, #153025);
      font: 15px/1.55 system-ui, sans-serif;
      color: var(--ink);
      background: var(--paper);
      border-radius: 18px;
      overflow: hidden
    }

    #mt-studio * {
      box-sizing: border-box
    }

    #mt-studio [hidden] {
      display: none !important
    }

    #mt-studio header {
      padding: 22px 28px;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      padding-right: 105px
    }

    #mt-studio .brand {
      font-weight: 650;
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap
    }

    #mt-studio .brand small {
      font-size: 10px;
      letter-spacing: 1.5px;
      color: var(--quiet);
      font-weight: 500
    }

    #mt-studio .logo {
      background: var(--accent);
      color: var(--on-accent);
      border-radius: 10px;
      padding: 0 10px;
      font: 28px Georgia, serif
    }

    #mt-studio .prototype {
      font-size: 11px;
      color: var(--quiet)
    }

    #mt-studio button,
    #mt-studio input,
    #mt-studio select,
    #mt-studio textarea {
      font: inherit;
      color: inherit
    }

    #mt-studio button {
      border: 1px solid var(--line);
      border-radius: 9px;
      background: var(--panel);
      padding: 9px 13px;
      cursor: pointer
    }

    #mt-studio button:hover {
      background: var(--wash)
    }

    #mt-studio button.main {
      background: var(--accent);
      color: var(--on-accent);
      border-color: var(--accent)
    }

    #mt-studio .intro {
      text-align: center;
      padding: 48px 20px 28px
    }

    #mt-studio .eyebrow {
      font-size: 10px;
      letter-spacing: 1.8px;
      color: var(--quiet);
      font-weight: 650
    }

    #mt-studio h1 {
      font: 42px/1.15 Georgia, serif;
      margin: 12px 0
    }

    #mt-studio p {
      margin: 12px 0
    }

    #mt-studio .intro p {
      color: var(--quiet)
    }

    #mt-studio .paths {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 18px;
      max-width: 710px;
      margin: 0 auto;
      padding: 0 20px
    }

    #mt-studio .paths button {
      text-align: left;
      padding: 24px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 14px;
      border-radius: 14px
    }

    #mt-studio .paths strong {
      font: 25px Georgia, serif
    }

    #mt-studio .paths span {
      color: var(--quiet)
    }

    #mt-studio .paths b {
      font-size: 13px;
      font-weight: 600;
      color: var(--accent);
      margin-top: 7px
    }

    #mt-studio .footnote {
      text-align: center;
      color: var(--quiet);
      padding: 22px 16px 32px;
      font-size: 12px
    }

    #mt-studio form {
      max-width: 670px;
      padding: 24px;
      margin: 0 auto;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 14px
    }

    #mt-studio h2 {
      font: 26px Georgia, serif;
      margin: 0
    }

    #mt-studio .setup-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 20px
    }

    #mt-studio label {
      display: block;
      font-size: 13px
    }

    #mt-studio input,
    #mt-studio select {
      display: block;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      width: 100%;
      margin: 6px 0 18px;
      min-width: 0
    }

    #mt-studio input[type=file] {
      font-size: 12px
    }

    #mt-studio .fields {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px
    }

    #mt-studio .soft {
      font-size: 12px;
      color: var(--quiet)
    }

    #mt-studio .session-top {
      padding: 16px 24px;
      display: flex;
      align-items: center;
      gap: 16px;
      flex-wrap: wrap;
      font-size: 12px;
      border-bottom: 1px solid var(--line)
    }

    #mt-studio .pill {
      margin-left: auto;
      background: var(--wash);
      padding: 6px 10px;
      border-radius: 20px;
      font-size: 11px
    }

    #mt-studio .session-grid {
      display: grid;
      grid-template-columns: 190px minmax(0, 1fr) minmax(0, 1.05fr)
    }

    #mt-studio aside {
      padding: 24px 18px;
      border-right: 1px solid var(--line)
    }

    #mt-studio h3 {
      font-size: 16px;
      margin: 5px 0 16px;
      font-weight: 600
    }

    #mt-studio .topic {
      padding: 12px 8px;
      font-size: 12px;
      color: var(--quiet)
    }

    #mt-studio .topic small {
      display: block;
      margin: 4px 0 0 16px;
      font-size: 11px
    }

    #mt-studio .topic.active {
      background: var(--wash);
      border-radius: 8px;
      color: var(--ink)
    }

    #mt-studio .aside-note {
      font-size: 12px;
      color: var(--quiet);
      border-top: 1px solid var(--line);
      padding-top: 18px;
      margin-top: 28px
    }

    #mt-studio .lesson {
      padding: 26px 22px
    }

    #mt-studio .tutor-heading {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 26px
    }

    #mt-studio .avatar {
      font: 26px Georgia, serif;
      background: var(--wash);
      border-radius: 12px;
      padding: 5px 12px
    }

    #mt-studio .tutor-heading small {
      display: block;
      font-size: 11px;
      color: var(--quiet)
    }

    #mt-studio .equation {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 13px;
      padding: 28px 0;
      font: 29px Georgia, serif
    }

    #mt-studio .lim {
      display: flex;
      flex-direction: column;
      text-align: center
    }

    #mt-studio .lim small {
      font-size: 13px
    }

    #mt-studio #mt-feedback {
      display: grid;
      align-content: start;
      gap: 10px;
      height: clamp(240px, 42vh, 420px);
      overflow-y: auto;
      overscroll-behavior: contain;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: var(--panel);
      font-size: 14px;
    }

    #mt-studio .tutor-message {
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--wash);
      overflow-wrap: anywhere;
    }

    #mt-studio .tutor-message.student {
      background: var(--paper);
    }

    #mt-studio .message-sender {
      color: var(--accent);
      font-size: 12px;
    }

    #mt-studio .student .message-sender {
      color: var(--quiet);
    }

    #mt-studio #mt-feedback .tutor-message p {
      margin: 4px 0 0;
      white-space: pre-wrap;
    }

    #mt-studio #mt-feedback .equation {
      padding: 12px 0;
    }

    #mt-studio #mt-conversation-form {
      display: grid;
      gap: 8px;
      margin: 14px 0 0;
      padding: 0;
      border: 0;
      background: transparent;
    }

    #mt-studio #mt-message {
      min-height: 64px;
      margin: 0;
      padding: 9px 10px;
    }

    #mt-studio .tutor-message-actions {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
    }

    #mt-studio .tutor-message-actions button {
      min-height: 44px;
    }

    #mt-studio #mt-clear-message {
      color: var(--quiet);
      background: transparent;
      padding-inline: 10px;
    }

    #mt-studio #mt-clear-message:hover {
      background: var(--wash);
    }

    #mt-studio .tutor-message-actions button[type="submit"] {
      margin-inline-start: auto;
    }

    #mt-studio #mt-voice-status:not(:empty) {
      margin-top: 6px;
    }

    #mt-studio .help {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 20px
    }

    #mt-studio .help button {
      font-size: 12px
    }

    #mt-studio .workspace {
      padding: 26px 22px;
      background: var(--panel);
      border-left: 1px solid var(--line)
    }

    #mt-studio .work-head h3 {
      margin: 0
    }

    #mt-studio .tabs {
      display: flex;
      gap: 6px;
      margin: 22px 0 16px
    }

    #mt-studio .tabs button {
      font-size: 12px
    }

    #mt-studio button[aria-pressed=true] {
      background: var(--wash);
      border-color: var(--accent)
    }

    #mt-studio textarea {
      width: 100%;
      min-height: 210px;
      resize: vertical;
      background: var(--paper);
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 15px;
      display: block;
      margin-top: 8px;
      font-size: 16px
    }

    #mt-studio .symbols {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
      margin: 10px 0
    }

    #mt-studio .symbols button {
      padding: 4px 12px
    }

    #mt-studio button.voice-action {
      display: grid;
      place-items: center;
      min-width: 44px;
      min-height: 44px;
      padding: 0;
      color: var(--accent);
    }

    #mt-studio button.voice-action[aria-pressed="true"] {
      background: var(--wash);
      border-color: var(--accent);
    }

    #mt-studio .message-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    #mt-studio button.tutor-speaker {
      min-width: 36px;
      min-height: 36px;
      background: transparent;
    }

    #mt-studio button.tutor-speaker:hover {
      border-color: var(--accent);
    }

    #mt-studio #mt-math-voice-status:not(:empty) {
      margin-bottom: 6px;
    }

    #mt-studio :is(#mt-keypad-toggle, #mt-prep-keypad-toggle) {
      min-height: 44px;
      color: var(--accent);
    }

    #mt-studio :is(#mt-keypad-toggle, #mt-prep-keypad-toggle)[aria-expanded="true"] {
      background: var(--wash);
      border-color: var(--accent);
    }

    #mt-studio :is(#mt-keypad-toggle, #mt-prep-keypad-toggle)[aria-expanded="true"] span {
      display: inline-block;
      transform: rotate(180deg);
    }

    #mt-studio :is(#mt-keypad, #mt-prep-keypad) {
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: var(--wash);
    }

    #mt-studio .keypad-keys,
    #mt-studio .keypad-actions {
      display: grid;
      gap: 6px;
    }

    #mt-studio .keypad-keys {
      grid-template-columns: repeat(auto-fit, minmax(max(44px, 18%), 1fr));
    }

    #mt-studio .keypad-actions {
      grid-template-columns: 1fr 1fr;
      margin-top: 6px;
    }

    #mt-studio :is(#mt-keypad, #mt-prep-keypad) button {
      min-width: 0;
      min-height: 44px;
      padding: 4px;
      touch-action: manipulation;
    }

    #mt-studio :is(#mt-keypad-done, #mt-prep-keypad-done) {
      color: var(--accent);
      font-weight: 600;
    }

    #mt-studio #mt-work-note {
      flex-basis: 100%;
    }

    #mt-studio #mt-clear-answer {
      font-size: 12px;
      color: var(--quiet);
    }

    #mt-studio #mt-check {
      margin-inline-start: auto;
    }

    #mt-studio .submit-row {
      margin-top: 25px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap
    }

    #mt-studio canvas {
      display: block;
      width: 100%;
      height: 220px;
      border: 1px solid var(--line);
      border-radius: 10px;
      touch-action: none;
      background: var(--paper)
    }

    #mt-studio .board-tools {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
      margin: 10px 0;
      font-size: 12px
    }

    @media(max-width:800px) {
      #mt-studio .session-grid {
        grid-template-columns: 1fr 1fr
      }

      #mt-studio aside {
        grid-column: 1 / -1;
        border-right: 0;
        border-bottom: 1px solid var(--line);
      }

      #mt-studio header {
        padding: 18px
      }

      #mt-studio .prototype {
        display: none
      }
    }

    @media(max-width:560px) {
      #mt-studio h1 {
        font-size: 32px
      }

      #mt-studio .paths,
      #mt-studio .session-grid,
      #mt-studio .fields {
        grid-template-columns: 1fr
      }

      #mt-studio .workspace {
        border-left: 0;
        border-top: 1px solid var(--line)
      }

      #mt-studio form {
        margin: 0 14px
      }

      #mt-studio .brand small {
        display: none
      }

      #mt-studio .intro {
        padding-top: 32px
      }
    }


/* --- Mathside simplified landing page --- */
#mt-studio .landing-cta {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px 34px;
  text-align: center;
}

#mt-studio .landing-card {
  max-width: 650px;
  margin: 0 auto;
  padding: 28px 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(35, 59, 53, 0.06);
}

#mt-studio .landing-symbol {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--wash);
  color: var(--accent);
  font: 30px Georgia, serif;
}

#mt-studio .landing-card h2 {
  margin: 4px 0 10px;
  font: 28px/1.2 Georgia, serif;
}

#mt-studio .landing-card p {
  max-width: 520px;
  margin: 0 auto 20px;
  color: var(--quiet);
}

#mt-studio .landing-start {
  min-width: 190px;
  padding: 12px 22px;
  font-weight: 650;
  transition: transform .18s ease, box-shadow .18s ease;
}

#mt-studio .landing-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(35, 59, 53, 0.12);
}

#mt-studio .landing-card small {
  display: block;
  margin-top: 13px;
  color: var(--quiet);
}

#mt-studio .landing-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

#mt-studio .landing-benefits div {
  padding: 16px 12px;
}

#mt-studio .landing-benefits strong,
#mt-studio .landing-benefits span {
  display: block;
}

#mt-studio .landing-benefits strong {
  margin-bottom: 4px;
  font-size: 13px;
}

#mt-studio .landing-benefits span {
  color: var(--quiet);
  font-size: 12px;
}

@media(max-width:560px) {
  #mt-studio .landing-benefits {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  #mt-studio .landing-card {
    padding: 24px 18px;
  }
}

#mt-studio #mt-feedback strong {
  display: block;
  margin-bottom: 4px;
}

#mt-studio .session-guide {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}

#mt-studio .session-guide summary {
  cursor: pointer;
  font-weight: 600;
}

#mt-studio .session-guide ol {
  margin: 10px 0 0;
  padding-inline-start: 22px;
  color: var(--quiet);
  font-size: 13px;
}

#mt-studio #mt-feedback .session-findings {
  margin: 8px 0 12px;
  padding-inline-start: 20px;
}

#mt-studio #mt-feedback .session-findings span {
  display: block;
  color: var(--quiet);
}

#mt-studio #mt-feedback .limit-expression {
  overflow-wrap: anywhere;
}

#mt-studio #mt-intent {
  padding: 32px 16px;
}

#mt-studio .intent-card {
  max-width: 670px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

#mt-studio .intent-options {
  display: grid;
  gap: 12px;
}

#mt-studio .intent-options button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  text-align: start;
}

#mt-studio .intent-options button:hover,
#mt-studio .intent-options button:focus-visible {
  border-color: var(--accent);
}

#mt-studio .intent-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--wash);
  color: var(--accent);
}

#mt-studio .intent-icon svg {
  width: 23px;
  height: 23px;
}

#mt-studio .intent-copy span {
  display: block;
  margin-top: 4px;
  color: var(--quiet);
}

#mt-studio .intent-arrow {
  color: var(--accent);
}

#mt-studio #mt-custom-topic.is-prominent label {
  color: var(--accent);
  font-weight: 600;
}

#mt-studio #mt-custom-topic.is-prominent input {
  border-color: var(--accent);
}

#mt-studio #mt-session-context {
  min-width: 0;
  overflow-wrap: anywhere;
}


#mt-studio #mt-math-field,
#mt-studio #mt-prep-question {
  display: block;
  width: 100%;
  min-height: 110px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 22px;
  --caret-color: var(--accent);
  --placeholder-color: var(--quiet);
}

#mt-studio #mt-prep-question {
  --question-writing-height: 240px;
  min-height: calc(var(--question-writing-height) + 34px);
  padding: 16px;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  cursor: text;
}

#mt-studio #mt-math-field {
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  cursor: text;
}

/* Prose wraps normally; each formula keeps MathLive's own math layout. */
#mt-studio :is(#mt-prep-question, #mt-math-field) .question-math {
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: normal;
}

#mt-studio :is(#mt-prep-question, #mt-math-field) math-field {
  display: inline-block;
  min-width: 1em;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 22px;
  --caret-color: var(--accent);
}

#mt-studio #mt-math-field math-field::part(virtual-keyboard-toggle),
#mt-studio #mt-math-field math-field::part(menu-toggle),
#mt-studio #mt-prep-question math-field::part(virtual-keyboard-toggle),
#mt-studio #mt-prep-question math-field::part(menu-toggle) {
  display: none;
}

#mt-studio #mt-math-help {
  margin: 6px 0 0;
}

#mt-studio .keypad-templates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(87px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

#mt-studio .keypad-templates button {
  color: var(--accent);
  font-size: 12px;
}

#mt-studio #mt-test-prep {
  margin-inline: auto;
}

#mt-studio #mt-test-prep textarea {
  min-height: 96px;
  margin-bottom: 18px;
}

#mt-studio .prep-materials {
  margin-bottom: 18px;
}

#mt-studio .prep-materials input {
  margin-bottom: 8px;
}

#mt-studio .prep-materials p {
  overflow-wrap: anywhere;
}

#mt-studio #mt-files {
  margin: 0;
  padding: 0;
  list-style: none;
}

#mt-studio #mt-files li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

#mt-studio #mt-files span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#mt-studio #mt-files li {
  flex-wrap: wrap;
}

#mt-studio .prep-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#mt-studio #mt-question-review {
  margin-bottom: 18px;
}

#mt-studio #mt-feedback .tutor-message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#mt-studio #mt-workspace-uploads {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

#mt-studio #mt-workspace-uploads textarea {
  min-height: 110px;
  margin-bottom: 12px;
}

#mt-studio .tabs {
  flex-wrap: wrap;
}

#mt-studio .message-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#mt-studio .question-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 10px 0;
}
#mt-studio .tutor-message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#mt-studio math-span {
  max-width: 100%;
  vertical-align: middle;
  overflow-x: auto;
}

#mt-studio #mt-question-list {
  padding-left: 24px;
  max-height: 260px;
  overflow-y: auto;
}
#mt-studio #mt-question-list button {
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
}
#mt-studio #mt-question-list button[aria-pressed="true"] {
  border-color: var(--accent);
}
#mt-studio .question-short-preview {
  display: block;
  max-height: 3.4em;
  overflow: hidden;
  font-weight: normal;
}

#mt-studio .account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
#mt-studio header { flex-wrap: wrap; }
#mt-studio .auth-form {
  display: grid;
  gap: 8px;
  text-align: left;
  width: 100%;
  max-width: 460px;
}
#mt-studio .auth-form input,
#mt-studio .auth-form select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 9px;
  min-width: 0;
}
#mt-studio .auth-panel {
  max-width: 850px;
  margin: 24px auto;
  padding: 24px;
}
#mt-studio #mt-admin-users {
  width: 100%; max-width: 1100px;
  margin: 24px auto; padding: 24px clamp(16px, 3vw, 32px);
}
#mt-studio #mt-admin-users .setup-head { flex-wrap: wrap; gap: 12px; }
#mt-studio #mt-admin-status:empty { display: none; }
#mt-studio .users-toolbar { display: flex; gap: 10px; margin-bottom: 18px; }
#mt-studio .users-toolbar button,
#mt-studio #mt-admin-close { min-height: 42px; padding: 10px 16px; font-size: 15px; }
#mt-studio .users-table-scroll {
  max-width: 100%; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
#mt-studio .users-table {
  width: 100%; min-width: 960px; table-layout: fixed; border-collapse: separate; border-spacing: 0;
}
#mt-studio .users-table th,
#mt-studio .users-table td {
  padding: 10px 18px; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--line); font-size: 15.5px; line-height: 1.5;
}
#mt-studio .users-table th {
  background: var(--wash); color: var(--ink); font-weight: 600; white-space: nowrap;
}
#mt-studio .users-table th:nth-child(1) { width: 22%; }
#mt-studio .users-table th:nth-child(2) { width: 22%; }
#mt-studio .users-table th:nth-child(3) { width: 24%; }
#mt-studio .users-table th:nth-child(4) { width: 18%; }
#mt-studio .users-table th:nth-child(5) { width: 14%; }
#mt-studio .users-table .account-row { height: 60px; }
#mt-studio .users-table .account-row:hover { background: var(--wash); }
#mt-studio .users-table td { overflow-wrap: anywhere; }
#mt-studio .users-table .account-row td:nth-child(3),
#mt-studio .users-table .account-row td:nth-child(4) { white-space: nowrap; }
#mt-studio .users-table input:not([type="checkbox"]),
#mt-studio .users-table select {
  width: 100%; min-width: 0; box-sizing: border-box; margin: 0;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px; background: var(--panel); font: inherit;
}
#mt-studio .users-table button { min-height: 40px; padding: 8px 14px; font-size: 15px; }
#mt-studio .users-table .account-row button { font-weight: 600; border-color: var(--accent); }
#mt-studio .users-table label { font-size: 14px; }
#mt-studio .user-form-row { background: var(--panel); }
#mt-studio .inline-user-form { display: grid; grid-template-columns: 2fr 1.2fr .8fr; gap: 16px; }
#mt-studio .inline-user-form label { display: grid; gap: 5px; }
#mt-studio .inline-user-form .inline-user-status { display: flex; align-items: center; }
#mt-studio .inline-user-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#mt-studio .inline-user-form .inline-user-actions { grid-column: 1 / -1; }
#mt-studio .inline-remove-form { display: grid; gap: 7px; max-width: 520px; }
#mt-studio .inline-remove-form p { margin: 0; }
#mt-studio #mt-credential-text { white-space: pre-wrap; overflow-wrap: anywhere; }
#mt-studio #mt-generate-user-password { margin-top: 5px; }
#mt-studio .password-mask { white-space: nowrap; letter-spacing: 1px; }
#mt-studio .users-table .account-row td:nth-child(4) { font-weight: 500; }

#mt-studio .learning-history-list { list-style: none; padding: 0; }
#mt-studio .learning-history-list li {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  overflow-wrap: anywhere;
}
#mt-studio .learning-history-list time { display: block; font-size: .85em; }
#mt-studio .learning-history-list p { margin: 6px 0; }


#mt-studio .users-table form {
  max-width: none; padding: 0; margin: 0;
  border: 0; border-radius: 0; background: transparent;
}
#mt-studio .users-table input[type="checkbox"] {
  width: auto; margin: 0; flex: 0 0 auto;
}
#mt-studio .inline-user-form .inline-user-status { white-space: nowrap; gap: 8px; }

#mt-studio .users-table .user-status-active::before,
#mt-studio .users-table .user-status-inactive::before {
  content: ""; display: inline-block;
  width: 9px; height: 9px; border-radius: 50%;
  margin-right: 8px; vertical-align: middle;
}
#mt-studio .users-table .user-status-active::before { background: var(--accent); }
#mt-studio .users-table .user-status-inactive::before { background: var(--quiet); }

#mt-studio .password-reveal-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#mt-studio .users-table .password-reveal-row input { width: 220px; max-width: 100%; }
#mt-studio #mt-credential-toggle { display: inline-flex; align-items: center; justify-content: center; }
#mt-studio #mt-credentials-done { margin-top: 8px; }

#mt-studio .password-input-with-toggle {
  display: flex; align-items: center; gap: 8px; min-width: 0; margin: 6px 0 18px;
}
#mt-studio .password-input-with-toggle input { flex: 1; min-width: 0; margin: 0; }
#mt-studio .password-field-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 40px; width: 40px; min-height: 40px; padding: 8px;
}
#mt-studio .users-table .password-input-with-toggle { margin: 0; }
#mt-studio .users-table .password-input-with-toggle input { width: 0; }

#mt-studio .users-table .password-field-toggle { padding: 8px; }

#mt-studio .table-password-contents { display: inline-flex; align-items: center; gap: 8px; }
#mt-studio .users-table .account-row .table-password-eye {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; min-height: 32px; padding: 5px;
  border-color: transparent; background: transparent; letter-spacing: normal;
}
#mt-studio .users-table .account-row .table-password-eye:hover {
  border-color: var(--line); background: var(--wash);
}

#mt-studio .table-password-contents { max-width: 100%; }
#mt-studio .table-password-contents .password-mask { min-width: 0; overflow-x: auto; }
#mt-studio .table-password-contents .table-password-eye { flex: 0 0 32px; }

/* The existing branding is one keyboard-accessible Home control. */
#mt-studio button.brand {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
}

#mt-studio button.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

#mt-studio .brand > svg {
  flex-shrink: 0;
  color: var(--accent);
}

#mt-studio #mt-prep-input-tools {
  min-width: 0;
}

#mt-studio .question-clipboard {
  margin-bottom: 0;
}

/* Landing-only refinement. Other screens retain their existing styles. */
#mt-studio #mt-welcome .intro {
  padding: clamp(32px, 4vw, 52px) 20px 28px;
}

#mt-studio #mt-welcome .eyebrow {
  font-weight: 600;
}

#mt-studio #mt-welcome h1 {
  font-size: clamp(32px, 3.75vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 12px 0 14px;
  text-wrap: balance;
}

#mt-studio #mt-welcome .intro p {
  max-width: 44ch;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.65;
}

#mt-studio #mt-welcome .landing-cta {
  max-width: 780px;
  padding: 0 24px;
}

#mt-studio #mt-welcome .landing-card {
  max-width: 620px;
  padding: 28px 32px;
  border-radius: 16px;
  box-shadow: none;
}

#mt-studio #mt-welcome .landing-symbol {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 28px;
  margin-bottom: 12px;
}

#mt-studio #mt-welcome .landing-card h2 {
  font-size: 24px;
  line-height: 1.3;
  margin: 0 0 10px;
}

#mt-studio #mt-welcome .landing-card > p {
  max-width: 520px;
  line-height: 1.6;
}

/* A single card frame; existing sign-in/setup forms keep their behavior. */
#mt-studio #mt-welcome .auth-form {
  max-width: 380px;
  padding: 0;
  margin: 24px auto 0;
  border: 0;
  background: transparent;
}

#mt-studio #mt-welcome .auth-form input {
  min-height: 44px;
  margin: 0 0 8px;
}

#mt-studio #mt-welcome .password-input-with-toggle {
  margin: 0 0 8px;
}

#mt-studio #mt-welcome .password-input-with-toggle input {
  margin: 0;
}

#mt-studio #mt-welcome button.main {
  min-height: 44px;
  padding: 10px 20px;
  font-weight: 600;
}

#mt-studio #mt-welcome .landing-start {
  min-width: 176px;
  transition: none;
}

#mt-studio #mt-welcome button.main:hover {
  background: var(--accent);
  transform: none;
  box-shadow: none;
}

#mt-studio #mt-welcome button.main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

#mt-studio #mt-welcome .landing-card small {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.5;
}

#mt-studio #mt-welcome .landing-benefits {
  gap: 20px;
  margin-top: 24px;
}

#mt-studio #mt-welcome .landing-benefits div {
  padding: 0 8px;
}

#mt-studio #mt-welcome .landing-benefits strong {
  font-weight: 600;
}

#mt-studio #mt-welcome .landing-benefits span {
  font-size: 13px;
  line-height: 1.5;
}

#mt-studio #mt-welcome .footnote {
  margin: 0;
  padding: 28px 20px 0;
  line-height: 1.6;
}

#mt-studio #mt-welcome .landing-copyright {
  margin: 6px 0 0;
  padding: 0 20px 28px;
  color: var(--quiet);
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  #mt-studio #mt-welcome .landing-cta {
    padding-inline: 16px;
  }

  #mt-studio #mt-welcome .landing-card {
    padding: 24px 20px;
  }

  #mt-studio #mt-welcome .landing-card h2 {
    font-size: 22px;
  }

  #mt-studio #mt-welcome .auth-form {
    margin-inline: auto;
  }

  #mt-studio #mt-welcome .landing-benefits {
    gap: 16px;
  }
}

/* Quiet mathematical identity on the landing page only. */
#mt-studio #mt-welcome .landing-math-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 36px;
  margin-top: 22px;
}

#mt-studio #mt-welcome .landing-math-examples > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#mt-studio #mt-welcome .landing-math-examples span:first-child {
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.4;
}

#mt-studio #mt-welcome .landing-math-examples span:last-child {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.4;
  white-space: nowrap;
}

/* Learning Intent choices only; destination forms retain their styles. */
#mt-studio #mt-intent-choices {
  max-width: 700px;
  margin: 12px auto 16px;
  padding: 28px;
  border-radius: 16px;
}

#mt-studio #mt-intent-choices .setup-head {
  gap: 20px;
  margin-bottom: 24px;
  align-items: center;
}

#mt-studio #mt-intent-choices h2 {
  margin: 0;
  font-size: clamp(25px, 2.4vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 600;
}

#mt-studio #mt-intent-choices h2:focus {
  outline: 1px solid var(--line);
  outline-offset: 6px;
}

#mt-studio #mt-intent-choices .intent-options {
  gap: 12px;
}

#mt-studio #mt-intent-choices .intent-options button {
  padding: 18px 16px;
  border-radius: 12px;
  gap: 14px;
  line-height: 1.5;
  box-shadow: none;
}

#mt-studio #mt-intent-choices .intent-copy strong {
  font-size: 16px;
  font-weight: 600;
}

#mt-studio #mt-intent-choices .intent-copy span {
  font-size: 14px;
  line-height: 1.55;
  margin-top: 4px;
}

#mt-studio #mt-intent-choices button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

#mt-studio #mt-intent-back {
  min-height: 44px;
  white-space: nowrap;
}

@media (max-width: 560px) {
  #mt-studio #mt-intent-choices {
    margin-top: 0;
    padding: 22px 18px;
  }

  #mt-studio #mt-intent-choices .setup-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
  }

  #mt-studio #mt-intent-choices .intent-options button {
    padding: 16px 12px;
    gap: 10px;
  }

  #mt-studio #mt-intent-choices .intent-icon {
    width: 32px;
    height: 36px;
  }
}

/* Preparation setup only; shared editors and destination screens are frozen. */
#mt-studio #mt-test-prep {
  max-width: 720px;
  padding: 28px;
  border-radius: 16px;
}

#mt-studio #mt-test-prep .setup-head {
  margin-bottom: 24px;
  gap: 16px;
}

#mt-studio #mt-test-prep .setup-head h2 {
  font-size: clamp(25px, 2.4vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

#mt-studio #mt-test-prep .fields {
  gap: 20px;
  margin-bottom: 22px;
}

#mt-studio #mt-test-prep label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

#mt-studio #mt-test-prep .fields select {
  min-height: 44px;
  margin-bottom: 0;
  font-size: 14px;
}

#mt-studio #mt-test-prep .prep-materials {
  margin-bottom: 22px;
}

#mt-studio #mt-test-prep .prep-materials h3,
#mt-studio #mt-test-prep #mt-review-heading {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

#mt-studio #mt-test-prep #mt-file-help {
  margin: 8px 0 12px;
  line-height: 1.55;
}

#mt-studio #mt-test-prep input[type="file"] {
  min-height: 44px;
  padding: 8px;
}

#mt-studio #mt-test-prep input[type="file"]::file-selector-button {
  padding: 5px 10px;
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

#mt-studio #mt-test-prep #mt-files li {
  padding-block: 10px;
}

#mt-studio #mt-test-prep #mt-files span {
  font-size: 13px;
  line-height: 1.5;
}

#mt-studio #mt-test-prep .prep-file-actions button {
  min-height: 44px;
  font-size: 13px;
}

#mt-studio #mt-test-prep #mt-prep-start {
  min-height: 44px;
  margin-top: 12px;
  padding-inline: 20px;
  font-weight: 600;
}

#mt-studio #mt-test-back {
  min-height: 44px;
  white-space: nowrap;
}

#mt-studio #mt-test-prep .fields select:focus-visible,
#mt-studio #mt-test-prep #mt-file:focus-visible,
#mt-studio #mt-test-prep .prep-file-actions button:focus-visible,
#mt-studio #mt-test-back:focus-visible,
#mt-studio #mt-prep-start:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 560px) {
  #mt-studio #mt-test-prep {
    padding: 22px 18px;
  }

  #mt-studio #mt-test-prep .fields {
    gap: 16px;
  }
}

#mt-studio #mt-welcome .landing-ai-disclosure {
  display: block;
  margin-top: 6px;
}

/* Tutor session presentation only; all input and tutoring behavior is frozen. */
#mt-studio #mt-session .lesson,
#mt-studio #mt-session .workspace {
  min-width: 0;
  padding: 24px;
}

#mt-studio #mt-session .tutor-heading {
  margin-bottom: 18px;
  align-items: flex-start;
}

#mt-studio #mt-session .tutor-heading strong,
#mt-studio #mt-session .work-head h3 {
  font: 22px/1.3 Georgia, "Times New Roman", serif;
}

#mt-studio #mt-session .tutor-heading small {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.5;
}

#mt-studio #mt-session .work-head p {
  margin: 6px 0 0;
  line-height: 1.5;
}

#mt-studio #mt-session #mt-feedback {
  padding: 12px;
  gap: 12px;
  line-height: 1.65;
  border-radius: 12px;
}

#mt-studio #mt-session .tutor-message {
  padding: 10px 2px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

#mt-studio #mt-session .tutor-message.student {
  padding-inline: 10px;
  background: var(--paper);
  border-radius: 8px;
}

#mt-studio #mt-session .message-sender {
  font-weight: 500;
}

#mt-studio #mt-session #mt-help {
  margin-top: 16px;
}

#mt-studio #mt-session #mt-help button,
#mt-studio #mt-session .tabs button {
  min-height: 44px;
  font-size: 13px;
}

#mt-studio #mt-session .tabs {
  margin: 18px 0 16px;
}

#mt-studio #mt-session #mt-conversation-form > label,
#mt-studio #mt-session #mt-type-panel > label {
  font-size: 13px;
  font-weight: 500;
}

#mt-studio #mt-session #mt-message {
  line-height: 1.55;
}

#mt-studio #mt-session #mt-clear-answer,
#mt-studio #mt-session #mt-check {
  min-height: 44px;
}

#mt-studio #mt-session #mt-check {
  font-weight: 600;
}

#mt-studio #mt-session #mt-question-focus h3 {
  font-size: 17px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 800px) {
  #mt-studio #mt-session .lesson,
  #mt-studio #mt-session .workspace {
    padding: 20px 18px;
  }
}

/* Phase 1 account metadata/search; frozen learning screens are unchanged. */
#mt-studio :is(#mt-admin-users, #mt-learning-history) .account-search {
  margin: 16px 0;
}
#mt-studio :is(#mt-admin-users, #mt-learning-history) .account-search > div {
  display: flex;
  gap: 8px;
  align-items: center;
}
#mt-studio :is(#mt-admin-users, #mt-learning-history) .account-search input {
  flex: 1;
  min-width: 0;
  margin: 6px 0;
}
#mt-studio :is(#mt-admin-users, #mt-learning-history) .account-search button,
#mt-studio #mt-learning-history .history-period button {
  min-height: 44px;
}
#mt-studio #mt-admin-users .user-profile-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
#mt-studio #mt-admin-users .user-profile-summary {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--quiet);
  overflow-wrap: anywhere;
}
#mt-studio #mt-learning-history .history-period {
  display: flex;
  gap: 8px;
}
@media (max-width: 560px) {
  #mt-studio #mt-admin-users .user-profile-fields {
    grid-template-columns: 1fr;
  }
}

/* Account/course foundation only; student learning screens retain their styles. */
#mt-studio #mt-course-profile {
  max-width: 1000px;
}
#mt-studio #mt-course-profile .foundation-form {
  max-width: none;
  margin: 16px 0;
  padding: 18px;
}
#mt-studio #mt-course-profile .foundation-form button {
  min-height: 44px;
  margin: 4px 8px 4px 0;
}
#mt-studio #mt-course-profile .course-list {
  padding: 0;
  list-style: none;
}
#mt-studio #mt-course-profile .course-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
#mt-studio #mt-course-profile .course-list button {
  min-height: 44px;
  max-width: 100%;
  text-align: start;
  white-space: normal;
  overflow-wrap: anywhere;
  margin: 4px 8px 4px 0;
}
#mt-studio #mt-course-profile .setup-head {
  flex-wrap: wrap;
}
#mt-studio #mt-course-profile form input,
#mt-studio #mt-course-profile form select {
  min-height: 44px;
}

/* Course roster: scoped to the faculty course view. */
#mt-course-profile .course-meta,
#mt-course-profile .course-roster-heading,
#mt-course-profile .course-roster-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
#mt-course-profile .course-meta { margin-bottom: 32px; }
#mt-course-profile .course-meta p { margin: 0; }
#mt-course-profile .course-meta button { margin-left: auto; }
#mt-course-profile .course-roster-heading { justify-content: space-between; }
#mt-course-profile .course-roster-heading h3 { margin: 0; }
#mt-course-profile .course-roster-tools { margin: 16px 0; }
#mt-course-profile .course-student-search {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  margin: 8px 0 16px;
}
#mt-course-profile .course-roster-scroll { overflow-x: auto; }
#mt-course-profile .course-roster-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
  font-size: 15px;
}
#mt-course-profile .course-roster-table :is(th, td) {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
#mt-course-profile .course-roster-table th { font-weight: 600; }
#mt-course-profile .course-roster-table :is(th, td):first-child { width: 24px; }
#mt-course-profile .course-roster-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green, #28765b);
}
#mt-course-profile .course-student-name { font-weight: 500; }
#mt-course-profile .course-instructor-details { margin-top: 28px; }
#mt-course-profile .course-instructor-details summary { cursor: pointer; }

/* Small shared Tutor action; no route-specific layout. */
#mt-studio #mt-session .tutor-heading { flex-wrap: wrap; }
#mt-studio #mt-new-problem {
  margin-left: auto;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

#mt-studio #mt-intent-choices .intent-options button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  border-color: var(--line);
}
#mt-studio #mt-intent-choices .intent-unavailable {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--quiet);
}

/* Instructor course materials only; student/personal material lists are unchanged. */
#mt-studio #mt-course-profile .course-material-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
#mt-studio #mt-course-profile .course-material-table :is(th, td) {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
#mt-studio #mt-course-profile .course-material-table:not(.material-selection-table) th:first-child { width: 38%; }
#mt-studio #mt-course-profile .course-material-table:not(.material-selection-table) th:nth-child(2) { width: 18%; }
#mt-studio #mt-course-profile .course-material-table:not(.material-selection-table) th:nth-child(3) { width: 44%; }
#mt-studio #mt-course-profile .course-material-table th { font-weight: 600; }
#mt-studio #mt-course-profile .material-table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
#mt-studio #mt-course-profile .material-table-actions > * {
  flex-shrink: 0;
  white-space: nowrap;
}
#mt-studio #mt-course-profile .material-table-actions button {
  min-height: 40px;
  padding: 6px 7px;
  margin: 0;
}
@media (max-width: 600px) {
  #mt-studio #mt-course-profile .course-material-table :is(tbody, tr, td) { display: block; }
  #mt-studio #mt-course-profile .course-material-table thead { display: none; }
  #mt-studio #mt-course-profile .course-material-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
  #mt-studio #mt-course-profile .course-material-table td {
    border: 0;
    padding: 5px 0;
  }
  #mt-studio #mt-course-profile .course-material-table td[data-label="File"] { font-weight: 600; }
  #mt-studio #mt-course-profile .course-material-table td[data-label="Type"]::before { content: "Type: "; }
}

/* Authorized original-file links, shared by instructor/student course lists. */
#mt-studio .material-file-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
#mt-studio .material-file-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Native disclosures affect only faculty course management sections. */
#mt-course-profile .course-disclosure { margin-top: 28px; min-width: 0; }
#mt-course-profile .course-disclosure > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0;
  min-height: 44px;
  box-sizing: border-box;
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
#mt-course-profile .course-disclosure > summary::-webkit-details-marker { display: none; }
#mt-course-profile .course-disclosure > summary::before { content: "▶"; margin-right: 10px; font-size: 12px; }
#mt-course-profile .course-disclosure[open] > summary::before { content: "▼"; }

/* Beta design-preview entry, shown only with the existing sign-in form. */
#mt-studio #mt-login .login-create-account { margin: 12px 0 0; text-align: center; }
#mt-studio #mt-login .login-create-account a { color: var(--accent); text-underline-offset: 3px; }

/* Read-only snapshots remain inside My Activity; no Tutor controls. */
#mt-studio .learning-history-list button + button { margin-left: 8px; }
#mt-studio #mt-history-readonly { min-width: 0; overflow-wrap: anywhere; }
#mt-studio #mt-history-readonly h2 { margin: 20px 0 8px; }
#mt-studio #mt-history-readonly h3 { margin: 24px 0 8px; }
#mt-studio #mt-history-readonly article { margin: 16px 0; }
#mt-studio #mt-history-readonly .activity-review-text { white-space: pre-wrap; overflow-wrap: anywhere; }
#mt-studio #mt-history-readonly img { max-width: 100%; height: auto; }

/* Course Intelligence: plain evidence summaries, scoped to this report only. */
#mt-course-profile .course-intelligence { min-width: 0; }
#mt-course-profile .course-intelligence section { margin: 30px 0; }
#mt-course-profile .course-intelligence h3 { margin: 0 0 16px; font-size: 19px; }
#mt-course-profile .course-intelligence h4 { margin: 20px 0 12px; font-size: 15px; }
#mt-course-profile .intelligence-kicker { font-size: 18px; margin-bottom: 4px; }
#mt-course-profile .intelligence-values { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 18px; margin: 12px 0; }
#mt-course-profile .intelligence-values dt { color: var(--quiet); font-size: 13px; }
#mt-course-profile .intelligence-values dd { margin: 4px 0 0; font-size: 24px; font-weight: 600; }
#mt-course-profile .intelligence-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; text-align: left; }
#mt-course-profile .intelligence-table :is(th,td) { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
#mt-course-profile .intelligence-table th { font-weight: 600; }
#mt-course-profile .intelligence-table th:first-child { width: 25%; }
@media(max-width: 600px) {
  #mt-course-profile .intelligence-table thead { display: none; }
  #mt-course-profile .intelligence-table :is(tbody,tr,td) { display: block; width: 100%; }
  #mt-course-profile .intelligence-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  #mt-course-profile .intelligence-table td { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; padding: 5px 0; border: 0; }
  #mt-course-profile .intelligence-table td::before { content: attr(data-label); color: var(--quiet); font-size: 13px; }
}

/* Three native evidence charts; existing counts/tables remain the primary data. */
#mt-course-profile .evidence-chart { margin: 24px 0; min-width: 0; }
#mt-course-profile .evidence-chart figcaption { font-size: 15px; font-weight: 600; }
#mt-course-profile .evidence-chart > p { margin: 6px 0 14px; }
#mt-course-profile .evidence-donut-body { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
#mt-course-profile .evidence-donut-body svg { width: 170px; max-width: 100%; height: auto; flex: 0 1 170px; }
#mt-course-profile .evidence-chart-legend { list-style: none; padding: 0; margin: 0; }
#mt-course-profile .evidence-chart-legend li { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
#mt-course-profile .evidence-legend-marker { width: 10px; height: 10px; background: var(--chart-category); flex: none; }
#mt-course-profile .evidence-category-0 { --chart-category: #386b58; stroke: var(--chart-category); }
#mt-course-profile .evidence-category-1 { --chart-category: #899c82; stroke: var(--chart-category); }
#mt-course-profile .evidence-category-2 { --chart-category: #a36c59; stroke: var(--chart-category); }
#mt-course-profile .evidence-category-3 { --chart-category: #a58b5f; stroke: var(--chart-category); }
#mt-course-profile .evidence-category-4 { --chart-category: #8b9297; stroke: var(--chart-category); }
#mt-course-profile .evidence-bars { list-style: none; padding: 0; margin: 0; }
#mt-course-profile .evidence-bars li { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr) minmax(28px,auto); align-items: center; gap: 12px; margin: 12px 0; }
#mt-course-profile .evidence-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
#mt-course-profile .evidence-bar-track { display: block; height: 12px; background: var(--wash); border-radius: 2px; }
#mt-course-profile .evidence-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
#mt-course-profile .evidence-bar-value { text-align: right; font-variant-numeric: tabular-nums; }
#mt-course-profile .evidence-bars-scroll { max-height: 300px; overflow-y: auto; padding-right: 8px; }

/* Neutral row tracking for the three Course Intelligence tables only. */
#mt-course-profile .intelligence-table thead {
  background: color-mix(in srgb, var(--ink) 8%, var(--paper));
}
#mt-course-profile .intelligence-table tbody tr:nth-child(odd) {
  background: var(--paper);
}
#mt-course-profile .intelligence-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--ink) 4%, var(--paper));
}
@media (hover: hover) {
  #mt-course-profile .intelligence-table tbody tr:hover {
    background: color-mix(in srgb, var(--ink) 7%, var(--paper));
  }
}

/* Report-only presentation switch; tables and chart styling are unchanged. */
#mt-course-profile .intelligence-view-switch { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
#mt-course-profile .intelligence-view-switch button { min-height: 44px; }
#mt-course-profile .intelligence-view-switch button[aria-pressed="true"] {
  background: var(--wash);
  border-color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Independent native disclosures for the existing detailed report. */
#mt-course-profile .intelligence-disclosure { margin: 30px 0; min-width: 0; }
#mt-course-profile .intelligence-disclosure > summary {
  cursor: pointer; list-style: none; padding: 12px 0; min-height: 44px;
  font-size: 19px; font-weight: 600; overflow-wrap: anywhere;
}
#mt-course-profile .intelligence-disclosure > summary::-webkit-details-marker { display: none; }
#mt-course-profile .intelligence-disclosure > summary::before { content: "▶"; font-size: 12px; margin-right: 10px; }
#mt-course-profile .intelligence-disclosure[open] > summary::before { content: "▼"; }
#mt-course-profile .course-intelligence .intelligence-values > div { padding: 8px; }
#mt-course-profile .course-intelligence .intelligence-values > div:nth-child(even) { background: color-mix(in srgb, var(--ink) 4%, var(--paper)); }
@media (hover: hover) {
  #mt-course-profile .course-intelligence .intelligence-values > div:hover { background: color-mix(in srgb, var(--ink) 7%, var(--paper)); }
}
#mt-course-profile .evidence-bar-fill { background: var(--chart-category, var(--accent)); }
#mt-course-profile .evidence-grouped-bars { list-style: none; margin: 0; padding: 0; }
#mt-course-profile .evidence-grouped-bars > li { margin: 0 0 20px; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
#mt-course-profile .evidence-group-label { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
#mt-course-profile .evidence-grouped-bars .evidence-bar-label { white-space: normal; overflow-wrap: anywhere; }
#mt-course-profile .evidence-groups-scroll { max-height: 440px; overflow-y: auto; padding-right: 8px; }

/* Ephemeral faculty question/answer; existing report views remain unchanged. */
#mt-course-profile .intelligence-suggestions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 20px 0; }
#mt-course-profile .intelligence-suggestions button { text-align: left; min-width: 0; overflow-wrap: anywhere; }
#mt-course-profile .intelligence-ask-form { margin: 20px 0; padding: 0; max-width: none; background: transparent; border: 0; }
#mt-course-profile .intelligence-ask-form label { display: block; }
#mt-course-profile .intelligence-ask-form textarea { display: block; box-sizing: border-box; width: 100%; min-width: 0; margin: 8px 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; resize: vertical; }
#mt-course-profile .intelligence-ask-result { overflow-wrap: anywhere; }
#mt-course-profile .intelligence-ask-answer { white-space: pre-wrap; }
@media(max-width:600px) { #mt-course-profile .intelligence-suggestions { grid-template-columns: 1fr; } }

/* Local Ask Q&A only; no saved-chat or Tutor changes. */
#mt-course-profile .intelligence-ask-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#mt-course-profile .intelligence-ask-actions button { min-height: 44px; }
#mt-course-profile .intelligence-qa-item { margin: 16px 0; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
#mt-course-profile .intelligence-qa-item > summary { cursor: pointer; list-style: none; min-height: 44px; padding: 10px 0; font-weight: 600; overflow-wrap: anywhere; }
#mt-course-profile .intelligence-qa-item > summary::-webkit-details-marker { display: none; }
#mt-course-profile .intelligence-qa-item > summary::before { content: "▶"; font-size: 12px; margin-right: 10px; }
#mt-course-profile .intelligence-qa-item[open] > summary::before { content: "▼"; }

/* Role-aware product Help: overlays never replace active application screens. */
#mt-studio.product-help-enabled { padding-bottom: 76px; }
#mt-studio #mt-help-launcher {
  position: fixed; right: 20px; bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 80; min-height: 44px; padding: 8px 14px;
  background: var(--panel); border: 1px solid var(--line); color: var(--accent);
}
#mt-studio .product-help-quick {
  position: fixed; right: 20px; bottom: 72px; z-index: 81;
  width: min(360px, calc(100vw - 32px)); max-height: calc(100dvh - 100px);
  overflow: auto; padding: 20px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel); overflow-wrap: anywhere;
}
#mt-studio .product-help-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#mt-studio .product-help-head h2 { margin: 0; font-size: 20px; }
#mt-studio .product-help-head button { flex-shrink: 0; min-height: 44px; }
#mt-studio .product-help-topics { display: grid; gap: 8px; margin-bottom: 16px; }
#mt-studio .product-help-topics button { text-align: left; min-height: 44px; }
#mt-studio .product-help-center {
  width: min(880px, calc(100vw - 32px)); max-height: calc(100dvh - 40px);
  padding: 24px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); color: var(--ink); overflow: auto; overflow-wrap: anywhere;
}
#mt-studio .product-help-center::backdrop { background: rgb(0 0 0 / 25%); }
#mt-studio .product-help-center details { border-top: 1px solid var(--line); padding: 8px 0; }
#mt-studio .product-help-center summary { cursor: pointer; min-height: 44px; padding: 10px 0; font-weight: 600; }
#mt-studio .product-help-center p, #mt-studio .product-help-center li { line-height: 1.65; }
@media (max-width: 480px) {
  #mt-studio #mt-help-launcher { right: 16px; }
  #mt-studio .product-help-quick { right: 16px; padding: 16px; }
  #mt-studio .product-help-center { padding: 16px; }
  #mt-studio .product-help-head { flex-wrap: wrap; }
}

/* Disposable Help question panel shared by the popup and Help Center. */
#mt-studio .product-help-ai { margin: 16px 0; min-width: 0; }
#mt-studio .product-help-ai label { display: block; font-weight: 500; }
#mt-studio .product-help-ai textarea {
  display: block; width: 100%; min-height: 72px; margin: 8px 0;
  padding: 10px; font: inherit; resize: vertical;
}
#mt-studio .product-help-ai-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#mt-studio .product-help-ai-actions button { min-height: 44px; }
#mt-studio .product-help-ai .soft { font-size: 12px; }
#mt-studio .product-help-answer { overflow-wrap: anywhere; }
#mt-studio .product-help-answer h3 { font-size: 15px; margin-bottom: 8px; }
#mt-studio .product-help-answer p, #mt-studio .product-help-answer li { line-height: 1.6; }
#mt-studio .product-help-answer ol { padding-left: 22px; }
#mt-studio .product-help-quick { max-height: min(680px, calc(100dvh - 100px)); }
#mt-studio .product-help-quick > .product-help-head,
#mt-studio .product-help-center > .product-help-head {
  position: sticky; top: 0; z-index: 1; background: var(--panel); padding-bottom: 8px;
}
#mt-studio .product-help-ai form {
  max-width: none; margin: 0; padding: 0; border: 0; background: transparent;
}

/* Course-material reuse and staged uploads; existing table layout is retained. */
#mt-studio .material-toolbar { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
#mt-studio .material-action-form { margin-top:16px; min-width:0; }
#mt-studio .material-action-form h3 { margin:0 0 12px; text-align:left; }
#mt-studio .material-drop-zone { padding:22px 16px; margin-bottom:12px; border:1px dashed var(--quiet); border-radius:8px; background:var(--paper); }
#mt-studio .material-drop-zone.drag-active { background:var(--wash); border-color:var(--accent); }
#mt-studio .material-staged-files { padding-left:20px; overflow-wrap:anywhere; }
#mt-studio .material-action-form label { display:grid; gap:6px; margin-bottom:12px; }
#mt-studio .material-action-form > button { margin:8px 8px 0 0; min-height:44px; }
#mt-studio .material-selection-table { width:100%; min-width:0; }
#mt-studio .material-selection-table td { overflow-wrap:anywhere; }
#mt-studio .material-selection-table input[type=checkbox] { min-width:20px; min-height:20px; }
@media(max-width:600px) {
  #mt-studio .material-selection-table thead { display:none; }
  #mt-studio .material-selection-table tr, #mt-studio .material-selection-table td { display:block; width:100%; }
  #mt-studio .material-selection-table td[data-label]::before { content:attr(data-label) ": "; font-weight:600; }
}
#mt-studio #mt-course-profile .material-selection-table th:first-child { width: 52px; }
#mt-studio #mt-course-profile .material-selection-table th:nth-child(2) { width: auto; }

/* Give actions more room on tablets; narrow screens retain the existing stack. */
@media (min-width: 601px) and (max-width: 1000px) {
  #mt-studio #mt-course-profile .course-material-table:not(.material-selection-table) th:first-child { width: 40%; }
  #mt-studio #mt-course-profile .course-material-table:not(.material-selection-table) th:nth-child(2) { width: 15%; }
  #mt-studio #mt-course-profile .course-material-table:not(.material-selection-table) th:nth-child(3) { width: 45%; }
}

/* Course material workflows stay beside their trigger; item actions use native dialogs. */
#mt-studio #mt-course-profile .material-workflow:not(:empty) { margin: 16px 0; }
#mt-studio .material-dialog {
  box-sizing: border-box;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper, #faf9f6);
  color: inherit;
}
#mt-studio .material-dialog::backdrop { background: rgba(20, 30, 25, .3); }
#mt-studio .material-dialog h3 { margin: 0 0 16px; }
#mt-studio .material-dialog p { overflow-wrap: anywhere; }
#mt-studio .material-dialog .material-selection-table { width: 100%; }

#mt-studio .material-dialog .foundation-form { padding: 0; border: 0; margin: 0; background: transparent; }
#mt-studio .material-dialog .material-selection-table th:first-child { white-space: nowrap; width: 64px; }

#mt-studio #mt-course-profile .material-select-check { width: 18px; height: 18px; min-height: 0; margin: 0 8px 0 0; vertical-align: middle; }
#mt-studio #mt-course-profile .material-toolbar[hidden] { display: none; }

.material-control-tooltip {
  position: fixed;
  z-index: 10000;
  box-sizing: border-box;
  max-width: min(280px, calc(100vw - 16px));
  padding: 7px 10px;
  border-radius: 6px;
  background: #283b33;
  color: #fff;
  font: 13px/1.4 system-ui, sans-serif;
  pointer-events: none;
}

#mt-studio #mt-course-profile .course-required-marker { color: #b42318; }

#mt-studio #mt-course-profile .course-entry-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
#mt-studio #mt-course-profile .course-entry-suggestions[hidden] { display: none; }
#mt-studio #mt-course-profile .course-entry-suggestions button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }

#mt-studio #mt-course-profile .course-term-group { min-width: 0; padding: 0; margin: 0; border: 0; }
#mt-studio #mt-course-profile .course-term-group legend { padding: 0; margin-bottom: 8px; font-size: 13px; }
#mt-studio #mt-course-profile .course-term-fields { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; width: 100%; max-width: 374px; }
#mt-studio #mt-course-profile .course-term-fields label { min-width: 0; max-width: 100%; flex: 2 1 180px; margin: 0; }
#mt-studio #mt-course-profile .course-term-fields label:last-child { flex: 1 1 110px; }
#mt-studio #mt-course-profile .course-term-fields input { width: 100%; min-width: 0; box-sizing: border-box; }

/* Only the new-course card contains this Term group. */
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) {
  box-sizing: border-box;
  width: 100%;
  max-width: 800px;
  margin: 16px auto;
}

/* Preferred control widths apply only to the Create New Course card. */
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) > label > :is(input, select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) > label:nth-of-type(1) > input { max-width: 260px; }
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) > label:nth-of-type(2) > input { max-width: 480px; }
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) > label:nth-of-type(3) > input,
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) > label > select { max-width: 220px; }

/* Compact new-course form: related fields share a row when space permits. */
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 18px;
  padding: 18px;
}
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) > label { min-width: 0; max-width: 100%; }
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) > label:nth-of-type(1) { flex: 0 1 260px; }
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) > label:nth-of-type(2) { flex: 1 1 360px; }
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) > label:nth-of-type(3) { flex: 0 1 260px; }
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) > .course-term-group { flex: 1 1 360px; }
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) > :is(p, .course-entry-suggestions, label:last-of-type) { flex-basis: 100%; margin: 0; }
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) :is(input, select) { margin: 5px 0 0; }
#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) button { margin: 0; }

#mt-studio #mt-course-profile .foundation-form:has(> .course-term-group) > p.soft {
  order: 1;
  text-align: center;
}

/* Align the new-course heading with its centered card without moving Back. */
#mt-studio #mt-course-profile:has(> .foundation-form > .course-term-group) > .setup-head h2 {
  margin-inline-start: max(0px, calc((100% - 800px) / 2));
}
