.hcpe-app,
.hcpe-profile-projects,
.hcpe-profile-card {
    --hcpe-primary: #2563eb;
    --hcpe-primary-dark: #1d4ed8;
    --hcpe-secondary: #7c3aed;
    --hcpe-ink: #172033;
    --hcpe-muted: #64748b;
    --hcpe-line: #e2e8f0;
    --hcpe-soft: #f4f7fb;
    --hcpe-white: #fff;
    --hcpe-danger: #dc2626;
    --hcpe-shadow: 0 16px 44px rgba(30, 50, 90, .10);
    color: var(--hcpe-ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    box-sizing: border-box;
}

.hcpe-app *, .hcpe-app *::before, .hcpe-app *::after,
.hcpe-profile-projects *, .hcpe-profile-projects *::before, .hcpe-profile-projects *::after,
.hcpe-profile-card *, .hcpe-profile-card *::before, .hcpe-profile-card *::after { box-sizing: border-box; }

.hcpe-app {
    width: 100vw;
    max-width: 100vw;
    margin: 28px calc(50% - 50vw) 52px;
    padding: 0 clamp(10px, 1.5vw, 24px);
}

/* The editor alone uses the full page width; the website header and footer stay unchanged. */
body.hcpe-editor-page #secondary,
body.hcpe-editor-page .site-content > .widget-area,
body.hcpe-editor-page .td-main-content-wrap .td-pb-span4,
body.hcpe-editor-page .td-main-sidebar-wrap,
body.hcpe-editor-page aside.sidebar-primary { display: none !important; }
body.hcpe-editor-page #primary,
body.hcpe-editor-page .content-area,
body.hcpe-editor-page .site-main,
body.hcpe-editor-page .td-main-content-wrap .td-pb-span8,
body.hcpe-editor-page .td-main-content-wrap .td-ss-main-content {
    width: 100% !important;
    max-width: none !important;
    float: none !important;
}
body.hcpe-editor-page .td-main-content-wrap .td-container,
body.hcpe-editor-page .td-main-content-wrap .td-pb-row,
body.hcpe-editor-page .site-content,
body.hcpe-editor-page .ast-container,
body.hcpe-editor-page .container.site-container {
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body.hcpe-editor-page article > .entry-header,
body.hcpe-editor-page .td-page-header,
body.hcpe-editor-page .td-crumb-container { display: none !important; }
body.hcpe-editor-page article,
body.hcpe-editor-page .entry-content { margin: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }
.hcpe-app button, .hcpe-app input, .hcpe-app select, .hcpe-app textarea { font: inherit; }
.hcpe-app button { cursor: pointer; }
.hcpe-app [hidden] { display: none !important; }

.hcpe-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 38px 42px;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 46%, #7c3aed 100%);
    box-shadow: 0 18px 50px rgba(37, 99, 235, .22);
}
.hcpe-hero::after { content: ""; position: absolute; width: 340px; height: 340px; right: -110px; top: -190px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hcpe-hero-copy, .hcpe-hero-actions { position: relative; z-index: 1; }
.hcpe-kicker { display: block; margin-bottom: 8px; color: inherit; font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; opacity: .82; }
.hcpe-hero h1 { margin: 0 0 10px; color: #fff !important; font-size: clamp(28px, 4vw, 46px); line-height: 1.08; font-weight: 800; }
.hcpe-hero p { max-width: 720px; margin: 0; color: rgba(255,255,255,.91) !important; font-size: 16px; line-height: 1.65; }
.hcpe-privacy { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.22); border-radius: 99px; background: rgba(255,255,255,.12); color: #fff; font-size: 12px; font-weight: 650; }
.hcpe-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; min-width: 280px; }

.hcpe-btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 10px 17px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; line-height: 1.2; text-decoration: none !important; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.hcpe-btn:hover { transform: translateY(-1px); }
.hcpe-btn-primary { border-color: var(--hcpe-primary); background: var(--hcpe-primary); color: #fff !important; box-shadow: 0 8px 18px rgba(37,99,235,.22); }
.hcpe-btn-primary:hover { background: var(--hcpe-primary-dark); }
.hcpe-btn-secondary { border-color: #cbd5e1; background: #fff; color: #243047 !important; }
.hcpe-btn-light { border-color: #fff; background: #fff; color: var(--hcpe-primary-dark) !important; }
.hcpe-btn-ghost { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.08); color: #fff !important; }
.hcpe-btn-ghost:hover { background: rgba(255,255,255,.18); }
.hcpe-full { width: 100%; }

.hcpe-ad { display: flex; min-height: 90px; align-items: center; justify-content: center; margin: 20px 0; border: 1px dashed #d6deea; border-radius: 14px; background: #f8fafc; color: #9aa7b9; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; }
.hcpe-ad-widget { width: 100%; text-align: center; }

.hcpe-workspace { overflow: hidden; border: 1px solid var(--hcpe-line); border-radius: 20px; background: #fff; box-shadow: var(--hcpe-shadow); }
.hcpe-topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 15px; border-bottom: 1px solid var(--hcpe-line); background: #fff; }
.hcpe-topbar-group { display: flex; align-items: center; gap: 5px; }
.hcpe-primary-actions { gap: 9px; }
.hcpe-icon-btn, .hcpe-zoom-value { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: #44516a; font-size: 13px; font-weight: 680; }
.hcpe-icon-btn:hover, .hcpe-zoom-value:hover { background: #f1f5f9; color: var(--hcpe-primary); }
.hcpe-icon-btn:disabled { cursor: not-allowed; opacity: .35; }
.hcpe-icon-btn > span:first-child { font-size: 20px; line-height: 1; }
.hcpe-icon-btn.hcpe-compact { width: 34px; min-height: 34px; padding: 0; background: #f1f5f9; font-size: 21px; }
.hcpe-zoom-value { min-width: 56px; }
.hcpe-divider { height: 26px; width: 1px; margin: 0 5px; background: var(--hcpe-line); }
.hcpe-save-status { max-width: 220px; color: var(--hcpe-muted); font-size: 12px; }

.hcpe-editor-grid { display: grid; grid-template-columns: 78px 300px minmax(420px, 1fr) 286px; min-height: 760px; }
.hcpe-toolrail { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 12px 8px; border-right: 1px solid var(--hcpe-line); background: #f8fafc; }
.hcpe-tool { display: flex; min-height: 66px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 10px; background: transparent; color: #5d6a80; font-size: 11px; font-weight: 720; }
.hcpe-tool > span:first-child { height: 24px; font-size: 22px; line-height: 24px; }
.hcpe-tool .hcpe-tool-letter { font-family: Georgia, serif; font-size: 23px !important; font-weight: 900; }
.hcpe-tool:hover { background: #eef2ff; color: var(--hcpe-primary); }
.hcpe-tool.active { background: #e8efff; color: var(--hcpe-primary-dark); box-shadow: inset 3px 0 0 var(--hcpe-primary); }

.hcpe-controls { overflow-y: auto; max-height: 824px; border-right: 1px solid var(--hcpe-line); background: #fff; scrollbar-width: thin; }
.hcpe-panel { display: none; padding: 20px 18px 30px; }
.hcpe-panel.active { display: block; }
.hcpe-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
.hcpe-panel-head h2 { margin: 0; color: var(--hcpe-ink); font-size: 18px; font-weight: 800; }
.hcpe-panel-head p { margin: 5px 0 0; color: var(--hcpe-muted); font-size: 12px; line-height: 1.45; }
.hcpe-link-btn { padding: 3px; border: 0; background: none; color: var(--hcpe-primary); font-size: 12px; font-weight: 750; }
.hcpe-section-title { margin: 21px 0 10px; color: #475569; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.hcpe-help { margin: 10px 0; color: #718096; font-size: 11px; line-height: 1.5; }

.hcpe-upload-card { width: 100%; min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 14px; border: 1.5px dashed #aebbd0; border-radius: 13px; background: #f8fbff; color: var(--hcpe-ink); }
.hcpe-upload-card > span { color: var(--hcpe-primary); font-size: 30px; }
.hcpe-upload-card strong { font-size: 13px; }
.hcpe-upload-card small { color: var(--hcpe-muted); }
.hcpe-upload-card:hover { border-color: var(--hcpe-primary); background: #eff6ff; }
.hcpe-wide-btn { width: 100%; min-height: 40px; margin-top: 10px; padding: 9px 12px; border: 1px solid #cdd7e6; border-radius: 9px; background: #fff; color: #334155; font-weight: 720; }
.hcpe-wide-btn:hover { border-color: var(--hcpe-primary); color: var(--hcpe-primary); }
.hcpe-wide-btn.primary { border-color: var(--hcpe-primary); background: var(--hcpe-primary); color: #fff; }
.hcpe-wide-btn.muted { background: #f8fafc; color: #64748b; }
.hcpe-button-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.hcpe-button-grid button, .hcpe-preset-grid button, .hcpe-property-buttons button { min-height: 42px; padding: 8px; border: 1px solid #d8e0eb; border-radius: 8px; background: #fff; color: #44516a; font-size: 11px; font-weight: 700; }
.hcpe-button-grid button:hover, .hcpe-preset-grid button:hover { border-color: #8ab0ff; background: #f0f6ff; color: var(--hcpe-primary); }

.hcpe-field { position: relative; display: block; margin: 14px 0 0; color: #475569; font-size: 12px; font-weight: 700; }
.hcpe-field output { float: right; color: #7b879a; font-size: 11px; font-weight: 600; }
.hcpe-field input[type="range"] { width: 100%; height: 4px; display: block; margin-top: 10px; accent-color: var(--hcpe-primary); cursor: pointer; }
.hcpe-field input[type="number"], .hcpe-field input[type="text"], .hcpe-field select, .hcpe-field textarea { width: 100%; min-height: 39px; margin-top: 7px; padding: 8px 10px; border: 1px solid #d5deea; border-radius: 8px; outline: none; background: #fff; color: var(--hcpe-ink); font-weight: 550; }
.hcpe-field textarea { resize: vertical; }
.hcpe-field input:focus, .hcpe-field select:focus, .hcpe-field textarea:focus { border-color: var(--hcpe-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.hcpe-field input[type="color"] { width: 100%; height: 39px; display: block; margin-top: 7px; padding: 3px; border: 1px solid #d5deea; border-radius: 8px; background: #fff; }
.hcpe-two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.hcpe-check { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: #556276; font-size: 12px; font-weight: 650; }
.hcpe-check input { accent-color: var(--hcpe-primary); }

.hcpe-preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.hcpe-preset-grid button small { color: #8a96a8; font-size: 9px; }
.hcpe-filter-presets button.active { border-color: var(--hcpe-primary); background: #eaf1ff; color: var(--hcpe-primary); box-shadow: inset 0 0 0 1px var(--hcpe-primary); }
.hcpe-format-row, .hcpe-segmented { display: flex; gap: 5px; margin-top: 12px; }
.hcpe-format-row button { width: 38px; height: 36px; border: 1px solid #d5deea; border-radius: 7px; background: #fff; color: #475569; }
.hcpe-format-row button.active { border-color: var(--hcpe-primary); background: #eaf1ff; color: var(--hcpe-primary); }
.hcpe-segmented { padding: 3px; border-radius: 9px; background: #eef2f7; }
.hcpe-segmented button { flex: 1; padding: 7px 4px; border: 0; border-radius: 7px; background: transparent; color: #64748b; font-size: 11px; font-weight: 720; }
.hcpe-segmented button.active { background: #fff; color: var(--hcpe-primary); box-shadow: 0 1px 5px rgba(30,50,80,.12); }

.hcpe-shape-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hcpe-shape-grid button { min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px solid #d8e0eb; border-radius: 9px; background: #fff; color: #536075; font-size: 11px; font-weight: 700; }
.hcpe-shape-grid button:hover, .hcpe-shape-grid button.active { border-color: var(--hcpe-primary); background: #eff6ff; color: var(--hcpe-primary); }
.hcpe-shape-grid button > span:first-child { display: inline-block; width: 30px; height: 22px; }
.shape-rect { border: 2px solid currentColor; }
.shape-circle { border: 2px solid currentColor; border-radius: 50%; }
.shape-line { width: 35px !important; height: 2px !important; margin-top: 10px; background: currentColor; transform: rotate(-20deg); }
.hcpe-sticker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.hcpe-sticker-grid button { aspect-ratio: 1; border: 1px solid #dbe3ed; border-radius: 9px; background: #fff; font-size: 24px; }
.hcpe-sticker-grid button:hover { border-color: var(--hcpe-primary); background: #eff6ff; transform: scale(1.04); }

.hcpe-layer-toolbar { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; margin: 0 0 12px; }
.hcpe-layer-toolbar button { min-height: 33px; padding: 5px 3px; border: 1px solid #d8e0eb; border-radius: 7px; background: #fff; color: #4f5d73; font-size: 10px; font-weight: 750; }
.hcpe-layer-toolbar button:hover { border-color: #8ab0ff; background: #eff6ff; color: var(--hcpe-primary); }
.hcpe-layer-list { display: flex; flex-direction: column; gap: 6px; }
.hcpe-layer-row { display: grid; grid-template-columns: 16px 27px 28px minmax(0,1fr) 27px 27px 27px; align-items: center; gap: 3px; min-height: 48px; padding: 5px; border: 1px solid #dde5ef; border-radius: 9px; background: #fff; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.hcpe-layer-row.selected { border-color: var(--hcpe-primary); background: #eff6ff; }
.hcpe-layer-row.dragging { opacity: .45; }
.hcpe-layer-row.drag-over { border-color: var(--hcpe-secondary); transform: translateY(-2px); box-shadow: 0 5px 14px rgba(76,59,180,.14); }
.hcpe-layer-row button { min-width: 27px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #64748b; font-size: 12px; }
.hcpe-layer-row button:hover { background: #e2e8f0; color: var(--hcpe-primary); }
.hcpe-layer-grip { overflow: hidden; color: #b0bac8; font-size: 11px; letter-spacing: -3px; cursor: grab; }
.hcpe-layer-type { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: #eef2f7; color: #50617a; font-size: 13px; font-weight: 850; }
.hcpe-layer-label { width: 100% !important; overflow: hidden; justify-content: start !important; border: 0; background: transparent; color: #334155; font-size: 11px !important; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.hcpe-layer-rename { width: 100%; min-width: 0; height: 30px; padding: 4px 6px; border: 1px solid var(--hcpe-primary); border-radius: 6px; outline: none; font-size: 11px; }
.hcpe-base-layer { border-style: dashed; background: #f8fafc; }
.hcpe-no-layers { padding: 30px 12px; color: #8a96a8; font-size: 12px; text-align: center; }

.hcpe-canvas-column { min-width: 0; display: flex; flex-direction: column; background: #e9eef5; }
.hcpe-canvas-toolbar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; border-bottom: 1px solid #d6dfeb; background: #f8fafc; color: #718096; font-size: 11px; }
.hcpe-mini-btn { min-height: 29px; padding: 5px 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #566379; font-size: 11px; font-weight: 700; }
.hcpe-mini-btn:hover, .hcpe-mini-btn.active { border-color: #cbd5e1; background: #fff; color: var(--hcpe-primary); }
.hcpe-canvas-stage { position: relative; min-height: 670px; flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 42px; background: radial-gradient(circle at 50% 42%, #f1f4f8 0, #e4e9f0 72%); overscroll-behavior: contain; scrollbar-width: thin; }
.hcpe-empty-state { max-width: 420px; padding: 46px 28px; color: #607087; text-align: center; }
.hcpe-upload-icon { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 20px; background: #fff; color: var(--hcpe-primary); box-shadow: 0 12px 35px rgba(55,75,110,.12); font-size: 34px; }
.hcpe-empty-state h2 { margin: 0 0 8px; color: #26344b; font-size: 23px; }
.hcpe-empty-state p { margin: 0 0 18px; font-size: 13px; }
.hcpe-empty-state small { display: block; margin-top: 12px; }
.hcpe-canvas-wrap { position: relative; flex: 0 0 auto; line-height: 0; background: transparent; box-shadow: 0 14px 48px rgba(30,45,70,.23); touch-action: none; }
#hcpe-canvas { display: block; max-width: none; outline: none; background-image: linear-gradient(45deg,#e8ecf1 25%,transparent 25%),linear-gradient(-45deg,#e8ecf1 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e8ecf1 75%),linear-gradient(-45deg,transparent 75%,#e8ecf1 75%); background-position: 0 0,0 8px,8px -8px,-8px 0; background-size: 16px 16px; cursor: default; }
.hcpe-canvas-meta { display: flex; align-items: center; gap: 16px; font-variant-numeric: tabular-nums; }
.hcpe-canvas-meta [data-role="pointer-position"] { min-width: 84px; color: #94a3b8; }
.hcpe-drop-hint { position: absolute; inset: 12px; z-index: 10; display: none; place-items: center; border: 3px dashed #7ba6ff; border-radius: 12px; background: rgba(239,246,255,.91); color: var(--hcpe-primary); font-size: 20px; font-weight: 800; line-height: 1; }
.hcpe-canvas-wrap.dragover .hcpe-drop-hint { display: grid; }
.hcpe-mobile-actions { display: none; }

.hcpe-properties { overflow-y: auto; max-height: 824px; padding: 18px 16px; border-left: 1px solid var(--hcpe-line); background: #fff; scrollbar-width: thin; }
.hcpe-properties-head { padding-bottom: 12px; border-bottom: 1px solid #e7edf4; }
.hcpe-properties-head h3 { margin: 0; color: var(--hcpe-ink); font-size: 16px; }
.hcpe-properties-head span { display: block; margin-top: 4px; color: #8995a7; font-size: 11px; }
.hcpe-properties-empty { padding: 28px 5px; color: #8b97a8; font-size: 12px; line-height: 1.55; text-align: center; }
.hcpe-property-buttons { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin-top: 18px; }
.hcpe-property-buttons button.danger { color: var(--hcpe-danger); }
.hcpe-align-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.hcpe-align-grid button { min-height: 34px; padding: 5px; border: 1px solid #d8e0eb; border-radius: 7px; background: #fff; color: #536075; font-size: 10px; font-weight: 700; }
.hcpe-align-grid button:hover { border-color: #8ab0ff; background: #eff6ff; color: var(--hcpe-primary); }
.hcpe-crop-ratios { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; margin-bottom: 9px; }
.hcpe-crop-ratios button { min-height: 32px; padding: 4px 2px; border: 1px solid #d8e0eb; border-radius: 7px; background: #fff; color: #5a687d; font-size: 10px; font-weight: 750; }
.hcpe-crop-ratios button.active { border-color: var(--hcpe-primary); background: #eaf1ff; color: var(--hcpe-primary); }

body.hcpe-editor-immersive { overflow: hidden !important; }
.hcpe-workspace.hcpe-is-fullscreen,
.hcpe-workspace:fullscreen,
.hcpe-workspace:-webkit-full-screen { width: 100vw; height: 100vh; max-width: none; display: flex; flex-direction: column; overflow: hidden; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.hcpe-fallback-fullscreen .hcpe-workspace { position: fixed; z-index: 999999; inset: 0; width: 100vw; height: 100vh; max-width: none; display: flex; flex-direction: column; overflow: hidden; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.hcpe-is-fullscreen .hcpe-topbar,
.hcpe-fallback-fullscreen .hcpe-topbar { flex: 0 0 auto; }
.hcpe-is-fullscreen .hcpe-editor-grid,
.hcpe-fallback-fullscreen .hcpe-editor-grid { min-height: 0; height: calc(100vh - 64px); flex: 1 1 auto; grid-template-columns: 78px 310px minmax(380px,1fr) 300px; }
.hcpe-is-fullscreen .hcpe-controls,
.hcpe-is-fullscreen .hcpe-properties,
.hcpe-fallback-fullscreen .hcpe-controls,
.hcpe-fallback-fullscreen .hcpe-properties { max-height: none; min-height: 0; }
.hcpe-is-fullscreen .hcpe-canvas-stage,
.hcpe-fallback-fullscreen .hcpe-canvas-stage { min-height: 0; }

.hcpe-features { padding: 54px 0 10px; }
.hcpe-features > h2 { margin: 0 0 24px; color: var(--hcpe-ink); font-size: 28px; text-align: center; }
.hcpe-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.hcpe-feature-grid article { padding: 22px; border: 1px solid var(--hcpe-line); border-radius: 15px; background: #fff; box-shadow: 0 9px 25px rgba(30,50,85,.06); }
.hcpe-feature-grid article > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: #eaf1ff; color: var(--hcpe-primary); font-size: 20px; }
.hcpe-feature-grid h3 { margin: 14px 0 7px; color: #26344b; font-size: 15px; }
.hcpe-feature-grid p { margin: 0; color: #728095; font-size: 12px; line-height: 1.55; }

.hcpe-modal { position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.hcpe-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.68); backdrop-filter: blur(3px); }
.hcpe-modal-card { position: relative; width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 28px; border-radius: 18px; background: #fff; box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.hcpe-modal-card h2 { margin: 0 35px 7px 0; color: var(--hcpe-ink); font-size: 23px; }
.hcpe-modal-card > p { margin: 0 0 18px; color: #657389; font-size: 13px; line-height: 1.55; }
.hcpe-modal-close { position: absolute; right: 15px; top: 13px; width: 35px; height: 35px; border: 0; border-radius: 50%; background: #eef2f7; color: #64748b; font-size: 23px; }
.hcpe-export-preview { height: 235px; display: flex; align-items: center; justify-content: center; margin: 18px 0; overflow: hidden; border-radius: 10px; background: #e8edf4; }
.hcpe-export-preview canvas { max-width: 100%; max-height: 100%; box-shadow: 0 6px 20px rgba(30,45,70,.2); }
.hcpe-export-meta { margin-top: 14px; padding: 9px 11px; border-radius: 8px; background: #f1f5f9; color: #64748b; font-size: 11px; text-align: center; }
.hcpe-modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.hcpe-toast { position: fixed; z-index: 1000000; left: 50%; bottom: 28px; max-width: min(460px, calc(100vw - 32px)); transform: translateX(-50%); padding: 12px 17px; border-radius: 10px; background: #142033; color: #fff; box-shadow: 0 12px 35px rgba(0,0,0,.25); font-size: 13px; font-weight: 650; }
.hcpe-toast.success { background: #047857; }
.hcpe-toast.error { background: #b91c1c; }

.hcpe-profile-card { max-width: 1200px; display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 20px; margin: 25px auto; padding: 24px; border: 1px solid #dbe5f2; border-radius: 17px; background: linear-gradient(120deg,#f8fbff,#f4f0ff); box-shadow: 0 10px 30px rgba(30,50,90,.08); }
.hcpe-profile-card-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 14px; background: #2563eb; color: #fff; font-size: 27px; }
.hcpe-profile-card .hcpe-kicker { margin: 0 0 3px; color: #2563eb; }
.hcpe-profile-card h2 { margin: 0; color: #172033; font-size: 21px; }
.hcpe-profile-card p { margin: 4px 0 0; color: #64748b; font-size: 13px; }

.hcpe-profile-projects { max-width: 1200px; margin: 26px auto; padding: 30px; border: 1px solid #e1e8f2; border-radius: 20px; background: #fff; box-shadow: 0 12px 36px rgba(30,50,90,.08); }
.hcpe-projects-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid #e6edf5; }
.hcpe-projects-head .hcpe-kicker { color: #2563eb; }
.hcpe-projects-head h2 { margin: 0; color: #172033; font-size: 28px; }
.hcpe-projects-head p { margin: 6px 0 0; color: #64748b; }
.hcpe-project-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin-top: 24px; }
.hcpe-project-item { overflow: hidden; border: 1px solid #dfe7f1; border-radius: 14px; background: #fff; transition: transform .16s ease, box-shadow .16s ease; }
.hcpe-project-item:hover { transform: translateY(-2px); box-shadow: 0 13px 28px rgba(30,50,90,.11); }
.hcpe-project-thumb { aspect-ratio: 16/10; display: grid; place-items: center; overflow: hidden; background: #edf2f7; color: #8ba0bb; font-size: 38px; }
.hcpe-project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hcpe-project-info { padding: 15px; }
.hcpe-project-info h3 { overflow: hidden; margin: 0; color: #26344b; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.hcpe-project-info p { margin: 5px 0 12px; color: #8a96a8; font-size: 11px; }
.hcpe-project-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hcpe-project-actions a, .hcpe-project-actions button { padding: 5px 8px; border: 0; border-radius: 6px; background: #eff6ff; color: #2563eb; font-size: 11px; font-weight: 750; text-decoration: none; }
.hcpe-project-actions button { background: #fef2f2; color: #dc2626; }
.hcpe-project-empty { padding: 60px 20px 40px; color: #657389; text-align: center; }
.hcpe-project-empty > div { font-size: 50px; }
.hcpe-project-empty h3 { margin: 13px 0 5px; color: #26344b; font-size: 20px; }
.hcpe-project-empty p { margin: 0 0 18px; }

@media (max-width: 1280px) {
    .hcpe-editor-grid { min-width: 1080px; grid-template-columns: 72px 274px minmax(390px,1fr) 262px; }
    .hcpe-workspace { overflow-x: auto; }
}

@media (max-width: 980px) {
    .hcpe-hero { align-items: flex-start; flex-direction: column; padding: 31px 27px; }
    .hcpe-hero-actions { min-width: 0; justify-content: flex-start; }
    .hcpe-editor-grid { grid-template-columns: 72px 260px minmax(360px,1fr) 250px; min-width: 1040px; }
    .hcpe-workspace { overflow-x: auto; }
    .hcpe-feature-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .hcpe-project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
    .hcpe-app { margin-top: 14px; padding: 0 8px; }
    .hcpe-hero { border-radius: 17px; }
    .hcpe-hero-actions { width: 100%; }
    .hcpe-hero-actions .hcpe-btn { flex: 1; }
    .hcpe-workspace { overflow: visible; border-radius: 15px; }
    .hcpe-topbar { position: sticky; top: 0; z-index: 20; }
    .hcpe-topbar .hcpe-primary-actions { display: none; }
    .hcpe-topbar .hcpe-icon-btn > span:last-child { display: none; }
    .hcpe-editor-grid { min-width: 0; display: grid; grid-template-columns: 1fr; }
    .hcpe-toolrail { order: 1; position: sticky; top: 63px; z-index: 15; overflow-x: auto; flex-direction: row; padding: 7px; border-right: 0; border-bottom: 1px solid var(--hcpe-line); }
    .hcpe-tool { min-width: 63px; min-height: 55px; }
    .hcpe-tool.active { box-shadow: inset 0 -3px 0 var(--hcpe-primary); }
    .hcpe-controls { order: 3; max-height: none; border-top: 1px solid var(--hcpe-line); border-right: 0; }
    .hcpe-panel { padding: 18px 16px 25px; }
    .hcpe-canvas-column { order: 2; min-height: 430px; }
    .hcpe-canvas-stage { min-height: 380px; padding: 25px; }
    .hcpe-properties { order: 4; display: block; max-height: none; border-top: 1px solid var(--hcpe-line); border-left: 0; }
    .hcpe-canvas-meta [data-role="pointer-position"] { display: none; }
    .hcpe-mobile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border-top: 1px solid #d5deea; background: #fff; }
    .hcpe-feature-grid { grid-template-columns: 1fr; }
    .hcpe-features { padding-top: 36px; }
    .hcpe-modal-card { padding: 22px; }
    .hcpe-profile-card { grid-template-columns: 52px 1fr; padding: 18px; }
    .hcpe-profile-card-icon { width: 50px; height: 50px; }
    .hcpe-profile-card .hcpe-btn { grid-column: 1 / -1; }
    .hcpe-profile-projects { padding: 20px 15px; }
    .hcpe-projects-head { align-items: flex-start; flex-direction: column; }
    .hcpe-project-grid { grid-template-columns: 1fr; }
    .hcpe-is-fullscreen .hcpe-editor-grid,
    .hcpe-fallback-fullscreen .hcpe-editor-grid { min-width: 0; height: auto; overflow-y: auto; grid-template-columns: 1fr; }
    .hcpe-is-fullscreen .hcpe-toolrail,
    .hcpe-fallback-fullscreen .hcpe-toolrail { top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hcpe-app *, .hcpe-profile-projects *, .hcpe-profile-card * { scroll-behavior: auto !important; transition: none !important; }
}
