/* CRS.EasyCreator Frontend + Admin Styles */

/* Browser-Extension "ColorPick Eyedropper" injiziert ein <img> neben input[type=color]. Manche
   Admin-/Editor-CSS-Regeln blasen es riesig auf -> hier hart auf 16px klemmen. */
img.colorpick-eyedropper-input-trigger {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    box-shadow: none !important;
    vertical-align: middle;
}

.crs-easycreator-story {
    position: relative;
}

.crs-easycreator-story.cc-is-admin {
    outline: 0;
}

.crs-easycreator-story .cc-edit-overlay {
    position: absolute;
    top: .5rem;
    right: .5rem;
    z-index: 10;
    display: none;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    background: rgba(52, 116, 104, .9);
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    font-size: .9rem;
    transition: transform .15s;
}

.crs-easycreator-story.cc-is-admin:hover .cc-edit-overlay {
    display: flex;
}

.crs-easycreator-story .cc-edit-overlay:hover {
    transform: scale(1.1);
    color: #fff;
}

/* Slider */
.cc-slider {
    position: relative;
    overflow: hidden;
    border-radius: .5rem;
}

.cc-slider-track {
    display: flex;
    transition: transform .5s ease;
}

.cc-slide {
    flex: 0 0 100%;
    position: relative;
}

.cc-slide img {
    width: 100%;
    height: auto;
    display: block;
}

.cc-slide-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, .65));
    color: #fff;
}

.cc-slider-prev,
.cc-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, .5);
    color: #fff;
    border: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
}

.cc-slider-prev { left: .75rem; }
.cc-slider-next { right: .75rem; }

/* ==================== Media-Browser (1:1 von CRS.Creator) ==================== */
.cc-media-browser {
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    gap: 12px;
    margin-top: 12px;
    min-height: 600px;
}
.cc-media-tree-wrap {
    display: flex;
    flex-direction: column;
}
.cc-tree-toolbar { margin-bottom: 6px; }
.cc-media-tree {
    flex: 1;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px;
    overflow-y: auto;
}
.cc-media-tree ul { list-style: none; padding-left: 14px; margin: 0; }
.cc-media-tree > ul { padding-left: 0; }
.cc-tree-folder {
    display: block;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    user-select: none;
}
.cc-tree-folder:hover { background: #eaeaea; }
.cc-tree-folder.active { background: #347468; color: #fff; }
.cc-tree-folder.active small { color: #d0d0d0 !important; }

.cc-media-grid {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    align-content: start;
}
.cc-media-grid.cc-tiles-small { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
.cc-media-grid.cc-tiles-small .cc-media-tile img,
.cc-media-grid.cc-tiles-small .cc-tile-icon { max-height: 48px; height: 48px; }
.cc-media-grid.cc-tiles-small .cc-tile-icon i { font-size: 22px; }
.cc-media-grid.cc-tiles-medium { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.cc-media-grid.cc-tiles-large { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.cc-media-grid.cc-tiles-large .cc-media-tile img,
.cc-media-grid.cc-tiles-large .cc-tile-icon { max-height: 140px; height: 140px; }
.cc-media-grid.cc-tiles-large .cc-tile-icon i { font-size: 56px; }
.cc-media-grid.cc-tiles-xlarge { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cc-media-grid.cc-tiles-xlarge .cc-media-tile img,
.cc-media-grid.cc-tiles-xlarge .cc-tile-icon { max-height: 220px; height: 220px; }
.cc-media-grid.cc-tiles-xlarge .cc-tile-icon i { font-size: 80px; }
.cc-media-grid.cc-tiles-xlarge .cc-media-name { font-size: 13px; }

.cc-media-restore {
    position: absolute;
    top: 4px; right: 4px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 28px; height: 28px;
    cursor: pointer;
}
.cc-media-tile { position: relative; }
.cc-media-grid.cc-dragover { border-color: #347468; background: #eef9f6; }
.cc-media-tile {
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    text-align: center;
    background: #f5f5f5;
}
.cc-media-tile.selected { border-color: #347468; background: #d8ebe6; }
.cc-media-tile img { max-width: 100%; max-height: 80px; object-fit: contain; }
.cc-tile-icon {
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    background: #fff;
    border-radius: 3px;
}
.cc-tile-icon i { font-size: 36px; }
.cc-tile-ext {
    font-size: 10px;
    margin-top: 2px;
    text-transform: uppercase;
    color: #555;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.cc-media-tile .cc-media-name {
    font-size: 11px;
    margin-top: 4px;
    word-break: break-all;
    line-height: 1.2;
    color: #555;
}
.cc-media-loading, .cc-media-empty { padding: 20px; color: #999; text-align: center; grid-column: 1 / -1; }
.cc-media-paging {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    margin-top: 8px;
    border-top: 1px solid #e0e0e0;
    color: #555;
    font-size: 12px;
}
.cc-paging-nav { display: flex; align-items: center; }

.cc-media-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}
.cc-media-detail {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
}
.cc-media-tags {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    overflow-y: auto;
}
.cc-media-tags h6 { margin-bottom: 8px; }
.cc-tag-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    margin-bottom: 4px;
    border-radius: 3px;
    background: #fff;
    border: 1px solid #ddd;
    cursor: pointer;
}
.cc-tag-item.selected { background: #347468; color: #fff; border-color: #347468; }
.cc-tag-item .cc-tag-delete {
    background: none;
    border: none;
    color: inherit;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
}
.cc-tag-add {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}
.cc-tag-add input { flex: 1; }

/* ===================================================================
   Phase 2 — Template-Picker + Slot-Editor (Admin)
   =================================================================== */

/* --- Template-Picker --- */
.ec-tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 12px;
}
.ec-tpl-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e3e3e3;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}
.ec-tpl-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); border-color: #347468; }
.ec-tpl-card__thumb {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f5;
    color: #b9c6c2;
    font-size: 36px;
}
.ec-tpl-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ec-tpl-card__body { padding: 12px 14px; flex: 1; }
.ec-tpl-card__title { margin: 0 0 4px; font-size: 15px; }
.ec-tpl-card__desc { margin: 0 0 8px; font-size: 12.5px; color: #777; line-height: 1.4; }
.ec-tpl-card__slots { display: flex; flex-wrap: wrap; gap: 4px; }
.ec-tpl-chip {
    font-size: 11px;
    background: #eef3f1;
    color: #347468;
    border-radius: 10px;
    padding: 1px 8px;
}
.ec-tpl-card__action { padding: 0 14px 14px; }
.ec-tpl-card__action .btn-block { width: 100%; }
.ec-tpl-card__tools { display: flex; gap: 6px; margin-top: 8px; align-items: stretch; }
.ec-tpl-card__tools .btn { flex: 0 0 auto; }
.ec-tpl-card__tools > a.btn { flex: 1 1 auto; text-align: center; }
.ec-tpl-import { display: inline-block; margin: 0; }
.ec-tpl-import input[type=file] { display: none; }

/* --- Slot-Editor: Device-Bar + Live-Vorschau --- */
.ec-device-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 6px;
}
.ec-device-bar > .fa { color: #9aa6a2; }
.ec-device-bar input[type="range"] { flex: 0 1 360px; cursor: pointer; }
.ec-vp-label { font-weight: 600; color: #347468; min-width: 150px; }
.ec-device-ticks { margin-left: auto; display: flex; gap: 6px; }
.ec-tick {
    border: 1px solid #cfd8d5;
    background: #f4f6f5;
    color: #455550;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
}
.ec-tick:hover { border-color: #347468; color: #347468; }
.ec-tick--active { background: #347468; border-color: #347468; color: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(52,116,104,.35); }
.ec-tick--active:hover { color: #fff; }
.ec-history { display: inline-flex; gap: 4px; margin-right: 6px; }
.ec-hist-btn { padding: 3px 9px; }
.ec-hist-btn:disabled { opacity: .4; cursor: default; border-color: #cfd8d5; color: #455550; background: #f4f6f5; }

.ec-slot-editor {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.ec-slot-form { flex: 1 1 0; min-width: 0; }
.ec-slot-preview { flex: 1 1 0; min-width: 0; }
.ec-slot-editor.ec-detached .ec-slot-preview { display: none; }
.ec-slot-editor.ec-detached .ec-slot-form { flex: 1 1 100%; }
.ec-preview-canvas {
    height: calc(100vh - 260px);
    min-height: 360px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #eef1f0;
    border: 1px solid #e3e3e3;
    border-radius: 6px;
    padding: 12px;
}
.ec-preview-wrap {
    background: #fff;
    box-shadow: 0 2px 16px rgba(0,0,0,.14);
    overflow: hidden;
    flex: 0 0 auto;
}
#ec-preview-frame { border: 0; background: #fff; display: block; }

.ec-slot { margin-bottom: 18px; }

/* --- Bild-Slot --- */
.ec-img-slot { display: flex; align-items: flex-start; gap: 12px; }
.ec-img-preview {
    position: relative;
    width: 120px;
    height: 80px;
    flex: 0 0 auto;
    border: 1px solid #e3e3e3;
    border-radius: 4px;
    overflow: hidden;
    background: #f4f6f5;
}
.ec-img-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ec-img-preview .ec-img-placeholder {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    color: #b9c6c2;
    font-size: 28px;
}
.ec-img-preview.is-empty img { display: none; }
.ec-img-preview.is-empty .ec-img-placeholder { display: flex; }
.ec-img-actions { display: flex; flex-direction: column; gap: 4px; }

@media (max-width: 1100px) {
    .ec-slot-editor { flex-direction: column; }
    .ec-slot-form { flex-basis: auto; max-width: none; width: 100%; }
    .ec-slot-preview { width: 100%; }
    .ec-preview-canvas { height: 460px; }
}

.ec-slot-form .ec-vp-pane { display: none; }
.ec-slot-form.ec-vp-edit-desktop .ec-vp-pane--desktop,
.ec-slot-form.ec-vp-edit-tablet .ec-vp-pane--tablet,
.ec-slot-form.ec-vp-edit-phone .ec-vp-pane--phone { display: block; }
.ec-vp-override { font-size: 11px; font-style: italic; }

.ec-rwp--tablet, .ec-rwp--phone { display: none; }
@media (max-width: 1024px) and (min-width: 641px) {
    .ec-rwp--desktop { display: none; }
    .ec-rwp--tablet { display: block; }
}
@media (max-width: 640px) {
    .ec-rwp--desktop, .ec-rwp--tablet { display: none; }
    .ec-rwp--phone { display: block; }
}

.ec-force-vp-desktop .ec-rwp--desktop { display: block !important; }
.ec-force-vp-desktop .ec-rwp--tablet, .ec-force-vp-desktop .ec-rwp--phone { display: none !important; }
.ec-force-vp-tablet .ec-rwp--tablet { display: block !important; }
.ec-force-vp-tablet .ec-rwp--desktop, .ec-force-vp-tablet .ec-rwp--phone { display: none !important; }
.ec-force-vp-phone .ec-rwp--phone { display: block !important; }
.ec-force-vp-phone .ec-rwp--desktop, .ec-force-vp-phone .ec-rwp--tablet { display: none !important; }

.ec-slot-label { font-weight: 600; display: block; margin-bottom: 8px; font-size: 14px; }
.ec-stage { margin-bottom: 10px; }
.ec-stage-tag { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: #6b7a76; margin-bottom: 4px; }
.ec-stage-tag small { font-weight: 400; text-transform: none; letter-spacing: 0; color: #9aa6a2; }
.ec-stage-tag--phone { color: #347468; }
.ec-stage-tag--tablet { color: #5b7fa6; }
.ec-stage-tag--desktop { color: #8a6d3b; }

/* ---- Layout-Builder Editor (Tree) ---- */
.ec-layout-toolbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 10px 0; }
.ec-arrange-bar { display: inline-flex; align-items: center; gap: 10px; padding: 4px 10px; background: #f0f4f3; border: 1px solid #e3eae8; border-radius: 6px; }
.ec-arrange-label { font-weight: 600; color: #2c6b5f; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.ec-arrange-bar label { display: inline-flex; flex-direction: column; font-size: 10px; color: #6b7a76; gap: 2px; margin: 0; }
.ec-arrange-bar select { width: 220px; min-width: 220px; }
.ec-arrange-bar .select2-container { width: 220px !important; min-width: 220px !important; }
.ec-arr-stage { display: none !important; }
.ec-arr-stage.ec-arr-stage--active { display: inline-flex !important; flex-direction: row; align-items: center; gap: 6px; }
.ec-arr-stage > i { color: #2c6b5f; font-size: 13px; }
.ec-arr-hint { display: none !important; }
.ec-switch { display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; }
.ec-switch input { width: 16px; height: 16px; }

/* Slider-Story: Konfig-Leiste oben (Dauer, Richtung, Volle Breite) + Seiten-Tabs. */
.ec-slider-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; padding: 10px 12px; margin: 10px 0 4px; background: #eef4f2; border: 1px solid #cfe0da; border-radius: 8px; }
.ec-slider-bar-title { font-weight: 700; color: #2c6b5f; display: inline-flex; align-items: center; gap: 6px; padding-bottom: 4px; }
.ec-sb-field { display: inline-flex; flex-direction: column; font-size: 12px; color: #5a6b66; gap: 3px; }
.ec-sb-field input { width: 140px; }
.ec-sb-field select { width: 190px; }
.ec-slider-pages { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; padding-bottom: 1px; }
.ec-sb-pages-label { font-size: 12px; color: #5a6b66; margin-right: 4px; }
.ec-slider-pages .btn { min-width: 30px; }
.ec-slider-pages .btn.ec-page-off { opacity: .75; text-decoration: line-through; }
.ec-sb-pages-sep { display: inline-block; width: 1px; align-self: stretch; background: #d5ded9; margin: 2px 4px; }

/* ---- Story-Container Editor (lineare Liste) ---- */
.ec-cont-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; padding: 10px 12px; margin: 10px 0 10px; background: #eef4f2; border: 1px solid #cfe0da; border-radius: 8px; }
.ec-cont-bar-title { font-weight: 700; color: #2c6b5f; display: inline-flex; align-items: center; gap: 6px; padding-bottom: 4px; }
.ec-cb-field { display: flex; flex-direction: column; font-size: 12px; color: #5a6b66; gap: 2px; margin: 0; }
.ec-cb-field input { width: 90px; }
.ec-cb-actions { display: inline-flex; gap: 6px; margin-left: auto; align-items: flex-end; }
.ec-cont-list { display: flex; flex-direction: column; }
.ec-cont-row { border: 1px solid #dbe4e1; border-radius: 8px; background: #fff; margin-bottom: 14px; overflow: hidden; }
.ec-cont-tools { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f5f8f7; border-bottom: 1px solid #e6edeb; }
.ec-cont-pick { flex: 1 1 auto; min-width: 0; }
.ec-cont-tools .select2-container { flex: 1 1 auto; min-width: 0; }
.ec-cont-handle { cursor: grab; color: #9aa8a4; font-weight: 700; user-select: none; padding: 0 4px; touch-action: none; }
.ec-cont-tools .btn { flex: 0 0 auto; }
.ec-cont-prev { position: relative; background: #fbfdfc; min-height: 60px; }
.ec-cont-prev iframe { width: 100%; border: 0; display: block; background: #fff; }
.ec-cont-empty { display: flex; align-items: center; justify-content: center; min-height: 80px; color: #9aa8a4; font-size: 13px; }
.ec-cont-addbar { display: flex; justify-content: flex-end; margin: 2px 0 8px; }
.ec-cont-hint { margin-top: 10px; font-size: 12px; }
.ec-savetpl { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.ec-savetpl input { width: 200px; }

.ec-tree { display: flex; flex-direction: column; gap: 12px; }
.ec-node-card { border: 1px solid #dfe5e3; border-radius: 8px; background: #fff; padding: 10px; }
.ec-node-card--container { border-color: #b9cfca; background: #f6faf9; }
.ec-node-card--root { border-color: #347468; }
.ec-node-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ec-node-type { font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.ec-node-place { display: inline-flex; gap: 4px; }
.ec-node-place select { width: auto; min-width: 64px; }
.ec-node-actions { display: inline-flex; gap: 4px; margin-left: auto; }
.ec-node-content { margin-bottom: 8px; }

.ec-toolbox { margin: 8px 0; padding: 10px; background: #eef4f2; border: 1px solid #d9e6e2; border-radius: 8px; }
.ec-toolbox-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #6b7a76; margin-bottom: 8px; }
.ec-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.ec-tool-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px;
    padding: 10px 4px; border: 1px solid #d9e6e2; border-radius: 8px; background: #fff;
    color: #41544e; font-size: 11px; line-height: 1.15; text-align: center; cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, color .12s ease;
}
.ec-tool-btn i { font-size: 17px; color: #347468; transition: transform .12s ease; }
.ec-tool-btn span { display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-tool-btn:hover { border-color: #347468; box-shadow: 0 4px 12px rgba(52, 116, 104, .18); transform: translateY(-2px); color: #2c6b5f; }
.ec-tool-btn:hover i { transform: scale(1.12); }
.ec-children { display: flex; flex-direction: column; gap: 10px; padding-left: 12px; border-left: 2px dashed #cdd9d5; margin-top: 8px; }

.ec-ed-options { margin: 6px 0; }
.ec-ed-options > summary { cursor: pointer; font-size: 13px; color: #347468; padding: 4px 0; user-select: none; list-style: none; }
.ec-ed-options > summary::-webkit-details-marker { display: none; }
.ec-ed-options > summary::before { content: "\2699"; margin-right: 6px; }

.ec-style-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; padding: 10px; background: #fafcfb; border: 1px solid #e8eeec; border-radius: 6px; }
.ec-style-row { display: flex; flex-direction: column; gap: 3px; }
.ec-style-row > label { font-size: 11px; font-weight: 600; color: #6b7a76; text-transform: uppercase; letter-spacing: .3px; margin: 0; }
.ec-dim { display: flex; gap: 4px; }
.ec-dim input { flex: 1 1 0; min-width: 0; }
.ec-dim select { flex: 0 0 70px; }
.ec-color { padding: 2px; height: 31px; }

.ec-btnlist-edit { display: flex; flex-direction: column; gap: 6px; }
.ec-btnbar-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; padding: 8px; background: #fafcfb; border: 1px solid #e8eeec; border-radius: 6px; margin-bottom: 8px; }
.ec-btnbar-list { display: flex; flex-direction: column; gap: 6px; }
.ec-btn-slot { border: 1px solid #dfe5e3; border-radius: 6px; background: #fff; }
.ec-btn-slot > summary { padding: 6px 10px; cursor: pointer; font-size: 12px; font-weight: 600; color: #455550; list-style: revert; }
.ec-btn-slot[open] > summary { border-bottom: 1px solid #e8eeec; color: #347468; }
.ec-btn-slot > :not(summary) { padding: 8px 10px; }
.ec-loc-code { text-transform: uppercase; font-size: 10px; font-weight: 700; min-width: 34px; justify-content: center; }
.ec-btn-row { display: flex; gap: 6px; }
.ec-btn-row input { flex: 1 1 0; min-width: 0; }
.ec-btn-row select { flex: 0 0 110px; }
.ec-btn-color { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; }
.ec-btn-color input[type="color"] { width: 46px; height: 28px; padding: 0; border: 1px solid #cfd8d5; border-radius: 4px; cursor: pointer; flex: 0 0 auto; }

.ec-tb-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 4px; }
.ec-tb-row .ec-tb-size { flex: 0 0 72px; }
.ec-tb-row .ec-tb-font { flex: 1 1 140px; min-width: 0; }
.ec-tb-row .ec-tb-color { flex: 0 0 auto; }
.ec-tb-row .ec-tb-color .ec-check { display: flex; align-items: center; gap: 4px; white-space: nowrap; margin: 0 0 2px; }
.ec-tb-row .ec-tb-color input[type="color"] { width: 46px; height: 28px; padding: 0; border: 1px solid #cfd8d5; border-radius: 4px; cursor: pointer; display: block; }
.ec-tb-row .ec-tb-align { flex: 0 0 108px; }
.ec-color-hex { width: 84px; margin-top: 4px; text-transform: lowercase; font-variant-numeric: tabular-nums; }

/* Button-Panel (Frontend): ein Button, zentriert im Panel. */
.crs-easycreator-story .ec-btn-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 44px;
}
.crs-easycreator-story .ec-btn-panel .ec-btn { white-space: normal; text-align: center; }

/* Button-Bar (Frontend): mehrere Buttons in einem Panel, per Flexbox (Richtung/Ausrichtung/Abstand inline). */
.crs-easycreator-story .ec-btn-bar { width: 100%; height: 100%; box-sizing: border-box; }
.crs-easycreator-story .ec-btn-bar .ec-btn { white-space: normal; text-align: center; margin: 0; }
.crs-easycreator-story .ec-btn-bar .ec-loc-btn { display: block; }
.crs-easycreator-story .ec-btn-bar.ec-btn-bar { line-height: normal; }

/* ---- FullWidth (Full-Bleed) ---- */
/* Nicht-FullWidth-Stories auf die Theme-Content-Breite begrenzen und zentrieren. Wirkt in jedem Kontext
   (eigene Seite, Widget-Zone, Startseite): liegt die Story in einer schmalen Zone, bleibt sie schmal
   (max-width verbreitert nie); liegt sie in einer vollbreiten Zone/Seite, wird sie auf --ec-content-max
   gekappt statt randlos zu laufen. Editor-Canvas (ec-edit-preview) ausgenommen. FullWidth (ec-fullwidth)
   hebt die Begrenzung wieder auf und bricht auf die volle Viewport-Breite aus. */
.crs-easycreator-story:not(.ec-fullwidth):not(.ec-edit-preview) {
    max-width: var(--ec-content-max, 1140px);
    margin-left: auto;
    margin-right: auto;
}

.crs-easycreator-story.ec-fullwidth,
.crs-easycreator-page.ec-fullwidth {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    margin-bottom: 0;
}

/* ---- Style-Form Gruppierung ---- */
.ec-style-form { display: flex; flex-direction: column; gap: 12px; padding: 0; background: none; border: 0; }
.ec-style-group { border: 1px solid #e8eeec; border-radius: 6px; background: #fafcfb; padding: 10px; }
.ec-style-group__title { font-size: 12px; font-weight: 700; color: #347468; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.ec-style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 14px; }
.ec-style-row--wide { grid-column: 1 / -1; }

.ec-range { display: flex; align-items: center; gap: 8px; }
.ec-range input[type="range"] { flex: 1 1 0; }
.ec-range-val { flex: 0 0 36px; text-align: right; font-variant-numeric: tabular-nums; color: #6b7a76; font-size: 12px; }

.ec-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; font-size: 12px; }
.ec-check input { width: 15px; height: 15px; }

/* ---- Positions-Controls ---- */
.ec-ed-pos { margin: 4px 0; }
.ec-pos-grid { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; background: #fafcfb; border: 1px solid #e8eeec; border-radius: 6px; }
.ec-pos-grid > label { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 12px; font-weight: 600; color: #6b7a76; }
.ec-pos-grid > label input[type="number"] { width: 64px; }
.ec-pos-clamp { margin-right: 6px; }

/* ---- Aktiver Knoten (nach Klick im Preview / nach Save) ---- */
.ec-node-active { box-shadow: 0 0 0 2px #347468; transition: box-shadow .2s; }

/* ---- Alle Config-Cards dauerhaft sichtbar (Fokus-Modus vorerst deaktiviert).
       Klick im Preview / data-ec-activate scrollt + highlightet nur die passende Card. ---- */
.ec-bg-title { font-size: 13px; font-weight: 700; color: #347468; margin-bottom: 8px; }
.ec-children:empty { display: none; }

/* Leichter Abstand unter jeder Story, damit nachfolgender Inhalt (und Schatten-Effekte) nicht ueberlappt
   bzw. Stories untereinander (z.B. gleiche Widget-Zone) getrennt bleiben. */
.crs-easycreator-story { margin-bottom: 15px; }

/* ---- Panel-Inhalt fuellt das Panel (Embeds/Bilder skalieren mit) ---- */
.crs-easycreator-story .ec-node { box-sizing: border-box; }
.crs-easycreator-story .ec-panel { min-width: 0; }

/* Maus-Hover-Zoom: Panel wird beim Hover leicht angehoben (3D-Lift) + Schatten + nach vorne geholt.
   Nur im Frontend (im Editor-Preview wuerde der Lift das Ziehen/Resizen stoeren). Bei rotierten /
   Parallax-Panels greift es nicht (deren Inline-transform hat Vorrang). */
.crs-easycreator-story:not(.ec-edit-preview) .ec-hover-zoom {
    transition: transform .25s ease, box-shadow .25s ease;
}
.crs-easycreator-story:not(.ec-edit-preview) .ec-hover-zoom:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
    z-index: 50 !important;
}

/* Blur-behind: verwischt, was hinter dem Panel liegt (ueberlappte Panels). Wirkt nur, wenn das Panel
   selbst (teil-)transparent ist - z.B. ein Text-Panel ohne eigene Hintergrundfarbe -> der Text bleibt
   scharf, der ueberlappte Hintergrund wird unscharf. Greift in Preview UND Frontend. */
.crs-easycreator-story .ec-blur-behind {
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

/* Nur im Editor-Preview: jedes Leaf-Panel bekommt einen leichten grauen Schleier (80% durchsichtig),
   damit auch transparente Panels sichtbar sind. Rein visuell (inset box-shadow toent, ueberschreibt
   keine echte Hintergrundfarbe) und greift NICHT im Frontend. */
.crs-easycreator-story.ec-edit-preview .ec-panel {
    box-shadow: inset 0 0 0 9999px rgba(128, 128, 128, .2);
}

/* Innerer Content-Wrapper. Basis: fuellt die Breite, Hoehe richtet sich nach Variante.
   - ec-fit (Bild/Video/Map/Katalog): feste Panel-Hoehe fuellen + Ueberlauf klippen (object-fit).
   - ec-grow (Text/HTML/...): mindestens die Panel-Hoehe, waechst aber mit dem Inhalt, KEIN Clipping. */
.crs-easycreator-story .ec-panel-content {
    position: relative;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: inherit;
    /* Inhalte duerfen das Panel nicht ueberlappen: lange Texte/Woerter umbrechen statt rechts hinauszuragen.
       (Wenn ein Auto-Layout kein horizontales Wachstum erlaubt, bricht der Text um; vertikal waechst das Panel.) */
    overflow-wrap: break-word;
    word-break: break-word;
}
.crs-easycreator-story .ec-panel-content img,
.crs-easycreator-story .ec-panel-content table,
.crs-easycreator-story .ec-panel-content video,
.crs-easycreator-story .ec-panel-content iframe { max-width: 100%; }
.crs-easycreator-story .ec-fit > .ec-panel-content {
    height: 100%;
    overflow: hidden;
}
.crs-easycreator-story .ec-grow > .ec-panel-content {
    min-height: 100%;
}

/* Katalog-Panels: das Produkt-Grid sitzt in einem Fit-Wrapper mit natuerlicher Breite und wird
   per JS (catalog-fit.js) proportional auf die (ziehbare) Panel-Box herunterskaliert -> nie groesser
   als 100% (Core-Kartengroesse), bei kleinerem Panel passt sich der Inhalt ein. */
/* height:100% reicht die Panel-Hoehe an einen enthaltenen Slider durch (-> ec-slider.js fit() skaliert die
   Items herunter). Beim Nicht-Slider sitzt das im Fit-Wrapper mit auto-Hoehe -> height:100% loest zu auto auf. */
.crs-easycreator-story .ec-catalog-products { width: 100%; height: 100%; }
.crs-easycreator-story .ec-catalog-brands { width: 100%; height: 100%; }

/* 1-zeiliger Karussell-Slider (Produkte/Hersteller/Bilder): feste Item-Breite, Prev/Next + Punkte, Autoplay.
   Hoehen-Flexbox, damit der Viewport eine definierte Hoehe hat -> ec-slider.js skaliert die Tiles per
   transform:scale auf die Panel-Hoehe herunter (nie ueber 100%). */
.crs-easycreator-story .ec-slider { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; }
.crs-easycreator-story .ec-slider-viewport { overflow: hidden; width: 100%; flex: 1 1 auto; min-height: 0; }
.crs-easycreator-story .ec-slider-track { display: flex; flex-wrap: nowrap; gap: 16px; transition: transform .4s ease; will-change: transform; transform-origin: top left; align-items: flex-start; }
.crs-easycreator-story .ec-slider-track > * { flex: 0 0 auto; width: 240px; }
.crs-easycreator-story .ec-slider-dots { flex: 0 0 auto; }
.crs-easycreator-story .ec-slider-prev,
.crs-easycreator-story .ec-slider-next {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(0, 0, 0, .55); color: #fff; font-size: 24px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.crs-easycreator-story .ec-slider-prev { left: 6px; }
.crs-easycreator-story .ec-slider-next { right: 6px; }
.crs-easycreator-story .ec-slider-prev:hover,
.crs-easycreator-story .ec-slider-next:hover { background: rgba(0, 0, 0, .75); }

/* Story-Slider: Pfeile kleiner, helleres Grau, ~15px vom Rand nach innen. */
.crs-easycreator-story .ec-slider--story .ec-slider-prev,
.crs-easycreator-story .ec-slider--story .ec-slider-next {
    width: 32px; height: 32px; font-size: 19px; background: rgba(0, 0, 0, .3);
}
.crs-easycreator-story .ec-slider--story .ec-slider-prev { left: 15px; }
.crs-easycreator-story .ec-slider--story .ec-slider-next { right: 15px; }
.crs-easycreator-story .ec-slider--story .ec-slider-prev:hover,
.crs-easycreator-story .ec-slider--story .ec-slider-next:hover { background: rgba(0, 0, 0, .45); }
.crs-easycreator-story .ec-slider-dots { display: flex; justify-content: center; gap: 7px; margin-top: 10px; }
.crs-easycreator-story .ec-slider-dot { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .25); cursor: pointer; }
.crs-easycreator-story .ec-slider-dot.active { background: #347468; }

/* Bilder-Slider: Slides fuellen die Panel-Hoehe */
.crs-easycreator-story .ec-slider--pic,
.crs-easycreator-story .ec-slider--pic .ec-slider-viewport,
.crs-easycreator-story .ec-slider--pic .ec-slider-track,
.crs-easycreator-story .ec-slider--pic .ec-slider-track > * { height: 100%; }
.crs-easycreator-story .ec-slider--pic .ec-slider-track > * { min-height: 140px; }
.crs-easycreator-story .ec-pic-slide { border-radius: inherit; overflow: hidden; }
.crs-easycreator-story .ec-pic-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Single-Mode: jeweils 1 Bild ueber die volle Panel-Breite (perView=1, wechselt durch). */
.crs-easycreator-story .ec-slider--single .ec-slider-track > * { width: 100%; }

/* Story-Slider (Story-Typ "Slider"): jede Seite ist ein vollwertiger Story-Rahmen, genau 1 Seite pro
   Ansicht, kein Fit-Scaling. Horizontal = nebeneinander (translateX), vertikal = untereinander (translateY). */
.crs-easycreator-story .ec-slider--story { width: 100%; }
.crs-easycreator-story .ec-slider--story .ec-slider-viewport { overflow: hidden; width: 100%; flex: none; min-height: 0; }
.crs-easycreator-story .ec-slider--story .ec-slider-track { display: flex; gap: 0; transform-origin: top left; transition: transform .5s ease; will-change: transform; }
.crs-easycreator-story .ec-slider--story:not(.ec-slider--vert) .ec-slider-track { flex-direction: row; align-items: stretch; }
.crs-easycreator-story .ec-slider--story.ec-slider--vert .ec-slider-track { flex-direction: column; }
.crs-easycreator-story .ec-slider--story .ec-slider-page { flex: 0 0 100%; width: 100%; min-width: 0; height: auto; position: relative; }

/* Ueberblenden (fade) + Verpixeln (pixel): Slides gestapelt statt geschoben; JS setzt die Viewport-Hoehe. */
.crs-easycreator-story .ec-slider--fade .ec-slider-track,
.crs-easycreator-story .ec-slider--pixel .ec-slider-track { display: block; position: relative; height: 100%; transform: none !important; transition: none; gap: 0; }
.crs-easycreator-story .ec-slider--fade .ec-slider-page,
.crs-easycreator-story .ec-slider--pixel .ec-slider-page { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.crs-easycreator-story .ec-slider--fade .ec-slider-page { transition: opacity .55s ease; }
.crs-easycreator-story .ec-slider--pixel .ec-slider-page { transition: none; }
.crs-easycreator-story .ec-slider--fade .ec-slider-page.ec-slide-on,
.crs-easycreator-story .ec-slider--pixel .ec-slider-page.ec-slide-on { opacity: 1; }

/* Fit-Modus: ganzes Bild sichtbar (contain) statt Panel-fuellend (cover). */
.crs-easycreator-story .ec-slider--fit .ec-pic-slide img { object-fit: contain; }

/* Maximieren: Klick-Cursor auf den Bildern. */
.crs-easycreator-story .ec-slider--maximize .ec-pic-slide img { cursor: zoom-in; }

/* Lightbox (an <body> gehaengt, daher NICHT unter .crs-easycreator-story gescopt). */
.ec-lightbox {
    position: fixed; inset: 0; z-index: 2000000; display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .92); opacity: 0; transition: opacity .2s ease;
}
.ec-lightbox.ec-lightbox-on { opacity: 1; }
.ec-lightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.ec-lightbox-close,
.ec-lightbox-prev,
.ec-lightbox-next {
    position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0;
    border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 28px; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ec-lightbox-close { top: 18px; right: 18px; transform: none; width: 42px; height: 42px; font-size: 24px; }
.ec-lightbox-prev { left: 18px; }
.ec-lightbox-next { right: 18px; }
.ec-lightbox-close:hover,
.ec-lightbox-prev:hover,
.ec-lightbox-next:hover { background: rgba(255, 255, 255, .3); }

/* Editor: Bild-Picker (Thumbnails) fuer den Picture-Slider */
.ec-pic-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.ec-pic-thumb { position: relative; width: 64px; height: 64px; border-radius: 4px; overflow: hidden; border: 1px solid #dfe5e3; }
.ec-pic-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ec-pic-thumb-rm {
    position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; line-height: 1;
    border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; padding: 0; font-size: 13px;
}
.ec-pic-thumb-rm:hover { background: rgba(200,0,0,.85); }
.ec-pic-dropzone {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 64px; padding: 12px; margin-top: 4px;
    border: 2px dashed #b9c6d6; border-radius: 6px; background: #f7faff;
    color: #51637a; font-size: 13px; cursor: pointer; text-align: center;
}
.ec-pic-dropzone.ec-pic-over { border-color: #347468; background: #eef6f3; }
.ec-pic-dropzone.ec-pic-busy { opacity: .6; pointer-events: none; }
.ec-pic-dropzone i { font-size: 18px; }
.crs-easycreator-story .ec-catalog-node .ec-panel-content { overflow: hidden; }
.crs-easycreator-story .ec-catalog-fit { transform-origin: top left; }

.crs-easycreator-story .ec-embed {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 240px;
    overflow: hidden;
    border-radius: inherit;
}
.crs-easycreator-story .ec-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.crs-easycreator-story .ec-embed .ec-map-link {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
}
.crs-easycreator-story video.ec-embed {
    object-fit: cover;
    background: #000;
}
.crs-easycreator-story .ec-embed--frame { background: #f5f5f5; }
.crs-easycreator-story .ec-frame-open {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 4;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    text-decoration: none;
}
.crs-easycreator-story .ec-frame-open:hover { background: rgba(0, 0, 0, .8); color: #fff; }

/* ---- PDF-Inline-Viewer ---- */
.crs-easycreator-story .ec-embed--pdf { min-height: 480px; background: #525659; }

/* ---- Topic-Einbettung ---- */
.crs-easycreator-story .ec-topic { width: 100%; }
.crs-easycreator-story .ec-topic-title { margin-top: 0; }

/* ---- Eingebettete Story ---- */
.crs-easycreator-story .ec-embed-story { width: 100%; }

/* ---- Katalog-Panel Platzhalter (nur Editor-Vorschau; im Frontend live ersetzt) ---- */
.crs-easycreator-story .ec-catalog-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px dashed #b9c6d6;
    border-radius: inherit;
    background: repeating-linear-gradient(45deg, #f4f7fb, #f4f7fb 10px, #eef2f7 10px, #eef2f7 20px);
    color: #51637a;
    font-weight: 600;
    text-align: center;
}

/* ---- Katalog-Panel Editor-Zahlenfelder ---- */
.ec-catalog-nums { display: flex; gap: 8px; margin-top: 6px; }
.ec-catalog-nums label { flex: 1 1 0; font-size: 12px; color: #6b7a76; display: flex; flex-direction: column; gap: 2px; }
.crs-easycreator-story .ec-img { display: block; max-width: 100%; height: auto; border-radius: inherit; }
.crs-easycreator-story .ec-img:not(.ec-logo) { width: 100%; }
.crs-easycreator-story .ec-logo { width: auto; }

/* Bild an Panel-Groesse skalieren (Bild + Logo): fit = contain, zoom = cover. Fuellt die Panel-Box,
   damit das Bild nicht in Originalgroesse ueberlaeuft. !important, damit Theme-img-Regeln (auch im
   Editor-Preview-iframe) es nicht ueberschreiben. */
.crs-easycreator-story .ec-img.ec-img--fit,
.crs-easycreator-story .ec-img.ec-img--zoom {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}
.crs-easycreator-story .ec-img.ec-img--fit { object-fit: contain !important; }
.crs-easycreator-story .ec-img.ec-img--zoom { object-fit: cover !important; }
.crs-easycreator-story .ec-img-link { display: block; width: 100%; height: 100%; }

/* ---- Per-Ansicht Style-Sektionen (Desktop/Tablet/Phone) ---- */
.ec-style-stage { display: none; }
.ec-style-stage.ec-stage-active { display: block; }
.ec-stage-label { font-size: 11px; font-weight: 600; color: #307abe; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
.ec-stage-hint { font-size: 11px; color: #6b7a76; margin-bottom: 8px; }

/* ---- Grid-Umschalter im Hintergrund-Config ---- */
.ec-grid-toggle { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.ec-grid-size { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #6b7a76; }
.ec-grid-size input { width: 72px; }

/* Editor-Raster als Overlay ueber dem Inhalt (auch ueber Hintergrundbildern sichtbar), klick-transparent,
   unter den Drag-Griffen (z-index 99999). */
.ec-grid-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 90000; }

/* ---- Panel-Liste im Hintergrund-Config ---- */
.ec-panel-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }

/* ---- Auto-Arrange je RWP-Stufe (CSS-Grid am Root) ----
   Der Root-Container traegt je Stufe eine Klasse ec-arr-{d|t|p}-{stacked|2col|3col|quarter} (Free => keine
   Klasse => absolute Positionierung). Die Grid-Regeln setzen die absolute Positionierung der direkten Panels
   zurueck und ordnen sie in Lesereihenfolge (Listen-Reihenfolge) ins Grid. Greift in Editor-Preview UND
   Frontend (kein :not(.ec-edit-preview)), damit die Vorschau die Anordnung 1:1 zeigt. */
.crs-easycreator-story .ec-node { max-width: 100%; }

@media (min-width: 1025px) {
    .crs-easycreator-story [class*="ec-arr-d-"].ec-container { display: grid !important; gap: var(--ec-gap, 16px); align-content: start; height: auto !important; }
    .crs-easycreator-story [class*="ec-arr-d-"] > .ec-node { position: relative !important; inset: auto !important; width: auto !important; height: auto !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; transform: none !important; order: 0 !important; margin: 0 !important; }
    .crs-easycreator-story .ec-arr-d-stacked.ec-container { grid-template-columns: 1fr; }
    .crs-easycreator-story .ec-arr-d-2col.ec-container { grid-template-columns: repeat(2, 1fr); }
    .crs-easycreator-story .ec-arr-d-3col.ec-container { grid-template-columns: repeat(3, 1fr); }
    .crs-easycreator-story .ec-arr-d-quarter.ec-container { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; }
    .crs-easycreator-story .ec-arr-d-4col.ec-container { grid-template-columns: repeat(4, 1fr); }
    .crs-easycreator-story .ec-arr-d-autofit.ec-container { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
    .crs-easycreator-story .ec-arr-d-sidebar.ec-container { grid-template-columns: 1fr 2fr; }
    .crs-easycreator-story .ec-arr-d-sidebar-r.ec-container { grid-template-columns: 2fr 1fr; }
    .crs-easycreator-story .ec-arr-d-readable.ec-container { grid-template-columns: minmax(0, 720px); justify-content: center; }
    .crs-easycreator-story .ec-arr-d-masonry.ec-container { display: block !important; column-count: 3; column-gap: var(--ec-gap, 16px); }
    .crs-easycreator-story .ec-arr-d-masonry.ec-container > .ec-node { display: block; break-inside: avoid; -webkit-column-break-inside: avoid; margin: 0 0 16px 0 !important; }
}
@media (min-width: 641px) and (max-width: 1024px) {
    .crs-easycreator-story [class*="ec-arr-t-"].ec-container { display: grid !important; gap: var(--ec-gap, 16px); align-content: start; height: auto !important; padding-left: clamp(16px,4vw,32px); padding-right: clamp(16px,4vw,32px); }
    .crs-easycreator-story [class*="ec-arr-t-"] > .ec-node { position: relative !important; inset: auto !important; width: auto !important; height: auto !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; transform: none !important; order: 0 !important; margin: 0 !important; }
    .crs-easycreator-story .ec-arr-t-stacked.ec-container { grid-template-columns: 1fr; }
    .crs-easycreator-story .ec-arr-t-2col.ec-container { grid-template-columns: repeat(2, 1fr); }
    .crs-easycreator-story .ec-arr-t-3col.ec-container { grid-template-columns: repeat(3, 1fr); }
    .crs-easycreator-story .ec-arr-t-quarter.ec-container { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; }
    .crs-easycreator-story .ec-arr-t-4col.ec-container { grid-template-columns: repeat(4, 1fr); }
    .crs-easycreator-story .ec-arr-t-autofit.ec-container { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .crs-easycreator-story .ec-arr-t-sidebar.ec-container { grid-template-columns: 1fr 2fr; }
    .crs-easycreator-story .ec-arr-t-sidebar-r.ec-container { grid-template-columns: 2fr 1fr; }
    .crs-easycreator-story .ec-arr-t-readable.ec-container { grid-template-columns: minmax(0, 640px); justify-content: center; }
    .crs-easycreator-story .ec-arr-t-masonry.ec-container { display: block !important; column-count: 2; column-gap: var(--ec-gap, 16px); }
    .crs-easycreator-story .ec-arr-t-masonry.ec-container > .ec-node { display: block; break-inside: avoid; -webkit-column-break-inside: avoid; margin: 0 0 16px 0 !important; }
}
@media (max-width: 640px) {
    .crs-easycreator-story [class*="ec-arr-p-"].ec-container { display: grid !important; gap: var(--ec-gap, 14px); align-content: start; height: auto !important; padding-left: clamp(14px,5vw,24px); padding-right: clamp(14px,5vw,24px); }
    .crs-easycreator-story [class*="ec-arr-p-"] > .ec-node { position: relative !important; inset: auto !important; width: auto !important; height: auto !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; transform: none !important; order: 0 !important; margin: 0 !important; }
    .crs-easycreator-story .ec-arr-p-stacked.ec-container { grid-template-columns: 1fr; }
    .crs-easycreator-story .ec-arr-p-2col.ec-container { grid-template-columns: repeat(2, 1fr); }
    .crs-easycreator-story .ec-arr-p-3col.ec-container { grid-template-columns: repeat(3, 1fr); }
    .crs-easycreator-story .ec-arr-p-quarter.ec-container { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; }
    .crs-easycreator-story .ec-arr-p-4col.ec-container { grid-template-columns: repeat(4, 1fr); }
    .crs-easycreator-story .ec-arr-p-autofit.ec-container { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .crs-easycreator-story .ec-arr-p-sidebar.ec-container { grid-template-columns: 1fr 2fr; }
    .crs-easycreator-story .ec-arr-p-sidebar-r.ec-container { grid-template-columns: 2fr 1fr; }
    .crs-easycreator-story .ec-arr-p-readable.ec-container { grid-template-columns: 1fr; }
    .crs-easycreator-story .ec-arr-p-masonry.ec-container { display: block !important; column-count: 2; column-gap: var(--ec-gap, 14px); }
    .crs-easycreator-story .ec-arr-p-masonry.ec-container > .ec-node { display: block; break-inside: avoid; -webkit-column-break-inside: avoid; margin: 0 0 14px 0 !important; }
}

/* ---- Story-Container (lineare Liste eingebetteter Stories) ---- */
.crs-easycreator-story .ec-slist { width: 100%; box-sizing: border-box; }
.crs-easycreator-story .ec-slist-item { width: 100%; min-width: 0; }
.crs-easycreator-story .ec-slist-item > .crs-easycreator-story { margin: 0; }

/* ---- Position je RWP-Stufe ---- */
.ec-pos-stages { display: flex; flex-direction: column; gap: 4px; padding: 8px; background: #fafcfb; border: 1px solid #e8eeec; border-radius: 6px; }
.ec-pos-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 2px 4px; border-radius: 4px; }
/* Stufen-Zeilen (Position + Sichtbarkeit): nur die zur aktuellen Preview-Stufe gehoerende ist sichtbar
   (markPosRow setzt ec-pos-row--active). Zeilen ohne data-stage (Z/Rotation, Hover-Zoom) bleiben immer da. */
.ec-pos-row[data-stage] { display: none; }
.ec-pos-row[data-stage].ec-pos-row--active { display: flex; }
.ec-pos-row--active { background: #eef4f2; }
.ec-pos-stage { flex: 0 0 72px; font-size: 11px; font-weight: 600; color: #6b7a76; }
.ec-pos-row > label { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 11px; color: #6b7a76; }
.ec-pos-row > label input[type="number"] { width: 104px; }
.ec-span-fld { font-weight: 600; color: #2c6b5f !important; }
.ec-span-fld input[type="number"] { width: 56px !important; }

/* ---- Anker-Pad (WinForms-artiges Kreuz: Kante aktiv = an dieser Kante verankert) ---- */
/* Ein Anker-Kreuz, das der Preview-Stufe folgt: die 3 ec-style-stage-Pads teilen sich den Platz,
   nur das aktive (markStyleStage) ist sichtbar. */
.ec-anchor-block { display: flex; align-items: center; gap: 12px; padding: 4px 4px 8px 76px; }
.ec-anchor-lbl { font-size: 11px; font-weight: 600; color: #6b7a76; display: inline-flex; align-items: center; gap: 5px; }
.ec-anchor-block .ec-style-stage { display: none; }
.ec-anchor-block .ec-style-stage.ec-stage-active { display: block; }
.ec-vis-check { font-size: 11px; color: #6b7a76; margin-left: 6px; }
.ec-anchor-pad { display: grid; grid-template-columns: repeat(3, 26px); grid-template-rows: repeat(3, 26px); gap: 3px; }
.ec-anchor-pad .ec-anchor-top { grid-column: 2; grid-row: 1; }
.ec-anchor-pad .ec-anchor-left { grid-column: 1; grid-row: 2; }
.ec-anchor-pad .ec-anchor-core { grid-column: 2; grid-row: 2; border: 1px dashed #b9cfca; border-radius: 3px; background: #eef4f2; }
.ec-anchor-pad .ec-anchor-right { grid-column: 3; grid-row: 2; }
.ec-anchor-pad .ec-anchor-bottom { grid-column: 2; grid-row: 3; }
.ec-anchor-btn { display: flex; align-items: center; justify-content: center; margin: 0; border: 1px solid #ccd6d3; border-radius: 4px; background: #fff; cursor: pointer; color: #9aa8a4; font-size: 13px; user-select: none; }
.ec-anchor-btn input { position: absolute; opacity: 0; pointer-events: none; }
.ec-anchor-btn:hover { border-color: #347468; }
.ec-anchor-btn:has(input:checked) { background: #347468; border-color: #347468; color: #fff; }

/* ---- Panel-Auswahlleiste (immer sichtbar, ausserhalb Hintergrund-Config) ---- */
.ec-panel-list--bar { padding: 8px; background: #f0f4f3; border: 1px solid #e3eae8; border-radius: 6px; margin-bottom: 10px; }

/* ---- Accordion-Stack (linker Editor-Bereich) ---- */
.ec-acc { display: flex; flex-direction: column; gap: 6px; }
.ec-list-hint { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.35; color: #4a5a55; background: #eef4f2; border: 1px solid #d3e2dd; border-radius: 6px; }
.ec-list-hint.ec-hidden { display: none; }
.ec-list-hint-icon { margin-top: 1px; color: #347468; }
.ec-list-hint > span { flex: 1; }
.ec-list-hint-x { flex: 0 0 auto; border: 0; background: transparent; color: #6b7a76; font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px; border-radius: 4px; }
.ec-list-hint-x:hover { color: #223; background: rgba(0, 0, 0, .06); }
.ec-acc-item { border: 1px solid #dfe5e3; border-radius: 6px; background: #fff; }
.ec-acc-item--bg { background: #e7eeec; border-color: #b9cfca; }
.ec-acc-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; user-select: none; font-weight: 600; font-size: 13px; border-radius: 6px; }
.ec-acc-item--bg .ec-acc-head { background: #d7e2de; }
.ec-acc-drag { cursor: grab; color: #9aa6a2; }
.ec-acc-title { flex: 1; }
.ec-acc-actions { margin-left: auto; }
.ec-acc-body { display: none; padding: 10px; border-top: 1px solid #e8eeec; }
.ec-acc-item.ec-open > .ec-acc-body { display: block; }
.ec-acc-item.ec-open > .ec-acc-head { background: #347468; color: #fff; }
.ec-acc-item--bg.ec-open > .ec-acc-head { background: #2b5f55; color: #fff; }

/* ---- Summernote-Editierflaeche im EasyCreator-Editor neutral-grau ----
   Der echte Panel-Hintergrund ist oft dunkel oder ein Bild; auf weisser Editier-Flaeche waeren weisse
   Texte unsichtbar. Ein mittleres Grau macht sowohl helle als auch dunkle Schrift beim Verfassen lesbar.
   Gilt nur im Plugin (easycreator.css wird ausschliesslich in den EasyCreator-Editoren geladen). */
.note-editable { background-color: #dfe2e6 !important; }
.note-editable::selection { background: rgba(52,116,104,.55); }
