.rail-body {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.rail-body .rail-btn {
  white-space: nowrap;
}

.form-inline {
  max-width: 310px;
}

.tool-fields {
  max-width: 780px;
}

.table-scroll {
  overflow: auto;
  margin-top: 14px;
}

.tool-table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 14px;
}

.tool-table td, .tool-table th {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  min-width: 90px;
  white-space: nowrap;
}

.tool-table thead th {
  background: var(--soft);
  font-size: 12px;
  color: var(--green);
}

.tool-table tbody tr:nth-child(even) {
  background: #fafbf7;
}

.tool-table tbody tr:last-child > * {
  border-bottom: 0;
}

.tool-card {
  gap: 4px;
}

.tool-card .meta {
  margin-top: 0;
}

.tools-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.resource-summary {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  margin: 3px 0 0;
}

.plan-period {
  padding: 12px 14px 9px;
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbf7;
}

.plan-period legend {
  padding: 3px 8px;
  border: 1px solid #d4e1cd;
  border-radius: 5px;
  background: #ebf2e5;
  font-size: 13px;
  font-weight: 730;
}

.plan-period > .btn {
  margin-top: 8px;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.report-layout textarea[name="draft"] {
  min-height: 345px;
}

.period-slot {
  align-items: center;
  background: transparent;
  border: 1px dashed #a9bda2;
  border-radius: 7px;
  color: var(--green);
  cursor: pointer;
  display: flex;
  font-weight: 650;
  font-size: 12px;
  gap: 5px;
  overflow-wrap: anywhere;
  padding: 5px 7px;
  text-align: left;
}

.period-slot:hover, .period-slot:focus-visible {
  background: #edf3e7;
  border-style: solid;
}

.period-slot .icon {
  height: 14px;
  width: 14px;
}

.period-assigned {
  align-items: center;
  background: var(--soft);
  border-radius: 8px;
  display: flex;
  font-size: 13px;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 15px;
  padding: 1px 10px;
}

.period-assigned span {
  align-items: center;
  display: flex;
  gap: 8px;
}

.period-assigned .icon {
  height: 16px;
  width: 16px;
}

.lesson-chip time {
  color: var(--green);
  flex: none;
}

.week-cycle {
  margin: 0 0 10px;
  text-align: center;
}

.linked-resources {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.linked-resources li {
  align-items: center;
  background: var(--soft);
  border-radius: 7px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.linked-resources .btn:first-child {
  max-width: 100%;
  text-align: left;
  white-space: normal;
}

.pagination-tools {
  justify-content: flex-end;
  margin-top: 16px;
}

.catalogue-dialog {
  width: min(880px, calc(100% - 26px));
}

.catalogue-content {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.resource-disclosure {
  margin: 6px 0 12px;
}

.resource-disclosure summary {
  font-weight: 690;
  cursor: pointer;
}

.resource-disclosure p {
  margin-top: 8px;
}

.surface h4 {
  font-size: 13px;
  margin: 12px 0 5px;
}

@media (max-width: 960px) {
  .report-layout {
    grid-template-columns: 1fr;
  }

  .report-layout textarea[name="draft"] {
    min-height: 225px;
  }
}

@media (max-width: 580px) {
  .rail-body {
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  .rail-body .rail-btn {
    flex: none;
  }

  .tools-filters {
    grid-template-columns: 1fr;
  }

  .catalogue-dialog {
    padding: 14px;
  }
}

@media print {
  body:has(#print-sheet) dialog {
    display: none;
  }

  #print-sheet {
    margin: 10mm;
    font-size: 11pt;
    line-height: 1.5;
  }

  #print-sheet h1 {
    margin-bottom: 8mm;
    font-size: 24pt;
  }

  #print-sheet h2, #print-sheet h3, #print-sheet h4, #print-sheet h5 {
    break-after: avoid;
    margin: 3mm 0 1mm;
  }

  #print-sheet p {
    margin: 1mm 0 2.5mm;
    white-space: pre-wrap;
  }

  #print-sheet .meta {
    font-size: 10pt;
    color: #394339;
  }

}
