.ionic-practice {
  flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px;
  padding: 8px 20px 12px; color: var(--ink, #233631);
}
.ionic-practice[hidden] { display: none; }
.ionic-practice button { font: inherit; min-height: 44px; }
.pr-toolbar { flex: none; display: flex; align-items: center; gap: 12px; }
.pr-directions { flex: 1; margin: 0; font-size: 14px; line-height: 1.35; }
.ionic-practice .pr-reset { flex: none; min-height: 36px; background: transparent; border: 1px solid #cad4c8; color: #52655b; border-radius: 8px; padding: 7px 10px; font-size: 12px; }
.pr-reset:hover, .pr-secondary:hover:not(:disabled) { background: #eef4eb; }
.pr-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.pr-status { flex: none; min-height: 42px; display: flex; align-items: center; margin: 0; padding: 8px 12px; border-radius: 8px; background: #eef3eb; border-left: 3px solid #8cab8c; font-size: 13px; line-height: 1.35; }
.pr-status-success { color: #245c37; border-color: #548959; background: #eaf4e7; }
.pr-status-retry { color: #805513; border-color: #c68b2b; background: #fff3df; }
.pr-actions, .pr-adjustments { display: flex; flex: none; align-items: center; justify-content: center; gap: 10px; }
.pr-footer { flex:none; display:flex; flex-direction:column; align-items:stretch; gap:8px; padding-top:8px; border-top:1px solid #dce2d9; }
.pr-footer .pr-sort-choices { align-self:center; }
.pr-footer .pr-primary { width:min(100%,360px); }
.ionic-practice .pr-primary { min-width: 180px; padding: 10px 18px; border: 1px solid #196b64; border-radius: 9px; background: #196b64; color: white; font-size: 14px; font-weight: 700; }
.pr-primary:hover:not(:disabled) { background: #115650; }
.ionic-practice .pr-primary:disabled { color: #28643b; background: #eaf4e7; border-color: #c5d8cb; opacity: 1; }
.ionic-practice .pr-secondary { padding: 9px 14px; border: 1px solid #a9c1af; border-radius: 9px; color: #25593c; background: #f2f7ee; font-size: 13px; font-weight: 650; }
.pr-secondary:disabled { opacity: .42; }
.pr-transfer { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: center; gap: 12px; width: min(100%, 660px); min-height: 0; }
.pr-transfer-atom { min-width: 0; text-align: center; padding: 8px; border: 1px solid #dae2d7; border-radius: 12px; background: #fffefa; }
.pr-transfer-atom h3 { margin: 0; font-size: 16px; }
.pr-atom-picture { width: min(100%, 200px); margin: 0 auto; }
.pr-atom-picture svg, .pr-sort-diagram svg, .pr-balance-atom svg { width: 100%; height: 100%; display: block; }
.pr-transfer-arrow { color: #669178; font-size: 30px; text-align: center; }
.pr-particle-counts { display: flex; justify-content: center; gap: 10px; margin: 0; font-size: 13px; line-height: 1.4; }
.pr-charge { margin: 4px 0 0; font-size: 14px; font-weight: 700; }
.pr-positive { color: #356ec0; }
.pr-negative { color: #ad3f5b; }
.pr-progress { display: flex; gap: 8px; flex: none; }
.pr-progress span { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #cad4c8; border-radius: 50%; font-size: 12px; }
.pr-progress .is-current { background: #e3eee6; border-color: #196b64; }
.pr-progress .is-done { background: #196b64; border-color: #196b64; color: white; }
.pr-sort-particle { display: flex; align-items: center; justify-content: center; gap: 20px; min-height: 0; }
.pr-sort-diagram { flex: none; width: 200px; }
.pr-sort-counts h3 { font-size: 16px; margin: 0 0 8px; }
.pr-sort-counts p { margin: 4px 0; font-size: 16px; }
.pr-sort-counts .pr-rule { max-width: 175px; margin-top: 10px; font-size: 12px; color: #64736e; }
.pr-sort-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 530px); flex: none; }
.ionic-practice .pr-group { padding: 10px; border: 1px solid #b9cbbd; border-radius: 9px; background: #f8fbf5; color: #233631; }
.pr-group strong, .pr-group span { display: block; }
.pr-group strong { font-size: 14px; }
.pr-group span { margin-top: 2px; color: #64736e; font-size: 12px; }
.pr-group:hover:not(:disabled) { background: #e8f2e6; border-color: #719c77; }
.pr-group:disabled { opacity: .55; }
.pr-group.is-correct:disabled { border-color: #548959; background: #e5f0e3; color: #205828; opacity: 1; }
.pr-round-label { margin: 0; font-size: 13px; color: #52655b; flex: none; }
.pr-balance-workspace { width: min(100%, 610px); display: grid; grid-template-columns: minmax(0, 1fr) 25px minmax(0, 1.2fr); align-items: center; gap: 10px; min-height: 0; }
.pr-fixed-ion, .pr-chloride-group { text-align: center; min-width: 0; font-size: 14px; }
.pr-fixed-ion { color: #356ec0; }
.pr-chloride-group { color: #a03e55; }
.pr-balance-atom { width: 175px; max-width: 100%; margin: 0 auto; }
.pr-plus { font-size: 25px; color: #64736e; text-align: center; }
.pr-added-ions { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 125px; }
.pr-chloride-ion, .pr-empty-ion { display: grid; place-items: center; flex: 0 1 68px; aspect-ratio: 1; max-width: 68px; border: 1px solid #bf536c; border-radius: 50%; background: #fceaf0; color: #a03e55; font-size: 24px; }
.pr-empty-ion { border-style: dashed; color: #8d9a8f; background: #f8faf6; border-color: #adc1ad; }
.pr-total { font-size: 21px; font-weight: 500; color: #805513; flex: none; }
.pr-total-zero { color: #28643b; }
@media (max-height: 760px) {
  .pr-body { gap: 8px; }
  .pr-atom-picture, .pr-sort-diagram { width: 165px; }
  .pr-balance-atom { width: 145px; }
  .pr-added-ions { min-height: 108px; }
}
@media (max-width: 600px) {
  .ionic-practice { padding: 6px 10px 8px; gap: 6px; }
  .pr-toolbar { gap: 8px; }
  .pr-directions { font-size: 12px; }
  .ionic-practice .pr-reset { padding: 6px 8px; font-size: 11px; }
  .pr-body { gap: 8px; }
  .pr-status { min-height: 44px; padding: 7px 9px; font-size: 12px; }
  .pr-transfer { gap: 4px; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); }
  .pr-transfer-atom { padding: 7px 4px; }
  .pr-transfer-atom h3 { font-size: 13px; }
  .pr-atom-picture { width: 130px; }
  .pr-transfer-arrow { font-size: 20px; }
  .pr-particle-counts { flex-direction: column; gap: 0; font-size: 12px; }
  .pr-charge { font-size: 12px; }
  .pr-sort-particle { gap: 10px; }
  .pr-sort-diagram { width: 150px; }
  .pr-sort-counts h3 { font-size: 14px; margin-bottom: 5px; }
  .pr-sort-counts p { font-size: 14px; }
  .pr-sort-counts .pr-rule { font-size: 11px; max-width: 135px; }
  .pr-sort-choices { gap: 6px; }
  .ionic-practice .pr-group { padding: 8px 3px; }
  .pr-group strong { font-size: 13px; }
  .pr-group span { font-size: 11px; }
  .pr-balance-workspace { grid-template-columns: minmax(0, 1fr) 15px minmax(0, 1.15fr); gap: 5px; }
  .pr-balance-atom { width: 130px; }
  .pr-fixed-ion, .pr-chloride-group { font-size: 12px; }
  .pr-added-ions { min-height: 110px; gap: 4px; }
  .pr-chloride-ion, .pr-empty-ion { font-size: 18px; flex-basis: 48px; max-width: 48px; }
  .pr-total { font-size: 18px; }
}
@media (max-height: 600px) {
  .pr-body { gap: 5px; }
  .pr-atom-picture, .pr-sort-diagram, .pr-balance-atom { width: 100px; }
  .pr-added-ions { min-height: 75px; }
  .pr-status { min-height: 34px; }
  .pr-progress span { width: 23px; height: 23px; }
}
@media print { .ionic-practice { display: none; } }
