﻿:root {
  --chemrytram-bg: #f3f6fb;
  --chemrytram-surface: #ffffff;
  --chemrytram-surface-alt: #edf3fb;
  --chemrytram-border: #d6deea;
  --chemrytram-border-strong: #b8c7dc;
  --chemrytram-text: #183047;
  --chemrytram-muted: #5a7189;
  --chemrytram-primary: #0d6e8a;
  --chemrytram-primary-dark: #094a5d;
  --chemrytram-danger: #b03a48;
  --chemrytram-danger-bg: #fdecef;
  --chemrytram-success: #0d7a5f;
  --chemrytram-shadow: 0 18px 50px rgba(17, 40, 67, 0.08);
  --chemrytram-radius-lg: 24px;
  --chemrytram-radius-md: 16px;
  --chemrytram-radius-sm: 10px;
}

.chemrytram-page {
  background:
    radial-gradient(circle at top left, rgba(13, 110, 138, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--chemrytram-bg) 100%);
  min-height: calc(100vh - 120px);
  padding: 32px 16px 60px;
}

.chemrytram-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.chemrytram-card,
.chemrytram-actions {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(214, 222, 234, 0.95);
  box-shadow: var(--chemrytram-shadow);
  backdrop-filter: blur(10px);
}

.chemrytram-hero {
  border-radius: 24px;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 4px;
  background:
    linear-gradient(135deg, rgba(12, 54, 88, 0.95), rgba(32, 110, 136, 0.92)),
    linear-gradient(120deg, #0e334d, #1f6c86);
  color: #f5fbff;
  border: 1px solid rgba(17, 63, 94, 0.64);
  box-shadow: var(--chemrytram-shadow);
  backdrop-filter: blur(10px);
}

.chemrytram-kicker,
.chemrytram-card-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--chemrytram-primary);
}

.chemrytram-hero .chemrytram-kicker {
  margin: 0 0 4px;
  color: rgba(245, 251, 255, 0.82);
  letter-spacing: 0.18em;
}

.chemrytram-title {
  margin: 0 0 4px;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  line-height: 1.05;
  color: var(--chemrytram-text);
}

.chemrytram-hero .chemrytram-title {
  color: #f5fbff;
}

.chemrytram-subtitle {
  margin: 0;
  color: rgba(245, 251, 255, 0.86);
}

.chemrytram-hero-copy {
  min-width: 0;
}

.chemrytram-hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.chemrytram-hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
  color: #f5fbff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.chemrytram-hero-link--primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.chemrytram-hero-link:hover,
.chemrytram-hero-link:focus-visible {
  transform: translateY(-1px);
}

.chemrytram-feedback {
  border-radius: var(--chemrytram-radius-md);
  padding: 14px 16px;
  border: 1px solid var(--chemrytram-border);
  background: var(--chemrytram-surface);
  color: var(--chemrytram-text);
}

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

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

.chemrytram-grid,
.chemrytram-output-grid {
  display: grid;
  gap: 24px;
}

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

.chemrytram-output-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.chemrytram-card {
  border-radius: var(--chemrytram-radius-lg);
  padding: 24px;
}

.chemrytram-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

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

.chemrytram-inline-note {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--chemrytram-radius-sm);
  background: var(--chemrytram-surface-alt);
  color: var(--chemrytram-muted);
  font-size: 0.95rem;
}

.chemrytram-editor {
  min-height: 360px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--chemrytram-border);
  background:
    linear-gradient(135deg, rgba(211, 238, 243, 0.55), rgba(255, 255, 255, 0.82)),
    #fff;
}

.chemrytram-button-row,
.chemrytram-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.chemrytram-button-row {
  margin: 18px 0;
}

.chemrytram-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  gap: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

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

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

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

.chemrytram-btn-secondary {
  background: var(--chemrytram-surface-alt);
  color: var(--chemrytram-text);
  border: 1px solid var(--chemrytram-border);
}

.chemrytram-btn-ghost {
  background: transparent;
  color: var(--chemrytram-muted);
  border: 1px solid var(--chemrytram-border);
}

.chemrytram-form,
.chemrytram-fields {
  display: grid;
  gap: 16px;
}

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

.chemrytram-field {
  display: grid;
  gap: 7px;
}

.chemrytram-field-full {
  grid-column: 1 / -1;
}

.chemrytram-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #375069;
}

.chemrytram-input {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--chemrytram-border);
  background: #fff;
  color: var(--chemrytram-text);
  padding: 11px 13px;
  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);
}

.chemrytram-input-readonly {
  min-height: 86px;
  resize: vertical;
  background: #f9fbfd;
}

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

.chemrytram-input.chemrytram-invalid {
  border-color: var(--chemrytram-danger);
  box-shadow: 0 0 0 4px rgba(176, 58, 72, 0.08);
}

.chemrytram-actions {
  border-radius: 22px;
  padding: 18px 22px;
  justify-content: flex-start;
}

.chemrytram-loading {
  color: var(--chemrytram-primary-dark);
  font-weight: 700;
}

.chemrytram-output {
  display: grid;
  gap: 24px;
}

.chemrytram-empty-state {
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 16px;
  border: 1px dashed var(--chemrytram-border-strong);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(237, 243, 251, 0.85), rgba(255, 255, 255, 0.95));
  color: var(--chemrytram-muted);
  text-align: center;
}

.chemrytram-spectrum-canvas {
  width: 100%;
  height: 360px;
  display: block;
  border-radius: 20px;
  border: 1px solid var(--chemrytram-border);
  background: linear-gradient(180deg, #fbfdff 0%, #eef5fc 100%);
}

.chemrytram-table-wrap {
  overflow-x: auto;
}

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

.chemrytram-table th,
.chemrytram-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--chemrytram-border);
  color: var(--chemrytram-text);
}

.chemrytram-table th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--chemrytram-muted);
}

.chemrytram-confidence {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 180px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(211, 238, 243, 0.95), rgba(255, 255, 255, 0.95));
  border: 1px solid var(--chemrytram-border);
  padding: 18px;
  text-align: center;
}

.chemrytram-confidence-value {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  color: var(--chemrytram-primary-dark);
}

.chemrytram-confidence-copy {
  color: var(--chemrytram-muted);
  line-height: 1.6;
}

.chemrytram-summary {
  display: grid;
  gap: 12px;
}

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

.chemrytram-summary-item {
  border-radius: 14px;
  border: 1px solid var(--chemrytram-border);
  padding: 14px;
  background: #fbfdff;
}

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

.chemrytram-summary-value {
  color: var(--chemrytram-text);
  font-weight: 700;
  word-break: break-word;
}

@media (max-width: 980px) {
  .chemrytram-grid,
  .chemrytram-output-grid,
  .chemrytram-summary-grid {
    grid-template-columns: 1fr;
  }

  .chemrytram-hero {
    padding: 16px 18px;
    flex-direction: column;
    align-items: flex-start;
  }

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

@media (max-width: 720px) {
  .chemrytram-page {
    padding: 20px 12px 44px;
  }

  .chemrytram-card,
  .chemrytram-actions {
    padding: 18px;
  }

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

  .chemrytram-button-row,
  .chemrytram-actions {
    flex-direction: column;
    align-items: stretch;
  }

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