/* Diário dos BNs — Laboratório de Construção Molecular 3D. Usa as variáveis do sistema visual (ds.css);
   a bancada e o painel sobre ela são sempre escuros (contraste para as estruturas). */
.cm-page { max-width: 1760px; margin: 0 auto; padding: 6px clamp(10px, 1.6vw, 22px) 44px; }
.cm-page .breadcrumbs { margin-bottom: 8px; }
.cm-body.cm-arrastando, .cm-body.cm-arrastando * { cursor: grabbing !important; user-select: none; }
.cm-body.cm-pegando .cm-palco canvas { cursor: copy; }

/* ---------- topo (primeira linha do laboratório) ---------- */
.cm-top { grid-area: topo; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; }
.cm-title { margin: 0 auto 0 0; font-size: clamp(1.15rem, 1.9vw, 1.6rem); white-space: nowrap; }
.cm-modos { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.cm-modos button { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 500 .88rem var(--font); white-space: nowrap; cursor: pointer; }
.cm-modos button:hover { color: var(--text); }
.cm-modos button[aria-selected="true"] { background: var(--ds-primary); color: var(--ds-primary-ink); }
.cm-modos button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cm-modos svg, .cm-btn svg, .cm-lateral button svg, .cm-painel-toggle svg, .cm-lado-x svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cm-top-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
#cm-tela-cheia .cm-tc-sair, #cm-tela-cheia[aria-pressed="true"] .cm-tc-entrar { display: none; }
#cm-tela-cheia[aria-pressed="true"] .cm-tc-sair { display: inline; }
html body .cm-page #cm-tela-cheia[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #15192a; }
html body .cm-page .cm-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text); font: 500 .9rem var(--font); cursor: pointer; }
html body .cm-page .cm-btn:hover { border-color: var(--text); }
html body .cm-page .cm-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
html body .cm-page .cm-btn-accent { background: var(--ds-primary); color: var(--ds-primary-ink); border-color: var(--ds-primary); }
.cm-menu-wrap { position: relative; }
.cm-menu { position: absolute; z-index: 60; right: 0; top: calc(100% + 6px); width: min(380px, 92vw); max-height: min(70vh, 640px); overflow: auto; padding: 8px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--panel, var(--surface)); box-shadow: 0 18px 44px rgba(0, 0, 0, .35); }
.cm-menu[hidden] { display: none; }
.cm-menu-largo { width: min(560px, 94vw); }
.cm-menu-t { margin: 8px 6px 4px; color: var(--muted); font: 600 .72rem var(--font); letter-spacing: .06em; text-transform: uppercase; }
.cm-menu-t:first-child { margin-top: 2px; }
.cm-menu-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 3px; }
.cm-menu button { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.cm-menu-grade button { display: grid; gap: 1px; }
.cm-menu button:hover, .cm-menu button:focus-visible { background: color-mix(in srgb, var(--text) 8%, transparent); outline: none; }
.cm-menu b { font-weight: 600; font-size: .9rem; }
.cm-menu small { display: block; color: var(--muted); font-size: .74rem; line-height: 1.3; }
.cm-exp-n { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--text); font: 600 .8rem var(--mono); }

/* ---------- laboratório: tabela (esquerda) · bancada (centro) · ferramentas e propriedades (direita) ---------- */
.cm-lab {
  --alt: clamp(600px, calc(100dvh - var(--header-h, 68px) - 56px), 1040px);
  --esq: clamp(300px, 23vw, 400px); --dir: clamp(290px, 22vw, 370px);
  display: grid; grid-template-columns: var(--esq) minmax(0, 1fr) var(--dir); grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "topo topo topo" "tabela palco lateral"; gap: 10px 12px; height: var(--alt); min-height: 0;
}
.cm-lab[data-tabela="recolhida"] { --esq: 58px; }

/* tabela lateral (sempre à esquerda; recolhida vira uma coluna com os elementos mais usados) */
.cm-tabela-painel { grid-area: tabela; display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; padding: 8px 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overscroll-behavior: contain; }
.cm-lado-cab { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 34px; }
.cm-lado-t { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
html body .cm-page .cm-lado-x { display: grid; place-items: center; flex: none; width: 34px; height: 34px; min-height: 34px !important; padding: 0; border: 1px solid var(--line-strong); border-radius: 9px; background: transparent; color: var(--text); cursor: pointer; }
.cm-lado-x:hover { border-color: var(--gold); color: var(--gold); }
.cm-lado-x:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.cm-lado-x svg { transition: transform .2s; }
.cm-tabela-corpo { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.cm-lab[data-tabela="recolhida"] .cm-tabela-painel { padding: 8px 6px; align-items: center; }
.cm-lab[data-tabela="recolhida"] .cm-tabela-corpo, .cm-lab[data-tabela="recolhida"] .cm-lado-t { display: none; }
.cm-lab[data-tabela="recolhida"] .cm-lado-cab { justify-content: center; }
.cm-lab[data-tabela="recolhida"] .cm-lado-x svg { transform: rotate(180deg); }
.cm-lab[data-tabela="recolhida"] .cm-rapidos { flex-direction: column; flex-wrap: nowrap; }
.cm-info-add { margin-top: 8px; }
.cm-busca { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.cm-busca input, .cm-busca select { min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--text); font: 400 .86rem var(--font); }
.cm-busca select { max-width: 150px; }
.cm-busca input:focus-visible, .cm-busca select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.cm-busca-n { grid-column: 1 / -1; color: var(--muted); font-size: .72rem; min-height: 0; }
.cm-busca-n:empty { display: none; }
.cm-rapidos { display: flex; flex-wrap: wrap; gap: 4px; }
.cm-tabela { --c: minmax(19px, 1fr); display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); grid-template-rows: repeat(7, auto) 7px repeat(2, auto); gap: 2px; }
.cm-el { position: relative; display: grid; place-items: center; min-width: 0; overflow: hidden; aspect-ratio: 1 / 1.1; padding: 0; border: 1px solid color-mix(in srgb, var(--el) 55%, var(--line)); border-radius: 4px; background: color-mix(in srgb, var(--el) 24%, var(--surface)); color: var(--text); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; font: inherit; transition: transform .12s, box-shadow .12s, opacity .15s; }
.cm-el b { font: 600 clamp(.5rem, .72vw, .64rem) var(--font); line-height: 1; letter-spacing: -.02em; }
.cm-el small { position: absolute; top: 1px; left: 2px; font: 400 .42rem var(--mono); color: var(--muted); line-height: 1; }
.cm-el:hover, .cm-el:focus-visible { z-index: 2; transform: scale(1.4); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); outline: none; border-color: var(--el); }
.cm-el:focus-visible { box-shadow: 0 0 0 2px var(--gold), 0 4px 14px rgba(0, 0, 0, .35); }
.cm-el.is-apagado { opacity: .18; }
.cm-el.is-pego { box-shadow: 0 0 0 2px var(--gold); background: color-mix(in srgb, var(--el) 50%, var(--surface)); }
html body .cm-page .cm-el { min-height: 0 !important; min-width: 0; } /* tabela densa: os botões “mais usados” acima são os alvos grandes */
html body .cm-page .cm-el-rapido { width: 40px; min-height: 40px !important; aspect-ratio: 1; }
.cm-el-rapido b { font-size: .78rem; }
.cm-el-rapido:hover, .cm-el-rapido:focus-visible { transform: scale(1.1); }
.cm-el-serie { display: grid; place-items: center; font: 400 .44rem var(--mono); color: var(--muted); border: 1px dashed var(--line); border-radius: 4px; }
.cm-info-el { min-height: 132px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--bg) 55%, var(--surface)); }
.cm-info-vazio { margin: 0; color: var(--muted); font-size: .84rem; }
.cm-info-topo { display: flex; align-items: center; gap: 10px; }
.cm-info-topo b { display: block; font-size: 1rem; }
.cm-info-topo small { color: var(--muted); font-size: .76rem; }
.cm-info-bola, .cm-bola { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--el) 30%, #fff) 0%, var(--el) 42%, color-mix(in srgb, var(--el) 50%, #000) 100%); color: #10131a; font: 700 .9rem var(--font); text-shadow: 0 0 3px rgba(255, 255, 255, .6); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .25); }
.cm-bola { width: 30px; height: 30px; font-size: .74rem; }
.cm-info-dados { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 10px 0 6px; }
.cm-info-dados div { min-width: 0; }
.cm-info-dados dt { color: var(--muted); font-size: .68rem; line-height: 1.2; }
.cm-info-dados dd { margin: 1px 0 0; font: 500 .86rem var(--mono); }
.cm-info-comp { margin: 0; color: var(--text); font-size: .8rem; line-height: 1.4; opacity: .9; }
.cm-dica { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.4; }

/* bancada */
.cm-palco { grid-area: palco; position: relative; overflow: hidden; min-height: 0; height: 100%; border: 1px solid rgba(160, 175, 200, .16); border-radius: 18px; background: #16181c; color: #e7ebf2; isolation: isolate; }
.cm-palco canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; outline: none; }
.cm-palco canvas.is-sobre { cursor: pointer; }
.cm-palco canvas:active { cursor: grabbing; }
.cm-palco canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }
.cm-rotulos { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.cm-rot { position: absolute; left: 0; top: 0; color: #fff; font: 600 .72rem var(--font); white-space: nowrap; text-shadow: 0 0 3px #000, 0 1px 4px rgba(0, 0, 0, .9); transition: opacity .2s; }
.cm-rot.is-at { font-size: .78rem; }
.cm-rot.is-sel { color: #ffe3a3; }
.cm-rot.is-ion { color: #fff; }
.cm-rot.is-ang { padding: 1px 6px; border-radius: 6px; background: rgba(12, 14, 20, .78); color: #ffd98a; font: 600 .74rem var(--mono); text-shadow: none; border: 1px solid rgba(255, 210, 120, .4); }
.cm-rot.is-dmais { color: #8fb8ff; font: 600 .72rem var(--mono); }
.cm-rot.is-dmenos { color: #ff9a8a; font: 600 .72rem var(--mono); }
.cm-rot.is-eletron { padding: 0 5px; border-radius: 6px; background: rgba(40, 110, 200, .5); color: #dff1ff; font: 600 .72rem var(--mono); }

/* coluna direita: ferramentas, exibição e propriedades (sempre escura, como a bancada) */
.cm-lateral { grid-area: lateral; display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: hidden; padding: 8px; border: 1px solid rgba(160, 175, 200, .16); border-radius: 16px; background: #16181c; color: #e7ebf2; }
.cm-grupo { flex: none; display: grid; gap: 6px; padding: 8px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; background: rgba(255, 255, 255, .025); }
.cm-grupo-t { margin: 0 2px; color: #94a0b6; font: 600 .68rem var(--font); letter-spacing: .08em; text-transform: uppercase; }
.cm-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 2px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.cm-seg button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; padding: 4px 2px; border: 0; border-radius: 8px; background: transparent; color: #b9c2d3; font: 500 .72rem var(--font); line-height: 1.1; text-align: center; cursor: pointer; }
.cm-seg button:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.cm-seg button[aria-pressed="true"] { background: rgba(245, 195, 92, .18); color: #ffe3a3; }
.cm-icones, .cm-camera { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
.cm-camera { grid-template-columns: repeat(4, minmax(0, 1fr)); }
html body .cm-page .cm-ic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: auto; min-height: 46px !important; padding: 4px 2px; border: 0; border-radius: 9px; background: transparent; color: #c9d1df; font: 500 .66rem var(--font); line-height: 1.1; cursor: pointer; }
.cm-ic:hover:not(:disabled) { background: rgba(255, 255, 255, .08); color: #fff; }
.cm-ic:disabled { opacity: .3; cursor: default; }
.cm-exibir { display: flex; flex-wrap: wrap; gap: 4px; }
.cm-exibir button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 9px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px; background: transparent; color: #b9c2d3; font: 500 .76rem var(--font); cursor: pointer; }
.cm-exibir button svg { width: 15px; height: 15px; }
.cm-exibir button:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }
.cm-exibir button[aria-pressed="true"] { color: #fff; border-color: rgba(245, 195, 92, .5); background: rgba(245, 195, 92, .1); }
.cm-exibir button[aria-pressed="false"] { opacity: .7; }
.cm-exibir #cm-estilo[aria-pressed] { opacity: 1; border-color: rgba(255, 255, 255, .2); background: transparent; }
.cm-exibir #cm-vista[aria-pressed="true"] { background: rgba(245, 195, 92, .18); color: #ffe3a3; opacity: 1; }
.cm-so-pol, .cm-so-forcas { display: none !important; }
.cm-lab[data-modo="polaridade"] .cm-so-pol, .cm-lab[data-modo="forcas"] .cm-so-forcas { display: inline-flex !important; }
.cm-lateral button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.cm-sep { display: none; }
.cm-marquee { position: absolute; z-index: 2; border: 1px dashed #ffd98a; background: rgba(255, 210, 120, .08); pointer-events: none; }
.cm-marquee[hidden] { display: none; }
.cm-vazio { position: absolute; z-index: 1; left: 50%; top: 46%; transform: translate(-50%, -50%); width: min(380px, 80%); text-align: center; color: #aeb7c8; pointer-events: none; }
.cm-vazio[hidden] { display: none; }
.cm-vazio p { margin: 0; font-size: .92rem; line-height: 1.5; }
.cm-vazio b { display: block; color: #e7ebf2; font-size: 1.05rem; margin-bottom: 4px; }

/* aviso, toast, popover */
.cm-aviso { position: absolute; z-index: 5; left: 50%; top: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100% - 24px)); padding: 8px 8px 8px 14px; border: 1px solid rgba(245, 195, 92, .45); border-radius: 12px; background: rgba(28, 24, 14, .92); }
.cm-aviso[hidden] { display: none; }
.cm-aviso p { margin: 0; font-size: .84rem; line-height: 1.35; color: #ffe9bd; }
.cm-aviso-x { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: #c9b58a; font-size: 1.25rem; cursor: pointer; }
.cm-toast { position: absolute; z-index: 6; left: 50%; bottom: 14px; transform: translate(-50%, 10px); max-width: min(560px, calc(100% - 24px)); padding: 9px 14px; border: 1px solid rgba(170, 190, 230, .22); border-radius: 12px; background: rgba(14, 16, 22, .94); color: #e3e9f3; font-size: .85rem; line-height: 1.4; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.cm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.cm-toast.is-erro { border-color: rgba(255, 130, 110, .55); color: #ffd6cc; }
.cm-toast.is-ok { border-color: rgba(120, 220, 160, .5); color: #d4f7e1; }
.cm-pop { position: absolute; z-index: 8; left: 0; top: 0; width: min(330px, calc(100% - 16px)); padding: 10px; border: 1px solid rgba(245, 195, 92, .4); border-radius: 14px; background: rgba(16, 18, 24, .97); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: cm-pop .16s ease-out; }
.cm-pop[hidden] { display: none; }
@keyframes cm-pop { from { opacity: 0; } }
.cm-pop-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cm-pop-cab b { font-size: .95rem; color: #ffe3a3; }
.cm-pop-x { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: #a9b4c8; font-size: 1.3rem; cursor: pointer; }
.cm-pop-x:hover { color: #fff; }
.cm-pop-ops { display: grid; gap: 4px; }
.cm-pop-op { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; background: rgba(255, 255, 255, .03); color: #e7ebf2; text-align: left; font: inherit; cursor: pointer; }
.cm-pop-op:hover, .cm-pop-op:focus-visible { border-color: rgba(245, 195, 92, .6); background: rgba(245, 195, 92, .1); outline: none; }
.cm-pop-op.is-atual { opacity: .55; cursor: default; }
.cm-pop-op.is-perigo b { color: #ffb4a6; }
.cm-pop-op b { display: block; font-size: .88rem; font-weight: 600; }
.cm-pop-op em { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(120, 220, 160, .16); color: #a8efc4; font: 600 .66rem var(--font); font-style: normal; letter-spacing: .02em; }
.cm-pop-op small { display: block; color: #a9b4c8; font-size: .76rem; line-height: 1.35; }
.cm-pop-aviso { margin: 4px 0; color: #ffd6a6; font-size: .84rem; line-height: 1.45; }
.cm-pop-det { margin-top: 8px; font-size: .78rem; color: #aeb7c8; }
.cm-pop-det summary { cursor: pointer; color: #c9d1df; }
.cm-pop-det ul { margin: 6px 0 0; padding-left: 16px; display: grid; gap: 4px; line-height: 1.4; }
.cm-pop-det b { color: #dfe5ef; font-weight: 600; }
.cm-op-ic { position: relative; flex: none; width: 34px; height: 22px; }
.cm-op-ic::before, .cm-op-ic::after { content: ""; position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: #c8ced8; }
.cm-op-ic::before { left: 0; } .cm-op-ic::after { right: 0; }
.cm-op-covalente { background: linear-gradient(#c8ced8, #c8ced8) center / 18px 2px no-repeat; }
.cm-op-covalente.o2 { background: linear-gradient(#c8ced8, #c8ced8) center calc(50% - 3px) / 18px 2px no-repeat, linear-gradient(#c8ced8, #c8ced8) center calc(50% + 3px) / 18px 2px no-repeat; }
.cm-op-covalente.o3 { background: linear-gradient(#c8ced8, #c8ced8) center calc(50% - 5px) / 18px 2px no-repeat, linear-gradient(#c8ced8, #c8ced8) center / 18px 2px no-repeat, linear-gradient(#c8ced8, #c8ced8) center calc(50% + 5px) / 18px 2px no-repeat; }
.cm-op-ionica { background: radial-gradient(circle, rgba(255, 210, 140, .7) 1px, transparent 1.6px) center / 4px 4px repeat-x; }
.cm-op-ionica::before { background: #ff9a6a; } .cm-op-ionica::after { background: #7ab0ff; }
.cm-op-metalica { border-radius: 8px; background: radial-gradient(circle at 50% 50%, rgba(110, 180, 255, .45), transparent 70%); }
.cm-op-remover::before, .cm-op-remover::after, .cm-op-desfazer-ionica::before, .cm-op-desfazer-ionica::after { background: #8a93a3; }

/* painel de propriedades, geometria e polaridade (coluna direita) */
.cm-painel { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; background: rgba(255, 255, 255, .02); }
.cm-painel.is-fechado { flex: none; }
.cm-painel.is-fechado .cm-painel-corpo { display: none; }
.cm-painel.is-fechado .cm-painel-toggle svg { transform: rotate(-90deg); }
html body .cm-page .cm-painel-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px !important; padding: 0 10px; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .07); background: transparent; color: #c9d1df; font: 600 .7rem var(--font); letter-spacing: .07em; text-align: left; text-transform: uppercase; cursor: pointer; }
.cm-painel-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 12px; }
.cm-painel-corpo { flex: 1; min-height: 0; overflow: auto; padding: 2px 10px 12px; overscroll-behavior: contain; }
.cm-p-sec { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.cm-p-sec:last-child { border-bottom: 0; }
.cm-p-sec h3 { margin: 0; font-size: 1.02rem; color: #f2f4f8; }
.cm-p-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cm-p-cab p { margin: 1px 0 0; color: #a9b4c8; font-size: .78rem; }
.cm-p-cab-mol { justify-content: space-between; align-items: flex-start; }
.cm-p-formula { color: #ffe3a3 !important; font: 600 .95rem var(--mono) !important; }
.cm-p-kicker { margin: 0 0 2px !important; color: #ffd98a !important; font: 600 .68rem var(--font) !important; letter-spacing: .08em; text-transform: uppercase; }
.cm-p-ion { color: #ffe3a3; font: 600 .9rem var(--mono); }
.cm-p-sub { margin: 12px 0 6px !important; font-size: .78rem !important; color: #a9b4c8 !important; letter-spacing: .05em; text-transform: uppercase; }
.cm-p-dados { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 8px 0; }
.cm-p-dados div { min-width: 0; }
.cm-p-dados dt { color: #94a0b6; font-size: .7rem; line-height: 1.2; }
.cm-p-dados dd { margin: 2px 0 0; color: #eef1f6; font: 500 .84rem var(--font); line-height: 1.3; }
.cm-p-dados small { color: #94a0b6; font-size: .72rem; }
.cm-p-estado { margin: 6px 0; padding: 7px 10px; border-radius: 9px; background: rgba(255, 255, 255, .045); color: #dfe5ef; font-size: .8rem; line-height: 1.4; }
.cm-p-alerta { margin: 6px 0; padding: 8px 10px; border-left: 3px solid #f5c35c; border-radius: 6px; background: rgba(245, 195, 92, .09); color: #ffe6b3; font-size: .8rem; line-height: 1.45; }
.cm-p-nota { margin: 6px 0; color: #aeb7c8; font-size: .78rem; line-height: 1.5; }
.cm-p-nota-lib { padding: 7px 10px; border-radius: 9px; background: rgba(120, 170, 255, .08); color: #cfdcf3; }
.cm-p-svg { margin: 4px 0 2px; border-radius: 10px; background: rgba(255, 255, 255, .03); }
.cm-p-acoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cm-pbtn { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; background: rgba(255, 255, 255, .04); color: #e3e9f3; font: 500 .78rem var(--font); cursor: pointer; }
.cm-pbtn:hover { border-color: rgba(255, 255, 255, .4); color: #fff; }
.cm-pbtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.cm-pbtn.is-destaque { border-color: rgba(245, 195, 92, .6); background: rgba(245, 195, 92, .16); color: #ffe3a3; }
.cm-pbtn.is-perigo { color: #ffb4a6; border-color: rgba(255, 140, 120, .3); }
.cm-pbtn.is-chip { min-height: 28px; padding: 0 9px; font-family: var(--mono); }
.cm-pbtn.is-chip[aria-pressed="true"] { background: rgba(245, 195, 92, .2); border-color: rgba(245, 195, 92, .7); color: #ffe3a3; }
.cm-p-escolha { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; color: #a9b4c8; font-size: .78rem; }
.cm-p-escolha select { min-height: 30px; padding: 0 8px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 8px; background: #1d2028; color: #e7ebf2; font: inherit; }
.cm-badge { flex: none; padding: 3px 9px; border-radius: 999px; font: 600 .68rem var(--font); letter-spacing: .02em; white-space: nowrap; }
.cm-badge.is-ok { background: rgba(110, 210, 150, .15); color: #9fe8bd; }
.cm-badge.is-aviso { background: rgba(245, 195, 92, .16); color: #ffdb94; }
.cm-badge.is-erro { background: rgba(255, 120, 100, .16); color: #ffb3a4; }
.cm-badge.is-neutro { background: rgba(255, 255, 255, .07); color: #c9d1df; }
.cm-chip { margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); color: #c9d1df; font: 500 .7rem var(--mono); }
.cm-p-geos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cm-p-geo > div { display: flex; align-items: center; gap: 8px; color: #f2f4f8; font-size: .88rem; }
.cm-p-geo ul { margin: 4px 0 0 38px; padding: 0; list-style: none; color: #b8c2d6; font-size: .76rem; line-height: 1.5; }
.cm-p-geo ul b { color: #ffd98a; font-family: var(--mono); font-weight: 600; }
.cm-p-geo small { color: #8f9ab0; }
.cm-pol-polar { color: #ffd98a; } .cm-pol-apolar { color: #9fd0ff; }
.cm-p-lig { position: relative; width: 24px; height: 12px; }
.cm-p-lig-covalente { background: linear-gradient(#c8ced8, #c8ced8) center / 100% 2px no-repeat; }
.cm-p-lig-covalente.o2 { background: linear-gradient(#c8ced8, #c8ced8) center calc(50% - 3px) / 100% 2px no-repeat, linear-gradient(#c8ced8, #c8ced8) center calc(50% + 3px) / 100% 2px no-repeat; }
.cm-p-lig-covalente.o3 { background: linear-gradient(#c8ced8, #c8ced8) center calc(50% - 4px) / 100% 2px no-repeat, linear-gradient(#c8ced8, #c8ced8) center / 100% 2px no-repeat, linear-gradient(#c8ced8, #c8ced8) center calc(50% + 4px) / 100% 2px no-repeat; }
.cm-p-lig-ionica { background: radial-gradient(circle, rgba(255, 210, 140, .8) 1px, transparent 1.6px) center / 4px 4px repeat-x; }
.cm-ions { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.cm-ionchip { padding: 3px 9px; border-radius: 999px; font: 600 .82rem var(--mono); }
.cm-ionchip.is-cat { background: rgba(255, 150, 100, .14); color: #ffc7a8; }
.cm-ionchip.is-an { background: rgba(110, 160, 255, .14); color: #b8d2ff; }
.cm-p-inicio h3 { margin-bottom: 8px; }
.cm-p-passos { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 6px; color: #c9d1df; font-size: .84rem; line-height: 1.45; }
.cm-p-passos b { color: #ffe3a3; }
.cm-p-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.cm-p-lista button { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: #e3e9f3; text-align: left; font: inherit; cursor: pointer; }
.cm-p-lista button:hover, .cm-p-lista button:focus-visible { background: rgba(255, 255, 255, .06); outline: none; }
.cm-p-lista b { font: 600 .86rem var(--mono); color: #ffe3a3; }
.cm-p-lista span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #a9b4c8; font-size: .78rem; }
.cm-p-ponto { width: 8px; height: 8px; border-radius: 50%; background: #8a93a3; }
.cm-p-ponto.is-ok { background: #6fdc9b; } .cm-p-ponto.is-aviso { background: #f5c35c; }
.cm-imf-leg { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 5px; }
.cm-imf-leg li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: .82rem; color: #dfe5ef; }
.cm-imf-leg b { font: 600 .82rem var(--mono); color: #ffe3a3; }
.cm-imf-dot { display: inline-block; width: 22px; height: 0; border-top: 2px dashed; margin-right: 6px; vertical-align: middle; }
.cm-imf-dot.is-lig-h { color: #4cf2d9; border-top-width: 3px; }
.cm-imf-dot.is-dipolo { color: #d98cff; }
.cm-imf-dot.is-ion-dipolo { color: #ffa64d; }
.cm-imf-dot.is-london { color: #c9cde8; border-top-style: dotted; }
.cm-p-tabela-wrap { overflow-x: auto; margin: 8px 0; }
.cm-p-tabela { width: 100%; border-collapse: collapse; font-size: .74rem; }
.cm-p-tabela th, .cm-p-tabela td { padding: 5px 4px; border-bottom: 1px solid rgba(255, 255, 255, .07); text-align: left; color: #dfe5ef; white-space: nowrap; }
.cm-p-tabela thead th { color: #94a0b6; font-weight: 500; }
.cm-p-tabela tbody th { font: 600 .8rem var(--mono); color: #ffe3a3; }
.cm-p-x { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: #a9b4c8; font-size: 1.3rem; cursor: pointer; }
.cm-p-prog { height: 6px; margin: 8px 0; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.cm-p-prog span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f5c35c, #6fdc9b); transition: width .4s; }
.cm-p-check { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.cm-p-check li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: start; }
.cm-p-check li > span { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; color: #a9b4c8; font: 600 .72rem var(--mono); }
.cm-p-check li.is-feito > span { border-color: #6fdc9b; background: rgba(110, 220, 155, .18); color: #9fe8bd; }
.cm-p-check p { margin: 1px 0 0; color: #dfe5ef; font-size: .82rem; line-height: 1.45; }
.cm-p-check li.is-feito p { color: #a9b4c8; }
.cm-p-det { margin: 8px 0; font-size: .8rem; color: #c9d1df; }
.cm-p-det summary { cursor: pointer; color: #ffe3a3; font-weight: 600; }
.cm-p-det ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 5px; line-height: 1.45; }
.cm-p-concl { margin: 10px 0; padding: 10px 12px; border: 1px solid rgba(110, 220, 155, .35); border-radius: 10px; background: rgba(110, 220, 155, .08); }
.cm-p-concl b { color: #9fe8bd; font-size: .84rem; }
.cm-p-concl p { margin: 4px 0 0; color: #dfeee6; font-size: .8rem; line-height: 1.5; }

/* fórmula estrutural */
.cm-estrutural { display: block; width: 100%; height: auto; }
.cm-e-lig { stroke: #c8d0dd; stroke-width: 1.7; stroke-linecap: round; }
.cm-e-cunha { fill: #c8d0dd; }
.cm-e-hash { stroke: #c8d0dd; stroke-width: 1.3; }
.cm-e-at { fill: color-mix(in srgb, var(--el) 55%, #fff); font: 700 13px var(--font); text-anchor: middle; paint-order: stroke; stroke: #14161b; stroke-width: 3px; }
.cm-e-carga { fill: #ffe3a3; font: 700 9px var(--mono); text-anchor: middle; }
.cm-e-par { fill: #9fc4ff; }

/* vista 2D */
.cm-2d { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; background: rgba(14, 16, 20, .97); }
.cm-2d[hidden] { display: none; }
.cm-2d-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.cm-2d-cab b { color: #f2f4f8; }
.cm-2d-cab span { flex: 1; min-width: 200px; color: #a9b4c8; font-size: .8rem; }
.cm-2d-grade { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); align-content: start; gap: 12px; padding: 16px; }
.cm-2d-cartao { display: grid; gap: 2px; padding: 10px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: rgba(255, 255, 255, .03); color: #e7ebf2; text-align: center; font: inherit; cursor: pointer; }
.cm-2d-cartao:hover, .cm-2d-cartao:focus-visible { border-color: rgba(245, 195, 92, .6); outline: none; }
.cm-2d-cartao span { color: #ffe3a3; font: 600 .86rem var(--mono); }
.cm-2d-vazio, .cm-2d-nota { grid-column: 1 / -1; margin: 0; color: #a9b4c8; font-size: .86rem; }
.cm-nogl { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; padding: 24px; background: #16181c; text-align: center; }
.cm-nogl[hidden] { display: none; }
.cm-nogl p { max-width: 420px; color: #dfe5ef; }

/* átomo sendo arrastado fora da bancada */
.cm-fantasma { position: fixed; z-index: 100; left: 0; top: 0; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--el) 30%, #fff) 0%, var(--el) 42%, color-mix(in srgb, var(--el) 50%, #000) 100%); color: #10131a; font: 700 .95rem var(--font); text-shadow: 0 0 3px rgba(255, 255, 255, .7); box-shadow: 0 8px 22px rgba(0, 0, 0, .45); pointer-events: none; }
.cm-fantasma[hidden] { display: none; }

/* sobre o modelo */
.cm-sobre { margin-top: 22px; }
.cm-sobre h2 { margin: 0 0 10px; font-size: 1.15rem; }
.cm-sobre-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.cm-sobre-grade p { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: .86rem; line-height: 1.55; }
.cm-sobre-grade b { color: var(--text); }

/* ---------- tela cheia: o laboratório ocupa a tela (API do navegador ou só CSS) ---------- */
.cm-lab.is-tela-cheia, .cm-lab:fullscreen {
  position: fixed; inset: 0; z-index: 5000; width: 100%; max-width: none; height: 100dvh; margin: 0;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: var(--bg); overflow: hidden;
}
.cm-lab:fullscreen::backdrop { background: var(--bg); }
.cm-lab.is-tela-cheia .cm-title { font-size: 1.05rem; }
html.cm-tela-cheia, html.cm-tela-cheia body { overflow: hidden !important; }
html.cm-tela-cheia .site-header, html.cm-tela-cheia .site-footer, html.cm-tela-cheia .nav2-migalhas, html.cm-tela-cheia .cm-sobre, html.cm-tela-cheia .a11y-launcher, html.cm-tela-cheia .ds-progress { visibility: hidden; }

/* ---------- telas menores ---------- */
@media (max-width: 1280px) {
  .cm-lab { --dir: 290px; }
  .cm-modos button { padding: 0 11px; }
}
/* tablet: a tabela continua à esquerda; ferramentas e propriedades descem para baixo da bancada */
@media (max-width: 1100px) {
  .cm-lab { --esq: min(300px, 38vw); height: auto; grid-template-columns: var(--esq) minmax(0, 1fr); grid-template-rows: auto clamp(440px, 66dvh, 720px) auto; grid-template-areas: "topo topo" "tabela palco" "lateral lateral"; }
  .cm-lab[data-tabela="recolhida"] { --esq: 58px; }
  .cm-lateral { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; overflow: visible; }
  .cm-lateral .cm-painel { grid-column: 1 / -1; max-height: 620px; }
  .cm-lab.is-tela-cheia, .cm-lab:fullscreen { grid-template-rows: auto minmax(0, 1fr) minmax(150px, 34dvh); }
  .cm-lab.is-tela-cheia .cm-lateral, .cm-lab:fullscreen .cm-lateral { overflow: auto; align-content: start; }
  .cm-lab.is-tela-cheia .cm-lateral .cm-painel, .cm-lab:fullscreen .cm-lateral .cm-painel { max-height: none; }
}
/* celular: coluna estreita com os elementos mais usados; a tabela completa abre abaixo da bancada */
@media (max-width: 760px) {
  .cm-lab, .cm-lab[data-tabela="recolhida"] { --esq: 54px; grid-template-rows: auto clamp(360px, 62dvh, 620px) auto; }
  .cm-lab[data-tabela="aberta"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto clamp(320px, 52dvh, 560px) auto auto; grid-template-areas: "topo" "palco" "tabela" "lateral"; }
  .cm-lab[data-tabela="aberta"] .cm-rapidos { flex-direction: row; flex-wrap: wrap; }
  .cm-tabela-painel { max-height: none; }
  .cm-lab[data-tabela="recolhida"] .cm-tabela-painel { padding: 6px 4px; }
  html body .cm-page .cm-lab[data-tabela="recolhida"] .cm-el-rapido { width: 42px; min-height: 42px !important; }
  .cm-lateral { grid-template-columns: minmax(0, 1fr); }
  .cm-title { flex-basis: 100%; }
  .cm-top-acoes { width: 100%; }
  .cm-top-acoes .cm-btn span { white-space: nowrap; }
  .cm-modos { width: 100%; }
  .cm-modos button { flex: 1 0 auto; justify-content: center; padding: 0 10px; font-size: .8rem; }
  .cm-toast { bottom: 10px; }
  .cm-lab.is-tela-cheia, .cm-lab:fullscreen { grid-template-rows: auto minmax(0, 1fr) minmax(150px, 38dvh); grid-template-columns: var(--esq) minmax(0, 1fr); grid-template-areas: "topo topo" "tabela palco" "lateral lateral"; }
  .cm-lab.is-tela-cheia[data-tabela="aberta"], .cm-lab:fullscreen[data-tabela="aberta"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) minmax(170px, 42dvh); grid-template-areas: "topo" "palco" "tabela"; }
  .cm-lab.is-tela-cheia[data-tabela="aberta"] .cm-lateral, .cm-lab:fullscreen[data-tabela="aberta"] .cm-lateral { display: none; }
  .cm-lab.is-tela-cheia .cm-title, .cm-lab:fullscreen .cm-title { display: none; }
  .cm-lab.is-tela-cheia .cm-top-acoes .cm-btn span, .cm-lab:fullscreen .cm-top-acoes .cm-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cm-lab.is-tela-cheia #cm-tela-cheia span, .cm-lab:fullscreen #cm-tela-cheia span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .cm-el, .cm-toast, .cm-p-prog span { transition: none; }
  .cm-pop { animation: none; }
}
