.fpd-entry { margin: 16px 0; }
.fpd-open { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 12px 18px; border: 1px solid #3264ff; border-radius: 11px; background: #eef3ff; color: #254cce; font: inherit; font-weight: 700; cursor: pointer; }
.fpd-open svg { flex: 0 0 21px; width: 21px; height: 21px; }
.fpd-open:hover { background: #e2eaff; }
.fpd-is-open { overflow: hidden; }
.fpd-dialog { box-sizing: border-box; position: fixed; inset: 0; width: min(1500px, calc(100vw - 40px)); height: min(960px, calc(100dvh - 40px)); max-width: none; max-height: none; padding: 0; margin: auto; border: 1px solid #e0e6f5; border-radius: 20px; background: #fff; color: #14213c; box-shadow: 0 30px 100px #06133240; font-family: inherit; font-size: 14px; text-align: left; }
.fpd-dialog[open] { display: flex; flex-direction: column; }
.fpd-dialog::backdrop { background: #0d183a99; backdrop-filter: blur(4px); }
.fpd-dialog *, .fpd-dialog *::before, .fpd-dialog *::after { box-sizing: border-box; }
.fpd-dialog [hidden] { display: none; }
.fpd-dialog h2, .fpd-dialog h3, .fpd-dialog p { padding: 0; margin: 0; text-align: left; }
.fpd-dialog h2 { font-size: 25px; line-height: 1.3; margin: 4px 0; }
.fpd-dialog h3 { font-size: 14px; font-weight: 700; line-height: 1.4; margin: 20px 0 10px; }
.fpd-dialog button { font: inherit; line-height: 1.35; cursor: pointer; transition: background .15s; text-transform: none; }
.fpd-dialog button:disabled { cursor: not-allowed; opacity: .45; }
.fpd-dialog button:focus-visible, .fpd-dialog input:focus-visible, .fpd-dialog select:focus-visible, .fpd-dialog textarea:focus-visible, .fpd-open:focus-visible { outline: 3px solid #8ca8ff; outline-offset: 3px; }
.fpd-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 24px; padding: 22px 28px; border-bottom: 1px solid #e4e9f5; }
.fpd-header > div { min-width: 0; }
.fpd-brand { color: #3264ff; letter-spacing: 1.4px; font-size: 11px; font-weight: 800; }
.fpd-header p { color: #78859d; font-size: 12px; overflow-wrap: anywhere; }
.fpd-secondary { padding: 11px 16px; border: 1px solid #dce4f3; border-radius: 9px; background: #fff; color: #314467; font-weight: 600; }
.fpd-secondary:hover { background: #f3f6fc; }
.fpd-workspace { display: grid; grid-template-columns: 295px minmax(0, 1fr); flex: 1; min-height: 0; }
.fpd-tools { overflow-y: auto; overscroll-behavior: contain; padding: 22px; border-right: 1px solid #e4e9f5; }
.fpd-tools > p { font-size: 13px; line-height: 1.6; color: #6a7790; }
.fpd-add-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 10px; }
.fpd-add-tools button { min-height: 64px; padding: 8px; border: 1px solid #cddaff; border-radius: 10px; background: #f3f6ff; color: #2857df; font-weight: 600; }
.fpd-tools small { display: block; font-size: 10px; line-height: 1.6; color: #7a879e; }
.fpd-layers { display: grid; gap: 6px; max-height: 180px; overflow-y: auto; }
.fpd-layers > p { font-size: 12px; color: #7a879e; }
.fpd-layers button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid #e1e6f0; border-radius: 8px; background: #fff; color: #41516e; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.fpd-layers button.is-selected { border-color: #3264ff; background: #eef3ff; color: #2354e6; }
.fpd-properties label { display: block; font-size: 12px; font-weight: 600; margin: 12px 0 8px; }
.fpd-properties input:not([type=checkbox]), .fpd-properties textarea, .fpd-properties select { display: block; min-width: 0; width: 100%; min-height: 36px; margin: 6px 0 0; border: 1px solid #dce3f0; border-radius: 7px; padding: 6px 9px; background: #fff; color: #243654; font: inherit; }
.fpd-properties textarea { resize: vertical; max-height: 150px; }
.fpd-properties input[type=range] { padding: 0; border: 0; accent-color: #3264ff; }
.fpd-properties input[type=color] { padding: 3px; }
.fpd-properties .fpd-check { display: flex; align-items: center; gap: 8px; }
.fpd-check input { accent-color: #3264ff; }
.fpd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fpd-layer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 16px 0; }
.fpd-layer-actions button, .fpd-history button { border: 1px solid #e0e6f0; background: #fff; padding: 8px; border-radius: 7px; color: #435571; font-size: 12px; }
.fpd-layer-actions .fpd-danger { color: #d54156; border-color: #f5dfe3; background: #fff5f6; }
.fpd-preview { display: flex; flex-direction: column; align-items: center; min-width: 0; min-height: 0; padding: 18px 24px; background: #f4f6fc; }
.fpd-history { display: flex; justify-content: flex-end; gap: 6px; width: 100%; margin-bottom: 10px; }
.fpd-canvas-wrap { display: flex; align-items: center; justify-content: center; width: 100%; flex: 1; min-height: 0; }
.fpd-canvas-wrap canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff; box-shadow: 0 5px 22px #1b326510; touch-action: none; }
.fpd-preview .fpd-hint { font-size: 11px; color: #7a879e; text-align: center; margin-top: 14px; line-height: 1.5; }
.fpd-preview .fpd-status { min-height: 20px; color: #159648; font-size: 12px; line-height: 1.5; margin-top: 6px; text-align: center; }
.fpd-preview .fpd-status.is-error { color: #c52c42; }
.fpd-footer { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 24px; padding: 18px 28px; border-top: 1px solid #e4e9f5; }
.fpd-footer > p { color: #7a879e; font-size: 11px; line-height: 1.6; max-width: 440px; }
.fpd-footer > div { display: flex; gap: 10px; }
.fpd-save { padding: 12px 22px; border: 0; border-radius: 9px; background: #12a64b; color: #fff; font-weight: 700; }
.fpd-save:hover { background: #0d913f; }
@media (max-width: 900px) {
  .fpd-dialog { width: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .fpd-header { padding: 14px 18px; }
  .fpd-header h2 { font-size: 20px; }
  .fpd-workspace { grid-template-columns: 240px minmax(0, 1fr); }
  .fpd-tools { padding: 16px; }
  .fpd-footer { padding: 14px 18px; gap: 16px; }
  .fpd-footer > p { max-width: 260px; }
}
@media (max-width: 640px) {
  .fpd-header { gap: 12px; }
  .fpd-header p { font-size: 10px; max-width: 220px; }
  .fpd-header .fpd-secondary { font-size: 11px; padding: 8px; flex: 0 0 100px; }
  .fpd-brand { font-size: 9px; }
  .fpd-workspace { display: flex; flex-direction: column; overflow-y: auto; }
  .fpd-preview { order: -1; flex: 0 0 43dvh; min-height: 270px; padding: 12px; }
  .fpd-tools { overflow: visible; border-right: 0; border-top: 1px solid #e4e9f5; }
  .fpd-canvas-wrap { height: 25dvh; }
  .fpd-layers { max-height: 125px; }
  .fpd-add-tools { margin: 10px 0; }
  .fpd-add-tools button { min-height: 44px; }
  .fpd-footer { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; }
  .fpd-footer > p { max-width: none; font-size: 9px; }
  .fpd-footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .fpd-footer button { font-size: 12px; padding: 10px; }
}
