.tg-sheet {
  max-width: 40rem;
}

.tg-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
}

.tg-steps a {
  color: var(--aismis-muted, #5c6b7f);
  text-decoration: none;
}

.tg-steps a[aria-current="step"] {
  color: var(--aismis-portal-accent);
  font-weight: 650;
}

.tg-days,
.tg-inline,
.tg-actions,
.tg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.tg-periods {
  clear: left;
}

.tg-same-times {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
}

.tg-period {
  display: grid;
  grid-template-columns: minmax(0, 8.5rem) minmax(0, 8.5rem) minmax(0, 8.5rem) auto;
  justify-content: start;
  gap: 0.75rem;
  align-items: center;
}

.tg-demand {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--aismis-border);
}

.tg-demand > label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--aismis-muted, #5c6b7f);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.tg-demand > label.tg-check {
  flex-direction: row;
  align-items: center;
  align-self: end;
}

.tg-field-note {
  grid-column: 1 / -1;
  margin: 0;
}

.tg-days {
  gap: 0.5rem 1rem;
}

.tg-period .form-control {
  width: 100%;
}

.tg-row .form-control {
  width: 8.5rem;
}

.tg-list-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tg-icon-button {
  color: var(--aismis-muted, #5c6b7f);
  line-height: 1;
  text-decoration: none;
}

.tg-icon-button:hover,
.tg-icon-button:focus-visible {
  color: var(--aismis-portal-accent, #155e75);
}

.tg-cycle-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tg-cycle-form {
  display: contents;
}

.tg-cycle-name {
  order: 1;
}

.tg-cycle-page > .aismis-card {
  order: 2;
}

.tg-cycle-rest {
  order: 3;
}

.tg-cycle-page .aismis-card {
  margin-top: 0;
}

.tg-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.tg-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tg-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--aismis-border);
}

.tg-scroll {
  overflow-x: auto;
}

.tg-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.tg-grid th,
.tg-grid td {
  border: 1px solid var(--aismis-muted);
  border: 1px solid color-mix(in srgb, var(--aismis-border) 45%, var(--aismis-muted));
  vertical-align: top;
  padding: 0.4rem;
  min-width: 7.5rem;
}

.tg-grid td {
  background: var(--aismis-surface);
}

.tg-time {
  display: block;
  color: var(--aismis-muted, #5c6b7f);
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.tg-lesson {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  width: 100%;
  padding: 0.35rem 0.4rem;
  margin-top: 0.25rem;
  border: 0;
  border-radius: 0.35rem;
  background: var(--tg-lesson-bg, var(--aismis-accent-soft, #E8EEF6));
  color: var(--aismis-text, #1A2332);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.tg-lesson.is-selected,
.tg-lesson.is-swap-target {
  outline: 2px solid var(--aismis-portal-accent);
}

.tg-lesson.is-conflict {
  box-shadow: inset 3px 0 0 var(--bs-danger);
}

.tg-lesson.is-unsaved {
  background: #fff4cc;
}

.tg-lesson-title {
  color: var(--aismis-text, #1A2332);
}

.tg-lesson-class {
  font-weight: 400;
}

.tg-lesson-teacher,
.tg-lesson-room {
  align-self: flex-start;
  max-width: 100%;
  border-radius: 0.2rem;
  padding: 0 0.2rem;
  font-weight: 650;
}

.tg-lesson-teacher {
  color: var(--aismis-navy, #0B2D5C);
  background: color-mix(in srgb, var(--aismis-navy, #0B2D5C) 10%, #fff);
}

.tg-lesson-room {
  color: var(--aismis-portal-accent, #155E75);
  background: color-mix(in srgb, var(--aismis-portal-accent, #155E75) 14%, #fff);
}

.tg-lesson.is-dragging {
  opacity: 0.45;
}

.tg-lesson-ghost {
  position: fixed;
  z-index: 1080;
  margin: 0;
  pointer-events: none;
  box-shadow: var(--aismis-shadow-md);
}

.tg-drop {
  min-height: 2.75rem;
}

.tg-cell.is-drop-target {
  box-shadow: inset 0 0 0 2px var(--aismis-portal-accent);
}

.tg-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tg-filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1.25rem;
  align-items: start;
}

.tg-filter-row > .tg-filter-note {
  grid-column: 1 / -1;
}

@media (min-width: 1200px) {
  .tg-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 719px) {
  .tg-filter-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

body:has(.tg-steps) .aismis-card.tg-filters {
  background: color-mix(in srgb, var(--aismis-portal-accent, #155e75) 10%, var(--aismis-surface));
  color: var(--aismis-text);
}

.tg-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.tg-filter-label {
  flex: 0 0 5.5rem;
  margin: 0;
}

.tg-filter .dropdown {
  flex: 1 1 auto;
  min-width: 0;
}

.tg-filter .tg-picker {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.tg-filter .dropdown-menu {
  width: 100%;
  max-height: 15rem;
  overflow: auto;
  padding: 0.35rem 0.75rem;
}

.tg-filter .form-check {
  margin-bottom: 0.25rem;
}

.tg-filter-note,
.tg-filter-empty {
  margin: 0;
  color: var(--aismis-muted, #5c6b7f);
  font-size: 0.875rem;
}

.tg-subject-colour {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--aismis-muted, #5c6b7f);
}

.tg-colour-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.tg-lesson-dialog .dropdown {
  width: 100%;
}

.tg-lesson-dialog .tg-picker {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.tg-lesson-dialog .dropdown-menu {
  width: 100%;
  max-height: 15rem;
  overflow: auto;
  padding: 0.35rem 0.75rem;
}

.tg-lesson-dialog .form-check {
  margin-bottom: 0.25rem;
}

.tg-conflicts {
  margin: 0 0 1rem;
  color: var(--bs-danger);
}

.tg-conflicts ul {
  margin: 0;
  padding-left: 1.1rem;
}

.tg-repair,
.tg-repair-group {
  margin: 0.25rem 0.35rem 0.25rem 0;
}

.tg-repair {
  white-space: normal;
  text-align: left;
}

.tg-conflicts form {
  display: inline;
}

.tg-actions {
  margin: 1rem 0;
  align-items: center;
}

.tg-pdf {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0;
}

.tg-pdf .form-select {
  width: auto;
  min-width: 9rem;
}

.tg-slots {
  align-items: end;
  margin-top: 0;
}

.tg-slots form,
.tg-file {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.tg-file .form-control {
  width: 16rem;
  max-width: 100%;
}

.tg-slots label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--aismis-muted, #5c6b7f);
}

.tg-slots .form-control,
.tg-slots .form-select {
  width: 16rem;
}

.tg-actions .form-text {
  flex-basis: 100%;
  margin: 0;
}

[data-repeat-add] {
  margin: 0.25rem 0 0.5rem;
}

[data-saved-row].is-unsaved-row:not(tbody),
[data-saved-id].is-unsaved-row {
  background-color: #fff4cc;
  border-radius: 0.35rem;
}

tbody[data-saved-row].is-unsaved-row > .tg-lesson-summary > td {
  background-color: #fff4cc;
}

form[data-unsaved] :is(input, select, textarea).is-unsaved,
.tg-cycle-page :is(input, select, textarea).is-unsaved {
  border-color: #8a5a00;
  background-color: #f6c445;
  box-shadow: inset 0 0 0 1px #8a5a00;
  transition: none;
}

form[data-unsaved] :is(input, select, textarea).is-unsaved:focus,
.tg-cycle-page :is(input, select, textarea).is-unsaved:focus {
  border-color: #8a5a00;
  background-color: #f6c445;
  box-shadow: inset 0 0 0 1px #8a5a00, 0 0 0 0.2rem rgba(138, 90, 0, 0.35);
}

form[data-unsaved] :is(input[type="checkbox"], input[type="radio"]).is-unsaved {
  outline: 3px solid #8a5a00;
  outline-offset: 2px;
  background-color: transparent;
  box-shadow: none;
  accent-color: #8a5a00;
}

.tg-field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
}

.tg-field-row > .form-label {
  margin: 0;
}

.tg-field-row > .form-control,
.tg-field-row > .form-select {
  width: auto;
  flex: 1 1 12rem;
  max-width: 22rem;
}

.tg-field-row > .tg-weeks {
  flex: 0 0 5.5rem;
  width: 5.5rem;
  max-width: 5.5rem;
}

.tg-label-line {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tg-hint {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  margin-left: 0.35rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1;
  vertical-align: middle;
}

.tg-label-line > .tg-hint,
.tg-field-row > .tg-hint,
.tg-same-times > .tg-hint,
.tg-actions > .tg-hint,
.tg-forms > .tg-hint {
  margin-left: 0;
}

.tg-hint-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--aismis-muted, #5c6b7f);
  line-height: 1;
}

.tg-hint-button:hover,
.tg-hint-button:focus-visible {
  color: var(--aismis-portal-accent, #155e75);
  background: var(--aismis-accent-soft, #e8eef6);
}

.tg-hint-bubble {
  display: none;
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.4rem);
  left: 0;
  width: min(24rem, 72vw);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--aismis-border, #d8dee9);
  border-radius: 0.5rem;
  background: #fff;
  color: var(--aismis-text, #1a2332);
  font-size: 0.8125rem;
  font-weight: 450;
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  white-space: normal;
  box-shadow: 0 0.45rem 1.25rem rgba(11, 45, 92, 0.14);
}

.tg-hint:hover .tg-hint-bubble,
.tg-hint:focus-within .tg-hint-bubble {
  display: block;
}

.tg-demand .form-control,
.tg-demand .form-select {
  min-width: 7rem;
}

.tg-lesson-row {
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--aismis-border);
}

.tg-lesson-row > .tg-demand {
  border-bottom: none;
  margin-bottom: 0.75rem;
  padding-bottom: 0;
}

.tg-lesson-table-wrap {
  max-width: 100%;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.tg-lesson-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.tg-lesson-table th,
.tg-lesson-table td {
  padding: 0.4rem 0.35rem;
  vertical-align: middle;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.tg-lesson-table th {
  font-size: 0.75rem;
  white-space: normal;
}

.tg-lesson-table td {
  font-size: 0.875rem;
}

.tg-lesson-actions {
  width: 1%;
  white-space: nowrap;
}

.tg-lesson-table:not(.tg-people-table) th:nth-child(1),
.tg-lesson-table:not(.tg-people-table) td:nth-child(1) {
  width: 26%;
}

.tg-lesson-table:not(.tg-people-table) th:nth-child(2),
.tg-lesson-table:not(.tg-people-table) td:nth-child(2) {
  width: 32%;
}

.tg-lesson-table:not(.tg-people-table) th:nth-child(3),
.tg-lesson-table:not(.tg-people-table) td:nth-child(3) {
  width: 24%;
}

.tg-lesson-table:not(.tg-people-table) th:nth-child(4),
.tg-lesson-table:not(.tg-people-table) td:nth-child(4) {
  width: 18%;
}

.tg-lesson-table.tg-name-table th:nth-child(1),
.tg-lesson-table.tg-name-table td:nth-child(1) {
  width: 82%;
}

.tg-lesson-table.tg-name-table th:nth-child(2),
.tg-lesson-table.tg-name-table td:nth-child(2) {
  width: 18%;
}

.tg-lesson-table.tg-room-table th:nth-child(1),
.tg-lesson-table.tg-room-table td:nth-child(1) {
  width: 34%;
}

.tg-lesson-table.tg-room-table th:nth-child(2),
.tg-lesson-table.tg-room-table td:nth-child(2) {
  width: 48%;
}

.tg-lesson-table.tg-room-table th:nth-child(3),
.tg-lesson-table.tg-room-table td:nth-child(3) {
  width: 18%;
}

@media (max-width: 800px) {
  .tg-lesson-table.tg-people-table {
    table-layout: auto;
    width: 100%;
  }

  .tg-people-table th,
  .tg-people-table td {
    padding-left: 0.2rem;
    padding-right: 0.2rem;
  }

  .tg-lesson-detail .tg-demand {
    grid-template-columns: minmax(0, 1fr);
  }

  /* A set width stops the browser's default input size from stretching the column. */
  .tg-people-table td:nth-child(1) .form-control {
    width: calc(4ch + 2rem);
    max-width: calc(4ch + 2rem);
  }

  .tg-people-table td:nth-child(2) .form-control,
  .tg-people-table td:nth-child(3) .form-control {
    width: calc(8ch + 2rem);
    max-width: calc(8ch + 2rem);
  }

  .tg-people-table td:nth-child(4) .form-control {
    width: calc(6ch + 2rem);
    max-width: calc(6ch + 2rem);
  }

  .tg-people-table td:nth-child(5) .form-control,
  .tg-people-table td:nth-child(6) .form-control {
    width: calc(5ch + 2rem);
    max-width: calc(5ch + 2rem);
  }
}

.tg-lesson-summary {
  cursor: pointer;
  border-top: 1px solid var(--aismis-border);
}

.tg-lesson-actions {
  text-align: right;
  white-space: nowrap;
}

.tg-lesson-detail td {
  padding-top: 0.25rem;
  padding-bottom: 0.75rem;
}

.tg-lesson-detail .form-control,
.tg-lesson-detail .form-select,
.tg-lesson-row .form-control,
.tg-lesson-row .form-select {
  min-width: 0;
  max-width: 100%;
}

.tg-demand > label.tg-teaching {
  min-width: 16rem;
  width: max-content;
  max-width: 100%;
}

.tg-lesson-detail .tg-teaching .form-select,
.tg-lesson-row .tg-teaching .form-select {
  min-width: 16rem;
  width: 16rem;
  max-width: none;
}

.tg-lesson-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
  padding-top: 0.25rem;
}

.tg-lesson-panel .tg-demand,
.tg-lesson-row > .tg-demand {
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.tg-lesson-table tbody[data-lesson-block] .tg-lesson-detail td[colspan] > .tg-lesson-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Keep a colspan editor inside the summary width so opening a row does not stretch the table. */
.tg-lesson-detail td[colspan] > :not(input) {
  width: 0;
  min-width: 100%;
}

.tg-set-summary {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

.tg-set-summary li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  padding: 0.2rem 0;
}

.tg-set-count {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 12rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--aismis-muted, #5c6b7f);
}

.tg-lesson-table.tg-pool-table th:nth-child(1),
.tg-lesson-table.tg-pool-table td:nth-child(1) {
  width: 34%;
}

.tg-lesson-table.tg-pool-table th:nth-child(2),
.tg-lesson-table.tg-pool-table td:nth-child(2) {
  width: 48%;
}

.tg-lesson-table.tg-pool-table th:nth-child(3),
.tg-lesson-table.tg-pool-table td:nth-child(3) {
  width: 18%;
}

.tg-pool-editor {
  display: grid;
  grid-template-columns: minmax(8rem, 16rem) minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

.tg-pool-editor > label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--aismis-muted, #5c6b7f);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.tg-pool-editor .form-control,
.tg-pool-editor .form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.tg-pool-editor .form-select[multiple] {
  min-height: 9rem;
}

@media (max-width: 800px) {
  .tg-pool-editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .tg-pool-editor .form-select[multiple] {
    min-height: 11rem;
    font-size: 1rem;
  }
}

@media (min-width: 801px) {
  .tg-pool-table th,
  .tg-room-table th {
    white-space: nowrap;
  }
}

.tg-form-lesson {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0;
  border-top: 1px solid var(--aismis-border);
}

.tg-form-lesson > label,
.tg-form-lesson > .tg-form-lesson-name {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--aismis-muted, #5c6b7f);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.tg-form-lesson > .tg-form-lesson-name {
  align-self: center;
  font-weight: 600;
  color: var(--aismis-text, #1a2332);
}

.tg-form-lesson .form-control,
.tg-form-lesson .form-select {
  width: 9rem;
  max-width: 100%;
}

.tg-form-lesson .form-select[multiple],
.tg-set .form-select[multiple] {
  width: 12rem;
  min-height: 9rem;
}

.tg-how-many {
  white-space: nowrap;
}

.tg-form-lesson .tg-how-many .form-control,
.tg-set .tg-how-many .form-control {
  width: 6rem;
}

@media (max-width: 800px) {
  .tg-demand > label.tg-teaching,
  .tg-lesson-detail .tg-teaching .form-select,
  .tg-lesson-row .tg-teaching .form-select {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .tg-editor-blocks {
    grid-template-columns: minmax(0, 1fr);
  }

  .tg-form-lesson,
  .tg-set {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .tg-form-lesson .form-select,
  .tg-form-lesson .form-control,
  .tg-set .form-select,
  .tg-set .form-control {
    width: 100%;
  }

  .tg-form-lesson .form-select[multiple],
  .tg-set .form-select[multiple] {
    width: 100%;
    min-height: 11rem;
    font-size: 1rem;
  }

  .tg-form-lesson .tg-how-many .form-control,
  .tg-set .tg-how-many .form-control {
    width: 100%;
  }
}

.tg-sets {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.tg-set {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0;
  border-top: 1px solid var(--aismis-border);
}

.tg-set-name {
  max-width: 16rem;
}

.tg-editor-blocks {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(14rem, 0.8fr);
  gap: 0.75rem 1rem;
  width: 100%;
  min-width: 0;
}

.tg-editor-block {
  min-width: 0;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--aismis-border, #d5dde8);
  border-radius: 0.4rem;
}

.tg-editor-label {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--aismis-text, #1a2332);
}

.tg-pick + .tg-pick {
  margin-top: 0.75rem;
}

.tg-pick label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  margin: 0;
  font-size: 0.875rem;
  color: var(--aismis-muted, #5c6b7f);
}

.tg-pick-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.tg-pick-pool > label:not(.tg-how-many) {
  flex: 1 1 12rem;
  min-width: 0;
}

.tg-pick-pool > .tg-how-many {
  flex: 0 0 6.5rem;
}

.tg-pick [data-use-pool],
.tg-pick [data-use-names] {
  margin-top: 0.25rem;
}

.tg-editor-block .form-select,
.tg-editor-block .form-control,
.tg-editor-block .form-select[multiple] {
  width: 100%;
  max-width: 100%;
}

.tg-set > label,
.tg-staff > [data-repeat-row] > label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--aismis-muted, #5c6b7f);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.tg-set > label.tg-check {
  flex-direction: row;
  align-items: center;
}

.tg-staff {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: end;
}

.tg-set .form-control,
.tg-set .form-select,
.tg-staff .form-select {
  width: 9rem;
  max-width: 100%;
}

.tg-form-lesson .tg-editor-block .form-select,
.tg-form-lesson .tg-editor-block .form-control,
.tg-set .tg-editor-block .form-select,
.tg-set .tg-editor-block .form-control,
.tg-form-lesson .tg-editor-block .form-select[multiple],
.tg-set .tg-editor-block .form-select[multiple] {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 800px) {
  .tg-set {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .tg-set .form-select,
  .tg-set .form-control {
    width: 100%;
  }

  .tg-set .form-select[multiple] {
    width: 100%;
    min-height: 11rem;
    font-size: 1rem;
  }
}

.tg-people-wrap {
  overflow-x: auto;
}

.tg-people-table .tg-lesson-detail label {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  min-width: min-content;
  font-size: 0.875rem;
  color: var(--aismis-muted, #5c6b7f);
}

.tg-people-table .tg-person-label {
  flex: 0 0 auto;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.tg-people-table .tg-lesson-detail .form-control {
  width: 100%;
}

@media (min-width: 801px) {
  .tg-lesson-table th {
    white-space: nowrap;
  }

  .tg-lesson-table.tg-people-table th:nth-child(1),
  .tg-lesson-table.tg-people-table td:nth-child(1) {
    width: 10%;
  }

  .tg-lesson-table.tg-people-table th:nth-child(2),
  .tg-lesson-table.tg-people-table td:nth-child(2),
  .tg-lesson-table.tg-people-table th:nth-child(3),
  .tg-lesson-table.tg-people-table td:nth-child(3) {
    width: 18%;
  }

  .tg-lesson-table.tg-people-table th:nth-child(4),
  .tg-lesson-table.tg-people-table td:nth-child(4) {
    width: 12%;
  }

  .tg-lesson-table.tg-people-table th:nth-child(5),
  .tg-lesson-table.tg-people-table td:nth-child(5),
  .tg-lesson-table.tg-people-table th:nth-child(6),
  .tg-lesson-table.tg-people-table td:nth-child(6) {
    width: 13%;
  }

  .tg-lesson-table.tg-people-table th:nth-child(7),
  .tg-lesson-table.tg-people-table td:nth-child(7) {
    width: 16%;
  }

  .tg-people-table .tg-person-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

.tg-forms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  grid-column: 1 / -1;
  margin: 0.25rem 0 0.75rem;
}

@media (max-width: 800px) {
  .tg-editor-blocks {
    grid-template-columns: minmax(0, 1fr);
  }

  .tg-lesson-panel .tg-demand,
  .tg-lesson-row > .tg-demand {
    grid-template-columns: minmax(0, 1fr);
  }

  .tg-demand > label.tg-teaching {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }

  .tg-lesson-detail .tg-teaching .form-select,
  .tg-lesson-row .tg-teaching .form-select {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
}

/* Page, section, and subsection use existing tokens. Borders stay so the
   regions still separate if the fill is hard to see. Unsaved yellow is below. */
body:has(.tg-steps) {
  background: var(--aismis-accent-soft);
  background-attachment: fixed;
}

body:has(.tg-steps) .aismis-card {
  background: var(--aismis-surface);
}

form.aismis-card:has(> .tg-section) {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.tg-section {
  background: var(--aismis-surface);
  border: 1px solid var(--aismis-border);
  border-radius: var(--aismis-radius, 0.625rem);
  box-shadow: var(--aismis-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
  padding: 1rem 1.1rem;
}

.tg-section + .tg-section,
.tg-section + .tg-actions,
form.aismis-card:has(> .tg-section) > .tg-actions {
  margin-top: 1rem;
}

.tg-section > .aismis-card-title:first-child {
  margin-top: 0;
}

.tg-lesson-summary > td {
  background: var(--aismis-surface);
  border-top: 1px solid var(--aismis-border);
}

.tg-lesson-detail > td {
  background: var(--aismis-register-am-bg);
  border: 1px solid var(--aismis-border);
  padding: 0.75rem;
}

.tg-set,
.tg-form-lesson {
  background: var(--aismis-register-am-bg);
  border: 1px solid var(--aismis-border);
  border-radius: 0.4rem;
  padding: 0.75rem;
}

.tg-editor-block {
  background: var(--aismis-accent-soft);
}

.tg-section > .tg-row:not(.is-unsaved-row),
.tg-section > .tg-demand,
.tg-section > details,
.tg-section > .tg-lesson-table-wrap + [data-repeat],
.tg-section > .tg-row + [data-repeat],
.tg-section > .tg-demand + [data-repeat],
.tg-section > p + [data-repeat] {
  background: var(--aismis-register-am-bg);
  border: 1px solid var(--aismis-border);
  border-radius: 0.4rem;
  padding: 0.65rem 0.75rem;
  margin-top: 0.65rem;
  margin-bottom: 0;
}

.tg-cycle-rest > fieldset,
.tg-cycle-rest > .tg-periods,
.tg-cycle-rest > .tg-number-grids {
  background: var(--aismis-register-am-bg);
  border: 1px solid var(--aismis-border);
  border-radius: var(--aismis-radius, 0.625rem);
  padding: 0.75rem 0.85rem;
}

.tg-number-grids {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tg-number-week + .tg-number-week {
  margin-top: 0.25rem;
}

.tg-number-grid {
  width: auto;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.tg-number-grid th,
.tg-number-grid td {
  border: 1px solid color-mix(in srgb, var(--aismis-border) 45%, var(--aismis-muted));
  padding: 0.35rem 0.45rem;
  vertical-align: middle;
  background: var(--aismis-surface);
  min-width: 0;
}

.tg-number-grid th {
  background: var(--aismis-register-am-bg);
  font-weight: 650;
  text-align: left;
}

.tg-number-grid .form-control {
  width: 4.75rem;
}

.tg-number-name {
  font-weight: 650;
}

.tg-number-time,
.tg-number-day {
  display: block;
  color: var(--aismis-muted, #5c6b7f);
  font-size: 0.75rem;
  font-weight: 400;
}

.tg-grid th {
  background: var(--aismis-register-am-bg);
}

tbody[data-saved-row].is-unsaved-row > .tg-lesson-summary > td,
[data-saved-row].is-unsaved-row:not(tbody),
[data-saved-id].is-unsaved-row {
  background-color: #fff4cc;
}

.tg-carousel-editor,
.tg-same-staff {
  min-width: 0;
  max-width: 100%;
}

.tg-carousel-editor .tg-demand {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

@media (max-width: 960px) {
  .tg-lesson-panel .tg-demand,
  .tg-lesson-row > .tg-demand,
  .tg-carousel-editor .tg-demand {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  }

  .tg-demand > label,
  .tg-demand > label.tg-teaching,
  .tg-lesson-detail .tg-teaching .form-select,
  .tg-lesson-row .tg-teaching .form-select,
  .tg-carousel-editor .form-select,
  .tg-carousel-editor .form-control {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .tg-editor-blocks {
    grid-template-columns: minmax(0, 1fr);
  }

  .tg-check,
  .tg-label-line {
    min-width: 0;
    max-width: 100%;
  }
}

/* One Save control per generator tab, level with the first section. The right
   padding keeps the section title clear of the control. */
.tg-page-tools {
  position: absolute;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
}

.tg-page-save.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--aismis-surface);
  border: 1px solid var(--aismis-border);
  border-radius: 0.4rem;
  box-shadow: var(--aismis-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
  padding: 0.3rem 0.55rem;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}

.tg-page-save.btn:hover,
.tg-page-save.btn:focus-visible {
  background: var(--aismis-surface);
  border-color: var(--aismis-border);
  color: var(--aismis-portal-accent, #155e75);
  text-decoration: none;
}

form.aismis-card:has(> .tg-page-tools) {
  position: relative;
}

form.aismis-card > .tg-page-tools {
  top: 0.7rem;
  right: 0.65rem;
}

form.aismis-card:has(> .tg-page-tools) > .tg-section:first-of-type {
  padding-right: 6.75rem;
}

.tg-cycle-name,
.tg-board {
  position: relative;
}

.tg-cycle-name > .tg-page-tools,
.tg-board > .tg-page-tools {
  top: 1.15rem;
  right: 0.85rem;
}

.tg-cycle-name:has(> .tg-page-tools),
.tg-board > section.aismis-card:first-of-type {
  padding-right: 6.75rem;
}

@media (max-width: 960px) {
  .tg-page-tools {
    display: flex;
    position: absolute;
  }

  form.aismis-card:has(> .tg-page-tools) > .tg-section:first-of-type,
  .tg-cycle-name:has(> .tg-page-tools),
  .tg-board > section.aismis-card:first-of-type {
    padding-right: 6.5rem;
  }
}

@media (max-width: 420px) {
  .tg-page-save.btn {
    padding: 0.25rem 0.45rem;
    font-size: 0.875rem;
  }

  form.aismis-card > .tg-page-tools {
    top: 0.45rem;
    right: 0.4rem;
  }

  .tg-cycle-name > .tg-page-tools,
  .tg-board > .tg-page-tools {
    top: 0.55rem;
    right: 0.45rem;
  }

  form.aismis-card:has(> .tg-page-tools) > .tg-section:first-of-type,
  .tg-cycle-name:has(> .tg-page-tools),
  .tg-board > section.aismis-card:first-of-type {
    padding-right: 5.6rem;
  }

  form.aismis-card:has(> .tg-page-tools) > .tg-table-exchange {
    width: calc(100% - 6rem);
  }
}

.tg-table-exchange {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  margin: 0 0 0.75rem;
  max-width: 100%;
}

form.aismis-card:has(> .tg-page-tools) > .tg-table-exchange {
  width: calc(100% - 7rem);
}

.tg-table-exchange .btn-group {
  flex: 1 1 12rem;
  max-width: 100%;
}

.tg-table-exchange .btn-group > .btn:first-child,
.tg-table-exchange .btn-group > a.btn {
  flex: 1 1 auto;
  white-space: normal;
  text-align: left;
}

.tg-table-exchange .dropdown-toggle-split {
  flex: 0 0 auto;
}

@media (max-width: 960px) {
  .tg-table-exchange .btn-group {
    flex-basis: 100%;
  }
}

/* Setup Download, Import, and Save share the tab-title row. The title wraps
   when the controls need the width. Near 390px the whole action group drops
   under the title and stays together. */
.aismis-page-header.tg-setup-header {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.aismis-page-header.tg-setup-header > h1 {
  flex: 1 1 auto;
  min-width: 4.5rem;
  margin: 0;
}

.tg-setup-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.tg-setup-actions .btn.btn-sm {
  padding: 0.2rem 0.45rem;
  font-size: 0.8125rem;
}

.tg-setup-actions > .tg-page-tools {
  position: static;
  z-index: auto;
  flex: 0 0 auto;
}

.tg-exchange-set {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.35rem;
}

.tg-exchange-label {
  color: var(--aismis-muted, #5c6b7f);
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.tg-setup-actions .tg-table-exchange {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  width: auto;
  max-width: none;
  margin: 0;
}

.tg-setup-actions .tg-table-exchange .btn-group {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
}

.tg-setup-actions .tg-table-exchange .btn-group > .btn:first-child,
.tg-setup-actions .tg-table-exchange .btn-group > a.btn {
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: center;
}

@media (max-width: 960px) {
  .aismis-page-header.tg-setup-header,
  .tg-setup-actions,
  .tg-setup-actions .tg-exchange-set,
  .tg-setup-actions .tg-table-exchange {
    flex-wrap: nowrap;
  }

  .tg-setup-actions .tg-table-exchange .btn-group {
    flex-basis: auto;
  }
}

.tg-home {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
  max-width: 100%;
}

.tg-home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem 2rem;
  align-items: center;
}

.tg-home-lead h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  margin: 0.15rem 0 0.55rem;
  max-width: 22em;
}

.tg-home-lead > p:last-child,
.tg-home-saved > p,
.tg-home-files > p,
.tg-home-board-head > p {
  margin: 0;
  max-width: 40rem;
}

.tg-home-signin {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.tg-home-signin .btn {
  white-space: nowrap;
}

.tg-home-signin p {
  margin: 0;
  max-width: 16rem;
  color: var(--aismis-muted, #5c6b7f);
  font-size: 0.875rem;
}

.tg-home-board {
  min-width: 0;
  max-width: 100%;
}

.tg-home-board-head h2,
.tg-home-saved h2,
.tg-home-files h2 {
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}

.tg-home-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0.85rem 0 0.75rem;
}

.tg-home-filters li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--aismis-border);
  border-radius: 999px;
  background: var(--aismis-surface, #fff);
  font-size: 0.8125rem;
}

.tg-home-filters span {
  color: var(--aismis-muted, #5c6b7f);
}

.tg-home-filters .is-set {
  border-color: var(--aismis-portal-accent, #155e75);
  background: color-mix(in srgb, var(--aismis-portal-accent, #155e75) 10%, #fff);
  font-weight: 650;
}

.tg-home .tg-scroll {
  min-width: 0;
  max-width: 100%;
}

.tg-home .tg-grid {
  font-size: 0.8125rem;
}

.tg-home .tg-grid th,
.tg-home .tg-grid td {
  min-width: 6.35rem;
}

.tg-home .tg-grid th:first-child {
  min-width: 4.6rem;
  width: 4.6rem;
}

.tg-home .tg-lesson {
  cursor: default;
}

.tg-home .aismis-colour-swatch {
  cursor: default;
}

.tg-home-drag {
  margin: 0.75rem 0 0;
  max-width: 46rem;
  color: var(--aismis-muted, #5c6b7f);
  font-size: 0.875rem;
}

.tg-home-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem 2.5rem;
  align-items: start;
  padding-top: 0.25rem;
}

.tg-home-drafts {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  border-top: 1px solid var(--aismis-border);
}

.tg-home-drafts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--aismis-border);
}

.tg-home-loaded {
  color: var(--aismis-portal-accent, #155e75);
  font-weight: 650;
  font-size: 0.875rem;
}

.tg-home-subjects {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--aismis-border);
}

.tg-home-kicker {
  margin: 0 0 0.45rem;
  color: var(--aismis-muted, #5c6b7f);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tg-home-subject-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  list-style: none;
  padding: 0;
  margin: 0 0 0.65rem;
}

.tg-home-subject-list li {
  display: inline-flex;
  align-items: center;
  font-weight: 650;
}

.tg-home-subjects > p:last-child {
  margin: 0;
  max-width: 40rem;
}

@media (min-width: 960px) {
  .tg-home-intro {
    grid-template-columns: minmax(0, 1fr) 15.5rem;
  }

  .tg-home-lower {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 420px) {
  .tg-home-lead h1 {
    font-size: 1.45rem;
  }

  .tg-home .tg-grid th,
  .tg-home .tg-grid td {
    min-width: 6.1rem;
    padding: 0.3rem;
  }
}

@media (max-width: 420px) {
  .aismis-page-header.tg-setup-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .aismis-page-header.tg-setup-header > h1 {
    flex: 1 1 100%;
    min-width: 0;
  }

  .tg-setup-actions {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 0.5rem;
  }
}

.tg-analysis {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.25rem 1.5rem;
  min-width: 0;
  max-width: 100%;
}

.tg-analysis-block {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  background: var(--aismis-surface);
  border: 1px solid var(--aismis-border);
  border-radius: var(--aismis-radius, 0.625rem);
  box-shadow: var(--aismis-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
  padding: 0.55rem 0.65rem 0.65rem;
}

.tg-analysis-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  max-width: 100%;
  margin: 0 0 0.4rem;
  color: var(--aismis-text);
  font-weight: 650;
}

.tg-analysis-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.tg-analysis-table {
  flex: 0 0 auto;
  width: max-content;
  border-collapse: collapse;
  background: var(--aismis-surface);
}

.tg-analysis-table th,
.tg-analysis-table td {
  padding: 0.4rem 0.65rem;
  white-space: nowrap;
  text-align: left;
  font-weight: 400;
  color: var(--aismis-text);
  background: var(--aismis-surface);
  border: 1px solid color-mix(in srgb, var(--aismis-border) 45%, var(--aismis-muted));
}

.tg-analysis-table thead th {
  background: var(--aismis-register-am-bg);
  color: var(--aismis-text);
  font-size: 0.75rem;
  font-weight: 650;
}

.tg-analysis-table thead button,
.tg-analysis-units button {
  font: inherit;
  font-weight: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.tg-analysis-table thead button:focus-visible,
.tg-analysis-units button:focus-visible {
  outline: 2px solid var(--aismis-portal-accent);
  outline-offset: 2px;
}

.tg-analysis-units {
  font-weight: 450;
}

.tg-analysis-download.tg-table-exchange {
  margin: 0;
  flex: 0 0 auto;
}

.tg-analysis-download .btn-group {
  flex: 0 0 auto;
}

.tg-analysis-download .btn-group > .btn:first-child {
  white-space: nowrap;
  text-align: left;
}

.tg-analysis-units button + button {
  margin-left: 0.45rem;
}

.tg-analysis-units button[aria-pressed="true"] {
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.tg-analysis-table thead button[aria-sort="ascending"]::after {
  content: " \2191";
}

.tg-analysis-table thead button[aria-sort="descending"]::after {
  content: " \2193";
}

.tg-heat {
  max-width: 100%;
  min-width: 0;
}

.tg-heat + .tg-analysis,
.tg-lanes + .tg-analysis,
.tg-strip + .tg-analysis,
.tg-options + .tg-analysis {
  margin-top: 1rem;
}

.tg-heat-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: var(--aismis-text);
}

.tg-heat-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin: 0.15rem 0 0.65rem;
  color: var(--aismis-text);
  font-size: 0.8125rem;
  font-weight: 450;
}

.tg-heat-swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 1px solid color-mix(in srgb, var(--aismis-border) 45%, var(--aismis-muted));
  background: color-mix(in srgb, var(--aismis-portal-accent, #155e75) calc(var(--heat, 0) * 100%), var(--aismis-surface, #fff));
}

.tg-heat-swatch-clash {
  background: color-mix(in srgb, var(--bs-danger, #dc3545) 42%, var(--aismis-surface, #fff));
  box-shadow: inset 3px 0 0 var(--bs-danger, #dc3545);
}

.tg-heat-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.tg-heat-week[hidden] {
  display: none;
}

.tg-heat-table {
  width: max-content;
  border-collapse: separate;
  border-spacing: 0.2rem;
  background: transparent;
}

.tg-heat-table th {
  background: var(--aismis-register-am-bg);
  color: var(--aismis-text);
  font-size: 0.75rem;
  font-weight: 650;
  white-space: nowrap;
  text-align: center;
  padding: 0.35rem 0.45rem;
}

.tg-heat-table tbody th {
  text-align: left;
}

.tg-heat-table td {
  padding: 0;
  background: transparent;
  border: 0;
  vertical-align: middle;
}

.tg-heat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  width: 100%;
  min-width: 2.75rem;
  min-height: 2.4rem;
  padding: 0.28rem 0.4rem;
  border: 1px solid color-mix(in srgb, var(--aismis-border) 45%, var(--aismis-muted));
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--aismis-portal-accent, #155e75) calc(var(--heat, 0) * 100%), var(--aismis-surface, #fff));
  color: var(--aismis-text, #1A2332);
  font: inherit;
  line-height: 1.15;
  cursor: pointer;
}

.tg-heat-cell.is-hot {
  color: #fff;
}

.tg-heat-cell.is-clash {
  background: color-mix(in srgb, var(--bs-danger, #dc3545) 42%, var(--aismis-surface, #fff));
  box-shadow: inset 3px 0 0 var(--bs-danger, #dc3545);
  color: var(--aismis-text, #1A2332);
}

.tg-heat-cell:focus-visible {
  outline: 2px solid var(--aismis-portal-accent, #155e75);
  outline-offset: 2px;
  z-index: 1;
}

.tg-heat-count {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.tg-heat-period,
.tg-heat-clash,
.tg-heat-cap {
  font-size: 0.65rem;
  font-weight: 650;
  line-height: 1.1;
}

.tg-heat-cell:not(.is-clash) .tg-heat-clash,
.tg-heat-cap {
  display: none;
}

.tg-heat[data-measure="teachers"] [data-over-cap="true"] .tg-heat-cap {
  display: block;
}

.tg-heat-gap {
  display: block;
  min-width: 2.75rem;
  min-height: 2.4rem;
}

.tg-heat-detail {
  max-width: 100%;
  margin: 0.65rem 0 0;
  color: var(--aismis-text);
  font-size: 0.875rem;
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tg-heat-detail-count,
.tg-heat-detail-line {
  display: block;
  max-width: 36rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tg-lanes {
  max-width: 100%;
  min-width: 0;
}

.tg-lane-week-name {
  color: var(--aismis-text);
  font-size: 0.8125rem;
  font-weight: 650;
}

.tg-lane-scroll {
  max-width: 100%;
  max-height: 32rem;
  overflow: auto;
}

.tg-lane-week[hidden],
.tg-lane-grid[hidden] {
  display: none;
}

.tg-lane-grid {
  --lane-count: 1;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  width: max(100%, max-content);
  min-width: 0;
}

.tg-lane-person {
  display: grid;
  grid-template-columns: minmax(7.5rem, 8.75rem) minmax(0, 1fr);
  column-gap: 0.35rem;
  align-items: center;
  min-width: 0;
}

.tg-lane-person-head {
  position: sticky;
  top: 0;
  z-index: 3;
  align-items: stretch;
  background: var(--aismis-surface, #fff);
}

.tg-lane-name {
  min-width: 0;
  padding: 0.28rem 0.45rem;
  overflow: hidden;
  color: var(--aismis-text);
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--aismis-surface, #fff);
  position: sticky;
  left: 0;
  z-index: 1;
}

.tg-lane-person-head .tg-lane-name {
  z-index: 4;
  background: var(--aismis-register-am-bg);
}

.tg-lane-track {
  display: grid;
  grid-template-columns: repeat(var(--lane-count), minmax(4.75rem, 1fr));
  grid-auto-rows: minmax(1.65rem, auto);
  column-gap: 0.2rem;
  row-gap: 0.12rem;
  min-width: 0;
  align-items: stretch;
}

.tg-lane-head-track {
  grid-template-rows: auto auto;
  row-gap: 0.12rem;
  background: var(--aismis-surface, #fff);
}

.tg-lane-day,
.tg-lane-period {
  min-width: 0;
  padding: 0.22rem 0.15rem;
  background: var(--aismis-register-am-bg);
  color: var(--aismis-text);
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.tg-lane-day {
  border-radius: 0.25rem 0.25rem 0 0;
}

.tg-lane-period {
  font-variant-numeric: tabular-nums;
  border-radius: 0 0 0.25rem 0.25rem;
}

.tg-lane-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  min-width: 0;
  max-width: 100%;
  min-height: 1.65rem;
  margin: 0;
  padding: 0.12rem 0.28rem;
  border: 0;
  border-radius: 0.35rem;
  background: var(--tg-lesson-bg, var(--aismis-accent-soft, #E8EEF6));
  color: var(--aismis-text, #1A2332);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  container-type: inline-size;
}

.tg-lane-block.is-clash {
  background: color-mix(in srgb, var(--bs-danger, #dc3545) 42%, var(--aismis-surface, #fff));
  box-shadow: inset 3px 0 0 var(--bs-danger, #dc3545);
  color: var(--aismis-text, #1A2332);
}

.tg-lane-block:focus-visible {
  outline: 2px solid var(--aismis-portal-accent, #155e75);
  outline-offset: 2px;
  z-index: 1;
}

.tg-lane-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tg-lane-label strong {
  font-weight: 650;
}

.tg-lane-meta {
  display: none;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@container (min-width: 7.5rem) {
  .tg-lane-meta {
    display: inline-block;
  }
}

.tg-lane-clash {
  font-size: 0.65rem;
  font-weight: 650;
  line-height: 1.1;
}

.tg-lane-block:not(.is-clash) .tg-lane-clash {
  display: none;
}

.tg-lane-detail {
  max-width: 100%;
  margin: 0.65rem 0 0;
  color: var(--aismis-text);
  font-size: 0.875rem;
  font-weight: 400;
}

.tg-lane-detail-line {
  display: block;
  max-width: 40rem;
}

.tg-strip,
.tg-options {
  max-width: 100%;
  min-width: 0;
}

.tg-strip-pick {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.75rem;
  font-weight: 650;
}

.tg-strip-pick select {
  min-width: 8rem;
  font-weight: 400;
}

.tg-strip-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.tg-strip-scroll[hidden],
.tg-spark-week[hidden],
.tg-options [data-option-week][hidden] {
  display: none;
}

.tg-strip-track {
  display: flex;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}

.tg-strip-stop {
  flex: 0 0 7.25rem;
  min-width: 7.25rem;
}

.tg-strip-number {
  display: block;
  margin: 0 0 0.2rem;
  color: var(--aismis-text);
  font-size: 0.75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.tg-strip-lessons {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 2.4rem;
}

.tg-strip-lesson,
.tg-option-set,
.tg-spark {
  font: inherit;
}

.tg-strip-lesson {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  width: 100%;
  min-height: 2.4rem;
  margin: 0;
  padding: 0.28rem 0.35rem;
  border: 0;
  border-radius: 0.35rem;
  background: var(--tg-lesson-bg, var(--aismis-accent-soft, #E8EEF6));
  color: var(--aismis-text, #1A2332);
  font-size: 0.75rem;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
}

.tg-strip-lesson.is-move {
  box-shadow: inset 0 3px 0 var(--aismis-portal-accent, #155e75);
}

.tg-strip-lesson:focus-visible,
.tg-option-set:focus-visible,
.tg-spark:focus-visible {
  outline: 2px solid var(--aismis-portal-accent, #155e75);
  outline-offset: 2px;
}

.tg-strip-label,
.tg-option-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tg-strip-label strong,
.tg-option-label strong {
  font-weight: 650;
}

.tg-strip-room {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tg-strip-move {
  font-size: 0.65rem;
  font-weight: 650;
  line-height: 1.1;
}

.tg-strip-move::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.25rem;
  border-radius: 50%;
  background: var(--aismis-portal-accent, #155e75);
  vertical-align: middle;
}

.tg-strip-gap,
.tg-option-gap {
  display: block;
  min-height: 2.4rem;
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--aismis-border) 35%, var(--aismis-surface, #fff));
}

.tg-strip-detail,
.tg-option-detail,
.tg-spark-detail {
  max-width: 100%;
  margin: 0.65rem 0 0;
  color: var(--aismis-text);
  font-size: 0.875rem;
  font-weight: 400;
}

.tg-strip-detail-line,
.tg-option-detail-line {
  display: block;
  max-width: 40rem;
}

.tg-option-block + .tg-option-block {
  margin-top: 0.9rem;
}

.tg-option-name {
  margin: 0 0 0.4rem;
  color: var(--aismis-text);
  font-size: 0.9rem;
  font-weight: 650;
}

.tg-option-empty {
  margin: 0;
  color: var(--aismis-text);
  font-size: 0.875rem;
  font-weight: 400;
}

.tg-option-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.tg-option-table {
  border-collapse: collapse;
  width: max-content;
  max-width: none;
}

.tg-option-table th,
.tg-option-table td {
  padding: 0.35rem;
  vertical-align: top;
  text-align: left;
  font-weight: 400;
  color: var(--aismis-text);
  border: 1px solid color-mix(in srgb, var(--aismis-border) 45%, var(--aismis-muted));
}

.tg-option-table thead th {
  font-size: 0.75rem;
  font-weight: 650;
  white-space: nowrap;
}

.tg-option-set {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  width: 8.5rem;
  max-width: 100%;
  min-height: 2.4rem;
  margin: 0;
  padding: 0.28rem 0.35rem;
  border: 0;
  border-radius: 0.35rem;
  background: var(--tg-lesson-bg, var(--aismis-accent-soft, #E8EEF6));
  color: var(--aismis-text, #1A2332);
  font-size: 0.75rem;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
}

.tg-option-meta {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tg-spark-holder {
  display: inline-block;
  margin-left: 0.45rem;
  vertical-align: middle;
}

.tg-spark {
  display: inline-flex;
  align-items: flex-end;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  line-height: 0;
  cursor: pointer;
}

.tg-spark-svg {
  display: block;
  width: 4.5rem;
  height: 1rem;
}

.tg-spark-bar {
  fill: var(--aismis-portal-accent, #155e75);
}

.tg-diff,
.tg-whatif {
  max-width: 100%;
  min-width: 0;
}

.tg-diff-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: end;
  margin: 0 0 0.75rem;
}

.tg-diff-picks label {
  display: flex;
  flex: 1 1 14rem;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  margin: 0;
  font-weight: 650;
}

.tg-diff-picks .form-select {
  width: 100%;
  max-width: 100%;
  font-weight: 400;
}

.tg-diff-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: center;
  margin: 0;
}

.tg-diff-key {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 650;
}

.tg-diff-key.is-added {
  color: #14532d;
}

.tg-diff-key.is-removed {
  color: #7f1d1d;
}

.tg-diff-key.is-moved {
  color: #713f12;
}

.tg-diff-number {
  display: block;
  font-weight: 650;
}

.tg-diff-lesson {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  position: relative;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.35rem 0.4rem;
  border: 0;
  border-radius: 0.35rem;
  color: var(--aismis-text, #1a2332);
  font: inherit;
  text-align: left;
  cursor: default;
}

.tg-diff-lesson.is-unchanged {
  background: color-mix(in srgb, var(--aismis-portal-accent, #155e75) 14%, var(--aismis-surface, #fff));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--aismis-portal-accent, #155e75) 28%, transparent);
  opacity: 0.72;
}

.tg-diff-lesson.is-added {
  background: #e8f6ec;
  box-shadow: inset 3px 0 0 #166534;
}

.tg-diff-lesson.is-removed {
  background: #fdecec;
  box-shadow: inset 3px 0 0 #991b1b;
}

.tg-diff-lesson.is-removed .tg-lesson-title {
  text-decoration: line-through;
}

.tg-diff-lesson.is-moved {
  background: #fff6db;
  box-shadow: inset 3px 0 0 #92400e;
}

.tg-diff-state {
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.tg-diff-lesson.is-added .tg-diff-state {
  color: #14532d;
}

.tg-diff-lesson.is-removed .tg-diff-state {
  color: #7f1d1d;
}

.tg-diff-lesson.is-moved .tg-diff-state {
  color: #713f12;
}

.tg-diff-lesson:focus {
  outline: 2px solid var(--aismis-portal-accent, #155e75);
  outline-offset: 2px;
}

.tg-diff-versions {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.tg-diff-lesson:hover .tg-diff-versions,
.tg-diff-lesson:focus .tg-diff-versions,
.tg-diff-lesson:focus-visible .tg-diff-versions {
  position: static;
  width: auto;
  height: auto;
  margin: 0.25rem 0 0;
  overflow: visible;
  clip: auto;
  color: var(--aismis-text, #1a2332);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.35;
}

.tg-diff-versions span {
  display: block;
}

@media (max-width: 719px) {
  .tg-diff-picks {
    flex-direction: column;
    align-items: stretch;
  }
}

.tg-review {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.tg-review > .aismis-card + .aismis-card {
  margin-top: 0;
}

.tg-review:not(:has(.tg-conflicts)) {
  grid-template-columns: minmax(16rem, 22rem);
}

.tg-score-total {
  margin: 0;
  font-size: 2rem;
  font-weight: 650;
  line-height: 1.1;
  color: var(--aismis-text, #1a2332);
}

.tg-score-total.is-clear {
  font-size: 1.5rem;
  color: var(--aismis-portal-accent, #155e75);
}

.tg-score-unit {
  font-size: 1rem;
  font-weight: 650;
  color: var(--aismis-muted, #5c6b7f);
}

.tg-score-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.tg-score-list button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.65rem;
  font: inherit;
  font-weight: 400;
  text-align: left;
  color: var(--aismis-text, #1a2332);
  background: var(--aismis-surface);
  border: 1px solid color-mix(in srgb, var(--aismis-border) 45%, var(--aismis-muted));
  cursor: pointer;
}

.tg-score-list button:focus-visible,
.tg-score-clear:focus-visible {
  outline: 2px solid var(--aismis-portal-accent);
  outline-offset: 2px;
}

.tg-score-list button[aria-pressed="true"] {
  font-weight: 650;
  background: color-mix(in srgb, var(--aismis-portal-accent, #155e75) 14%, #fff);
  box-shadow: inset 0 0 0 2px var(--aismis-portal-accent);
}

.tg-score-count {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.tg-score-clear {
  margin-top: 0.75rem;
}

@media (max-width: 719px) {
  .tg-review,
  .tg-review:not(:has(.tg-conflicts)) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tg-plan {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tg-plan-store {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tg-plan-status:not([hidden]) {
  margin: 0;
}

.tg-plan-scene-wrap,
.tg-plan-work,
.tg-plan-inspector,
.tg-plan-sizes,
.tg-plan-class-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tg-plan-scene-tools,
.tg-plan-tools,
.tg-plan-tabs,
.tg-plan-floorbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tg-plan-scene-tools button,
.tg-plan-walk button,
.tg-plan-tools button,
.tg-plan-tab {
  margin: 0;
  padding: 0.35rem 0.75rem;
  font: inherit;
  color: var(--aismis-text, #1a2332);
  background: var(--aismis-surface, #fff);
  border: 1px solid color-mix(in srgb, var(--aismis-border) 45%, var(--aismis-muted));
  cursor: pointer;
}

.tg-plan-floor-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tg-plan-scene-tools button.tg-plan-floor-switch {
  color: var(--aismis-muted, #5c6b7f);
}

.tg-plan-scene-tools button.tg-plan-floor-switch[aria-checked="true"] {
  font-weight: 650;
  color: var(--aismis-portal-accent, #155e75);
  background: color-mix(in srgb, var(--aismis-portal-accent, #155e75) 14%, #fff);
  box-shadow: inset 0 0 0 2px var(--aismis-portal-accent);
}

.tg-plan-scene-tools button[aria-pressed="true"],
.tg-plan-walk button[aria-pressed="true"],
.tg-plan-tools button[aria-pressed="true"],
.tg-plan-tab[aria-selected="true"] {
  font-weight: 650;
  color: var(--aismis-portal-accent, #155e75);
  background: color-mix(in srgb, var(--aismis-portal-accent, #155e75) 14%, #fff);
  box-shadow: inset 0 0 0 2px var(--aismis-portal-accent);
}

.tg-plan-scene-tools button:focus-visible,
.tg-plan-walk button:focus-visible,
.tg-plan-walk select:focus-visible,
.tg-plan-floor-switch:focus-visible,
.tg-plan-tools button:focus-visible,
.tg-plan-tab:focus-visible,
.tg-plan-stage:focus-visible,
.tg-plan-scene:focus-visible {
  outline: 2px solid var(--aismis-portal-accent);
  outline-offset: 2px;
}

.tg-plan-walk {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tg-plan-walk[hidden] {
  display: none;
}

.tg-plan-walk label,
.tg-plan-walk-side {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0;
  color: var(--aismis-muted, #5c6b7f);
}

.tg-plan-walk select {
  font: inherit;
  color: var(--aismis-text, #1a2332);
  background: var(--aismis-surface, #fff);
  border: 1px solid color-mix(in srgb, var(--aismis-border) 45%, var(--aismis-muted));
  padding: 0.35rem 0.5rem;
}

.tg-plan-scene {
  display: block;
  width: 100%;
  height: 28rem;
  background: var(--aismis-surface, #fff);
  border: 1px solid var(--aismis-border);
  touch-action: none;
  cursor: grab;
}

.tg-plan-legend {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tg-plan-legend li {
  padding: 0.35rem 0.65rem;
  background: var(--aismis-surface, #fff);
  border: 1px solid color-mix(in srgb, var(--aismis-border) 45%, var(--aismis-muted));
}

.tg-plan-legend li.is-busiest,
.tg-plan-legend li.is-crowded {
  font-weight: 650;
  color: #9a3412;
  box-shadow: inset 3px 0 0 #9a3412;
}

.tg-plan-speed input[type="range"],
.tg-plan-pupil input[type="range"] {
  width: 8rem;
  accent-color: var(--aismis-portal-accent, #155e75);
}

/* On Plan the unsaved line keeps its height, shown or not, so the controls and the picture stay still. */
body:has(.tg-plan-scene) .tg-unsaved-slot {
  position: relative;
  height: 3.25rem;
  margin: 0 0 1rem;
}

body:has(.tg-plan-scene) .tg-unsaved-slot > [data-unsaved-warning] {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  margin: 0;
  overflow: hidden;
}

.tg-plan-work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: 1rem;
  align-items: start;
}

.tg-plan-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: auto;
  scrollbar-gutter: stable;
  background:
    linear-gradient(to right, color-mix(in srgb, var(--aismis-border) 65%, transparent) 1px, transparent 1px) 0 0 / 2rem 2rem,
    linear-gradient(to bottom, color-mix(in srgb, var(--aismis-border) 65%, transparent) 1px, transparent 1px) 0 0 / 2rem 2rem,
    #f4f1ea;
  border: 1px solid var(--aismis-border);
  touch-action: none;
}

.tg-plan-zoom {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.tg-plan-zoom img,
.tg-plan-zoom svg,
.tg-plan-empty {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tg-plan-stage img {
  object-fit: fill;
  pointer-events: none;
}

.tg-plan-empty {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: var(--aismis-muted, #5c6b7f);
  pointer-events: none;
}

.tg-plan-empty[hidden] {
  display: none;
}

.tg-plan-shape {
  stroke: var(--aismis-portal-accent, #155e75);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
  fill-opacity: var(--tg-plan-opacity, 0.5);
}

.tg-plan-shape.is-selected {
  stroke-width: 3px;
}

.tg-plan-shape.is-detached {
  stroke: #b45309;
  stroke-dasharray: 8 5;
  stroke-width: 3px;
}

.tg-plan-gridline {
  stroke: rgba(21, 94, 117, 0.28);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.tg-plan-door {
  fill: #92400e;
  stroke: #1a2332;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.tg-plan-door.is-selected {
  stroke: #155e75;
  stroke-width: 3px;
}

.tg-plan-warn {
  margin: 0;
  color: #9a3412;
  font-size: 0.875rem;
}

.tg-plan-tools .tg-plan-grid,
.tg-plan-tools .tg-plan-grid-size {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: #1a2332;
}

.tg-plan-tools .tg-plan-grid-size input[type="range"] {
  width: 7rem;
  accent-color: #155e75;
}

.tg-plan-label {
  font-family: inherit;
  font-weight: 650;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: var(--aismis-text, #1a2332);
  pointer-events: none;
}

.tg-plan-handle {
  fill: #fff;
  stroke: var(--aismis-portal-accent, #155e75);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}

.tg-plan-inspector label,
.tg-plan-sizes > label,
.tg-plan-class-list label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--aismis-muted, #5c6b7f);
}

.tg-plan-kind {
  margin: 0;
  font-weight: 650;
  color: var(--aismis-text, #1a2332);
}

.tg-plan-inspector label.tg-plan-slider {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.75rem;
  align-items: center;
}

.tg-plan-inspector label.tg-plan-slider input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--aismis-portal-accent, #155e75);
}

.tg-plan-inspector label.tg-plan-check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  color: var(--aismis-text, #1a2332);
}

.tg-plan-inspector input[type="color"] {
  width: 3rem;
  height: 2.25rem;
  padding: 0.15rem;
}

.tg-plan-class-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

@media (max-width: 800px) {
  .tg-plan-work {
    grid-template-columns: minmax(0, 1fr);
  }

  .tg-plan-scene {
    height: 20rem;
  }
}
