.public-tool {
  --pt-ink: #122d2a;
  --pt-ink-soft: #23433f;
  --pt-muted: #607370;
  --pt-line: #d6e2dd;
  --pt-paper: #f6f9f7;
  --pt-mint: #e6f4ee;
  --pt-green: #0f6e58;
  --pt-green-dark: #0a4d40;
  --pt-gold: #c99a3a;
  --pt-cream: #f7f3e8;
  color: var(--pt-ink);
  background: #fff;
  border: 1px solid var(--pt-line);
  border-radius: 20px;
  box-shadow: 0 18px 52px rgba(18, 45, 42, .1);
  margin: 28px 0;
  overflow: hidden;
}

.pt-source-head,
.pb-ticket-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 26px;
  padding: 28px 30px 26px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px) 0 0 / 48px 100%,
    radial-gradient(circle at 88% 4%, rgba(201, 154, 58, .25), transparent 34%),
    linear-gradient(128deg, #122d2a, #0c5b4a);
}

.pb-ticket-head {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 48px 100%,
    radial-gradient(circle at 86% 0, rgba(255, 217, 123, .24), transparent 34%),
    linear-gradient(128deg, #17342f, #0f6e58);
}

.pt-head-copy { max-width: 760px; }

.pt-source-head h3,
.pb-ticket-head h3 {
  margin: 6px 0 7px;
  color: #fff;
  font: 750 clamp(1.32rem, 2.2vw, 1.9rem)/1.18 Poppins, Arial, sans-serif;
  letter-spacing: -.025em;
}

.pt-source-head p,
.pb-ticket-head p {
  max-width: 720px;
  margin: 0;
  color: #d4e6e0;
  font-size: .9rem;
  line-height: 1.55;
}

.pt-kicker {
  color: #8ee0c2;
  font: 750 .68rem/1.2 "IBM Plex Mono", monospace;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.pt-status-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 310px;
  min-height: 39px;
  padding: 8px 13px;
  color: #edf8f4;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  font: 650 .72rem/1.35 Poppins, Arial, sans-serif;
  text-align: center;
}

.pt-status-badge::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: #82e0bd;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(130, 224, 189, .13);
}

.pt-status-badge i { display: none; }
.pt-status-badge.is-error::before { background: #f1aa9f; box-shadow: 0 0 0 4px rgba(241, 170, 159, .14); }

.pt-trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #f8fbf9;
  border-bottom: 1px solid var(--pt-line);
}

.pt-trust-strip span {
  min-width: 0;
  padding: 11px 18px;
  color: var(--pt-muted);
  border-right: 1px solid var(--pt-line);
  font-size: .72rem;
  text-align: center;
}

.pt-trust-strip span:last-child { border-right: 0; }
.pt-trust-strip b { color: var(--pt-ink); font-weight: 750; }

.pt-step-grid,
.pb-check-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
}

.pb-check-layout { grid-template-columns: minmax(0, .95fr) minmax(390px, 1.05fr); }

.pt-panel {
  min-width: 0;
  padding: 28px 30px 30px;
}

.pt-panel + .pt-panel { border-left: 1px solid var(--pt-line); }

.pt-step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--pt-green-dark);
  font: 750 .72rem/1.2 Poppins, Arial, sans-serif;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.pt-step b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: var(--pt-green);
  border-radius: 8px;
  font: 750 .68rem/1 "IBM Plex Mono", monospace;
  letter-spacing: 0;
}

.pt-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pt-fields label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: #2f4945;
  font-size: .78rem;
  font-weight: 700;
}

.pt-fields .pt-wide { grid-column: 1 / -1; }

.pt-fields input,
.pt-fields select,
.pt-fields textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  color: var(--pt-ink);
  background: #fff;
  border: 1px solid #b9cbc4;
  border-radius: 10px;
  font: 500 .88rem/1.4 Poppins, Arial, sans-serif;
  transition: border-color .16s, box-shadow .16s, background .16s;
}

.pt-fields textarea {
  min-height: 110px;
  resize: vertical;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .02em;
}

.pt-fields input:hover,
.pt-fields select:hover,
.pt-fields textarea:hover { border-color: #91aea3; }

.pt-fields input:focus,
.pt-fields select:focus,
.pt-fields textarea:focus,
.public-tool button:focus-visible,
.public-tool a:focus-visible {
  border-color: var(--pt-green);
  outline: 3px solid rgba(15, 110, 88, .16);
  outline-offset: 1px;
}

.pt-fields input:disabled,
.pt-fields select:disabled,
.pt-fields textarea:disabled { color: #768481; background: #f1f4f2; cursor: wait; }

.pt-fields small {
  color: var(--pt-muted);
  font-size: .69rem;
  font-weight: 450;
  line-height: 1.45;
}

.pt-group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
  padding-top: 15px;
  border-top: 1px solid var(--pt-line);
}

.pt-selected + .pt-group-title { margin-top: 0; padding-top: 0; border-top: 0; }
.pt-group-title span { color: var(--pt-ink); font-size: .76rem; font-weight: 800; }
.pt-group-title small { color: var(--pt-muted); font-size: .66rem; }

.pt-live {
  margin: 15px 0 0;
  padding: 11px 13px;
  color: #405d58;
  background: #edf6f2;
  border-left: 3px solid #69af98;
  border-radius: 0 8px 8px 0;
  font-size: .75rem;
  line-height: 1.55;
}

.pt-empty {
  padding: 19px;
  color: var(--pt-muted);
  background: #fff;
  border: 1px dashed #b6c9c1;
  border-radius: 11px;
  font-size: .78rem;
}

.pt-caution,
.pb-data-foot {
  margin: 0;
  padding: 15px 30px;
  color: #52645f;
  background: var(--pt-cream);
  border-top: 1px solid #e4ddc9;
  font-size: .74rem;
  line-height: 1.55;
}

.pb-data-foot {
  display: flex;
  justify-content: space-between;
  gap: 26px;
}

.pb-data-foot span { max-width: 56ch; }

.pv-matches {
  display: grid;
  gap: 10px;
  max-height: 610px;
  margin-top: 14px;
  padding-right: 5px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #97b4aa transparent;
}

.pv-match {
  padding: 15px;
  background: #fff;
  border: 1px solid var(--pt-line);
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(18, 45, 42, .045);
}

.pv-match p {
  margin: 10px 0;
  color: #243d39;
  font: 500 .78rem/1.62 Poppins, Arial, sans-serif;
  white-space: pre-wrap;
}

.pv-match > a,
.pb-win-card > a,
.pb-guide-link,
.pb-next a {
  color: var(--pt-green);
  font-size: .71rem;
  font-weight: 750;
}

.pv-trail { display: flex; flex-wrap: wrap; gap: 6px; }

.pv-trail span {
  padding: 4px 7px;
  color: #47625d;
  background: #eaf4ef;
  border-radius: 999px;
  font: 650 .63rem/1.25 "IBM Plex Mono", monospace;
}

.pv-trail span:first-child { color: #fff; background: var(--pt-ink-soft); }
.pv-rate-choices { display: grid; gap: 7px; margin: 11px 0; }

.pv-rate-choice {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px dashed #d2ded9;
}

.pv-rate-choice b { font: 750 .81rem/1.2 "IBM Plex Mono", monospace; }

.pv-rate-choice button,
.pt-actions button {
  min-height: 32px;
  padding: 6px 9px;
  color: var(--pt-green-dark);
  background: #fff;
  border: 1px solid #afcbc0;
  border-radius: 8px;
  cursor: pointer;
  font: 700 .65rem/1.2 Poppins, Arial, sans-serif;
}

.pv-rate-choice button:hover,
.pt-actions button:hover { background: var(--pt-mint); border-color: #7fad9c; }
.pv-context { color: var(--pt-muted); font-size: .7rem; }

.pt-calc-panel,
.pb-result-panel { background: linear-gradient(145deg, #fff, #f8faf8); }

.pt-selected {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 14px 15px;
  color: #dcebe7;
  background: var(--pt-ink);
  border-radius: 11px;
  box-shadow: inset 4px 0 0 var(--pt-gold);
}

.pt-selected b { color: #fff; font-size: .8rem; }
.pt-selected span,
.pt-selected a { color: #bdd5cf; font-size: .68rem; }
.pt-selected a { margin-top: 2px; text-decoration: underline; text-underline-offset: 2px; }

.pt-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 17px 0;
  padding: 13px;
  color: #514922;
  background: #fff9e8;
  border: 1px solid #dccb8f;
  border-radius: 10px;
  font-size: .74rem;
  line-height: 1.5;
}

.pt-confirm input { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 2px; accent-color: var(--pt-green); }

.pt-result {
  position: relative;
  padding: 19px;
  color: #fff;
  background: linear-gradient(135deg, var(--pt-green), var(--pt-green-dark));
  border-radius: 13px;
  overflow: hidden;
}

.pt-result::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -38px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
}

.pt-result span,
.pt-result small { position: relative; z-index: 1; display: block; color: #c4e3d8; font-size: .68rem; }

.pt-result strong {
  position: relative;
  z-index: 1;
  display: block;
  margin: 5px 0;
  color: #fff;
  font: 750 clamp(1.55rem, 3vw, 2.25rem)/1.1 "IBM Plex Mono", monospace;
  letter-spacing: -.03em;
}

.pt-result p { position: relative; z-index: 1; margin: 4px 0; color: #eef8f4; font-size: .75rem; }
.pt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.pt-actions a { margin-left: auto; color: var(--pt-green); font-size: .7rem; font-weight: 750; }
.pt-actions button:disabled { opacity: .46; cursor: not-allowed; }

.pb-check-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  margin-top: 15px;
  padding: 13px 17px;
  color: #fff;
  background: var(--pt-green);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 9px 22px rgba(15, 110, 88, .2);
  font: 750 .8rem/1.2 Poppins, Arial, sans-serif;
  transition: background .16s, transform .16s, box-shadow .16s;
}

.pb-check-button:hover:not(:disabled) { background: var(--pt-green-dark); transform: translateY(-1px); box-shadow: 0 12px 26px rgba(15, 110, 88, .24); }
.pb-check-button:disabled { opacity: .48; cursor: wait; box-shadow: none; }

.pb-result-empty,
.pb-result-none {
  padding: 24px;
  background: rgba(255, 255, 255, .78);
  border: 1px dashed #bfcfc9;
  border-radius: 13px;
}

.pb-result-empty { min-height: 225px; text-align: center; display: grid; align-content: center; justify-items: center; }
.pb-empty-mark { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 12px; color: var(--pt-green); background: var(--pt-mint); border-radius: 50%; font-size: 1.1rem; font-weight: 800; }
.pb-result-empty > b { color: var(--pt-ink); font-size: .94rem; }
.pb-result-empty p,
.pb-answer-head p { max-width: 50ch; margin: 7px 0 0; color: var(--pt-muted); font-size: .77rem; line-height: 1.6; }

.pb-answer-head {
  padding: 17px;
  background: #fff;
  border: 1px solid var(--pt-line);
  border-radius: 12px;
}

.pb-answer-head span { display: block; color: #697b77; font: 700 .66rem/1.2 "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.pb-answer-head strong { display: block; margin-top: 5px; color: var(--pt-ink); font: 750 1.2rem/1.3 Poppins, Arial, sans-serif; letter-spacing: -.02em; }
.pb-answer-head.is-win { background: #e9f8f2; border-color: #70bea3; }
.pb-answer-head.is-win strong { color: var(--pt-green-dark); }

.pb-win-card {
  margin-top: 12px;
  padding: 17px;
  background: #fff;
  border: 1px solid #cadbd4;
  border-radius: 13px;
  box-shadow: 0 7px 19px rgba(18, 45, 42, .055);
}

.pb-win-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.pb-win-top span { color: #856515; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.pb-win-top strong { color: var(--pt-ink); font: 800 1.38rem/1 "IBM Plex Mono", monospace; letter-spacing: .06em; }
.pb-gross { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 14px 0 9px; padding: 11px 12px; background: #edf5f1; border-radius: 9px; }
.pb-gross span { color: var(--pt-muted); font-size: .64rem; }
.pb-gross b { color: var(--pt-ink); font: 750 1rem/1.15 "IBM Plex Mono", monospace; }
.pb-tax-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 13px; }

.pb-tax-option {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  background: #fafcfb;
  border: 1px solid #d2dfda;
  border-radius: 10px;
}

.pb-tax-option.is-selected { background: #e8f8f1; border-color: var(--pt-green); box-shadow: inset 0 0 0 1px var(--pt-green); }
.pb-tax-option > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pb-tax-option span { color: #294642; font-size: .68rem; font-weight: 750; }
.pb-tax-option em { color: #856515; font-size: .61rem; font-style: normal; font-weight: 750; }
.pb-tax-option > b { color: var(--pt-ink); font-size: .77rem; }
.pb-tax-option small { color: var(--pt-muted); font-size: .61rem; }
.pb-tax-option small strong { color: var(--pt-green-dark); }
.pb-tax-option i { position: absolute; right: 8px; bottom: 8px; padding: 3px 6px; color: #fff; background: var(--pt-green); border-radius: 999px; font-size: .5rem; font-style: normal; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.pb-tax-option.is-selected small { padding-right: 68px; }
.pb-win-card p { color: #596d69; font-size: .68rem; line-height: 1.5; }
.pb-warning { padding: 10px !important; color: #65521b !important; background: #fff5dc !important; border-left: 3px solid #c58b1d; }

.pb-next {
  margin-top: 14px;
  padding: 16px;
  color: #d9e8e4;
  background: var(--pt-ink);
  border-radius: 12px;
  font-size: .73rem;
}

.pb-next b { color: #fff; }
.pb-next ol { padding-left: 20px; line-height: 1.6; }
.pb-next a { color: #8ee0c2; }
.pb-checked { margin: 13px 0; }
.pb-checked p { display: flex; flex-wrap: wrap; gap: 5px; }
.pb-checked code { padding: 5px 7px; color: #1e3c38; background: #edf3f0; border-radius: 7px; font-size: .72rem; }

.pb-modal[hidden] { display: none; }
.pb-modal { position: fixed; z-index: 99999; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(4, 25, 22, .78); backdrop-filter: blur(8px); }
.pb-modal-card { position: relative; width: min(560px, 100%); max-height: 90vh; padding: 28px; overflow: auto; background: linear-gradient(145deg, #fffdf6, #eaf8f1); border: 1px solid rgba(255, 255, 255, .35); border-radius: 20px; box-shadow: 0 30px 90px rgba(0, 0, 0, .4); }
.pb-modal-card > h3 { margin: 3px 35px 15px 0; color: var(--pt-green); font: 750 1.55rem/1.2 Poppins, Arial, sans-serif; letter-spacing: -.025em; }
.pb-modal-close { position: absolute; top: 13px; right: 15px; color: #294642; background: transparent; border: 0; cursor: pointer; font-size: 1.7rem; }
.pb-confetti { display: block; color: var(--pt-gold); letter-spacing: .45em; }
.pb-modal-action { width: 100%; margin-top: 13px; padding: 12px; color: #fff; background: var(--pt-green); border: 0; border-radius: 9px; cursor: pointer; font-weight: 750; }
.pb-modal-open { overflow: hidden; }

.calc-wrap.is-public-tool { display: block; }
.calc-wrap.is-public-tool > .calc-card { max-width: none; padding: 0; border: 0; background: transparent; box-shadow: none; }
.calc-wrap.is-public-tool > .calc-out { display: none; }
.calc-wrap.is-public-tool .calc-card > h3,
.calc-wrap.is-public-tool .calc-card > .sub,
.calc-wrap.is-public-tool .calc-card > .calc-mini-grid,
.calc-wrap.is-public-tool .calc-card > .calc-database-note,
.calc-wrap.is-public-tool .calc-card > .calc-note,
.calc-wrap.is-public-tool #calcx-stamp-slot,
.calc-wrap.is-public-tool #calcx-cliff-slot,
.calc-wrap.is-public-tool #calcx-verify-slot { display: none; }
.calc-wrap.is-public-tool #calc-fields { margin: 0; }
.calc-wrap.is-public-tool .public-tool { margin: 0; }

/* Editorial-cover consistency: all catalogue and article artwork uses the same
   5:3 frame, crop origin and card rhythm. Source SVGs are 1200×720. */
.blog-grid { align-items: stretch; }
.blog-card { height: 100%; }
.blog-card .bimg,
.blog-article-hero img {
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  object-position: 50% 50%;
  background: #122d2a;
}
.blog-card .bimg { border-bottom: 1px solid var(--line, #d6e2dd); }
.blog-card .bbody { min-height: 250px; }
.blog-card h3 {
  display: -webkit-box;
  min-height: 2.56em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.blog-card-excerpt {
  display: -webkit-box !important;
  min-height: 4.65em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.blog-card .bmeta { gap: 8px; }

@media (max-width: 900px) {
  .pt-step-grid,
  .pb-check-layout { grid-template-columns: 1fr; }
  .pt-panel + .pt-panel { border-top: 1px solid var(--pt-line); border-left: 0; }
  .pt-source-head,
  .pb-ticket-head { flex-direction: column; }
  .pt-status-badge { max-width: none; }
}

@media (max-width: 600px) {
  .public-tool { border-radius: 15px; }
  .pt-source-head,
  .pb-ticket-head,
  .pt-panel { padding: 21px 18px; }
  .pt-source-head h3,
  .pb-ticket-head h3 { font-size: 1.28rem; }
  .pt-trust-strip { grid-template-columns: 1fr; }
  .pt-trust-strip span { padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--pt-line); text-align: left; }
  .pt-trust-strip span:last-child { border-bottom: 0; }
  .pt-fields { grid-template-columns: 1fr; }
  .pt-fields .pt-wide { grid-column: auto; }
  .pt-group-title { align-items: flex-start; flex-direction: column; gap: 2px; }
  .pv-rate-choice { grid-template-columns: 1fr 1fr; }
  .pv-rate-choice b { grid-column: 1 / -1; }
  .pt-actions { align-items: stretch; }
  .pt-actions > * { width: 100%; margin-left: 0; text-align: center; }
  .pb-data-foot { flex-direction: column; gap: 7px; padding: 14px 18px; }
  .pb-win-top { align-items: flex-start; flex-direction: column; }
  .pb-tax-compare { grid-template-columns: 1fr; }
  .pb-result-empty { min-height: 190px; }
  .blog-card .bbody { min-height: 0; }
  .blog-card h3,
  .blog-card-excerpt { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pb-check-button { transition: none; }
}

@media print {
  .public-tool { box-shadow: none; }
  .pt-source-head,
  .pb-ticket-head,
  .pt-result,
  .pt-selected { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .pb-modal { display: none !important; }
}
