/* Percentage calculator card */
.pct-card { padding: 24px !important; }
.pct-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin: 0 0 18px; scrollbar-width: none; }
.pct-tabs::-webkit-scrollbar { display: none; }
.pct-tabs button { flex: none; height: 40px; padding: 0 16px; border: 1px solid #d5ded8; border-radius: 999px; background: #fff; color: #334155; font: 600 14.5px inherit; cursor: pointer; transition: background .15s, border-color .15s; }
.pct-tabs button:hover { border-color: #14532d; }
.pct-tabs button.is-on { background: #14532d; border-color: #14532d; color: #fff; }
.pct-sentence { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin: 0 0 8px; }
.pct-word { font-size: 20px; font-weight: 700; color: #172b24; padding-bottom: 12px; }
.pct-field { display: grid; gap: 4px; }
.pct-cap { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #64756d; }
.pct-field input { width: 150px; height: 52px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 12px; background: #f8fafc; color: #111827; font: 700 20px inherit; }
.pct-field input:focus { outline: 2px solid #14532d; outline-offset: 1px; background: #fff; }
.pct-toggle { display: inline-flex; padding: 3px; border: 1px solid #d5ded8; border-radius: 12px; margin-bottom: 4px; }
.pct-toggle button { height: 44px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; font: 700 15px inherit; color: #475569; cursor: pointer; }
.pct-toggle button.is-on { background: #14532d; color: #fff; }
.pct-out { margin-top: 18px; padding: 22px; border-radius: 18px; background: #14532d; color: #fff; }
.pct-big strong { display: block; font-size: clamp(36px, 6vw, 52px); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.pct-say { margin: 8px 0 0; font-size: 16px; line-height: 1.5; color: #d7efe0; }
.pct-viz { margin: 16px 0 4px; }
.pct-bar-row { display: grid; grid-template-columns: 52px 1fr 44px; gap: 10px; align-items: center; font-size: 14px; color: #d7efe0; }
.pct-viz .pct-bar-row:first-child:last-child { grid-template-columns: 1fr; }
.pct-track { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.pct-fill { height: 100%; border-radius: 999px; background: #86efac; transition: width .35s ease; }
.pct-fill.is-after { background: #fde68a; }
.pct-viz-cap { display: block; margin-top: 6px; font-size: 13px; color: #d7efe0; }
.pct-viz .pct-bar-row + .pct-bar-row { margin-top: 8px; }
.pct-steps-h { margin: 18px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #bfe3cc; }
.pct-steps { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.7; color: #fff; font-variant-numeric: tabular-nums; }
.pct-error { margin: 0; font-size: 16px; color: #fde68a; }
.pct-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.pct-actions button { height: 44px; padding: 0 18px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; color: #172b24; font: 700 15px inherit; cursor: pointer; }
.pct-actions button:disabled { opacity: .5; cursor: default; }
.pct-status { font-size: 14px; color: #14532d; font-weight: 600; }
.pct-try { margin-top: 20px; padding-top: 18px; border-top: 1px solid #e2e8f0; }
.pct-try-h { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64756d; }
.pct-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.pct-chip { height: 36px; padding: 0 14px; border: 1px solid #d5ded8; border-radius: 999px; background: #fff; color: #334155; font: 600 14px inherit; cursor: pointer; }
.pct-chip:hover { border-color: #14532d; color: #14532d; background: #f1f5f3; }
@media (max-width: 560px) {
  .pct-card { padding: 16px !important; }
  .pct-field input { width: 100%; }
  .pct-field { flex: 1 1 130px; }
  .pct-word { padding-bottom: 0; flex: 1 1 100%; font-size: 18px; }
  .pct-out { padding: 18px; }
}
html.dark .pct-tabs button, html.dark .pct-chip, html.dark .pct-actions button { background: #141418; border-color: #2a2a33; color: #e2e8f0; }
html.dark .pct-tabs button.is-on { background: #e2e8f0; color: #111827; border-color: #e2e8f0; }
html.dark .pct-word { color: #f1f5f9; }
html.dark .pct-field input { background: #1a1f27; border-color: #334155; color: #f1f5f9; }
html.dark .pct-toggle { border-color: #2a2a33; }
html.dark .pct-toggle button { color: #cbd5e1; }
html.dark .pct-toggle button.is-on { background: #e2e8f0; color: #111827; }
html.dark .pct-out { background: #0f3d21; }
html.dark .pct-try { border-color: #2a2a33; }
html.dark .pct-status { color: #86efac; }

/* The page's global text colours must not reach into the dark result panel. */
html body .pct-out, html body .pct-out .pct-big strong { color: #fff !important; }
html body .pct-out .pct-say, html body .pct-out .pct-viz-cap, html body .pct-out .pct-bar-row, html body .pct-out .pct-bar-row span { color: #d7efe0 !important; }
html body .pct-out .pct-steps, html body .pct-out .pct-steps li { color: #fff !important; }
html body .pct-out .pct-steps-h { color: #bfe3cc !important; }
html body .pct-out .pct-error { color: #fde68a !important; }
html body .pct-out .pct-bar-row strong { color: #fff !important; }
html body .pct-out .pct-track { display: block !important; width: 100%; height: 12px !important; border-radius: 999px; background: rgba(255, 255, 255, .22) !important; overflow: hidden; }
html body .pct-out .pct-fill { display: block !important; height: 100% !important; background: #86efac !important; border-radius: 999px; }
html body .pct-out .pct-fill.is-after { background: #fde68a !important; }
html body .pct-out .pct-steps { padding-left: 22px; }
html body .pct-tabs { flex-wrap: nowrap !important; overflow-x: auto; }
@media (max-width: 560px) {
  html body .pct-sentence { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
  html body .pct-sentence .pct-word { display: none; }
  html body .pct-sentence .pct-field { flex: 1 1 calc(50% - 5px); min-width: 0; }
  html body .pct-sentence .pct-toggle { flex: 1 1 100%; }
  html body .pct-sentence .pct-toggle button { flex: 1; }
  html body .pct-field input { width: 100%; font-size: 18px; }
}
