/* Dedicated lesson workspace; Notes and Resources retain their own panel. */
.pbc-tutor-workspace {
  --tw-green: #063d2d;
  --tw-height: 100dvh;
  --tw-top: 0px;
  box-sizing: border-box;
  position: fixed;
  inset: auto 0 auto 0;
  top: var(--tw-top);
  margin: 0;
  width: 100%;
  max-width: none;
  height: var(--tw-height);
  max-height: none;
  padding: 0;
  border: 0;
  background: #f5f8f6;
  color: #19372b;
  font-family: inherit;
  overflow: hidden;
  box-shadow: 0 0 70px #04281c55;
}
.pbc-tutor-workspace[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.pbc-tutor-workspace::backdrop {
  background: #04251eaa;
}
.pbc-tutor-workspace * {
  box-sizing: border-box;
}
.pbc-tutor-workspace [hidden] {
  display: none !important;
}
.pbc-tutor-workspace button,
.pbc-tutor-workspace input,
.pbc-tutor-workspace textarea {
  font: inherit;
}
.pbc-tutor-workspace button {
  min-height: 44px;
  border: 1px solid #bfd5c7;
  border-radius: 10px;
  background: #fff;
  color: #164632;
  cursor: pointer;
  padding: 8px 13px;
  font-size: 14px;
  line-height: 1.3;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.pbc-tutor-workspace button:hover {
  background: #e3efe7;
  border-color: #6b9f83;
}
.pbc-tutor-workspace button:active {
  background: #cfe5d7;
  color: #063d2d;
}
.pbc-tutor-workspace :is(button, input, textarea):focus-visible {
  outline: 3px solid #2ca770;
  outline-offset: 3px;
}
.pbc-tutor-workspace button:disabled {
  opacity: 0.5;
  cursor: default;
}
.tw-header {
  background: radial-gradient(ellipse at 50% 0, #145a42, #052f25 70%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  border-bottom: 1px solid #6fbf9344;
  min-height: 76px;
}
.pbc-tutor-workspace .tw-header button {
  background: #174c39;
  border-color: #78b49466;
  color: #fff;
  white-space: nowrap;
}
.pbc-tutor-workspace .tw-header button:is(:hover, :active) {
  background: #24654b;
  color: #fff;
  border-color: #96dfb6;
}
.tw-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tw-brand > span {
  color: #9ef2c2;
  font-size: 26px;
  text-shadow: 0 0 18px #41cf8888;
}
.tw-brand h2 {
  font-size: 19px;
  margin: 0;
  color: #fff;
}
.tw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  position: relative;
}
.tw-sidebar-open .tw-layout {
  grid-template-columns: 270px minmax(0, 1fr);
}
.tw-sidebar {
  background: #0b3428;
  color: #e3f2e8;
  padding: 22px 16px;
  min-width: 0;
  overflow: auto;
  display: none;
  border-right: 1px solid #3b7354;
}
.tw-sidebar-open .tw-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tw-sidebar-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 15px;
}
.tw-sidebar-heading button {
  display: none;
}
.pbc-tutor-workspace .tw-new {
  background: #1b5940;
  border-color: #66b68b;
  color: #fff;
  width: 100%;
  text-align: left;
}
.pbc-tutor-workspace .tw-new:is(:hover, :active) {
  background: #256f50;
  color: #fff;
}
.tw-search-label {
  font-size: 14px;
  color: #c8e3d4;
}
.tw-sidebar input {
  width: 100%;
  background: #07291f;
  color: #fff;
  border: 1px solid #59886c;
  border-radius: 9px;
  padding: 11px 12px;
  font-size: 16px;
}
.tw-sidebar input::placeholder {
  color: #a9c7b6;
}
.tw-sidebar h3 {
  font-size: 14px;
  margin: 8px 0 0;
  color: #c8e3d4;
}
.tw-chat-list {
  flex: 1;
}
.tw-date {
  font-size: 12px;
  color: #a8c8b5;
  margin: 18px 6px 7px;
}
.pbc-tutor-workspace .tw-chat {
  display: block;
  width: 100%;
  background: transparent;
  color: #e8f5ed;
  border-color: transparent;
  text-align: left;
  font-size: 14px;
  overflow-wrap: anywhere;
  margin: 3px 0;
  padding: 10px;
}
.pbc-tutor-workspace .tw-chat:is(:hover, :active),
.pbc-tutor-workspace .tw-chat[aria-current="true"] {
  background: #205b40;
  color: #fff;
  border-color: #5b916f;
}
.tw-private,
.tw-empty-history {
  font-size: 13px;
  color: #b6d2c0;
  line-height: 1.5;
}
.tw-private {
  margin-top: 20px;
}
.tw-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  position: relative;
  background:
    radial-gradient(ellipse at 60% 0, #e7f3eb88, transparent 65%), #f5f8f6;
}
.tw-context {
  padding: 16px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid #d8e5dc;
  display: grid;
  gap: 5px;
  background: #ffffffc9;
}
.tw-context-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #527461;
  font-weight: 700;
}
.tw-context > strong {
  font-size: 16px;
  line-height: 1.4;
  color: #143e2b;
}
.tw-context > span:not(.tw-context-label) {
  font-size: 13px;
  color: #476451;
  line-height: 1.4;
}
.tw-context small {
  font-size: 12px;
  color: #486855;
  margin-top: 2px;
}
.tw-conversation {
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  min-height: 0;
  padding: 26px clamp(20px, 4vw, 64px) 32px;
  scroll-behavior: auto;
}
.tw-welcome {
  max-width: 740px;
  margin: clamp(10px, 4vh, 44px) auto 20px;
  text-align: center;
}
.tw-welcome-spark {
  display: inline-grid;
  place-items: center;
  background: #063d2d;
  color: #acffd0;
  border: 1px solid #58bc89;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  box-shadow: 0 0 28px #2ea56822;
  font-size: 30px;
}
.tw-eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #49725b;
  margin: 20px 0 8px;
}
.tw-welcome h3 {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.025em;
  color: #123e2a;
  margin: 0 0 12px;
  line-height: 1.2;
}
.tw-welcome > p:last-of-type {
  font-size: 16px;
  line-height: 1.6;
  color: #486352;
  max-width: 520px;
  margin: 0 auto;
}
.tw-starters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px auto 0;
  max-width: 610px;
}
.pbc-tutor-workspace .tw-starters button {
  text-align: left;
  padding: 17px 18px;
  box-shadow: 0 3px 12px #0a3a2510;
  min-width: 0;
}
.tw-starters strong,
.tw-starters span {
  display: block;
}
.tw-starters strong {
  font-size: 15px;
  margin-bottom: 5px;
}
.tw-starters span {
  font-size: 14px;
  color: #4c6957;
}
.tw-message {
  max-width: 840px;
  margin: 0 auto 24px;
  padding: 0;
  overflow-wrap: anywhere;
}
.tw-by {
  font-size: 13px;
  color: #40684f;
  font-weight: 700;
  margin: 0 0 8px;
}
.tw-answer {
  font-size: 16px;
  line-height: 1.7;
  color: #193b2b;
}
.tw-answer p {
  margin: 0 0 12px;
}
.tw-answer h4 {
  font-size: 17px;
  color: #123a28;
  margin: 20px 0 8px;
}
.tw-answer ul,
.tw-answer ol {
  padding-left: 24px;
  margin: 10px 0 16px;
}
.tw-answer li {
  padding-left: 3px;
  margin: 5px 0;
}
.tw-answer a {
  color: #146b45;
  text-decoration: underline;
}
.tw-answer code {
  font-size: 14px;
  background: #e3ece6;
  border-radius: 4px;
  padding: 2px 4px;
}
.tw-answer pre {
  overflow: auto;
  background: #e3ece6;
  padding: 16px;
  border-radius: 10px;
  white-space: pre-wrap;
}
.tw-answer blockquote,
.tw-message > blockquote {
  border-left: 3px solid #67a880;
  margin: 12px 0;
  padding: 8px 14px;
  background: #eaf2ec;
  color: #3b5d48;
  font-size: 14px;
  line-height: 1.6;
}
.tw-answer hr {
  border: 0;
  border-top: 1px solid #c9dccf;
  margin: 18px 0;
}
.tw-table {
  overflow: auto;
}
.tw-table table {
  border-collapse: collapse;
  font-size: 14px;
}
.tw-table :is(th, td) {
  border: 1px solid #c9dccf;
  padding: 9px 12px;
  text-align: left;
}
.tw-user {
  background: #e2eee6;
  border: 1px solid #cbdfd2;
  border-radius: 16px;
  padding: 14px 18px;
  max-width: 740px;
  margin-left: auto;
  margin-right: 0;
}
.tw-user .tw-answer {
  white-space: pre-wrap;
}
.tw-answer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}
.pbc-tutor-workspace .tw-answer-actions button {
  font-size: 13px;
  min-height: 44px;
  background: transparent;
}
.tw-composer {
  padding: 12px clamp(20px, 4vw, 64px) max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid #d3e3d8;
  background: #f8fbf9;
  box-shadow: 0 -5px 20px #143f2808;
}
.tw-composer form {
  max-width: 840px;
  margin: auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #fff;
  border: 1px solid #9dbcaa;
  border-radius: 16px;
  padding: 9px;
  box-shadow: 0 0 0 3px #2baa6c08;
}
.tw-composer textarea {
  background: #fff !important;
  color: #173d29 !important;
  border: 0 !important;
  box-shadow: none !important;
  resize: none;
  min-height: 46px;
  max-height: 140px;
  flex: 1;
  min-width: 0;
  width: 100%;
  font-size: 16px;
  padding: 10px;
  line-height: 1.5;
}
.tw-composer textarea::placeholder {
  color: #587361;
}
.pbc-tutor-workspace .tw-send {
  background: #075139;
  color: #fff;
  border-color: #075139;
  min-height: 46px;
  padding: 10px 20px;
}
.pbc-tutor-workspace .tw-send:is(:hover, :active) {
  background: #0b6948;
  color: #fff;
  border-color: #228c5c;
}
.tw-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 840px;
  margin: 0 auto 8px;
  min-height: 22px;
}
.tw-feedback p {
  font-size: 13px;
  color: #496652;
  margin: 0;
  line-height: 1.45;
  flex: 1;
}
.tw-feedback button {
  font-size: 13px;
}
.tw-replying {
  font-size: 14px;
  color: #186244;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tw-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 2px;
}
.tw-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: tw-pulse 1.2s ease-in-out infinite;
}
.tw-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.tw-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
.tw-composer-hint {
  font-size: 12px;
  color: #52705c;
  margin: 8px auto 0;
  text-align: center;
}
.tw-passage {
  max-width: 840px;
  margin: 0 auto 8px;
  font-size: 13px;
  color: #406349;
  line-height: 1.45;
}
.pbc-tutor-workspace .tw-latest {
  display: block;
  margin: 0 auto 10px;
  border-radius: 22px;
  background: #0c543b;
  color: #fff;
}
.tw-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes tw-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (max-width: 1000px) {
  .tw-sidebar-open .tw-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }
  .tw-header {
    padding: 12px 16px;
  }
  .tw-context {
    padding: 14px 22px;
  }
  .tw-conversation {
    padding: 22px;
  }
  .tw-composer {
    padding-inline: 22px;
  }
}
@media (max-width: 760px) {
  .tw-header {
    padding: 10px 12px;
    gap: 8px;
    min-height: 62px;
  }
  .tw-brand h2 {
    font-size: 15px;
  }
  .tw-brand {
    gap: 6px;
  }
  .tw-brand > span {
    font-size: 19px;
  }
  .pbc-tutor-workspace .tw-header button {
    padding: 7px 9px;
    font-size: 13px;
    min-height: 44px;
  }
  .tw-history-toggle span {
    display: none;
  }
  .tw-layout,
  .tw-sidebar-open .tw-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .tw-sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    width: min(85vw, 310px);
    z-index: 3;
    padding: 18px 14px;
  }
  .tw-sidebar-heading button {
    display: block;
    background: #174c39;
    color: #fff;
    border-color: #689c7d;
  }
  .pbc-tutor-workspace .tw-scrim {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: #082d2477;
    border: 0;
    border-radius: 0;
    width: 100%;
    height: 100%;
  }
  .tw-context {
    padding: 12px 16px;
    gap: 3px;
  }
  .tw-context > strong {
    font-size: 14px;
  }
  .tw-context > span:not(.tw-context-label) {
    font-size: 12px;
  }
  .tw-conversation {
    padding: 20px 16px;
  }
  .tw-welcome {
    margin: 12px auto;
  }
  .tw-welcome h3 {
    font-size: 25px;
  }
  .tw-welcome > p:last-of-type {
    font-size: 15px;
  }
  .tw-welcome-spark {
    width: 46px;
    height: 46px;
    font-size: 25px;
    border-radius: 14px;
  }
  .tw-eyebrow {
    margin-top: 15px;
    font-size: 11px;
  }
  .tw-starters {
    gap: 8px;
    margin-top: 20px;
  }
  .pbc-tutor-workspace .tw-starters button {
    padding: 13px 11px;
  }
  .tw-starters strong {
    font-size: 14px;
  }
  .tw-starters span {
    font-size: 13px;
  }
  .tw-message {
    margin-bottom: 20px;
  }
  .tw-user {
    padding: 12px 14px;
  }
  .tw-composer {
    padding: 9px 12px max(9px, env(safe-area-inset-bottom));
  }
  .tw-composer form {
    padding: 6px;
    gap: 4px;
  }
  .pbc-tutor-workspace .tw-send {
    padding: 10px 13px;
  }
  .tw-composer-hint {
    font-size: 11px;
  }
  .tw-feedback {
    gap: 7px;
    margin-bottom: 6px;
  }
  .tw-feedback p {
    font-size: 12px;
  }
  .tw-feedback button {
    padding: 6px 10px;
  }
  .tw-answer-actions {
    gap: 5px;
  }
  .pbc-tutor-workspace .tw-answer-actions button {
    padding: 8px 10px;
  }
  .lp-cinema.lp-lesson-page .lp-player-bar > .lp-player-tutor {
    min-width: 112px;
  }
}
@media (max-width: 360px) {
  .tw-brand h2 {
    font-size: 13px;
  }
  .tw-header {
    gap: 5px;
    padding-inline: 8px;
  }
  .pbc-tutor-workspace .tw-back {
    font-size: 12px;
  }
  .tw-starters span {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tw-dots i {
    animation: none;
  }
  .pbc-tutor-workspace button {
    transition: none;
  }
}

@media (max-width: 760px) {
  .tw-keyboard .tw-context {
    padding-block: 7px;
  }
  .tw-keyboard .tw-context-label,
  .tw-keyboard .tw-context > span:not(.tw-context-label),
  .tw-keyboard .tw-composer-hint {
    display: none;
  }
  .tw-keyboard .tw-composer textarea {
    max-height: calc(var(--tw-height) * 0.25);
  }
  .tw-keyboard .tw-conversation {
    padding-block: 12px;
  }
}

/* Compact shared lesson context and persistent quick actions. */
.tw-context{padding:10px 20px;gap:3px}
.tw-context-label{display:none}
.tw-context strong{font-size:16px;line-height:1.3;overflow-wrap:anywhere}
.tw-context small,.tw-context>span{font-size:12px;line-height:1.4}
.tw-main>.tw-starters{display:flex;flex-wrap:wrap;gap:6px;padding:8px 20px;margin:0;flex-shrink:0}
.tw-main>.tw-starters button{width:auto;min-height:44px;padding:8px 12px;flex:1 1 auto}
.tw-main>.tw-starters button span{display:none}
.tw-chat{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:760px){.tw-context{padding:8px 12px}.tw-main>.tw-starters{padding:6px 12px;gap:4px}.tw-main>.tw-starters button{padding:6px 8px;font-size:12px}}

.tw-main{grid-template-rows:auto auto minmax(0,1fr) auto}
.tw-main>.tw-starters{max-width:none}
.tw-main>.tw-starters strong{margin:0;font-size:13px}
