/* The three subject views share their banner, navigation and card styles. */
#workspace:has(#nb-view:not([hidden])) #main {
  background: var(--lab-paper);
}

#nb-view {
  --ink: var(--lab-ink);
  --muted: var(--lab-muted);
  --line: var(--lab-line);
  --surface: var(--lab-surface);
  --focus: var(--lab-blue);
  --nb-action: #2157ec;
  --nb-gap: clamp(14px, 1.45vw, 24px);
  --nb-pad: clamp(16px, 1.6vw, 28px);
  --nb-doc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 2h9l5 5v15H5zM14 2v6h5M8.5 13h7M8.5 17h5'/%3E%3C/svg%3E");
  --nb-book: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6C9 3 5 3 2 4v15c3-1 7-1 10 2 3-3 7-3 10-2V4c-3-1-7-1-10 2zm0 0v15'/%3E%3C/svg%3E");
  --nb-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 6v6l4 3'/%3E%3C/svg%3E");
  --nb-upload: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V3m-5 5 5-5 5 5M3 14v5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5'/%3E%3C/svg%3E");
  --nb-bolt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 2 4 14h7l-1 8 10-13h-7l2-7z'/%3E%3C/svg%3E");
  --nb-cap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 9 10-5 10 5-10 5L2 9zm4 2v6c3 3 9 3 12 0v-6m4-2v8'/%3E%3C/svg%3E");
  max-width: 1740px;
  padding: clamp(12px, 1.35vw, 24px) clamp(14px, 1.7vw, 33px) 36px;
  color: var(--ink);
}

#workspace #nb-view.home .nb-subject-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: clamp(176px, 15vw, 255px);
  margin: 0 0 12px;
  padding: clamp(13px, 1.25vw, 24px) clamp(20px, 2.7vw, 53px);
  background-color: var(--tiplo-paper);
  background-image: linear-gradient(90deg, var(--tiplo-paper) 44%, transparent 85%),
    linear-gradient(var(--tiplo-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--tiplo-grid) 1px, transparent 1px);
  background-size: auto, 20px 20px, 20px 20px;
  border: 1px solid var(--tiplo-grid);
  border-radius: 14px;
  color: var(--tiplo-ink);
}

.nb-subject-head > div {
  min-width: 0;
}

.nb-breadcrumb {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 10px;
  color: var(--lab-muted);
  font: 520 .91rem/1.3 var(--sans);
}

.nb-breadcrumb #nb-subject,
.nb-breadcrumb button {
  color: inherit;
  font: inherit;
}

.nb-breadcrumb button,
#nb-subject-nav button,
#nb-other-books button {
  background: transparent;
  border: 0;
  color: inherit;
}

.nb-breadcrumb button {
  min-height: 28px;
  padding: 0;
}

.nb-breadcrumb button:hover,
#nb-other-books button:hover {
  text-decoration: underline;
}

#nb-view #nb-title {
  margin: 0;
  color: inherit;
  font: 800 clamp(2.9rem, 4.8vw, 5.4rem)/.98 var(--sans);
  letter-spacing: -.06em;
}

#nb-context {
  margin: 6px 0 0;
  color: var(--lab-muted);
  font: 490 clamp(1.1rem, 1.85vw, 1.9rem)/1.2 var(--sans);
  letter-spacing: -.025em;
}

#nb-tiplo {
  width: clamp(114px, 11.9vw, 206px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

#nb-view #nb-edit {
  min-height: 38px;
  margin-top: 13px;
  border-color: var(--line);
  background: transparent;
  color: var(--lab-muted);
  box-shadow: none;
}

#nb-switcher {
  display: none;
}

#nb-subject-nav {
  display: flex;
  align-items: stretch;
  gap: clamp(8px, 1.4vw, 24px);
  margin-bottom: var(--nb-gap, 18px);
  border-bottom: 1px solid var(--lab-line);
  color: var(--lab-ink);
  scrollbar-width: thin;
}

#nb-subject-nav button {
  position: relative;
  min-height: 46px;
  padding-inline: clamp(12px, 1.1vw, 21px);
  font: 570 clamp(.98rem, 1.25vw, 1.18rem)/1.2 var(--sans);
}

#nb-subject-nav button:hover,
#nb-subject-nav button[aria-current="page"] {
  color: var(--lab-blue);
}

#nb-subject-nav button[aria-current="page"] {
  font-weight: 740;
}

#nb-subject-nav button[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: currentColor;
  border-radius: 2px 2px 0 0;
}

#nb-view :is(button, input, textarea, select, summary, a):focus-visible,
#nb-subject-nav button:focus-visible {
  outline: 2px solid var(--lab-blue);
  outline-offset: 2px;
}

#nb-subject-nav button:focus-visible {
  outline-offset: -4px;
}

#nb-view h2 {
  margin: 0;
  color: inherit;
  font: 740 clamp(1.23rem, 1.75vw, 1.75rem)/1.16 var(--sans);
  letter-spacing: -.04em;
}

#nb-view :is(h3, h4) {
  margin: 0;
  font: 700 1.06rem/1.3 var(--sans);
  letter-spacing: -.022em;
}

#nb-view .primary {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--nb-action);
  color: #fff;
  box-shadow: none;
}

#nb-view .primary:hover:not(:disabled) {
  background: #1845cf;
}

#nb-view .secondary {
  min-height: 44px;
  border-color: var(--line);
  border-radius: 9px;
  color: var(--ink);
  box-shadow: none;
  white-space: normal;
}

#nb-view .secondary:hover:not(:disabled) {
  border-color: var(--lab-blue);
}

#nb-view .text-button {
  color: var(--lab-blue);
}

.nb-workspace-grid,
.nb-materials-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: var(--nb-gap);
}

.nb-workspace-side {
  display: grid;
  align-content: start;
  gap: var(--nb-gap);
}

.nb-subject-card,
#nb-view #nb-study-choice {
  min-width: 0;
  margin: 0;
  padding: var(--nb-pad);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

#nb-view #nb-study-choice {
  --chat-avatar-size: clamp(44px, 4.5vw, 66px);
  --chat-avatar-gap: clamp(9px, 1.15vw, 18px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 365px;
  padding: clamp(16px, 2.25vw, 36px);
}

#nb-view #nb-study-heading {
  font-size: clamp(1.65rem, 3vw, 3rem);
}

#nb-chat-log {
  align-content: start;
  gap: 16px;
  padding: 4px 0;
  overflow-x: hidden;
  scrollbar-width: thin;
}

#nb-chat-log .nb-chat-turn {
  display: grid;
  grid-template-columns: var(--chat-avatar-size) minmax(0, auto);
  align-items: center;
  column-gap: var(--chat-avatar-gap);
  width: fit-content;
  max-width: 95%;
}

#nb-chat-log .nb-chat-turn strong {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
}

.nb-chat-avatar {
  display: grid;
  place-items: center;
  grid-area: 1 / 1;
  color: var(--lab-blue);
}

.nb-chat-avatar img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

:root[data-mascot="off"] .nb-chat-turn:not(.nb-chat-user) .nb-chat-avatar::before {
  content: "";
  width: 1.35rem;
  height: 1.35rem;
  background: currentColor;
  mask: var(--nb-book) center / contain no-repeat;
}

.nb-chat-turn p {
  grid-area: 1 / 2;
  margin: 0;
  padding: 12px clamp(13px, 1.25vw, 20px);
  border-radius: 15px;
  background: var(--lab-paper);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: clamp(.97rem, 1.18vw, 1.14rem);
  line-height: 1.4;
}

.nb-chat-turn time {
  display: none;
}

.nb-coach-note {
  margin: -5px 0 0 calc(var(--chat-avatar-size) + var(--chat-avatar-gap));
}

#nb-chat-log:has(.nb-chat-turn + .nb-chat-turn) + .nb-coach-note {
  display: none;
}

#nb-chat-log .nb-chat-user {
  grid-template-columns: minmax(0, auto);
  padding: 0;
  border: 0;
  background: none;
}

.nb-chat-user .nb-chat-avatar {
  display: none;
}

.nb-chat-user p {
  grid-column: 1;
  background: var(--lab-wash);
}

#nb-chat-actions:empty,
#nb-chat-shortcuts:empty,
#nb-chat-attachment:empty,
#nb-task:empty {
  display: none;
}

#nb-chat-actions,
#nb-chat-shortcuts {
  gap: 8px;
  justify-content: flex-end;
}

#nb-chat-log:has(.nb-chat-turn:only-child) ~ #nb-chat-shortcuts {
  flex-direction: column;
  align-items: flex-end;
}

#nb-view :is(#nb-chat-shortcuts, #nb-chat-actions) button {
  max-width: 100%;
  padding: 8px clamp(13px, 1.35vw, 20px);
  border-radius: 999px;
  background: var(--surface);
  font-size: .96rem;
}

#nb-chat-form {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

#nb-chat-form:focus-within {
  border-color: var(--lab-blue);
}

#nb-chat-form #nb-chat-input {
  flex: 1 1 13rem;
  min-width: 0;
  min-height: 44px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#nb-chat-form #nb-chat-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

#nb-chat-form :is(#nb-chat-send, #nb-chat-attach) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-inline: 12px;
}

#nb-chat-form #nb-chat-attach {
  background: var(--lab-paper);
}

#nb-chat-send svg,
#nb-chat-attach svg {
  width: 18px;
  height: 18px;
  flex: none;
}

#nb-chat-attachment {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 8px;
  color: var(--muted);
  font-size: .87rem;
}

#nb-chat-status {
  margin: 0;
}

#nb-chat-earlier {
  align-self: flex-start;
}

.nb-chat-history-save:has(#nb-chat-history-status:empty) {
  display: none;
}

#nb-chat-history-status {
  margin: 0;
}

#nb-resume-card {
  --nb-card-icon: var(--nb-clock);
}

#nb-materials-card {
  --nb-card-icon: var(--nb-book);
}

#nb-workspace-panel .nb-subject-card h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
}

#nb-workspace-panel .nb-subject-card h2::before {
  content: "";
  flex: none;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: var(--lab-wash);
}

#nb-workspace-panel .nb-subject-card h2::after {
  content: "";
  position: absolute;
  left: 9px;
  width: 21px;
  height: 21px;
  background: var(--lab-blue);
  mask: var(--nb-card-icon) center / contain no-repeat;
}

#nb-workspace-panel .nb-subject-card > :last-child {
  margin-bottom: 0;
}

#nb-workspace-panel .nb-subject-card p {
  margin-top: 9px;
}

#nb-materials-card .nb-resource-head p {
  margin: 0;
}

#nb-resume-summary {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

#nb-resume-summary > p {
  margin: 0;
}

#nb-workspace-panel .nb-subject-card .nb-actions {
  margin-top: 8px;
}

#nb-resume-card .nb-actions {
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

#nb-progress-section {
  margin: 23px 0 0;
}

#nb-progress-section h2 {
  margin-bottom: 7px;
}

#nb-progress p {
  margin: 0;
}

#nb-progress p > span {
  color: var(--muted);
}

#nb-view .nb-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 15px;
}

#nb-view .nb-panel-head h2 {
  font-size: clamp(1.75rem, 2.55vw, 2.65rem);
}

.nb-panel-head p,
.nb-resource-head p,
.nb-materials-grid .nb-subject-card > p {
  margin: 5px 0 0;
  color: var(--muted);
}

#nb-view .nb-materials-grid h3 {
  font-size: clamp(1.35rem, 1.9vw, 1.9rem);
}

.nb-syllabus-note {
  padding: 11px 13px;
  border-radius: 8px;
  background: var(--lab-wash);
  font-size: .91rem;
}

.nb-resource-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.nb-materials-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
}

#nb-drop-material {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  width: 100%;
  min-height: 106px;
  margin: 13px 0 10px;
  padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--lab-blue) 55%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, var(--lab-paper) 75%, var(--lab-wash));
  color: var(--ink);
  text-align: center;
}

#nb-drop-material::before {
  content: "";
  width: 25px;
  height: 25px;
  margin-bottom: 5px;
  background: var(--lab-blue);
  mask: var(--nb-upload) center / contain no-repeat;
}

#nb-drop-material:hover,
#nb-drop-material:is(.dragging, [data-dragging="true"]) {
  border-color: var(--lab-blue);
  background: var(--lab-wash);
}

#nb-material-search,
#nb-material-search input {
  width: 100%;
}

#nb-material-search {
  margin-bottom: 9px;
}

.nb-material-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nb-material-row::before {
  content: "";
  grid-area: 1 / 1 / span 2;
  align-self: center;
  width: 23px;
  height: 26px;
  background: var(--lab-blue);
  mask: var(--nb-doc) center / contain no-repeat;
}

.nb-material-row:has([data-type="pdf"])::before {
  background: #c43842;
}

@media (prefers-color-scheme: dark) {
  .nb-material-row:has([data-type="pdf"])::before {
    background: #ffa4a7;
  }
}

.nb-material-name {
  grid-area: 1 / 2;
  align-self: end;
  min-width: 0;
  font-weight: 680;
}

.nb-material-meta {
  grid-area: 2 / 2;
  align-self: start;
  min-width: 0;
  color: var(--muted);
  font-size: .85rem;
}

.nb-material-row .nb-actions {
  grid-area: 1 / 3 / span 2;
  gap: 4px 7px;
  justify-content: flex-end;
}

.nb-material-row .nb-actions :is(.secondary, .text-button) {
  padding-inline: 8px;
}

.nb-material-menu {
  position: relative;
}

.nb-material-menu summary {
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 750;
  list-style: none;
}

.nb-material-menu summary::-webkit-details-marker {
  display: none;
}

.nb-material-menu summary:hover,
.nb-material-menu[open] summary {
  border-color: var(--line);
  background: var(--lab-paper);
}

.nb-material-menu > div {
  position: absolute;
  z-index: 2;
  inset: calc(100% + 3px) 0 auto auto;
  display: grid;
  width: max-content;
  max-width: 210px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 28px #17244e18;
}

#nb-view .nb-material-menu > div > button {
  border-color: transparent;
  background: transparent;
  text-align: start;
}

#nb-view .nb-material-menu > div > button:hover {
  background: var(--lab-wash);
}

#nb-syllabus-topics {
  display: grid;
  gap: 0;
  margin: 13px 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 9px;
}

#nb-syllabus-topics:empty {
  display: none;
}

.nb-topic {
  min-width: 0;
}

.nb-topic + .nb-topic,
#nb-syllabus-topics > li + li {
  border-top: 1px solid var(--line);
}

.nb-topic summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
  min-height: 49px;
  padding: 9px 11px;
  font-weight: 670;
  list-style: none;
}

.nb-topic summary::-webkit-details-marker {
  display: none;
}

.nb-topic summary::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(-45deg);
}

.nb-topic[open] summary::before {
  transform: rotate(45deg);
}

.nb-topic summary .nb-activity-label {
  margin-inline-start: auto;
}

.nb-topic-content {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 2px 12px 13px 28px;
}

.nb-topic-content p {
  flex-basis: 100%;
  margin: 4px 0 7px;
}

.nb-activity-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--lab-paper);
  color: var(--muted);
  font: 620 .8rem/1.3 var(--sans);
}

.nb-activity-label::before {
  content: "";
  flex: none;
  width: .5em;
  height: .5em;
  border-radius: 50%;
  background: currentColor;
}

.nb-activity-label[data-state="due"] {
  background: var(--lab-wash);
  color: var(--lab-blue);
}

.nb-activity-label[data-state="assisted"] {
  background: #fff1c7;
  color: #824000;
}

.nb-activity-label[data-state="independent"] {
  background: #dff7e9;
  color: #16563b;
}

.nb-activity-label[data-state="working"] {
  background: var(--lab-wash);
  color: var(--ink);
}

.nb-sprint {
  --nb-sprint-line: #315082;
  position: relative;
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 156px;
  margin-bottom: 18px;
  padding: var(--nb-pad) var(--nb-pad) var(--nb-pad) clamp(66px, 7.5vw, 114px);
  border-radius: 12px;
  background-color: #1b2b53;
  background-image: linear-gradient(90deg, #1b2b53 57%, transparent),
    linear-gradient(var(--nb-sprint-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--nb-sprint-line) 1px, transparent 1px);
  background-size: auto, 17px 17px, 17px 17px;
  color: #fff;
}

.nb-sprint::before,
.nb-sprint::after {
  content: "";
  position: absolute;
  top: var(--nb-pad);
  left: var(--nb-pad);
  width: clamp(35px, 3.45vw, 52px);
  aspect-ratio: 1;
}

.nb-sprint::before {
  border-radius: 11px;
  background: #2b4678;
}

.nb-sprint::after {
  background: #d5e5ff;
  mask: var(--nb-cap) center / 62% no-repeat;
}

#nb-view .nb-sprint h3 {
  font-size: clamp(1.25rem, 1.85vw, 1.8rem);
}

.nb-sprint p {
  margin: 0;
  color: #d5e5ff;
}

.nb-sprint > button {
  justify-self: start;
}

#nb-view .nb-sprint .primary {
  background: #fff;
  color: #151f42;
}

#nb-view .nb-sprint .primary:hover:not(:disabled) {
  background: #e9f1ff;
}

#nb-view .nb-sprint .text-button,
#nb-view .nb-sprint .secondary {
  color: #e3edff;
}

#nb-view .nb-sprint .secondary {
  border-color: #7d97c7;
  background: transparent;
}

#nb-view .nb-sprint :is(button, a):focus-visible {
  outline-color: #fff;
}

.nb-practice-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--nb-gap);
  margin: 9px 0 19px;
}

.nb-practice-options .nb-subject-card {
  --nb-option-icon: var(--nb-bolt);
  --nb-option-ink: var(--lab-blue);
  --nb-option-bg: var(--lab-wash);
  position: relative;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 15px 13px 15px clamp(62px, 5.1vw, 84px);
}

.nb-practice-options .nb-subject-card:nth-child(2) {
  --nb-option-icon: var(--nb-book);
  --nb-option-ink: #6044a4;
  --nb-option-bg: #f0e9fb;
}

.nb-practice-options .nb-subject-card:nth-child(3) {
  --nb-option-icon: var(--nb-doc);
  --nb-option-ink: #147056;
  --nb-option-bg: #d9f7eb;
}

.nb-practice-options .nb-subject-card::before,
.nb-practice-options .nb-subject-card::after {
  content: "";
  position: absolute;
  top: 15px;
  left: 13px;
  width: 39px;
  height: 39px;
}

.nb-practice-options .nb-subject-card::before {
  border-radius: 10px;
  background: var(--nb-option-bg);
}

.nb-practice-options .nb-subject-card::after {
  background: var(--nb-option-ink);
  mask: var(--nb-option-icon) center / 58% no-repeat;
}

.nb-practice-options p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .92rem;
}

.nb-practice-options button {
  justify-self: start;
}

#nb-review-topics,
#nb-practice-section {
  margin-block: 12px 17px;
}

#nb-review-topics > :first-child,
#nb-practice-section > :first-child {
  margin-bottom: 7px;
}

.nb-review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) auto;
  align-items: center;
  gap: 7px 12px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

#nb-review-topics > .nb-review-row + .nb-review-row {
  margin-top: 5px;
}

#nb-practice-section {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

#nb-practice-section summary {
  padding-block: 6px;
  font-weight: 680;
}

#nb-practice-section:not([open]) > summary {
  margin: 0;
}

@media (max-width: 1080px) {
  .nb-workspace-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  }

  .nb-material-row {
    gap: 4px 7px;
  }

  .nb-material-row .nb-actions {
    grid-area: 3 / 2 / auto / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  #nb-view {
    padding: 12px 12px 24px;
  }

  #workspace #nb-view.home .nb-subject-head {
    min-height: 135px;
    margin-bottom: 8px;
    padding: 13px 13px 15px 16px;
  }

  .nb-breadcrumb {
    margin-bottom: 5px;
    font-size: .82rem;
  }

  .nb-breadcrumb button {
    min-height: 40px;
  }

  #nb-view #nb-title {
    font-size: clamp(1.95rem, 7.5vw, 3.1rem);
  }

  #nb-tiplo {
    width: clamp(79px, 25vw, 130px);
  }

  #nb-switcher:has(#nb-switch-book option:nth-child(2)) {
    display: flex;
    gap: 7px;
    align-items: center;
    margin-block: 0 4px;
  }

  #nb-switch-book {
    min-width: 0;
    max-width: 52%;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: var(--lab-wash);
    color: var(--lab-ink);
  }

  #nb-other-books {
    display: flex;
    gap: 4px;
    min-width: 0;
  }

  #nb-other-books button {
    min-height: 44px;
    padding: 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #nb-view #nb-subject-nav {
    justify-content: stretch;
    gap: 1px;
  }

  #nb-view #nb-subject-nav button {
    flex: 1 1 0;
    padding-inline: 7px;
  }

  .nb-workspace-grid,
  .nb-materials-grid,
  .nb-practice-options {
    grid-template-columns: minmax(0, 1fr);
  }

  #nb-view #nb-study-choice {
    min-height: auto;
  }

  #nb-chat-form #nb-chat-input {
    flex-basis: 100%;
  }

  #nb-chat-form #nb-chat-send {
    margin-inline-start: auto;
  }

  .nb-review-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .nb-review-row .nb-activity-label {
    grid-row: 2;
  }

  .nb-review-row button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}
