/* ==========================================================================
   Ovile Lab (/ferramentas/) — Shared Design System & Tool Workspace Styles
   Tokens:
   - Primary ink: #051c2c / #0f172a
   - Neutral text: #58585e
   - Brand forest: #123f39 / #1b524a
   - Brand lime: #cce561 / #bcd94a
   ========================================================================== */

.lab-page {
  --lab-ink: #051c2c;
  --lab-text: #0f172a;
  --lab-muted: #58585e;
  --lab-forest: #123f39;
  --lab-forest-hover: #1b524a;
  --lab-lime: #cce561;
  --lab-lime-hover: #bcd94a;
  --lab-surface: #f8f9fa;
  --lab-card-bg: #f3f3f3;
  --lab-border: #e5e7eb;
  --lab-white: #ffffff;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--lab-text);
  background: var(--lab-white);
  -webkit-font-smoothing: antialiased;
}

.lab-page main {
  padding-top: 88px;
}

.lab-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lab-page [hidden] {
  display: none !important;
}

/* Highlight "Lab" item in the fixed header on all /ferramentas/ routes */
body.lab-page .nav a[data-nav="lab"] {
  color: var(--lab-forest);
  font-weight: 700;
}

/* ==========================================
   Hub Hero (/ferramentas/)
   ========================================== */
.lab-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(56px, 7vw, 96px) 20px clamp(64px, 8vw, 104px);
  background: var(--lab-forest);
  color: var(--lab-white);
  text-align: center;
}

.lab-hero::before,
.lab-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.lab-hero::before {
  top: -260px;
  left: -140px;
  width: 520px;
  height: 520px;
  background: var(--lab-forest-hover);
  opacity: 0.55;
}

.lab-hero::after {
  right: -200px;
  bottom: -360px;
  width: 620px;
  height: 620px;
  background: var(--lab-lime);
  opacity: 0.08;
}

.lab-hero-inner {
  width: min(100%, 920px);
  margin-inline: auto;
}

.lab-hero h1 {
  max-width: 22ch;
  margin: 0 auto 18px;
  color: var(--lab-white);
  font-size: clamp(32px, 4.4vw, 54px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.lab-hero-sub {
  max-width: 58ch;
  margin: 0 auto clamp(28px, 4vw, 40px);
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.55;
}

.lab-search {
  display: flex;
  gap: 12px;
  max-width: 660px;
  margin: 0 auto;
}

.lab-search input {
  flex: 1;
  min-width: 0;
  height: 58px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--lab-white);
  color: var(--lab-ink);
  font: inherit;
  font-size: 16.5px;
  outline: none;
}

.lab-search input::placeholder {
  color: var(--lab-muted);
}

.lab-search input:focus-visible {
  box-shadow: 0 0 0 3px var(--lab-lime);
}

.lab-search button {
  flex: none;
  height: 58px;
  padding: 0 30px;
  border: 0;
  border-radius: 999px;
  background: var(--lab-lime);
  color: var(--lab-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.lab-search button:hover {
  background: var(--lab-lime-hover);
}

/* ==========================================
   Category Tabs (/ferramentas/)
   ========================================== */
.lab-tabs {
  background: var(--lab-white);
  border-bottom: 1px solid var(--lab-border);
}

.lab-tabs-inner {
  display: flex;
  gap: 6px;
  width: min(100% - 40px, 1140px);
  margin-inline: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.lab-tabs-inner::-webkit-scrollbar {
  display: none;
}

.lab-tab {
  position: relative;
  flex: none;
  padding: 20px 18px;
  border: 0;
  background: none;
  color: var(--lab-muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.lab-tab:hover,
.lab-tab[aria-selected="true"] {
  color: var(--lab-forest);
}

.lab-tab[aria-selected="true"] {
  font-weight: 600;
}

.lab-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2.5px;
  background: var(--lab-forest);
}

/* ==========================================
   Hub Featured Spotlight & Grid
   ========================================== */
.lab-container {
  width: min(100% - 40px, 1140px);
  margin-inline: auto;
}

.lab-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding: clamp(24px, 3vw, 38px);
  margin: clamp(40px, 5vw, 72px) auto 0;
  border: 1px solid var(--lab-border);
  border-radius: 20px;
  background: var(--lab-white);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lab-featured:hover {
  border-color: #cbd5d1;
  box-shadow: 0 18px 40px -24px rgba(5, 28, 44, 0.2);
}

.lab-featured[hidden],
.lab-card[hidden],
.lab-empty[hidden] {
  display: none;
}

.lab-featured-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.lab-badge-lime {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--lab-lime);
  color: var(--lab-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lab-featured h2 {
  margin: 0;
  color: var(--lab-ink);
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.lab-featured p {
  margin: 0;
  color: var(--lab-muted);
  font-size: 16.5px;
  line-height: 1.6;
}

.lab-featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--lab-ink);
  color: var(--lab-white);
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.lab-featured:hover .lab-featured-cta {
  background: var(--lab-forest);
}

.lab-featured-media {
  overflow: hidden;
  border-radius: 14px;
  background: var(--lab-card-bg);
}

.lab-featured-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 3;
}

.lab-section {
  margin: clamp(52px, 6vw, 84px) auto 0;
}

.lab-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(24px, 3vw, 36px);
}

.lab-section-head h2 {
  margin: 0 0 8px;
  color: var(--lab-ink);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lab-section-head p {
  margin: 0;
  color: var(--lab-muted);
  font-size: 16.5px;
  line-height: 1.5;
}

.lab-count-pill {
  flex: none;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--lab-card-bg);
  color: var(--lab-muted);
  font-size: 13.5px;
  font-weight: 600;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 24px;
}

.lab-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--lab-border);
  border-radius: 18px;
  background: var(--lab-white);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.lab-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5d1;
  box-shadow: 0 14px 32px -22px rgba(5, 28, 44, 0.25);
}

.lab-card-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 3;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--lab-card-bg);
}

.lab-card-meta {
  margin: 0 0 10px;
  color: var(--lab-forest);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lab-card h3 {
  margin: 0 0 10px;
  color: var(--lab-ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.lab-card:hover h3 {
  color: var(--lab-forest);
}

.lab-card-text {
  margin: 0 0 18px;
  color: var(--lab-muted);
  font-size: 15.5px;
  line-height: 1.58;
  flex: 1;
}

.lab-card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lab-ink);
  font-size: 14.5px;
  font-weight: 600;
}

.lab-card:hover .lab-card-action {
  color: var(--lab-forest);
}

.lab-empty {
  padding: 40px 24px;
  border: 1px dashed var(--lab-border);
  border-radius: 16px;
  background: var(--lab-surface);
  text-align: center;
}

.lab-empty p {
  margin: 0 0 16px;
  color: var(--lab-muted);
  font-size: 16.5px;
}

.lab-bottom-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(32px, 4vw, 52px) 24px;
  margin: clamp(56px, 7vw, 92px) auto clamp(56px, 7vw, 88px);
  border-radius: 20px;
  background: var(--lab-card-bg);
  text-align: center;
}

.lab-bottom-cta h2 {
  margin: 0;
  max-width: 28ch;
  color: var(--lab-ink);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lab-bottom-cta p {
  margin: 0 0 6px;
  max-width: 54ch;
  color: var(--lab-muted);
  font-size: 16px;
  line-height: 1.55;
}

.lab-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ==========================================
   Individual Tool Hero & Workspace
   ========================================== */
.tool-hero {
  padding: clamp(34px, 4vw, 52px) 20px clamp(28px, 3.5vw, 42px);
  border-bottom: 1px solid var(--lab-border);
  background: var(--lab-surface);
}

.tool-hero-inner {
  width: min(100%, 1140px);
  margin-inline: auto;
}

.tool-back-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tool-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lab-forest);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.tool-back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tool-hero h1 {
  margin: 8px 0 10px;
  color: var(--lab-ink);
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  max-width: 28ch;
}

.tool-hero-sub {
  margin: 0;
  max-width: 68ch;
  color: var(--lab-muted);
  font-size: 16.5px;
  line-height: 1.55;
}

.tool-workspace-section {
  padding: clamp(32px, 4vw, 48px) 20px 0;
}

.tool-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px;
  align-items: start;
  width: min(100%, 1140px);
  margin-inline: auto;
}

.tool-panel,
.tool-output {
  padding: clamp(22px, 2.8vw, 30px);
  border: 1px solid var(--lab-border);
  border-radius: 18px;
  background: var(--lab-white);
}

.tool-output {
  position: sticky;
  top: 104px;
  background: var(--lab-surface);
}

.tool-panel-title {
  margin: 0 0 6px;
  color: var(--lab-ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tool-panel-sub {
  margin: 0 0 22px;
  color: var(--lab-muted);
  font-size: 14.5px;
  line-height: 1.5;
}

/* Form Controls */
.tool-field {
  margin-bottom: 18px;
}

.tool-field:last-child {
  margin-bottom: 0;
}

.tool-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.tool-label {
  display: block;
  margin-bottom: 7px;
  color: var(--lab-ink);
  font-size: 14.5px;
  font-weight: 600;
}

.tool-label-row .tool-label {
  margin-bottom: 0;
}

.tool-hint {
  color: var(--lab-muted);
  font-size: 13px;
}

.tool-input-row {
  display: flex;
  gap: 10px;
}

.tool-input,
.tool-select,
.tool-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: var(--lab-white);
  color: var(--lab-ink);
  font: inherit;
  font-size: 15.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-input,
.tool-select {
  height: 46px;
  padding: 0 14px;
}

.tool-select-cc {
  flex: 0 0 124px;
}

.tool-textarea {
  padding: 12px 14px;
  resize: vertical;
  min-height: 92px;
  line-height: 1.5;
}

.tool-input:focus,
.tool-select:focus,
.tool-textarea:focus {
  outline: none;
  border-color: var(--lab-forest);
  box-shadow: 0 0 0 3px rgba(18, 63, 57, 0.14);
}

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tool-chip {
  padding: 6px 13px;
  border: 1px solid var(--lab-border);
  border-radius: 999px;
  background: var(--lab-surface);
  color: var(--lab-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tool-chip:hover,
.tool-chip.is-active {
  border-color: var(--lab-forest);
  background: #eaf3f0;
  color: var(--lab-forest);
}

.tool-segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--lab-border);
  border-radius: 12px;
  background: var(--lab-surface);
  gap: 4px;
}

.tool-segmented button {
  padding: 8px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--lab-muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tool-segmented button[aria-pressed="true"] {
  background: var(--lab-forest);
  color: var(--lab-white);
}

/* Action Buttons */
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tool-btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.tool-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tool-btn-primary {
  background: var(--lab-ink);
  color: var(--lab-white);
}

.tool-btn-primary:hover:not(:disabled) {
  background: var(--lab-forest);
}

.tool-btn-forest {
  background: var(--lab-forest);
  color: var(--lab-white);
}

.tool-btn-forest:hover:not(:disabled) {
  background: var(--lab-forest-hover);
}

.tool-btn-lime {
  background: var(--lab-lime);
  color: var(--lab-ink);
}

.tool-btn-lime:hover:not(:disabled) {
  background: var(--lab-lime-hover);
}

.tool-btn-outline {
  border-color: var(--lab-border);
  background: var(--lab-white);
  color: var(--lab-ink);
}

.tool-btn-outline:hover:not(:disabled) {
  border-color: var(--lab-forest);
  color: var(--lab-forest);
}

.tool-feedback {
  margin: 10px 0 0;
  min-height: 20px;
  color: var(--lab-forest);
  font-size: 13.5px;
  font-weight: 600;
}

.tool-feedback.is-warn {
  color: #9a3412;
}

/* ==========================================
   Tool 1: Link + QR + Placa de Balcao
   ========================================== */
.wa-url-box {
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--lab-border);
  border-radius: 12px;
  background: var(--lab-white);
  color: var(--lab-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-all;
}

.tool-divider {
  height: 1px;
  margin: 22px 0;
  background: var(--lab-border);
  border: 0;
}

.tool-output-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tool-output-tabs button {
  flex: 1;
  height: 40px;
  border: 1px solid var(--lab-border);
  border-radius: 10px;
  background: var(--lab-white);
  color: var(--lab-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tool-output-tabs button[aria-selected="true"] {
  border-color: var(--lab-forest);
  background: var(--lab-forest);
  color: var(--lab-white);
}

.qr-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--lab-border);
  border-radius: 16px;
  background: var(--lab-white);
  text-align: center;
}

.qr-svg-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 240px);
  aspect-ratio: 1 / 1;
  padding: 10px;
  border-radius: 12px;
  background: var(--lab-white);
}

.qr-svg-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 240px);
  aspect-ratio: 1 / 1;
  padding: 20px;
  border: 2px dashed #cbd5d1;
  border-radius: 14px;
  background: var(--lab-surface);
  color: var(--lab-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.qr-placeholder i,
.qr-placeholder svg {
  width: 34px;
  height: 34px;
  font-size: 32px;
  color: var(--lab-forest);
}

/* Placa de Balcao live preview */
.sign-preview-card {
  width: min(100%, 340px);
  margin: 0 auto 16px;
  overflow: hidden;
  border: 1px solid var(--lab-border);
  border-radius: 16px;
  background: var(--lab-white);
  box-shadow: 0 14px 32px -20px rgba(5, 28, 44, 0.28);
  text-align: center;
}

.sign-preview-head {
  padding: 16px 18px 14px;
  background: var(--lab-forest);
  color: var(--lab-white);
}

.sign-preview-badge {
  display: inline-block;
  padding: 3px 10px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--lab-lime);
  color: var(--lab-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sign-preview-company {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--lab-white);
}

.sign-preview-body {
  padding: 18px 18px 14px;
}

.sign-preview-headline {
  margin: 0 0 6px;
  color: var(--lab-ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

.sign-preview-sub {
  margin: 0 0 14px;
  color: var(--lab-muted);
  font-size: 13px;
  line-height: 1.4;
}

.sign-preview-qr {
  width: 176px;
  height: 176px;
  margin: 0 auto 12px;
  padding: 10px;
  border: 2px solid var(--lab-forest);
  border-radius: 14px;
  background: var(--lab-white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sign-preview-qr svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sign-preview-phone {
  margin: 0 0 10px;
  color: var(--lab-ink);
  font-size: 15px;
  font-weight: 700;
}

.sign-preview-foot {
  padding: 9px 14px;
  border-top: 1px solid var(--lab-border);
  background: var(--lab-surface);
  color: var(--lab-muted);
  font-size: 11px;
}

.sign-preview-card[hidden],
.qr-stage[hidden] {
  display: none;
}

/* Dedicated hidden printable sheet rendered cleanly only under @media print */
.sign-print-sheet {
  display: none;
}

/* ==========================================
   Tool 2: Calculadora API Oficial (R$)
   ========================================== */
.calc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.calc-row {
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--lab-border);
  border-radius: 14px;
  background: var(--lab-surface);
}

.calc-row:last-child {
  margin-bottom: 0;
}

.calc-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.calc-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--lab-ink);
  font-size: 15.5px;
  font-weight: 600;
}

.calc-free-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lab-lime);
  color: var(--lab-ink);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.calc-rate-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lab-white);
  border: 1px solid var(--lab-border);
  color: var(--lab-muted);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.calc-row-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 14px;
  align-items: center;
}

.calc-range {
  width: 100%;
  accent-color: var(--lab-forest);
  cursor: pointer;
}

.calc-num-input {
  height: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.calc-row-desc {
  margin: 8px 0 0;
  color: var(--lab-muted);
  font-size: 13px;
  line-height: 1.45;
}

.calc-total-card {
  padding: 24px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: var(--lab-forest);
  color: var(--lab-white);
}

.calc-total-kicker {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calc-total-value {
  margin: 0 0 12px;
  color: var(--lab-lime);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.calc-submetrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.calc-submetric-label {
  display: block;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12.5px;
}

.calc-submetric-val {
  display: block;
  margin-top: 2px;
  color: var(--lab-white);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.calc-breakdown {
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--lab-border);
  border-radius: 14px;
  background: var(--lab-white);
}

.calc-breakdown h3 {
  margin: 0 0 14px;
  color: var(--lab-ink);
  font-size: 15px;
  font-weight: 600;
}

.calc-bar-item {
  margin-bottom: 12px;
}

.calc-bar-item:last-child {
  margin-bottom: 0;
}

.calc-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 13.5px;
  color: var(--lab-ink);
}

.calc-bar-head span:last-child {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.calc-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--lab-card-bg);
  overflow: hidden;
}

.calc-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--lab-forest);
  transition: width 0.2s ease;
}

.calc-bar-fill.is-lime {
  background: var(--lab-lime);
}

.calc-note {
  margin: 12px 0 0;
  color: var(--lab-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ==========================================
   Tool 3: Diagnostico de WhatsApp
   ========================================== */
.diag-progress-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.diag-progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--lab-card-bg);
  overflow: hidden;
}

.diag-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--lab-forest);
  transition: width 0.2s ease;
}

.diag-progress-text {
  color: var(--lab-muted);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.diag-question {
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--lab-border);
  border-radius: 14px;
  background: var(--lab-surface);
}

.diag-question:last-child {
  margin-bottom: 0;
}

.diag-question-title {
  margin: 0 0 12px;
  color: var(--lab-ink);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
}

.diag-options {
  display: grid;
  gap: 8px;
}

.diag-option {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--lab-border);
  border-radius: 10px;
  background: var(--lab-white);
  color: var(--lab-ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.diag-option:hover {
  border-color: var(--lab-forest);
}

.diag-option[aria-pressed="true"] {
  border-color: var(--lab-forest);
  background: #eaf3f0;
  color: var(--lab-forest);
  font-weight: 600;
}

.diag-score-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  margin-bottom: 18px;
  border: 1px solid var(--lab-border);
  border-radius: 16px;
  background: var(--lab-white);
}

.diag-gauge {
  position: relative;
  width: 104px;
  height: 104px;
  flex: none;
}

.diag-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.diag-gauge-num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--lab-ink);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.diag-gauge-num small {
  margin-top: 3px;
  color: var(--lab-muted);
  font-size: 11px;
  font-weight: 600;
}

.diag-risk-pill {
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.diag-risk-pill.is-pending {
  background: var(--lab-card-bg);
  color: var(--lab-muted);
}

.diag-risk-pill.is-high {
  background: #fee2e2;
  color: #991b1b;
}

.diag-risk-pill.is-medium {
  background: #fef3c7;
  color: #92400e;
}

.diag-risk-pill.is-good {
  background: var(--lab-lime);
  color: var(--lab-ink);
}

.diag-score-summary h3 {
  margin: 0 0 4px;
  color: var(--lab-ink);
  font-size: 18px;
  font-weight: 600;
}

.diag-score-summary p {
  margin: 0;
  color: var(--lab-muted);
  font-size: 14px;
  line-height: 1.45;
}

.diag-pillars,
.diag-recs {
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--lab-border);
  border-radius: 14px;
  background: var(--lab-white);
}

.diag-pillars h3,
.diag-recs h3 {
  margin: 0 0 12px;
  color: var(--lab-ink);
  font-size: 15px;
  font-weight: 600;
}

.diag-rec-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.diag-rec-item {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--lab-surface);
  border-left: 3px solid var(--lab-forest);
}

.diag-rec-item strong {
  display: block;
  margin-bottom: 3px;
  color: var(--lab-ink);
  font-size: 14px;
}

.diag-rec-item span {
  display: block;
  color: var(--lab-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

/* ==========================================
   Contextual CTA, FAQ & Related
   ========================================== */
.tool-bridge-section {
  padding: clamp(28px, 4vw, 42px) 20px 0;
}

.tool-bridge-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(100%, 1140px);
  margin-inline: auto;
  padding: clamp(22px, 3vw, 32px);
  border-radius: 18px;
  background: var(--lab-forest);
  color: var(--lab-white);
}

.tool-bridge-copy h2 {
  margin: 0 0 6px;
  color: var(--lab-white);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  line-height: 1.25;
}

.tool-bridge-copy p {
  margin: 0;
  max-width: 60ch;
  color: rgba(255, 255, 255, 0.84);
  font-size: 15px;
  line-height: 1.5;
}

.tool-bridge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-btn-bridge-ghost {
  border-color: rgba(255, 255, 255, 0.28);
  background: transparent;
  color: var(--lab-white);
}

.tool-btn-bridge-ghost:hover {
  border-color: var(--lab-white);
  background: rgba(255, 255, 255, 0.08);
  color: var(--lab-white);
}

.tool-content-section {
  padding: clamp(44px, 5vw, 68px) 20px clamp(56px, 6vw, 84px);
}

.tool-content-inner {
  width: min(100%, 1140px);
  margin-inline: auto;
}

.tool-tips-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: clamp(44px, 5vw, 64px);
}

.tool-tip-card {
  padding: 22px;
  border: 1px solid var(--lab-border);
  border-radius: 16px;
  background: var(--lab-surface);
}

.tool-tip-card h3 {
  margin: 0 0 8px;
  color: var(--lab-ink);
  font-size: 17px;
  font-weight: 600;
}

.tool-tip-card p {
  margin: 0;
  color: var(--lab-muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.tool-faq-title,
.tool-related-title {
  margin: 0 0 20px;
  color: var(--lab-ink);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.tool-faq-list {
  border-top: 1px solid rgba(5, 28, 44, 0.16);
  margin-top: 20px;
  margin-bottom: clamp(44px, 5vw, 64px);
}

.tool-faq-item {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(5, 28, 44, 0.16);
  background: transparent;
}

.tool-faq-item summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--lab-ink);
  font-size: clamp(18px, 1.4vw, 21px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.tool-faq-item summary::-webkit-details-marker {
  display: none;
}

.tool-faq-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--lab-ink);
  font-size: 18px;
  line-height: 1;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-faq-item[open] .tool-faq-icon {
  transform: rotate(180deg);
}

.tool-faq-body {
  max-width: 68ch;
  margin: -4px 48px 24px 0;
  padding: 0;
  color: var(--lab-muted);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.55;
}

.tool-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.tool-related-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--lab-border);
  border-radius: 16px;
  background: var(--lab-white);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.tool-related-card:hover {
  transform: translateY(-2px);
  border-color: var(--lab-forest);
}

.tool-related-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 3;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--lab-card-bg);
}

.tool-related-tag {
  margin: 0 0 6px;
  color: var(--lab-forest);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tool-related-card h3 {
  margin: 0 0 6px;
  color: var(--lab-ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.tool-related-card p {
  margin: 0;
  color: var(--lab-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 960px) {
  .lab-featured,
  .tool-workspace {
    grid-template-columns: 1fr;
  }

  .tool-output {
    position: static;
  }

  .lab-grid,
  .tool-tips-grid,
  .tool-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .lab-search {
    flex-direction: column;
  }

  .lab-search input,
  .lab-search button {
    width: 100%;
    height: 50px;
  }

  .lab-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .lab-grid,
  .tool-tips-grid,
  .tool-related-grid,
  .calc-row-controls,
  .calc-submetrics {
    grid-template-columns: 1fr;
  }

  .tool-input-row {
    flex-direction: column;
  }

  .tool-faq-body {
    margin-right: 0;
  }

  .tool-select-cc {
    flex: none;
    width: 100%;
  }

  .diag-score-card {
    flex-direction: column;
    text-align: center;
  }
}

/* ==========================================
   Print Styles (Placa de Balcao A5 / A4)
   ========================================== */
@media print {
  @page {
    margin: 12mm;
  }

  body.is-printing-sign > :not(#printableSignSheet) {
    display: none !important;
  }

  body.is-printing-sign {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.is-printing-sign #printableSignSheet {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 138mm;
    min-height: 194mm;
    margin: 0 auto;
    border: 1.5px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    text-align: center;
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  body.is-printing-sign #printableSignSheet.is-a4 {
    width: 180mm;
    min-height: 258mm;
  }

  .sign-print-head {
    width: 100%;
    padding: 14mm 10mm 10mm;
    background: #123f39 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sign-print-badge {
    display: inline-block;
    padding: 4px 14px;
    margin-bottom: 8px;
    border-radius: 999px;
    background: #cce561 !important;
    color: #051c2c !important;
    font-size: 12pt;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .sign-print-company {
    margin: 0;
    font-size: 17pt;
    font-weight: 700;
    color: #ffffff;
  }

  .sign-print-body {
    padding: 10mm 12mm;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6mm;
  }

  .sign-print-headline {
    margin: 0;
    color: #051c2c;
    font-size: 24pt;
    font-weight: 700;
    line-height: 1.15;
  }

  .sign-print-sub {
    margin: 0;
    max-width: 110mm;
    color: #58585e;
    font-size: 13pt;
    line-height: 1.4;
  }

  .sign-print-qr {
    width: 82mm;
    height: 82mm;
    padding: 5mm;
    border: 2.5px solid #123f39;
    border-radius: 14px;
    background: #ffffff;
  }

  .sign-print-qr svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  .sign-print-phone {
    margin: 0;
    color: #051c2c;
    font-size: 17pt;
    font-weight: 700;
  }

  .sign-print-foot {
    width: 100%;
    padding: 6mm 10mm;
    border-top: 1px solid #e5e7eb;
    background: #f8f9fa !important;
    color: #58585e;
    font-size: 10.5pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
