:root { --border:#d8dde8; --accent:#0f766e; --shadow:0 10px 24px rgba(15,23,42,.12); }
*{box-sizing:border-box} body{margin:0;font-family:"Segoe UI",Tahoma,sans-serif;color:#1f2937;background:radial-gradient(circle at 20% 10%,#eaf5ff 0,#f6f8fc 45%,#eef3ff 100%)}
.theme-toggle{display:flex;align-items:center;gap:4px;padding:4px;border-radius:999px;background:#e7e9e5;border:1px solid #d7dbd3}
.theme-btn{width:24px;height:24px;border:0;border-radius:999px;padding:0;display:flex;align-items:center;justify-content:center;font-size:13px;background:transparent;color:#9a8f60}
.theme-btn.active{background:#0f766e;color:#fff;box-shadow:inset 0 -1px 0 rgba(0,0,0,.14)}
body:not(.dark) #themeDarkBtn:not(.active){color:#0f766e}
body.dark #themeLightBtn:not(.active){color:#0f766e}
.hidden{display:none !important}
.app{height:100vh;display:flex;flex-direction:column}
.toolbar{position:relative;z-index:9000;display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--border);background:rgba(255,255,255,.84);backdrop-filter:blur(6px)}
.left,.right{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
button,input{border:1px solid var(--border);border-radius:8px;padding:6px 10px;font-size:14px;background:#fff} button{cursor:pointer}
#addWindowBtn,#modalCreateBtn{background:var(--accent);border-color:var(--accent);color:#fff}
.format-toggle{font-size:14px;display:flex;gap:6px;align-items:center}
.file-menu-wrap{position:relative;display:inline-block}
.file-label{background:#1f2937;color:#fff;border:1px solid #1f2937;border-radius:8px;padding:6px 12px;font-size:14px;cursor:pointer}
.file-dropdown{position:absolute;top:calc(100% + 8px);left:0;min-width:240px;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 12px 28px rgba(15,23,42,.18);padding:6px;z-index:9600;pointer-events:auto}
.file-dropdown.hidden{display:none}
.file-dropdown button,.file-toggle-item{display:flex;width:100%;align-items:center;gap:10px;text-align:left;border:0;background:#fff;padding:10px 12px;border-radius:10px;color:#1f2937}
.file-dropdown button:hover,.file-toggle-item:hover{background:#f8fafc}
.file-toggle-item{cursor:pointer;font-size:14px}
.file-toggle-item input{margin:0;width:16px;height:16px;accent-color:var(--accent)}
.file-modal-card{width:min(720px,calc(100vw - 32px))}
.file-doc-list{display:flex;flex-direction:column;gap:8px;max-height:min(54vh,480px);overflow:auto;padding-right:4px}
.file-doc-item{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #dce3ef;border-radius:12px;padding:12px;background:#fff}
.file-doc-item.active{border-color:var(--accent);box-shadow:inset 0 0 0 1px rgba(15,118,110,.08)}
.file-doc-meta{min-width:0;display:flex;flex-direction:column;gap:3px}
.file-doc-name{font-weight:700;font-size:14px;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-doc-sub{font-size:12px;color:#6b7280}
.file-doc-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.file-doc-actions button{padding:6px 10px}
.file-doc-open{background:var(--accent);border-color:var(--accent);color:#fff}
.hint{padding:8px 14px;font-size:13px;border-bottom:1px solid var(--border)} .hint.hidden{display:none}.hint.error{color:#991b1b;background:#fef2f2}.hint.warning{color:#92400e;background:#fffbeb}
.viewport{position:relative;z-index:1;flex:1;overflow:auto;padding:12px}
.viewport.panning{cursor:grabbing}
.desktop{position:relative;min-width:1800px;min-height:1100px;background-image:linear-gradient(to right,rgba(31,41,55,.06) 1px,transparent 1px),linear-gradient(to bottom,rgba(31,41,55,.06) 1px,transparent 1px);background-size:24px 24px;transform-origin:top left}
.viewport,.desktop{overflow-anchor:none}
.shape-menu-wrap{position:relative;display:inline-block}
.shape-label{background:#0f766e;color:#fff;border:1px solid #0f766e;border-radius:8px;padding:6px 10px;font-size:14px;cursor:pointer}
.shape-dropdown{position:absolute;top:calc(100% + 8px);left:0;min-width:220px;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 12px 28px rgba(15,23,42,.18);padding:6px;z-index:9500;pointer-events:auto}
.shape-dropdown.hidden{display:none}
.shape-dropdown button{display:block;width:100%;text-align:left;border:0;background:#fff;padding:10px 12px;border-radius:10px;transition:transform .08s ease, box-shadow .08s ease, background-color .08s ease}
.shape-dropdown button:hover{background:#f8fafc;transform:translateY(-1px);box-shadow:0 4px 10px rgba(15,23,42,.16)}
.modal{position:fixed;inset:0;background:rgba(2,6,23,.38);display:flex;align-items:center;justify-content:center;z-index:5000;pointer-events:auto}.modal.hidden{display:none}.modal-card{width:min(560px,calc(100vw - 32px));background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:16px;display:flex;flex-direction:column;gap:10px}.modal-actions{display:flex;justify-content:flex-end;gap:8px}
.sheet-window{position:absolute;width:640px;height:420px;border:1px solid #c7d0e0;border-radius:12px;background:#fff;box-shadow:var(--shadow);overflow:visible}
.sheet-window.selected-window{outline:1px dashed #38bdf8;outline-offset:2px}
.window-header{height:40px;background:#f8fafc;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 10px;cursor:move;user-select:none}
.window-title{font-size:13px;color:#6b7280}.window-actions{display:flex;gap:6px}.action-btn{width:28px;height:28px;border-radius:7px;padding:0}.sheet-frame{width:100%;height:calc(100% - 40px);border:0;background:#fff}
.resize-handle{position:absolute;right:0;bottom:0;width:16px;height:16px;cursor:nwse-resize;background:transparent}
.shape{position:absolute;cursor:move;user-select:none}
.shape.selected{outline:1px dashed #38bdf8;outline-offset:2px}
.shape .conn-points,.sheet-window .conn-points{display:none;position:absolute;inset:0;pointer-events:none}
.shape:hover .conn-points,.shape.selected .conn-points,.sheet-window:hover .conn-points,.sheet-window.selected-window .conn-points{display:block}
.conn-point{position:absolute;width:8px;height:8px;margin:-4px 0 0 -4px;border-radius:50%;background:#38bdf8;border:1px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,.2);cursor:crosshair;z-index:5;pointer-events:auto}
.conn-arrow{
  position:absolute;
  width:22px;
  height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  line-height:1;
  color:#8dd8ff;
  text-shadow:0 1px 2px rgba(15,23,42,.25);
  transform:translate(-50%,-50%);
  pointer-events:auto;
  cursor:crosshair;
  z-index:9
}
.conn-layer{position:absolute;inset:0;pointer-events:none;z-index:2}
.conn-line{fill:none;pointer-events:stroke;cursor:pointer}
.conn-line.selected{filter:drop-shadow(0 0 2px rgba(14,165,233,.8))}
.conn-handle{fill:#fff;stroke:#0ea5e9;stroke-width:2;cursor:crosshair;pointer-events:all}
.shape-rect{width:220px;height:120px;border:1px solid #000;background:#fff;overflow:hidden}
.shape-note{width:260px;height:150px;border:1px solid #d1c76a;background:#fff7a8;overflow:hidden}
.shape-note::after{display:none}
.shape-image{width:320px;height:240px;border:1px solid #cbd5e1;background:#fff;overflow:hidden}
.shape-image-media{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none;-webkit-user-drag:none}
.shape-text{width:100%;height:100%;padding:10px;outline:none;overflow:auto;cursor:text}
.shape-text[contenteditable="false"]{cursor:move;user-select:none;-webkit-user-select:none;pointer-events:none}
.shape-text[contenteditable="true"]{cursor:text;user-select:text;-webkit-user-select:text}
.shape-line{width:180px;height:2px;background:#000;transform-origin:left center;box-shadow:none}
.shape-line-handle{position:absolute;top:50%;width:12px;height:12px;margin-top:-6px;border-radius:50%;border:1px solid #111827;background:#fff;cursor:crosshair;display:none}
.shape-line-handle.start{left:-6px}
.shape-line-handle.end{right:-6px}
.shape.selected .shape-line-handle{display:block}
.shape-table{width:520px;height:300px;border:1px solid #111827;background:#fff;overflow:visible}
.shape-table-root{position:absolute;left:0;right:0;top:34px;bottom:0;padding:0;cursor:move}
.shape-table-wrap{width:100%;height:100%;overflow:auto;overscroll-behavior:contain;background:#fff;cursor:move}
.shape-table-grid{border-collapse:collapse;table-layout:fixed;width:100%;height:100%}
.shape-table-grid td{border:1px solid #111827;padding:4px 6px;outline:none;vertical-align:middle;white-space:normal;overflow:hidden;text-overflow:clip;overflow-wrap:anywhere;word-break:break-word;background:#fff;cursor:inherit}
.shape-table-grid td:focus,.shape-table-grid td.cell-selected{box-shadow:inset 0 0 0 2px #38bdf8}
.shape-table-grid td.cell-range-selected{box-shadow:inset 0 0 0 1px #60a5fa;background:#eff6ff}
.shape-table-grid td.cell-editing{box-shadow:inset 0 0 0 2px #0ea5e9}
.shape-table-grid td.cell-editing,
.shape-table-grid td[contenteditable="true"]{cursor:text;user-select:text;-webkit-user-select:text}
.table-titlebar{position:absolute;left:0;right:0;top:0;height:34px;background:#f8fafc;border-bottom:1px solid #cbd5e1;border-radius:8px 8px 0 0;display:flex;align-items:center;padding:0 10px;cursor:move;z-index:25}
.table-title-text{font-size:13px;color:#334155;outline:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:20px;cursor:text}
.table-add-col,.table-add-row{position:absolute;width:26px;height:26px;border-radius:50%;padding:0;display:none;align-items:center;justify-content:center;font-size:16px;line-height:1}
.table-add-col{right:-34px;top:2px;transform:none;z-index:40}
.table-add-row{left:0;bottom:-34px;transform:none;z-index:40}
.shape.selected .table-add-col,.shape.selected .table-add-row{display:flex}
.table-cell-toolbar{display:none !important}
.table-cell-toolbar.hidden{display:none}
.table-cell-toolbar .tt-google{height:34px;border-radius:8px;border:1px solid #bfc7d4;background:#fff;padding:4px 10px}
.table-cell-toolbar .tt-font{width:150px}
.table-cell-toolbar .tt-size{width:68px}
.table-cell-toolbar .tt-btn{width:34px;height:34px;padding:0;border:1px solid transparent;background:transparent;border-radius:6px;font-size:18px;line-height:1;color:#3c4043}
.table-cell-toolbar .tt-btn:hover{background:#dde3ec}
.table-cell-toolbar .tt-btn.active{background:#d2e3fc;border-color:#8ab4f8;color:#174ea6}
.table-cell-toolbar .tt-align,.table-cell-toolbar .tt-valign{display:flex;gap:2px;padding:2px;border-radius:8px;background:#dfe4ec}
.table-cell-toolbar .tt-borders,.table-cell-toolbar .tt-wrap,.table-cell-toolbar .tt-merge{font-size:19px}
.table-cell-toolbar .tt-btn:disabled{opacity:.45;cursor:not-allowed}
.table-cell-toolbar .tt-sep{display:inline-block;width:1px;height:28px;background:#c3cad6;margin:0 4px}
.table-cell-toolbar .tt-color-wrap,.table-cell-toolbar .tt-fill-wrap,.table-cell-toolbar .tt-border-wrap{position:relative;display:flex;align-items:center;justify-content:center;gap:0;font-size:14px;color:#3c4043;width:34px;height:34px;border-radius:6px}
.table-cell-toolbar .tt-color,.table-cell-toolbar .tt-fill,.table-cell-toolbar .tt-border{position:absolute;inset:0;opacity:0;cursor:pointer}
.table-cell-toolbar .tt-align,.table-cell-toolbar .tt-valign{display:flex;gap:2px}
.table-cell-toolbar .tt-strike span{text-decoration:line-through}
.shape-handles{position:absolute;inset:-6px;pointer-events:none;display:none}
.shape.selected .shape-handles{display:block}
.h{position:absolute;width:10px;height:10px;background:#38bdf8;border:1px solid #fff;border-radius:50%;pointer-events:auto}
.h.nw{left:0;top:0;cursor:nwse-resize}.h.n{left:50%;top:0;transform:translateX(-50%);cursor:ns-resize}.h.ne{right:0;top:0;cursor:nesw-resize}
.h.e{right:0;top:50%;transform:translateY(-50%);cursor:ew-resize}.h.se{right:0;bottom:0;cursor:nwse-resize}.h.s{left:50%;bottom:0;transform:translateX(-50%);cursor:ns-resize}
.h.sw{left:0;bottom:0;cursor:nesw-resize}.h.w{left:0;top:50%;transform:translateY(-50%);cursor:ew-resize}
.format-panel{position:fixed;right:20px;top:76px;width:640px;height:874px;overflow:auto;overflow-x:hidden;background:#f8fafc;border:1px solid #dfe4ee;border-radius:16px;box-shadow:0 10px 30px rgba(15,23,42,.12);padding:0;z-index:9500;resize:none}
.format-panel.hidden{display:none}
@media (max-width:900px){.toolbar{flex-direction:column;align-items:flex-start}}

.fp-header{display:flex;align-items:center;justify-content:space-between;height:56px;padding:0 20px;border-bottom:1px solid #e5e7eb;cursor:move;user-select:none;position:sticky;top:0;background:#f8fafc;z-index:5}
.fp-title{font-size:14px;font-weight:600;margin:0;line-height:1.2;color:#1f2937}
.fp-close{width:28px;height:28px;border-radius:8px;background:transparent;border:0;font-size:18px;line-height:1;color:#334155}

.fp-tabs{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin:12px 20px}
.fp-tab{height:38px;border:1px solid #e5e7eb;background:#f8fafc;padding:8px 10px;font-weight:600;font-size:14px;color:#1f2937;border-radius:8px}
.fp-tab.active{border-color:#22a06b;color:#16865a;background:#fff}

.fp-panel{padding:0 20px 14px}
.fp-panel.hidden{display:none}
.fp-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 16px}
.fp-grid label{font-size:13px;display:flex;flex-direction:column;gap:6px;color:#1f2937}
.fp-grid input,.fp-grid select{height:32px;border-radius:8px;padding:8px 10px;font-size:14px;border:1px solid #d6dee8;background:#fff}
.fp-range-row{display:grid;grid-template-columns:1fr 76px;gap:8px;align-items:center}
.fp-range-row input[type="number"]{text-align:right}
.fp-range-row input[type="range"]{height:4px;padding:0;accent-color:#2563eb}
.fp-range-row input[type="range"]::-webkit-slider-thumb{width:12px;height:12px}

.fp-style-presets{border:1px solid #e7edf5;border-radius:12px;padding:12px;background:#fff;margin:2px 0 12px}
.fp-subtitle-plain{font-size:14px;font-weight:600;color:#1f2937;margin:0 0 8px}
.fp-swatches{display:grid;grid-template-columns:repeat(8,1fr);gap:8px;margin-bottom:12px}
.swatch{height:36px;min-height:36px;max-height:36px;border:1px solid #d6dee8;border-radius:6px;padding:0;position:relative;background:#fff}
.swatch:hover{transform:translateY(-1px);box-shadow:0 4px 10px rgba(15,23,42,.1)}
.swatch-none::after{content:"";position:absolute;left:8px;right:8px;top:19px;height:2px;background:#ff7474;transform:rotate(-38deg)}
.swatch-more{height:36px;border:1px solid #d6dee8;border-radius:6px;background:#fff;color:#667085;font-size:18px;line-height:1}
.fp-border-presets .border-line span{position:absolute;left:8px;right:8px;top:17px;height:2px;background:#111827}
.fp-border-presets .border-line.dashed span{background:repeating-linear-gradient(to right,#111827 0 5px,transparent 5px 8px)}
.fp-border-presets .border-line.dashed2 span{background:repeating-linear-gradient(to right,#111827 0 7px,transparent 7px 12px)}
.fp-border-presets .border-line.active{box-shadow:inset 0 0 0 2px #22a06b}
.fp-border-presets .border-box.c1{border:2px solid #f4cc47}
.fp-border-presets .border-box.c2{border:2px solid #ff8d8d}
.fp-border-presets .border-box.c3{border:2px solid #a977ff}
.fp-preset-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.fp-preset-actions button{height:36px;border-radius:8px;border:1px solid #d6dee8;background:#fff;font-size:14px;font-weight:500;color:#27344b;white-space:nowrap}

.fp-style-columns{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.fp-col{display:flex;flex-direction:column;gap:10px}
.fp-col-title{font-size:14px;font-weight:600;color:#1f2937;line-height:1.2}
.fp-col label{font-size:13px;display:flex;flex-direction:column;gap:6px;color:#1f2937}
.fp-col input,.fp-col select{height:32px;border-radius:8px;padding:8px 10px;font-size:14px;border:1px solid #d6dee8;background:#fff}
.fp-fill-picker{width:48px;height:40px;border:1px solid #d6dee8;border-radius:8px;background:#fff;display:flex;align-items:center;justify-content:center}
.fp-mini-picker{position:relative;width:24px;height:24px;border:1px solid #64748b;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden}
.fp-mini-picker input[type="color"]{width:28px;height:28px;border:0;padding:0;background:transparent;border-radius:0;cursor:pointer}
.fp-mini-line::before{content:"";position:absolute;width:16px;height:2px;background:currentColor;color:#111827}
.fp-color-inline{height:32px;border:1px solid #d6dee8;border-radius:8px;background:#fff;padding:6px 10px;display:flex;align-items:center;gap:8px;font-size:14px}
.fp-border-dot{width:16px;height:16px;border-radius:4px;border:1px solid #cbd5e1;background:#000}

.fp-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.fp-actions button{height:40px;border-radius:10px;padding:8px 6px;font-size:13px}
.fp-subtitle{font-size:13px;font-weight:700;color:#1f2d44;margin:10px 0 8px;padding-top:10px;border-top:1px solid #edf1f7}

.fp-align-row{display:flex;gap:10px;margin:10px 0 12px}
.fp-ico{width:54px;height:44px;padding:0;font-size:24px;line-height:1;display:flex;align-items:center;justify-content:center;background:#f8fafd;border:1px solid #dbe2ee;border-radius:10px}
.fp-ico.active{background:#eef7ff;color:#1a56db;border-color:#6ea8ff}

.fp-connector-only.hidden{display:none !important}
.fp-shape-only.hidden{display:none !important}
.fp-arrow-picker-wrap{grid-column:1 / -1;margin-top:4px;padding-top:10px;border-top:1px solid #edf1f7}
.fp-arrow-head{display:flex;align-items:center;justify-content:flex-start;gap:10px;margin-bottom:6px}
.fp-arrow-title{font-size:14px;line-height:1.1;margin:0}
.fp-arrow-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.fp-arrow-gap{display:flex;align-items:center;justify-content:flex-end;gap:6px;font-size:14px;line-height:1;white-space:nowrap;min-width:140px;margin:0}
.fp-grid label.fp-arrow-gap{flex-direction:row;gap:6px;align-items:center}
.fp-arrow-gap input{width:94px;height:40px;padding:4px 8px;text-align:right}
.fp-arrow-pick{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:0;flex:1 1 auto}
.fp-arrow-option{width:58px;height:40px;padding:6px;border-radius:9px;background:#fff;border:1px solid #d4dbe8}
.fp-arrow-option svg{width:100%;height:100%}
.fp-arrow-option line,.fp-arrow-option path{stroke:#111827;stroke-width:2;fill:#111827;stroke-linejoin:round;stroke-linecap:round}
.fp-arrow-option path[fill="none"]{fill:none}
.fp-arrow-option.active{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.25)}
.fp-arrow-option:hover{transform:translateY(-1px)}
.swatch.active{border:2px solid #22a06b}

.shape-text{display:flex;align-items:flex-start;justify-content:flex-start;white-space:pre-wrap}

body.dark{color:#e5e7eb;background:radial-gradient(circle at 20% 10%,#1b2430 0,#111827 45%,#0b1220 100%)}
body.dark .toolbar{background:rgba(17,24,39,.88);border-bottom-color:#334155}
body.dark button,body.dark input,body.dark select{background:#0f172a;color:#e5e7eb;border-color:#334155}
body.dark #addWindowBtn,body.dark #modalCreateBtn,body.dark .shape-label{background:#0f766e;color:#fff;border-color:#0f766e}
body.dark .hint.warning{background:#3b2f1a;color:#fcd34d}
body.dark .hint.error{background:#3b1f1f;color:#fca5a5}
body.dark .desktop{background-image:linear-gradient(to right,rgba(148,163,184,.12) 1px,transparent 1px),linear-gradient(to bottom,rgba(148,163,184,.12) 1px,transparent 1px)}
body.dark .sheet-window{background:#0f172a;border-color:#334155}
body.dark .window-header{background:#111827;border-bottom-color:#334155}
body.dark .window-title{color:#cbd5e1}
body.dark .format-panel{background:#111827;border-color:#334155;color:#e5e7eb}
body.dark .fp-tab{background:#1f2937;color:#e5e7eb}
body.dark .fp-tab.active{background:#0f172a}
body.dark .fp-tabs{background:#334155;border-color:#334155}
body.dark .theme-toggle{background:#1f2937;border-color:#334155}
body.dark .theme-btn{color:#eab308}
body.dark .theme-btn.active{background:#0f766e;color:#fff}

/* Draw.io-like format panel refresh */
.format-panel{
  position: fixed;
  width: 510px;
  max-width: calc(100vw - 16px);
  height: auto;
  max-height: none;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #f3f3f3;
  border: 1px solid #cfcfcf;
  border-radius: 26px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  padding-bottom: 10px;
  backdrop-filter: none;
  transform: scale(0.5);
  transform-origin: top right;
}

.format-panel.is-collapsed{
  max-height: 60px;
  overflow: hidden;
}

.format-panel.is-collapsed .fp-tabs,
.format-panel.is-collapsed .fp-panel{
  display: none;
}

.fp-header{
  height: 60px;
  padding: 0 16px 0 18px;
  background: linear-gradient(#f7f7f7, #efefef);
  border-bottom: 1px solid #d8d8d8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
  user-select: none;
}

.format-panel.is-collapsed .fp-header{
  border-bottom: 0;
}

.fp-resize-handle{
  position: absolute;
  z-index: 20;
  background: transparent;
  touch-action: none;
}

.fp-resize-handle.top{
  left: 0;
  right: 18px;
  top: 0;
  height: 10px;
  cursor: ns-resize;
}

.fp-resize-handle.right{
  top: 8px;
  right: 0;
  bottom: 8px;
  width: 10px;
  cursor: ew-resize;
}

.fp-resize-handle.bottom{
  left: 10px;
  right: 18px;
  bottom: 0;
  height: 10px;
  cursor: ns-resize;
}

.fp-resize-handle.corner{
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
}

.fp-title{
  width: 100%;
  text-align: center;
  padding-left: 28px;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  color: #454545;
  letter-spacing: -0.02em;
}

.fp-header-actions{
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  gap: 10px;
}

.fp-header-icon{
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #7b7b7b;
  font-size: 24px;
  line-height: 1;
}

.fp-tabs{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin: 0;
  border-bottom: 1px solid #d7d7d7;
}

.fp-tab{
  height: 54px;
  border: 0;
  border-right: 1px solid #d7d7d7;
  border-radius: 0;
  background: #e9e9e9;
  color: #474747;
  font-size: 19px;
  font-weight: 500;
}

.fp-tab.active{
  background: #f5f5f5;
  color: #333;
}

.fp-panel{
  padding: 14px 18px 8px;
}

.fp-strip{
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.fp-nav{
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #6b6b6b;
  font-size: 32px;
  line-height: 1;
  padding: 0;
}

.fp-swatches{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 10px;
  justify-items: center;
}

.swatch{
  width: 72px;
  height: 48px;
  border-radius: 0;
  border: 2px solid #808080;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}

.swatch.active{
  border-color: #111;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), 0 0 0 1px rgba(0,0,0,.06);
}

.fp-dots{
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 0 10px;
}

.fp-dots .dot{
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid #c7c7c7;
  background: #f3f3f3;
}

.fp-dots .dot.active{
  border-color: #92a8c3;
  background: #67c4f2;
}

.fp-style-group,
.fp-text-options,
.fp-margins,
.fp-arrow-block{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fp-row,
.fp-dual-actions,
.fp-text-quickbar,
.fp-icon-grid,
.fp-align-toolbar{
  display: flex;
  align-items: center;
  gap: 8px;
}

.fp-row{
  justify-content: space-between;
}

.fp-select-inline,
.fp-font-select,
.fp-wide-button,
.fp-color-button,
.fp-spinner-wrap input,
.fp-margins-grid input{
  height: 40px;
  border-radius: 6px;
  border: 1px solid #d3d3d3;
  background: #fff;
  color: #3f3f3f;
}

.fp-select-inline,
.fp-font-select{
  padding: 0 12px;
  font-size: 18px;
}

.fp-font-select{
  width: 100%;
  height: 42px;
  margin-bottom: 10px;
}

.fp-color-button{
  position: relative;
  width: 88px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fp-color-button input[type="color"]{
  position: absolute;
  inset: 0;
  opacity: 0;
}

.fp-color-preview{
  width: 42px;
  height: 24px;
  border: 1px solid #d0d0d0;
  background: #ffffff;
}

.fp-line-preview{
  background: #000;
}

.fp-color-pencil{
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  color: #616161;
}

.fp-spinner-wrap{
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.fp-spinner-wrap input[type="number"]{
  width: 118px;
  padding: 0 10px;
  font-size: 18px;
  text-align: right;
}

.fp-spinner-wrap input[type="range"]{
  width: 100%;
  height: 18px;
  background: transparent;
  accent-color: #67a7d8;
}

.fp-unit{
  color: #545454;
  font-size: 18px;
}

.fp-label-inline,
.fp-font-head,
.fp-subtitle-line{
  font-size: 18px;
  font-weight: 600;
  color: #474747;
  margin: 0;
}

.fp-font-head,
.fp-subtitle-line{
  margin-top: 4px;
}

.fp-check{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  color: #4b4b4b;
  font-weight: 600;
}

.fp-check input{
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: #157efb;
}

.fp-check input:indeterminate{
  accent-color: #b8bec7;
}

.fp-quick{
  justify-content: center;
  min-width: 42px;
  height: 40px;
  padding: 0 10px;
  border-radius: 6px;
  border-color: #d0d0d0;
  background: #fff;
  font-size: 18px;
  font-weight: 700;
}

.fp-quick input{
  width: 18px;
  height: 18px;
}

.fp-icon-grid{
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 8px 0 10px;
}

.fp-icon-btn,
.fp-mini-align{
  width: 56px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #4e4e4e;
  font-size: 22px;
  padding: 0;
}

.fp-icon-btn.active,
.fp-mini-align.active{
  background: #d9d9d9;
  border-color: #c2c2c2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.fp-text-options{
  margin-top: 6px;
  padding-top: 0;
}

.fp-text-options .fp-check{
  font-size: 18px;
}

.fp-text-options .fp-text-scale{
  grid-column: 1 / -1;
  align-items: flex-start;
}

.fp-text-options .fp-text-scale span{
  white-space: normal;
  line-height: 1.15;
}

.fp-muted-row{
  justify-content: space-between;
}

.fp-muted-value{
  font-size: 18px;
  color: #666;
}

.fp-margins-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.fp-margins-grid label{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 17px;
  color: #555;
}

.fp-margins-grid input{
  width: 100%;
  padding: 0 10px;
  font-size: 18px;
  text-align: right;
}

.fp-wide-button,
.fp-dual-actions button,
.fp-footer-select button{
  width: 100%;
  height: 42px;
  font-size: 18px;
  border-radius: 6px;
  border: 1px solid #d0d0d0;
  background: linear-gradient(#fafafa, #f0f0f0);
  color: #444;
}

.fp-dual-actions{
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.fp-dual-actions button{
  font-size: 18px;
}

.fp-align-toolbar{
  justify-content: space-between;
  gap: 6px;
  margin: 6px 0;
}

.fp-align-toolbar .fp-mini-align{
  width: calc((100% - 30px) / 6);
  min-width: 0;
}

.fp-table-only{
  margin-top: 10px;
  padding-top: 10px;
}

.fp-connector-only.hidden,
.fp-shape-only.hidden,
.fp-table-only.hidden{
  display: none !important;
}

.fp-arrow-pick{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.fp-arrow-option{
  height: 40px;
  border-radius: 6px;
  border: 1px solid #d0d0d0;
  background: #fff;
}

.fp-arrow-option.active{
  background: #d9d9d9;
}

.fp-arrow-option svg{
  width: 100%;
  height: 100%;
}

.fp-arrow-option line,
.fp-arrow-option path{
  stroke: #3b3b3b;
  fill: #3b3b3b;
}

.fp-arrow-wrap{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fp-arrow-label{
  font-size: 18px;
  color: #474747;
  font-weight: 600;
}

.fp-arrow-gap{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #555;
}

.fp-arrow-gap input{
  width: 86px;
  height: 40px;
  padding: 0 10px;
  text-align: right;
}

.fp-wide-button-ghost{
  background: linear-gradient(#fbfbfb, #f2f2f2);
}

.fp-center-check{
  justify-content: center;
}

.fp-check.fp-disabled{
  opacity: .45;
}

.fp-check.fp-quick{
  min-width: 40px;
  justify-content: center;
  padding: 0 10px;
  height: 40px;
  border: 1px solid #d0d0d0;
  background: #fff;
  border-radius: 6px;
}

.fp-check.fp-quick input{
  display: none;
}

.fp-check.fp-quick span{
  min-width: 14px;
  text-align: center;
}

.fp-quick:has(input:checked),
.fp-check.fp-quick:has(input:checked){
  background: #d9d9d9;
}

.fp-check.fp-quick.fp-mixed{
  background: #e5e7eb;
}

.fp-mixed{
  opacity: .82;
}

.fp-mixed input[type="number"],
.fp-mixed select{
  background: #f3f5f7 !important;
  color: #6b7280 !important;
}

.fp-mixed input[type="range"]{
  accent-color: #b8bec7;
}

.fp-color-button.fp-mixed .fp-color-preview{
  background: #cfd5dd !important;
}

#fpTextColor.fp-mixed{
  background: #f3f5f7 !important;
  filter: grayscale(1);
}

.fp-header-icon:hover,
.fp-tab:hover,
.fp-wide-button:hover,
.fp-dual-actions button:hover,
.fp-quick:hover,
.fp-icon-btn:hover,
.fp-mini-align:hover,
.fp-arrow-option:hover,
.swatch:hover,
.fp-nav:hover{
  filter: brightness(0.98);
}
