/* Free AP Chemistry topic pages (/ap-chem/unit-N/<topic>/). Loaded after /assets/topic.css (the APES topic look) and changes:
   accent = the site's chem color, a periodic-tile hero, the "exam hands you" card, Work it, Find the wrong step. Class prefix ct-. */
.ct-body{--tp-acc:var(--chem);--tp-soft:color-mix(in srgb,var(--chem) 8%,var(--bg))}
.ct .tp-steps li::before{background:var(--chem)}

/* hero with a periodic-table tile */
.ct-hero{display:flex;gap:22px;align-items:center}
.ct-tile{flex:0 0 auto;width:118px;height:132px;border:3px solid var(--ink);border-radius:14px;display:flex;flex-direction:column;justify-content:space-between;padding:8px 10px;background:var(--tp-soft);box-shadow:5px 5px 0 var(--chem)}
.ct-tile b{font-size:2.5rem;font-weight:800;line-height:1;text-align:center;letter-spacing:-.02em}
.ct-tn{font-size:.9rem;font-weight:700}
.ct-ts{font-size:.78rem;font-weight:700;text-align:center;color:var(--chem);font-variant-numeric:tabular-nums}

/* picture: one wide figure, captions as a 2x2 grid under it */
.ct-fig svg{width:100%;height:auto;border-radius:20px}
.ct-steps{display:grid;grid-template-columns:1fr 1fr;gap:14px 26px;margin-top:18px}

/* what the exam hands you */
.ct-sheet{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.ct-sheet>div{border:1px solid var(--line);border-radius:16px;padding:16px 18px}
.ct-sheet h3{margin:0 0 8px;font-size:1rem;letter-spacing:.02em}
.ct-sheet ul{margin:0;padding-left:20px;line-height:1.55}
.ct-sheet li{margin-bottom:6px}
.ct-given{background:var(--panel)}
.ct-given h3::before{content:"";display:inline-block;width:10px;height:10px;border-radius:3px;background:var(--muted);margin-right:8px}
.ct-bring{border-color:color-mix(in srgb,var(--chem) 45%,var(--line))!important;background:var(--tp-soft)}
.ct-bring h3{color:var(--chem)}
.ct-bring h3::before{content:"";display:inline-block;width:10px;height:10px;border-radius:3px;background:var(--chem);margin-right:8px}

/* sim: the balance needs more room than the APES graphs */
.ct-sim{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr)}
.ct-sim .tp-seg button{padding:6px 11px}

/* work it */
.ct-work{border:1px solid var(--line);border-radius:16px;padding:18px;background:var(--panel)}
.ct-wtop{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:flex-start;justify-content:space-between}
.ct-wq{margin:0;font-size:1.08rem;line-height:1.5;flex:1 1 380px}
.ct-giv{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px}
.ct-giv li{background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:4px 10px;font-weight:600;font-size:.9rem;font-variant-numeric:tabular-nums}
.ct-road{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:14px 0 6px}
.ct-road span{border-radius:999px;padding:4px 12px;font-size:.86rem;font-weight:700;transition:background .2s,color .2s,border-color .2s}
.ct-stop{border:2px solid var(--line);color:var(--muted)}
.ct-op{color:var(--muted);font-weight:600!important}
.ct-road span.on{border-color:var(--chem);color:var(--chem)}
.ct-road .ct-stop.on{background:var(--chem);color:#fff}
.ct-road span.all{border-color:var(--tp-good);color:var(--tp-good)}
.ct-wsteps{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-direction:column;gap:10px}
.ct-ws{border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:var(--bg);animation:ctin .25s ease-out}
@keyframes ctin{from{transform:translateY(6px)}to{transform:none}}
@media (prefers-reduced-motion:reduce){.ct-ws{animation:none}}
.ct-wp{margin:0 0 8px;line-height:1.5}
.ct-wn{display:block;font-size:.74rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--chem);margin-bottom:2px}
.ct-wrow{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.ct-wrow input{font:inherit;font-size:1.05rem;font-variant-numeric:tabular-nums;padding:8px 12px;border:2px solid var(--line);border-radius:10px;background:var(--bg);color:var(--ink);width:min(220px,100%)}
.ct-wrow input:focus{outline:none;border-color:var(--chem)}
.ct-wpick{gap:8px}
.ct-opt{font:inherit;text-align:left;padding:9px 14px;border:2px solid var(--line);border-radius:10px;background:var(--bg);color:var(--ink);cursor:pointer;line-height:1.4}
.ct-opt:hover:not(:disabled){border-color:var(--chem)}
.ct-opt.on{border-color:var(--chem);opacity:.6}
.ct-wu{font-weight:700;color:var(--muted)}
.ct-wmsg{margin:8px 0 0;font-size:.95rem;line-height:1.5}
.ct-wmsg:empty{display:none}
.ct-wmsg.no{color:var(--tp-bad)}
.ct-whint{display:block;color:var(--ink);margin-top:4px}
.ct-ws.solved{border-color:color-mix(in srgb,var(--tp-good) 50%,var(--line));background:var(--tp-goodbg)}
.ct-ws.solved .ct-wp{margin-bottom:0;color:var(--muted)}
.ct-ws.shown{border-color:color-mix(in srgb,var(--tp-bad) 40%,var(--line));background:var(--tp-badbg)}
.ct-wline{display:block;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink)}
.ct-wnote{display:block;color:var(--muted);font-size:.9rem;margin-top:2px}
.ct-howto{margin:10px 0 0;font-size:.85rem;color:var(--muted)}
.ct-howto code,.ct-wmsg code{font-size:.85rem;background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:1px 6px}
.ct-final{margin-top:12px;padding:14px 16px;border-radius:12px;border-left:4px solid var(--chem);background:var(--tp-soft);display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between}
.ct-final p{margin:0;flex:1 1 320px;line-height:1.55}

/* find the wrong step */
.ct-err{border:1px solid var(--line);border-radius:16px;padding:18px}
.ct-err h3{margin:0 0 4px;font-size:1.1rem}
.ct-lines{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.ct-line{width:100%;display:flex;gap:12px;align-items:center;text-align:left;font:inherit;font-size:1.02rem;font-variant-numeric:tabular-nums;padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--ink);cursor:pointer}
.ct-line:hover:not([disabled]){border-color:var(--chem)}
.ct-line[disabled]{cursor:default}
.ct-ln{flex:0 0 26px;height:26px;border-radius:50%;border:1.5px solid var(--line);display:grid;place-items:center;font-size:.82rem;font-weight:700}
.ct-line.ok{border-color:var(--tp-good)}
.ct-line.ok .ct-ln{background:var(--tp-good);border-color:var(--tp-good);color:#fff}
.ct-line.bad{border-color:var(--tp-bad);background:var(--tp-badbg)}
.ct-line.bad .ct-ln{background:var(--tp-bad);border-color:var(--tp-bad);color:#fff}
.ct-line.bad>span:last-child{text-decoration:line-through;text-decoration-color:var(--tp-bad)}
.ct-err-msg{margin:10px 0 0;font-weight:600}
.ct-err-msg:empty{display:none}
.ct-err-fix p{line-height:1.55}
.ct-soon{opacity:.65}

@media (max-width:760px){
  .ct-hero{gap:14px;align-items:flex-start}
  .ct-tile{width:84px;height:96px;padding:6px 8px;box-shadow:4px 4px 0 var(--chem)}
  .ct-tile b{font-size:1.75rem}
  .ct-ts{font-size:.6rem}
  .ct-steps,.ct-sheet{grid-template-columns:1fr}
  .ct-sim{grid-template-columns:1fr}
}

/* unit hubs and the topic-notes index */
.tp-usw em.ct-soon-u{display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;padding:0 8px;border:1px dashed var(--line);border-radius:8px;font-size:.86rem;font-weight:600;font-style:normal;color:var(--muted);opacity:.6;cursor:default}
.ct-unit-soon{opacity:.7;border-style:dashed}
.ct-unit-soon p{margin:0}
.ct-more{margin:14px 0 0}
