/**
 * BS Ried SuS – Verwaltungs-Erweiterung 2.1.0
 */

.bsr-ext-admin-shell {
  max-width: 1460px;
  padding-top: 24px;
}

.bsr-ext-admin-page .bsr-footer {
  justify-content: center;
  max-width: 1410px;
}

.bsr-ext-admin-page .bsr-admin-card h2,
.bsr-ext-subpage-shell .bsr-admin-card h2 {
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 0;
}

.bsr-ext-create-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bsr-ext-create-grid .bsr-admin-card {
  min-height: 100%;
}

.bsr-ext-subject-form {
  align-items: end;
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(140px, .7fr) minmax(180px, 1fr) auto;
}

.bsr-ext-subject-form label,
.bsr-ext-class-filter label {
  color: var(--bsr-ink);
  display: grid;
  font-size: .72rem;
  font-weight: 730;
  gap: 5px;
}

.bsr-ext-subject-form input,
.bsr-ext-subject-form select,
.bsr-ext-class-filter select,
.bsr-ext-link-field input {
  background: #fffdf9;
  border: 1.5px solid #dcd1c5;
  border-radius: 9px;
  color: var(--bsr-ink);
  font: inherit;
  font-size: .73rem;
  min-height: 36px;
  outline: none;
  padding: 0 10px;
  width: 100%;
}

.bsr-ext-subject-form input:focus,
.bsr-ext-subject-form select:focus,
.bsr-ext-class-filter select:focus,
.bsr-ext-link-field input:focus {
  border-color: var(--bsr-orange);
  box-shadow: 0 0 0 3px rgba(245, 106, 0, .1);
}

.bsr-ext-class-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.bsr-ext-class-chip {
  align-items: center;
  background: #fff7ed;
  border: 1px solid #ecd9c6;
  border-radius: 999px;
  display: inline-flex;
  font-size: .68rem;
  font-weight: 700;
  gap: 5px;
  padding: 4px 5px 4px 9px;
}

.bsr-ext-class-chip button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: #b23a22;
  cursor: pointer;
  display: inline-flex;
  font-size: .95rem;
  height: 20px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 20px;
}

.bsr-ext-class-chip button:hover {
  background: #ffe3dc;
}

.bsr-ext-definitions-card {
  margin-top: 12px;
  overflow: hidden;
}

.bsr-ext-definitions-card .bsr-card-lead {
  margin-bottom: 13px;
}

.bsr-ext-definition-table {
  border: 1px solid var(--bsr-line);
  border-radius: 12px;
  overflow: hidden;
}

.bsr-ext-definition-head,
.bsr-ext-definition-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(70px, .65fr) minmax(90px, .85fr) minmax(105px, .75fr) minmax(190px, 1.55fr) minmax(190px, 1.55fr) minmax(76px, auto) minmax(54px, auto);
}

.bsr-ext-definition-head {
  background: #f4ece2;
  color: var(--bsr-muted);
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .045em;
  padding: 8px 10px;
  text-transform: uppercase;
}

.bsr-ext-definition-head > span:last-child {
  grid-column: 6 / 8;
}

.bsr-ext-definition-row {
  background: #fff;
  border-top: 1px solid var(--bsr-line);
  padding: 8px 10px;
}

.bsr-ext-definition-row:nth-child(odd) {
  background: #fffdfa;
}

.bsr-ext-definition-row:first-of-type {
  border-top: 0;
}

.bsr-ext-row-save {
  display: contents;
}

.bsr-ext-static-field {
  min-width: 0;
}

.bsr-ext-static-field strong {
  display: block;
  font-size: .7rem;
  overflow-wrap: anywhere;
}

.bsr-ext-field-label {
  display: none;
}

.bsr-ext-release-field,
.bsr-ext-link-field {
  display: block;
  margin: 0;
  min-width: 0;
}

.bsr-ext-toggle {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
}

.bsr-ext-toggle input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.bsr-ext-toggle > span {
  background: #c8c2bb;
  border-radius: 999px;
  display: inline-block;
  height: 20px;
  position: relative;
  transition: background .18s ease;
  width: 36px;
}

.bsr-ext-toggle > span::after {
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(30, 26, 22, .25);
  content: "";
  height: 16px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: transform .18s ease;
  width: 16px;
}

.bsr-ext-toggle input:checked + span {
  background: var(--bsr-orange);
}

.bsr-ext-toggle input:checked + span::after {
  transform: translateX(16px);
}

.bsr-ext-toggle input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(245, 106, 0, .2);
}

.bsr-ext-toggle em {
  color: var(--bsr-muted);
  font-size: .63rem;
  font-style: normal;
  font-weight: 700;
}

.bsr-ext-save-button {
  min-height: 34px;
  padding-inline: 10px;
}

.bsr-ext-delete-form {
  display: flex;
  justify-content: flex-end;
}

.bsr-ext-delete-form .bsr-text-button {
  min-height: 30px;
}

.bsr-ext-user-card {
  margin-top: 12px;
}

.bsr-ext-user-heading {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.bsr-ext-user-heading > div {
  max-width: 720px;
}

.bsr-ext-class-filter {
  align-items: end;
  display: grid;
  flex: 0 0 min(100%, 370px);
  gap: 7px;
  grid-template-columns: minmax(150px, 1fr) auto;
}

.bsr-ext-class-filter label {
  grid-column: 1 / -1;
}

.bsr-ext-class-filter .bsr-button {
  min-height: 36px;
}

.bsr-ext-user-list {
  border: 1px solid var(--bsr-line);
  border-radius: 12px;
  margin-top: 14px;
  overflow-x: auto;
}

.bsr-ext-user-row {
  align-items: center;
  background: #fff;
  border-top: 1px solid var(--bsr-line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(170px, 1fr) minmax(70px, auto) minmax(240px, auto) minmax(260px, 2fr) auto;
  min-width: max-content;
  padding: 9px 11px;
}

.bsr-ext-user-row:first-child {
  border-top: 0;
}

.bsr-ext-user-row:nth-child(even) {
  background: #fffdfa;
}

.bsr-ext-user-identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bsr-ext-user-identity strong {
  font-size: .72rem;
}

.bsr-ext-user-identity span,
.bsr-ext-user-class {
  color: var(--bsr-muted);
  font-size: .64rem;
  overflow-wrap: anywhere;
}

.bsr-ext-user-class {
  background: #fff2e4;
  border-radius: 999px;
  color: #8d4a13;
  font-weight: 750;
  justify-self: start;
  padding: 4px 8px;
}

.bsr-ext-role-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.bsr-ext-role-check {
  align-items: center;
  background: #fffaf3;
  border: 1px solid #dfd3c6;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-size: .66rem;
  font-weight: 700;
  gap: 6px;
  min-height: 32px;
  padding: 5px 8px;
}

.bsr-ext-role-check:has(input:checked) {
  background: #fff0e3;
  border-color: var(--bsr-orange);
  color: #9b4200;
}

.bsr-ext-role-check input {
  accent-color: var(--bsr-orange);
  height: 15px;
  margin: 0;
  width: 15px;
}

.bsr-ext-user-row > .bsr-button {
  min-height: 34px;
}

.bsr-ext-access-list {
  align-items: stretch;
  display: flex;
  gap: 7px;
  min-width: 0;
}

.bsr-ext-access-item {
  align-items: center;
  background: #fff;
  border: 1px solid #e8ddd2;
  border-radius: 8px;
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  margin: 0;
  min-width: 185px;
  padding: 5px 8px 6px;
}

.bsr-ext-access-item.is-unavailable {
  background: #f7f4f0;
}

.bsr-ext-access-item legend {
  color: var(--bsr-muted);
  font-size: .59rem;
  font-weight: 700;
  max-width: 165px;
  overflow: hidden;
  padding: 0 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bsr-ext-access-item legend strong {
  color: var(--bsr-ink);
}

.bsr-ext-access-check {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  font-size: .64rem;
  font-weight: 680;
  gap: 6px;
}

.bsr-ext-access-check input {
  accent-color: var(--bsr-orange);
  height: 15px;
  margin: 0;
  width: 15px;
}

.bsr-ext-access-check.is-disabled {
  color: #9f9790;
  cursor: not-allowed;
}

.bsr-ext-access-check.is-pending {
  color: #8c5b2d;
}

@media (max-width: 1100px) {
  .bsr-ext-definition-head {
    display: none;
  }

  .bsr-ext-definition-table {
    background: transparent;
    border: 0;
    display: grid;
    gap: 9px;
    overflow: visible;
  }

  .bsr-ext-definition-row {
    border: 1px solid var(--bsr-line);
    border-radius: 11px;
    display: grid;
    gap: 9px;
    grid-template-columns: 1fr auto;
    padding: 11px;
  }

  .bsr-ext-row-save {
    display: grid;
    gap: 9px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bsr-ext-link-field {
    grid-column: 1 / -1;
  }

  .bsr-ext-field-label {
    color: var(--bsr-muted);
    display: block;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .035em;
    margin-bottom: 4px;
    text-transform: uppercase;
  }

  .bsr-ext-save-button {
    justify-self: start;
  }

  .bsr-ext-delete-form {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 820px) {
  .bsr-ext-create-grid {
    grid-template-columns: 1fr;
  }

  .bsr-ext-user-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .bsr-ext-class-filter {
    flex-basis: auto;
  }

  .bsr-ext-user-row {
    grid-template-columns: minmax(170px, 1fr) minmax(70px, auto) minmax(240px, auto) minmax(260px, 2fr) auto;
  }

  .bsr-ext-role-checks {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .bsr-ext-admin-shell {
    padding-top: 20px;
  }

  .bsr-ext-subject-form,
  .bsr-ext-class-filter,
  .bsr-ext-row-save {
    grid-template-columns: 1fr;
  }

  .bsr-ext-subject-form .bsr-button,
  .bsr-ext-class-filter .bsr-button,
  .bsr-ext-save-button {
    width: 100%;
  }

  .bsr-ext-definition-row {
    grid-template-columns: 1fr;
  }

  .bsr-ext-delete-form {
    grid-column: 1;
    grid-row: auto;
    justify-content: stretch;
  }

  .bsr-ext-delete-form .bsr-text-button {
    width: 100%;
  }

  .bsr-ext-user-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .bsr-ext-user-class {
    grid-column: 1;
  }

  .bsr-ext-role-checks {
    display: grid;
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .bsr-ext-role-check {
    min-height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bsr-ext-toggle > span,
  .bsr-ext-toggle > span::after {
    transition: none;
  }
}

/* Verwaltungsübersicht – Version 2.4 */
.bsr-ext-graph-summary {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin-bottom: 12px;
  padding-block: 15px;
}

.bsr-ext-graph-summary h2,
.bsr-ext-graph-summary .bsr-kicker {
  margin-bottom: 0;
}

.bsr-ext-subpage-intro .bsr-button {
  margin-top: 10px;
}

.bsr-ext-create-grid .bsr-admin-card {
  padding-block: 15px;
}

.bsr-ext-create-grid h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.bsr-ext-master-card,
.bsr-ext-user-card {
  margin-top: 12px;
}

.bsr-ext-section-heading,
.bsr-ext-list-tools,
.bsr-ext-user-tools {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.bsr-ext-search,
.bsr-ext-list-tools > label {
  color: var(--bsr-ink);
  display: grid;
  font-size: .64rem;
  font-weight: 750;
  gap: 4px;
}

.bsr-ext-search input,
.bsr-ext-list-tools select,
.bsr-ext-rename-form input {
  background: #fffdf9;
  border: 1.5px solid #dcd1c5;
  border-radius: 9px;
  color: var(--bsr-ink);
  font: inherit;
  font-size: .7rem;
  min-height: 34px;
  outline: none;
  padding: 0 9px;
}

.bsr-ext-search input {
  min-width: min(280px, 70vw);
}

.bsr-ext-table {
  border: 1px solid var(--bsr-line);
  border-radius: 11px;
  margin-top: 12px;
  overflow: hidden;
}

.bsr-ext-table-head,
.bsr-ext-table-row {
  align-items: center;
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(100px, .6fr) minmax(130px, .8fr) minmax(360px, 1.8fr);
  padding: 7px 10px;
}

.bsr-ext-table-head {
  background: #f4ece2;
}

.bsr-ext-table-head button,
.bsr-ext-table-head span {
  background: transparent;
  border: 0;
  color: var(--bsr-muted);
  font: inherit;
  font-size: .61rem;
  font-weight: 800;
  padding: 0;
  text-align: left;
  text-transform: uppercase;
}

.bsr-ext-table-head button { cursor: pointer; }

.bsr-ext-table-row {
  background: #fff;
  border-top: 1px solid var(--bsr-line);
  font-size: .69rem;
}

.bsr-ext-table-row[hidden],
.bsr-ext-definition-item[hidden],
.bsr-ext-user-row[hidden] { display: none !important; }

.bsr-ext-table-actions,
.bsr-ext-rename-form {
  align-items: center;
  display: flex;
  gap: 6px;
}

.bsr-ext-table-actions > form { margin: 0; }
.bsr-ext-rename-form { flex: 1; }
.bsr-ext-rename-form input { flex: 1; min-width: 100px; }

.bsr-ext-definition-cards {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
}

.bsr-ext-list-tools {
  background: #fffaf4;
  border: 1px solid #eadfd2;
  border-radius: 10px;
  margin-bottom: 9px;
  padding: 8px;
  justify-content: flex-start;
}

.bsr-ext-definition-item {
  padding: 0;
}

.bsr-ext-definition-title {
  align-items: center;
  cursor: pointer;
  grid-template-columns: minmax(0, 1fr) auto auto;
  list-style: none;
  min-height: 48px;
  padding: 8px 10px;
}

.bsr-ext-definition-title::-webkit-details-marker { display: none; }

.bsr-ext-edit-hint {
  color: var(--bsr-orange) !important;
  font-size: .62rem !important;
  font-weight: 760 !important;
}

.bsr-ext-definition-editor {
  border-top: 1px solid var(--bsr-line);
  padding: 10px;
}

.bsr-ext-user-tools {
  background: #fffaf4;
  border: 1px solid #eadfd2;
  border-radius: 10px;
  justify-content: flex-start;
  margin-top: 10px;
  padding: 8px;
}

@media (max-width: 820px) {
  .bsr-ext-graph-summary { grid-template-columns: 1fr auto; }
  .bsr-ext-graph-summary .bsr-button { grid-column: 1 / -1; }
  .bsr-ext-table-head { display: none; }
  .bsr-ext-table-row { grid-template-columns: 1fr; }
  .bsr-ext-table-actions { align-items: stretch; flex-direction: column; }
}

@media (max-width: 620px) {
  .bsr-ext-graph-summary { grid-template-columns: 1fr; }
  .bsr-ext-graph-summary .bsr-ext-status { justify-self: start; }
  .bsr-ext-section-heading { align-items: stretch; flex-direction: column; }
  .bsr-ext-search input { min-width: 0; width: 100%; }
  .bsr-ext-list-tools > * { width: 100%; }
  .bsr-ext-rename-form { align-items: stretch; flex-direction: column; }
}

/* Microsoft-365-Verbindung – Version 2.0 */
.bsr-ext-graph-card {
  margin-bottom: 12px;
}

.bsr-ext-graph-heading {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.bsr-ext-graph-heading > div {
  max-width: 850px;
}

.bsr-ext-status {
  align-items: center;
  background: #f4efe9;
  border: 1px solid #ded5cb;
  border-radius: 999px;
  color: #766b61;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: .64rem;
  font-weight: 800;
  gap: 6px;
  padding: 6px 10px;
}

.bsr-ext-status > span {
  background: #aaa199;
  border-radius: 50%;
  height: 7px;
  width: 7px;
}

.bsr-ext-status.is-connected {
  background: #ecf8ef;
  border-color: #baddc2;
  color: #24713a;
}

.bsr-ext-status.is-connected > span {
  background: #35a554;
  box-shadow: 0 0 0 3px rgba(53, 165, 84, .13);
}

.bsr-ext-graph-form {
  align-items: end;
  border-top: 1px solid var(--bsr-line);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
  padding-top: 14px;
}

.bsr-ext-graph-form > label,
.bsr-ext-definition-form > label {
  color: var(--bsr-ink);
  display: grid;
  font-size: .66rem;
  font-weight: 760;
  gap: 5px;
  min-width: 0;
}

.bsr-ext-graph-form > label:nth-of-type(4) {
  grid-column: 1 / -1;
}

.bsr-ext-graph-form input,
.bsr-ext-definition-form input {
  background: #fffdf9;
  border: 1.5px solid #dcd1c5;
  border-radius: 9px;
  color: var(--bsr-ink);
  font: inherit;
  font-size: .72rem;
  min-height: 36px;
  outline: none;
  padding: 0 10px;
  width: 100%;
}

.bsr-ext-graph-form input:focus,
.bsr-ext-definition-form input:focus {
  border-color: var(--bsr-orange);
  box-shadow: 0 0 0 3px rgba(245, 106, 0, .1);
}

.bsr-ext-copy-field {
  display: grid;
  gap: 7px;
  grid-template-columns: 1fr auto;
}

.bsr-ext-copy-field input[readonly] {
  color: var(--bsr-muted);
}

.bsr-ext-graph-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.bsr-ext-graph-actions form {
  margin: 0;
}

.bsr-ext-connected-at,
.bsr-ext-locked-note {
  color: var(--bsr-muted);
  font-size: .63rem;
  margin: 0;
}

.bsr-ext-setup-help {
  background: #fffaf4;
  border: 1px solid #eadfd2;
  border-radius: 10px;
  color: var(--bsr-muted);
  font-size: .67rem;
  line-height: 1.48;
  margin-top: 13px;
  padding: 9px 11px;
}

.bsr-ext-setup-help summary {
  color: var(--bsr-ink);
  cursor: pointer;
  font-weight: 780;
}

.bsr-ext-setup-help ol {
  margin: 9px 0 6px 18px;
  padding: 0;
}

.bsr-ext-setup-help p {
  margin: 6px 0 0;
}

.bsr-ext-definitions-card code,
.bsr-ext-graph-card code {
  background: #f4eee7;
  border-radius: 4px;
  font-size: .9em;
  padding: 1px 4px;
}

/* Definitionen als kompakte Karten */
.bsr-ext-definition-list {
  display: grid;
  gap: 9px;
}

.bsr-ext-definition-item {
  background: #fffdfa;
  border: 1px solid var(--bsr-line);
  border-radius: 12px;
  display: grid;
  gap: 5px;
  padding: 10px;
}

.bsr-ext-definition-form {
  align-items: end;
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(150px, .7fr) minmax(150px, .75fr) minmax(270px, 1.55fr) minmax(175px, .8fr);
}

.bsr-ext-definition-title {
  align-content: center;
  display: grid;
  gap: 1px;
  min-height: 42px;
}

.bsr-ext-definition-title strong {
  font-size: .78rem;
}

.bsr-ext-definition-title > span {
  color: var(--bsr-muted);
  font-size: .65rem;
  font-weight: 700;
}

.bsr-ext-definition-title > em {
  color: #9a6c40;
  font-size: .56rem;
  font-style: normal;
  font-weight: 800;
  margin-top: 2px;
  text-transform: uppercase;
}

.bsr-ext-definition-title > em.is-ready {
  color: #24713a;
}

.bsr-ext-release-field {
  align-self: center;
}

.bsr-ext-path-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.bsr-ext-path-field > label {
  color: var(--bsr-ink);
  cursor: text;
  font-size: .72rem;
  font-weight: 730;
}

.bsr-ext-path-control {
  align-items: stretch;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
  position: relative;
  z-index: 3;
}

.bsriedsus-app .bsr-ext-path-input,
.bsr-ext-admin-page .bsr-ext-path-input {
  appearance: none;
  background: #fff !important;
  border: 1.5px solid #d0c1b2 !important;
  border-radius: 9px !important;
  color: var(--bsr-ink) !important;
  cursor: text !important;
  font: inherit !important;
  font-size: .73rem !important;
  min-height: 36px !important;
  opacity: 1 !important;
  outline: none !important;
  padding: 0 10px !important;
  pointer-events: auto !important;
  position: relative !important;
  user-select: text !important;
  width: 100% !important;
  z-index: 4 !important;
}

.bsriedsus-app .bsr-ext-path-input:focus,
.bsr-ext-admin-page .bsr-ext-path-input:focus {
  border-color: var(--bsr-orange) !important;
  box-shadow: 0 0 0 3px rgba(245, 106, 0, .14) !important;
}

.bsr-ext-path-edit {
  min-height: 36px;
  padding-inline: 10px;
  white-space: nowrap;
}

.bsr-ext-path-field small,
.bsr-ext-pdf-field small,
.bsr-ext-grade-field small,
.bsr-ext-grade-path-field small {
  color: var(--bsr-muted);
  font-size: .57rem;
  font-weight: 520;
  line-height: 1.35;
}

.bsr-ext-saved-path {
  color: #9b6b3d;
  display: block;
  font-size: .58rem;
  font-weight: 720;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.bsr-ext-saved-path.is-saved {
  color: #24713a;
}

.bsr-ext-saved-path code {
  color: inherit;
  font-size: inherit;
}

.bsr-ext-path-field small code {
  overflow-wrap: anywhere;
}

.bsr-ext-grade-field {
  grid-column: 1 / 4;
}

.bsr-ext-grade-release-field {
  align-self: center;
  grid-column: 1;
}

.bsr-ext-saved-release {
  color: #9b6b3d;
  display: block;
  font-size: .56rem;
  font-weight: 720;
  line-height: 1.35;
  margin-top: 4px;
}

.bsr-ext-saved-release.is-saved {
  color: #24713a;
}

.bsr-ext-grade-path-field {
  grid-column: 2 / 5;
}

.bsr-ext-row-actions {
  align-items: center;
  display: flex;
  gap: 7px;
  grid-column: 4;
  justify-content: flex-end;
}

.bsr-ext-legacy-note {
  background: #fff4df;
  border-radius: 8px;
  color: #7d571e;
  font-size: .61rem;
  grid-column: 1 / -1;
  line-height: 1.4;
  margin: 0;
  padding: 7px 9px;
}

.bsr-ext-definition-item > .bsr-ext-delete-form {
  border-top: 1px dashed #eadfd3;
  justify-content: flex-start;
  margin-top: 3px;
  padding-top: 5px;
}

/* Schüleransicht der PDF-Ressourcen */
.bsr-ext-lep-shell {
  min-height: 0 !important;
  padding-top: 0 !important;
}

.bsr-ext-lep-shell .bsr-learning-intro h2 {
  font-size: clamp(1.05rem, 1.55vw, 1.35rem);
  letter-spacing: -.035em;
  line-height: 1.08;
  margin: 0;
}

.bsr-ext-lep-tile {
  background: linear-gradient(145deg, #fff8ef, #ffead7);
  border-color: #e8c9aa;
}

.bsr-ext-lep-tile .bsr-tile-icon {
  background: #fff;
  color: var(--bsr-orange);
}

/* Startseitenkachel und Auswahl der Auswertungen */
.bsr-ext-results-tile {
  cursor: default;
  gap: 5px;
}

.bsr-ext-results-tile:hover {
  transform: none;
}

.bsr-ext-results-tile .bsr-tile-content p {
  margin-top: 4px;
}

.bsr-ext-results-tile .bsr-tile-content h3 {
  margin-bottom: 3px;
}

.bsr-ext-tile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.bsr-ext-tile-button {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 7px;
  display: inline-flex;
  font-size: .57rem;
  font-weight: 780;
  justify-content: center;
  line-height: 1.2;
  min-height: 26px;
  padding: 5px 8px;
  text-align: center;
}

.bsr-ext-tile-button.is-active {
  background: #fff;
  color: #c94f00 !important;
}

.bsr-ext-tile-button.is-active:hover,
.bsr-ext-tile-button.is-active:focus-visible {
  background: #fff7ef;
  color: #9f3f00 !important;
}

.bsr-ext-tile-button.is-disabled {
  background: rgba(117, 51, 7, .18);
  border-color: rgba(255, 255, 255, .26);
  color: rgba(255, 255, 255, .62) !important;
  cursor: not-allowed;
}

.bsr-ext-results-panel {
  align-items: start;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.bsr-ext-results-content {
  min-width: 0;
}

.bsr-ext-results-content > p:not(.bsr-kicker) {
  color: var(--bsr-muted);
  font-size: .72rem;
  line-height: 1.45;
  margin: 6px 0 0;
}

.bsr-ext-results-form {
  align-items: end;
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(2, minmax(170px, 1fr)) auto;
  margin-top: 13px;
}

.bsr-ext-results-form label {
  color: var(--bsr-ink);
  display: grid;
  font-size: .65rem;
  font-weight: 750;
  gap: 5px;
}

.bsr-ext-results-form select {
  background: #fffdf9;
  border: 1.5px solid #d9cdbf;
  border-radius: 9px;
  color: var(--bsr-ink);
  font: inherit;
  font-size: .71rem;
  min-height: 36px;
  outline: none;
  padding: 0 9px;
  width: 100%;
}

.bsr-ext-results-form select:focus {
  border-color: var(--bsr-orange);
  box-shadow: 0 0 0 3px rgba(245, 106, 0, .1);
}

.bsr-ext-results-open {
  min-height: 36px;
  white-space: nowrap;
}

.bsr-ext-results-open[aria-disabled="true"] {
  opacity: .46;
  pointer-events: none;
}

.bsr-ext-results-empty {
  background: #fff7ed;
  border: 1px solid #ead6c0;
  border-radius: 9px;
  padding: 8px 10px;
}

@media (max-width: 1180px) {
  .bsr-ext-definition-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bsr-ext-path-field,
  .bsr-ext-grade-field,
  .bsr-ext-grade-path-field {
    grid-column: 1 / -1;
  }

  .bsr-ext-grade-release-field {
    grid-column: 1;
  }

  .bsr-ext-row-actions {
    grid-column: 2;
  }
}

@media (max-width: 820px) {
  .bsr-ext-graph-form {
    grid-template-columns: 1fr;
  }

  .bsr-ext-graph-form > label:nth-of-type(4) {
    grid-column: 1;
  }

  .bsr-ext-results-panel {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .bsr-ext-results-form {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .bsr-ext-results-close {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .bsr-ext-graph-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .bsr-ext-status {
    align-self: flex-start;
  }

  .bsr-ext-copy-field,
  .bsr-ext-definition-form {
    grid-template-columns: 1fr;
  }

  .bsr-ext-path-control {
    grid-template-columns: 1fr;
  }

  .bsr-ext-copy-field .bsr-button,
  .bsr-ext-graph-form > .bsr-button,
  .bsr-ext-graph-actions .bsr-button {
    width: 100%;
  }

  .bsr-ext-graph-actions,
  .bsr-ext-graph-actions form {
    align-items: stretch;
    display: grid;
    width: 100%;
  }

  .bsr-ext-path-field,
  .bsr-ext-grade-field,
  .bsr-ext-grade-path-field,
  .bsr-ext-grade-release-field,
  .bsr-ext-row-actions,
  .bsr-ext-legacy-note {
    grid-column: 1;
  }

  .bsr-ext-row-actions {
    align-items: stretch;
    display: grid;
  }

  .bsr-ext-row-actions .bsr-button {
    width: 100%;
  }

  .bsr-ext-access-item {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .bsr-ext-access-item small {
    grid-column: 1;
  }

  .bsr-ext-tile-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .bsr-ext-results-panel {
    grid-template-columns: 1fr;
  }

  .bsr-ext-results-panel .bsr-area-icon {
    display: none;
  }
}

/* Getrennte Lehrstoff- und Notendefinitionen – Version 2.3 */
.bsr-ext-definition-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.bsr-ext-definition-cards .bsr-ext-definitions-card {
  margin-top: 0;
  min-width: 0;
}

.bsr-ext-definition-card-heading {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.bsr-ext-definition-card-heading h2 {
  margin-bottom: 0;
}

.bsr-ext-definition-counts {
  align-items: flex-end;
  display: grid;
  flex: 0 0 auto;
  gap: 3px;
  justify-items: end;
}

.bsr-ext-definition-counts strong,
.bsr-ext-definition-counts em {
  border-radius: 999px;
  font-size: .57rem;
  font-style: normal;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

.bsr-ext-definition-counts strong {
  background: #f4eee7;
  color: #766b61;
}

.bsr-ext-definition-counts em {
  background: #ecf8ef;
  color: #24713a;
}

.bsr-ext-definition-cards .bsr-ext-definition-item {
  gap: 8px;
  padding: 10px;
}

.bsr-ext-definition-cards .bsr-ext-definition-item.is-released {
  border-color: #baddc2;
  box-shadow: inset 3px 0 0 #35a554;
}

.bsr-ext-definition-cards .bsr-ext-definition-title {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 0;
}

.bsr-ext-definition-cards .bsr-ext-definition-title > span {
  color: var(--bsr-ink);
  font-size: .7rem;
}

.bsr-ext-definition-cards .bsr-ext-definition-title > span strong {
  display: inline;
  font-size: .75rem;
}

.bsr-ext-definition-cards .bsr-ext-definition-title > em {
  background: #fff3e6;
  border-radius: 999px;
  flex: 0 0 auto;
  margin: 0;
  padding: 4px 7px;
}

.bsr-ext-definition-cards .bsr-ext-definition-title > em.is-ready {
  background: #ecf8ef;
}

.bsr-ext-definition-cards .bsr-ext-definition-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(145px, .62fr) minmax(0, 1.7fr);
}

.bsr-ext-definition-cards .bsr-ext-release-field {
  align-self: start;
  grid-column: 1;
}

.bsr-ext-definition-cards .bsr-ext-path-field {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.bsr-ext-definition-cards .bsr-ext-pdf-field {
  grid-column: 2;
}

.bsr-ext-definition-cards .bsr-ext-sheet-field {
  grid-column: 2;
}

.bsr-ext-sheet-field small {
  color: var(--bsr-muted);
  display: block;
  font-size: .58rem;
  margin-top: 3px;
}

.bsr-ext-definition-cards .bsr-ext-row-actions {
  align-items: stretch;
  grid-column: 1;
  justify-content: flex-start;
}

.bsr-ext-definition-cards .bsr-ext-delete-form {
  border-top: 1px dashed #eadfd3;
  justify-content: flex-end;
  margin: 0;
  padding-top: 7px;
}

.bsr-ext-definition-cards .bsr-ext-delete-form .bsr-button {
  color: #a73825;
  min-height: 31px;
  padding: 5px 10px;
}

.bsr-ext-definition-cards .bsr-ext-delete-form .bsr-button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

@media (max-width: 1180px) {
  .bsr-ext-definition-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .bsr-ext-definition-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .bsr-ext-definition-counts {
    align-items: center;
    display: flex;
    justify-items: start;
  }

  .bsr-ext-definition-cards .bsr-ext-definition-form {
    grid-template-columns: 1fr;
  }

  .bsr-ext-definition-cards .bsr-ext-release-field,
  .bsr-ext-definition-cards .bsr-ext-path-field,
  .bsr-ext-definition-cards .bsr-ext-pdf-field,
  .bsr-ext-definition-cards .bsr-ext-sheet-field,
  .bsr-ext-definition-cards .bsr-ext-row-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .bsr-ext-definition-cards .bsr-ext-row-actions,
  .bsr-ext-definition-cards .bsr-ext-delete-form {
    display: grid;
    justify-content: stretch;
  }
}
.bsr-ext-diagnostic-card {
    border-color: #efb38d;
    background: #fffaf6;
}

.bsr-ext-diagnostic-list {
    display: grid;
    gap: 8px;
    margin: 14px 0 0;
}

.bsr-ext-diagnostic-list > div {
    display: grid;
    grid-template-columns: minmax(130px, 0.32fr) 1fr;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.78);
}

.bsr-ext-diagnostic-list dt {
    font-weight: 750;
    color: #74452c;
}

.bsr-ext-diagnostic-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #3c3029;
}

@media (max-width: 640px) {
    .bsr-ext-diagnostic-list > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* Abschließende Priorität für die einspaltige, einklappbare Verwaltung. */
.bsr-ext-definition-cards {
    grid-template-columns: 1fr;
}

.bsr-ext-definition-cards .bsr-ext-definition-item {
    padding: 0;
}

.bsr-ext-definition-cards .bsr-ext-definition-title {
    cursor: pointer;
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 48px;
    padding: 8px 10px;
}

.bsr-ext-definition-cards .bsr-ext-definition-editor {
    border-top: 1px solid var(--bsr-line);
    padding: 10px;
}

/* OneDrive-Dateiauswahl – Version 2.7 */
.bsr-ext-path-control {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.bsr-ext-path-check-status {
  display: block;
  min-height: 1em;
  color: var(--bsr-muted);
  font-size: .58rem;
  font-weight: 650;
  line-height: 1.35;
}

.bsr-ext-path-check-status.is-working {
  color: #8a5a25;
}

.bsr-ext-path-check-status.is-success {
  color: #24713a;
}

.bsr-ext-path-check-status.is-error {
  color: #a73825;
}

html.bsr-onedrive-modal-open {
  overflow: hidden;
}

.bsr-onedrive-picker[hidden] {
  display: none !important;
}

.bsr-onedrive-picker {
  inset: 0;
  position: fixed;
  z-index: 100000;
}

.bsr-onedrive-picker-backdrop {
  background: rgba(24, 20, 17, .5);
  inset: 0;
  position: absolute;
}

.bsr-onedrive-picker-dialog {
  background: #fffdf9;
  border: 1px solid #dfd1c3;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(32, 25, 20, .28);
  display: grid;
  grid-template-rows: auto auto auto minmax(220px, 1fr) auto;
  left: 50%;
  max-height: min(82vh, 760px);
  max-width: min(920px, calc(100vw - 32px));
  min-height: min(620px, calc(100vh - 40px));
  overflow: hidden;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.bsr-onedrive-picker-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--bsr-line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 18px 13px;
}

.bsr-onedrive-picker-header h2 {
  font-size: 1.08rem !important;
  margin: 2px 0 0 !important;
}

.bsr-onedrive-picker-header .bsr-kicker {
  margin: 0;
}

.bsr-onedrive-picker-close {
  align-items: center;
  background: #fff;
  border: 1px solid #dbcbbd;
  border-radius: 50%;
  color: #6d5f53;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font: inherit;
  font-size: 1.25rem;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 34px;
}

.bsr-onedrive-picker-close:hover,
.bsr-onedrive-picker-close:focus-visible {
  border-color: var(--bsr-orange);
  color: var(--bsr-orange);
  outline: none;
}

.bsr-onedrive-breadcrumb {
  align-items: center;
  background: #fff8f0;
  border-bottom: 1px solid #eadfd2;
  display: flex;
  gap: 5px;
  min-height: 42px;
  overflow-x: auto;
  padding: 7px 14px;
  white-space: nowrap;
}

.bsr-onedrive-breadcrumb button {
  background: transparent;
  border: 0;
  color: #5a4b40;
  cursor: pointer;
  font: inherit;
  font-size: .68rem;
  font-weight: 740;
  padding: 4px 3px;
}

.bsr-onedrive-breadcrumb button:hover,
.bsr-onedrive-breadcrumb button:focus-visible {
  color: var(--bsr-orange);
  outline: none;
  text-decoration: underline;
}

.bsr-onedrive-breadcrumb span {
  color: #a18f80;
  font-size: .8rem;
}

.bsr-onedrive-picker-status {
  color: var(--bsr-muted);
  font-size: .62rem;
  line-height: 1.4;
  margin: 0;
  min-height: 28px;
  padding: 7px 16px 5px;
}

.bsr-onedrive-picker-status.is-success {
  color: #24713a;
}

.bsr-onedrive-picker-status.is-error {
  color: #a73825;
  font-weight: 720;
}

.bsr-onedrive-list {
  background: #fff;
  border-bottom: 1px solid var(--bsr-line);
  border-top: 1px solid #f1e8df;
  min-height: 220px;
  overflow: auto;
  padding: 5px 0;
}

.bsr-onedrive-row {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #f0e8df;
  color: var(--bsr-ink);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 10px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  min-height: 52px;
  padding: 8px 16px;
  text-align: left;
  width: 100%;
}

.bsr-onedrive-row:last-child {
  border-bottom: 0;
}

.bsr-onedrive-row:hover,
.bsr-onedrive-row:focus-visible {
  background: #fff8f0;
  outline: none;
}

.bsr-onedrive-row.is-selected {
  background: #edf6ff;
  box-shadow: inset 3px 0 0 #2d7dba;
}

.bsr-onedrive-icon {
  align-items: center;
  background: #fff4e8;
  border-radius: 8px;
  color: #c95500;
  display: inline-flex;
  font-size: 1rem;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.bsr-onedrive-row[data-onedrive-item-type="file"] .bsr-onedrive-icon {
  background: #eaf6ed;
  color: #24713a;
  font-weight: 900;
}

.bsr-onedrive-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bsr-onedrive-main strong {
  font-size: .72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bsr-onedrive-meta {
  color: var(--bsr-muted);
  font-size: .59rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bsr-onedrive-row-action {
  color: var(--bsr-orange);
  font-size: .61rem;
  font-weight: 780;
  white-space: nowrap;
}

.bsr-onedrive-loading,
.bsr-onedrive-empty {
  color: var(--bsr-muted);
  font-size: .7rem;
  line-height: 1.5;
  padding: 28px 18px;
  text-align: center;
}

.bsr-onedrive-picker-footer {
  align-items: center;
  background: #fffaf4;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 11px 14px;
}

.bsr-onedrive-selected {
  color: #5c5046;
  font-size: .61rem;
  font-weight: 680;
  max-width: 62%;
  overflow-wrap: anywhere;
}

.bsr-onedrive-picker-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.bsr-onedrive-picker-actions .bsr-button[disabled] {
  cursor: not-allowed;
  opacity: .45;
}

@media (max-width: 1120px) {
  .bsr-ext-path-control {
    grid-template-columns: minmax(0, 1fr) repeat(2, auto);
  }

  .bsr-ext-path-edit {
    grid-column: 2 / 4;
  }
}

@media (max-width: 700px) {
  .bsr-ext-path-control {
    grid-template-columns: 1fr;
  }

  .bsr-ext-path-picker,
  .bsr-ext-path-check,
  .bsr-ext-path-edit {
    grid-column: 1;
    width: 100%;
  }

  .bsr-onedrive-picker-dialog {
    border-radius: 12px;
    max-height: calc(100vh - 16px);
    max-width: calc(100vw - 16px);
    min-height: calc(100vh - 16px);
  }

  .bsr-onedrive-picker-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .bsr-onedrive-selected {
    max-width: none;
  }

  .bsr-onedrive-picker-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .bsr-onedrive-row {
    grid-template-columns: 28px minmax(0, 1fr);
    padding-inline: 11px;
  }

  .bsr-onedrive-row-action {
    display: none;
  }
}
