/* ChitraMitra workspace shell + shared UI for Vector / Layout / Docs / Motion */
#wsbar { display: flex; align-items: center; gap: 10px; height: 40px; flex: none; padding: 0 10px; background: linear-gradient(90deg, #15121f, #1b1530 60%, #17181c); border-bottom: 1px solid var(--line); }
#wsbar nav { display: flex; gap: 3px; }
#wsbar nav button { background: none; border: 1px solid transparent; color: var(--mu); padding: 6px 13px; border-radius: 8px; cursor: pointer; font-weight: 600; }
#wsbar nav button:hover { color: var(--tx); background: var(--bg3); }
#wsbar nav button.on { color: #fff; background: linear-gradient(90deg, var(--ac2), var(--ac)); }
#wsbar .logo b { font-size: 14px; background: linear-gradient(90deg, #f0abfc, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
#wsbar .wsx { margin-left: auto; color: var(--mu); font-size: 11.5px; }
.ws { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#menubar .logo { display: none; }
.lrow canvas.mthumb { background: #000; }
.lrow canvas.mthumb.on, .lrow.on canvas.mthumb.on { outline: 2px solid #f0abfc; outline-offset: 1px; }

/* generic workspace chrome */
.wtop { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-height: 40px; padding: 4px 8px; background: var(--bg2); border-bottom: 1px solid var(--line); flex: none; }
.wtop .grp { display: flex; align-items: center; gap: 3px; padding-right: 8px; margin-right: 4px; border-right: 1px solid var(--line); }
.wtop .grp:last-child { border-right: 0; }
.wb { background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; cursor: pointer; white-space: nowrap; min-height: 28px; }
.wb:hover { border-color: #6b6f7b; background: #383b44; }
.wb.on { background: var(--ac2); border-color: #a78bfa; color: #fff; }
.wb.pri { background: linear-gradient(90deg, var(--ac2), var(--ac)); border: 0; color: #fff; font-weight: 600; }
.wb.ic { width: 30px; padding: 4px 0; text-align: center; }
.wtop select, .wtop input[type=number], .wtop input[type=text], .wside select, .wside input[type=number], .wside input[type=text], .wside textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px; color: var(--tx); }
.wtop input[type=number] { width: 58px; }
.wtop input[type=color], .wside input[type=color] { width: 32px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: none; cursor: pointer; }
.wbody { flex: 1; min-height: 0; display: flex; }
.wtools { width: 46px; flex: none; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; overflow-y: auto; }
.wtools button { width: 36px; height: 34px; border: 0; background: none; border-radius: 6px; cursor: pointer; font-size: 16px; display: grid; place-items: center; }
.wtools button:hover { background: var(--bg3); }
.wtools button.on { background: var(--ac2); box-shadow: inset 0 0 0 1px #a78bfa; }
.wtools hr { width: 28px; border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.wstage { flex: 1; position: relative; overflow: auto; background: #131417; min-width: 0; }
.wside { width: 280px; flex: none; background: var(--bg2); border-left: 1px solid var(--line); overflow-y: auto; padding: 8px 10px; user-select: text; }
.wside.left { border-left: 0; border-right: 1px solid var(--line); width: 220px; }
.wside h3 { margin: 10px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--mu); }
.wside h3:first-child { margin-top: 2px; }
.wside .r { display: flex; align-items: center; gap: 6px; margin: 5px 0; }
.wside .r > label:first-child { width: 78px; color: var(--mu); flex: none; font-size: 12px; }
.wside .r input[type=number] { width: 64px; }
.wside .r input[type=range] { flex: 1; accent-color: var(--ac); min-width: 0; }
.wside .r select, .wside .r input[type=text] { flex: 1; min-width: 0; }
.wside .list > div { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.wside .list > div:hover { background: var(--bg3); }
.wside .list > div.on { background: #3b2a5c; border-color: #6d4fb3; }
.wside .list > div span.n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wside .list > div button { background: none; border: 0; cursor: pointer; padding: 0 3px; color: var(--mu); }
.wside .note, .wnote { color: var(--mu); font-size: 11.5px; line-height: 1.45; }
.wstatus { height: 24px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 10px; background: #17181c; border-top: 1px solid var(--line); color: var(--mu); font-size: 11.5px; }
.wstatus .sp { flex: 1; }
.swrow { display: flex; flex-wrap: wrap; gap: 3px; }
.swrow div { width: 17px; height: 17px; border-radius: 3px; cursor: pointer; border: 1px solid rgba(0,0,0,.5); }
.swrow div.none { background: linear-gradient(45deg, #fff 45%, #e11 45% 55%, #fff 55%); }
.dmenu { position: relative; }
.dmenu > .dd { position: absolute; top: 100%; left: 0; min-width: 230px; background: #2a2c32; border: 1px solid var(--line); border-radius: 8px; padding: 5px; z-index: 120; box-shadow: 0 12px 30px rgba(0,0,0,.45); display: none; }
.dmenu.open > .dd { display: block; }
.dmenu .dd button { display: flex; width: 100%; background: none; border: 0; text-align: left; padding: 6px 10px; border-radius: 5px; cursor: pointer; gap: 10px; }
.dmenu .dd button:hover { background: var(--ac2); }
.dmenu .dd button span.k { margin-left: auto; color: var(--mu); font-size: 11.5px; }
.dmenu .dd hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.dmenu .dd .sub { color: var(--mu); font-size: 11px; padding: 6px 10px 2px; text-transform: uppercase; letter-spacing: .6px; }

/* vector */
#ws-vector svg.vsvg { position: absolute; left: 0; top: 0; }
.vsel-box { fill: none; stroke: #a78bfa; stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
.vh { fill: #fff; stroke: #7c3aed; stroke-width: 1.2; cursor: pointer; }
.vnode { fill: #fff; stroke: #c026d3; stroke-width: 1.4; cursor: move; }
.vnode.on { fill: #c026d3; }
.vctl { fill: #a78bfa; stroke: none; cursor: move; }
.vctl-l { stroke: #a78bfa; stroke-width: 1; }

/* layout */
.lpage { position: absolute; background: #fff; box-shadow: 0 6px 30px rgba(0,0,0,.6); }
.lthumbs canvas { width: 100%; border: 1px solid var(--line); background: #fff; display: block; }
.lthumbs > div { padding: 5px; border-radius: 6px; margin-bottom: 5px; cursor: pointer; text-align: center; font-size: 11px; color: var(--mu); border: 1px solid transparent; }
.lthumbs > div.on { border-color: #a78bfa; background: #3b2a5c; }

/* docs */
#ws-docs .wstage { background: #e8eaed; }
.dpage { background: #fff; color: #202124; margin: 24px auto; box-shadow: 0 1px 4px rgba(0,0,0,.25); outline: none; user-select: text; cursor: text; line-height: 1.5; font-family: Arial, sans-serif; font-size: 11pt; word-wrap: break-word; }
.dpage h1 { font-size: 20pt; margin: .5em 0 .3em; font-weight: 400; } .dpage h2 { font-size: 16pt; margin: .5em 0 .3em; font-weight: 400; } .dpage h3 { font-size: 14pt; margin: .5em 0 .3em; color: #434343; font-weight: 400; }
.dpage .title { font-size: 26pt; margin: 0 0 .2em; } .dpage .subtitle { font-size: 15pt; color: #666; margin: 0 0 .6em; }
.dpage p { margin: 0 0 .6em; } .dpage table { border-collapse: collapse; margin: .5em 0; } .dpage td, .dpage th { border: 1px solid #999; padding: 4px 8px; min-width: 40px; }
.dpage img { max-width: 100%; } .dpage blockquote { border-left: 3px solid #c026d3; margin: .5em 0; padding: .2em 1em; color: #444; }
.dpage .pb { border: 0; border-top: 2px dashed #bbb; margin: 1.2em -20px; position: relative; height: 0; page-break-after: always; }
.dpage .pb::after { content: 'page break'; position: absolute; right: 24px; top: -9px; background: #fff; color: #999; font-size: 9px; padding: 0 4px; }
.dpage .cm { background: #fde68a; border-bottom: 2px solid #f59e0b; }
.dpage ins.sg { color: #15803d; text-decoration: underline; background: #dcfce7; } .dpage del.sg { color: #b91c1c; background: #fee2e2; }
.dpage .hl-find { background: #fde047; }
.dpage code, .dpage pre { font-family: Consolas, monospace; background: #f3f4f6; }
.dpage pre { padding: 8px; border-radius: 4px; white-space: pre-wrap; }
.dpage ul.chk { list-style: none; padding-left: 1.2em; } .dpage ul.chk li::before { content: '☐ '; } .dpage ul.chk li.done::before { content: '☑ '; } .dpage ul.chk li.done { text-decoration: line-through; color: #777; }
.dcomments .c { background: var(--bg3); border-radius: 8px; padding: 8px; margin-bottom: 8px; border-left: 3px solid #f59e0b; font-size: 12px; }
.dcomments .c .q { color: var(--mu); font-style: italic; margin-bottom: 4px; }
.dout div { padding: 3px 6px; border-radius: 5px; cursor: pointer; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dout div:hover { background: var(--bg3); }

/* motion */
.mstrip { height: 120px; flex: none; background: var(--bg2); border-top: 1px solid var(--line); display: flex; gap: 8px; overflow-x: auto; padding: 10px; align-items: center; }
.mstrip .sl { position: relative; flex: none; width: 140px; cursor: pointer; border-radius: 6px; border: 2px solid transparent; }
.mstrip .sl.on { border-color: #c026d3; }
.mstrip .sl canvas { width: 100%; display: block; border-radius: 4px; background: #000; }
.mstrip .sl span { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.65); font-size: 10px; padding: 1px 5px; border-radius: 4px; }
.mstrip .tr { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--bg3); border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; font-size: 13px; }
.mstrip .tr:hover { border-color: #a78bfa; }
.mstrip .add { flex: none; width: 100px; height: 80px; border: 2px dashed var(--line); border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--mu); text-align: center; font-size: 12px; }
#ws-motion .wstage { display: grid; place-items: center; overflow: hidden; }
#ws-motion .wstage canvas { max-width: 96%; max-height: 94%; box-shadow: 0 10px 40px rgba(0,0,0,.6); background: #000; }
.empty-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mu); text-align: center; pointer-events: none; font-size: 14px; line-height: 1.7; }
.wstage:focus { outline: none; }
.dpage ins.sg { white-space: pre-wrap; }
.mstrip .add, .empty-hint { white-space: pre-line; }
