/* ══════════════════════════════════════════
   PERIODIC TABLE — Reskinned to IH Guide design system
══════════════════════════════════════════ */

.main { display: flex; min-height: calc(100vh - 56px); }
.table-area { flex: 1; padding: 18px 16px; overflow-x: auto; min-width: 0; }

/* Controls */
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ctrl-label {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--ink); text-transform: uppercase; letter-spacing: 0.08em;
}

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; align-items: center; }
.leg-label {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--ink); text-transform: uppercase; letter-spacing: 0.07em;
}
.leg-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--ink2);
  border: 1px solid var(--rule); background: var(--white);
  padding: 3px 8px; border-radius: 3px;
}
.leg-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.legend-note { font-size: 10px; color: var(--ink3); margin-left: 6px; }

/* Grid */
.table-wrap { overflow-x: auto; }
.pt-grid {
  display: grid;
  grid-template-columns: repeat(19, 48px);
  grid-template-rows: repeat(11, 48px);
  gap: 2px; width: fit-content;
}

/* Element cells */
.el {
  position: relative; border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.09);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2px 1px;
}
.el:hover {
  transform: scale(1.15); z-index: 20;
  box-shadow: 0 4px 18px rgba(0,71,255,0.2);
  border-color: var(--accent);
}
.el .enum { font-size: 7px; color: rgba(0,0,0,0.4); line-height: 1; align-self: flex-start; margin-left: 3px; }
.el .esym { font-size: 15px; font-weight: 900; line-height: 1.2; }
.el .ename { font-size: 5.8px; color: rgba(0,0,0,0.5); text-align: center; line-height: 1; white-space: nowrap; overflow: hidden; max-width: 46px; text-overflow: ellipsis; margin-bottom: 1px; }
.el .elmarker { position: absolute; top: 2px; right: 2px; font-size: 7px; line-height: 1; }

/* Curie temperature label on cell */
.el .curie-label {
  position: absolute; bottom: 5px; left: 0; right: 0;
  text-align: center;
  font-size: 6.2px; font-weight: 700;
  color: var(--c-curie);
  line-height: 1;
  letter-spacing: 0.02em;
}

/* Category colors — reskinned from UltraFlex to IH Guide */
.cat-excellent    { background: #e8eeff; color: #002080; }
.cat-good         { background: #ebf0ff; color: #1a4278; }
.cat-moderate     { background: #edf2f8; color: #384e72; }
.cat-poor         { background: #f2f3f5; color: #4a5260; }
.cat-semiconductor{ background: #f0edf8; color: #503a80; }
.cat-nonmetal     { background: #f3f5f4; color: #444; }
.cat-noble        { background: #f4f6f8; color: #666; }
.cat-unknown      { background: #f5f5f6; color: #888; }

/* Filter states */
.el.dimmed { opacity: 0.14; pointer-events: none; }
.el.highlighted { border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(0,71,255,0.18); }
.el.fm-hl { border-color: #e68c35 !important; box-shadow: 0 0 0 2px rgba(230,140,53,0.22); }
.el.curie-hl { border-color: var(--c-curie) !important; box-shadow: 0 0 0 2px rgba(192,57,43,0.20); }

/* Grid labels */
.pt-label {
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--ink4); font-weight: 700;
}
.series-gap {
  background: transparent; border: 1px dashed var(--rule);
  border-radius: 3px; display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: var(--ink4); font-weight: 700;
}
.table-hint {
  margin-top: 8px; font-size: 10px; color: var(--ink4);
}

/* ── Info Panel ── */
.info-panel {
  width: 280px; min-width: 280px;
  background: var(--white); border-left: 1px solid var(--rule);
  padding: 22px 18px;
  position: sticky; top: 0;
  height: calc(100vh - 56px);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.info-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--ink4); text-align: center; gap: 8px;
}
.info-empty .big { font-size: 38px; opacity: 0.35; }
.info-empty p { font-size: 12px; line-height: 1.5; }
.info-content { display: none; flex-direction: column; }
.info-content.vis { display: flex; }

.i-sym-row { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 2px; }
.i-sym { font-size: 54px; font-weight: 900; color: var(--accent); line-height: 1; }
.i-z { font-size: 10px; font-weight: 700; color: var(--ink4); padding-bottom: 10px; }
.i-name { font-size: 15px; font-weight: 900; color: var(--ink); margin-bottom: 10px; }
.i-div { height: 1px; background: var(--rule); margin: 8px 0; }

.i-section-head {
  font-size: 9.5px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.09em;
  margin: 10px 0 4px; padding-bottom: 3px;
  border-bottom: 2px solid var(--accent);
}

.i-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 5px 0; font-size: 11px; border-bottom: 1px solid var(--rule);
}
.i-row:last-of-type { border-bottom: none; }
.i-key { color: var(--ink3); }
.i-val { color: var(--ink); font-weight: 700; text-align: right; max-width: 140px; }

/* Conductivity bar */
.cond-wrap { margin: 8px 0 4px; }
.cond-lbl { font-size: 9.5px; font-weight: 700; color: var(--ink3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.cond-track { height: 7px; background: var(--rule); border-radius: 4px; overflow: hidden; }
.cond-fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width 0.3s ease; }
.cond-pct { font-size: 10px; font-weight: 700; color: var(--accent); margin-top: 3px; text-align: right; }

/* Curie temperature gauge */
.curie-block {
  margin: 10px 0 6px; padding: 10px 12px;
  background: #fff5f4; border-radius: 3px;
  border-left: 3px solid var(--c-curie);
}
.curie-block-title {
  font-size: 10px; font-weight: 700; color: var(--c-curie);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 6px;
  display: flex; align-items: center; gap: 5px;
}
.curie-temp { font-size: 22px; font-weight: 900; color: var(--c-curie); line-height: 1; }
.curie-temp-unit { font-size: 12px; font-weight: 700; color: #a04030; }
.curie-sub { font-size: 10px; color: #a04030; margin-top: 3px; }
.curie-track-wrap { margin-top: 8px; }
.curie-track-label { display: flex; justify-content: space-between; font-size: 9px; color: var(--ink3); margin-bottom: 3px; }
.curie-track { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.curie-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #e68c35, var(--c-curie)); transition: width 0.35s ease; }

.no-curie-block {
  margin: 8px 0; padding: 8px 12px;
  background: var(--bg2); border-radius: 3px;
  border-left: 3px solid var(--rule);
  font-size: 11px; color: var(--ink3);
}

/* Tags */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 3px;
  font-size: 11px; font-weight: 700; margin-top: 8px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.tag-yes { background: #e8eeff; color: var(--accent); border: 1px solid var(--accent); }
.tag-no  { background: var(--bg2); color: var(--ink3); border: 1px solid var(--rule); }
.tag-fm  { background: #fff4e6; color: #904e10; border: 1px solid #e68c35; margin-top: 5px; }

.i-note {
  font-size: 11px; color: #555; line-height: 1.55; margin-top: 10px;
  padding: 9px 11px; background: var(--bg2); border-radius: 3px;
  border-left: 3px solid var(--accent);
}
.i-foot { font-size: 9.5px; color: var(--ink4); margin-top: 14px; line-height: 1.5; }

/* Responsive */
@media (max-width: 900px) {
  .main { flex-direction: column; }
  .info-panel {
    width: 100%; min-width: unset;
    height: auto; position: static;
    border-left: none; border-top: 1px solid var(--rule);
  }
}
