@layer views {
  /* ── the tutor beside a lesson: a sheet with the conversation ── */
  dialog.tutor { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 12px; height: min(78dvh, 680px); padding: 16px; }
  dialog.tutor:not([open]) { display: none; }
  .tutor-head { display: flex; align-items: center; justify-content: space-between;
    & .h-sec { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-lg); }
    & .h-sec svg { width: 16px; height: 16px; color: var(--grad-a); } }
  .tutor-log { overflow-y: auto; display: grid; gap: 10px; align-content: start; overscroll-behavior: contain; padding: 2px; }
  .tutor-empty { display: grid; gap: 10px; justify-items: start; color: var(--muted); font-size: var(--fs-body-sm); padding: 6px 2px; }
  .tutor-msg { max-width: 92%; font-size: var(--fs-body-sm); line-height: 1.55; }
  .tutor-msg[data-role="user"] { justify-self: end; padding: 9px 13px; border-radius: 16px 16px 4px 16px; background: var(--fg); color: var(--bg); }
  .tutor-msg[data-role="assistant"] { justify-self: start; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); }
  .tutor-msg .code-block { font-size: 12.5px; }
  .tutor-quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; &::-webkit-scrollbar { display: none; }
    & .chip { flex: none; background: var(--surface); cursor: pointer; } }
  .tutor[data-busy] .tutor-quick { opacity: .5; pointer-events: none; }
  .tutor-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
  .tutor-box { resize: none; min-height: 44px; max-height: 140px; }
  .tutor-send { width: 44px; height: 44px; background: var(--fg); color: var(--bg); & svg { width: 16px; height: 16px; } }
  .tutor[data-busy] .tutor-send { opacity: .4; }
}
