.calc-page {
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #dbe7ff 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #e8f0fe 0%, transparent 50%),
    #f4f6f9;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.calc-page .logo {
  height: 96px;
}

.calc-container {
  max-width: 1120px;
}

.calc-hero {
  text-align: center;
  margin: 8px 0 28px;
}

.calc-hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: #19224a;
  letter-spacing: -0.02em;
}

.calc-subtitle {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 0.95rem;
}

.calc-help-btn {
  appearance: none;
  margin-top: 16px;
  border: 1.5px solid #3b5bdb;
  background: #fff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.calc-help-btn:hover {
  background: #eff4ff;
}

.calc-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}

.calc-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calc-step {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 8px 24px rgba(25, 34, 74, 0.04);
}

.calc-step-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.calc-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #19224a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.calc-step-head h2 {
  margin: 0;
  font-size: 0.95rem;
  color: #19224a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calc-step-head p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.calc-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.calc-options--dense {
  gap: 10px;
}

.calc-chip {
  appearance: none;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #19224a;
  border-radius: 14px;
  padding: 14px 10px;
  min-height: 48px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.calc-chip:hover {
  border-color: #93a8f0;
}

.calc-chip.is-active {
  background: #f0f4ff;
  border-color: #3b5bdb;
  color: #19224a;
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.12);
}

.calc-chip:focus-visible {
  outline: 2px solid #3b5bdb;
  outline-offset: 2px;
}

.calc-custom {
  margin-top: 12px;
}

.calc-custom label {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 6px;
}

.calc-custom input {
  width: 100%;
  max-width: 220px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.calc-custom input:focus {
  outline: none;
  border-color: #3b5bdb;
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.15);
}

.calc-syringes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.calc-syringe-card {
  appearance: none;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 10px;
  min-height: 64px;
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.calc-syringe-card:hover {
  border-color: #93a8f0;
}

.calc-syringe-card.is-active {
  border-color: #3b5bdb;
  background: #f0f4ff;
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.12);
}

.calc-syringe-card strong {
  display: block;
  font-size: 1.15rem;
  color: #19224a;
}

.calc-syringe-card span {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #64748b;
}

.calc-result {
  position: sticky;
  top: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(25, 34, 74, 0.07);
}

.calc-result-title {
  margin: 0 0 16px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.calc-result-visual {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.calc-syringe-wrap {
  display: flex;
  justify-content: center;
}

.calc-syringe-svg {
  width: 88px;
  height: auto;
  max-height: 280px;
}

.calc-volume-box {
  background: linear-gradient(135deg, #1d4ed8, #3b5bdb);
  color: #fff;
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
}

.calc-volume-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.calc-volume-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  opacity: 0.85;
}

.calc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.calc-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.calc-stat-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 4px;
}

.calc-stat-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #19224a;
}

.calc-stat-value .calc-doses-pill {
  display: inline-block;
  background: #22c55e;
  color: #fff;
  border-radius: 6px;
  padding: 1px 7px;
  margin-right: 4px;
}

.calc-warning {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.8rem;
}

.calc-table-wrap {
  overflow: auto;
  max-height: 220px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 14px;
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.calc-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  text-align: left;
  padding: 8px 10px;
  color: #64748b;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #e2e8f0;
}

.calc-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.calc-table tr.is-selected td {
  background: #eff4ff;
  color: #1d4ed8;
  font-weight: 700;
}

.calc-table tr.is-selected td:first-child::before {
  content: "▸ ";
  color: #3b5bdb;
}

.calc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.calc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s, transform 0.1s;
}

.calc-btn:hover {
  opacity: 0.92;
}

.calc-btn--primary {
  background: #19224a;
  color: #fff;
}

.calc-btn--whatsapp {
  background: #22c55e;
  color: #fff;
}

.calc-btn--ghost {
  background: #fff;
  border-color: #cbd5e1;
  color: #334155;
}

.calc-disclaimer {
  margin: 14px 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #94a3b8;
  text-align: center;
}

.calc-sticky-bar {
  display: none;
}

/* Tablet e abaixo: uma coluna, resultado no final, header compacto */
@media (max-width: 1024px) {
  .calc-page .container.calc-container {
    max-width: 760px;
    padding: 16px 16px 24px;
  }

  .calc-page .global-header {
    margin-bottom: 14px;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .calc-page .logo {
    height: 64px;
  }

  .calc-page .header-actions {
    position: static !important;
    transform: none !important;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .calc-page .header-actions .btn,
  .calc-page .header-actions .btn-secondary,
  .calc-page .header .btn,
  .calc-page .header .btn-secondary {
    width: auto !important;
    min-height: 42px;
    padding: 8px 14px;
    font-size: 13px;
  }

  .calc-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
  }

  .calc-result {
    position: static;
    order: 2;
    width: 100%;
    box-sizing: border-box;
  }

  .calc-steps {
    order: 1;
    width: 100%;
  }

  .calc-step {
    width: 100%;
    box-sizing: border-box;
  }

  .calc-hero {
    margin: 4px 0 18px;
  }

  .calc-help-btn {
    width: min(100%, 360px);
    min-height: 46px;
  }

  .calc-options,
  .calc-syringes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .calc-custom input {
    max-width: none;
    min-height: 48px;
    font-size: 16px;
  }

  .calc-result-visual {
    grid-template-columns: minmax(90px, 110px) 1fr;
    align-items: start;
  }

  .calc-table-wrap {
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
  }

  .calc-page .calc-table,
  .calc-page table.calc-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
  }

  .calc-table th,
  .calc-table td {
    padding: 7px 6px;
    word-break: break-word;
  }
}

/* Celular */
@media (max-width: 640px) {
  .calc-page .container.calc-container {
    padding: 12px 12px 96px;
  }

  .calc-page .logo {
    height: 48px;
  }

  .calc-page .header-actions .btn,
  .calc-page .header-actions .btn-secondary {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .calc-hero {
    margin: 2px 0 14px;
  }

  .calc-hero h1 {
    font-size: 1.4rem;
  }

  .calc-subtitle {
    font-size: 0.85rem;
  }

  .calc-help-btn {
    width: 100%;
    max-width: none;
    min-height: 48px;
    font-size: 0.84rem;
  }

  .calc-step {
    padding: 14px 12px 12px;
    border-radius: 14px;
  }

  .calc-step-head {
    gap: 10px;
    margin-bottom: 12px;
  }

  .calc-step-num {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .calc-step-head h2 {
    font-size: 0.8rem;
  }

  .calc-step-head p {
    font-size: 0.74rem;
  }

  .calc-options,
  .calc-syringes {
    gap: 8px;
  }

  .calc-chip,
  .calc-syringe-card {
    min-height: 48px;
    min-width: 0;
    padding: 10px 4px;
    font-size: 0.8rem;
    border-radius: 12px;
  }

  .calc-syringe-card {
    min-height: 58px;
  }

  .calc-syringe-card strong {
    font-size: 0.95rem;
  }

  .calc-syringe-card span {
    font-size: 0.68rem;
  }

  .calc-result {
    padding: 14px 12px;
    border-radius: 16px;
  }

  .calc-result-title {
    margin-bottom: 12px;
  }

  .calc-result-visual {
    grid-template-columns: 76px 1fr;
    gap: 10px;
  }

  .calc-syringe-svg {
    width: 72px;
    max-height: 220px;
  }

  .calc-volume-box {
    padding: 14px 12px;
  }

  .calc-volume-value {
    font-size: 1.05rem;
  }

  .calc-stats {
    gap: 8px;
  }

  .calc-stat {
    padding: 10px 8px;
  }

  .calc-stat-value {
    font-size: 0.82rem;
    word-break: break-word;
  }

  .calc-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .calc-btn {
    min-height: 48px;
    font-size: 0.8rem;
  }

  .calc-table {
    font-size: 0.72rem;
  }

  .calc-table th,
  .calc-table td {
    padding: 6px 4px;
    letter-spacing: 0;
  }

  .calc-table tr.is-selected td:first-child::before {
    content: "";
  }

  .calc-table tr.is-selected td:first-child {
    box-shadow: inset 3px 0 0 #3b5bdb;
    padding-left: 8px;
  }

  .calc-page .main-footer {
    padding-bottom: 88px;
  }

  .calc-sticky-bar[hidden] {
    display: none !important;
  }

  .calc-sticky-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #19224a;
    color: #fff;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.25);
  }

  .calc-sticky-label {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.8;
  }

  .calc-sticky-bar strong {
    font-size: 1.1rem;
  }

  .calc-sticky-link {
    flex-shrink: 0;
    color: #fff;
    background: #3b5bdb;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 12px 14px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .calc-modal {
    padding: 10px;
    align-items: flex-end;
  }

  .calc-modal-card {
    width: 100%;
    max-height: 92vh;
    padding: 18px 14px 16px;
    border-radius: 16px 16px 8px 8px;
  }
}

/* Celulares estreitos */
@media (max-width: 400px) {
  .calc-options,
  .calc-syringes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-result-visual {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .calc-result-main {
    width: 100%;
  }

  .calc-actions {
    grid-template-columns: 1fr;
  }
}

.calc-modal[hidden] {
  display: none !important;
}

.calc-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.calc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.calc-modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  padding: 22px 20px 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.calc-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  appearance: none;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.calc-modal-card h2 {
  margin: 0 32px 10px 0;
  font-size: 1.15rem;
  color: #19224a;
}

.calc-modal-text {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #475569;
}

.calc-modal-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

body.calc-modal-open {
  overflow: hidden;
}

@media print {
  .global-header,
  .header-actions,
  .footer,
  .calc-actions,
  .calc-disclaimer,
  .calc-help-btn,
  .calc-modal {
    display: none !important;
  }

  .calc-page {
    background: #fff;
  }

  .calc-layout {
    grid-template-columns: 1fr;
  }

  .calc-result {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
