/* PHASE D5.1: Ownership split from achievement-center-shell.css.
   Values are preserved intentionally; no visual redesign intended. */
.cert-preview-actions {
                margin-top: 14px;
                justify-content: flex-start;
            }

            .cert-field-tabs button.muted {
                opacity: .55;
                text-decoration: line-through;
            }

            .cert-color-row {
                display: grid;
                gap: 8px;
                margin-top: 4px;
            }

            .cert-color-row > span {
                color: #6f624d;
                font-weight: 900;
                font-size: 13px;
            }

            .cert-swatches {
                display: grid;
                grid-template-columns: repeat(10, 28px);
                gap: 8px;
                align-items: center;
            }

            .cert-swatches button {
                width: 28px;
                height: 28px;
                border-radius: 999px;
                border: 2px solid #fff;
                outline: 1px solid #d7c8aa;
                cursor: pointer;
                box-shadow: 0 4px 12px rgba(0,0,0,.08);
            }

            .cert-swatches button.active {
                outline: 3px solid #143d2c;
                transform: scale(1.08);
            }

            .cert-swatches button:disabled {
                opacity: .35;
                cursor: not-allowed;
            }

            .cert-color-custom {
                margin-top: 8px;
            }

            .cert-preview {
                border: 1px dashed #d7c8aa;
                border-radius: 18px;
                background: #fffaf0;
                min-height: 260px;
                overflow: hidden;
                display: grid;
                place-items: center;
                text-align: center;
                color: #8b7650;
                font-weight: 900;
            }

            .cert-preview img {
                width: 100%;
                max-height: 430px;
                object-fit: contain;
                background: #f6efe0;
                display: block;
            }

            .cert-help {
                background: #f7f2e6;
                border: 1px solid #eadfca;
                border-radius: 16px;
                padding: 13px;
                color: #695a3d;
                font-weight: 800;
                line-height: 1.8;
                font-size: 13px;
            }

            .cert-fields-grid {
                display: grid;
                gap: 12px;
            }

            .cert-field-box {
                border: 1px solid #eadfca;
                border-radius: 16px;
                padding: 13px;
                background: #fffdf8;
                display: grid;
                gap: 10px;
            }

            .cert-field-box strong {
                color: #143d2c;
            }

            .cert-mini-grid {
                display: grid;
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 8px;
            }

            .cert-mini-grid label {
                display: grid;
                gap: 5px;
                font-size: 12px;
                font-weight: 900;
                color: #6f624d;
            }

            .cert-mini-grid input,
            .cert-mini-grid select {
                padding: 9px;
                border-radius: 10px;
                border: 1px solid #ded4c2;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 800;
            }

            .cert-template-item {
                border: 1px solid #eadfca;
                border-radius: 18px;
                padding: 14px;
                display: grid;
                grid-template-columns: 120px minmax(0, 1fr) auto;
                gap: 14px;
                align-items: center;
                background: #fff;
            }

            .cert-template-thumb {
                height: 76px;
                border-radius: 12px;
                background: #f7f2e6;
                object-fit: cover;
                width: 120px;
                border: 1px solid #eadfca;
            }

            .cert-template-info {
                display: grid;
                gap: 5px;
            }

            .cert-template-info strong {
                color: #143d2c;
                font-size: 17px;
            }

            .cert-template-info small {
                color: #8b7650;
                font-weight: 800;
            }

            .cert-visual-stage {
                position: relative;
                width: 100%;
                display: inline-block;
                line-height: 0;
                user-select: none;
                touch-action: none;
            }

            .cert-visual-stage img {
                width: 100%;
                max-height: 520px;
                object-fit: contain;
                display: block;
                background: #f6efe0;
            }

            .cert-visual-layer {
                position: absolute;
                inset: 0;
                pointer-events: none;
            }

            .cert-drag-text {
                position: absolute;
                z-index: 5;
                line-height: 1.35;
                padding: 0;
                border: 2px dashed rgba(184,134,43,.55);
                background: rgba(255,255,255,.32);
                border-radius: 10px;
                cursor: grab;
                pointer-events: auto;
                min-height: 24px;
                box-sizing: border-box;
                text-shadow: 0 1px 0 rgba(255,255,255,.5);
            }

            .cert-drag-text.active {
                border-color: #0f766e;
                background: rgba(236,253,243,.72);
                box-shadow: 0 0 0 4px rgba(15,118,110,.14);
            }

            .cert-drag-text.dragging {
                cursor: grabbing;
                box-shadow: 0 14px 34px rgba(0,0,0,.18);
            }

            .cert-field-tabs {
                display: grid;
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 8px;
                margin-bottom: 12px;
            }

            .cert-field-tabs button {
                border: 1px solid #eadfca;
                background: #fffaf0;
                color: #143d2c;
                border-radius: 14px;
                padding: 11px;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 900;
                cursor: pointer;
            }

            .cert-field-tabs button.active {
                background: #143d2c;
                color: #fff;
                border-color: #143d2c;
            }

            .cert-mini-grid.visual {
                grid-template-columns: repeat(5, minmax(0, 1fr));
            }

            .cert-color-picker-row {
                display: grid;
                grid-template-columns: 120px minmax(0, 1fr);
                gap: 12px;
                align-items: end;
                margin-top: 10px;
            }

            .cert-color-picker-label,
            .cert-color-code-label {
                display: grid;
                gap: 7px;
                font-weight: 900;
                color: #6f624d;
                font-size: 13px;
            }

            .cert-color-picker-label input[type="color"] {
                width: 100%;
                height: 46px;
                border: 1px solid #ded4c2;
                border-radius: 14px;
                padding: 4px;
                background: #fff;
                cursor: pointer;
            }

            .cert-color-code-label input {
                height: 46px;
                border: 1px solid #ded4c2;
                border-radius: 14px;
                padding: 0 12px;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 900;
                direction: ltr;
                text-align: left;
            }

            .cert-smart-actions {
                display: grid;
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 8px;
                margin: 14px 0;
            }

            .cert-smart-actions button {
                border: 1px solid #eadfca;
                background: linear-gradient(180deg, #fffaf0, #f7edd7);
                color: #143d2c;
                border-radius: 14px;
                padding: 11px 9px;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 950;
                cursor: pointer;
                transition: .15s ease;
            }

            .cert-smart-actions button.hide {
                background: linear-gradient(180deg, #fff1f1, #ffe4e4);
                color: #b42318;
                border-color: #ffc9c9;
            }

            .cert-smart-actions button.show {
                background: linear-gradient(180deg, #ecfdf3, #d1fadf);
                color: #087443;
                border-color: #abefc6;
            }

            .cert-smart-actions button:hover {
                transform: translateY(-1px);
                box-shadow: 0 10px 22px rgba(20,61,44,.10);
            }

            .cert-inline-tools {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 10px;
                margin-bottom: 12px;
            }

            .cert-stepper {
                display: grid;
                grid-template-columns: auto 42px minmax(70px, 1fr) 42px;
                align-items: center;
                gap: 7px;
                background: #fffaf0;
                border: 1px solid #eadfca;
                border-radius: 16px;
                padding: 9px;
            }

            .cert-stepper span {
                font-weight: 950;
                color: #6f624d;
                font-size: 13px;
            }

            .cert-stepper button {
                width: 42px;
                height: 38px;
                border: 0;
                border-radius: 12px;
                background: #143d2c;
                color: #fff;
                font-size: 20px;
                font-weight: 950;
                cursor: pointer;
            }

            .cert-stepper input {
                height: 38px;
                border: 1px solid #ded4c2;
                border-radius: 12px;
                text-align: center;
                font-weight: 950;
                font-family: Cairo, system-ui, sans-serif;
            }

            .cert-tools-card.compact {
                padding-bottom: 14px;
            }

            .cert-field-box.compact {
                padding: 12px;
            }

            .cert-one-line-toolbar {
                display: grid;
                grid-template-columns:
                    minmax(210px, 1.35fr)
                    minmax(138px, .68fr)
                    minmax(190px, .95fr)
                    minmax(110px, .55fr)
                    minmax(100px, .50fr)
                    62px
                    minmax(125px, .62fr);
                gap: 9px;
                align-items: end;
            }

            .cert-one-line-toolbar .tool {
                display: grid;
                gap: 5px;
                min-width: 0;
            }

            .cert-one-line-toolbar .tool span {
                font-size: 11px;
                font-weight: 950;
                color: #6f624d;
                white-space: nowrap;
            }

            .cert-one-line-toolbar select,
            .cert-one-line-toolbar input[type="text"],
            .cert-one-line-toolbar input[type="number"] {
                height: 40px;
                border: 1px solid #ded4c2;
                border-radius: 12px;
                background: #fff;
                color: #143d2c;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 900;
                padding: 0 9px;
                min-width: 0;
            }

            .cert-one-line-toolbar input[type="number"] {
                text-align: center;
            }

            .cert-smart-actions.compact {
                grid-template-columns: repeat(5, minmax(0, 1fr));
                margin: 10px 0 0;
            }
@media (max-width: 1400px) {

                .cert-one-line-toolbar {
                    grid-template-columns: repeat(4, minmax(0, 1fr));
                }
}


            .cert-template-list.upgraded {
                display: grid;
                gap: 12px;
            }

            .cert-template-item.upgraded {
                display: grid;
                grid-template-columns: 112px minmax(0, 1fr);
                gap: 12px;
                padding: 13px;
                border: 1px solid #eadfca;
                border-radius: 18px;
                background: #fffdf8;
            }

            .cert-template-item.upgraded.active {
                border-color: #143d2c;
                box-shadow: 0 0 0 4px rgba(20,61,44,.10);
            }

            .cert-template-thumb.big {
                width: 112px;
                height: 78px;
                border-radius: 14px;
                overflow: hidden;
                border: 1px solid #eadfca;
                background: #f7f0df;
                display: grid;
                place-items: center;
            }

            .cert-template-thumb.big img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }

            .cert-template-title-row {
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 8px;
            }

            .cert-template-title-row strong {
                color: #143d2c;
                font-weight: 950;
            }

            .cert-template-title-row span {
                padding: 4px 8px;
                border-radius: 999px;
                font-size: 11px;
                font-weight: 950;
            }

            .cert-template-title-row span.active {
                background: #ecfdf3;
                color: #087443;
            }

            .cert-template-title-row span.inactive {
                background: #fff1f1;
                color: #b42318;
            }

            .cert-template-meta {
                display: flex;
                gap: 8px;
                flex-wrap: wrap;
                margin-top: 6px;
                color: #8a6a28;
                font-size: 12px;
                font-weight: 850;
            }

            .cert-template-actions {
                grid-column: 1 / -1;
                display: flex;
                gap: 8px;
                flex-wrap: wrap;
                justify-content: flex-start;
            }

            .cert-template-actions .cert-btn {
                padding: 9px 13px;
                border-radius: 12px;
            }

            .cert-template-list.compact {
                display: grid;
                gap: 10px;
            }

            .cert-template-item.compact {
                display: grid;
                grid-template-columns: 82px minmax(0, 1fr);
                gap: 10px;
                align-items: center;
                padding: 10px;
                border: 1px solid #eadfca;
                border-radius: 16px;
                background: #fffdf8;
            }

            .cert-template-item.compact.active {
                border-color: #143d2c;
                box-shadow: 0 0 0 3px rgba(20,61,44,.10);
            }

            .cert-template-thumb.compact {
                width: 82px;
                height: 58px;
                border-radius: 12px;
                overflow: hidden;
                border: 1px solid #eadfca;
                background: #f7f0df;
                display: grid;
                place-items: center;
                color: #8a6a28;
                font-size: 11px;
                font-weight: 900;
            }

            .cert-template-thumb.compact img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }

            .cert-template-main.compact {
                min-width: 0;
                display: grid;
                gap: 8px;
            }

            .cert-template-title-row.compact {
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 8px;
            }

            .cert-template-title-row.compact strong {
                color: #143d2c;
                font-weight: 950;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .cert-template-title-row.compact span {
                flex: 0 0 auto;
                padding: 4px 8px;
                border-radius: 999px;
                font-size: 10px;
                font-weight: 950;
            }

            .cert-template-title-row.compact span.active {
                background: #ecfdf3;
                color: #087443;
            }

            .cert-template-title-row.compact span.inactive {
                background: #fff1f1;
                color: #b42318;
            }

            .cert-template-actions.compact {
                display: grid;
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 6px;
            }

            .cert-template-actions.compact .cert-btn {
                padding: 8px 6px;
                border-radius: 11px;
                font-size: 12px;
                font-weight: 950;
                min-width: 0;
            }

            .cert-template-hint {
                padding: 12px 13px;
                border-radius: 13px;
                background: #fff8e6;
                color: #8a5a00;
                border: 1px solid #f1d28a;
                font-weight: 900;
                line-height: 1.6;
            }

            .cert-drag-photo {
                position: absolute;
                z-index: 8;
                overflow: hidden;
                border: 2px dashed rgba(20,61,44,.75);
                background: rgba(255,255,255,.35);
                cursor: grab;
                box-shadow: 0 8px 22px rgba(20,61,44,.10);
            }

            .cert-drag-photo.active {
                border-color: #bd861b;
                box-shadow: 0 0 0 4px rgba(189,134,27,.18);
            }

            .cert-drag-photo img {
                width: 100%;
                height: 100%;
                display: block;
                object-fit: cover;
            }

            .cert-color-line {
                display: grid;
                grid-template-columns: 170px minmax(0, 1fr);
                gap: 8px;
                margin-top: 10px;
            }

            .cert-color-line label {
                display: grid;
                gap: 5px;
                color: #6f624d;
                font-size: 12px;
                font-weight: 950;
            }

            .cert-color-line input {
                border: 1px solid #ded4c2;
                border-radius: 12px;
                background: #fff;
                color: #143d2c;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 850;
                padding: 9px 10px;
                height: 42px;
            }

            .cert-color-line input[type="color"] {
                padding: 3px;
                cursor: pointer;
            }

            .cert-field-tabs.one-line {
                display: grid;
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 8px;
                margin-bottom: 12px;
            }

            .cert-field-tabs.one-line button {
                min-height: 46px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                font-size: 14px;
            }

            .cert-photo-control-bar {
                display: grid;
                grid-template-columns: 1.1fr 1.1fr .85fr .85fr 1fr auto;
                gap: 8px;
                align-items: end;
                margin-bottom: 10px;
            }

            .cert-photo-control-bar label {
                min-width: 0;
                display: grid;
                grid-template-columns: 34px minmax(58px, 1fr) 34px;
                grid-template-areas:
                    "title title title"
                    "minus input plus";
                gap: 5px;
                color: #6f624d;
                font-size: 12px;
                font-weight: 950;
            }

            .cert-photo-control-bar label > span {
                grid-area: title;
                text-align: center;
            }

            .cert-photo-control-bar label button {
                border: 0;
                border-radius: 10px;
                background: #143d2c;
                color: #fff;
                font-weight: 950;
                cursor: pointer;
                min-height: 36px;
            }

            .cert-photo-control-bar label button:first-of-type {
                grid-area: minus;
            }

            .cert-photo-control-bar label button:last-of-type {
                grid-area: plus;
            }

            .cert-photo-control-bar input,
            .cert-photo-control-bar select {
                grid-area: input;
                width: 100%;
                min-width: 0;
                border: 1px solid #ded4c2;
                border-radius: 10px;
                background: #fff;
                color: #143d2c;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 900;
                text-align: center;
                padding: 8px 6px;
                min-height: 36px;
            }

            .cert-photo-control-bar .select-only {
                grid-template-columns: 1fr;
                grid-template-areas:
                    "title"
                    "input";
            }

            .cert-photo-control-bar .cert-mini-action {
                min-width: 115px;
                height: 36px;
                align-self: end;
            }

            .cert-smart-actions.photo-actions {
                grid-template-columns: repeat(4, minmax(0, 1fr));
            }

            .cert-drag-photo {
                touch-action: none;
                user-select: none;
            }
@media (max-width: 1200px) {

                .cert-photo-control-bar {
                    grid-template-columns: repeat(3, minmax(0, 1fr));
                }


                .cert-photo-control-bar .cert-mini-action {
                    width: 100%;
                    min-width: 0;
                }
}

@media (max-width: 760px) {

                .cert-field-tabs.one-line {
                    grid-template-columns: repeat(4, minmax(0, 1fr));
                    gap: 5px;
                }


                .cert-field-tabs.one-line button {
                    min-height: 42px;
                    font-size: 11px;
                    padding: 8px 4px;
                }


                .cert-photo-control-bar {
                    grid-template-columns: repeat(2, minmax(0, 1fr));
                    gap: 7px;
                }


                .cert-smart-actions.photo-actions {
                    grid-template-columns: repeat(2, minmax(0, 1fr));
                }
}


            .cert-drag-photo {
                touch-action: none !important;
                user-select: none !important;
                overflow: visible !important;
                border: 2px solid rgba(20,61,44,.95) !important;
                outline: 2px dashed rgba(255,255,255,.95);
                outline-offset: -5px;
            }

            .cert-drag-photo img {
                pointer-events: none;
                user-select: none;
                -webkit-user-drag: none;
                border-radius: inherit;
            }

            .cert-photo-move-handle {
                position: absolute;
                left: 50%;
                top: 50%;
                transform: translate(-50%, -50%);
                z-index: 12;
                min-width: 58px;
                height: 28px;
                padding: 0 10px;
                border-radius: 999px;
                background: rgba(20,61,44,.92);
                color: #fff;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                font-size: 12px;
                font-weight: 950;
                cursor: grab;
                box-shadow: 0 8px 18px rgba(0,0,0,.22);
                border: 2px solid rgba(255,255,255,.9);
            }

            .cert-drag-photo:active .cert-photo-move-handle,
            .cert-photo-move-handle:active {
                cursor: grabbing;
            }

            .cert-photo-resize-handle {
                position: absolute;
                z-index: 13;
                width: 18px;
                height: 18px;
                border-radius: 6px;
                background: #bd861b;
                border: 3px solid #fff;
                box-shadow: 0 5px 14px rgba(0,0,0,.22);
            }

            .cert-photo-resize-handle.nw {
                right: auto;
                left: -9px;
                top: -9px;
                cursor: nwse-resize;
            }

            .cert-photo-resize-handle.ne {
                right: -9px;
                top: -9px;
                cursor: nesw-resize;
            }

            .cert-photo-resize-handle.sw {
                left: -9px;
                bottom: -9px;
                cursor: nesw-resize;
            }

            .cert-photo-resize-handle.se {
                right: -9px;
                bottom: -9px;
                cursor: nwse-resize;
            }

            .cert-drag-photo.active {
                border-color: #bd861b !important;
                box-shadow: 0 0 0 5px rgba(189,134,27,.22), 0 14px 30px rgba(20,61,44,.18) !important;
            }

            .cert-drag-photo.active .cert-photo-move-handle {
                background: #bd861b;
            }

            .cert-drag-photo {
                z-index: 9999 !important;
                pointer-events: auto !important;
                touch-action: none !important;
                user-select: none !important;
                -webkit-user-select: none !important;
                overflow: visible !important;
                border: 2px solid rgba(20,61,44,.95) !important;
                outline: 2px dashed rgba(255,255,255,.95);
                outline-offset: -5px;
                cursor: move !important;
            }

            .cert-drag-photo * {
                pointer-events: auto !important;
            }

            .cert-drag-photo img {
                pointer-events: none !important;
                user-select: none !important;
                -webkit-user-drag: none !important;
                border-radius: inherit;
            }

            .cert-photo-move-handle {
                position: absolute;
                left: 50%;
                top: 50%;
                transform: translate(-50%, -50%);
                z-index: 10003;
                width: 34px;
                height: 34px;
                border-radius: 999px;
                background: rgba(20,61,44,.95);
                color: #fff;
                display: grid;
                place-items: center;
                font-size: 17px;
                font-weight: 950;
                cursor: move !important;
                box-shadow: 0 8px 18px rgba(0,0,0,.24);
                border: 2px solid rgba(255,255,255,.95);
                line-height: 1;
            }

            .cert-photo-resize-handle {
                position: absolute;
                z-index: 10004;
                width: 20px;
                height: 20px;
                border-radius: 7px;
                background: #bd861b;
                border: 3px solid #fff;
                box-shadow: 0 5px 14px rgba(0,0,0,.24);
                pointer-events: auto !important;
            }

            .cert-photo-resize-handle.nw {
                left: -10px;
                top: -10px;
                cursor: nwse-resize !important;
            }

            .cert-photo-resize-handle.ne {
                right: -10px;
                top: -10px;
                cursor: nesw-resize !important;
            }

            .cert-photo-resize-handle.sw {
                left: -10px;
                bottom: -10px;
                cursor: nesw-resize !important;
            }

            .cert-photo-resize-handle.se {
                right: -10px;
                bottom: -10px;
                cursor: nwse-resize !important;
            }

            .cert-drag-photo.active {
                border-color: #bd861b !important;
                box-shadow: 0 0 0 5px rgba(189,134,27,.22), 0 14px 30px rgba(20,61,44,.18) !important;
            }

            .cert-drag-photo {
                z-index: 9999 !important;
                pointer-events: auto !important;
                touch-action: none !important;
                user-select: none !important;
                -webkit-user-select: none !important;
                overflow: visible !important;
                border: 2px solid rgba(20,61,44,.95) !important;
                outline: 2px dashed rgba(255,255,255,.95);
                outline-offset: -5px;
                cursor: move !important;
            }

            .cert-drag-photo img {
                pointer-events: none !important;
                user-select: none !important;
                -webkit-user-drag: none !important;
                border-radius: inherit;
                width: 100%;
                height: 100%;
                object-fit: cover;
                display: block;
            }

            .cert-photo-move-handle {
                display: none !important;
            }

            .cert-photo-resize-handle {
                position: absolute;
                z-index: 10004;
                width: 20px;
                height: 20px;
                border-radius: 7px;
                background: #bd861b;
                border: 3px solid #fff;
                box-shadow: 0 5px 14px rgba(0,0,0,.24);
                pointer-events: auto !important;
            }

            .cert-photo-resize-handle.nw {
                left: -10px;
                top: -10px;
                cursor: nwse-resize !important;
            }

            .cert-photo-resize-handle.ne {
                right: -10px;
                top: -10px;
                cursor: nesw-resize !important;
            }

            .cert-photo-resize-handle.sw {
                left: -10px;
                bottom: -10px;
                cursor: nesw-resize !important;
            }

            .cert-photo-resize-handle.se {
                right: -10px;
                bottom: -10px;
                cursor: nwse-resize !important;
            }

            .cert-drag-photo.active {
                border-color: #bd861b !important;
                box-shadow: 0 0 0 5px rgba(189,134,27,.22), 0 14px 30px rgba(20,61,44,.18) !important;
            }

            .cert-photo-tools-compact {
                display: grid;
                grid-template-columns: auto 1fr 1.2fr 1.2fr .72fr .72fr .72fr;
                gap: 8px;
                align-items: end;
                margin-bottom: 10px;
            }

            .cert-photo-tools-compact label {
                min-width: 0;
                display: grid;
                gap: 5px;
                color: #6f624d;
                font-size: 12px;
                font-weight: 950;
            }

            .cert-photo-tools-compact label:has(button) {
                grid-template-columns: 34px minmax(58px, 1fr) 34px;
                grid-template-areas:
                    "title title title"
                    "minus input plus";
            }

            .cert-photo-tools-compact label > span {
                grid-area: title;
                text-align: center;
            }

            .cert-photo-tools-compact input,
            .cert-photo-tools-compact select {
                grid-area: input;
                width: 100%;
                min-width: 0;
                border: 1px solid #ded4c2;
                border-radius: 10px;
                background: #fff;
                color: #143d2c;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 900;
                text-align: center;
                padding: 8px 6px;
                min-height: 36px;
            }

            .cert-photo-tools-compact button:not(.cert-mini-action),
            .cert-photo-tools-compact label button {
                border: 1px solid #eadfca;
                border-radius: 10px;
                background: #fbf4e5;
                color: #143d2c;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 950;
                cursor: pointer;
                min-height: 36px;
                padding: 8px 8px;
            }

            .cert-photo-tools-compact label button:first-of-type {
                grid-area: minus;
                background: #143d2c;
                color: #fff;
            }

            .cert-photo-tools-compact label button:last-of-type {
                grid-area: plus;
                background: #143d2c;
                color: #fff;
            }

            .cert-photo-tools-compact .cert-mini-action {
                min-width: 86px;
                height: 36px;
            }
@media (max-width: 1200px) {

                .cert-tools-grid.compact.restored,
                .cert-photo-tools-compact {
                    grid-template-columns: repeat(3, minmax(0, 1fr));
                }
}

@media (max-width: 760px) {

                .cert-tools-grid.compact.restored,
                .cert-photo-tools-compact {
                    grid-template-columns: repeat(2, minmax(0, 1fr));
                }


                .cert-photo-tools-compact .cert-mini-action {
                    width: 100%;
                }
}


            /* CERT_TOOLS_HARD_FIX_20260615 */

            .cert-tools-card.compact {
                overflow: hidden;
            }

            .cert-color-line {
                display: grid !important;
                grid-template-columns: 150px minmax(0, 1fr) !important;
                gap: 10px !important;
                margin: 10px 0 !important;
            }

            .cert-color-line label {
                display: grid;
                gap: 5px;
                color: #6f624d;
                font-size: 12px;
                font-weight: 950;
            }

            .cert-color-line input {
                height: 42px;
                border: 1px solid #ded4c2;
                border-radius: 12px;
                background: #fff;
                color: #143d2c;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 900;
                padding: 8px 10px;
            }

            .cert-color-line input[type="color"] {
                padding: 3px;
                cursor: pointer;
            }

            .cert-photo-tools-compact {
                display: grid !important;
                grid-template-columns: 80px minmax(110px, 1fr) minmax(130px, 1.1fr) minmax(130px, 1.1fr) 72px 72px 72px !important;
                gap: 10px !important;
                align-items: end !important;
                margin-bottom: 10px;
            }

            .cert-photo-tools-compact label {
                display: grid !important;
                gap: 5px !important;
                min-width: 0;
                color: #6f624d;
                font-size: 12px;
                font-weight: 950;
            }

            .cert-photo-tools-compact label:has(button) {
                grid-template-columns: 34px minmax(58px, 1fr) 34px !important;
                grid-template-areas:
                    "title title title"
                    "minus input plus";
            }

            .cert-photo-tools-compact label > span {
                grid-area: title;
                text-align: center;
            }

            .cert-photo-tools-compact label button:first-of-type {
                grid-area: minus;
            }

            .cert-photo-tools-compact label button:last-of-type {
                grid-area: plus;
            }

            .cert-photo-tools-compact input,
            .cert-photo-tools-compact select {
                grid-area: input;
                height: 40px;
                width: 100%;
                min-width: 0;
                border: 1px solid #ded4c2;
                border-radius: 12px;
                background: #fff;
                color: #143d2c;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 900;
                text-align: center;
                padding: 8px 8px;
            }

            .cert-photo-tools-compact button:not(.cert-mini-action),
            .cert-photo-tools-compact label button {
                height: 40px;
                border: 0;
                border-radius: 12px;
                background: #143d2c;
                color: #fff;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 950;
                cursor: pointer;
            }
@media (max-width: 900px) {

                .cert-tools-grid.compact.restored,
                .cert-photo-tools-compact {
                    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
                }


                .cert-color-line {
                    grid-template-columns: 1fr !important;
                }
}


            /* CERT_TEXT_TOOLBAR_VISUAL_POLISH_3I */
            .cert-text-toolbar-final {
                display: grid !important;
                grid-template-columns: minmax(190px, 1.45fr) minmax(126px, .9fr) minmax(146px, 1fr) 132px 110px 74px minmax(108px, .8fr) 84px !important;
                gap: 10px !important;
                align-items: end !important;
                padding: 12px !important;
                border: 1px solid #eadfca !important;
                border-radius: 18px !important;
                background: linear-gradient(180deg, #fffdf8, #fbf4e8) !important;
            }

            .cert-text-toolbar-final label,
            .cert-text-toolbar-final .align-icons {
                min-width: 0 !important;
                display: grid !important;
                gap: 5px !important;
                color: #6f624d !important;
                font-size: 12px !important;
                font-weight: 950 !important;
            }

            .cert-text-toolbar-final label > span,
            .cert-text-toolbar-final .align-icons > span {
                text-align: center !important;
            }

            .cert-text-toolbar-final label.number {
                grid-template-columns: 36px minmax(62px, 1fr) 36px !important;
                grid-template-areas:
                    "title title title"
                    "minus input plus" !important;
            }

            .cert-text-toolbar-final label.number > span {
                grid-area: title !important;
            }

            .cert-text-toolbar-final label.number button:first-of-type {
                grid-area: minus !important;
            }

            .cert-text-toolbar-final label.number button:last-of-type {
                grid-area: plus !important;
            }

            .cert-text-toolbar-final input,
            .cert-text-toolbar-final select {
                grid-area: input !important;
                width: 100% !important;
                min-width: 0 !important;
                height: 42px !important;
                border: 1px solid #ded4c2 !important;
                border-radius: 13px !important;
                background: #fff !important;
                color: #143d2c !important;
                font-family: Cairo, system-ui, sans-serif !important;
                font-weight: 900 !important;
                text-align: center !important;
                padding: 8px 9px !important;
                box-shadow: inset 0 1px 0 rgba(255,255,255,.7) !important;
            }

            .cert-text-toolbar-final input[type="color"] {
                padding: 3px !important;
                cursor: pointer !important;
            }

            .cert-text-toolbar-final button:not(.cert-mini-action),
            .cert-text-toolbar-final label.number button {
                height: 42px !important;
                border: 0 !important;
                border-radius: 13px !important;
                background: #143d2c !important;
                color: #fff !important;
                font-family: Cairo, system-ui, sans-serif !important;
                font-weight: 950 !important;
                cursor: pointer !important;
                box-shadow: 0 8px 18px rgba(20,61,44,.12) !important;
            }

            .cert-text-toolbar-final .align-icons {
                grid-template-columns: repeat(3, 1fr) !important;
                grid-template-areas:
                    "title title title"
                    "right center left" !important;
            }

            .cert-text-toolbar-final .align-icons span {
                grid-area: title !important;
            }

            .cert-text-toolbar-final .align-icons button {
                font-size: 18px !important;
                line-height: 1 !important;
                background: #fff !important;
                color: #143d2c !important;
                border: 1px solid #eadfca !important;
                box-shadow: none !important;
            }

            .cert-text-toolbar-final .align-icons button.active {
                background: #143d2c !important;
                color: #fff !important;
                border-color: #143d2c !important;
            }

            .cert-text-toolbar-final .cert-mini-action {
                height: 42px !important;
                width: 100% !important;
            }
@media (max-width: 1280px) {

                .cert-text-toolbar-final {
                    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
                }
}

@media (max-width: 760px) {

                .cert-text-toolbar-final {
                    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
                    padding: 10px !important;
                }


                .cert-text-toolbar-final .font,
                .cert-text-toolbar-final .hex {
                    grid-column: 1 / -1 !important;
                }
}


            /* CERT_COLOR_POPOVER_3J */
            .cert-text-toolbar-final {
                grid-template-columns: minmax(200px, 1.6fr) minmax(126px, .9fr) minmax(146px, 1fr) 132px 110px 86px 84px !important;
            }

            .cert-color-button {
                width: 100%;
                height: 42px;
                border: 1px solid #ded4c2 !important;
                border-radius: 13px !important;
                background: #fff !important;
                display: grid;
                place-items: center;
                cursor: pointer;
                box-shadow: inset 0 1px 0 rgba(255,255,255,.7) !important;
            }

            .cert-color-button i {
                width: 30px;
                height: 30px;
                border-radius: 9px;
                display: block;
                background: var(--cert-current-color);
                border: 2px solid #fff;
                box-shadow: 0 0 0 1px #ded4c2, 0 8px 16px rgba(20,61,44,.12);
            }

            .cert-color-popover {
                position: absolute;
                z-index: 20000;
                top: calc(100% + 8px);
                left: 0;
                width: min(280px, 80vw);
                padding: 12px;
                border-radius: 16px;
                border: 1px solid #eadfca;
                background: #fffdf8;
                box-shadow: 0 18px 45px rgba(20,61,44,.18);
            }

            .cert-color-popover label {
                display: grid;
                gap: 6px;
                margin-bottom: 10px;
                color: #6f624d;
                font-size: 12px;
                font-weight: 950;
            }

            .cert-color-popover input {
                width: 100%;
                height: 42px;
                border: 1px solid #ded4c2;
                border-radius: 12px;
                background: #fff;
                color: #143d2c;
                font-family: Cairo, system-ui, sans-serif;
                font-weight: 900;
                text-align: center;
                padding: 8px 10px;
            }

            .cert-color-popover input[type="color"] {
                padding: 3px;
                cursor: pointer;
            }

            /* CERT_TOOLBAR_CLEAN_3K */
            .cert-text-toolbar-final {
                grid-template-columns: minmax(210px, 1.65fr) 126px 146px 132px 110px 86px 84px !important;
                align-items: end !important;
                overflow: visible !important;
            }

            .cert-text-toolbar-final .native-color-only {
                min-width: 0 !important;
                display: grid !important;
                gap: 5px !important;
                color: #6f624d !important;
                font-size: 12px !important;
                font-weight: 950 !important;
            }

            .cert-text-toolbar-final .native-color-only span {
                text-align: center !important;
            }

            .cert-text-toolbar-final .native-color-only input[type="color"] {
                width: 100% !important;
                height: 42px !important;
                padding: 4px !important;
                border: 1px solid #ded4c2 !important;
                border-radius: 13px !important;
                background: #fff !important;
                cursor: pointer !important;
            }

            .color-popover-wrap,
            .cert-color-popover {
                display: none !important;
            }
@media (max-width: 1280px) {

                .cert-text-toolbar-final {
                    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
                }
}

@media (max-width: 760px) {

                .cert-text-toolbar-final {
                    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
                }


                .cert-text-toolbar-final .font {
                    grid-column: 1 / -1 !important;
                }
}


            /* CERT_PRO_TOOLBAR_3L */
            .cert-pro-tools-card {
                overflow: visible !important;
                border-radius: 22px !important;
                background: #fffdf8 !important;
            }

            .cert-pro-tools-head {
                margin-bottom: 12px !important;
            }

            .cert-pro-field-tabs {
                display: grid !important;
                grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
                gap: 10px !important;
                margin-bottom: 14px !important;
            }

            .cert-pro-field-tabs button {
                min-height: 48px !important;
                border-radius: 15px !important;
                border: 1px solid #eadfca !important;
                background: #fffaf0 !important;
                color: #143d2c !important;
                font-family: Cairo, system-ui, sans-serif !important;
                font-weight: 950 !important;
                font-size: 14px !important;
                cursor: pointer !important;
                white-space: nowrap !important;
                overflow: hidden !important;
                text-overflow: ellipsis !important;
                box-shadow: inset 0 1px 0 rgba(255,255,255,.75) !important;
            }

            .cert-pro-field-tabs button.active {
                background: #143d2c !important;
                color: #fff !important;
                border-color: #143d2c !important;
                box-shadow: 0 12px 24px rgba(20,61,44,.15) !important;
            }

            .cert-pro-field-tabs button.muted {
                opacity: .55 !important;
            }

            .cert-pro-text-toolbar,
            .cert-pro-photo-toolbar {
                display: grid !important;
                grid-template-columns:
                    minmax(210px, 1.55fr)
                    minmax(124px, .9fr)
                    minmax(150px, 1.05fr)
                    minmax(138px, .9fr)
                    minmax(112px, .72fr)
                    76px
                    82px !important;
                gap: 10px !important;
                align-items: end !important;
                padding: 12px !important;
                border: 1px solid #eadfca !important;
                border-radius: 20px !important;
                background: linear-gradient(180deg, #fffaf1, #fff7eb) !important;
                box-shadow: inset 0 1px 0 rgba(255,255,255,.85) !important;
                overflow: visible !important;
            }

            .cert-pro-photo-toolbar {
                grid-template-columns:
                    86px
                    minmax(135px, .95fr)
                    minmax(132px, 1fr)
                    minmax(132px, 1fr)
                    78px
                    78px
                    78px !important;
            }

            .cert-pro-field,
            .cert-pro-stepper,
            .cert-pro-align,
            .cert-pro-color {
                min-width: 0 !important;
                display: grid !important;
                gap: 6px !important;
                color: #6f624d !important;
                font-size: 12px !important;
                font-weight: 950 !important;
            }

            .cert-pro-field > span,
            .cert-pro-stepper > span,
            .cert-pro-align > span,
            .cert-pro-color > span {
                text-align: center !important;
                line-height: 1 !important;
            }

            .cert-pro-field select,
            .cert-pro-stepper input {
                height: 43px !important;
                width: 100% !important;
                min-width: 0 !important;
                border: 1px solid #ded4c2 !important;
                border-radius: 14px !important;
                background: #fff !important;
                color: #143d2c !important;
                font-family: Cairo, system-ui, sans-serif !important;
                font-weight: 900 !important;
                text-align: center !important;
                padding: 8px 9px !important;
                box-shadow: inset 0 1px 0 rgba(255,255,255,.8) !important;
            }

            .cert-pro-stepper {
                grid-template-columns: 36px minmax(60px, 1fr) 36px !important;
                grid-template-areas:
                    "title title title"
                    "minus input plus" !important;
            }

            .cert-pro-stepper > span {
                grid-area: title !important;
            }

            .cert-pro-stepper input {
                grid-area: input !important;
            }

            .cert-pro-stepper button:first-of-type {
                grid-area: minus !important;
            }

            .cert-pro-stepper button:last-of-type {
                grid-area: plus !important;
            }

            .cert-pro-stepper button,
            .cert-pro-chip,
            .cert-pro-actions button {
                height: 43px !important;
                border: 0 !important;
                border-radius: 14px !important;
                background: #143d2c !important;
                color: #fff !important;
                font-family: Cairo, system-ui, sans-serif !important;
                font-weight: 950 !important;
                cursor: pointer !important;
                box-shadow: 0 10px 22px rgba(20,61,44,.12) !important;
            }

            .cert-pro-align {
                grid-template-columns: repeat(3, 1fr) !important;
                grid-template-areas:
                    "title title title"
                    "right center left" !important;
            }

            .cert-pro-align > span {
                grid-area: title !important;
            }

            .cert-pro-align button {
                height: 43px !important;
                border: 1px solid #eadfca !important;
                border-radius: 14px !important;
                background: #fff !important;
                display: grid !important;
                place-items: center !important;
                cursor: pointer !important;
            }

            .cert-pro-align button.active {
                background: #143d2c !important;
                border-color: #143d2c !important;
            }

            .cert-align-real-icon {
                width: 25px !important;
                height: 20px !important;
                display: grid !important;
                gap: 4px !important;
                align-content: center !important;
            }

            .cert-align-real-icon i {
                display: block !important;
                height: 3px !important;
                border-radius: 999px !important;
                background: #143d2c !important;
            }

            .cert-pro-align button.active .cert-align-real-icon i {
                background: #fff !important;
            }

            .cert-align-real-icon.right i:nth-child(1) { width: 100% !important; margin-left: auto !important; }

            .cert-align-real-icon.right i:nth-child(2) { width: 72% !important; margin-left: auto !important; }

            .cert-align-real-icon.right i:nth-child(3) { width: 88% !important; margin-left: auto !important; }

            .cert-align-real-icon.center i:nth-child(1) { width: 88% !important; margin-inline: auto !important; }

            .cert-align-real-icon.center i:nth-child(2) { width: 100% !important; margin-inline: auto !important; }

            .cert-align-real-icon.center i:nth-child(3) { width: 72% !important; margin-inline: auto !important; }

            .cert-align-real-icon.left i:nth-child(1) { width: 100% !important; margin-right: auto !important; }

            .cert-align-real-icon.left i:nth-child(2) { width: 72% !important; margin-right: auto !important; }

            .cert-align-real-icon.left i:nth-child(3) { width: 88% !important; margin-right: auto !important; }

            .cert-pro-color input[type="color"] {
                height: 43px !important;
                width: 100% !important;
                padding: 4px !important;
                border: 1px solid #ded4c2 !important;
                border-radius: 14px !important;
                background: #fff !important;
                cursor: pointer !important;
            }

            .cert-pro-hide {
                height: 43px !important;
                width: 100% !important;
                border-radius: 14px !important;
                font-family: Cairo, system-ui, sans-serif !important;
                font-weight: 950 !important;
                cursor: pointer !important;
            }

            .cert-pro-actions {
                display: grid !important;
                grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
                gap: 10px !important;
                margin-top: 12px !important;
            }

            .cert-pro-photo-toolbar + .cert-pro-actions {
                grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
            }

            .cert-pro-actions button {
                background: linear-gradient(180deg, #fff8ea, #f5e8cd) !important;
                color: #143d2c !important;
                border: 1px solid #eadfca !important;
                box-shadow: none !important;
                min-height: 46px !important;
            }

            .cert-text-toolbar-final,
            .cert-photo-tools-compact,
            .cert-color-line,
            .color-popover-wrap,
            .cert-color-popover {
                display: none !important;
            }
@media (max-width: 1280px) {

                .cert-pro-text-toolbar,
                .cert-pro-photo-toolbar {
                    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
                }


                .cert-pro-field.font {
                    grid-column: span 2 !important;
                }
}

@media (max-width: 760px) {

                .cert-pro-field-tabs {
                    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
                    gap: 7px !important;
                }


                .cert-pro-text-toolbar,
                .cert-pro-photo-toolbar {
                    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
                    padding: 10px !important;
                    gap: 8px !important;
                }


                .cert-pro-field.font {
                    grid-column: 1 / -1 !important;
                }


                .cert-pro-actions,
                .cert-pro-photo-toolbar + .cert-pro-actions {
                    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
                }
}


            /* CERT_TOOLBAR_FIT_PAGE_3M */
            .cert-tools-card,
            .cert-pro-tools-card {
                max-width: 100% !important;
                overflow: hidden !important;
                box-sizing: border-box !important;
            }

            .cert-pro-field-tabs {
                grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
                gap: 8px !important;
                margin-bottom: 10px !important;
            }

            .cert-pro-field-tabs button {
                min-width: 0 !important;
                min-height: 42px !important;
                padding: 8px 8px !important;
                font-size: 13px !important;
                border-radius: 13px !important;
            }

            .cert-pro-text-toolbar,
            .cert-pro-photo-toolbar {
                max-width: 100% !important;
                width: 100% !important;
                box-sizing: border-box !important;
                padding: 10px !important;
                gap: 7px !important;
                border-radius: 16px !important;
                overflow: hidden !important;
            }

            .cert-pro-text-toolbar {
                grid-template-columns:
                    minmax(150px, 1.45fr)
                    minmax(88px, .72fr)
                    minmax(105px, .82fr)
                    minmax(102px, .75fr)
                    minmax(82px, .62fr)
                    minmax(54px, .42fr)
                    minmax(62px, .48fr) !important;
            }

            .cert-pro-photo-toolbar {
                grid-template-columns:
                    minmax(62px, .48fr)
                    minmax(92px, .72fr)
                    minmax(96px, .82fr)
                    minmax(96px, .82fr)
                    minmax(58px, .48fr)
                    minmax(66px, .52fr)
                    minmax(58px, .48fr) !important;
            }

            .cert-pro-field,
            .cert-pro-stepper,
            .cert-pro-align,
            .cert-pro-color {
                min-width: 0 !important;
                gap: 4px !important;
                font-size: 11px !important;
            }

            .cert-pro-field > span,
            .cert-pro-stepper > span,
            .cert-pro-align > span,
            .cert-pro-color > span {
                white-space: nowrap !important;
                overflow: hidden !important;
                text-overflow: ellipsis !important;
            }

            .cert-pro-field select,
            .cert-pro-stepper input,
            .cert-pro-color input[type="color"] {
                height: 36px !important;
                min-height: 36px !important;
                border-radius: 11px !important;
                padding: 6px 6px !important;
                font-size: 12px !important;
            }

            .cert-pro-field.font select {
                text-align: right !important;
                font-size: 12px !important;
            }

            .cert-pro-stepper {
                grid-template-columns: 28px minmax(42px, 1fr) 28px !important;
                grid-template-areas:
                    "title title title"
                    "minus input plus" !important;
            }

            .cert-pro-stepper button,
            .cert-pro-chip,
            .cert-pro-align button,
            .cert-pro-hide {
                height: 36px !important;
                min-height: 36px !important;
                border-radius: 11px !important;
                padding: 5px 6px !important;
                font-size: 12px !important;
                box-shadow: none !important;
            }

            .cert-pro-align {
                grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
            }

            .cert-align-real-icon {
                width: 20px !important;
                height: 16px !important;
                gap: 3px !important;
            }

            .cert-align-real-icon i {
                height: 2px !important;
            }

            .cert-pro-color input[type="color"] {
                padding: 3px !important;
            }

            .cert-pro-actions {
                grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
                gap: 7px !important;
                margin-top: 8px !important;
            }

            .cert-pro-photo-toolbar + .cert-pro-actions {
                grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
            }

            .cert-pro-actions button {
                min-height: 38px !important;
                height: 38px !important;
                border-radius: 12px !important;
                padding: 6px 8px !important;
                font-size: 13px !important;
            }
@media (max-width: 1350px) {

                .cert-pro-text-toolbar {
                    grid-template-columns:
                        minmax(160px, 1.5fr)
                        minmax(92px, .8fr)
                        minmax(110px, .9fr)
                        minmax(106px, .85fr)
                        minmax(86px, .7fr)
                        minmax(58px, .48fr)
                        minmax(66px, .52fr) !important;
                }
}

@media (max-width: 1150px) {

                .cert-pro-text-toolbar,
                .cert-pro-photo-toolbar {
                    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
                }


                .cert-pro-field.font {
                    grid-column: span 2 !important;
                }


                .cert-pro-actions,
                .cert-pro-photo-toolbar + .cert-pro-actions {
                    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
                }
}

@media (max-width: 760px) {

                .cert-pro-field-tabs {
                    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
                    gap: 6px !important;
                }


                .cert-pro-field-tabs button {
                    min-height: 40px !important;
                    font-size: 12px !important;
                    padding: 7px 6px !important;
                }


                .cert-pro-text-toolbar,
                .cert-pro-photo-toolbar {
                    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
                    padding: 8px !important;
                    gap: 7px !important;
                }


                .cert-pro-field.font {
                    grid-column: 1 / -1 !important;
                }


                .cert-pro-actions,
                .cert-pro-photo-toolbar + .cert-pro-actions {
                    grid-template-columns: 1fr 1fr !important;
                }
}

@media (max-width: 1100px) {

                .cert-grid,
                .cert-row,
                .cert-mini-grid {
                    grid-template-columns: 1fr;
                }


                .cert-template-item {
                    grid-template-columns: 1fr;
                }


                .cert-template-thumb {
                    width: 100%;
                    height: 180px;
                }
}

/* PHASE D2: Certificate template manager scoped layout */
.certificate-template-manager {
    display: grid;
    gap: 16px;
    max-width: 100%;
    box-sizing: border-box;
}

.certificate-template-manager,
.certificate-template-manager * {
    box-sizing: border-box;
}

.certificate-template-manager__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid #e5d7bd;
    border-radius: 18px;
    background: #fffdf8;
}

.certificate-template-manager__header span {
    display: block;
    color: #8a641d;
    font-size: 12px;
    font-weight: 900;
}

.certificate-template-manager__header h2 {
    margin: 4px 0 0;
    color: #143d2c;
    font-size: 22px;
    font-weight: 950;
}

.certificate-template-manager__workspace {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.certificate-template-manager__list {
    position: sticky;
    top: 14px;
    min-width: 0;
}

.certificate-template-manager__editor {
    display: grid;
    grid-template-columns: minmax(260px, .76fr) minmax(0, 1.24fr);
    grid-template-areas:
        "form preview"
        "properties properties";
    gap: 16px;
    min-width: 0;
}

.certificate-template-manager__form-panel { grid-area: form; min-width: 0; }
.certificate-template-manager__preview-panel { grid-area: preview; min-width: 0; }
.certificate-template-manager__properties-panel { grid-area: properties; min-width: 0; }

.certificate-template-manager .cert-card {
    border-radius: 16px;
}

.certificate-template-manager .cert-preview {
    max-width: 100%;
}

.certificate-template-manager .cert-visual-stage {
    max-width: 100%;
    overflow: hidden;
}

.certificate-template-manager .cert-template-list.compact {
    max-height: calc(100vh - 220px);
    overflow: auto;
    padding-inline-end: 2px;
}

.certificate-template-manager .cert-template-actions.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1180px) {
    .certificate-template-manager__workspace {
        grid-template-columns: 1fr;
    }

    .certificate-template-manager__list {
        position: static;
    }

    .certificate-template-manager .cert-template-list.compact {
        max-height: none;
    }
}

@media (max-width: 860px) {
    .certificate-template-manager__editor {
        grid-template-columns: 1fr;
        grid-template-areas:
            "form"
            "preview"
            "properties";
    }
}

@media (max-width: 430px) {
    .certificate-template-manager__header {
        align-items: stretch;
        display: grid;
        padding: 14px;
    }

    .certificate-template-manager__header h2 {
        font-size: 19px;
    }

    .certificate-template-manager .cert-row,
    .certificate-template-manager .cert-template-actions.compact,
    .certificate-template-manager .cert-actions {
        grid-template-columns: 1fr;
        display: grid;
    }

    .certificate-template-manager .cert-btn,
    .certificate-template-manager button,
    .certificate-template-manager input,
    .certificate-template-manager select {
        min-height: 42px;
    }

    .certificate-template-manager .cert-preview {
        min-height: 180px;
    }
}
