/* =============================================================
   Percentage Increase Calculator - "Percentify" family, teal/green.
   EVERYTHING IS SCOPED UNDER .pctinc - see sql-formatter.css for why.
   THEME follows the site's data-theme attribute on <html>.
   ============================================================= */

.pctinc {
  --ink: #15181A; --ink-2: #4D545A; --ink-3: #828A91;
  --paper: #ECEEE9; --surface: #FFFFFF; --surface-2: #F6F7F3; --surface-3: #EFF1EC;
  --line: #DCDFD8; --line-2: #C6CABF;
  --brand: #0D6B5A; --brand-2: #13A184; --brand-soft: #DEF0EA; --brand-ink: #0A4C40;
  --neg: #BF4527; --neg-soft: #FAE7E1;
  --gold: #B8791C; --gold-soft: #F8EEDA;
  --radius: 16px; --radius-sm: 10px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow-sm: 0 1px 2px rgba(21,24,26,.05);
  --shadow: 0 2px 4px rgba(21,24,26,.04), 0 18px 44px -24px rgba(21,24,26,.30);
  --shadow-lg: 0 2px 6px rgba(21,24,26,.05), 0 40px 80px -40px rgba(13,107,90,.42);

  background: var(--paper); color: var(--ink); font-family: var(--body);
  font-size: 16px; line-height: 1.62; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .pctinc {
  --ink: #ECEFEA; --ink-2: #A3ABA6; --ink-3: #767E7A;
  --paper: #0D100F; --surface: #161A19; --surface-2: #1D2221; --surface-3: #232928;
  --line: #2A302E; --line-2: #3B4341;
  --brand: #3FCCA9; --brand-2: #5FE0BF; --brand-soft: #0F2B26; --brand-ink: #8CEBD3;
  --neg: #F0785A; --neg-soft: #301710;
  --gold: #E0AE5A; --gold-soft: #2C2211;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 2px 4px rgba(0,0,0,.35), 0 18px 44px -24px rgba(0,0,0,.9);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.4), 0 40px 80px -40px rgba(0,0,0,1);
}

.pctinc *, .pctinc *::before, .pctinc *::after { box-sizing: border-box }
.pctinc h1, .pctinc h2, .pctinc h3, .pctinc h4 { font-family: var(--display); margin: 0; line-height: 1.12; letter-spacing: -.025em; font-weight: 600 }
.pctinc p { margin: 0 }
.pctinc button, .pctinc input, .pctinc select { font: inherit; color: inherit }
.pctinc button { cursor: pointer; background: none; border: 0 }
.pctinc a { color: var(--brand); text-underline-offset: 3px }
.pctinc :focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px }
.pctinc .wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px }
.pctinc .eyebrow { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3) }
.pctinc .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* ---------- in-page section nav ---------- */
.pctinc .section-nav { border-bottom: 1px solid var(--line); background: var(--surface); margin-bottom: 4px }
.pctinc .section-nav__in { display: flex; align-items: center; gap: 18px; min-height: 50px; flex-wrap: wrap }
.pctinc .section-nav a { text-decoration: none; color: var(--ink-2); font-size: 13.5px; font-weight: 500; padding-bottom: 2px; border-bottom: 2px solid transparent }
.pctinc .section-nav a:hover { color: var(--ink); border-bottom-color: var(--line-2) }
.pctinc .section-nav a.here { color: var(--brand-ink); border-bottom-color: var(--brand) }

/* ---------- hero ---------- */
.pctinc .hero { padding: 26px 0 30px; text-align: center; position: relative; overflow: hidden }
.pctinc .hero::before { content: ""; position: absolute; z-index: 0; left: 50%; top: -400px; transform: translateX(-50%); width: 900px; height: 640px; pointer-events: none; background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 15%, transparent), transparent 72%) }
.pctinc .hero > * { position: relative; z-index: 1 }
.pctinc .hero h1 { font-size: clamp(33px,5vw,52px); margin: 16px auto 14px; max-width: 17ch }
.pctinc .hero h1 .up { color: var(--brand); display: inline-flex; align-items: center; gap: .12em }
.pctinc .hero h1 .up svg { width: .62em; height: .62em }
.pctinc .hero .lede { color: var(--ink-2); max-width: 58ch; margin: 0 auto; font-size: 17px }

/* ---------- calculator ---------- */
.pctinc .calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; margin-top: 32px }
.pctinc .tabrail { display: flex; gap: 5px; padding: 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); background: var(--surface-2) }
.pctinc .tabrail::-webkit-scrollbar { display: none }
.pctinc .tab { flex: none; padding: 9px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; border: 1px solid transparent; transition: background .2s, color .2s }
.pctinc .tab:hover { color: var(--ink); background: var(--surface-3) }
.pctinc .tab[aria-selected="true"] { background: var(--brand); color: #fff }
[data-theme="dark"] .pctinc .tab[aria-selected="true"] { color: #0B1614 }

.pctinc .stage { padding: 34px 30px 30px }
.pctinc .sentence { font-family: var(--display); font-size: clamp(20px,2.8vw,29px); font-weight: 500; letter-spacing: -.02em; line-height: 1.9; color: var(--ink) }
.pctinc .slot { font-family: var(--mono); font-size: .82em; font-weight: 500; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); border-radius: 9px; padding: 5px 10px; min-width: 3.4ch; text-align: center; transition: border-color .18s, background .18s, box-shadow .18s }
.pctinc .slot:hover { border-color: var(--line-2) }
.pctinc .slot:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent) }
.pctinc .panel[hidden] { display: none }

.pctinc .quickrow { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 20px }
.pctinc .quickrow .qlab { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-right: 2px }
.pctinc .qchip { font-family: var(--mono); font-size: 12.5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); transition: all .18s }
.pctinc .qchip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft) }
.pctinc .qchip:active { transform: scale(.95) }
.pctinc .qchip.on { background: var(--brand); border-color: var(--brand); color: #fff }
[data-theme="dark"] .pctinc .qchip.on { color: #0B1614 }
.pctinc .quickrow[hidden] { display: none }

/* ---------- result ---------- */
.pctinc .result { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 36px; align-items: center; margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line) }
.pctinc .res-label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3) }
.pctinc .res-value { font-family: var(--display); font-weight: 700; letter-spacing: -.045em; font-size: clamp(44px,7.6vw,72px); line-height: 1; margin: 10px 0 0; color: var(--brand); word-break: break-word; transition: color .3s }
.pctinc .res-value.neg { color: var(--neg) }
.pctinc .res-value.dim { color: var(--ink-3) }
.pctinc .res-value .suf { font-size: .44em; letter-spacing: -.02em; margin-left: .08em; color: var(--ink-3); font-weight: 600 }
.pctinc .res-steps { margin-top: 16px; font-family: var(--mono); font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; overflow-x: auto; white-space: nowrap }
.pctinc .res-note { margin-top: 12px; font-size: 14px; color: var(--ink-2) }
.pctinc .res-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap }
.pctinc .mini-btn { border: 1px solid var(--line); border-radius: 8px; padding: 7px 13px; font-size: 13px; font-weight: 500; color: var(--ink-2); transition: all .18s }
.pctinc .mini-btn:hover { border-color: var(--line-2); color: var(--ink); background: var(--surface-2) }

/* ---------- before / after comparison ---------- */
.pctinc .compare { width: 296px; flex: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px 18px 14px }
.pctinc .bars { display: grid; grid-template-columns: 1fr 62px 1fr; align-items: end; gap: 6px }
.pctinc .barcol { display: flex; flex-direction: column; align-items: center; min-width: 0 }
.pctinc .barval { font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100% }
.pctinc .bartrack { height: 168px; width: 100%; display: flex; align-items: flex-end; justify-content: center }
.pctinc .bar { position: relative; width: 100%; max-width: 78px; height: 0; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 7px 7px 3px 3px; overflow: visible; transition: height .5s cubic-bezier(.22,.9,.28,1) }
.pctinc .bar > span { display: block; width: 100%; transition: height .5s cubic-bezier(.22,.9,.28,1), background-color .3s }
.pctinc .bar .base { background: var(--ink-3); opacity: .3; border-radius: 0 0 3px 3px }
.pctinc .bar .grow { background: var(--brand); border-radius: 7px 7px 0 0 }
.pctinc .bar.down .base { background: var(--neg); opacity: .55; border-radius: 7px 7px 3px 3px }
.pctinc .bar .ghost { position: absolute; bottom: 100%; left: 0; right: 0; height: 0; border: 1.5px dashed var(--neg); border-bottom: 0; border-radius: 7px 7px 0 0; background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--neg) 12%, transparent) 0 5px, transparent 5px 10px); transition: height .5s cubic-bezier(.22,.9,.28,1) }
.pctinc .barlab { margin-top: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); text-align: center; line-height: 1.4 }
.pctinc .deltacol { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 36px; gap: 6px }
.pctinc .delta-badge { font-family: var(--mono); font-size: 11.5px; font-weight: 600; padding: 4px 8px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap }
.pctinc .delta-badge.neg { background: var(--neg-soft); color: var(--neg) }
.pctinc .delta-arrow { color: var(--brand); transition: transform .4s, color .3s }
.pctinc .delta-arrow.down { color: var(--neg); transform: rotate(180deg) }
.pctinc .compare-foot { margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3) }
.pctinc .compare-foot b { color: var(--ink); font-weight: 500 }

.pctinc .chartbox { margin-top: 14px; display: none }
.pctinc .chartbox.show { display: block }
.pctinc .chartbox svg { width: 100%; height: auto; display: block }
.pctinc .chartbox .cap { margin-top: 7px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); text-align: center }

@media (max-width: 860px) { .pctinc .result { grid-template-columns: 1fr; gap: 26px } .pctinc .compare { width: 100%; max-width: 330px } .pctinc .stage { padding: 26px 20px 24px } .pctinc .sentence { line-height: 2.1 } }

/* ---------- sections ---------- */
.pctinc section.block { padding: 56px 0 0 }
.pctinc .block-head { margin-bottom: 22px }
.pctinc .block-head h2 { font-size: clamp(24px,3.4vw,32px); margin: 10px 0 8px }
.pctinc .block-head p { color: var(--ink-2); max-width: 62ch }
.pctinc .tools { display: grid; grid-template-columns: repeat(auto-fit,minmax(258px,1fr)); gap: 16px }
.pctinc .tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: border-color .2s, box-shadow .2s, transform .2s }
.pctinc .tool:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px) }
.pctinc .tool h3 { font-size: 16.5px; display: flex; align-items: center; gap: 9px; margin-bottom: 4px }
.pctinc .tool h3 .tick { width: 7px; height: 7px; border-radius: 2px; background: var(--brand); flex: none }
.pctinc .tool .sub { font-size: 13px; color: var(--ink-3); margin-bottom: 16px }
.pctinc .rowin { display: flex; align-items: center; gap: 10px; margin-bottom: 9px }
.pctinc .rowin label { font-size: 13.5px; color: var(--ink-2); flex: 1; min-width: 0 }
.pctinc .rowin input { width: 104px; flex: none; text-align: right; font-family: var(--mono); font-size: 13.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; transition: border-color .18s, box-shadow .18s }
.pctinc .rowin input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent) }
.pctinc .tool-out { margin-top: auto; padding-top: 15px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 7px }
.pctinc .oline { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13.5px }
.pctinc .oline span { color: var(--ink-3) }
.pctinc .oline b { font-family: var(--mono); font-weight: 500; color: var(--ink); font-size: 14px }
.pctinc .oline.hero-out b { font-family: var(--display); font-size: 23px; font-weight: 700; letter-spacing: -.03em; color: var(--brand) }
.pctinc .oline.hero-out.neg b { color: var(--neg) }

.pctinc .ref-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(268px,1fr)); gap: 16px }
.pctinc .fcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px }
.pctinc .fcard h4 { font-size: 14.5px; font-family: var(--body); font-weight: 600; margin-bottom: 9px }
.pctinc .fcard .fx { font-family: var(--mono); font-size: 12.6px; color: var(--brand); background: var(--brand-soft); border-radius: 7px; padding: 9px 12px; display: block; overflow-x: auto; white-space: nowrap }
.pctinc .fcard .ex { margin-top: 9px; font-size: 13px; color: var(--ink-2) }
.pctinc table.common { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden }
.pctinc table.common th, .pctinc table.common td { padding: 11px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line) }
.pctinc table.common th { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; background: var(--surface-2) }
.pctinc table.common td { font-family: var(--mono); font-size: 13.5px; color: var(--ink-2) }
.pctinc table.common td:first-child { color: var(--ink); font-weight: 500 }
.pctinc table.common tr:last-child td { border-bottom: 0 }
.pctinc table.common tbody tr { transition: background .15s }
.pctinc table.common tbody tr:hover { background: var(--surface-2) }

.pctinc .faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 22px }
.pctinc details { border-top: 1px solid var(--line) }
.pctinc details:first-of-type { border-top: 0 }
.pctinc summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; font-size: 15.5px; display: flex; align-items: center; gap: 12px }
.pctinc summary::-webkit-details-marker { display: none }
.pctinc summary::before { content: ""; width: 9px; height: 9px; flex: none; border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg) translate(1px,-1px); transition: transform .25s }
.pctinc details[open] summary::before { transform: rotate(45deg) }
.pctinc details .ans { padding: 0 0 18px 21px; color: var(--ink-2); font-size: 14.8px }
.pctinc details .ans code { font-family: var(--mono); font-size: 12.8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px }

.pctinc .related { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 14px }
.pctinc .rel { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 17px 19px; text-decoration: none; transition: border-color .2s, transform .2s, box-shadow .2s }
.pctinc .rel:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow) }
.pctinc .rel b { display: block; font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -.02em }
.pctinc .rel span { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-3) }

.pctinc .toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%,20px); background: var(--ink); color: var(--paper); font-size: 13.5px; font-weight: 500; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 60 }
.pctinc .toast.show { opacity: 1; transform: translate(-50%,0) }

@media print { .pctinc .quickrow, .pctinc .toast, .pctinc .tabrail .tab:not([aria-selected="true"]), .pctinc .related { display: none !important } }
@media (prefers-reduced-motion: reduce) { .pctinc * { animation-duration: .001ms !important; transition-duration: .001ms !important } }
