/* Preznta design mode */
.design-only { display: none !important; }
body.design-mode .design-only:not([hidden]) { display: flex !important; }
body.design-mode [data-sidebar-library="templates"], body.design-mode [data-sidebar-library="designs"],
body.design-mode [data-sidebar-library="pages"], body.design-mode [data-sidebar-library="covers"],
body.design-mode .slide-smart-layout, body.design-mode .ai-sidebar-btn { display: none !important; }

/* Create: presentation or design, then the size */
.project-create-form.is-design { width: min(940px, 96vw); max-height: 92vh; overflow: auto; }
.dm-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 6px; }
.dm-kind button { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid #e2e8f0; border-radius: 14px; background: #fff; text-align: right; cursor: pointer; transition: .15s; }
.dm-kind button svg { width: 26px; height: 26px; color: #64748b; flex: none; }
.dm-kind button span { display: grid; gap: 2px; }
.dm-kind button b { font-size: 14px; color: var(--brand-text, #172330); }
.dm-kind button small { font-size: 11px; color: #64748b; }
.dm-kind button.active { border-color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary) 6%, #fff); }
.dm-kind button.active svg { color: var(--brand-primary); }
.dm-pick[hidden] { display: none; }
.dm-pick { margin: 12px 0 4px; }
.dm-picker { display: grid; gap: 16px; }
.dm-groups { display: grid; gap: 14px; }
.dm-groups h4, .dm-custom h4 { margin: 0 0 8px; font-size: 12px; font-weight: 800; color: #64748b; }
.dm-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.dm-preset { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 12px 8px 10px; border: 1.5px solid #e6ebf0; border-radius: 13px; background: #fff; cursor: pointer; text-align: center; transition: .12s; }
.dm-preset:hover { border-color: color-mix(in srgb, var(--brand-primary) 50%, #e6ebf0); }
.dm-preset.active { border-color: var(--brand-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 16%, transparent); }
.dm-preset b { font-size: 12px; line-height: 1.35; color: var(--brand-text, #172330); }
.dm-preset small { font-size: 10px; color: #8193a1; direction: rtl; }
.dm-frame { display: block; margin: 4px 0 2px; border: 1.8px solid var(--brand-primary); border-radius: 4px; background: color-mix(in srgb, var(--brand-primary) 10%, #fff); }
.dm-frame-box { display: flex; align-items: center; justify-content: center; width: 100%; }
.dm-frame-box .dm-frame { margin: 0; }
.dm-custom-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.dm-custom-row label { display: grid; gap: 4px; font-size: 11px; font-weight: 700; color: #475569; }
.dm-custom-row input, .dm-custom-row select { width: 110px; height: 38px; padding: 0 10px; border: 1px solid #dfe5ea; border-radius: 10px; font: inherit; }
.dm-swap { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #dfe5ea; border-radius: 10px; background: #fff; cursor: pointer; }
.dm-swap svg { width: 16px; height: 16px; }
.dm-use-custom { height: 38px; padding: 0 14px; border: 1.5px solid #dfe5ea; border-radius: 10px; background: #fff; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.dm-use-custom.active { border-color: var(--brand-primary); color: var(--brand-primary); }
.dm-error { margin: 6px 0 0; min-height: 14px; font-size: 12px; color: #b42318; }

/* Editor */
.dm-format-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 3px 9px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; font-size: 11px; font-weight: 700; color: #334155; cursor: pointer; }
.dm-format-badge svg { width: 13px; height: 13px; color: var(--brand-primary); }
.dm-format-badge small { color: #8193a1; font-weight: 600; direction: rtl; }
.dm-current { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--brand-primary-border, #dbe7ee); border-radius: 14px; background: var(--brand-primary-tint, #f2f8fb); margin-bottom: 16px; }
.dm-current-frame { width: 58px; height: 58px; display: grid; place-items: center; }
.dm-current b { display: block; font-size: 13px; }
.dm-current small { font-size: 11px; color: #64748b; }
.dm-current button { padding: 7px 11px; border: 1px solid #dbe4ea; border-radius: 9px; background: #fff; font-size: 11px; font-weight: 800; cursor: pointer; }
.dm-lib-section { margin-bottom: 20px; }
.dm-lib-section h4 { margin: 0 0 4px; font-size: 13px; font-weight: 800; }
.dm-muted { display: block; color: #8193a1; font-size: 11px; line-height: 1.7; margin: 0 0 10px; }
.dm-starter-grid, .dm-org-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.design-portrait .dm-starter-grid, body.design-portrait .dm-org-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dm-starter, .dm-org-card { display: grid; gap: 6px; padding: 6px; border: 1px solid #e3e9ee; border-radius: 12px; background: #fff; cursor: pointer; text-align: center; }
.dm-starter:hover, .dm-org-card:hover { border-color: var(--brand-primary); box-shadow: 0 6px 16px #0f172a14; }
.dm-starter b, .dm-org-card b { font-size: 11px; }
.dm-mini { position: relative; display: block; width: 100%; overflow: hidden; border-radius: 8px; background: #f1f5f9; }
.dm-mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Resize dialog and image export */
.dm-dialog { width: min(920px, 95vw); max-height: 92vh; padding: 0; border: 0; border-radius: 20px; box-shadow: 0 30px 80px #0f172a55; }
.dm-dialog::backdrop { background: #0f172a80; }
.dm-dialog form { display: grid; grid-template-rows: auto 1fr auto; max-height: 92vh; }
.dm-dialog header { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 10px; }
.dm-dialog header b { display: block; font-size: 17px; }
.dm-dialog header small { color: #64748b; font-size: 12px; }
.dm-dialog header [data-x] { width: 34px; height: 34px; border: 0; border-radius: 10px; background: #f1f5f9; font-size: 18px; cursor: pointer; }
.dm-dialog [data-pick] { padding: 4px 20px 14px; overflow: auto; }
.dm-dialog footer { display: flex; align-items: center; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid #eef2f5; }
.dm-check { display: flex; align-items: center; gap: 8px; margin-inline-end: auto; font-size: 12px; font-weight: 700; color: #475569; }
.dm-check input { accent-color: var(--brand-primary); }
.dm-btn { height: 40px; padding: 0 18px; border: 1px solid #dfe5ea; border-radius: 11px; background: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.dm-btn.primary { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.dm-export-row { display: grid; gap: 8px; margin-bottom: 14px; }
.dm-export-row > span { font-size: 12px; font-weight: 800; color: #64748b; }
.dm-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dm-seg button { display: grid; gap: 2px; padding: 12px; border: 1.5px solid #e2e8f0; border-radius: 12px; background: #fff; font-weight: 800; cursor: pointer; }
.dm-seg button small { font-size: 10.5px; font-weight: 600; color: #8193a1; }
.dm-seg button.active { border-color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary) 6%, #fff); }
.desktop-project-preview.is-design .mini-slide small { font-weight: 700; }
/* Organization designer: sized designs */
.dm-designer-form { display: grid; gap: 14px; margin: 18px 0 24px; padding: 18px; border: 1px solid #e3e8ec; border-radius: 18px; background: #fff; }
.dm-designer-form > label { display: grid; gap: 6px; font-weight: 700; }
.dm-designer-form input[name=name] { padding: 11px 12px; border: 1px solid #dfe5ea; border-radius: 11px; font: inherit; }
.dm-designer-pick .dm-presets { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.dm-designer-group { margin-bottom: 22px; }
.dm-designer-group h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 15px; }
.dm-designer-group h3 .dm-frame-box { width: 32px; }
.dm-designer-group h3 small { color: #8193a1; font-size: 11px; font-weight: 600; }
