/* School and science tools. Loaded only on those pages, after webtools-popular.css. */

.tool[data-webtool] { max-width: 100%; }
.sc-help, .sc-read, .sc-feedback { margin: 0; color: var(--text-2); font-size: 0.92rem; }
.sc-read { min-height: 1.4em; font-variant-numeric: tabular-nums; }
.sc-msg, .sc-warn { margin: 0.35rem 0 0; }
.sc-msg { color: var(--bad, #b42318); }
.sc-warn { color: var(--text); }

.sc-work { grid-column: 1 / -1; min-width: 0; }
.sc-work h3 { margin: 0.2rem 0 0.35rem; font-size: 0.95rem; }
.sc-steps { margin: 0; padding-left: 1.2rem; }
.sc-steps li { margin: 0.28rem 0; overflow-wrap: anywhere; }
.sc-formula { margin: 0; font-size: 1.05rem; font-weight: 600; }

.sc-canvas {
  width: 100%;
  height: min(68vw, 420px);
  min-height: 240px;
  display: block;
  touch-action: none;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: crosshair;
}
.sc-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sc-legend { display: grid; gap: 0.25rem; }
.sc-key { display: flex; align-items: center; gap: 0.45rem; margin: 0; min-height: 1.6em; overflow-wrap: anywhere; }
.sc-key i { flex: 0 0 auto; width: 1.1rem; height: 0.35rem; border-radius: 99px; }

.sc-pt-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.35rem; }
.sc-pt {
  display: grid;
  grid-template-columns: repeat(18, minmax(44px, 1fr));
  grid-auto-rows: auto;
  gap: 3px;
  width: max-content;
  min-width: 100%;
}
.sc-el, .sc-gap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  line-height: 1.05;
  cursor: pointer;
  touch-action: manipulation;
}
.sc-el small, .sc-gap small { font-size: 0.62rem; font-weight: 600; opacity: 0.75; }
.sc-el strong { font-size: 0.95rem; }
.sc-el.sc-on { outline: 2px solid var(--accent); outline-offset: 1px; }
.sc-el.sc-dim { opacity: 0.28; }
.sc-gap { background: var(--bg); color: var(--text-2); border-color: var(--border); border-style: dashed; }
.sc-series, .sc-spacer { grid-column: 1 / -1; }
.sc-series { margin: 0.35rem 0 0; font-size: 0.8rem; font-weight: 700; color: var(--text-2); }
.sc-spacer { height: 0.45rem; }
.sc-el.sc-alkali { background: #ffcdd2; color: #4a1218; }
.sc-el.sc-alkaline { background: #ffe0b2; color: #4a2c00; }
.sc-el.sc-transition { background: #fff3c4; color: #3d3200; }
.sc-el.sc-post { background: #dcedc8; color: #1b3310; }
.sc-el.sc-metalloid { background: #b2ebf2; color: #04343a; }
.sc-el.sc-nonmetal { background: #bbdefb; color: #0d2744; }
.sc-el.sc-halogen { background: #d1c4e9; color: #2a1848; }
.sc-el.sc-noble { background: #f8bbd0; color: #4a1028; }
.sc-el.sc-lanthanide { background: #ffccbc; color: #4a1c0c; }
.sc-el.sc-actinide { background: #e1bee7; color: #3a1244; }

.sc-legend-cats, .sc-hits { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sc-chip {
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.sc-chip.sc-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sc-chip i { display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.35rem; border-radius: 2px; vertical-align: -1px; }
i.sc-alkali { background: #ffcdd2; }
i.sc-alkaline { background: #ffe0b2; }
i.sc-transition { background: #fff3c4; }
i.sc-post { background: #dcedc8; }
i.sc-metalloid { background: #b2ebf2; }
i.sc-nonmetal { background: #bbdefb; }
i.sc-halogen { background: #d1c4e9; }
i.sc-noble { background: #f8bbd0; }
i.sc-lanthanide { background: #ffccbc; }
i.sc-actinide { background: #e1bee7; }

.sc-detail { display: grid; gap: 0.65rem; padding: 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.sc-hero { display: flex; align-items: center; gap: 0.8rem; }
.sc-hero b { font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1; }
.sc-hero p { margin: 0; }
.sc-dl { display: grid; grid-template-columns: minmax(8rem, 40%) 1fr; gap: 0.35rem 0.75rem; margin: 0; }
.sc-dl dt { margin: 0; color: var(--text-2); font-size: 0.82rem; }
.sc-dl dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.sc-res { display: flex; align-items: center; justify-content: center; gap: 0; min-height: 84px; }
.sc-wire { width: 18%; max-width: 4.5rem; height: 6px; background: #bdbdbd; }
.sc-body {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 7px;
  width: min(100%, 260px);
  height: 72px;
  padding: 0 16px;
  border-radius: 36px;
  background: #e4c99a;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.12);
}
.sc-stripe { width: 12px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28); }
.sc-stripe.sc-none { background: repeating-linear-gradient(135deg, transparent, transparent 3px, rgba(0, 0, 0, 0.35) 3px, rgba(0, 0, 0, 0.35) 4px); }

.sc-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.7rem; }
.sc-tt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; background: var(--bg); }
.sc-tt caption { caption-side: top; padding: 0 0 0.25rem; text-align: left; font-weight: 700; }
.sc-tt th, .sc-tt td { padding: 0.2rem 0.35rem; border-bottom: 1px solid var(--border); }
.sc-tt th { text-align: left; font-weight: 500; }
.sc-tt td { text-align: right; font-weight: 650; }
.sc-q { margin: 0; text-align: center; font-size: clamp(1.8rem, 8vw, 2.8rem); font-weight: 750; font-variant-numeric: tabular-nums; }
.sc-quiz input { font-size: 1.35rem; text-align: center; }
.sc-feedback { min-height: 1.4em; font-size: 1.05rem; font-weight: 650; color: var(--text); }
.sc-sheet.sc-screen-off { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media print {
  @page { margin: 12mm; }
  body:has([data-webtool="times"]) * { visibility: hidden; }
  body:has([data-webtool="times"]) .sc-sheet,
  body:has([data-webtool="times"]) .sc-sheet * { visibility: visible; color: #000; background: #fff; }
  body:has([data-webtool="times"]) .sc-sheet,
  body:has([data-webtool="times"]) .sc-sheet.sc-screen-off {
    position: absolute; left: 0; top: 0; width: 100%; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal;
  }
  body:has([data-webtool="times"]) .sc-tables { grid-template-columns: repeat(3, 1fr); }
  body:has([data-webtool="times"]) .sc-tt th,
  body:has([data-webtool="times"]) .sc-tt td { border-bottom-color: #ccc; }
}

@media (max-width: 420px) {
  .sc-dl { grid-template-columns: 1fr; gap: 0.1rem; }
  .sc-dl dd { margin-bottom: 0.35rem; }
}
