/* SealSelectionTool.html: calculator frame copied from css/tank-vent.css
   (itself from ThreadStressCalculator.html). Reference cards come from
   css/kc-calc.css. Page additions at the end. */
.tsc * { box-sizing: border-box; }

/* ── Green wrapper token system (matches ORing-All-Sizes-Groove.html) ── */
:root {
  --sq-wrap:     #1d3f4b;
  --sq-outline:  rgb(67,67,67);
  --sq-panel:    #eeeeee;
  --sq-blue:     #1a6475;
  --sq-ink:      #1C2227;
  --sq-ink-soft: #5A6168;
  --sq-ui:       "Roboto","Roboto Fallback", Arial, sans-serif;
}
.sq-main { max-width: 1500px; margin: 0 auto; padding: 0 20px 60px; }
.sq-subtitle { font-family: var(--sq-ui); color: var(--sq-ink-soft); font-size: 15px; line-height: 1.5; max-width: 70ch; margin: 18px auto 22px; text-align: center; }
.sq-subtitle.sq-crosslink { margin-top: -12px; font-size: 14px; }
.sq-calc-grid { font-family: var(--sq-ui); display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; align-items: start; background: var(--sq-wrap); border: 3px solid var(--sq-outline); border-radius: 18px; box-shadow: 0px 3px 5px 0 rgba(0,0,0,.4); padding: 20px; }
@media (max-width:960px) { .sq-calc-grid { grid-template-columns: 1fr; } }
.sq-panel { background: var(--sq-panel); border: 2px solid var(--sq-outline); border-radius: 10px; box-shadow: 0px 3px 5px 0 rgba(0,0,0,.4); overflow: hidden; }
.sq-panel-h { padding: 11px 16px; background: #fff; border-bottom: 2px solid var(--sq-outline); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--sq-ink); font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sq-panel-b { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
/* The input panel used to follow the scroll. It fought the page on anything
   but a tall window, so it stays put. */
.sq-sticky { position: static; }

/* ── Section cards ── */
.tsc-section {
  background: var(--calc-background-color);
  border: 2px solid var(--calc-outline-color);
  border-radius: 10px;
  padding: 11px 13px;
  box-shadow: 0 2px 5px rgba(0,0,0,.15);
}

/* Section heading */
.tsc-h2 {
  font-family: var(--title-font-family);
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  background: var(--section-title-color);
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

/* Form labels */
.tsc label {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  color: #444;
  font-family: var(--body-font-family);
}

/* Inputs & selects */
.tsc input[type=number],
.tsc select {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid #9aabb0;
  border-radius: var(--border-radius-small);
  font-size: 13px;
  font-family: var(--body-font-family);
  background: #fff;
  color: #222;
}
.tsc input[type=number]:focus,
.tsc select:focus { outline: 2px solid var(--section-title-color); }
.tsc input[readonly] { background: #ececec !important; }

/* Grid helpers */
.tsc-r2 { display: grid; grid-template-columns: 1fr 1fr;     gap: 8px; }
.tsc-r3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.tsc-field { margin-bottom: 8px; }
.tsc-sep   { border-top: 1px solid #c8d0da; margin: 10px 0; }
.tsc-note  { font-size: 11px; color: #666; margin-top: 4px; font-family: var(--body-font-family); }



/* Calculate button */
.tsc-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: var(--font-weight-bold);
  font-family: var(--title-font-family);
  background: var(--section-title-color);
  color: #fff;
  border: none;
  border-radius: var(--border-radius-small);
  cursor: pointer;
  transition: background .2s;
  box-shadow: 0 2px 5px rgba(0,0,0,.2);
}
.tsc-btn:hover { background: #4a6a72; }
.tsc-actions { align-self: end; }
/* Calculate and Copy link side by side. share-link.js stacks its button
   under a full-width one with inline styles, hence the !important. */
.tsc-input-grid > .tsc-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.tsc-actions > .tsc-btn { flex: 1 1 160px; width: auto; }
.tsc-actions > #shareLinkBtn { display: inline-flex !important; align-items: center; justify-content: center; margin: 0 !important; }
.tsc-btn.tsc-btn-secondary { background: #fff; color: var(--section-title-color); border: 1.5px solid var(--section-title-color); padding: 9px 12px; font-size: 13.5px; box-shadow: none; }
.tsc-btn.tsc-btn-secondary:hover { background: var(--section-title-color); color: #fff; }

/* Result table */
.tsc-result-table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--body-font-family); }
.tsc-result-table th { background: var(--section-title-color); color: #fff; padding: 5px 8px; text-align: left; font-size: 12px; }
.tsc-result-table td { padding: 5px 8px; border-bottom: 1px solid #dde; }
.tsc-result-table tr:nth-child(even) td { background: #f2f4f7; }


/* Calc block (monospace intermediate values) */
.tsc-calc-block {
  background: #f8f9fb;
  border: 1px solid #dde;
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  line-height: 1.8;
  white-space: pre-wrap;
}
.tsc-calc-block b { color: #1a3a5c; }

/* Summary cards */
.tsc-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tsc-summary-card { border: 1px solid #c8d0da; border-radius: 6px; padding: 8px; background: #fff; }
.tsc-summary-card .val { font-size: 18px; font-weight: bold; }
.tsc-summary-card .lbl { font-size: 11px; color: #666; }


/* Collapsible intermediate header */
.tsc-intermed-hdr {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; padding: 6px 10px;
  background: var(--section-title-color);
  border-radius: 6px 6px 0 0;
  user-select: none;
}
.tsc-intermed-hdr span { font-size: 14px; font-weight: bold; color: #fff; font-family: var(--title-font-family); }
.tsc-intermed-body { padding: 10px; background: var(--calc-background-color); border: 2px solid var(--calc-outline-color); border-top: none; border-radius: 0 0 6px 6px; }


.tsc-chart-box { position: relative; width: 100%; background: #fff; border: 1px solid #dde; border-radius: 6px; padding: 6px; }

/* Hidden helper */
.tsc-hidden { display: none; }

/* Collapsible input sections: the heading is the toggle */
details.tsc-collapse > summary.tsc-h2 {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 0; user-select: none;
}
details.tsc-collapse[open] > summary.tsc-h2 { margin-bottom: 10px; }
details.tsc-collapse > summary::-webkit-details-marker,
details.tsc-sub > summary::-webkit-details-marker { display: none; }
details.tsc-collapse > summary.tsc-h2::after { content: '\25B6'; font-size: 11px; transition: transform .2s; }
details.tsc-collapse[open] > summary.tsc-h2::after { transform: rotate(90deg); }
details.tsc-sub {
  margin-top: 8px; border: 1px solid #c8d0da; border-radius: 6px; background: #fff;
}
details.tsc-sub > summary {
  cursor: pointer; list-style: none; padding: 6px 10px; font-size: 12px; font-weight: 600;
  color: #2c3e48; font-family: var(--body-font-family); display: flex;
  justify-content: space-between; align-items: center;
}
details.tsc-sub > summary::after { content: '+'; color: #5f6b70; font-size: 14px; }
details.tsc-sub[open] > summary::after { content: '\2212'; }
details.tsc-sub[open] > summary { border-bottom: 1px solid #c8d0da; }
.tsc-sub-b { padding: 8px 10px 4px; }
.tsc label.tsc-chk {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #333;
  margin: 4px 0 8px; cursor: pointer;
}
.tsc label.tsc-chk input { width: 15px; height: 15px; accent-color: var(--section-title-color); }

/* Results area — flex column so gap works between tsc-section cards */
#tsc-results-area { display: flex; flex-direction: column; gap: 12px; }
#tsc-results-area.tsc-hidden { display: none; }   /* the id rule above outranks .tsc-hidden */

/* Input panel — 2-column grid */
/* Two independent columns (1-3-5 | 2-4-6) rather than a grid, so a
   collapsed card sits directly under the card above it instead of
   being stretched to the height of its row-mate. */
.tsc-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.tsc-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.sq-seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid rgb(67,67,67); border-radius: 6px; overflow: hidden; width: fit-content; }
/* Button colours come from site-chrome.css, as on the other calculators. */
.sq-seg button { appearance: none; font: 600 12.5px/1 "Roboto","Roboto Fallback", Arial, sans-serif; padding: 7px 14px; cursor: pointer; }
/* Explainer tooltips, same look as the other calculators. The box is
   positioned by script (position: fixed) so it never clips at the edge
   of the narrow inputs panel. */
.tooltip-icon { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-left: 4px; vertical-align: 1px; border-radius: 50%; background: #1a6475; color: #fff; font: 700 9.5px/1 Roboto, Arial, sans-serif; font-style: normal; cursor: help; user-select: none; }
summary .tooltip-icon { background: #fff; color: #1a6475; }
.tooltip-icon:focus-visible { outline: 2px solid #73dae5; outline-offset: 1px; }
.tooltip-box { display: none; position: fixed; z-index: 10000; width: max-content; max-width: 300px; background: #1a3a40; color: #eee; font: 400 12px/1.55 Roboto, "Roboto Fallback", Arial, sans-serif; text-transform: none; letter-spacing: normal; text-align: left; padding: 8px 11px; border-radius: 6px; border: 1px solid #3a6270; box-shadow: 0 3px 8px rgba(0,0,0,.4); white-space: normal; pointer-events: none; }
.tooltip-box b { color: #fff; }
.tooltip-box.show { display: block; }
/* One column: dissolve the column wrappers and put the cards back in
   1-6 order with `order`. */
@media (max-width: 760px) {
  .tsc-input-grid { display: flex; flex-direction: column; }
  .tsc-col { display: contents; }
}
mjx-container { color: #1a3a40 !important; margin: 0; }
mjx-container[jax="SVG"][display="true"] { margin: 0.7em 0 !important; }
mjx-container[jax="SVG"] { margin: 0 !important; }

/* ── Page additions ── */
.tsc [hidden], .ss-path-wrap[hidden] { display: none !important; }
.ss-em { font-weight: var(--font-weight-medium, 500); color: #1a3a40; }

/* Start here: guides */
.ss-guides { max-width: 1300px; margin: 0 auto 24px; font-family: var(--sq-ui); }
.ss-guides h2 { font-size: 16px; font-weight: 700; color: #1a6475; text-transform: uppercase; letter-spacing: .1em; text-align: center; margin: 0 0 6px; }
.ss-guides-lead, .ss-guides-more { font-size: 14px; color: #333; line-height: 1.55; text-align: center; max-width: 72ch; margin: 0 auto 12px; }
.ss-guides-more { font-size: 13px; margin-top: 12px; }
.ss-guide-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1150px) { .ss-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ss-guide-grid { grid-template-columns: 1fr; } }
.ss-more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
@media (max-width: 760px) { .ss-more-grid { grid-template-columns: 1fr; } }
.ss-more { background: #fff; border: 1px solid #c8d0da; border-radius: 10px; padding: 10px 14px; }
.ss-more h3 { font-size: 14px; font-weight: 700; color: #1a6475; margin: 0 0 6px; }
.ss-more ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: #333; }
.ss-more li { margin-bottom: 4px; }
.ss-guide { background: #fff; border: 2px solid var(--sq-outline); border-top: 6px solid #1a6475; border-radius: 10px; padding: 12px 14px; box-shadow: 0 3px 5px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.ss-guide-no { font: 700 12px/1 Roboto, Arial, sans-serif; letter-spacing: .12em; color: #1a6475; }
.ss-guide h3 { font-size: 16px; font-weight: 700; color: #1C2227; margin: 4px 0 2px; }
.ss-guide-ed { font-size: 12px !important; color: #5A6168 !important; margin-bottom: 6px !important; }
.ss-guide p { font-size: 13px; color: #333; line-height: 1.5; margin: 0 0 6px; }
.ss-guide-link { margin-top: auto; align-self: flex-start; font: 600 13px/1 Roboto, Arial, sans-serif; color: #fff !important; background: #1a6475; border-radius: 5px; padding: 8px 12px; text-decoration: none; }
.ss-guide-link:hover { background: #134b58; }

/* Inputs */
.tsc-section > .tsc-chk { margin-top: 2px; }

/* Results */
.ss-static { font-family: var(--body-font-family); font-size: 13px; color: #333; line-height: 1.55; padding: 4px 6px; }
.ss-static ul { padding-left: 18px; margin: 6px 0; }
.ss-errors { background: #fdecec; border-left: 4px solid #b00000; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: #6a0000; }
.ss-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.ss-stat { background: #fff; border: 1px solid #c8d0da; border-radius: 6px; padding: 4px 9px; font: 12px/1.4 Roboto, Arial, sans-serif; color: #333; }
.ss-stat b { color: #1a3a40; }
.ss-primary { background: #fff; border: 2px solid #1a6475; border-radius: 10px; padding: 12px 14px; box-shadow: 0 2px 6px rgba(0,0,0,.2); font-family: var(--body-font-family); }
.ss-kicker { font: 700 11px/1 Roboto, Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #1a6475; }
.ss-primary h3 { font-size: 19px; font-weight: 700; color: #1C2227; margin: 5px 0 2px; line-height: 1.3; }
.ss-ex { font-size: 12.5px; color: #5A6168; margin: 0 0 8px; }
.ss-why, .ss-cau { margin: 0 0 6px; padding-left: 18px; font-size: 13px; line-height: 1.5; color: #333; }
.ss-cau li { color: #6b4300; }
.ss-cau li::marker { content: '⚠ '; }
.ss-refs { font-size: 11.5px; color: #5A6168; margin-top: 4px; }
.ss-alt { border: 1px solid #c8d0da; background: #fff; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-family: var(--body-font-family); }
.ss-alt:last-child { margin-bottom: 0; }
.ss-alt-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 600; color: #1C2227; }
.ss-alt-n { font: 700 11px/1 Roboto, Arial, sans-serif; color: #fff; background: #5f7a80; border-radius: 10px; padding: 3px 7px; }
.ss-alt .ss-why, .ss-alt .ss-cau { font-size: 12.5px; margin-top: 4px; }
.ss-badge { display: inline-block; font: 700 11px/1.4 Roboto, Arial, sans-serif; border-radius: 4px; padding: 1px 7px; }
.ss-badge.yes { background: #b00000; color: #fff; }
.ss-badge.rec { background: #cc7700; color: #fff; }
.ss-badge.no { background: #1a7a1a; color: #fff; }
.ss-badge.built { background: #1a6475; color: #fff; }
.ss-mat { border-left: 3px solid #1a6475; background: #fff; border-radius: 0 6px 6px 0; padding: 6px 10px; margin: 6px 0; font-size: 13px; font-family: var(--body-font-family); }
.ss-mat.first { border-left-width: 5px; }
.ss-mat-h { font-weight: 600; color: #1C2227; }
.ss-mat p { margin: 2px 0 0; color: #333; line-height: 1.45; font-size: 13px; }
.tsc p, .ss-primary p, .ss-alt p { font-size: 13px; }
.ss-ex { font-size: 12.5px !important; }
.ss-elast-rate { font-size: 11.5px; color: #5A6168; }
.ss-warn-i { font-family: var(--body-font-family); font-size: 12.5px; line-height: 1.5; background: #fff8e6; border-left: 3px solid #cc7700; border-radius: 0 6px 6px 0; padding: 6px 10px; color: #5a3a00; margin-bottom: 6px; }
.ss-warn-i:last-child { margin-bottom: 0; }
.ss-read .ss-src { background: #fff; border: 1px solid #c8d0da; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; font-family: var(--body-font-family); }
.ss-read .ss-src:last-child { margin-bottom: 0; }
.ss-src-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ss-src-h b { color: #1a3a40; }
.ss-src ul { margin: 4px 0 0; padding-left: 18px; color: #333; }
.ss-links { margin: 0; padding-left: 18px; font-size: 13px; font-family: var(--body-font-family); line-height: 1.7; }

/* Decision path */
.ss-path-wrap, .ss-data { max-width: 58rem; margin: 26px auto 0; font-family: var(--sq-ui); }
.ss-path-wrap h2, .ss-data h2 { font-size: 16px; font-weight: 700; color: #1a6475; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 6px; }
.ss-path-wrap > p, .ss-data > p { font-size: 13px; color: #333; line-height: 1.6; margin: 0 0 10px; }
.ss-path { list-style: none; margin: 0; padding: 0 0 0 4px; counter-reset: step; }
.ss-path li { position: relative; padding: 0 0 12px 34px; counter-increment: step; }
.ss-path li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: #1a6475; color: #fff; font: 700 12px/24px Roboto, Arial, sans-serif; text-align: center; }
.ss-path li::after { content: ''; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: #b9c9cd; }
.ss-path li:last-child::after { display: none; }
.ss-path li.kc::before { background: #8a6d3b; }
.ss-node { font-size: 13.5px; color: #1C2227; }
.ss-node b { font-weight: 600; }
.ss-node .ss-ans { display: inline-block; background: #e3eef0; color: #134b58; border-radius: 4px; padding: 0 6px; margin-left: 4px; font-weight: 600; }
.ss-node-t { font-size: 13px; color: #333; line-height: 1.5; margin-top: 2px; }
.ss-node-r { font-size: 11.5px; color: #5A6168; }
.ss-rej { margin-top: 10px; background: #fff; border: 1px solid #c8d0da; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.ss-rej ul { margin: 4px 0 0; padding-left: 18px; }

/* Static tables */
.ss-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ss-types { min-width: 760px; }
.ss-elast-table { min-width: 620px; }
.ss-eq { font-family: 'Courier New', monospace; font-size: 13px; margin: 4px 0; color: #1a3a40; }

@media (max-width: 760px) { .tsc-input-grid { align-items: stretch; } }
@media (max-width: 420px) { .sq-main { padding: 0 8px 40px; } .sq-calc-grid { padding: 8px; border-radius: 12px; } .sq-panel-b { padding: 10px; } .tsc-r2, .tsc-r3 { grid-template-columns: 1fr; } .sq-panel-h { flex-wrap: wrap; } }
/* Detail panels inside an answer */
details.ss-det { margin: 6px 0 4px; border: 1px solid #c8d0da; border-radius: 6px; background: #f7fafb; }
details.ss-det > summary { cursor: pointer; padding: 5px 9px; font: 600 12.5px/1.4 Roboto, Arial, sans-serif; color: #134b58; }
details.ss-det[open] > summary { border-bottom: 1px solid #c8d0da; }
details.ss-det .ss-why { margin: 6px 0; padding-right: 8px; }

/* Redrawn PTFE profile decision trees */
.ss-trees { max-width: 58rem; margin: 26px auto 0; font-family: var(--sq-ui); }
.ss-trees h2 { font-size: 16px; font-weight: 700; color: #1a6475; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 6px; }
.ss-trees > p { font-size: 13px; color: #333; line-height: 1.6; margin: 0 0 8px; }
.ss-tree-box { background: #fff; border: 1px solid #c8d0da; border-radius: 8px; margin: 8px 0; }
.ss-tree-box > summary { cursor: pointer; padding: 8px 12px; font: 600 14px/1.4 Roboto, Arial, sans-serif; color: #1C2227; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ss-tree-box[open] > summary { border-bottom: 1px solid #c8d0da; }
.ss-tree-ref { font-weight: 400; font-size: 12px; color: #5A6168; }
.ss-tree-box.ss-has-hit > summary { background: #e3eef0; }
.ss-tree, .ss-tree ul { list-style: none; margin: 0; padding: 0; }
.ss-tree { padding: 10px 12px 8px; font-size: 13px; line-height: 1.5; color: #333; }
.ss-tree ul { padding-left: 14px; }
.ss-tree li { position: relative; padding: 3px 0 3px 16px; }
.ss-tree li::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1.5px solid #b9c9cd; }
.ss-tree li:last-child::before { bottom: auto; height: 14px; }
.ss-tree li::after { content: ''; position: absolute; left: 0; top: 14px; width: 11px; border-top: 1.5px solid #b9c9cd; }
.ss-tree > li { padding-left: 0; }
.ss-tree > li::before, .ss-tree > li::after { display: none; }
.ss-q { font-weight: 600; color: #134b58; }
.ss-a { display: inline-block; background: #eef4f5; border-radius: 4px; padding: 0 6px; color: #1C2227; }
.ss-leaf { display: inline-block; font: 600 12px/1.5 'Courier New', monospace; background: #1a6475; color: #fff; border-radius: 4px; padding: 0 6px; margin: 1px 1px; white-space: nowrap; }
.ss-leaf.ss-hit { background: #cc7700; box-shadow: 0 0 0 2px #ffd28a; }
.ss-tree-note { font-size: 12px; color: #5A6168; margin: 0 12px 10px; }
.ss-trees-key .ss-leaf { font-size: 11px; }
@media (max-width: 420px) { .ss-tree ul { padding-left: 6px; } .ss-tree li { padding-left: 12px; } .ss-tree li::after { width: 8px; } }
