body[data-calc-embed] {
  color-scheme: light;
  --surface: #fffdfa;
  --ink: #29231d;
  --muted: #60574e;
  --bar-extra: 0px;
  font-family: system-ui, Arial, sans-serif;
  accent-color: var(--blue);
}

body[data-calc-embed="megomebel"] {
  --bg: #eee3d3;
  --bar: #3b2c22;
  --surface2: #f5eadb;
  --line: #d3c2ab;
  --red: #b8925f;
  --grey: #77573f;
  --blue: #765139;
  --blue-soft: #f1e4d2;
  --watermark: "MEGOMEBEL";
}

body[data-calc-embed="cao"] {
  --bg: #f6f4ef;
  --bar: #fffdfa;
  --surface2: #f2ede4;
  --line: #dcd4c8;
  --red: #9c7d52;
  --grey: #e3ddd1;
  --blue: #514638;
  --blue-soft: #eee6d9;
  --watermark: "ЦАО Мебель";
}

body[data-calc-embed] #logo {
  top: 41px;
  width: 215px;
  color: var(--blue);
  border-bottom: 2px solid var(--red);
  padding: 2px 0 7px;
  font: 600 25px/1.1 Georgia, serif;
}

[data-calc-embed="megomebel"] #logo { letter-spacing: .07em; }
[data-calc-embed="megomebel"] #bar .tabs,
[data-calc-embed="megomebel"] #pgW { display: none !important; }
[data-calc-embed="megomebel"] #bar .tbtn { background: #4e3a2c; border-color: #926e52; color: #fffdfa; }
[data-calc-embed="megomebel"] #zpct { color: #f4eadb; }
[data-calc-embed] #bar .tbtn { min-width: 0; }
[data-calc-embed] #bar .tbtn .ico { flex: 0 0 auto; }
[data-calc-embed] #jbtn .ico { display: inline; }
[data-calc-embed="cao"] #bar .tabs button { border-radius: 3px; }
[data-calc-embed="cao"] #bar .tabs button.act { background: var(--blue); color: #fff; }

[data-calc-embed] #stage .card { border-color: var(--line); border-radius: 6px; }
[data-calc-embed] #stage .card h3::before { background: var(--red); }
[data-calc-embed] table.m td.v.on { background: var(--blue-soft); }
[data-calc-embed] table.m.off td.v.on { background: #f1f1f1; }
[data-calc-embed] table.m tr.hd td.mod.on,
[data-calc-embed] .on > .cb,
[data-calc-embed] .on > .qb { background: var(--blue); border-color: var(--blue); }
[data-calc-embed] .mod.on > .cb { background: #fff; border-color: #fff; }
[data-calc-embed] .mod.on > .cb::after { border-color: var(--blue); }
[data-calc-embed] .hot.on { outline-color: var(--blue); background: transparent; }
[data-calc-embed] table.est tr.grand td,
[data-calc-embed] table.est tr.gr td { color: var(--blue); }
[data-calc-embed] .wm { display: grid; place-items: center; background-image: none; }
[data-calc-embed] .wm::after {
  content: var(--watermark);
  color: var(--blue);
  opacity: .14;
  transform: rotate(-18deg);
  font: 700 clamp(24px, 5vw, 58px)/1 Georgia, serif;
}

@media (max-width: 1080px) {
  [data-calc-embed="cao"]:has(#pgK.show) { --bar-extra: 36px; }
  [data-calc-embed="cao"] #bar { flex-wrap: wrap; align-content: center; row-gap: 2px; }
  [data-calc-embed="cao"] #zoom { order: 1; width: 100%; justify-content: center; }
  [data-calc-embed] #bar { height: calc(48px + var(--bar-extra) + env(safe-area-inset-top, 0px)); }
  [data-calc-embed] main { top: calc(48px + var(--bar-extra) + env(safe-area-inset-top, 0px)); }
  [data-calc-embed] :is(#jpanel, #apanel, #ppanel) { top: calc(54px + var(--bar-extra) + env(safe-area-inset-top, 0px)); }
}

@media (max-width: 560px) {
  [data-calc-embed="megomebel"] #bar .sp { display: none; }
  [data-calc-embed="megomebel"] #zoom { margin-right: auto; }
  [data-calc-embed="megomebel"] #zoom #kModeSeg { margin-right: 1px !important; }
  [data-calc-embed] #zoom #kModeSeg button { padding: 0 7px !important; }
}

@media (max-width: 340px) {
  body[data-calc-embed="megomebel"] { --bar-extra: 36px; }
  [data-calc-embed="megomebel"] #bar { flex-wrap: wrap; align-content: center; justify-content: flex-end; row-gap: 2px; }
  [data-calc-embed="megomebel"] #zoom { order: 1; width: 100%; justify-content: center; margin-right: 0; }
}
