@import url("/js/punnett.css");
@import url("/js/factor-chain.css");
.study-header{display:flex;justify-content:space-between;gap:1rem;padding:.85rem max(1rem,calc((100% - 1120px)/2));border-bottom:1px solid var(--line);background:var(--paper);font-weight:700}
.study-page{max-width:1120px;margin:0 auto;padding:clamp(1rem,4vw,2.6rem)}
.study-page h1{margin:.1rem 0 .5rem}
.study-page p{max-width:76ch}
.study-controls{display:flex;flex-wrap:wrap;gap:1rem;align-items:end;margin:1.2rem 0}
.study-controls label{flex:1;min-width:190px}
.periodic-scroll{overflow:auto;padding:.45rem;border:1px solid var(--line);border-radius:.25rem}
.periodic-grid{display:grid;grid-template-columns:2rem repeat(18,minmax(3.05rem,1fr));grid-template-rows:1.6rem repeat(9,3.8rem);gap:.2rem;min-width:59rem}
.grid-label{align-self:center;text-align:center;font-size:.69rem;color:var(--muted)}
.element-tile{display:grid;align-content:center;justify-items:start;line-height:1.15;min-width:0;padding:.2rem .27rem;color:#17263c;background:#eff4fa;border:1px solid #9eb0c4;border-radius:.2rem}
.element-tile small{font-size:.62rem}
.element-tile .element-value{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%}
.element-tile strong{font-size:1.1rem}
.element-tile[data-family="alkali-metal"],.element-tile[data-family="alkaline-earth-metal"]{background:#fae3d2}
.element-tile[data-family="transition-metal"],.element-tile[data-family="post-transition-metal"]{background:#dce8fa}
.element-tile[data-family="lanthanide"],.element-tile[data-family="actinide"]{background:#eadff6}
.element-tile[data-family="nonmetal"],.element-tile[data-family="halogen"]{background:#d9efe4}
.element-tile[data-family="noble-gas"],.element-tile[data-family="metalloid"]{background:#f7edcc}
.element-tile[aria-pressed="true"]{background:#173e76;color:#fff;outline:2px solid #173e76;outline-offset:1px}
.muted-tile{opacity:.38}
.study-callout{margin:1.35rem 0;padding:.9rem 1.1rem;background:#f0f5fb;border-left:3px solid #1c4c89}
.study-callout h2{margin:0 0 .45rem}
.study-callout dl{display:grid;grid-template-columns:minmax(6.4rem,12rem) minmax(0,1fr);gap:.3rem .75rem;margin:.35rem 0}
.study-callout dt{font-weight:700}.study-callout dd{margin:0;overflow-wrap:anywhere}
.study-flow{display:flex;align-items:stretch;flex-wrap:wrap;gap:.45rem;padding:0;list-style:none}
.study-flow li{display:flex;align-items:center;gap:.45rem;background:#edf4fa;padding:.55rem .7rem;border-radius:.2rem}
.study-flow li:not(:last-child)::after{content:"→";font-weight:800;margin-left:.2rem}
.study-table{border-collapse:collapse;width:100%;margin:.6rem 0 1rem}
.study-table th,.study-table td{padding:.55rem .7rem;border:1px solid var(--line);vertical-align:top;text-align:left}
.study-table th{background:#e8f1fa}
.study-table-wrap{overflow:auto}
.study-math{background:#f0f5fb;border-left:3px solid #1c4c89;padding:.7rem .85rem;white-space:pre-line;font-variant-numeric:tabular-nums}
.study-links{line-height:1.7}
@media print{.study-header,.study-controls,.study-print,.study-links{display:none}.study-page{padding:0}.study-flow,.study-math,.study-callout{break-inside:avoid}}

.study-factor, .study-compartments { margin: 0; padding: .8rem 1rem; background: #f1f5fa; color: #142039; }
.study-factor { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.study-ratio { display: inline-grid; text-align: center; }
.study-ratio > span:first-child { border-bottom: 1px solid; }
.study-compartments p { margin: 0; padding: .4rem 0; }
.study-membrane { display: flex; gap: .35rem 1rem; flex-wrap: wrap; padding: .5rem .7rem; border-block: 2px solid #003478; background: white; }
.study-membrane strong { flex-basis: 100%; }
@media print {
  .study-factor, .study-compartments, .study-membrane { print-color-adjust: exact; -webkit-print-color-adjust: exact; break-inside: avoid; }
}

.study-report{display:grid;gap:1rem;max-width:46rem}
.study-report label{display:grid;gap:.3rem;font-weight:700}
.study-report input,.study-report select,.study-report textarea{font:inherit;padding:.5rem}
.study-report button{justify-self:start}
.print-credit{display:flex;gap:.8rem;align-items:center;margin-top:2rem;color:#405468;font-size:.83rem;break-inside:avoid}
.print-credit img{width:8rem;height:auto}

.guide-illustration {display:block;width:100%;max-width:48rem;height:auto;margin:.55rem 0 1rem}
@media print {.guide-illustration {break-inside:avoid}}
