/* Copyright Chemryt Informatics Private Limited */
/* ChemrytKSM scientific UI rule: keep molecule controls compact so structure, identity, and KSM readiness context stay primary. */
:root {
  --chemrytksm-ink: var(--chemrytiq-text, #12304d);
  --chemrytksm-muted: var(--chemrytiq-text-soft, #445d73);
  --chemrytksm-soft-muted: var(--chemrytiq-text-muted, #6f8498);
  --chemrytksm-line: var(--chemrytiq-border, #d7e3ef);
  --chemrytksm-panel: var(--chemrytiq-surface, #ffffff);
  --chemrytksm-soft: var(--chemrytiq-surface-soft, #f7fbff);
  --chemrytksm-font-sans: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --chemrytksm-blue: #1976d2;
  --chemrytksm-blue-soft: #eef6ff;
  --chemrytksm-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  --chemrytksm-align-left: max(15px, calc((100vw - 1170px) / 2));
  --chemrytksm-align-right: max(15px, calc((100vw - 1170px) / 2));
  --chemrytksm-align-width: min(1170px, calc(100vw - var(--chemrytksm-align-left) - var(--chemrytksm-align-right)));
  --chemrytksm-align-trim: 3px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  overflow-x: hidden;
  background: #f3f7fb;
  color: var(--chemrytksm-ink);
  font-family: var(--chemrytksm-font-sans);
}

.chemrytksm-shell {
  box-sizing: border-box;
  width: calc(var(--chemrytksm-align-width) - var(--chemrytksm-align-trim)) !important;
  max-width: none !important;
  margin: 1.25rem auto 3rem var(--chemrytksm-align-left) !important;
  padding-inline: 0 !important;
  overflow-x: clip;
}

.chemryt-module-navbar .chemryt-module-navbar__list {
  box-sizing: border-box;
  width: calc(var(--chemrytksm-align-width) - var(--chemrytksm-align-trim)) !important;
  max-width: none !important;
  margin-left: var(--chemrytksm-align-left) !important;
  margin-right: auto !important;
  padding-inline: 0 !important;
}

.chemrytksm-page {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  margin: 0 auto;
  padding: 0 0 24px;
  font-size: 11px !important;
}

.chemrytksm-page > * {
  min-width: 0;
}

.chemrytksm-page h1,
.chemrytksm-page h2,
.chemrytksm-page h3,
.chemrytksm-page p {
  margin: 0;
}

.chemrytksm-topbar,
.chemrytksm-workbench,
.chemrytksm-panel {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 12px;
}

.chemrytksm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(13, 65, 98, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(12, 54, 88, 0.95), rgba(32, 110, 136, 0.92)),
    linear-gradient(120deg, #0e334d, #1f6c86);
  box-shadow: 0 18px 40px rgba(20, 46, 67, 0.08);
  color: #f5fbff;
  padding: 12px 16px;
}

.chemrytksm-kicker {
  display: block;
  margin-bottom: 3px;
  color: rgba(226, 244, 255, 0.86);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.chemrytksm-page h1 {
  color: #f5fbff !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
}

.chemrytksm-page h2 {
  color: var(--chemrytksm-ink);
  font-size: 13px !important;
  font-weight: 600;
  line-height: 1.2 !important;
}

.chemrytksm-page p {
  color: var(--chemrytksm-muted);
  font-size: 11px !important;
  line-height: 1.3 !important;
}

.chemrytksm-topbar p {
  max-width: none;
  color: rgba(233, 245, 255, 0.84) !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chemrytksm-workbench {
  display: grid;
  gap: 12px;
  max-width: 100%;
}

.chemrytksm-editor-panel,
.chemrytksm-panel {
  border: 1px solid var(--chemrytksm-line);
  border-radius: 8px;
  background: var(--chemrytksm-panel);
  box-shadow: var(--chemrytksm-shadow);
  padding: 10px;
}

.chemrytksm-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.chemrytksm-panel-head > div {
  min-width: 0;
  flex: 1 1 auto;
}

.chemrytksm-loader-toolbar,
.chemrytksm-loader-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chemrytksm-loader-actions {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.chemrytksm-page button {
  box-sizing: border-box;
  height: 21px !important;
  min-height: 21px !important;
  max-height: 21px !important;
  border: 1px solid #bad2e8;
  border-radius: 7px;
  background: #f8fbfe;
  color: var(--chemrytksm-blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 400;
  line-height: 19px !important;
  padding: 0 8px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex: 0 0 auto;
}

.chemrytksm-page button:hover {
  border-color: var(--chemrytksm-blue);
  background: var(--chemrytksm-blue-soft);
}

.chemrytksm-page button.primary {
  border-color: var(--chemrytksm-blue);
  background: var(--chemrytksm-blue);
  color: #fff;
}

.chemrytksm-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 !important;
  min-height: 21px !important;
  height: 21px !important;
  border: 1px solid var(--chemrytksm-line);
  border-radius: 4px !important;
  background: #fbfdff;
  overflow: hidden;
}

.chemrytksm-view-toggle button {
  min-width: 44px;
  height: 21px !important;
  min-height: 21px !important;
  max-height: 21px !important;
  border-color: transparent;
  padding: 0 8px !important;
}

.chemrytksm-view-toggle button.is-active {
  background: var(--chemrytksm-blue);
  border-color: var(--chemrytksm-blue);
  color: #fff;
}

.chemrytksm-loader-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, calc((100% - 10px) / 2)));
  gap: 10px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.chemrytksm-structure-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.chemrytksm-editor-frame,
.chemrytksm-empty-card {
  border: 1px solid #dbe7f2;
  border-radius: 10px;
  background: linear-gradient(180deg, #fdfefe 0%, #f5faff 100%);
}

.chemrytksm-editor-frame {
  position: relative;
  min-width: 0;
  min-height: 300px;
  height: 300px;
  border: 1px solid var(--chemrytksm-line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.chemrytksm-jsme {
  width: 100%;
  height: 100%;
  min-height: 300px;
}

.chemrytksm-editor-frame.is-live-map .chemrytksm-live-structure-map[hidden] {
  display: none;
}

.chemrytksm-editor-frame:not(.is-depict) .chemrytksm-live-structure-map {
  display: none;
}

.chemrytksm-3d-viewer {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  background: linear-gradient(180deg, #fcfdff, #f3f7fb);
  color: var(--chemrytksm-muted);
  font-size: 12px;
  text-align: center;
  padding: 12px;
}

.chemrytksm-3d-stage {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border: 1px solid #dbe6f0;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.chemrytksm-3d-canvas {
  width: 100%;
  height: 100%;
  min-height: 248px;
}

.chemrytksm-3d-status {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  color: var(--chemrytksm-muted);
}

.chemrytksm-molecule-info {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 300px;
  height: 300px;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--chemrytksm-line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 9px;
}

.chemrytksm-info-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #e1ebf3;
  padding-bottom: 7px;
}

.chemrytksm-info-head strong {
  color: var(--chemrytksm-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.chemrytksm-info-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--chemrytksm-soft-muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.chemrytksm-loader-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.chemrytksm-loader-fields .wide {
  grid-column: 1 / -1;
}

.chemrytksm-loader-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--chemrytksm-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.chemrytksm-loader-fields input {
  min-width: 0;
  min-height: 30px;
  width: 100%;
  border: 1px solid #c5d4e5;
  border-radius: 7px;
  background: #ffffff;
  color: var(--chemrytksm-ink);
  font-size: 12px;
  font-weight: 400;
  padding: 0 9px;
}

.chemrytksm-readonly-output {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #dbe6f0;
  border-radius: 7px;
  background: linear-gradient(180deg, #f8fbfe, #f2f6fa);
  color: #254762;
  box-shadow: inset 3px 0 0 rgba(25, 118, 210, 0.18);
  cursor: default;
}

.chemrytksm-loader-fields input[readonly] {
  border-color: #dbe6f0;
  background: linear-gradient(180deg, #f8fbfe, #f2f6fa);
  color: #254762;
  box-shadow: inset 3px 0 0 rgba(25, 118, 210, 0.18);
  cursor: default;
}

.chemrytksm-loader-fields input[readonly]:focus {
  outline: none;
}

.chemrytksm-loader-readouts {
  display: grid;
  gap: 8px;
}

.chemrytksm-validation { padding: 8px 10px; border: 1px solid #d7e3ef; border-left: 4px solid #7b8ea2; border-radius: 7px; background: #fff; }
.chemrytksm-validation.is-valid { border-left-color: #21835a; background: #f2fbf7; }
.chemrytksm-validation.has-warning { border-left-color: #d68a00; background: #fff9ea; }
.chemrytksm-validation.has-error { border-left-color: #c53b3b; background: #fff3f3; }
.chemrytksm-validation__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chemrytksm-validation ul { margin: 5px 0 0; padding-left: 16px; color: var(--chemrytksm-muted); line-height: 1.35; }
.chemrytksm-validation.has-error li { color: #8f2525; }
.chemrytksm-page button:disabled { cursor: not-allowed; opacity: .55; }

.chemrytksm-reactive-map { padding: 8px 10px; border: 1px solid #d7e3ef; border-radius: 7px; background: linear-gradient(135deg, #f8fbff, #fffaf0); }
.chemrytksm-structure-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.chemrytksm-reactive-map__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chemrytksm-reactive-map__head > div { display: grid; gap: 2px; }
.chemrytksm-reactive-map__head span, .chemrytksm-site-suggestion > span { color: var(--chemrytksm-soft-muted); font-size: 10px; }
.chemrytksm-reactive-map__head label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.chemrytksm-reactive-map > p { margin-top: 5px; }
.chemrytksm-rdkit-depiction { display: grid; place-items: center; min-height: 190px; margin-top: 8px; border: 1px solid #d9e4ee; border-radius: 7px; background: #fff; overflow: hidden; color: var(--chemrytksm-soft-muted); }
.chemrytksm-rdkit-depiction svg { display: block; width: 100%; height: auto; max-height: 280px; }
.chemrytksm-reactive-sites { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.chemrytksm-reactive-sites button i { width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; box-shadow: 0 0 7px currentColor; }
.chemrytksm-site-suggestion { margin-top: 7px; padding: 7px 8px; border: 1px solid #f1c36b; border-radius: 6px; background: #fff; }
.chemrytksm-site-suggestion p { margin-top: 3px; }
.chemrytksm-site-suggestion ul { margin: 4px 0 0; padding-left: 16px; color: var(--chemrytksm-muted); }

.chemrytksm-loader-readouts > div {
  display: grid;
  gap: 4px;
}

.chemrytksm-loader-readouts dt {
  color: var(--chemrytksm-muted);
  font-size: 11px;
  font-weight: 600;
}

.chemrytksm-loader-readouts dd {
  margin: 0;
  color: var(--chemrytksm-ink);
  font-size: 12px;
  line-height: 1.3;
  word-break: break-word;
}

.chemrytksm-prediction-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.chemrytksm-compliance-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef3f8;
  color: var(--chemrytksm-muted);
  font-size: 11px;
  font-weight: 400;
}

.chemrytksm-live-compare-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #dbe7f2;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbfe 0%, #eef5fb 100%);
}

.chemrytksm-live-compare-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.chemrytksm-live-compare-card__head strong {
  color: var(--chemrytksm-ink);
  font-size: 12px;
}

.chemrytksm-live-compare-card p {
  margin: 0;
  color: var(--chemrytksm-muted);
  font-size: 11px;
  line-height: 1.4;
}

.chemrytksm-live-compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--chemrytksm-ink);
  font-size: 11px;
  font-weight: 600;
}

.chemrytksm-live-compare-toggle input {
  margin: 0;
}

.chemrytksm-live-structure-map {
  position: absolute;
  inset: auto 10px 10px 10px;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  cursor: pointer;
}

.chemrytksm-live-structure-map__badge {
  border: 1px solid rgba(25, 118, 210, 0.18);
  border-radius: 8px;
  background: rgba(247, 251, 255, 0.96);
  color: #35526c;
  padding: 8px 10px;
  line-height: 1.3;
  text-align: center;
  pointer-events: auto;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.chemrytksm-editor-status {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: none;
  align-items: center;
  min-height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(247, 251, 255, 0.96);
  color: var(--chemrytksm-muted);
  font-size: 11px;
  font-weight: 400;
  pointer-events: none;
}

.chemrytksm-editor-frame.is-depict .chemrytksm-editor-status {
  display: inline-flex;
}

.chemrytksm-panel-note {
  border: 1px solid #dbe7f2;
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbff 0%, #eef5fb 100%);
  padding: 10px 12px;
}

.chemrytksm-panel-note p {
  color: var(--chemrytksm-muted);
}

@media (max-width: 960px) {
  .chemrytksm-loader-layout,
  .chemrytksm-structure-review-grid,
  .chemrytksm-empty-grid {
    grid-template-columns: 1fr;
  }

  .chemrytksm-shell,
  .chemryt-module-navbar .chemryt-module-navbar__list {
    width: auto !important;
    margin-left: 15px !important;
    margin-right: 15px !important;
  }
}
