.ce-solution-viewer {
  --cesv-blue: #18398a;
  --cesv-line: #cbd5e1;
  --cesv-surface: #ffffff;
  --cesv-text: #0f172a;
  --cesv-muted: #64748b;
  width: 100%;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--cesv-line);
  border-radius: 14px;
  background: var(--cesv-surface);
  color: var(--cesv-text);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .1);
  font: 13px/1.35 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.ce-solution-viewer.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  width: auto;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background: #e9eef5;
}
.ce-solution-viewer__bar {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--cesv-line);
  background: color-mix(in srgb, var(--cesv-surface) 94%, #dbeafe);
}
.ce-solution-viewer.is-fullscreen .ce-solution-viewer__bar {
  position: sticky;
  top: 0;
  z-index: 3;
  flex: 0 0 auto;
}
.ce-solution-viewer__title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.ce-solution-viewer__page { color: var(--cesv-muted); white-space: nowrap; }
.ce-solution-viewer button {
  min-width: 34px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--cesv-line);
  border-radius: 8px;
  background: var(--cesv-surface);
  color: var(--cesv-text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
}
.ce-solution-viewer button:hover { border-color: #2563eb; }
.ce-solution-viewer button:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: 1px; }
.ce-solution-viewer button:disabled { opacity: .42; cursor: default; }
.ce-solution-viewer__viewport {
  position: relative;
  width: 100%;
  height: 420px;
  min-height: 280px;
  overflow: hidden;
  background: #e9eef5;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.ce-solution-viewer.is-fullscreen .ce-solution-viewer__viewport { flex: 0 0 auto; }
.ce-solution-viewer__viewport.is-panning { cursor: grabbing; }
.ce-solution-viewer__canvas { display: block; width: 100%; height: 100%; }
.ce-solution-viewer__status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: #475569;
  background: rgba(241, 245, 249, .88);
}
.ce-solution-viewer__status[hidden] { display: none; }
.ce-solution-viewer__tip {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: 11px;
  pointer-events: none;
  transition: opacity .25s;
}
.ce-solution-viewer.has-interacted .ce-solution-viewer__tip { opacity: 0; }
body.dark-mode .ce-solution-viewer,
html[data-theme="dark"] .ce-solution-viewer {
  --cesv-line: #475569;
  --cesv-surface: #1e293b;
  --cesv-text: #e2e8f0;
  --cesv-muted: #cbd5e1;
}
@media (max-width: 640px) {
  .ce-solution-viewer { border-radius: 10px; }
  .ce-solution-viewer__bar { flex-wrap: wrap; }
  .ce-solution-viewer__title { flex-basis: calc(100% - 90px); }
  .ce-solution-viewer button { padding-inline: 8px; }
  .ce-solution-viewer [data-cesv-action="fit"] { font-size: 0; }
  .ce-solution-viewer [data-cesv-action="fit"]::after { content: "Fit"; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .ce-solution-viewer__tip { transition: none; }
}
