:root {
  --zba-panel: #fff;
  --zba-text: #10213a;
  --zba-muted: #58708d;
  --zba-line: #d6e0eb;
  --zba-accent: #0f766e;
  --zba-accent-strong: #0b5f70;
  --zba-danger: #b42318;
  --zba-surface: #fbfcfd;
  --zba-shadow: 0 18px 50px rgba(16, 33, 58, .08);
}

.zba-panel,
.zba-panel * {
  box-sizing: border-box;
}

.zba-panel {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: .85rem;
  margin-top: 1rem;
  padding: 1rem;
  color: var(--zba-text);
  border: 1px solid var(--zba-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--zba-shadow);
}

.zba-panel.is-compact {
  margin-top: 0;
  box-shadow: none;
  background: transparent;
}

.zba-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.zba-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.zba-summary,
.zba-status,
.zba-note {
  margin: 0;
  color: var(--zba-muted);
}

.zba-status {
  min-height: 1.4rem;
  font-weight: 800;
}

.zba-status.is-ok {
  color: var(--zba-accent-strong);
}

.zba-status.is-error {
  color: var(--zba-danger);
}

.zba-text-link {
  color: var(--zba-accent-strong);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.zba-actions,
.zba-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}

.zba-actions {
  justify-content: flex-end;
}

.zba-button,
.zba-panel button,
.zba-link-button {
  display: inline-flex;
  min-height: 44px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #bdd0e0;
  border-radius: 8px;
  padding: .65rem .9rem;
  color: var(--zba-text);
  background: #fff;
  font: inherit;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.zba-button.is-primary,
.zba-panel button.is-primary,
.zba-link-button.is-primary {
  color: #fff;
  border-color: var(--zba-accent);
  background: var(--zba-accent);
}

.zba-button.is-danger,
.zba-panel button.is-danger {
  color: var(--zba-danger);
  border-color: #f0b8b2;
  background: #fff7f6;
}

.zba-panel button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.zba-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px) auto;
  gap: .75rem;
  align-items: end;
}

.zba-field,
.zba-panel label {
  display: grid;
  min-width: 0;
  gap: .25rem;
  color: #48617c;
  font-size: .88rem;
  font-weight: 800;
}

.zba-field input,
.zba-panel input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bdd0e0;
  border-radius: 8px;
  padding: .65rem .75rem;
  color: var(--zba-text);
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.zba-field input:disabled,
.zba-panel input:disabled {
  color: #7f8da1;
  border-color: #d7e0ea;
  background: #eef3f8;
  cursor: not-allowed;
}

.zba-create-fields,
.zba-reset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.zba-create-fields {
  grid-column: 1 / -1;
  padding-top: .85rem;
  border-top: 1px solid var(--zba-line);
}

.zba-reset-panel {
  display: grid;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid var(--zba-line);
  border-radius: 8px;
  background: var(--zba-surface);
}

.zba-compact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
}

.zba-compact-copy {
  display: grid;
  min-width: 0;
  gap: .2rem;
}

.zba-kicker {
  color: var(--zba-muted);
  font-size: .88rem;
  font-weight: 900;
}

.zba-strong {
  font-weight: 900;
}

.zba-hidden {
  display: none !important;
}

.zba-field-ready {
  animation: zbaFieldReady .75s ease;
}

.zbc-panel,
.zbc-panel *,
[data-zebezo-course-catalog],
[data-zebezo-course-catalog] * {
  box-sizing: border-box;
}

.zbc-panel {
  display: grid;
  gap: .85rem;
  margin: 1rem 0;
  padding: 1rem;
  color: var(--zba-text);
  border: 1px solid var(--zba-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--zba-shadow);
}

.zbc-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.zbc-head h2,
.zbc-course h3 {
  margin: 0;
  line-height: 1.2;
}

.zbc-head p,
.zbc-course p,
.zbc-status {
  margin: 0;
  color: var(--zba-muted);
}

.zbc-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  color: var(--zba-muted);
  font-size: .88rem;
  font-weight: 900;
}

.zbc-head > .zbc-summary {
  justify-content: flex-end;
}

.zbc-summary-chip,
.zbc-meta span,
.zbc-state {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--zba-line);
  border-radius: 999px;
  padding: .18rem .55rem;
  color: var(--zba-muted);
  background: #fff;
  font-size: .8rem;
  font-weight: 900;
}

.zbc-summary-chip {
  position: relative;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.zbc-summary-chip:hover,
.zbc-summary-chip:focus-visible {
  color: #fff;
  border-color: var(--zba-accent);
  background: var(--zba-accent);
  box-shadow: 0 8px 20px rgba(15, 118, 110, .18);
  outline: none;
}

.zbc-summary-chip:disabled {
  opacity: .62;
  cursor: wait;
}

.zbc-summary-hover {
  display: none;
}

.zbc-summary-chip:hover .zbc-summary-default,
.zbc-summary-chip:focus-visible .zbc-summary-default {
  display: none;
}

.zbc-summary-chip:hover .zbc-summary-hover,
.zbc-summary-chip:focus-visible .zbc-summary-hover {
  display: inline;
}

.zbc-state.is-good {
  border-color: #92d3cd;
  color: #0f766e;
  background: #e8fbf8;
}

.zbc-state.is-warn {
  border-color: #fed7aa;
  color: #9a3412;
  background: #fff7ed;
}

.zbc-state.is-muted {
  color: var(--zba-muted);
  background: #f8fafc;
}

.zbc-course-progress {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .6rem;
  color: var(--zba-muted);
  font-size: .82rem;
  font-weight: 800;
}

.zbc-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem;
}

.zbc-course {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "head head"
    "body actions";
  gap: .75rem 1rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--zba-line);
  border-radius: 8px;
  background: var(--zba-surface);
}

.zbc-course.is-enrolled {
  border-color: #92d3cd;
  background: #fbfffe;
}

.zbc-course-head {
  grid-area: head;
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
}

.zbc-course-body {
  grid-area: body;
  display: grid;
  min-width: 0;
  gap: .65rem;
}

.zbc-kicker {
  color: var(--zba-muted);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.zbc-meta,
.zbc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}

.zbc-actions {
  grid-area: actions;
  align-content: start;
  justify-content: flex-end;
  min-width: 170px;
}

.zbc-button {
  display: inline-flex;
  min-height: 44px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #bdd0e0;
  border-radius: 8px;
  padding: .65rem .9rem;
  color: var(--zba-text);
  background: #fff;
  font: inherit;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.zbc-button.is-primary {
  color: #fff;
  border-color: var(--zba-accent);
  background: var(--zba-accent);
}

.zbc-button:disabled,
.zbc-button.is-disabled {
  opacity: .55;
  cursor: not-allowed;
}

.zbc-empty {
  padding: .9rem;
  border: 1px solid var(--zba-line);
  border-radius: 8px;
  background: var(--zba-surface);
}

.zbc-empty p {
  margin: 0;
  color: var(--zba-muted);
}

.zbc-empty.is-error,
.zbc-status.is-error {
  color: var(--zba-danger);
}

.zbc-status {
  min-height: 1.4rem;
  font-weight: 900;
}

.zbc-status.is-ok {
  color: var(--zba-accent-strong);
}

.zbc-dialog {
  width: min(460px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--zba-text);
  background: transparent;
}

.zbc-dialog::backdrop {
  background: rgba(16, 33, 58, .42);
}

.zbc-dialog-card {
  display: grid;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid var(--zba-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 33, 58, .24);
}

.zbc-dialog-head {
  display: grid;
  gap: .35rem;
}

.zbc-dialog-head h3,
.zbc-dialog-card p {
  margin: 0;
}

.zbc-credit-preview {
  display: grid;
  gap: .5rem;
  margin: 0;
}

.zbc-credit-preview div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  padding: .65rem .75rem;
  border: 1px solid var(--zba-line);
  border-radius: 8px;
  background: var(--zba-surface);
}

.zbc-credit-preview dt,
.zbc-credit-preview dd {
  margin: 0;
}

.zbc-credit-preview dt,
.zbc-dialog-note {
  color: var(--zba-muted);
}

.zbc-credit-preview dd {
  font-weight: 900;
}

.zbc-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}

@keyframes zbaFieldReady {
  0% {
    border-color: var(--zba-accent);
    background: #eefbf9;
    box-shadow: 0 0 0 0 rgba(15, 118, 110, .34);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(15, 118, 110, 0);
  }
}

@media (max-width: 900px) {
  .zba-head,
  .zba-compact-grid {
    display: grid;
  }

  .zba-actions {
    justify-content: flex-start;
  }

  .zba-form,
  .zba-create-fields,
  .zba-reset-grid,
  .zbc-list {
    grid-template-columns: 1fr;
  }

  .zbc-course {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "body"
      "actions";
  }

  .zbc-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .zbc-dialog-actions {
    justify-content: stretch;
  }

  .zbc-dialog-actions .zbc-button {
    flex: 1 1 150px;
  }

  .zba-create-fields {
    grid-column: auto;
  }

  .zbc-head,
  .zbc-course-head {
    display: grid;
  }
}

@media (max-width: 560px) {
  .zba-panel,
  .zbc-panel {
    gap: .72rem;
    margin-top: .75rem;
    margin-bottom: .75rem;
    padding: .78rem;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 33, 58, .08);
  }

  .zba-panel.is-compact {
    padding: .78rem;
    border: 1px solid var(--zba-line);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 24px rgba(16, 33, 58, .08);
  }

  .zba-compact-grid {
    grid-template-columns: 1fr;
    gap: .65rem;
  }

  .zba-title,
  .zbc-head h2 {
    font-size: 1.14rem;
    line-height: 1.12;
  }

  .zba-kicker,
  .zbc-kicker {
    font-size: .72rem;
    line-height: 1.1;
  }

  .zba-note,
  .zbc-head p,
  .zbc-status {
    font-size: .86rem;
    line-height: 1.32;
  }

  .zba-button,
  .zba-panel button,
  .zba-link-button,
  .zbc-button {
    width: 100%;
    min-height: 40px;
    padding: .56rem .7rem;
    font-size: .86rem;
    line-height: 1.12;
  }

  .zbc-list {
    gap: .68rem;
  }

  .zbc-course {
    gap: .56rem;
    padding: .72rem;
    border-radius: 8px;
  }

  .zbc-course-head {
    gap: .3rem;
  }

  .zbc-course-body {
    gap: .38rem;
  }

  .zbc-course h3 {
    font-size: 1rem;
    line-height: 1.16;
  }

  .zbc-course.is-compact .zbc-course-body {
    gap: .28rem;
  }

  .zbc-course-progress {
    font-size: .72rem;
    line-height: 1.25;
  }

  .zbc-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .44rem;
    width: 100%;
  }

  .zbc-actions .zbc-button.is-primary {
    grid-column: 1 / -1;
  }

  .zbc-actions .zbc-button:only-child,
  .zbc-actions .zbc-button:nth-child(2):last-child {
    grid-column: 1 / -1;
  }

  .zbc-summary {
    gap: .35rem;
    font-size: .72rem;
  }

  .zbc-summary-chip,
  .zbc-meta span,
  .zbc-state {
    padding: .16rem .45rem;
    font-size: .7rem;
  }
}

@media (max-width: 420px) {
  .zbc-actions {
    grid-template-columns: 1fr;
  }

  .zbc-actions .zbc-button {
    grid-column: 1 / -1;
  }
}
