@font-face{font-family:'Noto Sans Thai';src:url('./fonts/NotoSansThai-Regular.ttf')}@font-face{font-family:'Noto Serif Thai';src:url('./fonts/NotoSerifThai-Regular.ttf')}
/* Design-app layout: gradient top bar, canvas in the middle, layered timeline, tool rail
   (desktop) or bottom tab bar (phone and tablet), and one sheet at a time. */
#designWorkspace{--ink:#0e1318;--muted:#5e6670;--line:#e6e7ea;--soft:#f1f2f6;--row:#eef0f3;--tile:#f3f4f8;--accent:#8b3dff;--accent-soft:#f1e8ff;--chip:#e4dbfb;--top:linear-gradient(90deg,#00c4cc 0%,#3f8ee8 50%,#7d2ae8 100%);
  position:relative;display:grid;grid-template-columns:76px minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr);grid-template-areas:"top top" "busy busy" "tabs main";
  background:var(--soft);color:var(--ink);border:1px solid var(--line);border-radius:18px;overflow:hidden;margin:0 0 24px;font-family:'Noto Sans Thai',system-ui,sans-serif;min-height:680px}
#designWorkspace *{box-sizing:border-box}
#designWorkspace [hidden]{display:none!important}
#designWorkspace button,#designWorkspace select,#designWorkspace input,#designWorkspace textarea{font:inherit;color:inherit;max-width:100%}
#designWorkspace button{min-height:40px;border:1px solid var(--line);border-radius:10px;background:white;padding:6px 12px;cursor:pointer;transition:background .15s,border-color .15s,box-shadow .15s}
#designWorkspace button:hover{background:#f7f7f9}#designWorkspace button:disabled{opacity:.4;cursor:default}
#designWorkspace button:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
#designWorkspace .dw-primary{background:var(--accent);border-color:var(--accent);color:white;font-weight:600}#designWorkspace .dw-primary:hover{background:#7a2ff0}
#designWorkspace select,#designWorkspace input:not([type=range]):not([type=checkbox]):not([type=color]),#designWorkspace textarea{background:white;border:1px solid #d5d8dd;border-radius:10px;padding:8px 10px;min-height:42px;width:100%}
#designWorkspace input[type=color]{width:100%;height:40px;border:1px solid #d5d8dd;border-radius:8px;padding:3px;background:white}
#designWorkspace svg{width:22px;height:22px;flex:none}
/* Top bar */
.dw-topbar{grid-area:top;display:flex;align-items:center;gap:6px;padding:8px 12px;background:var(--top);color:white;min-height:60px}
.dw-top-left,.dw-top-right{display:flex;align-items:center;gap:4px}.dw-top-right{margin-left:auto}
#designWorkspace .dw-topbar button{background:transparent;border:0;color:white;display:inline-flex;align-items:center;gap:8px;border-radius:10px;padding:6px 10px;font-weight:600}
#designWorkspace .dw-topbar button:hover,#designWorkspace .dw-topbar button[aria-pressed=true]{background:rgba(255,255,255,.18)}
#designWorkspace .dw-topbar .dw-icon span{display:none}#designWorkspace .dw-topbar .dw-save span{display:inline;font-size:13px;opacity:.9;font-weight:500}
#designWorkspace .dw-topbar .dw-save.dw-dirty span{opacity:1;font-weight:700}
#designWorkspace .dw-topbar .dw-share{background:white;color:var(--accent);font-weight:700;padding:6px 16px}#designWorkspace .dw-topbar .dw-share:hover{background:#f4edff}
#designWorkspace .dw-topbar .dw-menu{font-size:16px}#designWorkspace .dw-edit-menu svg:last-child{width:18px;height:18px}
#designWorkspace .dw-title{max-width:260px;margin-left:8px;background:rgba(255,255,255,.14);border:1px solid transparent;color:white;font-weight:600;min-height:38px}
#designWorkspace .dw-title:focus{background:white;color:var(--ink)}
/* Edit menu */
.dw-popover{position:absolute;z-index:60;display:flex;flex-direction:column;min-width:230px;padding:6px;background:white;border-radius:14px;box-shadow:0 12px 36px rgba(14,19,24,.22)}
/* Status line */
.dw-busy{grid-area:busy;display:flex;align-items:center;gap:8px;padding:0 14px;background:white;border-bottom:1px solid var(--line)}
.dw-status{margin:0;flex:1;font-size:13px;color:var(--muted);min-height:30px;display:flex;align-items:center}
#designWorkspace.dw-working .dw-status{color:var(--accent);font-weight:600}
#designWorkspace #dwCancel{min-height:30px;padding:2px 12px;font-size:13px}
.dw-busy:has(.dw-status:empty):has(#dwCancel[hidden]){display:none}
/* Main area */
.dw-main{grid-area:main;display:flex;min-width:0;min-height:0}
.dw-center{flex:1;min-width:0;display:flex;flex-direction:column;position:relative;padding:12px 16px 10px;overflow-y:auto}
.dw-stage{flex:1 0 auto;min-height:240px;display:flex;align-items:center;justify-content:center;padding:20px 8px}
.dw-stage canvas{display:block;max-width:100%;max-height:50vh;width:auto;height:auto;background:white;box-shadow:0 1px 3px rgba(14,19,24,.06),0 10px 30px rgba(14,19,24,.1);touch-action:none}
.dw-context{position:absolute;top:14px;left:50%;transform:translateX(-50%);z-index:5;display:flex;gap:2px;padding:4px;background:white;border-radius:14px;box-shadow:0 6px 24px rgba(14,19,24,.16);max-width:calc(100% - 24px);overflow-x:auto}
#designWorkspace .dw-ctx{border:0;display:inline-flex;align-items:center;gap:6px;min-height:38px;padding:4px 10px;white-space:nowrap;font-size:13px;background:transparent}
/* Playback */
.dw-play{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:16px;padding:6px 0}
.dw-time{font-variant-numeric:tabular-nums;font-size:16px;font-weight:600}.dw-time:first-child{text-align:right}
#designWorkspace .dw-play-button{width:54px;height:54px;min-height:54px;border-radius:50%;border:0;padding:0;display:grid;place-items:center;background:white;box-shadow:0 2px 10px rgba(14,19,24,.16)}
#designWorkspace .dw-play-button svg{width:24px;height:24px}
.dw-play input[type=range]{grid-column:1/-1;width:100%;height:4px;accent-color:var(--accent);opacity:.5}
/* Timeline */
.dw-timeline{background:white;border:1px solid var(--line);border-radius:14px;padding:6px 0 8px;transition:box-shadow .15s}
.dw-timeline.dw-dragover{box-shadow:0 0 0 3px var(--accent)}
.dw-tl-head{display:flex;align-items:center;gap:8px;padding:0 12px 2px;font-size:12px;color:var(--muted)}.dw-tl-head span:first-child{flex:1}
.dw-zoom{display:flex;gap:4px}#designWorkspace .dw-zoom button{min-height:28px;padding:0 10px;font-size:13px}
.dw-tl-scroll{position:relative;overflow-x:auto;padding:0 12px 4px}
.dw-ruler{position:relative;height:24px;min-width:100%;cursor:pointer}
.dw-ruler span{position:absolute;top:4px;font-size:11px;color:#8a929b;padding-left:4px;border-left:1px solid #c9cdd3;height:16px;line-height:14px}
.dw-tl-row{display:flex;align-items:center;gap:6px;min-height:40px;margin-top:6px}
#designWorkspace .dw-elements-row button,#designWorkspace .dw-row-add{display:inline-flex;align-items:center;gap:6px;min-height:34px;border:0;background:var(--row);color:#3d4550;border-radius:8px;font-size:13px;white-space:nowrap;padding:4px 12px}
#designWorkspace .dw-elements-row svg,#designWorkspace .dw-row-add svg{width:16px;height:16px}
#designWorkspace .dw-row-add-icon span{display:none}
#designWorkspace .dw-elements-row .dw-chip{background:#e0f7f5;color:#08605a}#designWorkspace .dw-elements-row .dw-chip[aria-pressed=true]{background:var(--accent-soft);color:var(--accent);box-shadow:inset 0 0 0 2px var(--accent)}
.dw-media-row{min-height:76px}
#designWorkspace .dw-pages.dw-clips{display:flex;gap:4px;padding:0;margin:0;overflow:visible}
#designWorkspace .dw-clips .dw-clip{position:relative;flex:0 0 auto;min-height:72px;padding:0 0 4px;background:var(--row);border:2px solid transparent;border-radius:10px;overflow:hidden;display:flex;flex-direction:column;text-align:left;font-size:11px;line-height:1;color:#3d4550;touch-action:none;cursor:grab}
#designWorkspace .dw-clips .dw-clip:hover{background:#e6e8ec}
#designWorkspace .dw-clips .dw-clip[aria-pressed=true]{border-color:var(--accent);background:var(--accent-soft);color:var(--accent);font-weight:600}
#designWorkspace .dw-clips .dw-clip canvas{width:100%;height:50px;object-fit:cover;display:block;pointer-events:none;background:#d9dce1;margin-bottom:4px}
.dw-trim{position:absolute;top:0;right:0;bottom:0;width:14px;cursor:ew-resize;background:linear-gradient(90deg,transparent 5px,rgba(139,61,255,.85) 5px,rgba(139,61,255,.85) 8px,transparent 8px);opacity:0;transition:opacity .15s}
.dw-clip:hover .dw-trim,.dw-clip[aria-pressed=true] .dw-trim{opacity:1}
.dw-clip.dw-drop-before{box-shadow:-5px 0 0 var(--accent)}.dw-clips.dw-drop-end{box-shadow:5px 0 0 var(--accent)}
#designWorkspace .dw-append{flex:0 0 52px;width:52px;min-height:52px;height:52px;border-radius:50%;border:0;background:white;box-shadow:0 2px 10px rgba(14,19,24,.18);margin-left:6px;display:grid;place-items:center;padding:0}
#designWorkspace .dw-append span{display:none}
.dw-music-row{min-height:40px}
.dw-music{display:flex;align-items:center;gap:8px;padding:4px 10px;border-radius:8px;background:#e9ddff;color:#4b1fa3;font-size:12px;min-height:36px}
.dw-music span{flex:1;display:flex;align-items:center;gap:6px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dw-music svg{width:16px!important;height:16px!important}
#designWorkspace .dw-music input{width:110px;accent-color:var(--accent)}
#designWorkspace .dw-music button{min-height:28px;padding:0 10px;font-size:12px;border:0}
.dw-playhead{position:absolute;top:22px;bottom:0;width:2px;margin-left:-1px;background:var(--ink);pointer-events:none;border-radius:2px}
.dw-playhead::before{content:'';position:absolute;top:-6px;left:-5px;width:12px;height:12px;border-radius:50%;background:var(--ink)}
.dw-page-actions{display:flex;gap:6px;overflow-x:auto;padding:10px 0 2px;scrollbar-width:none}
#designWorkspace .dw-pill{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;min-height:36px;font-size:13px;border-radius:999px;padding:4px 14px}
#designWorkspace .dw-pill svg{width:17px;height:17px}
/* Tool rail / tab bar */
.dw-tabbar{grid-area:tabs;display:flex;flex-direction:column;gap:2px;padding:8px 4px;background:white;border-right:1px solid var(--line);overflow-y:auto;scrollbar-width:none}
#designWorkspace .dw-tab{border:0;background:transparent;display:flex;flex-direction:column;align-items:center;gap:3px;padding:4px 2px;min-height:66px;border-radius:12px;font-size:11.5px;color:#4a525c}
#designWorkspace .dw-tab:hover{background:transparent}#designWorkspace .dw-tab:hover svg{background:var(--soft)}
#designWorkspace .dw-tab svg{width:42px;height:42px;padding:9px;border-radius:13px;transition:background .15s,box-shadow .15s,color .15s}
#designWorkspace .dw-tab[aria-pressed=true]{color:var(--ink);font-weight:700}
#designWorkspace .dw-tab[aria-pressed=true] svg{background:white;color:var(--accent);box-shadow:0 2px 10px rgba(14,19,24,.14)}
#designWorkspace #dwAiTab svg{color:white;background:conic-gradient(from 200deg,#00c4cc,#7d2ae8,#ff6ec7,#00c4cc);border-radius:50%;padding:9px;box-shadow:0 2px 8px rgba(125,42,232,.3)}
/* Side panel / bottom sheet (one open at a time) */
.dw-panel{position:relative;flex:0 0 360px;width:360px;background:white;border-right:1px solid var(--line);padding:14px 16px 18px;overflow-y:auto;max-height:100%;overscroll-behavior:contain}
.dw-panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;min-height:36px}.dw-panel-head strong{font-size:18px}
#designWorkspace .dw-panel-close{border:0;background:transparent;min-height:36px;width:36px;padding:0;display:grid;place-items:center;border-radius:50%}#designWorkspace .dw-panel-close span{display:none}
.dw-sheet label{display:block;font-size:13px;color:var(--muted);margin-bottom:12px}.dw-sheet label select{margin-top:4px;color:var(--ink)}
.dw-sheet-actions,.dw-export-grid{display:grid;gap:8px}.dw-sheet-actions.dw-two{grid-template-columns:1fr 1fr}
#designWorkspace .dw-sheet-actions button,#designWorkspace .dw-export-grid button{display:inline-flex;align-items:center;justify-content:center;gap:8px}
#designWorkspace .dw-export-main{min-height:52px;font-size:16px}
.dw-hint{font-size:12.5px;color:var(--muted);margin:10px 0 0;line-height:1.55}.dw-mode-note{font-size:12px;color:var(--muted)}
/* Search, category chips, sections and tiles */
.dw-search{display:flex;align-items:center;gap:10px;border:1px solid #d9dbe8;border-radius:14px;padding:0 14px;min-height:50px;background:white;color:#3d4550}
.dw-search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
#designWorkspace .dw-search input{border:0!important;padding:0!important;min-height:46px;outline:none;flex:1;background:transparent!important;font-size:16px;box-shadow:none}
.dw-chips{display:flex;gap:10px;overflow-x:auto;padding:12px 0 4px;scrollbar-width:none}.dw-chips:empty{display:none}
#designWorkspace .dw-chip-filter{flex:0 0 auto;border:1.5px solid var(--chip);border-radius:999px;padding:6px 18px;background:white;font-size:15px}
#designWorkspace .dw-chip-filter[aria-pressed=true]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);font-weight:600}
.dw-section{margin-top:18px}.dw-section-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.dw-section-head h4{margin:0;font-size:16px;font-weight:700}
.dw-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(70px,1fr));gap:10px}
.dw-grid-stickers{grid-template-columns:repeat(auto-fill,minmax(54px,1fr))}.dw-grid-wide{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
.dw-grid-tools{grid-template-columns:repeat(auto-fill,minmax(96px,1fr))}
.dw-row{display:flex;gap:10px;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}.dw-row>*{flex:0 0 76px}
#designWorkspace .dw-tile{aspect-ratio:1;display:grid;place-items:center;background:var(--tile);border:0;border-radius:12px;padding:12px;color:#6b7280;min-height:0}
#designWorkspace .dw-tile:hover{background:#e9eaf1;color:var(--accent)}
#designWorkspace .dw-tile svg{width:100%;height:100%;max-width:52px;max-height:52px}
.dw-emoji{font-size:32px;line-height:1;font-family:'Apple Color Emoji','Segoe UI Emoji','Noto Color Emoji',sans-serif}
.dw-categories{display:grid;grid-template-columns:repeat(auto-fill,minmax(86px,1fr));gap:14px 10px}
#designWorkspace .dw-category{display:flex;flex-direction:column;align-items:center;gap:8px;border:0;background:none;padding:0;font-size:13px}
.dw-category>span{width:68px;height:68px;border-radius:20px;display:grid;place-items:center;color:white;box-shadow:0 8px 16px rgba(14,19,24,.14),inset 0 -6px 0 rgba(0,0,0,.08);transform:rotate(-4deg);transition:transform .15s}
#designWorkspace .dw-category:hover>span{transform:rotate(0) scale(1.05)}#designWorkspace .dw-category svg{width:34px;height:34px}.dw-category .dw-emoji{font-size:34px}
.dw-category.c1>span{background:linear-gradient(135deg,#ff6b6b,#e11d48)}.dw-category.c2>span{background:linear-gradient(135deg,#f0abfc,#c026d3)}.dw-category.c3>span{background:linear-gradient(135deg,#60a5fa,#2563eb)}
.dw-category.c4>span{background:linear-gradient(135deg,#fdba74,#ea580c)}.dw-category.c5>span{background:linear-gradient(135deg,#c084fc,#7c3aed)}.dw-category.c6>span{background:linear-gradient(135deg,#4ade80,#16a34a)}
#designWorkspace .dw-template{display:flex;flex-direction:column;gap:6px;padding:0;border:0;background:none;text-align:left;font-size:12.5px;min-height:0}
.dw-template canvas{width:100%;height:auto;aspect-ratio:auto;border-radius:10px;box-shadow:0 1px 4px rgba(14,19,24,.18);background:white;transition:box-shadow .15s}
#designWorkspace .dw-template:hover canvas,#designWorkspace .dw-template[aria-current=true] canvas{box-shadow:0 0 0 3px var(--accent)}
#designWorkspace .dw-add-page{align-items:center;justify-content:center;border:2px dashed #d5d8dd;border-radius:10px;min-height:90px;color:var(--muted)}
#designWorkspace .dw-wide{width:100%;min-height:50px;display:flex;align-items:center;justify-content:center;gap:8px;font-size:16px}
.dw-list{display:flex;flex-direction:column;gap:8px}
#designWorkspace .dw-text-preset{display:block;width:100%;text-align:left;background:var(--tile);border:0;border-radius:12px;padding:12px 16px;line-height:1.25}
#designWorkspace .dw-style-card{min-height:86px;background:linear-gradient(135deg,#a5b4fc,#64748b);border:0;border-radius:12px;font-size:22px}
#designWorkspace .dw-row-item{display:flex;align-items:center;gap:12px;width:100%;text-align:left;border:0;background:var(--tile);border-radius:12px;padding:10px 14px;min-height:50px}
#designWorkspace .dw-row-item span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dw-row-item small{color:var(--muted)}
#designWorkspace .dw-row-item[aria-pressed=true],#designWorkspace .dw-row-item[aria-current=true]{background:var(--accent-soft);color:var(--accent);font-weight:600}
#designWorkspace .dw-tool{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;background:var(--tile);border:0;border-radius:14px;min-height:92px;font-size:12.5px;text-align:center;line-height:1.3}
#designWorkspace .dw-tool svg{width:26px;height:26px}#designWorkspace .dw-tool[aria-pressed=true]{background:var(--accent-soft);color:var(--accent);box-shadow:inset 0 0 0 2px var(--accent)}
.dw-swatches{display:grid;grid-template-columns:repeat(auto-fill,minmax(44px,1fr));gap:10px}
#designWorkspace .dw-swatch{aspect-ratio:1;border-radius:50%;min-height:0;border:1px solid rgba(14,19,24,.12);padding:0}
#designWorkspace .dw-swatch:hover{box-shadow:0 0 0 3px var(--accent-soft),0 0 0 5px var(--accent)}
.dw-swatches-wide{grid-template-columns:repeat(auto-fill,minmax(70px,1fr))}#designWorkspace .dw-swatches-wide .dw-swatch{border-radius:12px;aspect-ratio:1.5}
/* Page sheet */
.dw-page-meta{text-align:center;color:var(--muted);margin:-4px 0 14px;font-size:14px}
.dw-icon-row{display:flex;justify-content:center;gap:10px;padding-bottom:14px;border-bottom:1px solid var(--line)}
#designWorkspace .dw-icon-action{flex-direction:column;display:flex;align-items:center;gap:6px;border:0;background:none;font-size:13px;min-width:70px;padding:6px}
#designWorkspace .dw-icon-action svg{width:28px;height:28px}
.dw-menu-list{display:flex;flex-direction:column;padding:6px 0;border-bottom:1px solid var(--line)}
#designWorkspace .dw-menu-item{display:flex;align-items:center;gap:14px;border:0;background:none;justify-content:flex-start;padding:10px 8px;font-size:15px;text-align:left;border-radius:10px}
#designWorkspace .dw-menu-item:hover{background:var(--soft)}
.dw-notes{display:grid!important;grid-template-columns:auto 1fr;align-items:center;gap:10px 12px;margin-top:14px;font-size:15px!important;color:var(--ink)!important}.dw-notes textarea{grid-column:1/-1}
.dw-agent-slot .page-agent{margin:10px 0 0;box-shadow:none;border:0;padding:0;background:none}
/* Media in the uploads sheet */
.dw-tray-head{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin-bottom:12px}
#designWorkspace .dw-tray-head button{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:12.5px;min-height:64px;border-radius:12px}
#designWorkspace .dw-tray-head button:not(.dw-primary){background:var(--tile);border:0}
.dw-tray-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;margin-top:10px}
#designWorkspace .dw-tray-item{display:flex;flex-direction:column;gap:4px;padding:0;border:0;background:transparent;text-align:left;cursor:grab;min-height:0}
.dw-tray-item img{width:100%;aspect-ratio:16/10;object-fit:cover;border-radius:10px;background:var(--row);pointer-events:none}
.dw-tray-item b{display:grid;place-items:center;width:100%;aspect-ratio:16/10;border-radius:10px;background:#e9ddff;color:var(--accent)}
.dw-tray-item small{font-size:11.5px;color:var(--muted);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
/* Object properties */
.dw-inspector{display:none;flex:0 0 300px;width:300px;background:white;border-left:1px solid var(--line);padding:14px 16px;overflow-y:auto;max-height:100%;overscroll-behavior:contain}
#designWorkspace.dw-inspecting .dw-inspector{display:block}
.dw-inspector-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.dw-inspector-head strong{font-size:17px}
#designWorkspace #dwInspectorDone{min-height:34px;padding:2px 16px;font-size:13px;border-radius:999px}
.dw-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.dw-fields label{font-size:12px;color:var(--muted);display:block}.dw-fields .wide{grid-column:1/-1}
.dw-fields input[type=checkbox]{width:22px;height:22px;accent-color:var(--accent);display:block;margin-top:6px}
.dw-inspector h4{margin:16px 0 6px;font-size:13px}.dw-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}
.dw-layer{display:flex;gap:4px;padding:2px 0}.dw-layer button:first-child{flex:1;text-align:left}
#designWorkspace .dw-layer button{min-height:34px;font-size:13px}#designWorkspace .dw-layer button[aria-pressed=true]{border-color:var(--accent);color:var(--accent)}
/* Library dialog */
.dw-dialog{border:0;border-radius:20px;width:min(680px,95vw);max-height:84vh;padding:20px;color:var(--ink);background:white;font-family:'Noto Sans Thai',system-ui,sans-serif}.dw-dialog::backdrop{background:rgba(14,19,24,.6)}
.dw-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}.dw-dialog-head h3{margin:0;font-size:18px}.dw-dialog-head .dw-actions{margin:0}
.dw-dialog button{min-height:40px;border:1px solid var(--line);border-radius:10px;background:white;padding:6px 12px;font:inherit;cursor:pointer}
.dw-dialog .dw-chip-filter{flex:0 0 auto;border:1.5px solid var(--chip);border-radius:999px;padding:6px 18px}.dw-dialog .dw-chip-filter[aria-pressed=true]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);font-weight:600}
.dw-dialog .dw-search input{border:0;outline:none;flex:1;min-height:46px;font:inherit;font-size:16px;background:transparent}
.dw-library{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;margin-top:10px}
.dw-library button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;overflow-wrap:anywhere;min-height:90px;background:var(--tile);border:0}
.dw-library img{width:100%;height:96px;object-fit:cover;border-radius:8px}.dw-library [hidden]{display:none}
.dw-library-note{grid-column:1/-1;margin:8px 0 0;font-size:12.5px;color:var(--muted)}
/* Full screen app */
html.dw-app-open,html.dw-app-open body{overflow:hidden}
#designWorkspace.dw-full{position:fixed;inset:0;z-index:1000;margin:0;border:0;border-radius:0;height:100dvh;min-height:0}
#designWorkspace.dw-full .dw-stage canvas{max-height:calc(100dvh - 480px);min-height:160px}
/* Phones and tablets: the tool rail becomes the bottom tab bar; sheets and properties rise from the bottom. */
@media(max-width:900px){
  #designWorkspace{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;grid-template-areas:"top" "busy" "main" "tabs";min-height:0}
  .dw-main{display:block;overflow-y:auto}.dw-center{padding:8px 10px 12px;overflow:visible}
  .dw-tabbar{flex-direction:row;gap:0;padding:6px 4px calc(6px + env(safe-area-inset-bottom,0px));border-right:0;border-top:1px solid var(--line);overflow-x:auto;position:sticky;bottom:0;z-index:20}
  #designWorkspace .dw-tab{flex:0 0 78px;min-height:66px}
  .dw-panel,.dw-inspector{position:fixed;left:0;right:0;bottom:calc(80px + env(safe-area-inset-bottom,0px));width:auto;max-height:62vh;border:0;border-radius:24px 24px 0 0;box-shadow:0 -12px 36px rgba(14,19,24,.18);z-index:30;padding:26px 18px 18px}
  /* A page ancestor clips overflow, so sticky cannot pin to the screen; the tab bar is fixed instead. */
  #designWorkspace:not(.dw-full) .dw-tabbar{position:fixed;left:0;right:0;bottom:0;background:white;box-shadow:0 -6px 20px rgba(14,19,24,.08)}
  #editingPage:has(#designWorkspace:not(.dw-full)){padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))}
  body:has(#editingPage.active #designWorkspace:not(.dw-full)) .bizhub-voice-open{bottom:calc(88px + env(safe-area-inset-bottom,0px))}
  .dw-panel::before,.dw-inspector::before{content:'';position:absolute;top:10px;left:50%;width:44px;height:5px;margin-left:-22px;border-radius:5px;background:#d5d8dd}
  .dw-stage{min-height:200px;padding:14px 4px}.dw-stage canvas{max-height:38vh}
  #designWorkspace.dw-full .dw-stage canvas{max-height:min(38vh,calc(100dvh - 470px))}
  .dw-desktop-only{display:none!important}
  #designWorkspace .dw-title{display:none}
  .dw-panel-head{justify-content:center;position:relative}.dw-panel-head strong{font-size:17px}#designWorkspace .dw-panel-close{position:absolute;right:-6px;top:-4px}
}
@media(max-width:600px){#designWorkspace .dw-wide-only{display:none!important}}
@media(max-width:420px){#designWorkspace .dw-topbar .dw-save span,#designWorkspace .dw-edit-menu span{display:none}.dw-time{font-size:14px}.dw-topbar{gap:2px;padding:8px 6px}.dw-top-left,.dw-top-right{gap:0}#designWorkspace .dw-topbar button{padding:6px 7px}#designWorkspace .dw-topbar .dw-share{padding:6px 10px}
  #designWorkspace .dw-tab{flex-basis:72px}}
