:root {
  --chemrytram-bg: #eef3f8;
  --chemrytram-surface: #ffffff;
  --chemrytram-surface-soft: #f7fbfe;
  --chemrytram-border: #d7e0ea;
  --chemrytram-border-strong: #c5d2df;
  --chemrytram-text: #16324a;
  --chemrytram-muted: #5c7084;
  --chemrytram-primary: #0d6e8a;
  --chemrytram-primary-dark: #094f66;
  --chemrytram-danger: #b42318;
  --chemrytram-danger-bg: #fde7e5;
  --chemrytram-success: #14532d;
  --chemrytram-success-bg: #dff5e6;
  --chemrytram-shadow: 0 18px 40px rgba(20, 46, 67, 0.08);
  --chemrytram-radius: 24px;
  --chemrytram-radius-sm: 8px;
  --chemrytram-control-radius: 14px;
  --chemrytram-visual-height: 300px;
}

body {
  overflow-x: hidden;
  color: var(--chemrytram-text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.chemryt-module-navbar .chemryt-module-navbar__list {
  box-sizing: border-box;
  width: min(100%, 1170px);
  padding-inline: 15px;
}

.chemrytram-shell {
  box-sizing: border-box;
  width: min(100%, 1120px) !important;
  max-width: 1120px !important;
  margin: 2rem auto 3rem !important;
  padding-inline: 15px !important;
}

.chemx-wrap.chemrytram-shell {
  box-sizing: border-box;
  width: min(100%, 1120px) !important;
  max-width: 1120px !important;
  margin: 2rem auto 3rem !important;
  padding-inline: 15px !important;
}

.chemrytram-page,
.chemrytram-page *,
.chemrytram-page *::before,
.chemrytram-page *::after {
  box-sizing: border-box;
}

.chemrytram-page {
  display: grid;
  gap: 1rem;
}

.chemrytram-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.35rem;
  border-radius: var(--chemrytram-radius);
  border: 1px solid rgba(13, 65, 98, 0.28);
  background:
    linear-gradient(135deg, rgba(12, 54, 88, 0.95), rgba(32, 110, 136, 0.92)),
    linear-gradient(120deg, #0e334d, #1f6c86);
  color: #f5fbff;
  box-shadow: var(--chemrytram-shadow);
}

.chemrytram-kicker,
.chemrytram-card-eyebrow {
  display: inline-block;
  margin: 0 0 0.25rem;
  color: rgba(226, 244, 255, 0.86);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.chemrytram-card-eyebrow {
  color: var(--chemrytram-primary);
  letter-spacing: 0.12em;
}

.chemrytram-title {
  margin: 0;
  color: #f5fbff;
  font-size: 2rem;
  line-height: 1.05;
}

.chemrytram-subtitle {
  margin: 0.6rem 0 0;
  color: rgba(233, 245, 255, 0.84);
  font-size: 0.98rem;
}

.chemrytram-hero-actions,
.chemrytram-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.chemrytram-hero-actions {
  justify-content: flex-end;
}

.chemrytram-hero-link,
.chemrytram-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  height: 21px;
  min-height: 21px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.89rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.chemrytram-hero-link {
  height: 34px;
  min-height: 34px;
  color: #f5fbff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}

.chemrytram-hero-link--primary,
.chemrytram-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--chemrytram-primary) 0%, #1793aa 100%);
  border-color: var(--chemrytram-primary);
  box-shadow: 0 14px 32px rgba(13, 110, 138, 0.22);
}

.chemrytram-hero-link:hover,
.chemrytram-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.chemrytram-btn:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}

.chemrytram-btn-secondary {
  color: var(--chemrytram-text);
  background: #f4fafc;
  border-color: #d6e4ed;
}

.chemrytram-btn-ghost {
  color: var(--chemrytram-muted);
  background: transparent;
  border-color: #d6e4ed;
}

.chemrytram-feedback {
  padding: 0.9rem 1rem;
  border: 1px solid #bddff0;
  border-radius: 16px;
  background: #e7f4fb;
  color: #124f75;
  font-weight: 600;
}

.chemrytram-feedback[data-variant="error"] {
  border-color: #f5c3bd;
  background: var(--chemrytram-danger-bg);
  color: var(--chemrytram-danger);
}

.chemrytram-feedback[data-variant="success"] {
  border-color: #bde4c7;
  background: var(--chemrytram-success-bg);
  color: var(--chemrytram-success);
}

.chemrytram-workspace,
.chemrytram-output {
  display: grid;
  gap: 1.15rem;
}

.chemrytram-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--chemrytram-border);
  border-radius: var(--chemrytram-radius);
  background: var(--chemrytram-surface);
  box-shadow: var(--chemrytram-shadow);
}

.chemrytram-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid #e5edf4;
}

.chemrytram-card-title {
  margin: 0;
  color: var(--chemrytram-text);
  font-size: 1.05rem;
}

.chemrytram-card > .chemrytram-button-row,
.chemrytram-card > .chemrytram-inline-note,
.chemrytram-card > .chemrytram-structure-layout,
.chemrytram-card > .chemrytram-form {
  margin: 1rem 1.25rem;
}

.chemrytram-card > .chemrytram-structure-layout {
  margin-top: 0;
}

.chemrytram-collapse-toggle {
  flex: 0 0 auto;
}

.chemrytram-collapsible-body[hidden] {
  display: none !important;
}

.chemrytram-inline-note {
  padding: 0.75rem 0.85rem;
  border: 1px solid #d9e4ee;
  border-radius: var(--chemrytram-radius-sm);
  background: var(--chemrytram-surface-soft);
  color: var(--chemrytram-muted);
  font-size: 0.9rem;
}

.chemrytram-inline-note:empty {
  display: none;
}

.chemrytram-structure-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(320px, 1.02fr);
  gap: 1rem;
  align-items: start;
  min-width: 0;
}

.chemrytram-editor-frame {
  position: relative;
  padding: 0.85rem;
  border: 1px solid var(--chemrytram-border);
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
}

.chemrytram-editor {
  width: 100%;
  min-height: var(--chemrytram-visual-height);
  height: var(--chemrytram-visual-height);
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.chemrytram-jsme-overlay {
  position: absolute;
  inset: 0.85rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
}

.chemrytram-jsme-overlay:hover {
  background: rgba(55, 80, 105, 0.06);
}

.chemrytram-jsme-overlay__hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--chemrytram-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  color: #375069;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.chemrytram-jsme-overlay:hover .chemrytram-jsme-overlay__hint {
  opacity: 1;
}

.chemrytram-molecule-info {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.chemrytram-form,
.chemrytram-fields {
  display: grid;
  gap: 0.85rem;
}

.chemrytram-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chemrytram-field {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.chemrytram-field-full {
  grid-column: span 2;
}

.chemrytram-label {
  display: inline-block;
  margin-bottom: 0.1rem;
  color: #375069;
  font-size: 0.85rem;
  font-weight: 700;
}

.chemrytram-input {
  width: 100%;
  min-height: 28px;
  padding: 0 0.6rem;
  border: 1px solid #cdd8e3;
  border-radius: var(--chemrytram-control-radius);
  background: #fbfdff;
  color: var(--chemrytram-text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chemrytram-input:focus {
  outline: none;
  border-color: var(--chemrytram-primary);
  box-shadow: 0 0 0 4px rgba(13, 110, 138, 0.12);
}

textarea.chemrytram-input {
  min-height: 70px;
  padding: 0.45rem 0.6rem;
  resize: vertical;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.92rem;
}

.chemrytram-input-readonly {
  background: #fbfdff;
}

.chemrytram-field-error {
  color: var(--chemrytram-danger);
  font-size: 0.82rem;
}

.chemrytram-field-error:empty {
  display: none;
}

.chemrytram-input.chemrytram-invalid {
  border-color: var(--chemrytram-danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08);
}

.chemrytram-output[hidden] {
  display: none !important;
}

.chemrytram-empty-state {
  display: grid;
  min-height: 140px;
  place-items: center;
  padding: 1rem;
  border: 1px dashed var(--chemrytram-border-strong);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f7fbfe);
  color: var(--chemrytram-muted);
  text-align: center;
}

.chemrytram-spectrum-canvas {
  display: block;
  width: calc(100% - 2.5rem);
  height: 360px;
  margin: 1.25rem;
  border: 1px solid #d9e4ee;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f7fbfe);
}

#chemrytram-chart-empty {
  margin: 1.25rem;
}

.chemrytram-table-wrap {
  overflow-x: auto;
  margin: 1.25rem;
  border: 1px solid #d9e4ee;
  border-radius: 18px;
}

.chemrytram-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.chemrytram-table th,
.chemrytram-table td {
  padding: 0.85rem;
  border-bottom: 1px solid #e5edf4;
  color: var(--chemrytram-text);
  text-align: left;
  vertical-align: top;
}

.chemrytram-table th {
  background: #f5f9fc;
  color: #35506a;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chemrytram-summary {
  display: grid;
  gap: 0.75rem;
}

.chemrytram-molecule-summary,
.chemrytram-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chemrytram-summary-grid {
  display: grid;
  gap: 0.75rem;
}

.chemrytram-summary-item {
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid #dde6ef;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff, #f4f8fb);
}

.chemrytram-summary-item--wide {
  grid-column: 1 / -1;
}

.chemrytram-summary-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--chemrytram-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.chemrytram-summary-value {
  display: block;
  color: var(--chemrytram-text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

code.chemrytram-summary-value {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

#chemrytram-peaks-empty,
#chemrytram-summary.chemrytram-empty-state {
  margin: 1.25rem;
}

@media (max-width: 1180px) {
  .chemrytram-structure-layout {
    grid-template-columns: 1fr;
  }

  .chemrytram-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .chemrytram-shell {
    --chemrytram-visual-height: 260px;
    margin: 1.5rem auto 2.5rem !important;
    padding-inline: 1rem !important;
  }

  .chemrytram-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem;
    border-radius: 20px;
  }

  .chemrytram-title {
    font-size: 1.6rem;
  }

  .chemrytram-hero-actions {
    justify-content: flex-start;
  }

  .chemrytram-card-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem 1rem 0.75rem;
  }

  .chemrytram-card > .chemrytram-button-row,
  .chemrytram-card > .chemrytram-inline-note,
  .chemrytram-card > .chemrytram-structure-layout,
  .chemrytram-card > .chemrytram-form {
    margin: 1rem;
  }

  .chemrytram-button-row {
    align-items: flex-start;
  }

  .chemrytram-fields,
  .chemrytram-molecule-summary,
  .chemrytram-summary-grid {
    grid-template-columns: 1fr;
  }

  .chemrytram-field-full {
    grid-column: auto;
  }

  .chemrytram-btn,
  .chemrytram-hero-link {
    max-width: 100%;
  }
}
