/* eitri.io's additions to the core's design system (/assets/design/, the single source of truth; nothing here redefines it):
   the landing pages' 3D labels and hover panel, the root's cross-check tooltips and tool chips, the tool pages' partner chips,
   the account button, signed-in visibility, and four rules for the core's editor page. Loaded after the design system on every
   page eitri.io serves (its own pages, and the core's pages at their <!-- eitri:host-head --> marker). */
.gl-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.gl-labels span { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; }
.tlabel { font: 500 var(--t-xs) var(--font-mono); color: var(--fg); display: inline-flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; }
.tlabel::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--tool); }
.tlabel.core { color: var(--fg-2); letter-spacing: .04em; text-transform: uppercase; font-size: var(--t-2xs); }
.tlabel.core::before { background: conic-gradient(var(--c-cad), var(--c-wires), var(--c-motion), var(--c-pneumatics), var(--c-firmware), var(--c-cad)); border-radius: 50%; }
.xlabel { pointer-events: auto; cursor: help; font: 400 var(--t-2xs) var(--font-mono); color: var(--fg-2); background: color-mix(in srgb, var(--panel) 85%, transparent);
  border: 1px dashed var(--line-2); border-radius: 4px; padding: 1px 6px; }
.hud { position: absolute; z-index: 4; min-width: 200px; max-width: 260px; pointer-events: none; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--r2); box-shadow: var(--shadow-2); padding: 9px 11px; opacity: 0; transform: translateY(4px);
  transition: opacity .14s var(--ease), transform .14s var(--ease); }
.hud.on { opacity: 1; transform: none; }
.hud .t { display: flex; align-items: center; gap: 8px; font: 600 var(--t-md) var(--font-ui); color: var(--fg); }
.hud .t e-glyph { width: 16px; height: 16px; color: var(--tool); }
.hud p { margin: 3px 0 0; color: var(--fg-2); font-size: var(--t-sm); line-height: 1.4; }
.hud .go { margin-top: 6px; font: 400 var(--t-xs) var(--font-mono); color: var(--muted); }

/* the root's cross-checks: a title and its pair; the description is a tooltip (hover or keyboard focus) */
.xchecks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.xchecks li { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r1); cursor: help; }
.xchecks li:hover, .xchecks li:focus-visible { background: var(--raised); }
.xchecks li:focus-visible { outline: 2px solid var(--tool); outline-offset: -2px; }
.xchecks .pair { width: 52px; flex: none; }
.xchecks .k { font: 500 var(--t-md) var(--font-ui); color: var(--fg); }
.tipbox { position: absolute; left: 8px; right: 8px; top: calc(100% + 4px); z-index: 10; background: var(--raised-2); color: var(--fg-2); border: 1px solid var(--line-2);
  border-radius: var(--r1); box-shadow: var(--shadow-2); padding: 7px 9px; font: 400 var(--t-sm)/1.45 var(--font-ui); opacity: 0; visibility: hidden;
  transition: opacity .12s var(--ease); pointer-events: none; }
.xchecks li:hover .tipbox, .xchecks li:focus-visible .tipbox { opacity: 1; visibility: visible; }
/* the tools as one row of chips */
.toolchips { display: flex; flex-wrap: wrap; gap: 6px; }
.toolchips a { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 8px; border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--fg-2); text-decoration: none; font: 500 var(--t-sm) var(--font-ui); }
.toolchips a e-glyph { width: 16px; height: 16px; color: var(--tool); }
.toolchips a:hover { border-color: var(--tool); color: var(--fg); }
.toolchips a:focus-visible { outline: 2px solid var(--tool); outline-offset: 2px; }

/* the root's panel on desktop: the tools sit at the foot, like a tool panel's footer (no empty half-panel under the waitlist) */
@media (min-width: 761px) {
  body.app[data-tool="all"] .inspector { display: flex; flex-direction: column; }
  body.app[data-tool="all"] .inspector .sect.dock { margin-top: auto; border-top: 1px solid var(--line); border-bottom: 0; }
}

.pairs { display: block; line-height: 2; margin: 10px 0 0; font: 400 var(--t-sm) var(--font-ui); color: var(--muted); }
.pairs a, .pairs span.chipish { vertical-align: middle; margin: 0 2px; line-height: 1.5; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 8px 2px 6px;
  color: var(--fg-2); text-decoration: none; font: 500 var(--t-xs) var(--font-ui); }
.pairs a:hover { border-color: var(--faint); color: var(--fg); }
.pairs e-glyph { width: 14px; height: 14px; }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; color: var(--fg-2); font-size: var(--t-sm); }
details.more video { display: block; width: 100%; height: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r2); }

/* the account button in the top bar */
eitri-topbar .account .handle { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { eitri-topbar .account .handle { display: none; } }
/* what only a signed-out visitor needs (the free-tier line); signed-in state is set on <html> by hosted.js */
html.signed-in .signed-out-only { display: none !important; }
html:not(.signed-in) .signed-in-only { display: none !important; }

/* the core's editor: the usage meter lives in the top bar (hosted.js); the editor's own pill in #hostedbar is not shown twice */
#hostedbar .pill.meter { display: none; }
#hostedbar:not(:empty) { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
/* "billed to your key" is the local install's wording; on eitri.io usage is the daily allowance, shown in the top bar */
#planusage { display: none; }
/* a combined project's editor: the status bar's tool item names the workspace (EITRI_SHELL.place in hosted.js), so "eitri.io · beta" is not repeated */
html.workspace #statusbar #st-where { display: none; }

/* ---------------------------------------------------------------- the Assembly view (static/js/assembly.js): the whole machine in one scene */
/* while the view is up the page's own model, domain editor and CAD tools step aside; the 3D canvas stays whatever file is current */
body[data-view="assembly"] #hostharness, body[data-view="assembly"] #domtools, body[data-view="assembly"] #tools, body[data-view="assembly"] #hud,
body[data-view="assembly"] #selpanel, body[data-view="assembly"] #timeline, body[data-view="assembly"] #labels .lbl.hole, body[data-view="assembly"] #labels .lbl.dim,
body[data-view="assembly"] #band, body[data-view="assembly"] #hover { display: none !important; }
body[data-view="assembly"] #canvas > canvas, body[data-view="assembly"].domain #canvas > canvas { display: block !important; }
body[data-view="assembly"] #canvas::after { display: block; }
body[data-view="assembly"] #canvas { cursor: default; }
.asm-status, .asm-caption, .asm-tray, .asm-tip, .asm-hud, .asm-strip, .asm-checks { display: none; position: absolute; z-index: 7; font: 400 var(--t-sm) var(--font-ui); color: var(--fg);
  background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--line-2); border-radius: var(--r2); backdrop-filter: blur(8px); }
body[data-view="assembly"] .asm-strip { display: flex; }
body[data-view="assembly"] .asm-status.on, body[data-view="assembly"] .asm-caption.on, body[data-view="assembly"] .asm-tray.on, body[data-view="assembly"] .asm-tip.on,
body[data-view="assembly"] .asm-hud.on, body[data-view="assembly"] .asm-checks.on { display: block; }
.asm-status { left: 12px; top: 12px; padding: 6px 10px; font: 400 var(--t-xs) var(--font-mono); color: var(--fg-2); display: none; align-items: center; gap: 8px; }
body[data-view="assembly"] .asm-status.on { display: flex; }
.asm-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.asm-status.busy .dot { background: var(--c-all); animation: asm-pulse 1.3s var(--ease) infinite; }
@keyframes asm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.asm-caption { left: 12px; top: 44px; max-width: min(520px, calc(100% - 140px)); padding: 8px 12px; color: var(--fg-2); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.asm-tray { right: 12px; top: 12px; padding: 8px 10px; min-width: 120px; }
.asm-tray b { display: block; font-size: var(--t-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.asm-tray .u { display: flex; align-items: center; gap: 6px; padding: 3px 0; font: 400 var(--t-xs) var(--font-mono); color: var(--c-wires); }
.asm-tray e-glyph { width: 14px; height: 14px; }
.asm-tip { pointer-events: none; padding: 5px 9px; font: 400 var(--t-xs) var(--font-mono); white-space: nowrap; border-left: 3px solid var(--tool); }
.asm-hud { right: 12px; bottom: 58px; padding: 10px 12px; font: 400 var(--t-xs) var(--font-mono); min-width: 220px; }
.asm-hud b { display: block; font: 600 var(--t-sm) var(--font-ui); margin-bottom: 6px; }
.asm-hud .j { display: block; color: var(--fg-2); padding: 1px 0; } .asm-hud .j.bad { color: var(--bad); }
.asm-strip { left: 12px; right: 12px; bottom: 12px; align-items: center; gap: 10px; padding: 6px 8px 6px 10px; flex-wrap: wrap; }
.asm-strip .counts { display: flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
.asm-strip .k { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border: 1px solid transparent; border-radius: var(--r1); background: none; color: var(--fg-2); font: 400 var(--t-xs) var(--font-mono); cursor: pointer; }
.asm-strip .k:hover { background: var(--raised); color: var(--fg); border-color: var(--line-2); }
.asm-strip .k e-glyph { width: 14px; height: 14px; color: var(--tool); }
.asm-strip .k b { font-weight: 600; } .asm-strip .k b.ok { color: var(--ok); } .asm-strip .k b.warn { color: var(--warn); } .asm-strip .k b.bad { color: var(--bad); } .asm-strip .k b.none { color: var(--faint); }
.asm-strip .msg { flex: 1 1 160px; min-width: 0; font: 400 var(--t-xs) var(--font-mono); color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asm-strip .msg.on { color: var(--fg); }
.asm-strip .acts { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.asm-strip .badge.compile { font: 400 var(--t-xs) var(--font-mono); color: var(--c-firmware); padding: 3px 8px; border: 1px solid color-mix(in srgb, var(--c-firmware) 45%, transparent); border-radius: 999px; }
.asm-strip .badge.compile.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.asm-strip .dd { position: relative; }
.asm-strip .dd .menu { display: none; position: absolute; right: 0; bottom: 30px; min-width: 130px; padding: 4px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r2); box-shadow: var(--shadow-2, 0 8px 24px rgba(0,0,0,.35)); }
.asm-strip .dd .menu.open { display: block; }
.asm-strip .dd .menu button { display: block; width: 100%; text-align: left; padding: 6px 8px; border: 0; background: none; color: var(--fg); font: 400 var(--t-sm) var(--font-ui); border-radius: var(--r1); cursor: pointer; }
.asm-strip .dd .menu button:hover { background: var(--raised); }
.asm-checks { left: 12px; bottom: 58px; width: min(520px, calc(100% - 24px)); max-height: 50%; overflow: auto; padding: 10px 12px; }
.asm-checks b { display: block; margin-bottom: 6px; } .asm-checks p { color: var(--muted); margin: 0; }
.asm-checks .c { display: flex; gap: 8px; align-items: baseline; padding: 4px 6px; border-radius: 6px; font: 400 var(--t-xs) var(--font-mono); cursor: pointer; }
.asm-checks .c:hover { background: var(--raised); }
.asm-checks .c.ok .m { color: var(--ok); } .asm-checks .c.warn .m { color: var(--warn); } .asm-checks .c.bad .m { color: var(--bad); }
.asm-checks .c .n { flex: none; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .asm-checks .c .v { color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#labels .lbl.asm-pin { background: color-mix(in srgb, var(--c-firmware) 22%, var(--panel)); border-color: color-mix(in srgb, var(--c-firmware) 60%, transparent); color: var(--c-firmware); font: 600 11px var(--font-mono); transform: translate(8px, -120%); }
#labels .lbl.asm-joint { background: color-mix(in srgb, var(--c-motion) 20%, var(--panel)); border-color: color-mix(in srgb, var(--c-motion) 60%, transparent); color: var(--c-motion); font: 600 11px var(--font-mono); transform: translate(10px, -50%); }
#labels .lbl.asm-target { background: var(--panel); color: var(--fg); font: 600 11px var(--font-mono); }
/* the file tabs: the Assembly tab in the workspace's neutral accent */
#filetabs [role="tab"].view e-glyph { color: var(--c-all); }
/* the record layout: the canvas alone at 1920×1080, with the strip and the status line (R toggles it) */
body.asm-record eitri-topbar, body.asm-record eitri-rail, body.asm-record footer.status, body.asm-record #filebar, body.asm-record #dock, body.asm-record #views, body.asm-record .viewcube-wrap { display: none !important; }
body.asm-record { grid-template-rows: 0 1fr 0 !important; grid-template-columns: 0 1fr !important; }
body.asm-record main.canvas { grid-template-columns: 1fr !important; grid-template-rows: 1fr !important; }
body.asm-record #canvas { position: fixed !important; inset: 0; width: 1920px; height: 1080px; max-width: 100vw; max-height: 100vh; margin: auto; }
body.asm-record .asm-strip { font-size: 15px; padding: 10px 14px; } body.asm-record .asm-strip .k { height: 32px; font-size: 14px; }
body.asm-record .asm-status { font-size: 14px; padding: 8px 12px; } body.asm-record .asm-caption { font-size: 15px; }

/* the work pill (static/js/work.js): a live counter while eitri works, then the design's real time and cost */
#workpill[hidden] { display: none; }
#workpill { font-variant-numeric: tabular-nums; color: var(--fg-2); cursor: default; }
#workpill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
#workpill.live { color: var(--fg); }
#workpill.live .dot { background: var(--ok); animation: workpulse 1.2s ease-in-out infinite; }
@keyframes workpulse { 50% { opacity: 0.3; } }

/* the Assembly view's layers (assembly.js): what is drawn over the solid geometry, toggled; "Geometry only" is one click */
.asm-strip button.small.on { border-color: var(--c-all); color: var(--fg); background: color-mix(in srgb, var(--c-all) 14%, transparent); }
.asm-strip .dd .menu.layers { min-width: 190px; }
.asm-strip .dd .menu .opt { display: flex; align-items: center; gap: 8px; }
.asm-strip .dd .menu .opt .box { width: 14px; height: 14px; flex: none; border: 1px solid var(--line-2); border-radius: 3px; background: var(--raised); display: inline-grid; place-items: center; }
.asm-strip .dd .menu .opt.on .box { background: var(--c-all); border-color: var(--c-all); }
.asm-strip .dd .menu .opt.on .box::after { content: ""; width: 7px; height: 4px; border: solid var(--bg); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.asm-strip .dd .menu .opt:focus-visible, .asm-strip button.small:focus-visible { outline: 2px solid var(--c-all); outline-offset: 1px; }
.asm-strip .dd .menu .sep { height: 1px; margin: 4px 2px; background: var(--line); }
body.asm-hide-motion #labels .lbl.asm-joint, body.asm-hide-motion #labels .lbl.asm-target, body.asm-hide-pins #labels .lbl.asm-pin { display: none !important; }
/* the account menu's "Guest access" tag (an invite link's guest) */
.menu .head .guest { display: inline-block; margin-left: 8px; color: var(--c-all, var(--fg-2)); border: 1px solid color-mix(in srgb, var(--c-all, var(--fg-2)) 45%, transparent); border-radius: 4px; padding: 0 5px; font: 400 var(--t-xs) var(--font-ui); }
