/* ============================================================================
 * chem_alloy.css
 * Metallurgy Alloy System Cards, Inline Slider & CalcAlloyPhaseView Modal Styles
 * Part of [OAW-Chem] platform client styles (<= 150 lines)
 * ============================================================================ */

/* Alloy Card Badge & Subtitle */
.tier-alloy {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #b45309 !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
[data-theme="dark"] .tier-alloy, [data-theme="blueprint"] .tier-alloy {
  background: rgba(245, 158, 11, 0.22) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
}

.alloy-subline {
  font-size: 0.70rem; font-weight: 600; color: var(--ink-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 1px 0 2px;
}

/* Inline Card Scrubbing Slider */
.chem-alloy-slider-strip {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--chem-card-strip-bg, rgba(241, 245, 249, 0.50)); border-radius: 6px; padding: 4px 6px; margin: 2px 0 3px;
}
[data-theme="dark"] .chem-alloy-slider-strip,
[data-theme="blueprint"] .chem-alloy-slider-strip {
  background: rgba(30, 41, 59, 0.50);
}
.alloy-slider-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px; width: 100%; min-width: 0;
}
.alloy-slider-lbl {
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700; color: var(--accent-link);
  white-space: nowrap; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.chem-alloy-slider {
  width: 100%; height: 4px; appearance: none; background: var(--border-grid, #cbd5e1);
  border-radius: 2px; outline: none; cursor: pointer;
}
.chem-alloy-slider::-webkit-slider-thumb {
  appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-link, #2563eb); border: 2px solid #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer; transition: transform 100ms ease;
}
.chem-alloy-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.alloy-phase-tag, .chem-alloy-phase, .chem-alloy-slider-strip .chem-alloy-phase {
  font-family: var(--font-sans); font-size: 0.60rem; font-weight: 700; min-width: 0; max-width: 100%;
  color: var(--ink-muted); text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 4x3 Crystal Lattice Mount */
.chem-alloy-lattice-mount {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 96px;
  background: transparent; overflow: hidden;
}
.chem-alloy-lattice-svg {
  max-width: 100%; max-height: 94px; display: block;
}

/* Two-Half Calculator Modal (.chem-calc-alloy-container) */
.chem-calc-alloy-container {
  display: flex; flex-direction: column; gap: 12px; width: 100%;
}
.chem-alloy-stage-row {
  display: grid; grid-template-columns: 165px 1fr; gap: 12px; align-items: start;
}
@media (max-width: 540px) {
  .chem-alloy-stage-row { grid-template-columns: 1fr; }
}
.chem-alloy-lattice-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-canvas, #ffffff); border: 1px solid var(--border-grid, #cbd5e1);
  border-radius: 10px; padding: 10px; box-shadow: 0 1px 3px rgba(15,23,42,0.05);
}
.chem-alloy-grade-readout {
  display: flex; flex-direction: column; align-items: center; margin-top: 6px; text-align: center;
}
.alloy-readout-name { font-family: var(--font-sans); font-size: 0.78rem; font-weight: 700; color: var(--ink-primary); }
.alloy-readout-phase { font-family: var(--font-mono); font-size: 0.70rem; color: var(--accent-link); margin-top: 1px; }

.chem-alloy-controls-panel {
  display: flex; flex-direction: column; gap: 10px;
}
.chem-calc-param-group {
  display: flex; flex-direction: column; gap: 4px;
}
.chem-calc-param-group .param-header {
  display: flex; justify-content: space-between; align-items: baseline; font-size: 0.74rem;
}
.chem-calc-param-group .param-title { font-weight: 600; color: var(--ink-secondary); }
.chem-calc-param-group .param-val { font-family: var(--font-mono); font-weight: 700; color: var(--accent-link); }

.chem-alloy-metrics-box {
  display: flex; flex-direction: column; gap: 4px; background: var(--bg-canvas, #ffffff);
  border: 1px solid var(--border-grid, #cbd5e1); border-radius: 8px; padding: 8px 10px;
}
.chem-metric-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.70rem;
}
.chem-metric-row .m-lbl { color: var(--ink-muted); }
.chem-metric-row .m-val {
  font-family: var(--font-mono); font-weight: 600; color: var(--ink-primary);
  white-space: nowrap; text-align: right;
}
.chem-metric-row .m-val.is-favorable { color: #15803d; }
.chem-metric-row .m-val.is-strained { color: #b45309; }

.chem-alloy-trait-bar {
  background: var(--bg-recessed, #f1f5f9); border-left: 3px solid var(--accent-link, #2563eb);
  padding: 6px 10px; border-radius: 0 6px 6px 0; font-size: 0.74rem; color: var(--ink-secondary);
}
.chem-alloy-trait-bar strong { color: var(--ink-primary); font-family: var(--font-sans); }

[data-theme="dark-paper"] .tier-alloy {
  background: rgba(245, 158, 11, 0.22) !important; color: #fbbf24 !important; border-color: rgba(245, 158, 11, 0.45) !important;
}
[data-theme="dark-paper"] .chem-alloy-slider-strip { background: rgba(41, 37, 36, 0.60); }
[data-theme="dark"] .chem-metric-row .m-val.is-favorable,
[data-theme="dark-paper"] .chem-metric-row .m-val.is-favorable { color: #4ade80; }
[data-theme="dark"] .chem-metric-row .m-val.is-strained,
[data-theme="dark-paper"] .chem-metric-row .m-val.is-strained { color: #fbbf24; }

/* Segmented Elemental wt% Makeup Bar & Interactive Oxidation Chips */
.chem-alloy-wt-mount { margin-top: 4px; min-width: 0; }
.chem-wt-block {
  display: flex; flex-direction: column; gap: 5px; margin: 4px 0 6px; padding: 6px 8px;
  background: var(--bg-recessed, #f1f5f9); border: 1px solid var(--border-grid, #cbd5e1);
  border-radius: 8px; min-width: 0; box-sizing: border-box;
}
.chem-wt-block.is-compact { padding: 4px 6px; gap: 4px; margin: 2px 0; border-radius: 6px; }
.chem-wt-head {
  font-family: var(--font-sans); font-size: 0.64rem; font-weight: 700;
  color: var(--ink-muted); letter-spacing: 0.02em; text-transform: uppercase;
}
.chem-wt-bar {
  display: flex; width: 100%; height: 7px; border-radius: 999px; overflow: hidden;
  background: var(--border-grid, #cbd5e1); gap: 1px;
}
.chem-wt-block.is-compact .chem-wt-bar { height: 5px; }
.chem-wt-seg { display: block; height: 100%; min-width: 3px; transition: width 120ms ease; }
.chem-wt-legend { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.chem-wt-chip {
  appearance: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px; border-radius: 999px; border: 1px solid var(--border-grid, #cbd5e1);
  background: var(--bg-canvas, #ffffff); color: var(--ink-primary);
  font-family: var(--font-mono); font-size: 0.63rem; line-height: 1.25;
  cursor: pointer; white-space: nowrap; transition: border-color 120ms ease, background 120ms ease;
}
.chem-wt-block.is-compact .chem-wt-chip { padding: 1px 5px; font-size: 0.60rem; gap: 3px; }
.chem-wt-chip:hover { border-color: var(--accent-link); background: var(--sig-bg, rgba(37, 99, 235, 0.08)); }
.chem-wt-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.chem-wt-sym { font-weight: 700; color: var(--ink-primary); }
.chem-wt-pct { font-weight: 600; color: var(--ink-secondary); }
.chem-wt-ox { color: var(--ink-muted); font-weight: 600; }

