/* ===========================================
   Self Limitations Block – визуален стил
   =========================================== */

/* Стъклен контейнер */
.maxima-sl__inner {
    padding: 12px 16px;
    border: 1px solid rgba(0,0,0,0.25);
    border-radius: 16px;
    background: rgba(255,255,255,0.5);
    backdrop-filter: saturate(120%) blur(8px);
  }
  
  /* Заглавие + глобални бутони за сортиране на един ред */
  .maxima-sl__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* позволява заглавието да се пренася, бутоните остават отгоре вдясно */
    margin-bottom: 12px;
  }
  .maxima-sl__header-title {
    flex: 1;
    font-size: 1.05em;      /* по-малко от преди */
    font-weight: 600;
    color: #222;
    margin: 0 12px 0 0;     /* място преди бутоните */
    /* пренасяне на повече редове, без изрязване */
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .maxima-sl__header-buttons { display: flex; gap: 8px; }
  .maxima-sl__score-sort {
    width: 42px; height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.25);
    background: rgba(255,255,255,0.95);
    cursor: pointer; line-height: 1; font-weight: 700; font-size: 16px;
  }
  .maxima-sl__score-sort:hover { background: rgba(255,255,255,1); }
  
  /* Контейнер за всеки ред (основно поле + 2 оценки) */
  .maxima-sl__group { margin-bottom: 8px; }
  .maxima-sl__row {
    display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px;
  }
  
  /* Поле за текст */
  .maxima-sl__textarea {
    flex: 1; width: 100%; min-height: 0; height: auto;
    overflow-y: hidden; resize: none;
    padding: 10px 12px;
    border-radius: 12px; border: 1px solid rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.8);
    line-height: 1.5; box-sizing: border-box;
  }
  
  /* Квадратчета за оценки */
  .maxima-sl__score {
    width: 42px; height: 42px; border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.25);
    background: rgba(255,255,255,0.85);
    text-align: center; font-size: 15px; font-weight: 600; color: #222;
    padding: 0; box-sizing: border-box;
  }
  .maxima-sl__score:focus { outline: 2px solid rgba(0,0,0,0.4); }
  .maxima-sl__score { -moz-appearance: textfield; }
  .maxima-sl__score::-webkit-outer-spin-button,
  .maxima-sl__score::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  
  /* Контроли под списъка */
  .maxima-sl__controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
  .maxima-sl__btn { appearance: none; cursor: pointer; }
  .maxima-sl__btn--add {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.18);
    /* сив, леко прозрачен фон – като на скрийншота */
    background: rgba(190, 198, 204, 0.55);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    color: #111;
    font-weight: 400; /* regular */
  }
  
  /* =========================
     Дъщерно поле (Notes)
     ========================= */
  .maxima-sl__notes {
    position: relative;
    display: flex; align-items: flex-start; gap: 8px;
  
    /* започва веднага след бутона – максимално място за текста */
    margin-left: 28px;           /* синхрон с left на бутона */
    padding-left: 2px;           /* лек въздух след бутона */
    min-height: 32px;            /* за да не се застъпва долният ред, когато е скрито */
  }
  
  /* Бутонът – вляво, изравнен с началото на основното поле */
  .maxima-sl__notes-toggle {
    position: absolute;
    left: -28px;                 /* бутона излиза точно преди полето */
    top: 2px;
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.25);
    background: rgba(255,255,255,0.95);
    cursor: pointer; font-weight: 700; line-height: 1;
    z-index: 1;
  }
  
  /* Дъщерното поле – различим, мек фон */
  .maxima-sl__notes-textarea {
    flex: 1; width: 100%;
    overflow-y: hidden; resize: none;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
    background: rgba(255, 247, 214, 0.9);   /* #FFF7D6 – щадящ */
    line-height: 1.5; box-sizing: border-box;
  }
  
  /* Скрито състояние – textarea е скрита, но редът държи височина за бутона */
  .maxima-sl__notes--hidden { min-height: 32px; }
  .maxima-sl__notes--hidden .maxima-sl__notes-textarea { display: none; }
  
  /* =========================
     Мобилна оптимизация – ширина с „луфт“ от двете страни
     ========================= */
  @media (max-width: 640px) {
    .maxima-sl__inner {
      width: calc(100vw - 40px);   /* ~20px отстъп отляво/дясно */
      margin-left: 50%;
      transform: translateX(-50%);
      border-radius: 14px;
    }
    .maxima-sl__header-title { font-size: 1.02em; } /* още малко по-компактно */
    .maxima-sl__score { width: 38px; height: 38px; }
    .maxima-sl__notes { margin-left: 28px; }
    .maxima-sl__notes-toggle { left: -28px; }
  }
/* Вертикален стак на дъщерните полета + естествена височина */
.maxima-sl__notes {
    flex-direction: column;        /* едно под друго */
    align-items: stretch;          /* заемат цялата ширина */
  }
  
  .maxima-sl__notes-textarea {
    flex: 0 0 auto;                /* НЕ се разтягат по височина */
    min-height: 0;                 /* позволи shrink в flex контекст */
    height: auto;                  /* JS контролира височината */
    overflow-y: hidden;            /* без вътрешен скролбар */
  }
/* Бледо зелено за второто дъщерно поле ("Подобрения") */
.maxima-sl__notes .maxima-sl__notes-textarea:nth-of-type(2) {
    background-color: #edfbe6;   /* бледо зелено */
    border-color: #b9e6a5;       /* по желание – леко зелена рамка */
  }
  
  /* по желание: по-четим placeholder в зеленото поле */
  .maxima-sl__notes .maxima-sl__notes-textarea:nth-of-type(2)::placeholder {
    opacity: .8;
  }
    