/* --- BLOKK-TÍPUS KONFIGURÁCIÓ (2-es sablon) --- */
.section-block-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    user-select: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    min-width: 78px;
    justify-content: center;
    box-sizing: border-box;
  }
  .section-block-badge:hover { background: #e2e8f0; }
  .section-block-badge[data-state="default"] {
    background: #f0fdf4; border-color: #86efac;
  }
  .section-block-badge[data-state="default"]:hover { background: #dcfce7; }
  .section-block-badge[data-state="custom"] {
    background: #fef3c7; border-color: #fcd34d;
  }
  .section-block-badge[data-state="custom"]:hover { background: #fde68a; }
  .section-block-badge[data-state="none"] {
    background: #fee2e2; border-color: #fca5a5;
  }
  .section-block-badge[data-state="none"]:hover { background: #fecaca; }
  .section-block-badge .badge-icon {
    font-size: 0.82rem;
    line-height: 1;
    flex-shrink: 0;
  }
  .section-block-badge .badge-text {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #475569;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .section-block-badge[data-state="default"] .badge-text { color: #166534; }
  .section-block-badge[data-state="custom"] .badge-text  { color: #92400e; }
  .section-block-badge[data-state="none"] .badge-text    { color: #991b1b; }

  body:not(.teacher-mode) .section-block-badge { display: none !important; }

  .section-block-config-panel {
    display: none;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0 0 14px 0;
    font-size: 0.88rem;
  }
  .section-block-config-panel.show { display: block; }
  .section-block-config-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; gap: 8px; flex-wrap: wrap;
  }
  .section-block-config-title {
    font-weight: 700; color: #78350f; font-size: 0.85rem;
  }
  .section-block-config-actions { display: flex; gap: 4px; flex-wrap: wrap; }
  .section-block-config-actions .tool-btn { padding: 3px 8px; font-size: 0.75rem; }
  .section-block-config-list { display: flex; flex-direction: column; gap: 10px; }
  .section-block-config-row { display: flex; flex-wrap: wrap; gap: 8px 14px; }
  .section-block-config-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #fcd34d;
    border-radius: 6px;
  }
  .section-block-config-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #78350f;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 4px;
    border-bottom: 1px solid #fef3c7;
  }
  .section-block-config-group-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
  }
  .section-block-config-item {
    display: flex; align-items: center; gap: 6px;
    cursor: pointer; user-select: none;
    font-weight: 600; color: #78350f;
    padding: 3px 8px; border-radius: 6px;
    transition: background 0.12s;
  }
  .section-block-config-item:hover { background: #fef3c7; }
  .section-block-config-item input {
    width: auto; margin: 0; cursor: pointer; accent-color: #d97706;
  }
  .section-block-config-hint {
    margin-top: 10px; padding: 8px 12px;
    background: #fef9e7; border-radius: 6px;
    font-size: 0.82rem; color: #78350f; line-height: 1.5;
  }
  .section-block-preview {
    margin-top: 10px; padding: 8px 12px;
    background: #f0f9ff; border: 1px solid #bae6fd;
    border-radius: 6px;
    display: flex; flex-wrap: wrap; gap: 6px;
    align-items: center; min-height: 32px;
  }
  .section-block-preview .preview-label {
    font-size: 0.78rem; font-weight: 700;
    color: #0c4a6e; margin-right: 4px;
  }
  .section-block-preview .preview-btn {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 8px; background: white;
    border: 1px solid #bae6fd; border-radius: 6px;
    font-size: 0.78rem; font-weight: 600; color: #0c4a6e;
  }
  .section-block-preview .preview-none {
    font-size: 0.78rem; color: #991b1b;
    font-style: italic; font-weight: 600;
  }
  @media (max-width: 600px) {
    .section-block-config-panel { margin-left: 0; }
  }

/* --- BLOKK-SZINTŰ BEÁLLÍTÁSOK (vágólap + diák nézet) --- */
/* Összevont ⚙️ gomb: a vágólap-állapotot színezéssel jelzi. */
.icon-btn.block-settings-btn { color: #6b7280; }
  .icon-btn.block-settings-btn:hover { background: #f1f5f9; }
  .icon-btn.block-settings-btn.state-allow {
    background: #dcfce7; border-color: #86efac; color: #166534;
  }
  .icon-btn.block-settings-btn.state-deny {
    background: #fee2e2; border-color: #fca5a5; color: #991b1b;
  }
  body:not(.teacher-mode) .block-settings-btn { display: none !important; }
  /* A régi, külön gombok osztályai is maradjanak rejtve a diáknál. */
  body:not(.teacher-mode) .clipboard-btn,
  body:not(.teacher-mode) .text-settings-btn { display: none !important; }

/* --- SETTINGS MODAL - CSOPORT SZEKCIOK --- */
.mt-settings-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    margin-bottom: 8px;
  }
  /* A gombok egy wrapperben, jobbra igazitva. */
  .mt-settings-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
  }
  /* A cim balra, a gombok jobbra, egymas mellett. */
  .mt-settings-header .field-label {
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mt-settings-header .field-label { margin: 0; }
  .mt-settings-group {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
    /* NE zsugorodjon ossze, amikor sok csoport van.
       Igy minden csoport a sajat tartalmahoz igazodik,
       es a lista lesz gorgetheto. */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
  }


  /* Csoport becsukas / kinyitas */
  .mt-settings-group.collapsed .mt-settings-group-panels {
    display: none;
  }
  .mt-settings-group.collapsed .mt-settings-group-header {
    border-bottom: none;
  }

  /* Csoport toggle gomb */
  .mt-settings-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    color: #475569;
    font-family: inherit;
    line-height: 1;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    user-select: none;
  }
  .mt-settings-toggle-btn:hover {
    background: rgba(0,0,0,0.08);
    color: #1e293b;
  }

  /* Csoport drag handle */
  .mt-settings-drag-handle {
    cursor: grab;
    color: #94a3b8;
    font-size: 1rem;
    padding: 2px 4px;
    border-radius: 3px;
    user-select: none;
    flex-shrink: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mt-settings-drag-handle:hover {
    background: rgba(0,0,0,0.08);
    color: #475569;
  }
  .mt-settings-drag-handle:active {
    cursor: grabbing;
  }

  /* Csoport drag allapotok (inset, mert overflow: hidden) */
  .mt-settings-group.dragging {
    opacity: 0.5;
    border-style: dashed !important;
  }
  .mt-settings-group.drag-over-top {
    box-shadow: inset 0 4px 0 0 #d97706;
  }
  .mt-settings-group.drag-over-bottom {
    box-shadow: inset 0 -4px 0 0 #d97706;
  }
  .mt-settings-group.drag-over {
    border-color: #d97706;
    box-shadow: inset 0 0 0 3px rgba(217, 119, 6, 0.35);
    background: #fffbeb;
  }
  body.mt-group-dragging {
    cursor: grabbing !important;
    user-select: none !important;
  }
  body.mt-group-dragging .mt-settings-drag-handle {
    cursor: grabbing !important;
  }
  .mt-settings-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #e2e8f0;
    border-bottom: 1px solid #cbd5e1;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
  }
  .mt-settings-group-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mt-settings-group-count {
    background: #64748b;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
  }
  .mt-settings-group-action {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 3px 7px;
    border-radius: 4px;
    line-height: 1;
    color: #475569;
    font-family: inherit;
  }
  .mt-settings-group-action:hover {
    background: rgba(0,0,0,0.08);
  }
  .mt-settings-group-action.danger { color: #b91c1c; }
  .mt-settings-group-action.danger:hover { background: #fee2e2; }
  .mt-settings-group-panels {
    padding: 8px;
    /* Legyen eleg nagy ahhoz, hogy egy panelt kenyelmesen
       lehessen ide huzni, es ne zsugorodjon. */
    min-height: 60px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .mt-settings-group-empty {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    font-size: 0.82rem;
    padding: 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    background: white;
    flex-shrink: 0;
  }
  .mt-panel-item[draggable="true"] { cursor: grab; }
  .mt-panel-item[draggable="true"]:active { cursor: grabbing; }
  .mt-panel-item.dragging { opacity: 0.4; }
  .mt-panel-item.drag-over-top {
    box-shadow: 0 -3px 0 0 #d97706;
  }
  .mt-panel-item.drag-over-bottom {
    box-shadow: 0 3px 0 0 #d97706;
  }