/* CAD-workspace layout (modeled on a browser-based CAD workflow):
   top bar · toolbar · [feature list | graphics area | notes | rail] · tab bar */
:root {
  --bg: #f2f4f6;
  --panel: #ffffff;
  --line: #d9dde3;
  --line-2: #e9ecef;
  --ink: #1f2933;
  --ink-2: #52606d;
  --ink-3: #8a96a3;
  --blue: #1a6fd1;
  --blue-2: #e3eefb;
  --blue-3: #b9d3f5;
  --hover: #f1f5fa;
  --gfx-top: #ffffff;
  --gfx-bot: #d7dee7;
  --todo: #fff4c7;
  --sans: "Noto Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; display: grid; grid-template-rows: 50px 1fr;
  background: var(--bg); color: var(--ink); font: 13px/1.45 var(--sans); overflow: hidden;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--ink); color: #fff; }
.mark svg { width: 20px; height: 20px; stroke-width: 1.6; }
.docname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.doc-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; color: var(--ink-2); }
.ws-pill svg { width: 13px; height: 13px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.top-link { color: var(--ink-2); font-size: 13px; }
.share { background: var(--blue); color: #fff; border: 0; border-radius: 4px; padding: 6px 14px; font-weight: 600; }
.share:hover { background: #155db0; }
.me { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; border: 1px solid var(--line); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 2px; padding: 0 8px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tool { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--ink); white-space: nowrap; }
.tool:hover { background: var(--hover); border-color: var(--line); }
.tool[aria-pressed="true"], .tool.on { background: var(--blue-2); border-color: var(--blue-3); color: var(--blue); }
.tool:disabled { opacity: .35; pointer-events: none; }
.tool svg { width: 20px; height: 20px; }
.tool .caret { width: 9px; height: 9px; margin-left: -2px; }
.tool-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; flex-shrink: 0; }
.tool-label { font-size: 12.5px; }
.tb-title { margin-left: auto; padding: 0 6px; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; min-width: 190px; padding: 4px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 28px rgba(20, 30, 45, .16); }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border: 0; background: none; text-align: left; border-radius: 4px; color: var(--ink); }
.menu button:hover { background: var(--hover); }
.menu button.on { color: var(--blue); font-weight: 600; }
.menu kbd { margin-left: auto; font: 11px var(--mono); color: var(--ink-3); }

/* ---------- Workspace ---------- */
.workspace { display: grid; grid-template-columns: 272px 1fr 360px 40px; min-height: 0; position: relative; }
.workspace.no-right { grid-template-columns: 272px 1fr 0 40px; }
.workspace.no-right .right { display: none; }
.left, .right { background: var(--panel); min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.left { border-right: 1px solid var(--line); }
.right { border-left: 1px solid var(--line); }
.rail { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding-top: 6px; gap: 4px; }
.rail button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 4px; background: none; color: var(--ink-2); }
.rail button:hover { background: var(--hover); }
.rail button[aria-pressed="true"] { background: var(--blue-2); color: var(--blue); }
.rail svg { width: 18px; height: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px 8px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.panel-head .count { color: var(--ink-3); font-weight: 400; }
.x { border: 0; background: none; font-size: 18px; line-height: 1; color: var(--ink-3); padding: 0 2px; }
.panel-scroll { overflow: auto; flex: 1; padding: 4px 0 24px; }
.left-toggle { display: none; }

/* Feature / instance list */
.flist { list-style: none; margin: 0; padding: 0; }
.flist ul { list-style: none; margin: 0; padding: 0; }
.fi { display: flex; align-items: center; gap: 7px; width: 100%; height: 26px; padding: 0 10px 0 calc(10px + var(--lvl, 0) * 16px);
  border: 0; background: none; text-align: left; color: var(--ink); white-space: nowrap; overflow: hidden; }
.fi:hover { background: var(--hover); }
.fi.sel { background: var(--blue-2); }
.fi .tw { width: 10px; flex-shrink: 0; font-size: 8px; color: var(--ink-3); transition: transform .12s; }
.fi[aria-expanded="false"] .tw { transform: rotate(-90deg); }
.fi .ic { width: 16px; height: 16px; flex-shrink: 0; }
.fi .lbl { overflow: hidden; text-overflow: ellipsis; }
.fi .meta { margin-left: auto; padding-left: 8px; color: var(--ink-3); font-size: 11.5px; flex-shrink: 0; }
.fi.dim { color: var(--ink-3); }
.fi.hidden-part .lbl { color: var(--ink-3); text-decoration: line-through; }
li[aria-expanded="false"] > ul { display: none; }
.group-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.rollback { height: 3px; margin: 4px 10px; border-radius: 2px; background: var(--blue); opacity: .7; }
.ic-sketch { color: #1a6fd1; } .ic-feat { color: #2f8f5b; } .ic-plane { color: #8a96a3; } .ic-origin { color: #c0392b; }
.ic-part { color: #c27a1a; } .ic-asm { color: #7d4fc4; } .ic-page { color: #52606d; } .ic-pdf { color: #c0392b; } .ic-ver { color: #1a6fd1; }
.left-foot { border-top: 1px solid var(--line-2); padding: 10px 12px; font-size: 12px; color: var(--ink-2); }

/* ---------- Graphics area ---------- */
.gfx { position: relative; min-width: 0; min-height: 0; background: linear-gradient(var(--gfx-top), var(--gfx-bot)); overflow: hidden; }
#three { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#cube { position: absolute; top: 10px; right: 10px; width: 110px; height: 110px; z-index: 4; cursor: pointer; }
.gfx-msg { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px; padding: 24px; text-align: center; color: var(--ink-2); font: 500 13px var(--mono); z-index: 3; }
.gfx-msg small { font: 12px var(--sans); color: var(--ink-3); }
.gfx-msg code { background: #e5e9ee; padding: 1px 5px; border-radius: 3px; font: 12px var(--mono); }
.tip { position: absolute; z-index: 6; pointer-events: none; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(20,30,45,.12);
  border-radius: 4px; padding: 4px 8px; font-size: 12px; max-width: 320px; }
.tip small { display: block; color: var(--ink-3); font-size: 11px; }
.gfx-page { position: absolute; inset: 0; overflow: auto; z-index: 2; background: #f6f7f9; }
.gfx-sketch { position: absolute; inset: 0; z-index: 2; background: #fbfcfd;
  background-image: linear-gradient(#e9edf2 1px, transparent 1px), linear-gradient(90deg, #e9edf2 1px, transparent 1px); background-size: 24px 24px; }
.sk-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.sk-geo { fill: none; stroke: #1d3f7a; stroke-width: 1.3; }
.sk-geo * { vector-effect: non-scaling-stroke; }
.sk-svg .cons { stroke: #5a8fd8; stroke-dasharray: 6 4; stroke-width: 1; }
.sk-svg text { fill: #1d3f7a; stroke: none; font-family: var(--mono); }

/* ---------- Document pages (About, Personal) shown in the graphics area ---------- */
.doc { max-width: 960px; margin: 0 auto; padding: 36px 32px 60px; }
.hero { display: grid; grid-template-columns: 150px 1fr; gap: 28px; align-items: center; padding: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.hero img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; }
.hero h1 { font-size: 30px; line-height: 1.15; margin: 0 0 2px; letter-spacing: -.01em; }
.hero .sub { color: var(--blue); font-weight: 600; margin: 0 0 10px; }
.hero p { font-size: 15px; margin: 0 0 10px; color: var(--ink-2); max-width: 600px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #2f9e5a; box-shadow: 0 0 0 3px #2f9e5a33; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); font-weight: 500; }
.btn:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #155db0; color: #fff; }
.sec-title { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 0 12px; }
.sec-title h2 { font-size: 15px; margin: 0; }
.sec-title span { color: var(--ink-3); font-size: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; color: var(--ink); text-align: left; padding: 0; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--blue-3); box-shadow: 0 6px 18px rgba(20,30,45,.08); text-decoration: none; }
.thumb { position: relative; aspect-ratio: 16/10; background: linear-gradient(var(--gfx-top), var(--gfx-bot)); display: grid; place-items: center; border-bottom: 1px solid var(--line-2); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 46px; height: 46px; stroke-width: 1.1; opacity: .55; }
.thumb:has(img) svg { display: none; }
.card-body { padding: 12px 14px 14px; }
.card-kind { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); margin-bottom: 3px; }
.card-kind svg { width: 13px; height: 13px; }
.card h3 { font-size: 14.5px; margin: 0 0 4px; }
.card p { margin: 0; color: var(--ink-2); font-size: 12.5px; }
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table td, .table th { padding: 9px 14px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.table tr:last-child td, .table tr:last-child th { border-bottom: 0; }
.table th { width: 180px; color: var(--ink-2); font-weight: 500; }
.table .r { text-align: right; color: var(--ink-3); white-space: nowrap; font-size: 12px; }
.table small { display: block; color: var(--ink-2); }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.two .sec-title { margin-top: 34px; }
.version { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 12px; }
.version header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.version .vtag { font: 600 11.5px var(--mono); color: var(--blue); background: var(--blue-2); border-radius: 10px; padding: 1px 8px; }
.version h3 { margin: 0; font-size: 15px; }
.version time { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.version p { margin: 0 0 8px; color: var(--ink-2); }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shots img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.shots:not(:has(img)) { display: none; }
.pdf { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #525659; }

/* ---------- Notes panel (project write-up) ---------- */
.right-body { overflow: auto; flex: 1; padding: 14px 16px 40px; font-size: 13.5px; }
.right-body .kicker { font: 11.5px var(--mono); color: var(--ink-3); margin: 0 0 4px; }
.right-body h1 { font-size: 19px; line-height: 1.25; margin: 0 0 6px; }
.right-body .lede { color: var(--ink-2); margin: 0 0 10px; }
.right-body h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 20px 0 6px; padding: 4px 6px; border-radius: 4px; transition: background .3s; }
.right-body h2.flash { background: var(--blue-2); }
.right-body p, .right-body ul { margin: 0 0 9px; }
.right-body ul { padding-left: 18px; }
.right-body li { margin-bottom: 4px; }
.props { width: 100%; border-collapse: collapse; margin: 6px 0 8px; font-size: 12.5px; }
.props th { text-align: left; font-weight: 500; color: var(--ink-3); width: 66px; padding: 4px 8px 4px 0; vertical-align: top; }
.props td { padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.measures { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; margin: 10px 0; }
.measure { border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; }
.measure b { display: block; font: 600 15px var(--mono); color: var(--blue); }
.measure span { font-size: 11px; color: var(--ink-2); }
.cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); margin: 6px 0; }
.todo { font: 12px/1.55 var(--mono); color: #6b4e00; background: var(--todo); border-left: 3px solid #e0a800; padding: 4px 8px; border-radius: 0 3px 3px 0; }
.todo::before { content: "TODO  "; font-weight: 600; }
span.todo { display: inline; }

/* ---------- Tab bar ---------- */
.tabbar { display: flex; align-items: stretch; background: #e8ebef; border-top: 1px solid var(--line); min-width: 0; }
.tab-mgr { width: 38px; border: 0; border-right: 1px solid var(--line); background: none; color: var(--ink-2); display: grid; place-items: center; flex-shrink: 0; }
.tab-mgr:hover { background: var(--hover); }
.tab-mgr svg { width: 16px; height: 16px; }
.tabs { display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 6px; padding: 0 14px; border: 0; border-right: 1px solid var(--line); background: none; color: var(--ink-2); white-space: nowrap; font-size: 12.5px; position: relative; }
.tab:hover { background: #f3f5f7; color: var(--ink); }
.tab[aria-selected="true"] { background: var(--panel); color: var(--ink); font-weight: 600; }
.tab[aria-selected="true"]::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--blue); }
.tab svg { width: 15px; height: 15px; }
.tabmenu { position: fixed; left: 6px; bottom: 40px; z-index: 50; min-width: 240px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 28px rgba(20,30,45,.18); }
.tabmenu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 4px; text-align: left; }
.tabmenu button:hover { background: var(--hover); }
.tabmenu svg { width: 15px; height: 15px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 240px 1fr 320px 40px; }
  .workspace.no-right { grid-template-columns: 240px 1fr 0 40px; }
}
@media (max-width: 820px) {
  .top-link, .ws-pill { display: none; }
  .workspace, .workspace.no-right { grid-template-columns: 1fr; grid-template-rows: 1fr auto; overflow: auto; }
  .rail { display: none; }
  .gfx { min-height: 56vh; }
  .workspace.page-mode .gfx { min-height: 100%; }
  .right { border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .right .x { display: none; }
  .right-body { overflow: visible; }
  .left { position: fixed; top: 0; left: 0; bottom: 0; width: 84vw; max-width: 320px; z-index: 60; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .left.open { transform: none; }
  .left-toggle { display: block; position: absolute; top: 10px; left: 10px; z-index: 5; width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
  .workspace.page-mode .left-toggle { display: none; }
  #cube { width: 84px; height: 84px; }
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero img { width: 110px; height: 110px; }
  .two { grid-template-columns: 1fr; }
  .doc { padding: 20px 16px 40px; }
  .table th { width: 120px; }
}

/* ---------- Application tab (software projects) ---------- */
.doc.app { max-width: 880px; }
.app-head .btn { white-space: nowrap; }
.app-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.app-ic { width: 42px; height: 42px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.app-ic svg { width: 24px; height: 24px; }
.app-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.app-repo { font-size: 16px; color: var(--ink-2); }
.app-repo a { color: inherit; }
.app-repo b { color: var(--ink); }
.app-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-3); }
.app-meta span { display: inline-flex; align-items: center; gap: 4px; }
.app-meta svg { width: 13px; height: 13px; }
.app-lede { font-size: 15px; color: var(--ink-2); margin: 16px 2px 18px; }
.demo { margin: 0; background: #0b0f14; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.demo video { display: block; width: 100%; max-height: 62vh; background: #000; }
.demo figcaption { padding: 10px 14px; font-size: 12.5px; color: #c4ccd6; background: #141a21; }
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pipeline li { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; transition: background .3s, border-color .3s; }
.pipeline li.flash { background: var(--blue-2); border-color: var(--blue-3); }
.pipeline h3 { margin: 1px 0 3px; font-size: 14.5px; }
.pipeline p { margin: 0; color: var(--ink-2); font-size: 13px; }
.step-n { font: 500 11px var(--mono); color: var(--blue); }
.step-shots { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 2px; }
.step-shots figure { margin: 0; }
.step-shots a { display: block; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #0b0f14; }
.step-shots img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .25s; }
.step-shots a:hover img { transform: scale(1.03); }
.step-shots figcaption { margin-top: 5px; font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.step-art { width: 120px; height: 66px; color: var(--ink-2); stroke-width: 1.4; }
.step-art .hot { fill: #e0402f; stroke: #e0402f; }
.step-art .hot-line { stroke: #e0402f; stroke-width: 2.2; }
.step-art .pin { fill: #e0402f; stroke: #fff; }
@media (max-width: 820px) {
  .pipeline li { grid-template-columns: 1fr; gap: 6px; }
  .step-art { width: 96px; height: 52px; }
}
@media (max-width: 820px) {
  /* application tabs: let the page flow, notes underneath */
  .workspace.app-mode .gfx { min-height: 0; overflow: visible; }
  .workspace.app-mode .gfx-page { position: static; overflow: visible; }
}
@media (max-width: 820px) {
  .app-title { flex: 1 1 calc(100% - 60px); }
  .app-repo { word-break: break-word; font-size: 15px; }
  .app-head .btns { flex-basis: 100%; }
}

/* =====================================================================
   Two modes: documents list (body.mode-docs) and a document workspace (body.mode-ws)
   ===================================================================== */
body.mode-docs .ws, body.mode-ws .docs { display: none !important; }
.ws { display: grid; grid-template-rows: 40px 1fr 34px; min-height: 0; }

/* ---------- Top bar variants ---------- */
.topbar { gap: 14px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 19px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 32px; height: 32px; }
.search { position: relative; flex: 0 1 560px; margin: 0 auto; display: flex; }
.search input { flex: 1; min-width: 0; height: 36px; padding: 0 40px 0 12px; border: 1px solid #c5cad1; border-right: 0; border-radius: 4px 0 0 4px; font: italic 14px var(--sans); color: var(--ink); background: #fff; }
.search input:not(:placeholder-shown) { font-style: normal; }
.search input:focus { outline: 2px solid var(--blue-3); outline-offset: -1px; }
.search button { width: 40px; border: 1px solid #c5cad1; border-radius: 0 4px 4px 0; background: #f7f8fa; display: grid; place-items: center; color: var(--ink); }
.search button svg { width: 20px; height: 20px; stroke-width: 2; }
.top-icons { display: flex; align-items: center; gap: 6px; }
.top-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 4px; color: var(--ink); }
.top-icon:hover { background: var(--hover); text-decoration: none; }
.top-icon svg { width: 21px; height: 21px; }
.user { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 20px; color: var(--ink); font-size: 14.5px; white-space: nowrap; }
.user:hover { background: var(--hover); text-decoration: none; }
.user img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 13px; padding: 4px 8px; border-radius: 4px; }
.back:hover { background: var(--hover); text-decoration: none; }
.back svg { width: 15px; height: 15px; }

/* ---------- Documents page ---------- */
.docs { display: grid; grid-template-columns: 300px 1fr 44px; grid-template-rows: 1fr 30px; min-height: 0; background: #fff; }
.nav { grid-row: 1; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 0 0; min-height: 0; overflow: auto; background: #fff; }
.create { position: relative; margin: 0 24px 18px; }
.create > button { width: 100%; height: 42px; border: 0; border-radius: 4px; background: #2e5fbf; color: #fff; font-size: 16px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; }
.create > button:hover { background: #2652a8; }
.create > button svg { width: 11px; height: 11px; stroke-width: 2.4; }
.create .menu { top: 46px; left: 0; right: 0; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 16px 0 24px; border: 0; background: none; color: var(--ink); font-size: 15.5px; text-align: left; white-space: nowrap; text-decoration: none; }
.nav-item:hover { background: #f3f5f8; text-decoration: none; }
.nav-item.on { color: #2e5fbf; font-weight: 600; }
.nav-item.on::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; background: #2e5fbf; }
.nav-item svg { width: 22px; height: 22px; flex-shrink: 0; stroke-width: 1.5; }
.nav-item .chev { position: absolute; left: 6px; width: 12px; height: 12px; stroke-width: 2; transition: transform .15s; }
.nav-item[aria-expanded="true"] .chev { transform: rotate(90deg); }
.nav-item .ext { margin-left: auto; width: 14px; height: 14px; color: var(--ink-3); }
.nav-sub { list-style: none; margin: 0; padding: 0; }
.nav-sub .nav-item { height: 34px; padding-left: 58px; font-size: 14px; color: var(--ink-2); }
.nav-sub .nav-item.on { color: #2e5fbf; }
.nav-foot { margin-top: auto; padding: 18px 24px 16px; font-size: 14px; font-weight: 600; }
.nav-foot span { font-weight: 400; color: var(--ink-2); }

.docs-main { grid-row: 1; overflow: auto; padding: 22px 18px 30px 18px; min-width: 0; }
.dm-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px 12px; font-size: 21px; font-weight: 600; }
.dm-title svg { width: 24px; height: 24px; }
.dm-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; background: none; border-radius: 8px; font-size: 16px; font-weight: 600; color: var(--ink); text-align: left; }
.dm-row:hover { background: #f5f7fa; }
.dm-row.hl { background: #eef2f8; }
.dm-row .chev { width: 13px; height: 13px; stroke-width: 2.2; transition: transform .15s; }
.dm-row[aria-expanded="true"] .chev { transform: rotate(90deg); }
.dm-row svg.big { width: 22px; height: 22px; }
.dm-row .bulb { color: #fff; background: #2e5fbf; border-radius: 50%; padding: 3px; width: 26px; height: 26px; }
.dm-body { padding: 6px 14px 14px 52px; }
.dm-body[hidden] { display: none; }
.intro { display: flex; gap: 18px; align-items: center; }
.intro img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; }
.intro p { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; max-width: 640px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 13.5px; }
.chip:hover { border-color: var(--blue-3); background: #f6f9fd; text-decoration: none; }
.chip svg { width: 18px; height: 18px; color: var(--ink-2); }
.divider { position: relative; height: 1px; background: var(--line); margin: 14px 12px 22px; }
.divider span { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); width: 34px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); display: grid; place-items: center; }
.divider svg { width: 12px; height: 12px; stroke-width: 2.2; }
.list-tools { display: flex; align-items: center; justify-content: space-between; margin: 0 12px 12px; }
.typebtn { position: relative; }
.typebtn > button { height: 36px; padding: 0 12px; border: 1px solid #c5cad1; border-radius: 4px; background: #fff; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.typebtn > button svg { width: 10px; height: 10px; stroke-width: 2.4; }
.result-count { color: var(--ink-3); font-size: 13.5px; }
.doctable { width: 100%; border-collapse: collapse; font-size: 15px; }
.doctable th { text-align: left; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid #b9bfc7; white-space: nowrap; position: relative; }
.doctable th + th::before { content: ""; position: absolute; left: -2px; top: 8px; bottom: 8px; width: 2px; background: #d6dae0; }
.doctable th button { border: 0; background: none; font: inherit; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.doctable th svg { width: 10px; height: 10px; stroke-width: 2.4; color: var(--ink-3); }
.doctable td { padding: 6px 12px; border-bottom: 1px solid #e6e9ed; height: 60px; vertical-align: middle; white-space: nowrap; }
.doctable tbody tr { cursor: pointer; }
.doctable tbody tr:hover td { background: #f3f6fa; }
.doctable .nm { display: flex; align-items: center; gap: 14px; }
.dthumb { width: 96px; height: 50px; flex-shrink: 0; display: grid; place-items: center; position: relative; }
.dthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.dthumb svg { width: 30px; height: 30px; color: #9aa5b3; stroke-width: 1.2; }
.dthumb:has(img) svg { display: none; }
.dname { font-size: 16px; color: var(--ink); }
.dkind { color: #2e5fbf; display: inline-flex; }
.dkind svg { width: 19px; height: 19px; }
.dmain { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: var(--ink-2); }
.dmain svg { width: 13px; height: 13px; }
.dsub { display: block; font-size: 12.5px; color: var(--ink-3); white-space: normal; max-width: 420px; }
.empty { padding: 30px 12px; color: var(--ink-3); }
.docs-rail { grid-row: 1; border-left: 1px solid var(--line); display: flex; justify-content: center; padding-top: 52px; }
.docs-rail button { width: 34px; height: 34px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.docs-rail button:hover { background: var(--hover); }
.docs-rail svg { width: 24px; height: 24px; stroke-width: 1.6; }
.docs-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 220px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); background: #fff; }
.docs-foot a { color: var(--ink-2); }
.page-wrap { margin: -22px -18px -30px; }
.page-wrap .doc { padding-top: 26px; }
.resume-frame { width: 100%; height: calc(100vh - 140px); border: 1px solid var(--line); border-radius: 6px; }

@media (max-width: 1100px) {
  .docs-foot { padding: 0 24px; }
  .doctable .col-by { display: none; }
}
@media (max-width: 820px) {
  body { grid-template-rows: 50px auto; height: auto; min-height: 100%; }
  html, body { height: auto; overflow: auto; }
  .ws { grid-template-rows: 40px auto 34px; }
  .ws .tabbar { position: sticky; bottom: 0; z-index: 30; }
  .search, .top-icons, .user span { display: none; }
  .user { margin-left: auto; }
  .docs { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .nav { grid-row: auto; border-right: 0; border-bottom: 1px solid var(--line); padding-top: 12px; }
  .nav-list { display: flex; overflow-x: auto; scrollbar-width: none; }
  .nav-list > li > .nav-item { height: 38px; padding: 0 14px; font-size: 14px; }
  .nav-list > li > .nav-item.on::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 3px; }
  .nav-item .chev, .nav-sub, .nav-foot, .nav-item .ext { display: none; }
  .create { margin: 0 14px 10px; }
  .docs-main { grid-row: auto; overflow: visible; padding: 16px 8px 24px; }
  .docs-rail { display: none; }
  .docs-foot { padding: 12px 16px; flex-wrap: wrap; gap: 6px; }
  .doctable .col-mod, .doctable .col-by, .doctable .col-own { display: none; }
  .doctable td { white-space: normal; }
  .dthumb { width: 72px; height: 42px; }
  .page-wrap { margin: -16px -8px -24px; }
}
@media (max-width: 820px) {
  /* phones: graphics fill the screen under the top bar + toolbar, tabs stay pinned at the bottom */
  .ws .gfx { min-height: calc(100vh - 124px); min-height: calc(100dvh - 124px); }
  .workspace.app-mode .gfx { min-height: 0; }
}
@media (max-width: 820px) {
  .intro { flex-direction: column; align-items: flex-start; gap: 10px; }
  .intro img { width: 64px; height: 64px; }
  .dm-body { padding-left: 14px; }
}

/* =====================================================================
   Document workspace, modeled on the reference CAD layout
   ===================================================================== */
.rel { position: relative; }
/* grid: left icon rail · instance/feature list · graphics · right panel · right icon rail */
body .workspace { --lw: 290px; --rw: 360px; grid-template-columns: 44px var(--lw) 1fr var(--rw) 40px; }
body .workspace.no-left { --lw: 0px; }
body .workspace.no-right { --rw: 0px; }
body .workspace.no-left .left, body .workspace.no-right .right { display: flex; visibility: hidden; border: 0; }
.lrail { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 8px; }
.lrail button, .rail button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 4px; background: none; color: #2b3642; }
.lrail button:hover, .rail button:hover { background: var(--hover); }
.lrail button[aria-pressed="true"], .rail button[aria-pressed="true"] { background: var(--blue-2); color: var(--blue); }
.lrail svg, .rail svg { width: 21px; height: 21px; }
.rail { gap: 2px; padding-top: 8px; }

/* top bar inside a document */
.doc-title.big { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.main-gray { color: #8a96a3; font-size: 16px; margin-left: 10px; }
.doc-icons { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.top-icon.sm { width: 30px; height: 30px; color: #3d4a57; border: 0; background: none; }
.top-icon.sm svg { width: 19px; height: 19px; }
.top-icon.dim-txt { width: auto; padding: 0 6px; gap: 5px; display: inline-flex; font-size: 13px; color: var(--ink-2); }
.top-icon.dim-txt svg { color: #2e5fbf; }
button.top-icon { border: 0; background: none; cursor: pointer; }
.top-right .share { background: #2e5fbf; padding: 7px 16px; font-size: 14.5px; }
.top-right .menu { left: auto; right: 0; }

/* toolbar + tool search */
.toolbar { gap: 1px; }
.tb-grow { flex: 1; }
.toolsearch { display: flex; align-items: center; height: 32px; margin-left: 8px; padding: 0 6px 0 10px; background: #f1f3f5; border: 1px solid transparent; border-radius: 4px; flex-shrink: 0; }
.toolsearch:focus-within { background: #fff; border-color: var(--blue-3); }
.toolsearch input { border: 0; background: none; width: 190px; font: 14px var(--sans); color: var(--ink); outline: none; }
.toolsearch kbd { font: 11px var(--sans); color: var(--ink-2); border: 1px solid #c5cad1; border-radius: 3px; padding: 1px 4px; background: #fff; white-space: nowrap; }
.tools-menu { left: auto; right: 0; width: 320px; max-height: 360px; overflow: auto; }
.tools-menu button.on { background: var(--hover); color: var(--ink); font-weight: 400; }

/* left panel: filter row + tree */
.filter-row { display: flex; align-items: center; gap: 6px; padding: 8px 8px 6px 10px; }
.filter-row .ic-wrap svg { width: 20px; height: 20px; color: #2b3642; }
.ffilter { flex: 1; min-width: 0; height: 32px; padding: 0 8px; border: 1px solid #c5cad1; border-radius: 3px; font: italic 14px var(--sans); }
.ffilter:not(:placeholder-shown) { font-style: normal; }
.ffilter:focus { outline: 2px solid var(--blue-3); outline-offset: -1px; }
.filter-row .tool { width: 32px; height: 32px; padding: 0; justify-content: center; }
.left .panel-head { font-size: 14.5px; font-weight: 600; border-bottom: 0; padding: 6px 12px 4px; }
.left .fi { height: 30px; font-size: 14.5px; }
.left .fi .tw { font-size: 9px; width: 12px; }
.left .fi[aria-expanded="false"] .tw, .left .fi .tw { transform: none; }
.left li[aria-expanded="true"] > .fi .tw { transform: rotate(90deg); }
.left .fi:disabled { color: var(--ink-3); cursor: default; }
.left .fi:disabled:hover { background: none; }
.badge-link { display: inline-flex; color: #5b8fe6; margin-left: 4px; }
.badge-link svg { width: 17px; height: 17px; }
.origin-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #6b7684; margin: 0 3px; flex-shrink: 0; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px #6b7684; }

/* graphics: plain white like the reference */
.ws .gfx { background: #fff; }
#cube { top: 30px; right: 34px; width: 104px; height: 104px; }
.cube-ctl { position: absolute; top: 8px; right: 12px; width: 148px; height: 190px; z-index: 5; pointer-events: none; }
.cube-ctl > * { pointer-events: auto; }
.ca { position: absolute; width: 18px; height: 18px; border: 0; background: none; padding: 0; cursor: pointer; }
.ca::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border: 7px solid transparent; }
.ca-up { top: 0; left: 65px; } .ca-up::after { border-bottom-color: #c5cad1; border-top-width: 0; }
.ca-down { top: 128px; left: 65px; } .ca-down::after { border-top-color: #c5cad1; border-bottom-width: 0; }
.ca-left { top: 64px; left: 0; } .ca-left::after { border-right-color: #c5cad1; border-left-width: 0; }
.ca-right { top: 64px; right: 0; } .ca-right::after { border-left-color: #c5cad1; border-right-width: 0; }
.ca:hover::after { filter: brightness(.6); }
.ca-up:hover::after { border-bottom-color: var(--blue); } .ca-down:hover::after { border-top-color: var(--blue); }
.ca-left:hover::after { border-right-color: var(--blue); } .ca-right:hover::after { border-left-color: var(--blue); }
.cube-disp { position: absolute; top: 152px; right: 8px; }
.cube-disp .menu { left: auto; right: 0; }

/* right panel: bill of materials */
.bomt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bomt th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 6px 6px; border-bottom: 1px solid var(--line); position: sticky; top: -14px; background: #fff; }
.bomt td { padding: 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.bomt td:first-child, .bomt th:first-child { color: var(--ink-3); width: 26px; }
.bomt td:last-child, .bomt th:last-child { text-align: right; font: 500 12.5px var(--mono); }
.bomt small { display: block; color: var(--ink-3); font-size: 11px; }

/* tabs: wide, left-aligned, folders */
.tabbar { background: #e9ecef; }
.tab-search { border-right: 0; }
.tab { min-width: 190px; justify-content: flex-start; padding: 0 14px; font-size: 14px; color: #3d4a57; }
.tab span { overflow: hidden; text-overflow: ellipsis; }
.tab.folder svg { color: #3d4a57; }
.tab[aria-selected="true"] { color: var(--ink); }

@media (max-width: 1100px) { body .workspace { --lw: 250px; --rw: 320px; } }
@media (max-width: 820px) {
  body .workspace, body .workspace.no-right, body .workspace.no-left { grid-template-columns: 1fr; }
  .lrail, .cube-ctl .ca, .doc-icons, .main-gray, .toolsearch kbd { display: none; }
  .toolsearch input { width: 120px; }
  body .workspace.no-right .right { display: none; }
  body .workspace.no-left .left { visibility: visible; }
  #cube { top: 10px; right: 10px; width: 84px; height: 84px; }
  .cube-disp { top: 100px; right: 4px; }
  .tab { min-width: 140px; }
  .doc-title.big { font-size: 16px; }
}
@media (min-width: 821px) {
  body .workspace, body .workspace.no-right, body .workspace.no-left { grid-template-columns: 44px var(--lw) 1fr var(--rw) 40px; }
}

/* imported image tabs */
.imgview { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: #f4f5f7; overflow: auto; }
.imgview img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 4px 20px rgba(20,30,45,.12); cursor: zoom-in; }
.imgview.actual { place-items: start; }
.imgview.actual img { max-width: none; max-height: none; cursor: zoom-out; }
.right-body img.cover { cursor: zoom-in; }
@media (max-width: 820px) { .imgview { position: static; padding: 12px; } }

/* part / instance visibility (eye on hover, right-aligned) */
.fi.has-eye { cursor: pointer; position: relative; }
.fi .eye { margin-left: auto; flex-shrink: 0; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px; color: #3d4a57; opacity: 0; transition: opacity .1s; }
.fi .meta + .eye, .fi .badge-link + .eye { margin-left: 4px; }
.fi:hover .eye, .fi:focus-within .eye, .fi .eye:focus { opacity: 1; }
.fi .eye:hover { background: #dfe6ef; color: var(--blue); }
.fi .eye.off { opacity: 1; color: var(--ink-3); }
.fi .eye svg { width: 17px; height: 17px; }
.fi.hidden-part .lbl, .fi.hidden-part .meta { color: var(--ink-3); }
.fi.hidden-part > .ic { opacity: .45; }
.fi.vis-row { gap: 4px; padding-left: 6px; }
.fi.vis-row:hover { background: none; }
.fi.vis-row button { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border: 0; border-radius: 4px; background: none; color: var(--ink-2); font-size: 13px; }
.fi.vis-row button:hover { background: var(--hover); color: var(--ink); }
.fi.vis-row svg { width: 16px; height: 16px; }
@media (hover: none) { .fi .eye { opacity: .7; } }
.fi.hidden-part .lbl { text-decoration: none; }

/* menus: icons at a fixed size (Contact / Share / document menus) */
.menu svg { width: 18px; height: 18px; flex-shrink: 0; }
.menu button { align-items: center; }
.menu button span { display: flex; flex-direction: column; line-height: 1.25; }
.menu button small { color: var(--ink-3); font-size: 12px; }
.create .menu { min-width: 250px; right: auto; }

/* resume rendered with pdf.js */
.resume-pages { margin: 0 12px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.resume-page { width: 100%; max-width: 900px; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 6px 24px rgba(20,30,45,.1); }
.btn { white-space: nowrap; }

/* loading screen shown briefly when a document opens */
.ws { position: relative; }
.ws-loading { position: absolute; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #fff linear-gradient(90deg, #f7f8f9 54px, #e1e4e8 54px, #e1e4e8 55px, transparent 55px); }
.ws-loading[hidden] { display: none; }
.ws-spin { width: 70px; height: 70px; border-radius: 50%; border: 7px solid #d8d8d8; border-right-color: #2e5fbf; animation: ws-spin .9s linear infinite; }
.ws-loading p { margin: 0; font-size: 16px; color: #2b3642; }
@keyframes ws-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ws-spin { animation-duration: 2.5s; } }
@media (max-width: 820px) { .ws-loading { position: fixed; top: 50px; background: #fff; } }

/* view cube, modeled on Onshape's (overrides earlier cube styles) */
.cube-ctl { top: 4px; right: 6px; width: 176px; height: 212px; }
.cube-ctl #cube { position: absolute; top: 24px; left: 28px; right: auto; width: 120px; height: 120px; pointer-events: auto; }
.ca { position: absolute; width: auto; height: auto; padding: 2px; border: 0; background: none; cursor: pointer; line-height: 0; }
.ca::after { display: none; }
.ca svg { fill: #cbd3dc; stroke: #cbd3dc; display: block; }
.ca:hover svg { fill: var(--blue); stroke: var(--blue); }
.ca-up { top: 0; left: 78px; } .ca-up svg { width: 18px; height: 13px; }
.ca-down { top: 150px; left: 78px; } .ca-down svg { width: 18px; height: 13px; }
.ca-left { top: 74px; left: 2px; } .ca-left svg { width: 13px; height: 18px; }
.ca-right { top: 74px; left: 158px; } .ca-right svg { width: 13px; height: 18px; }
.cube-disp { position: absolute; top: 174px; right: 8px; }
.cube-disp .tool { gap: 4px; }
.cube-disp .ic { width: 24px; height: 24px; color: #5b6570; }
.cube-disp .caret { width: 10px; height: 10px; color: #2b3642; }
@media (max-width: 820px) {
  .cube-ctl { transform: scale(.72); transform-origin: top right; }
  .cube-ctl .ca { display: block; }
  #cube { top: 24px; right: auto; }
}
/* loading screen now lives outside the workspace so it covers both views */
.ws-loading { position: fixed; top: 50px; left: 0; right: 0; bottom: 0; z-index: 200; background: #fff; }
.ws-loading.rail { background: #fff linear-gradient(90deg, #f7f8f9 44px, #e1e4e8 44px, #e1e4e8 45px, transparent 45px); }
/* documents page without the right-hand info rail */
.docs { grid-template-columns: 300px 1fr; }
/* button icons (About me, Resume page) */
.btn svg, .chip svg { width: 16px; height: 16px; flex-shrink: 0; }
/* bottom row: just the copyright, bottom-left */
.docs-foot { justify-content: flex-start; padding: 0 24px; }

/* photo viewer */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10, 13, 17, .86); display: flex; align-items: center; justify-content: center; padding: 48px 32px 32px; cursor: zoom-out; animation: lb-in .15s ease-out; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox img { max-width: min(1400px, 100%); max-height: calc(100vh - 120px); object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); cursor: default; }
.lightbox figcaption { color: #dfe5ec; font-size: 13.5px; text-align: center; }
.lb-x { position: absolute; top: 12px; right: 16px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.lb-x:hover { background: rgba(255,255,255,.24); }
@keyframes lb-in { from { opacity: 0; } }
.step-shots a { cursor: zoom-in; }

/* inline dimension badge (key numbers in notes) */
.dim { display: inline-block; padding: 0 6px; margin: 0 1px; border-radius: 4px; background: var(--blue-2); border: 1px solid var(--blue-3); color: var(--blue); font: 500 0.9em var(--mono); line-height: 1.5; white-space: nowrap; }

/* temperature legend (furnace) */
.therm-legend { position: absolute; left: 14px; bottom: 14px; z-index: 3; padding: 10px 12px 12px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 10px rgba(20,30,40,.08); font-size: 12px; color: var(--ink); pointer-events: none; }
.therm-legend b { display: block; font-size: 12.5px; }
.therm-legend small { display: block; color: var(--ink-2); font-size: 11px; margin: 1px 0 8px; }
.tl-body { display: flex; gap: 8px; height: 150px; }
.tl-bar { width: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); }
.tl-ticks { display: flex; flex-direction: column; justify-content: space-between; font: 500 11px var(--mono); color: var(--ink-2); margin: -6px 0; }
.tip .tip-temp { color: var(--blue); font: 500 12px var(--mono); }

/* Section / Temperature toggles, floating over the top-left of the 3D view */
.view-toggles { position: absolute; top: 12px; left: 12px; z-index: 4; display: flex; gap: 2px; padding: 3px; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 10px rgba(20,30,40,.08); }
.view-toggles[hidden] { display: none; }
.view-toggles .tool { height: 34px; padding: 0 11px; border-radius: 6px; }
.view-toggles .tool-label { font-size: 13px; font-weight: 500; }
@media (max-width: 820px) { .view-toggles { left: 56px; top: 10px; } }

/* hide the empty top tool row */
.ws.no-toolbar { grid-template-rows: 0 1fr 34px; }
.ws.no-toolbar .toolbar { border: 0; padding: 0; overflow: hidden; }
@media (max-width: 820px) { .ws.no-toolbar { grid-template-rows: 0 auto 34px; } .ws.no-toolbar .gfx { min-height: calc(100vh - 84px); min-height: calc(100dvh - 84px); } }

.left .panel-head.files-head { margin-top: 10px; }

/* "still undergoing changes" note for work-in-progress projects */
.wip-tip { position: fixed; z-index: 100; max-width: 260px; padding: 8px 11px; border-radius: 6px; background: #1f2937; color: #fff;
  font-size: 12.5px; line-height: 1.35; box-shadow: 0 6px 18px rgba(15,23,42,.25); pointer-events: none; opacity: 0; transform: translateY(-3px);
  transition: opacity .15s, transform .15s; }
.wip-tip.show { opacity: 1; transform: none; }
.view-toggles .vt-sep { width: 1px; margin: 5px 3px; background: var(--line); }
.view-toggles .vt-cfg { padding: 0 9px; }

/* tab folders: a folder tab opens to show its tabs, with the folder pinned first as the way back */
.tab.folder .dir-n { margin-left: auto; padding: 0 6px; border-radius: 8px; background: #d9dee4; color: var(--ink-2); font-size: 11px; font-weight: 500; }
.tab.folder[aria-selected="true"] .dir-n { background: #dbe7fb; color: var(--blue); }
.tab.folder.up { min-width: 0; flex-shrink: 0; background: #dde2e8; font-weight: 600; color: var(--ink); }
.tab.folder.up .up-arr { order: -1; font-size: 16px; line-height: 1; color: var(--ink-2); margin-right: 2px; }
.tab.folder.up:hover { background: #d3d9e0; }
.tabmenu .tm-dir { display: flex; align-items: center; gap: 8px; padding: 7px 10px 3px; color: var(--ink-3); font-size: 12px; }
.tabmenu .tm-dir svg { width: 14px; height: 14px; }
.tabmenu button.sub { padding-left: 28px; }
.tab.folder.up span { overflow: visible; }
.view-toggles .vt-scale { display: flex; align-items: center; gap: 7px; padding: 0 8px 0 10px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.view-toggles .vt-scale input { width: 80px; accent-color: var(--blue); }
.view-toggles .vt-scale output { min-width: 36px; font: 500 12.5px var(--mono); color: var(--ink); }
.view-toggles { flex-wrap: wrap; max-width: calc(100% - 190px); }
