.chapitres-page {
  margin: 0 0 0 67px;
  padding: 14px 16px 40px;
}

.muted {
  opacity: 0.75;
}

.flash {
  margin: 12px 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
}

.flash--error {
  border: 1px solid rgba(220, 80, 80, 0.8);
  background: rgba(220, 80, 80, 0.10);
}

.chap-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 14px;
}

.btn-plus {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
  cursor: pointer;

  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.btn-plus img {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
  transition: transform 180ms ease;
}

.btn-plus:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-1px);
}

.btn-plus[aria-expanded="true"] img {
  transform: rotate(45deg);
}

.create-panel {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  overflow: hidden;

  transform-origin: top;
  transition:
    max-height 260ms ease,
    opacity 220ms ease,
    transform 220ms ease,
    padding 220ms ease;

  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  padding: 0 14px;

  border : 1px solid black;
}

.create-panel[data-open="1"] {
  max-height: 2000px;
  opacity: 1;
  transform: translateY(0);
  padding: 14px;
}

.chap-form {
  display: grid;
  gap: 12px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  opacity: 0.95;
}

.field input[type="text"] {
  width: 40%;
  min-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;

  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.18);
  color: inherit;

  outline: none;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.field input[type="text"]:focus {
  border-color: rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.24);
  transform: translateY(-1px);
}

.rep-status {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 32px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.12);
  font-weight: 600;
  font-size: 0.85rem;

  width: 40%;
  min-width: 240px;
  display: inline-block;
  vertical-align: middle;

  transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.rep-status[data-state="idle"] {
  opacity: 0.65;
}

.rep-status[data-state="loading"] {
  opacity: 0.85;
}

.rep-status[data-state="ok"] {
  border-color: rgba(90, 200, 120, 0.8);
  background: rgba(90, 200, 120, 0.18);
}

.rep-status[data-state="bad"] {
  border-color: rgba(220, 120, 120, 0.8);
  background: rgba(220, 120, 120, 0.18);
}

.form-actions {
  margin-top: 8px;
}

.chapitres-page .chap-form .btn-primary {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;

  appearance: none;
  -webkit-appearance: none;

  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: inherit;
  font-weight: 700;

  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.chapitres-page .chap-form .btn-primary:disabled {
  background: rgba(160,160,160,0.25);
  border-color: rgba(160,160,160,0.45);
  color: rgba(255,255,255,0.45);

  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.chapitres-page .chap-form .btn-primary:not(:disabled) {
  background: rgba(90, 200, 120, 0.35);
  border-color: rgba(90, 200, 120, 0.85);
  color: rgba(255,255,255,0.95);

  box-shadow:
    0 0 0 1px rgba(90, 200, 120, 0.25),
    0 6px 14px rgba(0,0,0,0.25);
}

.chapitres-page .chap-form .btn-primary:not(:disabled):hover {
  background: rgba(90, 220, 140, 0.45);
  border-color: rgba(90, 220, 140, 1);
  transform: translateY(-1px);
}

.chapitres-page .chap-form .btn-primary:not(:disabled):active {
  transform: translateY(0);
  box-shadow:
    0 0 0 1px rgba(90, 200, 120, 0.35),
    0 3px 8px rgba(0,0,0,0.35);
}

@media (max-width: 560px) {
  .chapitres-page {
    padding: 12px 12px 30px;
  }

  .btn-plus {
    width: 40px;
    height: 40px;
  }

  .field input[type="text"],
  .rep-status {
    width: 100%;
    min-width: 0;
  }
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
  flex-wrap: wrap;
}

.searchbar__input {
  flex: 1;
  min-width: 260px;

  padding: 10px 12px;
  border-radius: 14px;

  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.18);
  color: inherit;

  outline: none;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.searchbar__input:focus {
  border-color: rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.24);
  transform: translateY(-1px);
}

.filter {
  position: relative;
}

.filter__btn {
  padding: 10px 12px;
  border-radius: 14px;

  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: inherit;

  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.filter__btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.28);
}

.filter__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;

  width: 220px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(6px);

  overflow: hidden;
  transform-origin: top right;
  transition: opacity 160ms ease, transform 160ms ease;

  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
}

.filter__menu[data-open="1"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.filter__item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;

  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.filter__item:hover {
  background: rgba(255,255,255,0.08);
}

.results-meta {
  opacity: 0.75;
  margin-bottom: 12px;
}

.no-results {
  opacity: 0.75;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.18);
}

.sep {
  margin: 22px 0;
  border: 0;
  height: 1px;
  background: rgba(255,255,255,0.10);
}

.chap-grid {

  display: grid;
  gap: 14px;

  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .chap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .chap-grid { grid-template-columns: 1fr; }
}

.chap-card {
  display: block;
  padding: 14px 14px 12px;
  border-radius: 16px;
  border : 1px solid black;

  background: rgba(0,0,0,0.4);
  color : white;
  text-decoration: none;
  color: inherit;

  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.chap-card:hover {
  transform: translateY(-2px);
  background: rgba(0,0,0,1);
}

.chap-card__title {
  font-weight: 800;
  font-size: large;
  text-align : center;
  margin-bottom: 6px;
  color : white;
}

.chap-card__meta {
  opacity: 0.85;
  font-size: small;
  color : white;
}

.chap-card__author {
  margin-top: 8px;
  font-size: small;
  color : white;
}

.filter .message{
	font-size : x-small;
	display : block;
	width : 100%;
}

.ch-card, .chapitre-card{ border-radius: 0 !important; border-left: 4px solid var(--ax-noyer) !important; }

.chap-card{
  background: var(--ax-surface) !important;
  color: var(--ax-ink) !important;
  border: 1px solid var(--ax-line) !important;
}

.chap-card:hover{
  background: rgba(111,75,42,.08) !important;
}

.chap-card__title,
.chap-card__meta,
.chap-card__author{
  color: var(--ax-ink) !important;
}
