/* /prime-factorization-calculator/ page styles. Built from /assets/polyatic.css tokens only (no new colours or fonts). */
.nojs{margin:1.25rem 0 0;padding:0.875rem 1rem;border:1px solid var(--line);border-left:0.25rem solid var(--accent);border-radius:0.625rem;background:var(--surface);color:var(--ink);font-size:0.9375rem;line-height:1.6}

.pf-head .sub{margin-bottom:0.75rem}
@media(max-width:519px){.pf-head h1{margin-bottom:0.125rem}.pf-head .sub{font-size:0.9375rem;line-height:1.4;margin-bottom:0.5rem}}

/* phone: the number, then the answer and drawings. Desktop: the number left, the drawings right. */
.pf-tool{display:grid;gap:0.75rem;grid-template-columns:minmax(0,1fr)}
@media(min-width:920px){.pf-tool{grid-template-columns:minmax(0,.62fr) minmax(0,1.38fr);gap:1.25rem;align-items:start}}
.pf-card{padding:0.75rem;min-width:0}
@media(min-width:520px){.pf-card{padding:1.125rem}}

.pf-k{display:block;font-family:var(--mono);font-size:0.6875rem;font-weight:500;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:0.25rem}
.pf-f{display:block;min-width:0}
#n{width:100%;min-height:2.875rem;padding:0.4375rem 0.625rem;font-family:var(--mono);font-size:1.25rem;font-variant-numeric:tabular-nums}
.pf-ex{display:flex;flex-wrap:wrap;gap:0.375rem;margin:0.5rem 0 0.625rem}
.pf-ex .chip{font-family:var(--mono);font-size:0.8125rem}
.pf-split{margin:0;flex-wrap:nowrap}
.pf-split button{padding:0.5rem 0.375rem;min-width:0;font-size:0.875rem}
.pf-msg{margin:0.625rem 0 0;color:var(--bad);font-weight:600;font-size:0.9375rem;line-height:1.5;overflow-wrap:anywhere}
.pf-msg[hidden]{display:none}
input[aria-invalid=true]{border-color:var(--bad)}
.pf-hint{color:var(--muted);font-size:0.8125rem;line-height:1.5;margin:0.5rem 0 0}

/* answer */
.pf-result{border-left:0.25rem solid var(--signal);padding:0.125rem 0 0.125rem 0.75rem;margin-bottom:0.75rem;min-height:1.5rem}
.pf-result:empty{display:none}
.pf-ans{margin:0;font-family:var(--mono);font-size:1.375rem;line-height:1.35;font-weight:650;color:var(--ink);overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.pf-line{margin:0.25rem 0 0;font-size:0.9375rem;line-height:1.45;color:var(--ink-2);overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.pf-lk{font-family:var(--mono);font-size:0.6875rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-right:0.25rem}
.pf-prime{display:inline-block;margin-top:0.375rem;padding:0.125rem 0.5rem;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-weight:650;font-size:0.875rem}

/* drawings */
.pf-pics{display:flex;flex-wrap:wrap;gap:0.75rem;align-items:flex-start}
.pf-fig{margin:0;min-width:0}
.pf-treefig{flex:1 1 13rem}
.pf-ladfig{flex:0 1 auto;max-width:100%}
.pf-scroll{overflow:auto;-webkit-overflow-scrolling:touch;background:var(--surface-2);border:1px solid var(--line);border-radius:0.5rem;padding:0.5rem;max-width:100%;max-height:30rem}
#treeBox svg{display:block;margin:0 auto;max-width:none;height:auto}
#treeBox.fit svg{max-width:100%}
.pf-ladder{border-collapse:collapse;font-family:var(--mono);font-size:1rem;font-variant-numeric:tabular-nums;color:var(--ink)}
.pf-ladder td{padding:0.1875rem 0.5rem;text-align:right;white-space:nowrap}
.pf-ladder td.d{color:var(--accent);font-weight:650;border-right:2px solid var(--ink)}
.pf-ladder tr:not(:last-child) td.v{border-bottom:2px solid var(--ink)}
.pf-ladder tr:last-child td.d{border-right-color:transparent}
.pf-actions{display:flex;flex-wrap:wrap;gap:0.5rem;align-items:center;margin-top:0.75rem}
.pf-actions .pf-hint{margin:0}
.btn.pf-small{height:auto;min-height:2.5rem;padding:0.5rem 0.875rem;font-size:0.875rem}

/* steps + divisors */
.pf-below{display:grid;gap:0.75rem;margin-top:0.75rem;grid-template-columns:minmax(0,1fr)}
@media(min-width:920px){.pf-below{grid-template-columns:minmax(0,1.3fr) minmax(0,.7fr);gap:1.25rem;margin-top:1.25rem;align-items:start}}
.pf-sec{font-size:0.8125rem;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);margin:0 0 0.5rem}
.pf-sub{font-size:0.9375rem;margin:0.5rem 0 0.25rem;color:var(--ink)}
.pf-list{margin:0;padding-left:1.5rem;max-width:75ch;font-size:0.9375rem;line-height:1.55;color:var(--ink-2)}
.pf-list li{margin:0 0 0.25rem}
.pf-divlist{margin:0.5rem 0 0;font-family:var(--mono);font-size:0.875rem;line-height:1.6;color:var(--ink-2);overflow-wrap:anywhere;max-height:16rem;overflow:auto}

/* practice sheet */
.pf-sheetcard{margin-top:0.75rem}
@media(min-width:920px){.pf-sheetcard{margin-top:1.25rem}}
.pf-sheetform{display:grid;gap:0.5rem;grid-template-columns:repeat(4,minmax(0,1fr));max-width:36rem}
.pf-sheetform input,.pf-sheetform select{width:100%;min-height:2.5rem;font-family:var(--mono)}
.pf-sheet{margin-top:0.75rem}
.pf-page{background:var(--surface);border:1px solid var(--line);border-radius:0.5rem;padding:0.75rem;margin-top:0.75rem}
.pf-page h3{margin:0 0 0.25rem;font-size:1rem}
.pf-page .pf-meta{margin:0 0 0.5rem;font-family:var(--mono);font-size:0.75rem;color:var(--muted)}
.pf-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0.5rem}
.pf-cell{border:1px dashed var(--line-2);border-radius:0.375rem;padding:0.25rem;min-width:0;text-align:center}
.pf-cell svg{max-width:100%;height:auto;display:block;margin:0 auto}
.pf-cell .pf-a{font-family:var(--mono);font-size:0.8125rem;margin:0.25rem 0 0;overflow-wrap:anywhere;color:var(--ink)}

.explainer .pf-cannot{color:var(--muted);font-size:0.9375rem;margin:0 0 0.75rem;padding-left:1.25rem}
.explainer .pf-cannot li{margin:0 0 0.5rem}

.modes button:focus-visible,.btn:focus-visible,.chip:focus-visible,#n:focus-visible,.pf-sheetform input:focus-visible,.pf-sheetform select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* print: the working (default), or only the practice sheet when body.pf-ps */
@media print{
  header.brand,.skip-link,.pf-in,.pf-actions,.explainer-row,footer.site,.tool-head .sub,.nojs,.pf-sheetcard,.pf-divs{display:none!important}
  body,.wrap{background:#fff!important;color:#000!important}
  .card{box-shadow:none!important;border:0!important;background:#fff!important}
  .pf-tool,.pf-below{display:block}
  .pf-scroll{overflow:visible;max-height:none;border:0;background:#fff}
  .pf-list{color:#000;font-size:11pt;max-width:none}
  .pf-ladder,.pf-ladder td.d{color:#000}
  body.pf-ps .tool-head,body.pf-ps .pf-tool,body.pf-ps .pf-below{display:none!important}
  body.pf-ps .pf-sheetcard{display:block!important;padding:0}
  body.pf-ps .pf-sheetcard>*:not(.pf-sheet){display:none!important}
  .pf-page{border:0;padding:0;margin:0;background:#fff;break-after:page}
  .pf-page:last-child{break-after:auto}
  .pf-cell{border-color:#999;break-inside:avoid}
  .pf-cell .pf-a,.pf-page .pf-meta{color:#000}
}
