.chemrytiq-page .chemrytio-structure-modal,
.chemrytiq-page .chemrytio-structure-modal *,
.chemrytiq-page .chemrytio-structure-modal *::before,
.chemrytiq-page .chemrytio-structure-modal *::after {
  box-sizing: border-box;
}

.chemrytiq-page .chemrytio-structure-modal {
  display: none;
  margin-top: 1.1rem;
  border: 1px solid var(--chemrytiq-border);
  border-radius: var(--chemrytiq-radius-lg);
  background: var(--chemrytiq-surface);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.chemrytiq-page .chemrytio-structure-modal.open,
.chemrytiq-page .chemrytio-structure-modal[aria-hidden="false"] {
  display: block;
}

.chemrytiq-page .chemrytio-structure-modal[aria-hidden="true"] {
  display: none;
}

.chemrytiq-page .chemrytio-structure-modal__shell {
  padding: 1.15rem 1.2rem 1.25rem;
  overflow: hidden;
}

.chemrytiq-page .chemrytio-structure-modal__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e6eef7;
}

.chemrytiq-page .chemrytio-structure-modal__title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--chemrytiq-text);
  font-size: 0.98rem;
  font-weight: 700;
}

.chemrytiq-page .chemrytio-structure-modal__hint {
  flex: 1 1 18rem;
  min-width: 0;
  color: var(--chemrytiq-text-soft);
  font-size: 0.92rem;
}

.chemrytiq-page .chemrytio-structure-modal__close {
  border: none;
  background: transparent;
  margin-left: auto;
  padding: 0.2rem 0.45rem;
  border-radius: 0.45rem;
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1;
  transition: background .15s ease, color .15s ease;
}

.chemrytiq-page .chemrytio-structure-modal__close:hover {
  background: #fee2e2;
  color: #dc2626;
}

.chemrytiq-page .chemrytio-structure-modal__body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(20rem, 0.8fr);
  align-items: start;
  gap: 1.25rem;
  width: 100%;
  max-width: 100%;
  padding-top: 1rem;
  overflow: hidden;
}

.chemrytiq-page .chemrytio-structure-modal__editor,
.chemrytiq-page .chemrytio-structure-modal__details {
  min-width: 0;
  max-width: 100%;
}

.chemrytiq-page .chemrytio-structure-modal__editor {
  display: grid;
  gap: 1rem;
  overflow: hidden;
}

.chemrytiq-page .chemrytio-structure-modal__canvas {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 27rem;
  border: 1px solid var(--chemrytiq-border);
  border-radius: 1rem;
  background: #fff;
  overflow: hidden;
  isolation: isolate;
}

.chemrytiq-page .chemrytio-structure-modal__canvas > div,
.chemrytiq-page .chemrytio-structure-modal__canvas > table,
.chemrytiq-page .chemrytio-structure-modal__canvas iframe,
.chemrytiq-page .chemrytio-structure-modal__canvas svg {
  max-width: 100% !important;
}

.chemrytiq-page .chemrytio-structure-modal__canvas.is-tools-collapsed::before,
.chemrytiq-page .chemrytio-structure-modal__canvas.is-tools-collapsed::after {
  content: "";
  position: absolute;
  background: #ffffff;
  z-index: 3;
  pointer-events: none;
}

.chemrytiq-page .chemrytio-structure-modal__canvas.is-tools-collapsed::before {
  top: 0;
  left: 0;
  right: 0;
  height: 4.5rem;
  border-bottom: 1px solid #d9e5f0;
}

.chemrytiq-page .chemrytio-structure-modal__canvas.is-tools-collapsed::after {
  top: 4.5rem;
  left: 0;
  bottom: 0;
  width: 2.35rem;
  border-right: 1px solid #d9e5f0;
}

.chemrytiq-page .chemrytio-structure-modal__intro {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid #d5e6f6;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(15, 35, 58, 0.08);
  color: #36516b;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.chemrytiq-page .chemrytio-structure-modal__canvas.is-tools-collapsed .chemrytio-structure-modal__intro {
  opacity: 1;
  transform: translateY(0);
}

.chemrytiq-page .chemrytio-structure-modal__controls {
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.chemrytiq-page .chemrytio-structure-modal__label {
  display: block;
  margin-bottom: 0.45rem;
  color: #5a7089;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chemrytiq-page .chemrytio-structure-modal__textarea {
  width: 100%;
  min-height: 7rem;
  border: 1.5px solid var(--chemrytiq-border-strong);
  border-radius: 0.85rem;
  background: #f8fbff;
  padding: 0.85rem 0.95rem;
  color: var(--chemrytiq-text);
  font-family: Consolas, Monaco, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

.chemrytiq-page .chemrytio-structure-modal__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chemrytiq-page .chemrytio-structure-modal__search,
.chemrytiq-page .chemrytio-structure-modal__clear {
  flex: 1 1 13rem;
  min-height: 2.9rem;
  padding-inline: 1.25rem;
  border-radius: 0.85rem;
  font-size: 0.92rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}

.chemrytiq-page .chemrytio-structure-modal__search {
  border: none;
  background: linear-gradient(135deg, #1565c0, #1e88e5);
  color: #fff;
  box-shadow: 0 4px 12px rgba(21, 101, 192, 0.26);
}

.chemrytiq-page .chemrytio-structure-modal__search:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(21, 101, 192, 0.34);
}

.chemrytiq-page .chemrytio-structure-modal__clear {
  border: 1px solid var(--chemrytiq-border);
  background: #f1f5f9;
  color: #475569;
}

.chemrytiq-page .chemrytio-structure-modal__clear:hover {
  background: #e2e8f0;
}

.chemrytiq-page .chemrytio-structure-modal__tip {
  margin: 0;
  color: #69819a;
  font-size: 0.86rem;
  line-height: 1.5;
}

.chemrytiq-page .chemrytio-structure-modal__details {
  align-self: stretch;
  max-height: 42rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.chemrytiq-page .chemrytio-structure-modal__details-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0.9rem;
  padding: 1.2rem;
  border: 1px solid #dce6f0;
  border-radius: 1.2rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 26px rgba(15, 35, 58, 0.06);
}

.chemrytiq-page .chemrytio-structure-modal__kicker {
  color: #0b6fbf;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chemrytiq-page .chemrytio-structure-modal__name {
  margin: 0;
  color: #16324d;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.15;
  word-break: break-word;
}

.chemrytiq-page .chemrytio-structure-modal__subtext {
  color: #607288;
  font-size: 0.92rem;
  line-height: 1.55;
}

.chemrytiq-page .chemrytio-structure-modal__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chemrytiq-page .chemrytio-structure-modal__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #dbe4ef;
  background: #f8fbff;
  color: #24425f;
  font-size: 0.83rem;
  font-weight: 800;
  line-height: 1;
}

.chemrytiq-page .chemrytio-structure-modal__badge--pass {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #166534;
}

.chemrytiq-page .chemrytio-structure-modal__badge--warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.chemrytiq-page .chemrytio-structure-modal__badge--neutral {
  background: #f5f9fd;
  color: #44627d;
}

.chemrytiq-page .chemrytio-structure-modal__summary-grid {
  display: grid;
  gap: 0.55rem;
}

.chemrytiq-page .chemrytio-structure-modal__summary-row {
  display: grid;
  grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
  align-items: flex-start;
  column-gap: 1rem;
  row-gap: 0.35rem;
  padding: 0.72rem 0;
  border-top: 1px solid #e4edf6;
}

.chemrytiq-page .chemrytio-structure-modal__summary-label {
  color: #607288;
  font-size: 0.84rem;
  font-weight: 700;
}

.chemrytiq-page .chemrytio-structure-modal__summary-value {
  color: #0f2236;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: left;
  justify-self: start;
  min-width: 0;
  word-break: break-word;
}

.chemrytiq-page .chemrytio-structure-modal__summary-value--code {
  font-family: Consolas, Monaco, monospace;
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .chemrytiq-page .chemrytio-structure-modal__body {
    grid-template-columns: 1fr;
  }

  .chemrytiq-page .chemrytio-structure-modal__details {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .chemrytiq-page .chemrytio-structure-modal__shell {
    padding: 1rem;
  }

  .chemrytiq-page .chemrytio-structure-modal__canvas {
    min-height: 20rem;
  }

  .chemrytiq-page .chemrytio-structure-modal__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chemrytiq-page .chemrytio-structure-modal__summary-row {
    grid-template-columns: 1fr;
  }
}
