.chemrytaas-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(14, 85, 122, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(11, 81, 150, 0.08), transparent 24%),
    linear-gradient(180deg, #edf3f8 0%, #f7fafc 48%, #edf4f8 100%);
  color: #163044;
}

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

.chemrytaas-container {
  width: min(100%, 1180px);
  max-width: 1180px;
  margin: 1.75rem auto 3rem;
  padding: 0 1.25rem;
}

.chemrytaas-card {
  background: #ffffff;
  border: 1px solid #d8e3ec;
  border-radius: 24px;
  box-shadow: 0 20px 46px rgba(19, 50, 73, 0.09);
}

.chemrytaas-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  margin-bottom: 0.85rem;
  background: linear-gradient(135deg, #0d3551, #1f6c86);
  color: #f5fbff;
  border-radius: 22px;
  box-shadow: 0 14px 26px rgba(19, 50, 73, 0.07);
}

.chemrytaas-hero__copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.chemrytaas-hero__actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.chemrytaas-kicker,
.chemrytaas-card-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 700;
}

.chemrytaas-kicker {
  color: #f5fbff;
}

.chemrytaas-title,
.chemrytaas-card-title,
.chemrytaas-result-title {
  margin: 0;
  line-height: 1.08;
}

.chemrytaas-title {
  font-size: 1.45rem;
  color: #f5fbff;
}

.chemrytaas-card-title {
  font-size: 1.18rem;
  color: #18364d;
}

.chemrytaas-result-title {
  font-size: 1.02rem;
  color: #17364f;
}

.chemrytaas-subtitle,
.chemrytaas-chart-caption,
.chemrytaas-field-help,
.chemrytaas-inline-note,
.chemrytaas-result-copy {
  margin: 0;
  line-height: 1.5;
}

.chemrytaas-subtitle {
  max-width: 48rem;
  color: #f5fbff;
  font-size: 0.92rem;
}

.chemrytaas-field-help,
.chemrytaas-inline-note,
.chemrytaas-chart-caption,
.chemrytaas-result-copy {
  color: #557084;
  font-size: 0.9rem;
}

.chemrytaas-hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.chemrytaas-hero-link {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
  color: #f5fbff;
}

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

.chemrytaas-hero-link:hover,
.chemrytaas-hero-link:focus-visible,
.chemrytaas-btn:hover,
.chemrytaas-btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.chemrytaas-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.chemrytaas-status {
  margin: 0 0 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 16px;
  border: 1px solid #d6e4ed;
  font-weight: 600;
}

.chemrytaas-status--info {
  background: #ebf6fb;
  color: #1f5875;
}

.chemrytaas-status--success {
  background: #ebf7ef;
  color: #246647;
}

.chemrytaas-status--error {
  background: #fff1ee;
  color: #9d392d;
}

.chemrytaas-workspace {
  display: grid;
  gap: 1rem;
}

.chemrytaas-workspace__main {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  align-items: start;
  gap: 1rem;
}

.chemrytaas-workspace__column {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.chemrytaas-panel,
.chemrytaas-results {
  min-width: 0;
}

.chemrytaas-card-head,
.chemrytaas-card-body {
  padding: 1.35rem 1.45rem;
}

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

.chemrytaas-card-actions,
.chemrytaas-action-bar {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

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

.chemrytaas-btn--secondary {
  background: #f4fafc;
  color: #163347;
  border-color: #d6e4ed;
}

.chemrytaas-btn--ghost {
  background: transparent;
  color: #5c7386;
  border-color: #d6e4ed;
}

.chemrytaas-btn--large {
  min-width: 148px;
}

.chemrytaas-jsme-shell {
  min-height: 420px;
  padding: 0.9rem;
  margin-bottom: 1rem;
  border-radius: 20px;
  border: 1px solid #d6e4ee;
  background: linear-gradient(180deg, #f8fbfd, #edf4f7);
}

.chemrytaas-jsme {
  width: 100%;
  min-height: 390px;
}

.chemrytaas-graph-shell {
  min-height: 430px;
  padding-top: 0.85rem;
}

.chemrytaas-graph-shell--large {
  min-height: 560px;
}

.chemrytaas-form-grid,
.chemrytaas-summary-grid-inline,
.chemrytaas-results-grid,
.chemrytaas-results-detail-grid {
  display: grid;
  gap: 1rem;
}

.chemrytaas-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chemrytaas-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chemrytaas-field--wide {
  grid-column: 1 / -1;
}

.chemrytaas-check-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.chemrytaas-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  color: #17364d;
}

.chemrytaas-check input {
  width: 18px;
  height: 18px;
  accent-color: #14a4b8;
}

.chemrytaas-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #375069;
}

.chemrytaas-input,
.chemrytaas-select,
.chemrytaas-textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #ccd8e3;
  border-radius: 16px;
  padding: 0.75rem 0.95rem;
  background: #fff;
  color: #1b3347;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chemrytaas-textarea {
  min-height: 112px;
  resize: vertical;
}

.chemrytaas-textarea--mono {
  font-family: Consolas, "Courier New", monospace;
}

.chemrytaas-input:focus,
.chemrytaas-select:focus,
.chemrytaas-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.chemrytaas-field-error {
  min-height: 18px;
  color: #b42318;
  font-size: 0.82rem;
}

.chemrytaas-inline-note {
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: #f4f9fc;
  border: 1px solid #d9e6ef;
}

.chemrytaas-inline-note--error {
  color: #b42318;
}

.chemrytaas-summary-grid-inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chemrytaas-summary-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
  min-height: 96px;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid #dce6ee;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f9fc 100%);
}

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

.chemrytaas-summary-label,
.chemrytaas-metric-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #587087;
  text-transform: uppercase;
}

.chemrytaas-summary-value {
  color: #17354d;
  font-size: 0.98rem;
  font-weight: 600;
  word-break: break-word;
}

.chemrytaas-form-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.chemrytaas-form-tools .chemrytaas-btn {
  min-width: 148px;
}

.chemrytaas-action-bar {
  justify-content: flex-start;
}

.chemrytaas-loading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0 0;
  color: #1d4f74;
  font-weight: 700;
}

.chemrytaas-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(37, 99, 235, 0.18);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: chemrytaas-spin 0.8s linear infinite;
}

@keyframes chemrytaas-spin {
  to {
    transform: rotate(360deg);
  }
}

.chemrytaas-results {
  align-self: start;
}

.chemrytaas-results-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.chemrytaas-results--compact .chemrytaas-results-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chemrytaas-results--compact .chemrytaas-results-detail-grid {
  grid-template-columns: 1fr;
}

.chemrytaas-results--compact .chemrytaas-card-body {
  padding-top: 1.1rem;
}

.chemrytaas-metric-card,
.chemrytaas-result-panel {
  border: 1px solid #dbe6ee;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.chemrytaas-metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 132px;
  padding: 1rem 1.1rem;
}

.chemrytaas-results--compact .chemrytaas-metric-card {
  min-height: 108px;
}

.chemrytaas-metric-value {
  display: block;
  margin-top: 0.55rem;
  color: #14344b;
  font-size: clamp(1.45rem, 1.8vw, 1.85rem);
  font-weight: 800;
}

.chemrytaas-results-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chemrytaas-result-panel {
  padding: 1rem 1.1rem;
}

.chemrytaas-summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.chemrytaas-summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #e7eef4;
}

.chemrytaas-summary-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.chemrytaas-summary-term {
  color: #5b7287;
  font-weight: 600;
}

.chemrytaas-summary-data {
  color: #17364d;
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

.chemrytaas-chart-stage {
  position: relative;
  min-height: 360px;
}

.chemrytaas-chart-stage--large {
  min-height: 520px;
}

.chemrytaas-chart-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f1f7fb 100%);
}

.chemrytaas-chart-empty {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f1f7fb 100%);
  color: #557084;
  text-align: center;
  padding: 1.25rem;
}

.chemrytaas-chart-empty--large {
  min-height: 520px;
}

.chemrytaas-chart-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  min-width: 140px;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: rgba(14, 35, 53, 0.94);
  color: #f5fbff;
  font-size: 0.82rem;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.2);
  transform: translate(12px, 12px);
  z-index: 3;
}

.chemrytaas-dialog {
  width: min(760px, calc(100vw - 32px));
  border: none;
  border-radius: 18px;
  padding: 0;
}

.chemrytaas-dialog::backdrop {
  background: rgba(16, 33, 45, 0.45);
}

.chemrytaas-dialog-form {
  padding: 1.35rem;
}

.chemrytaas-dialog-head {
  margin-bottom: 0.9rem;
}

.chemrytaas-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (max-width: 1100px) {
  .chemrytaas-workspace__main,
  .chemrytaas-results-grid,
  .chemrytaas-results-detail-grid {
    grid-template-columns: 1fr;
  }

  .chemrytaas-container {
    width: min(100%, 960px);
  }

  .chemrytaas-results--compact .chemrytaas-results-grid,
  .chemrytaas-results--compact .chemrytaas-results-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .chemrytaas-container {
    margin-top: 1rem;
    padding: 0 0.9rem;
  }

  .chemrytaas-hero,
  .chemrytaas-card-head,
  .chemrytaas-card-actions,
  .chemrytaas-action-bar,
  .chemrytaas-form-tools,
  .chemrytaas-dialog-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chemrytaas-form-grid,
  .chemrytaas-summary-grid-inline {
    grid-template-columns: 1fr;
  }

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