/* ── Theoretical Yield Calculator v1.1 ──────────────────────────── */

.tyc-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 880px;
  margin: 2rem auto;
  background: #f0fdfa;
  border: 1.5px solid #5eead4;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 32px rgba(13,148,136,0.12);
  color: #134e4a;
  box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────────────── */
.tyc__header {
  background: linear-gradient(135deg, #042f2e 0%, #134e4a 40%, #0d9488 75%, #14b8a6 100%);
  padding: clamp(1.4rem, 4vw, 2rem) clamp(1.2rem, 4vw, 2rem);
}
.tyc__header h2 {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 900; color: #fff; margin: 0 0 0.25rem; letter-spacing: -0.01em;
}
.tyc__header p { font-size: 0.9rem; color: #99f6e4; margin: 0; }

/* ── Body ────────────────────────────────────────────────────────── */
.tyc__body { padding: clamp(1.2rem, 3vw, 1.6rem); display: flex; flex-direction: column; gap: 1.25rem; background: #fff; }

/* ── Presets ─────────────────────────────────────────────────────── */
.tyc__presets-section { display: flex; flex-direction: column; gap: 0.5rem; }
.tyc__presets-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: #0d9488; }
.tyc__presets { display: flex; flex-wrap: wrap; gap: 7px; }
.tyc__preset {
  background: #f0fdfa; border: 1.5px solid #5eead4;
  border-radius: 20px; padding: 4px 14px;
  font-size: 0.78rem; font-weight: 700; color: #0d9488;
  cursor: pointer; transition: all 0.15s;
}
.tyc__preset:hover, .tyc__preset.tyc--active {
  background: #0d9488; border-color: #0d9488; color: #fff;
}
.tyc__reaction-name { font-size: 0.82rem; font-weight: 700; color: #0f766e; min-height: 1.2em; font-style: italic; }

/* ── Step badge ──────────────────────────────────────────────────── */
.tyc__step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #0d9488; color: #fff;
  font-size: 0.72rem; font-weight: 900; flex-shrink: 0;
}
.tyc__step-badge--green  { background: #16a34a; }
.tyc__step-badge--blue   { background: #2563eb; }
.tyc__step-badge--orange { background: #f59e0b; }

/* ── Two-column inputs ───────────────────────────────────────────── */
.tyc__inputs {
  display: flex; align-items: flex-start; gap: 0.75rem;
  background: #f0fdfa; border: 1.5px solid #ccfbf1;
  border-radius: 12px; padding: 1.25rem;
}
.tyc__col { flex: 1; display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.tyc__col-title {
  font-size: 0.85rem; font-weight: 800; color: #134e4a;
  display: flex; align-items: center; gap: 7px;
  border-bottom: 2px solid #ccfbf1; padding-bottom: 0.5rem;
}
.tyc__arrow-col { display: flex; align-items: center; justify-content: center; padding-top: 3rem; flex-shrink: 0; }
.tyc__reaction-arrow { font-size: 2rem; color: #0d9488; font-weight: 900; }

/* ── Fields ──────────────────────────────────────────────────────── */
.tyc__field { display: flex; flex-direction: column; gap: 4px; }
.tyc__label { font-size: 0.78rem; font-weight: 600; color: #134e4a; }
.tyc__input-row {
  display: flex; align-items: center;
  border: 2px solid #5eead4; border-radius: 9px; overflow: hidden;
  transition: border-color 0.2s;
}
.tyc__input-row:focus-within { border-color: #0d9488; box-shadow: 0 0 0 3px rgba(13,148,136,0.15); }
.tyc__input {
  flex: 1; border: none; outline: none;
  padding: 0.6rem 0.75rem; font-size: 0.98rem;
  color: #134e4a; background: transparent; font-weight: 600;
  width: 100%; box-sizing: border-box;
}
.tyc__input::placeholder { color: #94a3b8; font-weight: 400; }
.tyc__unit { background: #ccfbf1; color: #0d9488; padding: 0.6rem 0.75rem; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }

/* ── Results ─────────────────────────────────────────────────────── */
.tyc__results {
  border: 2px solid #5eead4; border-radius: 12px; padding: 1.1rem;
  background: #f0fdfa; display: flex; flex-direction: column; gap: 0.85rem;
}
.tyc__results-title { font-size: 0.85rem; font-weight: 800; color: #134e4a; display: flex; align-items: center; gap: 7px; }
.tyc__results-grid { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; }
.tyc__result-box {
  background: #fff; border: 1.5px solid #ccfbf1; border-radius: 10px;
  padding: 0.85rem 0.9rem; text-align: center; display: flex; flex-direction: column; gap: 2px;
}
.tyc__result-box--accent {
  border-color: #0d9488;
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  box-shadow: 0 2px 12px rgba(13,148,136,0.12);
}
.tyc__result-label { font-size: 0.72rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.8px; }
.tyc__result-val { font-size: 1.5rem; font-weight: 900; color: #0d9488; line-height: 1.1; word-break: break-all; }
.tyc__result-val--large { font-size: 2rem; color: #0f766e; }
.tyc__result-unit { font-size: 0.78rem; font-weight: 700; color: #0d9488; }

/* ── Percent yield ───────────────────────────────────────────────── */
.tyc__percent-section {
  background: #fffbeb; border: 1.5px solid #fde68a;
  border-radius: 12px; padding: 1.1rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.tyc__percent-title { font-size: 0.85rem; font-weight: 800; color: #92400e; display: flex; align-items: center; gap: 7px; }
.tyc__optional { font-weight: 500; font-size: 0.75rem; color: #b45309; }
.tyc__percent-row { display: flex; align-items: flex-end; gap: 1rem; }
.tyc__percent-result-wrap { text-align: center; flex-shrink: 0; min-width: 110px; }
.tyc__percent-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: #b45309; letter-spacing: 0.8px; margin-bottom: 4px; }
.tyc__percent-val { font-size: 2.2rem; font-weight: 900; color: #d97706; line-height: 1; }

/* ══════════════════════════════════════════════════════════════════
   STEP-BY-STEP SECTION
   ══════════════════════════════════════════════════════════════════ */
.tyc__steps-section {
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  animation: tyc-fade-in 0.35s ease;
}
@keyframes tyc-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Panel (forward / reverse) */
.tyc__steps-panel { padding: 1.1rem 1.25rem; }
.tyc__steps-panel--forward { background: #f8fffe; }
.tyc__steps-panel--reverse { background: #f5f3ff; }

.tyc__steps-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #e2e8f0;
}
.tyc__steps-dir-label {
  font-size: 0.72rem; font-weight: 900; letter-spacing: 2px;
  text-transform: uppercase; border-radius: 20px;
  padding: 3px 12px;
}
.tyc__steps-dir-label--forward { background: #0d9488; color: #fff; }
.tyc__steps-dir-label--reverse { background: #7c3aed; color: #fff; }
.tyc__steps-subtitle { font-size: 0.82rem; font-weight: 700; color: #64748b; }

/* Step list */
.tyc__steps-body { display: flex; flex-direction: column; gap: 0; }

/* Individual step */
.tyc__stp {
  display: flex;
  gap: 0;
}

/* Left: number + connector line */
.tyc__stp-left {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; width: 36px;
}
.tyc__stp-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 900; color: #fff;
  flex-shrink: 0; z-index: 1;
}
.tyc__steps-panel--forward .tyc__stp-num { background: #0d9488; }
.tyc__steps-panel--reverse .tyc__stp-num { background: #7c3aed; }

.tyc__stp-line {
  flex: 1; width: 2px; min-height: 12px;
  margin: 2px 0;
}
.tyc__steps-panel--forward .tyc__stp-line { background: linear-gradient(#0d9488, #ccfbf1); }
.tyc__steps-panel--reverse .tyc__stp-line { background: linear-gradient(#7c3aed, #ede9fe); }

/* Right: content */
.tyc__stp-right {
  flex: 1; padding: 0 0 1.1rem 0.85rem; min-width: 0;
}
.tyc__stp:last-child .tyc__stp-right { padding-bottom: 0; }
.tyc__stp:last-child .tyc__stp-line  { display: none; }

.tyc__stp-heading {
  font-size: 0.82rem; font-weight: 800; color: #1e293b;
  margin: 0 0 0.4rem; padding-top: 4px;
}

.tyc__stp-formula {
  font-size: 0.8rem; font-style: italic; color: #64748b;
  background: #f1f5f9; border-radius: 6px;
  padding: 4px 10px; margin-bottom: 6px;
  display: inline-block; font-family: 'Courier New', monospace;
}

.tyc__stp-calc {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  font-size: 0.88rem; font-weight: 600; color: #334155;
  margin-bottom: 6px;
}
.tyc__stp-eq { color: #94a3b8; font-weight: 400; }

.tyc__stp-result {
  font-size: 1rem; font-weight: 900;
  padding: 5px 14px; border-radius: 20px;
  display: inline-block;
}
.tyc__steps-panel--forward .tyc__stp-result { background: #ccfbf1; color: #0f766e; }
.tyc__steps-panel--reverse .tyc__stp-result { background: #ede9fe; color: #5b21b6; }

/* Final result box — larger, highlighted */
.tyc__stp-result--final {
  font-size: 1.25rem;
  padding: 8px 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.tyc__steps-panel--forward .tyc__stp-result--final { background: linear-gradient(90deg,#0d9488,#14b8a6); color: #fff; }
.tyc__steps-panel--reverse .tyc__stp-result--final { background: linear-gradient(90deg,#7c3aed,#a78bfa); color: #fff; }

/* Verify badge */
.tyc__stp-verify {
  display: inline-flex; align-items: center; gap: 6px;
  background: #dcfce7; color: #15803d;
  font-size: 0.78rem; font-weight: 800;
  border-radius: 20px; padding: 3px 12px;
  margin-top: 6px; letter-spacing: 0.5px;
}

/* Divider between panels */
.tyc__steps-divider {
  display: flex; align-items: center; gap: 0.75rem;
  background: #f1f5f9; padding: 0.55rem 1.25rem;
  border-top: 1.5px solid #e2e8f0; border-bottom: 1.5px solid #e2e8f0;
}
.tyc__steps-divider span {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase; color: #7c3aed; white-space: nowrap;
}
.tyc__steps-divider::before, .tyc__steps-divider::after {
  content: ''; flex: 1; height: 1.5px; background: #e2e8f0;
}

/* ── Reference Table ─────────────────────────────────────────────── */
.tyc__table-section { padding: clamp(1rem, 3vw, 1.4rem); background: #f0fdfa; border-top: 1.5px solid #ccfbf1; }
.tyc__table-title { font-size: clamp(0.88rem, 2.5vw, 1rem); font-weight: 800; color: #134e4a; margin: 0 0 0.25rem; }
.tyc__table-hint { font-size: 0.78rem; color: #0d9488; margin: 0 0 0.75rem; }
.tyc__table-wrap { overflow-x: auto; }
.tyc__table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.tyc__table thead tr { background: linear-gradient(90deg, #042f2e, #0d9488); }
.tyc__table thead th { color: #fff; padding: 0.6rem 1rem; text-align: left; font-weight: 700; font-size: 0.8rem; white-space: nowrap; }
.tyc__table tbody tr:nth-child(even) { background: #f0fdfa; }
.tyc__table tbody tr { cursor: pointer; transition: background 0.15s; }
.tyc__table tbody tr:hover { background: #ccfbf1; }
.tyc__table tbody td { padding: 0.45rem 1rem; color: #134e4a; border-bottom: 1px solid #ccfbf1; }

/* ── Note ────────────────────────────────────────────────────────── */
.tyc__note { background: #f0fdfa; border-top: 1.5px solid #5eead4; padding: 0.85rem clamp(1rem, 3vw, 1.5rem); font-size: 0.82rem; color: #134e4a; line-height: 1.6; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .tyc__inputs    { flex-direction: column; }
  .tyc__arrow-col { padding-top: 0; }
  .tyc__reaction-arrow { transform: rotate(90deg); }
  .tyc__results-grid { grid-template-columns: 1fr 1fr; }
  .tyc__result-box--accent { grid-column: span 2; }
  .tyc__percent-row { flex-direction: column; }
  .tyc__percent-result-wrap { text-align: left; }
  .tyc__stp-formula { font-size: 0.72rem; }
}
