/* Obrys — projects, versions, libraries, multi-page selection, timeline, raster, prototype */
.pg-row.sel { background: var(--acc-soft); color: var(--fg); }
.pg-row.drop-b { box-shadow: inset 0 2px 0 var(--acc); }
.pg-row.drop-a { box-shadow: inset 0 -2px 0 var(--acc); }
.dlg.wide { width: min(860px, 100%); }

/* new project templates */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-align: left; min-height: 104px; }
.tpl:hover, .tpl:focus-visible { border-color: var(--acc); background: var(--acc-soft); }
.tpl-ic { color: var(--acc); }
.tpl-n { font-weight: 600; }
.tpl em { font-style: normal; color: var(--fg-3); font-variant-numeric: tabular-nums; }

/* project manager */
.pm-back { position: fixed; inset: 0; z-index: 880; background: rgba(10, 10, 20, .45); display: grid; place-items: center; padding: 16px; }
.pm { width: min(1180px, 100%); height: min(780px, calc(100vh - 32px)); display: flex; flex-direction: column; background: var(--bg); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.pm-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pm-h h2 { margin: 0 8px 0 0; font-size: 18px; }
.pm-q { height: 32px; min-width: 0; flex: 0 1 260px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--panel-2); outline: none; }
.pm-q:focus { border-color: var(--acc); }
.pm-sort { height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); padding: 0 6px; }
.pm-grid { flex: 1; overflow: auto; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; align-content: start; }
.pm-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.pm-card.cur { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.pm-th { height: 150px; border: 0; padding: 0; background: var(--checker); display: grid; place-items: center; color: var(--fg-3); cursor: pointer; }
.pm-th img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pm-meta { padding: 10px 40px 10px 12px; min-width: 0; }
.pm-n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-d { color: var(--fg-3); font-size: 11.5px; margin-top: 2px; }
.pm-badge { position: absolute; top: 8px; left: 8px; background: var(--acc); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.pm-more { position: absolute; right: 6px; bottom: 10px; }
.pm-empty { color: var(--fg-3); padding: 24px; }
.pm-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--panel); border-top: 1px solid var(--line); color: var(--fg-3); flex-wrap: wrap; }

/* versions */
.ver-new { display: flex; gap: 8px; margin-bottom: 8px; }
.ver-new input { flex: 1; min-width: 0; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--panel-2); outline: none; }
.ver-new input:focus { border-color: var(--acc); }
.ver-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.ver { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.ver-m { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ver-m span { color: var(--fg-3); font-size: 11.5px; }

/* libraries */
.lib { display: grid; grid-template-columns: 200px 1fr; gap: 12px; min-height: 320px; }
.lib-side { display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); padding-right: 10px; overflow: auto; max-height: 55vh; }
.lib-p { text-align: left; border: 0; background: none; padding: 8px; border-radius: 6px; }
.lib-p:hover { background: var(--panel-2); }
.lib-p.on { background: var(--acc-soft); color: var(--acc); }
.lib-main { overflow: auto; max-height: 55vh; }
.lib-main h4 { margin: 4px 0 8px; }
.lib-grid { padding: 0; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
@media (max-width: 640px) { .lib { grid-template-columns: 1fr; } .lib-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 140px; } }

/* font picker (Google Fonts) */
.font-row { gap: 4px; }
.font-row .fontin { flex: 1; min-width: 0; }
.font-pick { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; height: 28px; }
.fpick { position: fixed; z-index: 950; width: 300px; max-width: calc(100vw - 16px); height: min(520px, calc(100vh - 16px)); display: flex; flex-direction: column; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; }
.fp-top { display: flex; gap: 4px; align-items: center; }
.fp-q { flex: 1; min-width: 0; height: 30px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); padding: 0 8px; outline: none; }
.fp-q:focus { border-color: var(--acc); }
.fp-cats { display: flex; flex-wrap: wrap; gap: 3px; margin: 8px 0 4px; }
.fp-cats button { border: 1px solid var(--line); background: transparent; border-radius: 12px; padding: 2px 8px; font-size: 11.5px; color: var(--fg-2); }
.fp-cats button.on { background: var(--acc-soft); border-color: transparent; color: var(--acc); font-weight: 600; }
.fp-cyr { margin: 2px 2px 6px; }
.fp-list { flex: 1; overflow: auto; border-top: 1px solid var(--line); padding-top: 4px; overscroll-behavior: contain; }
.fp-h { position: sticky; top: -4px; background: var(--panel); color: var(--fg-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 8px 6px 4px; z-index: 1; }
.fp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 6px; min-height: 34px; }
.fp-row:hover, .fp-row.hi { background: var(--panel-2); }
.fp-row.cur { background: var(--acc-soft); }
.fp-n { font-size: 17px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fp-row em { font-style: normal; font-size: 10.5px; color: var(--fg-3); flex: none; }
.fp-more, .fp-empty { color: var(--fg-3); text-align: center; padding: 10px; font-size: 11.5px; }
.fp-foot { color: var(--fg-3); font-size: 11px; padding: 6px 4px 0; border-top: 1px solid var(--line); }

/* Blender-style workspace: areas, gutters, headers */
body.ws-on #app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "ws"; }
#ws { grid-area: ws; display: none; min-width: 0; min-height: 0; background: var(--line); }
body.ws-on #ws { display: flex; }
body.ws-on:not(.ws-mobile) #left, body.ws-on:not(.ws-mobile) #right { display: none; }
.ws-split { display: flex; flex: 1 1 0; min-width: 0; min-height: 0; }
.ws-split.h { flex-direction: row; }
.ws-split.v { flex-direction: column; }
.ws-c { display: flex; min-width: 0; min-height: 0; overflow: hidden; }
.ws-gutter { flex: 0 0 4px; background: var(--line); cursor: col-resize; position: relative; z-index: 2; touch-action: none; transition: background .12s; }
.ws-split.v > .ws-gutter { cursor: row-resize; }
.ws-gutter::after { content: ""; position: absolute; inset: -3px; }
.ws-gutter:hover, .ws-gutter.on, .ws-gutter:focus-visible { background: var(--acc); outline: none; }
body.ws-drag-h, body.ws-drag-h * { cursor: col-resize !important; user-select: none; }
body.ws-drag-v, body.ws-drag-v * { cursor: row-resize !important; user-select: none; }
.ws-area { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); container-type: inline-size; }
@container (max-width: 300px) { .ws-ah [data-wsa="split-h"], .ws-ah [data-wsa="split-v"] { display: none; } }
.ws-ah { flex: none; height: 32px; display: flex; align-items: center; gap: 2px; padding: 0 4px 0 4px; border-bottom: 1px solid var(--line); background: var(--panel); min-width: 0; overflow: hidden; }
.ws-ah .ib { width: 24px; height: 24px; opacity: .55; }
.ws-ah:hover .ib, .ws-ah .ib:focus-visible { opacity: 1; }
.ws-type { display: inline-flex; align-items: center; gap: 1px; height: 24px; padding: 0 4px; border: 0; border-radius: 5px; background: var(--panel-2); color: var(--fg-2); flex: none; }
.ws-type:hover { color: var(--fg); }
.ws-name { font-weight: 600; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ws-tabs { display: flex; gap: 1px; min-width: 0; overflow: hidden; }
.ws-tabs button { border: 0; background: transparent; padding: 4px 8px; border-radius: 5px; font-weight: 600; color: var(--fg-3); white-space: nowrap; }
.ws-tabs button.on { color: var(--fg); background: var(--panel-2); }
.ws-tabs button:hover { color: var(--fg); }
.ws-ab { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.ws-ab > #canvas { flex: 1 1 0; min-height: 0; min-width: 0; }
.ws-ab > #lp-layers, .ws-ab > #lp-assets, .ws-ab > #props, .ws-ab > #code, .ws-ab > .ed-list { flex: 1 1 0; min-height: 0; overflow: auto; }
.ws-empty { padding: 16px; color: var(--fg-2); overflow: auto; }
.ws-empty p { margin: 0 0 10px; }
.ws-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-pick .btn:disabled { opacity: .45; cursor: default; }
.ws-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: var(--topbar-2); color: var(--topbar-fg); white-space: nowrap; flex: none; font-size: 12.5px; }
.ws-btn:hover { filter: brightness(1.15); }
@media (max-width: 1500px) { .ws-btn .lbl { display: none; } }
@media (max-width: 760px) { .ws-btn { display: none; } }
/* history editor */
.ed-list { padding: 4px 0; }
.eh-row { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; text-align: left; padding: 6px 12px; color: var(--fg); }
.eh-row:hover { background: var(--panel-2); }
.eh-row.on { background: var(--acc-soft); color: var(--acc); font-weight: 600; }
.eh-row.fut { color: var(--fg-3); }
.eh-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* web preview editor */
.ed-web { flex: 1 1 0; display: flex; flex-direction: column; min-height: 0; }
.ew-bar { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.ew-what { color: var(--fg-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ew-stage { flex: 1 1 0; min-height: 0; display: flex; justify-content: center; overflow: auto; background: var(--checker); }
.ew-stage iframe { flex: 1; width: 100%; height: 100%; border: 0; background: #fff; }
/* timeline (animation) */
#timeline { flex: 1 1 0; display: flex; flex-direction: column; min-height: 0; background: var(--panel); font-size: 12px; }
#canvas > #timeline { position: absolute; left: 0; right: 0; bottom: 0; height: 230px; z-index: 6; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); }
.tl-head { flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tl-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 64px; }
.tl-f { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-3); }
.tl-f input, .tl-f select, .tl-head > select { height: 26px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-2); color: var(--fg); padding: 0 4px; }
.tl-f input { width: 58px; }
.tl-f em { font-style: normal; }
.tl-rec .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); }
.tl-rec.on { border-color: #F24822; color: #F24822; }
.tl-rec.on .dot { background: #F24822; }
.tl-play { background: var(--acc-soft); color: var(--acc); }
.tl-pause { display: inline-block; width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.tl-body { flex: 1 1 0; display: flex; min-height: 0; overflow: auto; }
.tl-names { flex: 0 0 180px; border-right: 1px solid var(--line); padding-top: 24px; }
.tl-name { height: 26px; line-height: 26px; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.tl-name.sel, .tl-row.sel { background: var(--acc-soft); }
.tl-empty { padding: 10px; color: var(--fg-3); white-space: normal; line-height: 1.5; }
.tl-track { flex: 1; position: relative; min-width: 300px; cursor: text; }
.tl-ruler { position: sticky; top: 0; height: 24px; border-bottom: 1px solid var(--line); background: var(--panel); z-index: 1; }
.tl-tick { position: absolute; top: 4px; font-size: 10px; color: var(--fg-3); border-left: 1px solid var(--line); padding-left: 3px; height: 18px; }
.tl-row { position: relative; height: 26px; border-bottom: 1px solid var(--line); }
.tl-bar { position: absolute; top: 12px; height: 2px; background: var(--acc); opacity: .35; }
.tl-key { position: absolute; top: 6px; width: 13px; height: 13px; margin-left: -6.5px; padding: 0; border: 1.5px solid var(--panel); background: var(--acc); transform: rotate(45deg); border-radius: 2px; cursor: ew-resize; z-index: 1; }
.tl-key.on { background: #FFC700; box-shadow: 0 0 0 2px var(--acc); }
.tl-key.hold { border-radius: 0; background: var(--fg-2); }
.tl-ph { position: absolute; top: 0; bottom: 0; width: 1px; background: #F24822; pointer-events: none; z-index: 2; }
.tl-ph::before { content: ""; position: absolute; top: 0; left: -5px; width: 11px; height: 12px; background: #F24822; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.lottie-stage { background: var(--checker); border-radius: 8px; padding: 12px; display: grid; place-items: center; }
.lottie-box { width: min(560px, 100%); max-height: 60vh; }

/* PDF page picker */
.pp-tools { display: flex; gap: 6px; }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; max-height: 46vh; overflow: auto; padding: 2px; }
.pp { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border-radius: 8px; background: var(--panel-2); cursor: pointer; }
.pp-th { width: 110px; height: 110px; display: grid; place-items: center; color: var(--fg-3); background: var(--checker); border-radius: 4px; overflow: hidden; }
.pp-th canvas { max-width: 110px; max-height: 110px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); background: #fff; }
.pp-n { display: flex; align-items: center; gap: 4px; font-size: 12px; }

/* link pens (animation / adaptation) */
.lk-hint { margin: 0 0 6px; color: var(--fg-2); line-height: 1.5; font-size: 12px; }
.ps.lk.on { background: var(--acc-soft); }
.lk-title { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font-weight: 600; color: var(--fg); text-align: left; }
.lk-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lk-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 2px 0 8px; }
.lk-n { display: inline-flex; align-items: center; gap: 4px; background: var(--panel-2); border-radius: 12px; padding: 2px 8px 2px 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.lk-n b { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #FF3D9A; color: #fff; font-size: 10px; }
.lk-ar { color: var(--fg-3); }
.lk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lk-grid1 { display: grid; gap: 6px; margin-top: 6px; }
.lk-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 11px; color: var(--fg-3); }
.lk-f select, .lk-f input[type="text"] { height: 28px; border: 1px solid transparent; background: var(--panel-2); border-radius: var(--r); padding: 0 6px; min-width: 0; color: var(--fg); outline: none; }
.lk-f select:focus, .lk-f input:focus { border-color: var(--acc); }
.lk-in { display: inline-flex; align-items: center; gap: 2px; height: 28px; background: var(--panel-2); border-radius: var(--r); padding: 0 6px; min-width: 0; border: 1px solid transparent; }
.lk-in:focus-within { border-color: var(--acc); }
.lk-in input { width: 100%; min-width: 0; border: 0; background: transparent; outline: none; color: var(--fg); font-variant-numeric: tabular-nums; }
.lk-in em { font-style: normal; color: var(--fg-3); font-size: 11px; }
.lk-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
.lk-btns .btn { padding: 4px 8px; font-size: 12px; }
.lk-levels { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.lk-lv { display: grid; grid-template-columns: auto 1fr 92px; grid-template-rows: auto auto; column-gap: 6px; align-items: center; padding: 6px; border-radius: 6px; background: var(--panel-2); }
.lk-dev { font-weight: 600; color: #14AE5C; font-size: 11.5px; }
.lk-fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--fg-2); }
.lk-lv .lk-in { grid-row: span 2; background: var(--panel); }
.lk-rng { grid-column: 1 / 3; color: var(--fg-3); font-size: 11px; }

/* layout grids */
.lg { border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 6px; }
.lg:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.lg.off { opacity: .55; }
.lg input[type="color"] { width: 28px; height: 28px; padding: 0; border: 0; background: none; flex: none; }

/* device chooser for websites */
.dev-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.dev-g { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 8px; margin: 0; min-width: 0; }
.dev-g legend { font-weight: 700; padding: 0 4px; }
.dev { display: grid; grid-template-columns: auto 1fr auto; column-gap: 8px; align-items: center; padding: 5px 0; cursor: pointer; }
.dev input { accent-color: var(--acc); margin: 0; }
.dev-n { font-weight: 600; min-width: 0; }
.dev-s { color: var(--fg-2); font-variant-numeric: tabular-nums; font-size: 12px; }
.dev em { grid-column: 2 / 4; font-style: normal; color: var(--fg-3); font-size: 11px; line-height: 1.35; }
.dlg-text.small { font-size: 11.5px; color: var(--fg-3); }
