/* EduFabTech — chemistry.css (kimya; 17 Eki 2026). Önek ch-. Pano / sekme / kutucuk electronics.css'ten (el-, calc-tab). */

/* ── kategori renkleri (tek kaynak: data-cat). :is(...) özgüllüğü .ch-el varsayılanını ezer; ısı / hâl kuralları sonra gelir ve onları ezer. ── */
:is(.ch-el, .ch-fc, .ch-tile, .ch-leg)[data-cat="alkali"]          { --c: #ff7b72; }
:is(.ch-el, .ch-fc, .ch-tile, .ch-leg)[data-cat="alkaline-earth"]  { --c: #ffa657; }
:is(.ch-el, .ch-fc, .ch-tile, .ch-leg)[data-cat="transition"]      { --c: #e3b341; }
:is(.ch-el, .ch-fc, .ch-tile, .ch-leg)[data-cat="post-transition"] { --c: #56d4c1; }
:is(.ch-el, .ch-fc, .ch-tile, .ch-leg)[data-cat="metalloid"]       { --c: #79c0ff; }
:is(.ch-el, .ch-fc, .ch-tile, .ch-leg)[data-cat="nonmetal"]        { --c: #7ee787; }
:is(.ch-el, .ch-fc, .ch-tile, .ch-leg)[data-cat="halogen"]         { --c: #d2a8ff; }
:is(.ch-el, .ch-fc, .ch-tile, .ch-leg)[data-cat="noble-gas"]       { --c: #ff9bce; }
:is(.ch-el, .ch-fc, .ch-tile, .ch-leg)[data-cat="lanthanide"]      { --c: #f0c987; }
:is(.ch-el, .ch-fc, .ch-tile, .ch-leg)[data-cat="actinide"]        { --c: #e49fe6; }

.ch-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.ch-chips .chip { cursor: pointer; font-size: 12.5px; }
.ch-chips .chip.mono, .chip.mono { font-family: var(--mono); }

/* ── periyodik tablo ── */
.ch-ptbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.ch-search { max-width: 260px; flex: 1 1 200px; }
.ch-temp { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: rgba(16,20,28,.72); }
.ch-temp input[type=range] { flex: 1 1 220px; accent-color: #43d49b; }
.ch-temp-keys { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ch-temp-keys .chip { cursor: pointer; font-size: 12px; }
.ch-pt-wrap { overflow-x: auto; padding: 2px 2px 8px; -webkit-overflow-scrolling: touch; }
.ch-pt {
  display: grid; gap: 3px; min-width: 900px;
  grid-template-columns: repeat(18, minmax(46px, 1fr));
  grid-template-rows: 18px repeat(7, 58px) 14px repeat(2, 58px);
}
.ch-gh { grid-row: 1; text-align: center; font-size: 10.5px; color: var(--muted); font-family: var(--mono); align-self: end; }
.ch-ph { display: flex; align-items: center; justify-content: center; font-size: 10.5px; color: var(--muted); font-family: var(--mono); border: 1px dashed var(--border-2); border-radius: 6px; }
.ch-el {
  --c: #8b949e; position: relative; display: flex; flex-direction: column; justify-content: space-between; min-width: 0;
  padding: 3px 4px 3px 5px; border-radius: 6px; text-decoration: none; color: var(--text);
  background: color-mix(in srgb, var(--c) 17%, #0f141c); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: inset 3px 0 0 var(--c); transition: transform .08s, opacity .15s, box-shadow .15s, background .2s;
}
.ch-el:hover { transform: translateY(-1px); text-decoration: none; box-shadow: inset 3px 0 0 var(--c), 0 0 0 1px var(--c), 0 6px 14px rgba(0,0,0,.35); z-index: 1; }
.ch-el.is-on { box-shadow: inset 3px 0 0 var(--c), 0 0 0 2px #43d49b, 0 0 16px rgba(67,212,155,.45); z-index: 2; }
.ch-el.is-dim { opacity: .16; }
.ch-z { font-size: 9.5px; line-height: 1; color: var(--text-2); font-family: var(--mono); }
.ch-s { font-size: 18px; font-weight: 700; line-height: 1.05; letter-spacing: -.01em; }
.ch-n { font-size: 8.6px; line-height: 1.1; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-m { font-size: 8.6px; line-height: 1; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; }

/* ısı haritası: --heat 0..1 (mavi → kırmızı) */
.ch-el.is-heat { --c: hsl(calc(225 - 225 * var(--heat)) 75% 58%); background: hsl(calc(225 - 225 * var(--heat)) 55% 24%); }
.ch-el.is-nodata { --c: #3a4250; background: #12161e; color: var(--muted); }
/* hâl */
.ch-el[data-state="solid"]   { --c: #c9d1d9; background: #1c222c; }
.ch-el[data-state="liquid"]  { --c: #58a6ff; background: #0f2744; }
.ch-el[data-state="gas"]     { --c: #f0b24a; background: #2a2011; border-style: dashed; }
.ch-el[data-state="unknown"] { --c: #3a4250; background: #12161e; color: var(--muted); }
/* blok */
.ch-el[data-block="s"] { --c: #ff7b72; } .ch-el[data-block="p"] { --c: #7ee787; } .ch-el[data-block="d"] { --c: #79c0ff; } .ch-el[data-block="f"] { --c: #d2a8ff; }
[data-ch-mode="b"] .ch-el { background: color-mix(in srgb, var(--c) 17%, #0f141c); }

/* odak kartı: tablonun üst ortasındaki boşluk (1–3. periyot, 3–12. sütun) */
.ch-focus { grid-row: 2 / 5; grid-column: 3 / 13; display: flex; gap: 12px; align-items: stretch; padding: 4px 8px; min-width: 0; overflow: hidden; }
.ch-focus > p { margin: auto 0; font-size: 12.5px; line-height: 1.5; }
.ch-fc { --c: #8b949e; flex: 0 0 104px; display: flex; flex-direction: column; justify-content: space-between; padding: 8px 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--c) 22%, #0f141c); border: 1px solid var(--c); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 30%, transparent); }
.ch-fc-z { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.ch-fc-s { font-size: 40px; font-weight: 800; line-height: 1; }
.ch-fc-m { font-size: 12px; color: var(--text-2); }
.ch-fd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.ch-fd-h strong { font-size: 16px; }
.ch-fd-g { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; }
.ch-fd-g > span:nth-child(odd) { color: var(--muted); white-space: nowrap; }
.ch-fd-g > span:nth-child(even) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-fd-a { display: flex; gap: 10px; align-items: center; margin-top: auto; }
.ch-fd-a .chip { cursor: pointer; font-size: 12px; }

.ch-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.ch-leg { --c: #8b949e; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; color: var(--text-2);
  border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); cursor: default; }
button.ch-leg { cursor: pointer; }
.ch-leg::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.ch-leg.on { color: var(--text); background: color-mix(in srgb, var(--c) 30%, transparent); }
.ch-leg[data-state="solid"] { --c: #c9d1d9; } .ch-leg[data-state="liquid"] { --c: #58a6ff; } .ch-leg[data-state="gas"] { --c: #f0b24a; } .ch-leg[data-state="unknown"], .ch-leg.is-nodata { --c: #3a4250; }
.ch-leg[data-block="s"] { --c: #ff7b72; } .ch-leg[data-block="p"] { --c: #7ee787; } .ch-leg[data-block="d"] { --c: #79c0ff; } .ch-leg[data-block="f"] { --c: #d2a8ff; }
.ch-heatleg { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.ch-heatbar { width: 160px; height: 10px; border-radius: 6px; background: linear-gradient(90deg, hsl(225 55% 40%), hsl(112 55% 40%), hsl(0 55% 45%)); }

/* ── hesap bölmeleri ── */
.ch-formula { font-size: 17px; }
.ch-big { font-family: var(--mono); font-size: 22px; font-weight: 600; color: #e9fff5; min-height: 1.4em; overflow-wrap: anywhere; text-shadow: 0 0 14px rgba(67,212,155,.3); }
.ch-eqout { margin: 14px 0 12px; padding: 12px 14px; border: 1px solid rgba(67,212,155,.35); border-radius: 12px; background: rgba(16,20,28,.72); }
.ch-err { color: var(--err); font-size: 14px; font-family: var(--sans, inherit); text-shadow: none; font-weight: 500; }
.ch-tablewrap { overflow-x: auto; }
.ch-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ch-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.ch-table td { padding: 6px 8px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.ch-table td a { text-decoration: none; font-weight: 600; }
.ch-bar { display: inline-block; vertical-align: middle; width: 60px; height: 6px; margin-right: 8px; border-radius: 4px; background: linear-gradient(90deg, #43d49b var(--w), rgba(255,255,255,.08) var(--w)); }
.ch-stoich tr.is-lim td { background: rgba(240,178,74,.08); }
.ch-stoich tr.is-lim td:first-child { box-shadow: inset 3px 0 0 #f0b24a; }
.ch-stoich .ch-in { max-width: 220px; }
.ch-eqgrid { margin-top: 4px; }
.ch-sub { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.ch-h3 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.ch-emp { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 10px; margin-bottom: 10px; align-items: end; }
.ch-emprow { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px; }
.ch-in { display: flex; gap: 6px; align-items: center; min-width: 0; }
.ch-in .input { flex: 1 1 80px; min-width: 0; }
.ch-in .ch-unit { flex: 0 0 auto; width: auto; max-width: 160px; min-width: 0; padding: 8px 10px; }
.ch-u { font-family: var(--mono); font-size: 12.5px; color: #5ad7ff; white-space: nowrap; }
.ch-field.is-solved .input { border-color: rgba(67,212,155,.55); color: #43d49b; background: rgba(67,212,155,.06); cursor: default; }
.ch-field.is-solved .el-label::after { content: " · calculated"; color: #43d49b; text-transform: none; letter-spacing: 0; }
.ch-modes { margin: 0 0 14px; }
.ch-units .select { flex: 0 1 120px; min-width: 0; }
.ch-gasrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ch-amt { margin-bottom: 10px; }
.ch-amt .select { width: 100%; }
.ch-allel { line-height: 1.9; font-size: 13.5px; }
.ch-allel a { margin-right: 4px; }

/* ── element sayfası ── */
.ch-elpage { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: start; }
.ch-tile { --c: #8b949e; display: grid; grid-template-rows: auto 1fr auto auto; aspect-ratio: 1; max-width: 240px; padding: 14px 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--c) 22%, #0f141c); border: 1px solid var(--c); box-shadow: inset 5px 0 0 var(--c), 0 0 34px color-mix(in srgb, var(--c) 25%, transparent); }
.ch-tile-z { font-family: var(--mono); font-size: 18px; color: var(--text-2); }
.ch-tile-s { font-size: 86px; font-weight: 800; line-height: 1; align-self: center; letter-spacing: -.03em; }
.ch-tile-n { font-size: 18px; font-weight: 600; }
.ch-tile-m { font-family: var(--mono); font-size: 15px; color: var(--text-2); }
.ch-mini { display: grid; grid-template-columns: repeat(18, 1fr); grid-template-rows: repeat(10, 12px); gap: 2px; margin: 18px 0 6px; max-width: 300px; }
.ch-mini .ch-el { padding: 0; border-radius: 2px; border: 0; background: color-mix(in srgb, var(--c) 35%, #0f141c); box-shadow: none; }
.ch-mini .ch-el.is-on { background: #43d49b; box-shadow: 0 0 8px #43d49b; }
.ch-mini .ch-el:hover { transform: none; background: var(--c); }
.ch-mini-cap { font-size: 12.5px; margin: 0 0 14px; }
.ch-elnav { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-props { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ch-props th { text-align: left; font-weight: 500; color: var(--text-2); padding: 8px 12px 8px 0; width: 42%; border-bottom: 1px solid var(--hair); vertical-align: top; }
.ch-props td { padding: 8px 0; border-bottom: 1px solid var(--hair); font-family: var(--mono); font-size: 14px; }
.ch-props td .muted { font-family: inherit; font-size: 12.5px; }
.ch-h2 { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; margin: 26px 0 4px; }
.ch-src { font-size: 12.5px; margin: 22px 0 0; line-height: 1.6; }

@media (max-width: 860px) {
  .ch-elpage { grid-template-columns: 1fr; }
  .ch-tile { max-width: 200px; }
  .ch-tile-s { font-size: 70px; }
}
@media (max-width: 640px) {
  .ch-ptbar { flex-direction: column; align-items: stretch; }
  .ch-search { max-width: none; flex: 0 0 auto; }
  .ch-big { font-size: 18px; }
  .el-two.ch-amt, .ch-gasrow { grid-template-columns: minmax(0, 1fr); }
  .ch-stoich .ch-in { min-width: 150px; }
  .ch-props th { width: 48%; font-size: 13px; }
  .ch-props td { font-size: 13px; }
}
